@igamingcareer/igaming-components 1.1.17 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7734,7 +7734,7 @@
|
|
|
7734
7734
|
hover:border-gray-300 hover:bg-white
|
|
7735
7735
|
focus:outline-none focus:ring-2 focus:ring-yellow-400 focus:border-yellow-400 focus:bg-white
|
|
7736
7736
|
${r}
|
|
7737
|
-
`,children:s.map(i=>e.jsx("option",{value:i,children:i},i))}),e.jsx("span",{className:"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M2 4l4 4 4-4"})})})]}),e.jsx("span",{className:"text-xs text-gray-400 hidden lg:inline-block select-none",children:"/ page"})]}),mI=({viewMode:t,onToggleViewMode:a,selectedItemsPerPage:s,onItemsPerPageChange:n,totalCount:r,startIndex:i,endIndex:l,title:c})=>e.jsx("div",{className:"lg:block hidden bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:c}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:i}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:l})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:r})," articles"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx(H7,{viewMode:t,onToggle:a}),e.jsx(NC,{value:s,onChange:n})]})]})}),kD=({title:t,description:a,ctaText:s,ctaLink:n,bgColor:r="bg-yellow-50",textColor:i="text-yellow-800"})=>e.jsx("div",{className:`promo-card ${r} p-4 rounded-lg shadow-sm hidden md:block`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:`font-bold text-lg ${i}`,children:t}),e.jsx("p",{className:`text-sm mt-1 ${i} opacity-90`,children:a})]}),e.jsx("a",{href:n,className:"bg-white text-yellow-600 hover:bg-yellow-50 px-4 py-2 rounded-md text-sm font-medium shadow-sm transition-colors",children:s})]})}),vD=({items:t,cardType:a,viewMode:s,savedJobs:n,onSaveJob:r,onViewJob:i,onApplyJob:l,firstItemRef:c=null,userAccess:h})=>{const[d,u]=p.useState([]),[y,x]=p.useState(null);p.useEffect(()=>{try{if(!Array.isArray(t)){console.error("❌ Items is not an array:",t),x("Invalid data format received"),u([]);return}const g=[...t];t.length>5&&g.splice(5,0,{id:"promo-1",title:"Promo",isPromo:!0}),u(g),x(null)}catch(g){console.error("Error processing items:",g),x(`Error processing items: ${g instanceof Error?g.message:String(g)}`),u([])}},[t]);const m=(g,f)=>{const v=f===0&&!g.isPromo?{ref:c}:{};try{if(g.isPromo)return e.jsx("div",{className:"col-span-full my-4",children:e.jsx(kD,{title:"Upgrade Your Job Search",description:"Get personalized job recommendations and stand out to employers.",ctaText:"Learn More",ctaLink:"#premium-features",bgColor:"bg-yellow-50",textColor:"text-yellow-800"})},`promo-${f}`);if(!g||typeof g!="object")return console.error("❌ Invalid item detected:",g),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Invalid Job Data"}),e.jsx("p",{className:"text-red-600 text-sm",children:"The job data is in an unexpected format."})]});const N=g.id?`${g._id}-${f}`:g.slug?`${g.slug}-${f}`:`item-${f}`;switch(a){case"job":return e.jsx("div",{...v,children:e.jsx(wC,{job:g,positionInList:f,onSaveJob:M=>r(M,f),onViewJob:(M,b,C)=>i(M,f,C),onApplyJob:l?(M,b,C)=>l(M,f,C):void 0,isSaved:n.includes(g.id||g.slug||g.link),userAccess:h})},N);default:return console.warn(`⚠️ Unknown cardType: ${a}`),e.jsxs("div",{className:"error-card bg-yellow-50 p-4 rounded-md border border-yellow-200",children:[e.jsx("p",{className:"text-yellow-800 font-medium",children:"Unknown Card Type"}),e.jsx("p",{className:"text-yellow-700 text-sm",children:"The specified card type is not supported."})]})}}catch(N){return console.error("Error rendering card:",N),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Error Rendering Card"}),e.jsx("p",{className:"text-red-600 text-sm",children:N instanceof Error?N.message:String(N)})]})}};return y?e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Error Loading Items"}),e.jsx("p",{children:y})]}):d.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("h3",{children:"No items found matching your criteria"}),e.jsx("p",{children:"Try adjusting your filters or search term"})]}):e.jsx("div",{className:s==="grid"?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4":"flex flex-col gap-4","data-view-mode":s,children:d.map((g,f)=>m(g,f))})},V7=({currentPage:t,totalPages:a,onPageChange:s})=>{if(a<=1)return null;const n=5,r=Math.max(1,t-Math.floor(n/2)),i=Math.min(a,r+n-1),l=[];for(let c=r;c<=i;c++)l.push(c);return e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs("nav",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>s(Math.max(1,t-1)),disabled:t===1,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Cs,{})}),l.map(c=>e.jsx("button",{onClick:()=>s(c),className:`px-3 py-2 text-sm font-medium rounded-md ${t===c?"bg-yellow-600 text-white":"text-gray-700 bg-white border border-gray-300 hover:bg-gray-50"}`,children:c},c)),e.jsx("button",{onClick:()=>s(Math.min(a,t+1)),disabled:t===a,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Ss,{})})]})})},bD=({jobs:t,onViewJob:a})=>!t||t.length===0?null:e.jsxs("div",{className:"last-visited-jobs mt-8 bg-white rounded-lg shadow p-4",children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Recently Viewed Jobs"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:t.map((s,n)=>e.jsxs("div",{className:"p-3 border rounded-md hover:shadow-md transition-shadow cursor-pointer",onClick:()=>a(s,n,"same_tab","last_visited"),children:[e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsx("img",{src:s.logo||"/placeholder.svg?height=30&width=30",alt:`${s.company} logo`,className:"w-6 h-6 mr-2"}),e.jsx("h3",{className:"font-medium text-sm truncate",children:s.title})]}),e.jsx("p",{className:"text-xs text-gray-600 truncate",children:s.company}),e.jsx("p",{className:"text-xs text-gray-500 truncate",children:s.location})]},s._id||s.slug||s.link))})]}),wD=(t,a,s="date")=>{if(a==="all")return t;const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate());return t.filter(i=>{const l=i[s]||i.created_at||i.published_at||i.scraped_at;if(!l)return!1;const c=new Date(l);switch(a){case"today":return c>=r;case"this_week":{const h=new Date(n);return h.setDate(n.getDate()-n.getDay()),h.setHours(0,0,0,0),c>=h}case"this_month":{const h=new Date(n.getFullYear(),n.getMonth(),1);return c>=h}case"last_30_days":{const h=new Date(n);return h.setDate(n.getDate()-30),c>=h}case"last_90_days":{const h=new Date(n);return h.setDate(n.getDate()-90),c>=h}default:return!0}})},jD=(t,a)=>t.filter(s=>{var n,r,i,l,c;if(a.jobTypes.length>0){const h=((n=s.department)==null?void 0:n.toLowerCase())||"";if(!a.jobTypes.some(d=>h.includes(d)))return!1}if(a.experienceLevels.length>0){const h=((r=s.title)==null?void 0:r.toLowerCase())||"";if(!a.experienceLevels.some(d=>!!(d==="senior"&&h.includes("senior")||d==="mid"&&(h.includes("mid")||h.includes("mid-level"))||d==="entry"&&(h.includes("junior")||h.includes("entry")))))return!1}return!(a.country&&!(((i=s.location)==null?void 0:i.toLowerCase())||((l=s.city)==null?void 0:l.toLowerCase())||"").includes(a.country.toLowerCase())||a.city&&!(((c=s.company_type)==null?void 0:c.toLowerCase())||"").includes(a.city.toLowerCase()))}),Lc=(t,a)=>{const s={};for(const n of t)for(const r of a){s[r]||(s[r]=new Set);const i=n[r];Array.isArray(i)?i.forEach(l=>{typeof l=="string"&&l.trim()&&s[r].add(l.trim())}):typeof i=="string"&&i.trim()&&s[r].add(i.trim())}return Object.fromEntries(Object.entries(s).map(([n,r])=>[n,Array.from(r)]))},pI=t=>{const a=new URLSearchParams(window.location.search);t==="all"?a.delete("date_filter"):a.set("date_filter",t);const s=`${window.location.pathname}?${a.toString()}`;window.history.replaceState({},"",s)},Go=(t,a,s,n,r="date")=>{let i=t.filter(l=>Object.entries(a).every(([c,h])=>{const d=l[c];return typeof d=="string"?d.toLowerCase()===h.toLowerCase():Array.isArray(d)?d.some(u=>typeof u=="string"&&u.toLowerCase()===h.toLowerCase()):!1}));return s.length>0&&(i=i.filter(l=>s.every(c=>{var h,d;return((h=l.title)==null?void 0:h.toLowerCase().includes(c.toLowerCase()))||((d=l.overview)==null?void 0:d.toLowerCase().includes(c.toLowerCase()))}))),i=wD(i,n,r),i},Kc=(t,a,s=[],n="date")=>{const r=h=>{const d=h[n]||h.created_at||h.published_at||h.scraped_at;return d?new Date(d).getTime():0},i=h=>{var u;const d=h.views??h.viewCount??((u=h.metrics)==null?void 0:u.views)??0;return typeof d=="number"?d:0},l=h=>{if(s.length===0)return 0;const d=(h.title??"").toLowerCase(),u=(h.overview??"").toLowerCase();return s.reduce((y,x)=>{const m=x.toLowerCase();let g=y;return d.includes(m)&&(g+=3),u.includes(m)&&(g+=1),g},0)},c=[...t];return c.sort((h,d)=>{switch(a){case"date_asc":return r(h)-r(d);case"views_desc":return i(d)-i(h);case"views_asc":return i(h)-i(d);case"relevance":{const u=l(d)-l(h);return u!==0?u:r(d)-r(h)}case"title_asc":{const u=(h.title??"").localeCompare(d.title??"",void 0,{sensitivity:"base"});return u!==0?u:r(d)-r(h)}case"date_desc":default:return r(d)-r(h)}}),c},yI=({dateFieldLabel:t,activeDateFilter:a,onDateFilterChange:s,filterKeys:n,searchableFilters:r,filtersData:i,activeFilters:l,handleFilterChange:c,toggleSavedJobsFilter:h,showOnlySaved:d,savedJobs:u})=>e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Filters"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:t}),e.jsx(cI,{activeDateFilter:a,onDateFilterChange:s,dateFieldLabel:""})]}),n.map(y=>{var x;return e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:y.replace(/_/g," ").replace(/^\w/,m=>m.toUpperCase())}),r.includes(y)?e.jsx(O7,{options:i[y]||[],value:l[y]||"",onChange:m=>c(y,m),placeholder:`Select ${y.replace(/_/g," ")}`,className:"w-full"}):e.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-yellow--500 focus:border-yellow--500 bg-white",value:l[y]||"",onChange:m=>c(y,m.target.value),children:[e.jsxs("option",{value:"",children:["Select ",y.replace(/_/g," ")]}),(x=i[y])==null?void 0:x.map(m=>e.jsx("option",{value:m,children:m},m))]})]},y)}),e.jsx("div",{className:"mt-6",children:e.jsxs("button",{onClick:h,className:`w-full px-4 py-2 rounded-lg flex items-center justify-center ${d?"bg-yellow-100 text-indigo-800":"bg-gray-100 text-gray-800 hover:bg-gray-200"}`,children:[e.jsx(Et,{size:16,className:"mr-2"}),e.jsxs("span",{children:["Saved Jobs (",u.length,")"]})]})})]})}),st=Ct.Root,xI=Ct.Trigger,MD=Ct.Portal,gI=ie.forwardRef(({className:t,...a},s)=>e.jsx(Ct.Overlay,{ref:s,className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a}));gI.displayName=Ct.Overlay.displayName;const Xe=ie.forwardRef(({className:t,children:a,...s},n)=>e.jsxs(MD,{children:[e.jsx(gI,{}),e.jsxs(Ct.Content,{ref:n,className:oe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s,children:[a,e.jsxs(Ct.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(Hc.Cross2Icon,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xe.displayName=Ct.Content.displayName;const Oe=({className:t,...a})=>e.jsx("div",{className:oe("flex flex-col space-y-1.5 text-center sm:text-left",t),...a});Oe.displayName="DialogHeader";const at=({className:t,...a})=>e.jsx("div",{className:oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});at.displayName="DialogFooter";const Le=ie.forwardRef(({className:t,...a},s)=>e.jsx(Ct.Title,{ref:s,className:oe("text-lg font-semibold leading-none tracking-tight",t),...a}));Le.displayName=Ct.Title.displayName;const it=ie.forwardRef(({className:t,...a},s)=>e.jsx(Ct.Description,{ref:s,className:oe("text-sm text-muted-foreground",t),...a}));it.displayName=Ct.Description.displayName;const ND=_7("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),B=ie.forwardRef(({className:t,...a},s)=>e.jsx(tS.Root,{ref:s,className:oe(ND(),t),...a}));B.displayName=tS.Root.displayName;const CD=1,SD=1e6;let iN=0;function LD(){return iN=(iN+1)%Number.MAX_SAFE_INTEGER,iN.toString()}const oN=new Map,l9=t=>{if(oN.has(t))return;const a=setTimeout(()=>{oN.delete(t),k7({type:"REMOVE_TOAST",toastId:t})},SD);oN.set(t,a)},ID=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,CD)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(s=>s.id===a.toast.id?{...s,...a.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=a;return s?l9(s):t.toasts.forEach(n=>{l9(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===s||s===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(s=>s.id!==a.toastId)}}},AD=[];let lN={toasts:[]};function k7(t){lN=ID(lN,t),AD.forEach(a=>{a(lN)})}function c9({...t}){const a=LD(),s=r=>k7({type:"UPDATE_TOAST",toast:{...r,id:a}}),n=()=>k7({type:"DISMISS_TOAST",toastId:a});return k7({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:r=>{r||n()}}}),{id:a,dismiss:n,update:s}}const PD=new Set([200,201,202,204]);function TD(t){return t===400?"BAD_REQUEST":t===401?"UNAUTHORIZED":t===403?"FORBIDDEN":t===404?"NOT_FOUND":t===409?"CONFLICT":t===429?"RATE_LIMITED":t>=500?"SERVER":"UNKNOWN"}function RD(t){if(t.friendly)return t.friendly;switch(t.code){case"TIMEOUT":return"The request took too long. Please try again.";case"NETWORK":return"You appear to be offline or the server can’t be reached.";case"RATE_LIMITED":return"Too many requests. Please wait a moment and try again.";case"SERVER":return"The server had an issue. Please try again shortly.";case"CONFLICT":return"This email may already be subscribed.";case"BAD_REQUEST":return"Please check your input and try again.";case"UNAUTHORIZED":return"Please sign in to continue.";default:return"Something went wrong. Please try again."}}async function DD(t,a){const{timeoutMs:s=12e3,...n}=a??{},r=new AbortController,i=setTimeout(()=>r.abort(),s);try{const l=await fetch(t,{...n,signal:r.signal});if(PD.has(l.status)){if(l.status===204)return{ok:!0,data:void 0};const u=await l.text();return{ok:!0,data:u?JSON.parse(u):void 0}}let c=null;try{c=await l.json()}catch{}return{ok:!1,error:{code:TD(l.status),status:l.status,message:(c==null?void 0:c.message)||`${l.status} ${l.statusText}`,details:c}}}catch(l){const c=(l==null?void 0:l.name)==="AbortError";return{ok:!1,error:{code:c?"TIMEOUT":"NETWORK",message:c?"Request aborted by timeout":(l==null?void 0:l.message)||"Network error"}}}finally{clearTimeout(i)}}function _D({open:t,onOpenChange:a,onSubscriptionSuccess:s,searchQuery:n,filters:r,apiUrl:i="http://localhost:5147"}){const[l,c]=p.useState(""),[h,d]=p.useState(!1),[u,y]=p.useState(null),x=async m=>{if(m.preventDefault(),y(null),!l||!l.includes("@")){y("Please enter a valid email address.");return}d(!0);try{const g=await DD(`${i}/api/leads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,source:"filters_modal",utmCampaign:"jobs_filters",utmMedium:"ui",utmSource:"subscription_modal"}),timeoutMs:1e4});if(!g.ok){y(RD(g.error)),c9({title:"Subscription failed",description:g.error.message});return}localStorage.setItem("leadId",g.data.id),localStorage.setItem("email",l),c9({title:"You're subscribed",description:`We'll notify you at ${l} when new jobs match your criteria.`}),s==null||s(),c("")}finally{d(!1)}};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{className:"sm:max-w-md",children:[e.jsxs(Oe,{children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx(Ba,{className:"h-5 w-5 text-orange-500"}),"Create Job Alert"]}),e.jsx(it,{children:"Subscribe to get notified when new jobs matching your search criteria are posted."})]}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"email",children:"Email address"}),e.jsxs("div",{className:"relative",children:[e.jsx(ca,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{id:"email",type:"email",placeholder:"Enter your email address",value:l,onChange:m=>c(m.target.value),className:"pl-10",required:!0,"aria-invalid":!!u,"aria-describedby":u?"email-error":void 0})]}),u&&e.jsx("p",{id:"email-error",role:"alert",className:"text-sm text-red-600",children:u})]}),n&&e.jsxs("div",{className:"rounded-lg bg-muted p-3 text-sm",children:[e.jsx("p",{className:"font-medium",children:"Alert criteria:"}),e.jsxs("p",{className:"text-muted-foreground",children:['"',n,'"']})]}),e.jsxs(at,{className:"gap-2 sm:gap-0",children:[e.jsx(P,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:h,children:"Cancel"}),e.jsx(P,{type:"submit",disabled:h,children:h?"Creating Alert...":"Create Alert"})]})]})]})})}function fI(){const t="savedJobs",[a,s]=p.useState([]);return p.useEffect(()=>{try{const i=localStorage.getItem(t);i&&s(JSON.parse(i))}catch(i){console.error("Failed to load saved jobs:",i)}},[]),{savedJobs:a,toggleJob:i=>{s(l=>{const h=l.includes(i)?l.filter(d=>d!==i):[...l,i];try{localStorage.setItem(t,JSON.stringify(h))}catch(d){console.error("Failed to persist saved jobs:",d)}return h})},isSaved:i=>i?a.includes(i):!1}}const zD=({value:t,options:a,onChange:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Order by"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{"aria-label":"Order results",value:t,onChange:n=>s(n.target.value),className:"block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 pr-9 text-sm text-gray-700 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-100",children:a.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),e.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400",children:"▼"})]})]}),qD=6,cN={jobTypes:[],experienceLevels:[],country:"",city:"",location:"",minSalary:"",maxSalary:"",industry:""},FD=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,banner:n,enableMobileFilter:r=!0,cardType:i,dateField:l="created_at",dateFieldLabel:c="Published",searchableFilters:h=["companies"],notification_url:d="http://localhost:5147",userAccess:u,onEmitEvent:y,eventContext:x,onPopularTagClick:m,onPopularTagRemove:g,allowPopularTagRemoval:f=!1})=>{var RC;const[k,v]=p.useState([]),[N,M]=p.useState([]),[b,C]=p.useState([]),[S,L]=p.useState(1),[w,j]=p.useState({}),[I,T]=p.useState([]),[A,R]=p.useState({}),[D,q]=p.useState(""),[E,F]=p.useState([]),[G,Z]=p.useState(!1),[$,Q]=p.useState(a),[te,K]=p.useState("grid"),[ee,ce]=p.useState(!1),[fe,de]=p.useState([]),[se,H]=p.useState(!0),[z,_]=p.useState(null),[V,J]=p.useState("all"),[pe,ke]=p.useState(!1),[Be,is]=p.useState(!1),[Bt,he]=p.useState({...cN}),[_e,_t]=p.useState({open:!1,type:"info",message:""}),[pt,sa]=p.useState("date_desc"),{savedJobs:fa,toggleJob:Sn}=fI(),Lt=B7(u),ot=p.useMemo(()=>({component:"Listing",...x??{}}),[x]),$s=p.useMemo(()=>[{value:"relevance",label:"Best match (relevance)"},{value:"date_desc",label:`${c} (newest)`},{value:"date_asc",label:`${c} (oldest)`},{value:"views_desc",label:"Most viewed"},{value:"views_asc",label:"Least viewed"},{value:"title_asc",label:"Title A → Z"}],[c]),lt=p.useCallback((X,ue)=>{y&&y({domain:"jobs",name:X,payload:ue,timestamp:new Date().toISOString(),context:ot})},[ot,y]),Ya=p.useCallback((X,ue)=>{y&&y({domain:"newsletter",name:X,payload:ue,timestamp:new Date().toISOString(),context:ot})},[ot,y]),_a=p.useCallback(async X=>{Ya("newsletter_subscribe_requested",X)},[Ya]),ka=p.useCallback(()=>({filters:{...w},advancedFilters:Bt,dateFilter:V}),[w,V,Bt]),os=p.useCallback(()=>({page:S,pageSize:$,totalResults:N.length,viewMode:te,showOnlySaved:ee}),[S,N.length,$,ee,te]),va=p.useRef(!1),Ja=(X,ue)=>{_t({open:!0,type:X,message:ue})};p.useEffect(()=>{try{const X=localStorage.getItem("lastVisitedJobs");X&&de(JSON.parse(X));try{localStorage.getItem("email")&&is(!0)}catch(ue){console.error("Error checking subscription state:",ue)}}catch(X){console.error("Error loading data from localStorage:",X)}},[]),p.useEffect(()=>{const ue=new URLSearchParams(window.location.search).get("date_filter");ue&&ue!=="all"&&J(ue)},[]),p.useEffect(()=>{if(!t){_("❌ Missing API URL for Listing component!"),H(!1);return}H(!0),_(null),(async()=>{try{const ue=await fetch(t);if(!ue.ok)throw new Error(`API responded with status: ${ue.status}`);const we=await ue.json();if(!Array.isArray(we))throw new Error("Expected an array but received: "+typeof we);const De=we.map((Yt,Ka)=>({...Yt,sponsored:Ka%7===0,topTag:uI(Yt.title||"")})),xt=Array.from(new Set(De.map(Yt=>Yt.topTag).filter(Yt=>typeof Yt=="string"))).slice(0,10);C(xt);const wa=Kc(De,pt,I,l);v(De),M(wa);const ls=Lc(De,s);R(ls)}catch(ue){console.error("Error fetching data:",ue),_(`Failed to load data: ${ue instanceof Error?ue.message:String(ue)}`);const we=yD(20),De=Kc(we,pt,I,l);v(we),M(De);const xt=Lc(we,s);R(xt)}finally{H(!1)}})()},[t,l,I,pt]),p.useEffect(()=>{const X=new URLSearchParams(window.location.search),ue={};s.forEach(xt=>{const wa=X.get(xt);wa&&(ue[xt]=wa)}),j(ue);const we=X.get("q")||X.get("searchTerm")||"";we&&q(we);const De={};s.forEach(xt=>{const wa=X.get(xt);wa&&(De[xt]=wa)}),j(De)},[]),p.useEffect(()=>{if(ee){const X=k.filter(we=>fa.includes(we.id||we.slug||we.link)),ue=Kc(X,pt,I,l);M(ue),L(1)}else ra()},[]),p.useEffect(()=>{va.current||se||!N.length&&!k.length||(lt("jobs_listing_viewed",{...ka(),...os()}),va.current=!0)},[k.length,lt,N.length,ka,os,se]);const na=p.useCallback(X=>{const ue=Lc(X,s);R(ue)},[s]),ra=p.useCallback(X=>{const ue=(X==null?void 0:X.baseItems)??k,we=(X==null?void 0:X.filters)??w,De=(X==null?void 0:X.search)??I,xt=(X==null?void 0:X.dateFilter)??V,wa=(X==null?void 0:X.advanced)??Bt;let ls=Go(ue,we,De,xt,l);ls=jD(ls,wa);const Yt=Kc(ls,pt,De,l);return M(Yt),((X==null?void 0:X.resetPage)??!0)&&L(1),((X==null?void 0:X.refreshFiltersData)??!0)&&na(Yt),Yt},[V,w,Bt,k,l,I,pt,na]);p.useEffect(()=>{ra({resetPage:!1,refreshFiltersData:!1})},[pt,ra]);const ge=(X,ue)=>{const we={...w};ue?we[X]=ue:delete we[X],ee&&ce(!1),j(we),ra({filters:we});const De={...ka(),filters:we};ue?lt("jobs_filter_selected",{key:X,value:ue,...De}):lt("jobs_filter_cleared",{key:X,...De})},Ie=()=>{is(!0),be().then(()=>ke(!1))},Te=p.useRef(null),ze=X=>{L(X),lt("jobs_listing_page_changed",{page:X,pageSize:$,totalResults:N.length}),setTimeout(()=>{var ue;(ue=Te.current)==null||ue.scrollIntoView({behavior:"smooth",block:"start"})},100)},Ne=X=>{ee&&ce(!1),J(X),ra({dateFilter:X}),pI(X),lt("jobs_date_filter_changed",{dateFilter:X})},Qe=X=>{if(q(X),X){const ue=k.map(we=>we.title).filter((we,De,xt)=>we&&we.toLowerCase().includes(X.toLowerCase())&&xt.indexOf(we)===De).slice(0,5);F(ue)}else F([])},dt=X=>{if(!X.trim())return;ee&&ce(!1);const ue=[...I,X.trim()];T(ue),ra({search:ue}),q(""),lt("jobs_search_submitted",{searchKeywords:ue,query:X.trim(),...ka()})},ye=X=>{const ue=I.filter(we=>we!==X);T(ue),ra({search:ue}),lt("jobs_search_filter_removed",{removedKeyword:X,remainingKeywords:ue})},Y=()=>{j({}),T([]),ce(!1),J("all"),he({...cN}),ra({filters:{},search:[],dateFilter:"all",advanced:cN}),lt("jobs_filters_cleared_all",{})},le=X=>{const ue=new Set,we=[];for(const De of X){const xt=`${De.key??""}|${De.value.toLowerCase()}`;ue.has(xt)||(ue.add(xt),we.push(De))}return we},xe=X=>X.replace(/\/+$/,""),be=async()=>{if(lt("jobs_alert_cta_clicked",{searchKeywords:I,query:D.trim()||void 0,...ka()}),!Be)ke(!0),lt("jobs_subscription_modal_opened",{});else{const X=localStorage.getItem("email"),ue=localStorage.getItem("leadId");if(!X||!ue){Ja("info","Please subscribe first to create alerts.");return}const we="keyword",De=(ja,cs)=>cs&&cs.trim()?{key:ja.toLowerCase(),value:cs.trim()}:null,xt=Object.entries(w).map(([ja,cs])=>De(ja,cs)).filter(ja=>ja!==null),wa=I.map(ja=>De(we,ja)).filter(ja=>ja!==null),ls=De(we,D),Yt=ls?[ls]:[],Ka=le([...xt,...wa,...Yt]);if(Ka.length===0){Ja("info","No filters/keywords to save.");return}try{const ja=xe(d??"http://localhost:5147"),cs=await fetch(`${ja}/api/leads/${ue}/preferences/bulk`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ka)});if(!cs.ok){let Wc="";try{Wc=await cs.text()}catch{}throw new Error(`${cs.status} ${cs.statusText} ${Wc}`.trim())}Ja("success","Alert saved. We’ll notify you about new matching jobs."),q(""),lt("jobs_alert_created",{preferences:Ka.filter(Wc=>Wc!==null)})}catch(ja){console.error("Create alert failed:",ja),Ja("error","Failed to save alert.")}}},Re=()=>{Z(!G)},Ft=N.length===0?0:(S-1)*$+1,$e=Math.min(S*$,N.length),yt=X=>{Q(X),L(1),lt("jobs_listing_items_per_page_changed",{pageSize:X})},Ul=()=>{K(X=>{const ue=X==="grid"?"list":"grid";return lt("jobs_listing_viewmode_changed",{viewMode:ue}),ue})},It=(X,ue,we="same_tab",De="listing")=>{const xt=X.id||X.slug||X.link;xt&&(de(wa=>{const ls=wa.filter(Ka=>(Ka.id||Ka.slug||Ka.link)!==xt),Yt=[X,...ls].slice(0,qD);try{localStorage.setItem("lastVisitedJobs",JSON.stringify(Yt))}catch(Ka){console.error("Error saving to localStorage:",Ka)}return Yt}),lt("job_opened",{jobId:xt,slug:X.slug,positionInList:ue,openedFrom:De,openedIn:we}))},ba=(X,ue)=>{const we=X.id||X.slug||X.link;if(!we)return;const De=fa.includes(we);Sn(we),lt(De?"job_unsaved":"job_saved",{jobId:we,slug:X.slug,positionInList:ue})},G7=(X,ue,we="external")=>{const De=X.id||X.slug||X.link;De&<("job_apply_clicked",{jobId:De,slug:X.slug,positionInList:ue,applyType:we})},TC=()=>{ce(!ee)},PA=Math.ceil(N.length/$),TA=N.slice((S-1)*$,S*$);return z&&!k.length?e.jsx("div",{className:"flex-grow p-8",children:e.jsx("div",{className:"max-w-7xl mx-auto",children:e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Error Loading Jobs"}),e.jsx("p",{className:"mb-4",children:z}),e.jsx("button",{onClick:()=>window.location.reload(),className:"bg-red-100 hover:bg-red-200 text-red-800 font-medium py-2 px-4 rounded",children:"Retry"})]})})}):e.jsxs("div",{className:"flex flex-col min-h-screen pb-16 md:pb-0",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx(jC,{onSearchChange:Qe,searchPlaceholder:"Search jobs, companies, or keywords...",title:"Job Listings",description:"",popularTags:b,generateHref:X=>`/jobs?q=${X.toLowerCase().replace(/\s+/g,"+")}`,onTagClick:m,onTagRemove:g,allowTagRemoval:f}),e.jsxs("div",{className:"container mx-auto py-8 pb-20 md:pb-8",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:[e.jsx(hI,{data:k.map(X=>X.title).filter(Boolean),onSelect:X=>{dt(X)},onTyping:X=>{q(X),Qe(X)},placeholder:"Search for jobs, companies, or keywords...",className:"w-full",showSubmitButton:!0}),e.jsx("button",{className:"block md:hidden flex items-center justify-center p-3 bg-white border-2 border-gray-200 text-gray-700 rounded-xl hover:border-gray-300 hover:bg-gray-50 transition-all duration-200 focus:ring-4 focus:ring-gray-200 focus:outline-none hover:scale-105",onClick:Re,children:e.jsx(hn,{size:16,className:"mr-1.5"})})]}),e.jsx("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:e.jsx(MC,{filters:[...V!=="all"?[{key:"date",label:c,value:V.replace(/_/g," "),onRemove:()=>Ne("all")}]:[],...I.map(X=>({key:"search",label:"",value:X,onRemove:()=>ye(X)})),...Object.entries(w).map(([X,ue])=>({key:X,label:X.replace(/_/g," "),value:ue,onRemove:()=>ge(X,"")}))],onClearAll:Y,handleCreateAlert:be})})]}),r&&e.jsxs("button",{className:"md:hidden w-full mb-6 px-4 py-3 bg-yellow-600 text-white rounded-lg flex items-center justify-center",onClick:Re,"aria-expanded":G,children:[e.jsx(hn,{className:"w-4 h-4 mr-2"}),G?"Close Filters":"Filters"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:gap-6",children:[e.jsx(yI,{dateFieldLabel:"Date",activeDateFilter:V,onDateFilterChange:Ne,filterKeys:s,searchableFilters:h,filtersData:A,activeFilters:w,handleFilterChange:ge,toggleSavedJobsFilter:TC,showOnlySaved:ee,savedJobs:fa}),se?e.jsx(Wa,{}):e.jsxs("div",{className:"lg:gap-6 w-fit",children:[e.jsx(mI,{viewMode:te,onToggleViewMode:Ul,selectedItemsPerPage:$,onItemsPerPageChange:yt,totalCount:N.length,startIndex:Ft,endIndex:$e,title:"Latest Jobs"}),e.jsxs("div",{className:"",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("h3",{className:"text-xl font-semibold text-gray-900 flex items-center",children:[ee?"Saved Jobs":"Open Positions",V!=="all"&&!ee&&e.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",V.replace(/_/g," "),")"]})]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:N.length})," found"]})]}),e.jsx(zD,{value:pt,options:$s,onChange:sa})]})}),e.jsx(vD,{items:TA,cardType:i,viewMode:te,savedJobs:fa,onSaveJob:ba,onViewJob:It,onApplyJob:G7,firstItemRef:Te,userAccess:Lt}),N.length>0&&e.jsx("div",{className:"mt-6",children:e.jsx(V7,{currentPage:S,totalPages:PA,onPageChange:ze})})]}),fe.length>0&&e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:e.jsx(bD,{jobs:fe,onViewJob:It})})]}),e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:((RC=n==null?void 0:n.sidebar)==null?void 0:RC.enabled)&&e.jsxs("div",{className:"sticky top-4",children:[e.jsx(Ol,{position:"sidebar",url:n.sidebar.url,link:n.sidebar.link,alt:n.sidebar.alt}),e.jsx(E7,{onSubscribe:_a}),e.jsxs("div",{className:"mt-6 bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((X,ue)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+ue)}`,alt:`Featured employer ${ue+1}`,className:"w-10 h-10 object-contain"})},ue))})]})]})})]})]})]}),e.jsx(dI,{activeDateFilter:V,handleDateFilterChange:Ne,filterKeys:s,searchableFilters:h,dateFieldLabel:c,activeFilters:w,handleFilterChange:ge,toggleSavedJobsFilter:TC,filtersData:A,savedJobs:fa,showOnlySaved:ee,isMobileFilterOpen:G,toggleMobileFilter:Re}),e.jsx(cl,{}),e.jsx(oI,{open:_e.open,type:_e.type,message:_e.message,onClose:()=>_t(X=>({...X,open:!1}))}),e.jsx(_D,{open:pe,onOpenChange:ke,onSubscriptionSuccess:Ie,apiUrl:d})]})},kI=ie.forwardRef(({className:t,...a},s)=>e.jsxs(Ql.Root,{ref:s,className:oe("relative flex w-full touch-none select-none items-center",t),...a,children:[e.jsx(Ql.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(Ql.Range,{className:"absolute h-full bg-primary"})}),e.jsx(Ql.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));kI.displayName=Ql.Root.displayName;const vI=({title:t="Filters",sections:a,onFilterChange:s,onClearAll:n,activeFiltersCount:r,maxVisible:i=5,rangeConfig:l,savedCount:c=0,showSavedOnly:h=!1,onToggleSavedOnly:d,savedLabel:u="Saved Items",className:y=""})=>e.jsxs("div",{className:`bg-card rounded-lg shadow-sm border border-border sticky top-24 max-h-[calc(100vh-7rem)] overflow-y-auto scrollbar-thin ${y}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ds,{className:"w-5 h-5 text-accent"}),e.jsx("h2",{className:"font-semibold text-foreground",children:t}),r>0&&e.jsx("span",{className:"bg-accent text-accent-foreground text-xs font-bold px-2 py-0.5 rounded-full",children:r})]}),r>0&&e.jsx("button",{onClick:n,className:"text-sm text-accent hover:underline",children:"Clear all"})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[a.map(x=>e.jsx(ED,{section:x,onFilterChange:s,maxVisible:i,rangeConfig:l},x.key)),d&&e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsxs("button",{onClick:d,className:`w-full px-4 py-2.5 rounded-lg flex items-center justify-center gap-2 transition-colors ${h?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[e.jsx(Et,{className:"w-4 h-4"}),e.jsxs("span",{className:"font-medium",children:[u," (",c,")"]})]})})]})]}),ED=({section:t,onFilterChange:a,maxVisible:s,rangeConfig:n})=>{var b,C,S;const[r,i]=p.useState(t.defaultExpanded??!0),[l,c]=p.useState(""),[h,d]=p.useState(!1),u=t.maxVisible??s,y=p.useMemo(()=>{var I;const L=((I=t.options)==null?void 0:I.filter(T=>T.label.toLowerCase().includes(l.toLowerCase())))||[],w=L.filter(T=>t.selectedValues.includes(T.value)),j=L.filter(T=>!t.selectedValues.includes(T.value));return[...w,...j]},[t.options,l,t.selectedValues]),x=p.useMemo(()=>h||u>=y.length?y:y.slice(0,u),[y,h,u]),m=y.length>u,g=t.searchable!==!1&&(((b=t.options)==null?void 0:b.length)||0)>6,f=L=>{const w=t.selectedValues.includes(L)?t.selectedValues.filter(j=>j!==L):[...t.selectedValues,L];a(t.key,w)},k=L=>{a(t.key,L?[L]:[])},v=t.rangeConfig??n,N=t.selectedValues.length===2?t.selectedValues.map(Number):v?[v.min,v.max]:[0,100],M=L=>{if(v!=null&&v.formatLabel)return v.formatLabel(L);const w=(v==null?void 0:v.unit)||"";return((v==null?void 0:v.unitPosition)||"prefix")==="prefix"?`${w}${L.toLocaleString()}`:`${L.toLocaleString()}${w}`};return e.jsxs("div",{className:"border-b border-border pb-4 last:border-b-0 last:pb-0",children:[t.collapsible!==!1?e.jsxs("button",{onClick:()=>i(!r),className:"flex items-center justify-between w-full py-2 text-left",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.label}),r?e.jsx(cn,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(la,{className:"w-4 h-4 text-muted-foreground"})]}):e.jsx("h3",{className:"text-sm font-medium text-foreground py-2",children:t.label}),r&&e.jsxs("div",{className:"mt-2 space-y-2",children:[g&&t.type==="checkbox"&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx(wt,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx("input",{type:"text",value:l,onChange:L=>c(L.target.value),placeholder:`Search ${t.label.toLowerCase()}...`,className:"w-full h-8 pl-8 pr-8 text-sm rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),l&&e.jsx("button",{onClick:()=>c(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(Ve,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})]}),t.type==="checkbox"&&e.jsxs("div",{className:"space-y-2",children:[x.map(L=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(L.value),onChange:()=>f(L.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground group-hover:text-accent transition-colors flex-1 truncate",children:L.label}),L.count!==void 0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",L.count,")"]})]},L.value)),y.length===0&&l&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No matching options"}),m&&!l&&e.jsx("button",{onClick:()=>d(L=>!L),className:"text-sm text-accent hover:underline font-medium mt-1",children:h?"View less":`View more (${y.length-u})`})]}),(t.type==="select"||t.type==="searchable-select")&&e.jsxs("select",{value:t.selectedValues[0]||"",onChange:L=>k(L.target.value),className:"w-full h-9 px-3 rounded-md border border-input bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:[e.jsxs("option",{value:"",children:["All ",t.label]}),(C=t.options)==null?void 0:C.map(L=>e.jsxs("option",{value:L.value,children:[L.label,L.count!==void 0&&` (${L.count})`]},L.value))]}),t.type==="range"&&v&&e.jsxs("div",{className:"space-y-3 px-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[e.jsx("span",{children:M(N[0])}),e.jsx("span",{children:M(N[1])})]}),e.jsx(kI,{min:v.min,max:v.max,step:v.step??1,value:N,onValueChange:L=>{a(t.key,L.map(String))},className:"w-full"}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:M(v.min)}),e.jsx("span",{children:M(v.max)})]})]}),t.type==="toggle"&&((S=t.options)==null?void 0:S.map(L=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(L.value),onChange:()=>f(L.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground",children:L.label})]},L.value)))]})]})},OD=({isOpen:t,onClose:a,title:s="Filters",children:n})=>t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75 z-40",onClick:a}),e.jsxs("div",{className:"fixed inset-y-0 right-0 max-w-xs w-full bg-white shadow-xl z-50 overflow-y-auto",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-200 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:s}),e.jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100","aria-label":"Close filters",children:e.jsx("svg",{className:"h-6 w-6 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"p-4",children:n})]})]}):null,bI=({sort:t,viewMode:a,onViewModeChange:s,itemsPerPage:n,onItemsPerPageChange:r,itemsPerPageOptions:i,showItemsPerPage:l=!0,trailingSlot:c,className:h="",summaryTitle:d,startIndex:u,endIndex:y,totalCount:x,itemLabel:m="items"})=>{var v;const[g,f]=p.useState(!1);p.useEffect(()=>{var b;if(typeof window>"u"||typeof window.matchMedia!="function")return;const N=window.matchMedia("(max-width: 767px)"),M=()=>f(N.matches);return M(),(b=N.addEventListener)==null||b.call(N,"change",M),()=>{var C;return(C=N.removeEventListener)==null?void 0:C.call(N,"change",M)}},[]);const k=d&&typeof x=="number"&&typeof u=="number"&&typeof y=="number";return e.jsx("div",{className:`rounded-lg border border-gray-200 bg-white p-4 ${h}`,children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row items-center lg:justify-between",children:[e.jsx("div",{className:"flex-1 min-w-0 hidden lg:inline-block",children:k&&e.jsxs("div",{className:"mb-3 hidden lg:block",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:d}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:u}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:x})," ",m]})]})}),e.jsx("div",{className:"w-full lg:w-auto",children:e.jsxs("div",{className:"flex w-full flex-nowrap items-center gap-1.5 lg:w-auto lg:flex-wrap lg:justify-end",children:[k&&e.jsxs("div",{className:"min-w-0 flex-1 truncate whitespace-nowrap text-xs text-gray-600 lg:hidden",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:u}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:x})," ",m]}),t&&((v=t.options)==null?void 0:v.length)>0&&e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-gray-500 whitespace-nowrap hidden lg:inline-block cursor-pointer select-none",children:t.label??"Order"}),e.jsx("select",{value:t.value,onChange:N=>t.onChange(N.target.value),className:"h-8 w-[7.5rem] pl-3 pr-8 rounded-lg border border-gray-200 bg-gray-50 text-xs lg:w-auto lg:text-sm focus:outline-none focus:ring-2 focus:ring-yellow-500",children:t.options.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))})]}),a&&s&&!g&&e.jsx(H7,{viewMode:a,onViewModeChange:s}),l&&n!==void 0&&r&&e.jsx(NC,{value:n,onChange:r,options:i,className:"shrink-0",selectClassName:"w-[4rem] lg:w-auto"}),c]})})]})})},wI=({value:t,onChange:a,onSubmit:s,onClear:n,onFilterClick:r,placeholder:i="Search...",suggestions:l=[],onSuggestionSelect:c,showFilterButton:h=!0,filterCount:d=0,className:u=""})=>{const[y,x]=p.useState(!1),m=g=>{g.key==="Enter"&&t.trim()&&(s(t.trim()),x(!1)),g.key==="Escape"&&x(!1)};return e.jsxs("div",{className:`relative ${u}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(wt,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),e.jsx("input",{type:"text",value:t,onChange:g=>{a(g.target.value),x(g.target.value.length>0)},onKeyDown:m,onFocus:()=>x(t.length>0&&l.length>0),onBlur:()=>setTimeout(()=>x(!1),200),placeholder:i,className:"w-full h-12 pl-10 pr-20 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"}),t&&n&&e.jsx("button",{onClick:n,"aria-label":"Clear search",className:"absolute right-14 top-1/2 -translate-y-1/2 p-1 hover:bg-muted rounded",children:e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx("button",{onClick:()=>t.trim()&&s(t.trim()),className:"absolute right-2 top-1/2 -translate-y-1/2 bg-accent hover:bg-accent-hover text-accent-foreground p-2 rounded-md transition-colors",children:e.jsx(wt,{className:"h-4 w-4"})})]}),h&&r&&e.jsxs("button",{onClick:r,className:"lg:hidden flex items-center justify-center h-12 w-12 rounded-lg border border-input bg-background hover:bg-muted transition-colors relative",children:[e.jsx(hn,{className:"h-5 w-5 text-muted-foreground"}),d>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-accent text-accent-foreground text-xs font-bold w-5 h-5 rounded-full flex items-center justify-center",children:d})]})]}),y&&l.length>0&&e.jsx("ul",{className:"absolute z-20 mt-1 w-full bg-card border border-border rounded-lg shadow-lg max-h-60 overflow-y-auto",children:l.map((g,f)=>e.jsx("li",{children:e.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-foreground hover:bg-muted flex items-center gap-2",onClick:()=>{c==null||c(g),x(!1)},children:[e.jsx(wt,{className:"h-4 w-4 text-muted-foreground"}),g]})},f))})]})},dN=({config:t,className:a=""})=>{const s=t.url.match(/\.(mp4|webm|ogg)$/i),n={sidebar:"w-full max-w-[300px] h-[250px]",top:"w-full h-[48px] md:h-[90px]",bottom:"w-full h-[48px] md:h-[90px]"};return e.jsx("div",{className:`flex justify-center items-center rounded-lg overflow-hidden bg-muted ${a}`,children:e.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"block",children:s?e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:`${n[t.position]} object-cover`,children:[e.jsx("source",{src:t.url,type:"video/mp4"}),"Your browser does not support the video tag."]}):e.jsx("img",{src:t.url,alt:t.alt??"Advertisement",className:`${n[t.position]} object-cover`})})})},Za=({title:t,description:a,headerPopularTags:s=[],sponsoredSlot:n,sidebarSlot:r,filtersPanel:i,mobileFiltersPanel:l,filters:c,filterValues:h,onFilterChange:d,onClearFilters:u,activeFilters:y,search:x,sort:m,viewMode:g,onViewModeChange:f,pagination:k,showToolbar:v=!0,toolbarTrailingSlot:N,resultsClassName:M="",banner:b,headerActions:C,children:S,maxFiltersVisible:L=5})=>{const[w,j]=p.useState(!1),[I,T]=p.useState(""),A=()=>j(!0);p.useEffect(()=>{if(typeof window>"u")return;const K=new URLSearchParams(window.location.search),ee=K.get("searchTerm")??K.get("q")??"";x&&ee&&(T(ee),x.onChange(ee),x.onSubmit&&x.onSubmit!==x.onChange&&x.onSubmit(ee)),!(!c||!d)&&c.forEach(ce=>{const fe=[...K.getAll(ce.key),...K.getAll(`filters[${ce.key}]`)],de=Array.from(new Set(fe.flatMap(se=>se.split(",")).map(se=>se.trim()).filter(Boolean)));de.length>0&&d(ce.key,de)})},[]);const R=!!(i||c&&c.length>0),D=p.useMemo(()=>c?c.map(K=>({...K,selectedValues:(h==null?void 0:h[K.key])??[]})):[],[c,h]),q=p.useMemo(()=>h?Object.values(h).reduce((K,ee)=>K+ee.length,0):y?y.length:0,[h,y]),E=(k==null?void 0:k.toolbarTotalCount)??(k==null?void 0:k.totalCount)??0,F=k&&E>0?(k.page-1)*k.pageSize+1:0,G=k&&E>0?Math.min(k.page*k.pageSize,E):0,Z=p.useMemo(()=>i||(c&&d&&u?e.jsx(vI,{sections:D,onFilterChange:d,onClearAll:u,activeFiltersCount:q,maxVisible:L}):null),[i,c,d,u,D,q]),$=l??Z,Q=p.useMemo(()=>{const K=y?[...y]:[],ee=I.trim();return ee&&!K.some(ce=>ce.key==="searchTerm"&&ce.value===ee)&&K.unshift({key:"searchTerm",label:"Search",value:ee,onRemove:()=>{T(""),x!=null&&x.onClear?x.onClear():x!=null&&x.onChange&&x.onChange("")}}),K},[y,x,I]),te=()=>{u==null||u(),T(""),x!=null&&x.onClear?x.onClear():x!=null&&x.onChange&&x.onChange("")};return e.jsxs("div",{className:"bg-gray-50",children:[e.jsx(jC,{onSearchChange:()=>{},title:t,description:a,sponsoredSlot:n,popularTags:s}),C&&e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-4 flex justify-end",children:C}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[x&&e.jsx("div",{className:"mb-4",children:e.jsx(wI,{value:x.value,onChange:x.onChange,onSubmit:K=>{const ee=K.trim();ee&&T(ee),x.onSubmit(K)},onClear:()=>{T(""),x.onClear?x.onClear():x.onChange("")},placeholder:x.placeholder,suggestions:x.suggestions,onSuggestionSelect:x.onSuggestionSelect,onFilterClick:R?A:void 0,filterCount:q,showFilterButton:R})}),v&&e.jsx(bI,{sort:m,viewMode:g,onViewModeChange:f,itemsPerPage:k==null?void 0:k.pageSize,onItemsPerPageChange:k==null?void 0:k.onPageSizeChange,itemsPerPageOptions:k==null?void 0:k.pageSizeOptions,showItemsPerPage:(k==null?void 0:k.showItemsPerPage)!==!1,trailingSlot:N,summaryTitle:(k==null?void 0:k.toolbarTitle)??t,totalCount:E,startIndex:F,endIndex:G,itemLabel:(k==null?void 0:k.toolbarItemLabel)??"items"}),Q.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(MC,{filters:Q,onClearAll:te})}),e.jsxs("div",{className:"mt-6 flex flex-col gap-6 lg:flex-row",children:[Z&&e.jsxs("aside",{className:"hidden lg:block lg:w-72 space-y-4",children:[Z,b&&b.position==="sidebar"&&e.jsx(dN,{config:b})]}),e.jsxs("div",{className:`flex-1 ${M}`,children:[b&&b.position==="top"&&e.jsx("div",{className:"mb-4",children:e.jsx(dN,{config:b})}),S,b&&b.position==="bottom"&&e.jsx("div",{className:"mt-4",children:e.jsx(dN,{config:b})}),k&&k.enabled!==!1&&e.jsx(V7,{currentPage:k.page,totalPages:k.totalPages,onPageChange:k.onPageChange})]}),r&&e.jsx("aside",{className:"lg:w-72",children:r})]})]}),$&&e.jsx(OD,{isOpen:w,onClose:()=>j(!1),children:$})]})},Ic=["categories","jobType","salaryRange","created","company","country","city","department","workplace","companySize"],BD={created_at:"created",createdAt:"created",published_at:"created",publishedAt:"created",job_type:"jobType",company_size:"companySize"},d9=t=>{const a=[];return t.forEach(s=>{const n=BD[s]??s;Ic.includes(n)&&!a.includes(n)&&a.push(n)}),a.length>0?a:[...Ic]},HD=[{value:"full-time",label:"Full-time"},{value:"part-time",label:"Part-time"},{value:"intern",label:"Intern"},{value:"seasonal",label:"Seasonal"},{value:"contract",label:"Contract"}],VD=[{value:"today",label:"Today"},{value:"this_week",label:"This week"},{value:"last_week",label:"Last week"},{value:"this_month",label:"This month"},{value:"last_3_months",label:"Last 3 months"},{value:"this_year",label:"This year"}],UD=[{value:"remote",label:"Remote"},{value:"hybrid",label:"Hybrid"},{value:"onsite",label:"On-site"}],GD=["company","country","city"],v7=(t,a)=>{if(typeof t=="string"){const s=t.trim();if(!s)return"";const n=s.match(new RegExp(`['"]${a}['"]\\s*:\\s*['"]([^'"]+)['"]`,"i"));if(n!=null&&n[1])return n[1].trim();if(s.startsWith("{")&&s.endsWith("}")){const r=s.replace(/([{,]\s*)'([^']+)'\s*:/g,'$1"$2":').replace(/:\s*'([^']*)'/g,': "$1"');try{const i=JSON.parse(r);return v7(i,a)}catch{return s}}return s}if(Array.isArray(t))return t.map(s=>v7(s,a)).find(Boolean)??"";if(t&&typeof t=="object"){const s=t,n=[a,"name","label","value","title"];for(const r of n){const i=s[r],l=v7(i,a);if(l)return l}}return""},Dl=(t,a)=>{const s=t[a];return v7(s,a)},$D=t=>{const a=Dl(t,"workplace")||Dl(t,"workplace_type");if(a)return a.toLowerCase();const s=(t.location??"").toLowerCase();return s.includes("remote")?"remote":s.includes("hybrid")?"hybrid":"onsite"},WD=(t,{optionSort:a="alphabetical",showOptionCounts:s=!0})=>{const n=t.reduce((r,i)=>{const l=i.trim();return l&&r.set(l,(r.get(l)??0)+1),r},new Map);return Array.from(n.entries()).sort(([r,i],[l,c])=>a==="count_desc"?c-i||r.localeCompare(l):a==="count_asc"&&i-c||r.localeCompare(l)).map(([r,i])=>({value:r,label:r,...s?{count:i}:{}}))},ZD=(t,a,s={})=>{const n=s.multiSelectKeys??GD;return a.map(r=>{if(r==="jobType")return{key:r,label:"Job Type",type:"checkbox",options:HD};if(r==="salaryRange"){const u=Math.max(1e5,...t.flatMap(y=>[Number(y.min_salary??0),Number(y.max_salary??0)]));return{key:r,label:"Salary Range",type:"range",rangeConfig:{min:0,max:u,step:1e3,unit:"$",unitPosition:"prefix"}}}if(r==="created")return{key:r,label:"Created",type:"checkbox",options:VD};if(r==="workplace")return{key:r,label:"Remote / Hybrid / On-site",type:"checkbox",options:UD};const i={categories:"Categories",company:"Company",country:"Country",city:"City",department:"Department",companySize:"Company Size"},l={categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"},c=WD(t.map(u=>Dl(u,l[r])),s),h=n.includes(r),d=["company","country","city"].includes(r);return{key:r,label:i[r],type:d&&!h?"searchable-select":"checkbox",searchable:r==="categories"||r==="department"||d&&h,options:c}})},YD=t=>new Date(t.created_at??t.published_at??t.scraped_at??0),JD=(t,a)=>{const s=new Date,n=YD(t);if(Number.isNaN(n.getTime()))return!1;const r=24*60*60*1e3,i=s.getTime()-n.getTime();switch(a){case"today":return n.toDateString()===s.toDateString();case"this_week":return i<=7*r;case"last_week":return i>7*r&&i<=14*r;case"this_month":return n.getMonth()===s.getMonth()&&n.getFullYear()===s.getFullYear();case"last_3_months":return i<=90*r;case"this_year":return n.getFullYear()===s.getFullYear();default:return!0}},KD=(t,a,s)=>{if(s.length===0)return!0;if(a==="salaryRange"){if(s.length<2)return!0;const[r,i]=s.map(Number),l=Number(t.min_salary??0),c=Number(t.max_salary??l);return!Number.isNaN(r)&&!Number.isNaN(i)&&c>=r&&l<=i}if(a==="created")return s.some(r=>JD(t,r));if(a==="jobType"){const r=Dl(t,"job_type")||Dl(t,"type");return s.includes(r.toLowerCase())}if(a==="workplace")return s.includes($D(t));const n={categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"};return s.includes(Dl(t,n[a]))},XD=[{value:"date_desc",label:"Newest"},{value:"date_asc",label:"Oldest"},{value:"title_asc",label:"Title (A-Z)"},{value:"company_asc",label:"Company (A-Z)"}],h9="savedJobs",QD=["vip","casino","marketing","sportsbook","compliance","money laundering","igaming","payments","crm","ai"],Xc=t=>new Date(t.created_at??t.published_at??t.scraped_at??0).getTime(),e_=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,filterOptions:n,enablePagination:r=!0,enableMobileFilter:i=!0,searchableFilters:l=["company"],filterDisplayConfig:c,banner:h,cardType:d="job",userAccess:u,onEmitEvent:y,eventContext:x,initialJobs:m})=>{var z;const[g,f]=p.useState(m??[]),[k,v]=p.useState(!m),[N,M]=p.useState(""),[b,C]=p.useState({}),[S,L]=p.useState(1),[w,j]=p.useState(a),[I,T]=p.useState("date_desc"),[A,R]=p.useState("grid"),[D,q]=p.useState([]),E=B7(u),F=p.useMemo(()=>{const _=n??s??[...Ic];return d9(_)},[s,n]),G=p.useMemo(()=>({...c,multiSelectKeys:c!=null&&c.multiSelectKeys?d9(c.multiSelectKeys):void 0}),[c]);p.useEffect(()=>{try{const _=localStorage.getItem(h9);if(_){const V=JSON.parse(_);Array.isArray(V)&&q(V.filter(J=>typeof J=="string"))}}catch(_){console.error("Failed to load saved jobs",_)}},[]),p.useEffect(()=>{try{localStorage.setItem(h9,JSON.stringify(D))}catch(_){console.error("Failed to persist saved jobs",_)}},[D]),p.useEffect(()=>{if(m)return;let _=!0;const V=async()=>{try{const J=await fetch(t);if(!J.ok)throw new Error("Could not load jobs");const pe=await J.json();_&&Array.isArray(pe)&&f(pe)}catch(J){console.error("Failed to fetch jobs",J),_&&f([])}finally{_&&v(!1)}};return v(!0),V(),()=>{_=!1}},[t,m]),p.useEffect(()=>{if(typeof window>"u")return;const _=new URLSearchParams(window.location.search),V=_.get("searchTerm")??_.get("q")??"";V&&M(V);const J={};F.forEach(pe=>{const ke=[..._.getAll(pe),..._.getAll(`filters[${pe}]`),...pe==="created"?_.getAll("created_at"):[],...pe==="created"?_.getAll("filters[created_at]"):[]].flatMap(Be=>Be.split(",")).map(Be=>Be.trim()).filter(Boolean);ke.length&&(J[pe]=Array.from(new Set(ke)))}),Object.keys(J).length>0&&C(pe=>({...pe,...J}))},[F]);const Z=p.useMemo(()=>ZD(g,F,G).map(_=>({..._,searchable:_.searchable??l.includes(_.key)})),[g,G,F,l]),$=p.useMemo(()=>{const _=N.trim().toLowerCase();return g.filter(V=>!_||`${V.title} ${V.company} ${V.location??""}`.toLowerCase().includes(_)?Object.entries(b).every(([pe,ke])=>ke.length===0||!Ic.includes(pe)?!0:KD(V,pe,ke)):!1)},[g,N,b]),Q=p.useMemo(()=>{const _=[...$];return _.sort((V,J)=>{switch(I){case"date_asc":return Xc(V)-Xc(J);case"title_asc":return(V.title??"").localeCompare(J.title??"");case"company_asc":return(V.company??"").localeCompare(J.company??"");case"date_desc":default:return Xc(J)-Xc(V)}}),_},[$,I]),te=p.useMemo(()=>{const _=(S-1)*w;return Q.slice(_,_+w)},[S,w,Q]),K=Math.max(1,Math.ceil(Q.length/w));p.useEffect(()=>{L(1)},[N,b,w]);const ee=p.useMemo(()=>{const _={categories:"Categories",jobType:"Job Type",salaryRange:"Salary Range",created:"Created",company:"Company",country:"Country",city:"City",department:"Department",workplace:"Remote / Hybrid / On-site",companySize:"Company Size"};return Object.entries(b).flatMap(([V,J])=>J.map(pe=>({key:V,value:pe,label:Ic.includes(V)?_[V]:V,onRemove:()=>{C(ke=>({...ke,[V]:(ke[V]??[]).filter(Be=>Be!==pe)}))}})))},[b]),ce=_=>{const V=String(_.id??_._id??"");V&&q(J=>J.includes(V)?J.filter(pe=>pe!==V):[...J,V])},fe=()=>{},de=p.useCallback((_,V)=>{y&&y({domain:"newsletter",name:_,payload:V,timestamp:new Date().toISOString(),context:{component:"Listing",...x??{}}})},[x,y]),se=p.useCallback(_=>{de(_.name,_.payload)},[de]),H=(z=h==null?void 0:h.sidebar)!=null&&z.enabled?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"sticky top-4 space-y-6",children:[e.jsx(Ol,{position:"sidebar",url:h.sidebar.url,link:h.sidebar.link,alt:h.sidebar.alt}),e.jsx(E7,{onEmitEvent:se,isAuthenticated:u==null?void 0:u.registered,userEmail:u==null?void 0:u.email}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((_,V)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+V)}`,alt:`Featured employer ${V+1}`,className:"w-10 h-10 object-contain"})},V))})]})]})}):void 0;return e.jsx(e.Fragment,{children:e.jsx(Za,{title:"Jobs",description:"Discover fresh opportunities across iGaming teams.",headerPopularTags:QD,search:{value:N,onChange:M,onSubmit:M,onClear:()=>M(""),placeholder:"Search jobs"},filters:Z,filterValues:b,onFilterChange:(_,V)=>C(J=>({...J,[_]:V})),onClearFilters:()=>C({}),activeFilters:ee,sort:{value:I,options:XD,onChange:T},viewMode:A,onViewModeChange:R,pagination:{enabled:r,page:S,pageSize:w,totalPages:K,totalCount:Q.length,toolbarTotalCount:Q.length,toolbarTitle:"Latest Jobs",toolbarItemLabel:"jobs",onPageChange:L,onPageSizeChange:j},sidebarSlot:H,resultsClassName:A==="grid"?"grid gap-4 sm:grid-cols-2":"space-y-4",children:k?e.jsx(Wa,{totalColumns:w}):te.length>0?te.map((_,V)=>{const J=String(_.id??_._id??"");return e.jsx(wC,{job:_,positionInList:(S-1)*w+V,onSaveJob:ce,onViewJob:fe,isSaved:!!(J&&D.includes(J)),layout:A==="grid"?"grid":"list",userAccess:E},J||`${_.title}-${V}`)}):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Ce,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jobs found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>C({}),children:"Clear all filters"})]})})})},t_=_7("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-yellow-200/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",accent:"border-transparent bg-accent/20 text-accent hover:bg-accent/30 shadow-card",gaming:"border-transparent bg-gaming-gold/20 text-gaming-gold hover:bg-gaming-gold/30 shadow-card"}},defaultVariants:{variant:"default"}});function O({className:t,variant:a,...s}){return e.jsx("div",{className:oe(t_({variant:a}),t),...s})}const a_=t=>{const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},s_=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),n_=({title:t,organizer:a,category:s,format:n,city:r,country:i,date:l,attendeeCount:c,tags:h=[],isFeatured:d=!1,isFree:u=!1,link:y})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[d&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Featured"}),u&&e.jsx(O,{className:"bg-emerald-500/10 text-emerald-600",children:"Free"}),e.jsx(O,{variant:"outline",children:s}),e.jsx(O,{variant:"secondary",children:n})]}),e.jsx("h3",{className:"mb-2 line-clamp-2 text-lg font-semibold text-foreground",children:t}),e.jsxs("p",{className:"mb-3 text-sm text-muted-foreground",children:["by ",a]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pa,{className:"h-3.5 w-3.5"}),a_(l)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"h-3.5 w-3.5"}),r,", ",i]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(qe,{className:"h-3.5 w-3.5"}),s_(c)," attendees"]})]}),h.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:h.slice(0,3).map(x=>e.jsx(O,{variant:"outline",className:"text-xs",children:x},x))}),y&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:["View Event",e.jsx(Rt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),u9=[{id:"event-1",title:"European iGaming Leadership Summit",organizer:"iGaming Career",category:"Conference",format:"In-person",country:"Malta",city:"Valletta",date:"2026-05-12",attendeeCount:1200,tags:["leadership","strategy"],isFeatured:!0,link:"https://example.com/events/leadership-summit"},{id:"event-2",title:"AML Compliance Masterclass",organizer:"Compliance Academy",category:"Workshop",format:"Online",country:"Remote",city:"Remote",date:"2026-04-04",attendeeCount:380,tags:["compliance","aml"],isFree:!0,link:"https://example.com/events/aml-masterclass"},{id:"event-3",title:"Sportsbook Product Roundtable",organizer:"Bet Product Guild",category:"Roundtable",format:"Hybrid",country:"United Kingdom",city:"London",date:"2026-06-19",attendeeCount:540,tags:["sportsbook","product"],link:"https://example.com/events/sportsbook-roundtable"},{id:"event-4",title:"Affiliate Growth Forum",organizer:"Affiliate Network EU",category:"Forum",format:"In-person",country:"Spain",city:"Barcelona",date:"2026-03-21",attendeeCount:750,tags:["affiliate","marketing"],link:"https://example.com/events/affiliate-growth-forum"},{id:"event-5",title:"Responsible Gaming Webinar",organizer:"RG Alliance",category:"Webinar",format:"Online",country:"Remote",city:"Remote",date:"2026-02-28",attendeeCount:910,tags:["responsible-gaming","policy"],isFree:!0,link:"https://example.com/events/rg-webinar"},{id:"event-6",title:"Payments and Fraud Prevention Expo",organizer:"Fintech iGaming Expo",category:"Expo",format:"In-person",country:"Cyprus",city:"Limassol",date:"2026-07-10",attendeeCount:660,tags:["payments","fraud"],isFeatured:!0,link:"https://example.com/events/payments-fraud-expo"}],vt=ie.forwardRef(({className:t,...a},s)=>e.jsx(wN.Root,{className:oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...a,ref:s,children:e.jsx(wN.Thumb,{className:oe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));vt.displayName=wN.Root.displayName;const Ye=bt.Root,Je=bt.Value,Ue=ie.forwardRef(({className:t,children:a,...s},n)=>e.jsxs(bt.Trigger,{ref:n,className:oe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...s,children:[a,e.jsx(bt.Icon,{asChild:!0,children:e.jsx(Hc.ChevronDownIcon,{className:"h-4 w-4 opacity-50"})})]}));Ue.displayName=bt.Trigger.displayName;const jI=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.ScrollUpButton,{ref:s,className:oe("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(Hc.ChevronUpIcon,{className:"h-4 w-4"})}));jI.displayName=bt.ScrollUpButton.displayName;const MI=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.ScrollDownButton,{ref:s,className:oe("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(Hc.ChevronDownIcon,{className:"h-4 w-4"})}));MI.displayName=bt.ScrollDownButton.displayName;const Ge=ie.forwardRef(({className:t,children:a,position:s="popper",...n},r)=>e.jsx(bt.Portal,{children:e.jsxs(bt.Content,{ref:r,className:oe("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...n,children:[e.jsx(jI,{}),e.jsx(bt.Viewport,{className:oe("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(MI,{})]})}));Ge.displayName=bt.Content.displayName;const r_=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.Label,{ref:s,className:oe("px-2 py-1.5 text-sm font-semibold",t),...a}));r_.displayName=bt.Label.displayName;const me=ie.forwardRef(({className:t,children:a,...s},n)=>e.jsxs(bt.Item,{ref:n,className:oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(bt.ItemIndicator,{children:e.jsx(Hc.CheckIcon,{className:"h-4 w-4"})})}),e.jsx(bt.ItemText,{children:a})]}));me.displayName=bt.Item.displayName;const i_=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.Separator,{ref:s,className:oe("-mx-1 my-1 h-px bg-muted",t),...a}));i_.displayName=bt.Separator.displayName;const o_=["C-level","B2B","Regulators","Affiliates","Tech","Operators","Providers","General"],l_=["In-person","Online","Hybrid"],c_=["Conference","Summit","Expo","Webinar","Meetup","Awards","Hackathon"],d_=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(""),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState(""),[m,g]=p.useState(""),[f,k]=p.useState(""),[v,N]=p.useState(""),[M,b]=p.useState(""),[C,S]=p.useState(""),[L,w]=p.useState([]),[j,I]=p.useState(!1),[T,A]=p.useState(!1),R=n.trim().length>=3&&i.trim().length>=2&&c&&d&&y.trim().length>=2&&m.trim().length>=2&&f&&M.trim().length>=20,D=F=>{w(G=>G.includes(F)?G.filter(Z=>Z!==F):[...G,F])},q=()=>{!R||!d||(s==null||s({title:n.trim(),organizer:i.trim(),category:c,format:d,country:y.trim(),city:m.trim(),date:f,endDate:v||void 0,description:M.trim(),link:C.trim()||void 0,audience:L,isFree:j}),A(!0))},E=()=>{r(""),l(""),h(""),u(""),x(""),g(""),k(""),N(""),b(""),S(""),w([]),I(!1),A(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:E,children:e.jsx(Xe,{className:"sm:max-w-[560px]",children:T?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Event Submitted!"}),e.jsx(it,{className:"text-center",children:"Thank you for submitting your event. It will appear on the calendar after review (usually within 24-48 hours)."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:E,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(Pa,{className:"w-6 h-6 text-accent"})}),e.jsx(Le,{children:"Submit an Event"}),e.jsx(it,{children:"Add your iGaming event to our calendar. All submissions are reviewed before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Event Name *"}),e.jsx(ae,{placeholder:"e.g. ICE London 2026",value:n,onChange:F=>r(F.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Organizer *"}),e.jsx(ae,{placeholder:"e.g. Clarion Gaming",value:i,onChange:F=>l(F.target.value),maxLength:100})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Event Type *"}),e.jsxs(Ye,{value:c,onValueChange:h,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select type"})}),e.jsx(Ge,{children:c_.map(F=>e.jsx(me,{value:F,children:F},F))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Format *"}),e.jsxs(Ye,{value:d,onValueChange:F=>u(F),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select format"})}),e.jsx(Ge,{children:l_.map(F=>e.jsx(me,{value:F,children:F},F))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Country *"}),e.jsx(ae,{placeholder:"e.g. United Kingdom",value:y,onChange:F=>x(F.target.value),maxLength:60})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"City *"}),e.jsx(ae,{placeholder:"e.g. London",value:m,onChange:F=>g(F.target.value),maxLength:60})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Start Date *"}),e.jsx(ae,{type:"date",value:f,onChange:F=>k(F.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["End Date ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ae,{type:"date",value:v,onChange:F=>N(F.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Description *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(rt,{placeholder:"Describe the event, topics covered, who should attend...",value:M,onChange:F=>b(F.target.value),rows:3,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Event Website ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ae,{type:"url",placeholder:"https://...",value:C,onChange:F=>S(F.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Target Audience ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(select all that apply)"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:o_.map(F=>e.jsx("button",{type:"button",onClick:()=>D(F),className:`px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${L.includes(F)?"bg-accent text-accent-foreground border-accent":"bg-secondary text-muted-foreground border-border hover:border-accent/50"}`,children:F},F))})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Free event"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This event is free to attend"})]}),e.jsx(vt,{checked:j,onCheckedChange:I})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:E,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:q,disabled:!R,children:"Submit Event"})]})]})})})};function Ke(t){const a=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&a==="[object Date]"?new t.constructor(+t):typeof t=="number"||a==="[object Number]"||typeof t=="string"||a==="[object String]"?new Date(t):new Date(NaN)}function wn(t,a){return t instanceof Date?new t.constructor(a):new Date(a)}const NI=6048e5,h_=864e5,Qc=43200,m9=1440;let u_={};function Uc(){return u_}function Oc(t,a){var c,h,d,u;const s=Uc(),n=(a==null?void 0:a.weekStartsOn)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??s.weekStartsOn??((u=(d=s.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,r=Ke(t),i=r.getDay(),l=(i<n?7:0)+i-n;return r.setDate(r.getDate()-l),r.setHours(0,0,0,0),r}function T7(t){return Oc(t,{weekStartsOn:1})}function CI(t){const a=Ke(t),s=a.getFullYear(),n=wn(t,0);n.setFullYear(s+1,0,4),n.setHours(0,0,0,0);const r=T7(n),i=wn(t,0);i.setFullYear(s,0,4),i.setHours(0,0,0,0);const l=T7(i);return a.getTime()>=r.getTime()?s+1:a.getTime()>=l.getTime()?s:s-1}function p9(t){const a=Ke(t);return a.setHours(0,0,0,0),a}function R7(t){const a=Ke(t),s=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return s.setUTCFullYear(a.getFullYear()),+t-+s}function m_(t,a){const s=p9(t),n=p9(a),r=+s-R7(s),i=+n-R7(n);return Math.round((r-i)/h_)}function p_(t){const a=CI(t),s=wn(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),T7(s)}function b7(t,a){const s=Ke(t),n=Ke(a),r=s.getTime()-n.getTime();return r<0?-1:r>0?1:r}function y_(t){return wn(t,Date.now())}function x_(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function g_(t){if(!x_(t)&&typeof t!="number")return!1;const a=Ke(t);return!isNaN(Number(a))}function f_(t,a){const s=Ke(t),n=Ke(a),r=s.getFullYear()-n.getFullYear(),i=s.getMonth()-n.getMonth();return r*12+i}function k_(t){return a=>{const n=(t?Math[t]:Math.trunc)(a);return n===0?0:n}}function v_(t,a){return+Ke(t)-+Ke(a)}function b_(t){const a=Ke(t);return a.setHours(23,59,59,999),a}function w_(t){const a=Ke(t),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(23,59,59,999),a}function j_(t){const a=Ke(t);return+b_(a)==+w_(a)}function M_(t,a){const s=Ke(t),n=Ke(a),r=b7(s,n),i=Math.abs(f_(s,n));let l;if(i<1)l=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*i);let c=b7(s,n)===-r;j_(Ke(t))&&i===1&&b7(t,n)===1&&(c=!1),l=r*(i-Number(c))}return l===0?0:l}function N_(t,a,s){const n=v_(t,a)/1e3;return k_(s==null?void 0:s.roundingMethod)(n)}function C_(t){const a=Ke(t),s=wn(t,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}const S_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},L_=(t,a,s)=>{let n;const r=S_[t];return typeof r=="string"?n=r:a===1?n=r.one:n=r.other.replace("{{count}}",a.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+n:n+" ago":n};function hN(t){return(a={})=>{const s=a.width?String(a.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const I_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},A_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},P_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},T_={date:hN({formats:I_,defaultWidth:"full"}),time:hN({formats:A_,defaultWidth:"full"}),dateTime:hN({formats:P_,defaultWidth:"full"})},R_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},D_=(t,a,s,n)=>R_[t];function Jl(t){return(a,s)=>{const n=s!=null&&s.context?String(s.context):"standalone";let r;if(n==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,c=s!=null&&s.width?String(s.width):l;r=t.formattingValues[c]||t.formattingValues[l]}else{const l=t.defaultWidth,c=s!=null&&s.width?String(s.width):t.defaultWidth;r=t.values[c]||t.values[l]}const i=t.argumentCallback?t.argumentCallback(a):a;return r[i]}}const __={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},z_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},q_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},F_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},E_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},O_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},B_=(t,a)=>{const s=Number(t),n=s%100;if(n>20||n<10)switch(n%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},H_={ordinalNumber:B_,era:Jl({values:__,defaultWidth:"wide"}),quarter:Jl({values:z_,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Jl({values:q_,defaultWidth:"wide"}),day:Jl({values:F_,defaultWidth:"wide"}),dayPeriod:Jl({values:E_,defaultWidth:"wide",formattingValues:O_,defaultFormattingWidth:"wide"})};function Kl(t){return(a,s={})=>{const n=s.width,r=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=a.match(r);if(!i)return null;const l=i[0],c=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],h=Array.isArray(c)?U_(c,y=>y.test(l)):V_(c,y=>y.test(l));let d;d=t.valueCallback?t.valueCallback(h):h,d=s.valueCallback?s.valueCallback(d):d;const u=a.slice(l.length);return{value:d,rest:u}}}function V_(t,a){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a(t[s]))return s}function U_(t,a){for(let s=0;s<t.length;s++)if(a(t[s]))return s}function G_(t){return(a,s={})=>{const n=a.match(t.matchPattern);if(!n)return null;const r=n[0],i=a.match(t.parsePattern);if(!i)return null;let l=t.valueCallback?t.valueCallback(i[0]):i[0];l=s.valueCallback?s.valueCallback(l):l;const c=a.slice(r.length);return{value:l,rest:c}}}const $_=/^(\d+)(th|st|nd|rd)?/i,W_=/\d+/i,Z_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Y_={any:[/^b/i,/^(a|c)/i]},J_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},K_={any:[/1/i,/2/i,/3/i,/4/i]},X_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Q_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ez={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},tz={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},az={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sz={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nz={ordinalNumber:G_({matchPattern:$_,parsePattern:W_,valueCallback:t=>parseInt(t,10)}),era:Kl({matchPatterns:Z_,defaultMatchWidth:"wide",parsePatterns:Y_,defaultParseWidth:"any"}),quarter:Kl({matchPatterns:J_,defaultMatchWidth:"wide",parsePatterns:K_,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Kl({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:Q_,defaultParseWidth:"any"}),day:Kl({matchPatterns:ez,defaultMatchWidth:"wide",parsePatterns:tz,defaultParseWidth:"any"}),dayPeriod:Kl({matchPatterns:az,defaultMatchWidth:"any",parsePatterns:sz,defaultParseWidth:"any"})},SI={code:"en-US",formatDistance:L_,formatLong:T_,formatRelative:D_,localize:H_,match:nz,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rz(t){const a=Ke(t);return m_(a,C_(a))+1}function iz(t){const a=Ke(t),s=+T7(a)-+p_(a);return Math.round(s/NI)+1}function LI(t,a){var u,y,x,m;const s=Ke(t),n=s.getFullYear(),r=Uc(),i=(a==null?void 0:a.firstWeekContainsDate)??((y=(u=a==null?void 0:a.locale)==null?void 0:u.options)==null?void 0:y.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(x=r.locale)==null?void 0:x.options)==null?void 0:m.firstWeekContainsDate)??1,l=wn(t,0);l.setFullYear(n+1,0,i),l.setHours(0,0,0,0);const c=Oc(l,a),h=wn(t,0);h.setFullYear(n,0,i),h.setHours(0,0,0,0);const d=Oc(h,a);return s.getTime()>=c.getTime()?n+1:s.getTime()>=d.getTime()?n:n-1}function oz(t,a){var c,h,d,u;const s=Uc(),n=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((u=(d=s.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,r=LI(t,a),i=wn(t,0);return i.setFullYear(r,0,n),i.setHours(0,0,0,0),Oc(i,a)}function lz(t,a){const s=Ke(t),n=+Oc(s,a)-+oz(s,a);return Math.round(n/NI)+1}function He(t,a){const s=t<0?"-":"",n=Math.abs(t).toString().padStart(a,"0");return s+n}const Js={y(t,a){const s=t.getFullYear(),n=s>0?s:1-s;return He(a==="yy"?n%100:n,a.length)},M(t,a){const s=t.getMonth();return a==="M"?String(s+1):He(s+1,2)},d(t,a){return He(t.getDate(),a.length)},a(t,a){const s=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(t,a){return He(t.getHours()%12||12,a.length)},H(t,a){return He(t.getHours(),a.length)},m(t,a){return He(t.getMinutes(),a.length)},s(t,a){return He(t.getSeconds(),a.length)},S(t,a){const s=a.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,s-3));return He(r,a.length)}},hl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},y9={G:function(t,a,s){const n=t.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});case"GGGG":default:return s.era(n,{width:"wide"})}},y:function(t,a,s){if(a==="yo"){const n=t.getFullYear(),r=n>0?n:1-n;return s.ordinalNumber(r,{unit:"year"})}return Js.y(t,a)},Y:function(t,a,s,n){const r=LI(t,n),i=r>0?r:1-r;if(a==="YY"){const l=i%100;return He(l,2)}return a==="Yo"?s.ordinalNumber(i,{unit:"year"}):He(i,a.length)},R:function(t,a){const s=CI(t);return He(s,a.length)},u:function(t,a){const s=t.getFullYear();return He(s,a.length)},Q:function(t,a,s){const n=Math.ceil((t.getMonth()+1)/3);switch(a){case"Q":return String(n);case"QQ":return He(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,a,s){const n=Math.ceil((t.getMonth()+1)/3);switch(a){case"q":return String(n);case"qq":return He(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,a,s){const n=t.getMonth();switch(a){case"M":case"MM":return Js.M(t,a);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(t,a,s){const n=t.getMonth();switch(a){case"L":return String(n+1);case"LL":return He(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(t,a,s,n){const r=lz(t,n);return a==="wo"?s.ordinalNumber(r,{unit:"week"}):He(r,a.length)},I:function(t,a,s){const n=iz(t);return a==="Io"?s.ordinalNumber(n,{unit:"week"}):He(n,a.length)},d:function(t,a,s){return a==="do"?s.ordinalNumber(t.getDate(),{unit:"date"}):Js.d(t,a)},D:function(t,a,s){const n=rz(t);return a==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):He(n,a.length)},E:function(t,a,s){const n=t.getDay();switch(a){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});case"EEEE":default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(t,a,s,n){const r=t.getDay(),i=(r-n.weekStartsOn+8)%7||7;switch(a){case"e":return String(i);case"ee":return He(i,2);case"eo":return s.ordinalNumber(i,{unit:"day"});case"eee":return s.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})}},c:function(t,a,s,n){const r=t.getDay(),i=(r-n.weekStartsOn+8)%7||7;switch(a){case"c":return String(i);case"cc":return He(i,a.length);case"co":return s.ordinalNumber(i,{unit:"day"});case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})}},i:function(t,a,s){const n=t.getDay(),r=n===0?7:n;switch(a){case"i":return String(r);case"ii":return He(r,a.length);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});case"iiii":default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(t,a,s){const r=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,a,s){const n=t.getHours();let r;switch(n===12?r=hl.noon:n===0?r=hl.midnight:r=n/12>=1?"pm":"am",a){case"b":case"bb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,a,s){const n=t.getHours();let r;switch(n>=17?r=hl.evening:n>=12?r=hl.afternoon:n>=4?r=hl.morning:r=hl.night,a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,a,s){if(a==="ho"){let n=t.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Js.h(t,a)},H:function(t,a,s){return a==="Ho"?s.ordinalNumber(t.getHours(),{unit:"hour"}):Js.H(t,a)},K:function(t,a,s){const n=t.getHours()%12;return a==="Ko"?s.ordinalNumber(n,{unit:"hour"}):He(n,a.length)},k:function(t,a,s){let n=t.getHours();return n===0&&(n=24),a==="ko"?s.ordinalNumber(n,{unit:"hour"}):He(n,a.length)},m:function(t,a,s){return a==="mo"?s.ordinalNumber(t.getMinutes(),{unit:"minute"}):Js.m(t,a)},s:function(t,a,s){return a==="so"?s.ordinalNumber(t.getSeconds(),{unit:"second"}):Js.s(t,a)},S:function(t,a){return Js.S(t,a)},X:function(t,a,s){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(a){case"X":return g9(n);case"XXXX":case"XX":return $o(n);case"XXXXX":case"XXX":default:return $o(n,":")}},x:function(t,a,s){const n=t.getTimezoneOffset();switch(a){case"x":return g9(n);case"xxxx":case"xx":return $o(n);case"xxxxx":case"xxx":default:return $o(n,":")}},O:function(t,a,s){const n=t.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+x9(n,":");case"OOOO":default:return"GMT"+$o(n,":")}},z:function(t,a,s){const n=t.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+x9(n,":");case"zzzz":default:return"GMT"+$o(n,":")}},t:function(t,a,s){const n=Math.trunc(t.getTime()/1e3);return He(n,a.length)},T:function(t,a,s){const n=t.getTime();return He(n,a.length)}};function x9(t,a=""){const s=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),i=n%60;return i===0?s+String(r):s+String(r)+a+He(i,2)}function g9(t,a){return t%60===0?(t>0?"-":"+")+He(Math.abs(t)/60,2):$o(t,a)}function $o(t,a=""){const s=t>0?"-":"+",n=Math.abs(t),r=He(Math.trunc(n/60),2),i=He(n%60,2);return s+r+a+i}const f9=(t,a)=>{switch(t){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},II=(t,a)=>{switch(t){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},cz=(t,a)=>{const s=t.match(/(P+)(p+)?/)||[],n=s[1],r=s[2];if(!r)return f9(t,a);let i;switch(n){case"P":i=a.dateTime({width:"short"});break;case"PP":i=a.dateTime({width:"medium"});break;case"PPP":i=a.dateTime({width:"long"});break;case"PPPP":default:i=a.dateTime({width:"full"});break}return i.replace("{{date}}",f9(n,a)).replace("{{time}}",II(r,a))},dz={p:II,P:cz},hz=/^D+$/,uz=/^Y+$/,mz=["D","DD","YY","YYYY"];function pz(t){return hz.test(t)}function yz(t){return uz.test(t)}function xz(t,a,s){const n=gz(t,a,s);if(console.warn(n),mz.includes(t))throw new RangeError(n)}function gz(t,a,s){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${a}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fz=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kz=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vz=/^'([^]*?)'?$/,bz=/''/g,wz=/[a-zA-Z]/;function jz(t,a,s){var u,y,x,m;const n=Uc(),r=n.locale??SI,i=n.firstWeekContainsDate??((y=(u=n.locale)==null?void 0:u.options)==null?void 0:y.firstWeekContainsDate)??1,l=n.weekStartsOn??((m=(x=n.locale)==null?void 0:x.options)==null?void 0:m.weekStartsOn)??0,c=Ke(t);if(!g_(c))throw new RangeError("Invalid time value");let h=a.match(kz).map(g=>{const f=g[0];if(f==="p"||f==="P"){const k=dz[f];return k(g,r.formatLong)}return g}).join("").match(fz).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const f=g[0];if(f==="'")return{isToken:!1,value:Mz(g)};if(y9[f])return{isToken:!0,value:g};if(f.match(wz))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:g}});r.localize.preprocessor&&(h=r.localize.preprocessor(c,h));const d={firstWeekContainsDate:i,weekStartsOn:l,locale:r};return h.map(g=>{if(!g.isToken)return g.value;const f=g.value;(yz(f)||pz(f))&&xz(f,a,String(t));const k=y9[f[0]];return k(c,f,r.localize,d)}).join("")}function Mz(t){const a=t.match(vz);return a?a[1].replace(bz,"'"):t}function Nz(t,a,s){const n=Uc(),r=(s==null?void 0:s.locale)??n.locale??SI,i=2520,l=b7(t,a);if(isNaN(l))throw new RangeError("Invalid time value");const c=Object.assign({},s,{addSuffix:s==null?void 0:s.addSuffix,comparison:l});let h,d;l>0?(h=Ke(a),d=Ke(t)):(h=Ke(t),d=Ke(a));const u=N_(d,h),y=(R7(d)-R7(h))/1e3,x=Math.round((u-y)/60);let m;if(x<2)return s!=null&&s.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,c):u<10?r.formatDistance("lessThanXSeconds",10,c):u<20?r.formatDistance("lessThanXSeconds",20,c):u<40?r.formatDistance("halfAMinute",0,c):u<60?r.formatDistance("lessThanXMinutes",1,c):r.formatDistance("xMinutes",1,c):x===0?r.formatDistance("lessThanXMinutes",1,c):r.formatDistance("xMinutes",x,c);if(x<45)return r.formatDistance("xMinutes",x,c);if(x<90)return r.formatDistance("aboutXHours",1,c);if(x<m9){const g=Math.round(x/60);return r.formatDistance("aboutXHours",g,c)}else{if(x<i)return r.formatDistance("xDays",1,c);if(x<Qc){const g=Math.round(x/m9);return r.formatDistance("xDays",g,c)}else if(x<Qc*2)return m=Math.round(x/Qc),r.formatDistance("aboutXMonths",m,c)}if(m=M_(d,h),m<12){const g=Math.round(x/Qc);return r.formatDistance("xMonths",g,c)}else{const g=m%12,f=Math.trunc(m/12);return g<3?r.formatDistance("aboutXYears",f,c):g<9?r.formatDistance("overXYears",f,c):r.formatDistance("almostXYears",f+1,c)}}function CC(t,a){return Nz(t,y_(t),a)}const Cz=t=>{const a=new Date(t);return{day:a.getDate(),month:a.toLocaleDateString("en-US",{month:"short"}).toUpperCase()}},Sz=(t,a)=>{const s=new Date(t),n={month:"short",day:"numeric"};if(!a)return s.toLocaleDateString("en-US",{...n,year:"numeric"});const r=new Date(a);return s.getMonth()===r.getMonth()?`${s.toLocaleDateString("en-US",n)} - ${r.getDate()}, ${r.getFullYear()}`:`${s.toLocaleDateString("en-US",n)} - ${r.toLocaleDateString("en-US",{...n,year:"numeric"})}`},Lz=t=>t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:t.toString(),Iz=({event:t})=>{const{day:a,month:s}=Cz(t.date),n=t.isFeatured;return e.jsxs("div",{className:`group relative flex gap-4 rounded-lg border bg-card p-4 transition-all duration-200 hover:shadow-card ${n?"border-accent/30 bg-accent/[0.02]":"border-border"}`,children:[e.jsxs("div",{className:`flex h-16 w-16 flex-shrink-0 flex-col items-center justify-center rounded-lg ${n?"bg-accent text-accent-foreground":"bg-primary text-primary-foreground"}`,children:[e.jsx("span",{className:"text-[10px] font-bold uppercase leading-none tracking-wider",children:s}),e.jsx("span",{className:"text-2xl font-bold leading-tight",children:a})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-1.5",children:[n&&e.jsx(O,{className:"bg-accent/10 text-accent text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Recommended"}),t.isFree&&e.jsx(O,{className:"bg-gaming-success/10 text-gaming-success text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Free"}),e.jsx(O,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:t.category}),e.jsx(O,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:t.format})]}),e.jsx("h3",{className:"mb-1 text-base font-semibold leading-snug text-foreground group-hover:text-accent transition-colors",children:t.title}),t.description&&e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground leading-relaxed",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pa,{className:"h-3.5 w-3.5"}),Sz(t.date,t.endDate)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[t.format==="Online"?e.jsx(Dt,{className:"h-3.5 w-3.5"}):e.jsx(Fe,{className:"h-3.5 w-3.5"}),t.format==="Online"?"Online":`${t.city}, ${t.country}`]}),t.attendeeCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(qe,{className:"h-3.5 w-3.5"}),Lz(t.attendeeCount)," attendees"]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["by ",t.organizer]})]}),t.audience&&t.audience.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:t.audience.map(r=>e.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-secondary-foreground",children:r},r))})]}),e.jsx("div",{className:"flex flex-shrink-0 flex-col items-end justify-between",children:t.link&&e.jsx(P,{variant:"outline",size:"sm",className:"text-xs",asChild:!0,children:e.jsxs("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",children:["Event Info",e.jsx(Rt,{className:"ml-1.5 h-3 w-3"})]})})})]})},Az=[{value:"upcoming",label:"Upcoming"},{value:"newest",label:"Newest added"},{value:"popular",label:"Most attendees"},{value:"name",label:"Name (A-Z)"}],Pz=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],Tz=[{value:"C-level",label:"C-level"},{value:"B2B",label:"B2B"},{value:"Regulators",label:"Regulators"},{value:"Affiliates",label:"Affiliates"},{value:"Tech",label:"Tech"},{value:"Operators",label:"Operators"},{value:"Providers",label:"Providers"},{value:"General",label:"General"}],Rz=({apiUrl:t,eventsData:a,itemsPerPage:s=20,enableMobileFilter:n=!0,onSubmitEvent:r})=>{const[i,l]=p.useState(!1),[c,h]=p.useState(a??[]),[d,u]=p.useState(!a),[y,x]=p.useState(1),[m,g]=p.useState(s),[f,k]=p.useState(""),[v,N]=p.useState("upcoming"),[M,b]=p.useState("list"),[C,S]=p.useState({category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]});p.useEffect(()=>{if(a)return;let q=!0;const E=async()=>{try{if(!t){q&&h(u9);return}const F=await fetch(t);if(!F.ok)throw new Error(`Failed loading events: ${F.status}`);const G=await F.json();q&&Array.isArray(G)&&h(G)}catch(F){console.error("Failed to fetch events list",F),q&&h(u9)}finally{q&&u(!1)}};return u(!0),E(),()=>{q=!1}},[t,a]);const L=p.useMemo(()=>{const q=Array.from(new Set(c.map(Z=>Z.category))).sort(),E=Array.from(new Set(c.map(Z=>Z.format))).sort(),F=Array.from(new Set(c.map(Z=>Z.country).filter(Z=>Z!=="Remote"))).sort(),G=Array.from(new Set(c.map(Z=>Z.organizer))).sort();return[{key:"month",label:"Month",type:"checkbox",options:Pz},{key:"audience",label:"Audience",type:"checkbox",options:Tz},{key:"category",label:"Event Type",type:"checkbox",options:q.map(Z=>({value:Z,label:Z}))},{key:"format",label:"Format",type:"checkbox",options:E.map(Z=>({value:Z,label:Z}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:F.map(Z=>({value:Z,label:Z}))},{key:"organizer",label:"Organizer",type:"searchable-select",searchable:!0,options:G.map(Z=>({value:Z,label:Z}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"free",label:"Free events only"}]}]},[c]),w=p.useMemo(()=>Object.entries(C).flatMap(([q,E])=>E.map(F=>({key:q,label:q.charAt(0).toUpperCase()+q.slice(1),value:F,onRemove:()=>S(G=>({...G,[q]:(G[q]??[]).filter(Z=>Z!==F)}))}))),[C]),j=p.useMemo(()=>{const q=f.trim().toLowerCase();return c.filter(E=>{if(q&&!`${E.title} ${E.organizer} ${E.city} ${E.country} ${E.description??""}`.toLowerCase().includes(q)||C.category.length&&!C.category.includes(E.category)||C.format.length&&!C.format.includes(E.format)||C.country.length&&!C.country.includes(E.country)||C.organizer.length&&!C.organizer.includes(E.organizer))return!1;if(C.month.length){const F=new Date(E.date).toISOString().slice(5,7);if(!C.month.includes(F))return!1}return!(C.audience.length&&(!E.audience||!C.audience.some(F=>E.audience.includes(F)))||C.signals.includes("featured")&&!E.isFeatured||C.signals.includes("free")&&!E.isFree)})},[c,C,f]),I=p.useMemo(()=>{const q=[...j];return q.sort((E,F)=>{switch(v){case"newest":return new Date(F.date).getTime()-new Date(E.date).getTime();case"popular":return F.attendeeCount-E.attendeeCount;case"name":return E.title.localeCompare(F.title);case"upcoming":default:return new Date(E.date).getTime()-new Date(F.date).getTime()}}),q},[j,v]);p.useEffect(()=>{x(1)},[f,C,m]);const T=Math.max(1,Math.ceil(I.length/m)),A=I.slice((y-1)*m,y*m),R=p.useMemo(()=>{if(M!=="list")return null;const q={};for(const E of A){const F=jz(new Date(E.date),"MMMM yyyy");q[F]||(q[F]=[]),q[F].push(E)}return q},[A,M]),D={category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]};return e.jsxs(e.Fragment,{children:[e.jsx(Za,{title:"iGaming Events & Conferences Calendar",description:"Discover the most important iGaming conferences, expos, webinars, and networking events worldwide. Filter by region, audience, and event type.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>l(!0),children:[e.jsx(Pa,{className:"w-4 h-4"}),"Submit Event"]}),search:{value:f,onChange:k,onSubmit:k,onClear:()=>k(""),placeholder:"Search events by name, organizer, or location..."},filters:L,filterValues:C,onFilterChange:(q,E)=>S(F=>({...F,[q]:E})),onClearFilters:()=>S(D),activeFilters:w,sort:{value:v,options:Az,onChange:N},viewMode:M,onViewModeChange:b,pagination:{page:y,pageSize:m,totalPages:T,totalCount:I.length,toolbarTotalCount:c.length,toolbarTitle:"Events Calendar",toolbarItemLabel:"events",onPageChange:x,onPageSizeChange:q=>{g(q),x(1)},pageSizeOptions:[10,20,50]},resultsClassName:M==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"",children:d?e.jsx(Wa,{totalColumns:6}):A.length?M==="list"&&R?e.jsx("div",{className:"space-y-8",children:Object.entries(R).map(([q,E])=>e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex items-center rounded-md bg-accent px-3 py-1.5 text-sm font-bold text-accent-foreground uppercase tracking-wide",children:q}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.jsx("div",{className:"space-y-3",children:E.map(F=>e.jsx(Iz,{event:F},F.id))})]},q))}):A.map(q=>e.jsx(n_,{id:q.id,title:q.title,organizer:q.organizer,category:q.category,format:q.format,city:q.city,country:q.country,date:q.date,attendeeCount:q.attendeeCount,tags:q.tags,isFeatured:q.isFeatured,isFree:q.isFree,link:q.link,viewMode:M},q.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Pa,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No events found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsx(P,{variant:"outline",onClick:()=>S(D),children:"Clear all filters"})]})}),e.jsx(d_,{open:i,onOpenChange:l,onSubmit:q=>{r==null||r(q),console.log("[EventsList] Submit event:",q)}})]})},Dz=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),_z=({name:t,type:a,city:s,country:n,shortDescription:r,services:i,tags:l=[],rating:c,reviewCount:h,website:d,isFeatured:u=!1})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:a}),u&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Featured"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:t}),e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground",children:r}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"h-3.5 w-3.5"}),s,", ",n]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(tt,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),c.toFixed(1)," (",Dz(h),")"]})]}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:i.slice(0,3).map(y=>e.jsx(O,{variant:"outline",className:"text-xs",children:y},y))}),l.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:l.slice(0,2).map(y=>e.jsx(O,{variant:"outline",className:"text-xs",children:y},y))}),d&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:["Visit Place",e.jsx(Rt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),k9=[{id:"place-1",name:"Valletta Gaming Campus",type:"Innovation Hub",city:"Valletta",country:"Malta",shortDescription:"Innovation campus focused on sportsbook and casino startups.",services:["Events","Mentorship","Recruitment"],tags:["startup","community"],rating:4.8,reviewCount:132,isFeatured:!0,website:"https://example.com/places/valletta-campus"},{id:"place-2",name:"Barcelona Betting Labs",type:"Coworking",city:"Barcelona",country:"Spain",shortDescription:"Flexible workspaces for game, risk, and analytics teams.",services:["Coworking","Meeting Rooms","Events"],tags:["analytics","product"],rating:4.5,reviewCount:89,website:"https://example.com/places/barcelona-labs"},{id:"place-3",name:"Tallinn Compliance Center",type:"Office",city:"Tallinn",country:"Estonia",shortDescription:"Specialized compliance hub for regulated operators.",services:["Compliance Advisory","Training"],tags:["compliance","regulation"],rating:4.6,reviewCount:64,website:"https://example.com/places/tallinn-compliance-center"},{id:"place-4",name:"London iGaming Forum Hall",type:"Conference Venue",city:"London",country:"United Kingdom",shortDescription:"Large conference venue for iGaming networking and expos.",services:["Conferences","Streaming","Booths"],tags:["conference","networking"],rating:4.4,reviewCount:210,website:"https://example.com/places/london-forum-hall"},{id:"place-5",name:"Sofia Product Studio",type:"Office",city:"Sofia",country:"Bulgaria",shortDescription:"Product-focused office optimized for agile delivery teams.",services:["Product Sprints","Hiring Support"],tags:["product","engineering"],rating:4.3,reviewCount:48,website:"https://example.com/places/sofia-product-studio"},{id:"place-6",name:"Riga Talent House",type:"Coworking",city:"Riga",country:"Latvia",shortDescription:"Coworking location with hiring events and mentorship sessions.",services:["Coworking","Recruitment","Mentorship"],tags:["talent","recruitment"],rating:4.7,reviewCount:73,isFeatured:!0,website:"https://example.com/places/riga-talent-house"}],zz=[{value:"relevance",label:"Most relevant"},{value:"rating",label:"Highest rated"},{value:"reviews",label:"Most reviews"},{value:"name",label:"Name (A-Z)"}],qz=({apiUrl:t,itemsPerPage:a=9,enableMobileFilter:s=!0})=>{const[n,r]=p.useState([]),[i,l]=p.useState(!0),[c,h]=p.useState(1),[d,u]=p.useState(a),[y,x]=p.useState(""),[m,g]=p.useState("relevance"),[f,k]=p.useState("grid"),[v,N]=p.useState({type:[],country:[],city:[],services:[],tags:[],signals:[]});p.useEffect(()=>{let j=!0;const I=async()=>{try{if(!t){j&&r(k9);return}const T=await fetch(t);if(!T.ok)throw new Error(`Failed loading places: ${T.status}`);const A=await T.json();j&&Array.isArray(A)&&r(A)}catch(T){console.error("Failed to fetch places list",T),j&&r(k9)}finally{j&&l(!1)}};return l(!0),I(),()=>{j=!1}},[t]);const M=p.useMemo(()=>{const j=Array.from(new Set(n.map(D=>D.type))).sort(),I=Array.from(new Set(n.map(D=>D.country))).sort(),T=Array.from(new Set(n.map(D=>D.city))).sort(),A=Array.from(new Set(n.flatMap(D=>D.services))).sort(),R=Array.from(new Set(n.flatMap(D=>D.tags))).sort();return[{key:"type",label:"Type",type:"checkbox",options:j.map(D=>({value:D,label:D}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:I.map(D=>({value:D,label:D}))},{key:"city",label:"City",type:"searchable-select",searchable:!0,options:T.map(D=>({value:D,label:D}))},{key:"services",label:"Services",type:"checkbox",searchable:!0,options:A.map(D=>({value:D,label:D}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:R.map(D=>({value:D,label:D}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"}]}]},[n]),b=p.useMemo(()=>Object.entries(v).flatMap(([j,I])=>I.map(T=>({key:j,label:j.charAt(0).toUpperCase()+j.slice(1),value:T,onRemove:()=>{N(A=>({...A,[j]:(A[j]??[]).filter(R=>R!==T)}))}}))),[v]),C=p.useMemo(()=>{const j=y.trim().toLowerCase();return n.filter(I=>!(j&&!`${I.name} ${I.shortDescription} ${I.city} ${I.country}`.toLowerCase().includes(j)||v.type.length&&!v.type.includes(I.type)||v.country.length&&!v.country.includes(I.country)||v.city.length&&!v.city.includes(I.city)||v.services.length&&!v.services.every(T=>I.services.includes(T))||v.tags.length&&!v.tags.every(T=>I.tags.includes(T))||v.signals.includes("featured")&&!I.isFeatured))},[v,n,y]),S=p.useMemo(()=>{const j=[...C];return j.sort((I,T)=>{switch(m){case"rating":return T.rating-I.rating;case"reviews":return T.reviewCount-I.reviewCount;case"name":return I.name.localeCompare(T.name);case"relevance":default:return Number(T.isFeatured)-Number(I.isFeatured)||T.rating-I.rating}}),j},[C,m]);p.useEffect(()=>{h(1)},[y,v,d]);const L=Math.max(1,Math.ceil(S.length/d)),w=S.slice((c-1)*d,c*d);return e.jsx(Za,{title:"Places",description:"Browse offices, venues, and hubs where iGaming teams work and connect.",search:{value:y,onChange:x,onSubmit:x,onClear:()=>x(""),placeholder:"Search places"},filters:M,filterValues:v,onFilterChange:(j,I)=>N(T=>({...T,[j]:I})),onClearFilters:()=>N({type:[],country:[],city:[],services:[],tags:[],signals:[]}),activeFilters:b,sort:{value:m,options:zz,onChange:g},viewMode:f,onViewModeChange:k,pagination:{page:c,pageSize:d,totalPages:L,totalCount:S.length,toolbarTotalCount:n.length,toolbarTitle:"Popular Places",toolbarItemLabel:"places",onPageChange:h,onPageSizeChange:j=>{u(j),h(1)}},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:i?e.jsx(Wa,{totalColumns:d}):w.length?w.map(j=>e.jsx(_z,{id:j.id,name:j.name,type:j.type,city:j.city,country:j.country,shortDescription:j.shortDescription,services:j.services,tags:j.tags,rating:j.rating,reviewCount:j.reviewCount,website:j.website,isFeatured:j.isFeatured,viewMode:f},j.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Fe,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No places found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>N({type:[],country:[],city:[],services:[],tags:[],signals:[]}),children:"Clear all filters"})]})})},Fz={Low:"bg-gaming-success/10 text-gaming-success",Medium:"bg-gaming-warning/10 text-gaming-warning",High:"bg-destructive/10 text-destructive"},Ez=({slug:t,name:a,parentCategory:s,description:n,vendorCount:r,productCount:i,jobCount:l,complianceLevel:c,tags:h=[],isFeatured:d=!1,isTrending:u=!1,subcategories:y=[],topCompanies:x=[]})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/product-categories/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:s}),e.jsxs(O,{className:Fz[c],children:[c," Compliance"]}),d&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Featured"}),u&&e.jsx(O,{variant:"accent",children:"Trending"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:a}),e.jsx("p",{className:"mb-3 line-clamp-2 text-sm text-muted-foreground",children:n}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),r," vendors"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ml,{className:"h-3.5 w-3.5"}),i," products"]}),l!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ce,{className:"h-3.5 w-3.5"}),l," jobs"]})]}),y.length>0&&e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[y.slice(0,3).map(m=>e.jsx(O,{variant:"outline",className:"text-xs",children:m.name},m.slug)),y.length>3&&e.jsxs(O,{variant:"outline",className:"text-xs text-muted-foreground",children:["+",y.length-3]})]}),x.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Top vendors:"}),e.jsxs("p",{className:"text-xs font-medium text-foreground",children:[x.slice(0,3).map(m=>m.name).join(", "),x.length>3&&` +${x.length-3} more`]})]}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full",onClick:m=>{m.stopPropagation(),window.location.replace(`/product-categories/${t}`)},children:[e.jsx(Ha,{className:"mr-1.5 h-3.5 w-3.5"})," Explore Category"]})]}),v9=[{id:"pc-1",slug:"sportsbook-platform",name:"Sportsbook Platform",parentCategory:"Core Platform",description:"Odds, trading, risk management, and real-time bet settlement stack.",longDescription:"End-to-end sportsbook capabilities covering pre-match and in-play pricing, trading tools, risk management, and low-latency bet placement and settlement.",synonyms:["sportsbook","betting platform","sports trading"],subcategories:[{name:"Risk Management",slug:"risk-management",description:"Exposure controls, limits, and automated risk tooling."},{name:"Trading Tools",slug:"trading-tools",description:"Odds management, feeds, and trader workbench features."}],vendorCount:42,productCount:68,jobCount:18,complianceLevel:"High",tags:["sportsbook","risk"],lastUpdated:"2026-01-22",isTrending:!0,isFeatured:!0,topCompanies:[{name:"Example Sportsbook Co",slug:"example-sportsbook-co",offeringsStrength:"core"}],sampleJobs:[{title:"Sportsbook Product Manager",company:"Example Sportsbook Co",location:"Remote",slug:"sportsbook-product-manager"}],keySkills:[{name:"Odds Modeling",demandLevel:"High"},{name:"Risk Management",demandLevel:"High"}],relatedCategories:[{name:"KYC and AML Tooling",slug:"kyc-and-aml-tooling"},{name:"Affiliate Tracking",slug:"affiliate-tracking"}]},{id:"pc-2",slug:"casino-aggregator",name:"Casino Aggregator",parentCategory:"Content",description:"Unified API layer for slots, live casino, and jackpots.",longDescription:"Aggregation platforms unify multiple game providers behind a single integration, handling lobbies, routing, reporting, and game lifecycle events.",synonyms:["game aggregator","casino aggregation","content aggregation"],subcategories:[{name:"Slots Aggregation",slug:"slots-aggregation",description:"Unified access to slot providers and catalogs."},{name:"Live Casino Aggregation",slug:"live-casino-aggregation",description:"Unified access to live dealer providers and tables."}],vendorCount:35,productCount:77,jobCount:14,complianceLevel:"Medium",tags:["casino","aggregation"],lastUpdated:"2026-02-05",isTrending:!0,topCompanies:[{name:"Example Aggregator Ltd",slug:"example-aggregator-ltd",offeringsStrength:"core"}],sampleJobs:[{title:"Integration Engineer (Casino)",company:"Example Aggregator Ltd",location:"EU (Hybrid)",slug:"integration-engineer-casino"}],keySkills:[{name:"API Integrations",demandLevel:"High"},{name:"Game Certification",demandLevel:"Medium"}],relatedCategories:[{name:"Player CRM",slug:"player-crm"},{name:"Responsible Gaming Suite",slug:"responsible-gaming-suite"}]},{id:"pc-3",slug:"kyc-and-aml-tooling",name:"KYC and AML Tooling",parentCategory:"Compliance",description:"Identity checks, sanctions screening, and ongoing AML monitoring.",longDescription:"Compliance tooling supporting onboarding verification, PEP/sanctions screening, transaction monitoring, case management, and audit-ready reporting.",synonyms:["identity verification","aml monitoring","compliance checks"],subcategories:[{name:"Identity Verification",slug:"identity-verification",description:"Document and biometric checks to verify identity."},{name:"Sanctions & PEP Screening",slug:"sanctions-pep-screening",description:"Watchlist checks and ongoing screening workflows."}],vendorCount:28,productCount:41,jobCount:22,complianceLevel:"High",tags:["kyc","aml"],lastUpdated:"2025-12-11",isFeatured:!0,topCompanies:[{name:"Example Compliance Inc",slug:"example-compliance-inc",offeringsStrength:"core"}],sampleJobs:[{title:"AML Compliance Analyst",company:"Example Compliance Inc",location:"UK",slug:"aml-compliance-analyst"}],keySkills:[{name:"AML",demandLevel:"High"},{name:"KYC",demandLevel:"High"}],relatedCategories:[{name:"Responsible Gaming Suite",slug:"responsible-gaming-suite"},{name:"Player CRM",slug:"player-crm"}]},{id:"pc-4",slug:"affiliate-tracking",name:"Affiliate Tracking",parentCategory:"Marketing",description:"Performance attribution and campaign lifecycle analytics.",longDescription:"Affiliate platforms manage partner tracking, attribution models, commission plans, fraud signals, and reporting across acquisition channels.",synonyms:["affiliate platform","attribution","commission tracking"],subcategories:[{name:"Attribution",slug:"attribution",description:"Clicks, signups, FTD, and multi-touch attribution models."},{name:"Commission Management",slug:"commission-management",description:"CPA/RevShare plans, tiers, and partner payouts."}],vendorCount:31,productCount:52,jobCount:9,complianceLevel:"Medium",tags:["affiliate","analytics"],lastUpdated:"2025-11-29",topCompanies:[{name:"Example Marketing Tech",slug:"example-marketing-tech",offeringsStrength:"core"}],sampleJobs:[{title:"Affiliate Manager",company:"Example Marketing Tech",location:"Remote",slug:"affiliate-manager"}],keySkills:[{name:"Attribution Modeling",demandLevel:"Medium"},{name:"Partner Management",demandLevel:"High"}],relatedCategories:[{name:"Player CRM",slug:"player-crm"},{name:"Casino Aggregator",slug:"casino-aggregator"}]},{id:"pc-5",slug:"player-crm",name:"Player CRM",parentCategory:"Operations",description:"Lifecycle messaging, segmentation, and player retention workflows.",longDescription:"CRMs centralize player segmentation, omnichannel communications, bonus orchestration, and retention automation for regulated iGaming operations.",synonyms:["crm","retention crm","lifecycle marketing"],subcategories:[{name:"Segmentation",slug:"segmentation",description:"Audience building from behavioral and transactional data."},{name:"Messaging",slug:"messaging",description:"Email, SMS, push, and on-site messaging journeys."}],vendorCount:39,productCount:59,jobCount:12,complianceLevel:"Low",tags:["crm","retention"],lastUpdated:"2026-02-10",topCompanies:[{name:"Example CRM Vendor",slug:"example-crm-vendor",offeringsStrength:"core"}],sampleJobs:[{title:"CRM Specialist",company:"Example CRM Vendor",location:"LATAM",slug:"crm-specialist"}],keySkills:[{name:"Lifecycle Marketing",demandLevel:"High"},{name:"Segmentation",demandLevel:"High"}],relatedCategories:[{name:"Affiliate Tracking",slug:"affiliate-tracking"},{name:"Responsible Gaming Suite",slug:"responsible-gaming-suite"}]},{id:"pc-6",slug:"responsible-gaming-suite",name:"Responsible Gaming Suite",parentCategory:"Compliance",description:"Affordability checks, self-exclusion, and safer gambling interventions.",longDescription:"Responsible gaming tooling supports safer gambling requirements including limits, interventions, affordability and vulnerability signals, and exclusion workflows.",synonyms:["rg","safer gambling","player protection"],subcategories:[{name:"Limits & Controls",slug:"limits-and-controls",description:"Deposit, loss, session, and wagering limits."},{name:"Self-Exclusion",slug:"self-exclusion",description:"Self-exclusion and cooling-off journeys and enforcement."}],vendorCount:24,productCount:36,jobCount:11,complianceLevel:"High",tags:["responsible-gaming","safeguards"],lastUpdated:"2026-01-31",isTrending:!0,topCompanies:[{name:"Example RG Provider",slug:"example-rg-provider",offeringsStrength:"core"}],sampleJobs:[{title:"RG Compliance Manager",company:"Example RG Provider",location:"US",slug:"rg-compliance-manager"}],keySkills:[{name:"Regulatory Compliance",demandLevel:"High"},{name:"Risk Analytics",demandLevel:"Medium"}],relatedCategories:[{name:"KYC and AML Tooling",slug:"kyc-and-aml-tooling"},{name:"Sportsbook Platform",slug:"sportsbook-platform"}]}],Oz=[{value:"popularity",label:"Most popular"},{value:"vendors",label:"Most vendors"},{value:"jobs",label:"Most jobs"},{value:"name",label:"Name (A-Z)"}],Bz=["Payments","KYC / AML","Platform (PAM)","Sportsbook","Casino Games / Studios","CRM / CDP","Affiliates","Fraud / Risk"],b9={parentCategory:[],complianceLevel:[],tags:[],signals:[]},Hz=({apiUrl:t})=>{const[a,s]=p.useState([]),[n,r]=p.useState(!0),[i,l]=p.useState(1),[c,h]=p.useState(9),[d,u]=p.useState(""),[y,x]=p.useState("popularity"),[m,g]=p.useState("grid"),[f,k]=p.useState(b9);p.useEffect(()=>{let w=!0;const j=async()=>{try{if(!t){w&&s(v9);return}const I=await fetch(t);if(!I.ok)throw new Error(`${I.status}`);const T=await I.json();w&&Array.isArray(T)&&s(T)}catch(I){console.error("Failed to fetch product categories",I),w&&s(v9)}finally{w&&r(!1)}};return r(!0),j(),()=>{w=!1}},[t]);const v=p.useMemo(()=>{const w=j=>Array.from(new Set(j)).sort();return[{key:"parentCategory",label:"Pillar",type:"checkbox",options:w(a.map(j=>j.parentCategory)).map(j=>({value:j,label:j}))},{key:"complianceLevel",label:"Compliance Level",type:"checkbox",options:w(a.map(j=>j.complianceLevel)).map(j=>({value:j,label:j}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:w(a.flatMap(j=>j.tags)).map(j=>({value:j,label:j}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"trending",label:"Trending only"}]}]},[a]),N=p.useMemo(()=>Object.entries(f).flatMap(([w,j])=>j.map(I=>({key:w,label:w.charAt(0).toUpperCase()+w.slice(1),value:I,onRemove:()=>k(T=>({...T,[w]:(T[w]??[]).filter(A=>A!==I)}))}))),[f]),M=p.useMemo(()=>{const w=d.trim().toLowerCase();return a.filter(j=>!(w&&!`${j.name} ${j.description} ${j.parentCategory} ${j.synonyms.join(" ")}`.toLowerCase().includes(w)||f.parentCategory.length&&!f.parentCategory.includes(j.parentCategory)||f.complianceLevel.length&&!f.complianceLevel.includes(j.complianceLevel)||f.tags.length&&!f.tags.every(I=>j.tags.includes(I))||f.signals.includes("featured")&&!j.isFeatured||f.signals.includes("trending")&&!j.isTrending))},[a,f,d]),b=p.useMemo(()=>{const w=[...M];return w.sort((j,I)=>{switch(y){case"vendors":return I.vendorCount-j.vendorCount;case"jobs":return I.jobCount-j.jobCount;case"name":return j.name.localeCompare(I.name);default:return I.vendorCount+I.productCount-(j.vendorCount+j.productCount)}}),w},[M,y]);p.useEffect(()=>{l(1)},[d,f,c]);const C=Math.max(1,Math.ceil(b.length/c)),S=b.slice((i-1)*c,i*c),L=()=>k(b9);return e.jsx(Za,{title:"Product Categories",description:"Explore the iGaming B2B technology stack — platforms, content, payments, compliance, and more.",headerPopularTags:Bz,search:{value:d,onChange:u,onSubmit:u,onClear:()=>u(""),placeholder:"Search categories or synonyms (e.g. PAM, PSP)"},filters:v,filterValues:f,onFilterChange:(w,j)=>k(I=>({...I,[w]:j})),onClearFilters:L,activeFilters:N,sort:{value:y,options:Oz,onChange:x},viewMode:m,onViewModeChange:g,pagination:{page:i,pageSize:c,totalPages:C,totalCount:b.length,toolbarTotalCount:a.length,toolbarTitle:"B2B Stack Categories",toolbarItemLabel:"categories",onPageChange:l,onPageSizeChange:w=>{h(w),l(1)}},resultsClassName:m==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:n?e.jsx(Wa,{totalColumns:c}):S.length?S.map(w=>e.jsx(Ez,{id:w.id,slug:w.slug,name:w.name,parentCategory:w.parentCategory,description:w.description,vendorCount:w.vendorCount,productCount:w.productCount,jobCount:w.jobCount,complianceLevel:w.complianceLevel,tags:w.tags,isFeatured:w.isFeatured,isTrending:w.isTrending,subcategories:w.subcategories,topCompanies:w.topCompanies,viewMode:m},w.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(rc,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No categories found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:L,children:"Clear all filters"})]})})},w9={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},j9={positive:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",neutral:"bg-secondary text-muted-foreground border-border",warning:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},ed={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},Vz=({market:t,viewMode:a="grid"})=>a==="list"?e.jsx(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:t.name}),e.jsx(O,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(O,{className:`text-xs ${w9[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(O,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:t.overview}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.badges.map(s=>e.jsx(O,{variant:"outline",className:`text-xs ${j9[s.type]}`,children:s.label},s.label))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center sm:min-w-[280px]",children:[e.jsx(uN,{icon:Ce,label:"Jobs",value:t.stats.jobsCount.toLocaleString()}),e.jsx(uN,{icon:Se,label:"Companies",value:t.stats.companiesCount.toLocaleString()}),e.jsx(uN,{icon:Al,label:"Remote",value:`${t.stats.remoteRatio}%`})]})]})}):e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(O,{className:`text-xs ${w9[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(O,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"mb-1 text-lg font-semibold text-foreground group-hover:text-accent transition-colors",children:t.name}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.jobsCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Jobs"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.companiesCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Companies"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-lg font-bold text-foreground",children:[t.stats.remoteRatio,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Remote"})]})]}),e.jsxs("div",{className:"flex gap-4 mb-3 text-xs",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Xo,{className:`h-3.5 w-3.5 ${ed[t.stats.hiringIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Hiring:"}),e.jsx("span",{className:`font-medium ${ed[t.stats.hiringIntensity]}`,children:t.stats.hiringIntensity})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ta,{className:`h-3.5 w-3.5 ${ed[t.stats.complianceIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Compliance:"}),e.jsx("span",{className:`font-medium ${ed[t.stats.complianceIntensity]}`,children:t.stats.complianceIntensity})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.badges.slice(0,3).map(s=>e.jsx(O,{variant:"outline",className:`text-xs ${j9[s.type]}`,children:s.label},s.label))}),t.trendingRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(jt,{className:"h-3 w-3 text-gaming-success"}),e.jsxs("span",{children:["Trending: ",e.jsx("strong",{className:"text-foreground",children:t.trendingRoles[0].roleFamily})]}),e.jsxs("span",{className:"text-gaming-success",children:["+",t.trendingRoles[0].changePercent,"%"]})]})]}),uN=({icon:t,label:a,value:s})=>e.jsxs("div",{children:[e.jsx(t,{className:"h-4 w-4 mx-auto mb-0.5 text-muted-foreground"}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a})]}),UN=[{id:"mk-malta",slug:"malta",name:"Malta",region:"Europe",countries:["Malta"],cities:["Sliema","St. Julian's","Birkirkara"],status:"Regulated",verticals:["Casino","Sportsbook","Poker","Live Casino"],languages:["English","Maltese"],currency:"EUR",timezone:"CET",populationM:.5,revenuePotentialM:2200,licensesRequired:4,isFeatured:!0,overview:"Malta is the undisputed hub of European iGaming, home to 300+ licensed operators and suppliers. The Malta Gaming Authority (MGA) provides one of the most recognized regulatory frameworks globally, making it the jurisdiction of choice for B2B and B2C companies.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High hiring",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:842,companiesCount:312,remoteRatio:62,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Evolution",slug:"evolution",openRoles:45,employeeRange:"10,000+",isClaimed:!0},{name:"Betsson",slug:"betsson",openRoles:32,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Kindred Group",slug:"kindred-group",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"SOFTSWISS",slug:"softswiss",openRoles:24,employeeRange:"501-1,000",isClaimed:!0},{name:"Yggdrasil",slug:"yggdrasil",openRoles:15,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:210,changePercent:12},{roleFamily:"Compliance",count:95,changePercent:18},{roleFamily:"Product",count:78,changePercent:8},{roleFamily:"Payments",count:52,changePercent:22},{roleFamily:"Marketing",count:68,changePercent:-3}],salaryPulse:{currency:"EUR",medianAnnual:52e3,rangeMin:28e3,rangeMax:12e4,topRoleFamilies:[{role:"Engineering",median:62e3},{role:"Product",median:58e3},{role:"Compliance",median:48e3},{role:"Marketing",median:45e3}]},regulators:[{name:"Malta Gaming Authority",slug:"mga",authority:"MGA",licenseTypes:["B2B","B2C","Type 1","Type 2","Type 3","Type 4"]}],upcomingEvents:[{name:"SiGMA Europe",slug:"sigma-europe",date:"2026-11-11",city:"Valletta"},{name:"Malta iGaming Seminar",slug:"migs-2026",date:"2026-06-15",city:"St. Julian's"}]},{id:"mk-uk",slug:"united-kingdom",name:"United Kingdom",region:"Europe",countries:["United Kingdom"],cities:["London","Manchester","Leeds","Edinburgh"],status:"Regulated",verticals:["Sportsbook","Casino","Poker","Bingo"],languages:["English"],currency:"GBP",timezone:"GMT",populationM:67,revenuePotentialM:5800,licensesRequired:3,isFeatured:!0,overview:"The UK is the world's most mature and tightly regulated iGaming market. The UK Gambling Commission (UKGC) sets global standards for player protection and responsible gambling. London is a key hub for iGaming headquarters and talent.",badges:[{label:"High compliance",type:"warning"},{label:"High hiring",type:"positive"}],stats:{jobsCount:1250,companiesCount:420,remoteRatio:45,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Flutter Entertainment",slug:"flutter",openRoles:68,employeeRange:"10,000+",isClaimed:!0},{name:"Entain",slug:"entain",openRoles:55,employeeRange:"10,000+",isClaimed:!0},{name:"Playtech",slug:"playtech",openRoles:42,employeeRange:"5,001-10,000",isClaimed:!0},{name:"bet365",slug:"bet365",openRoles:38,employeeRange:"5,001-10,000"}],trendingRoles:[{roleFamily:"Compliance",count:185,changePercent:25},{roleFamily:"Engineering",count:320,changePercent:8},{roleFamily:"Data Science",count:120,changePercent:15},{roleFamily:"Responsible Gambling",count:65,changePercent:30}],salaryPulse:{currency:"GBP",medianAnnual:58e3,rangeMin:3e4,rangeMax:15e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Data Science",median:68e3},{role:"Product",median:65e3},{role:"Compliance",median:55e3}]},regulators:[{name:"UK Gambling Commission",slug:"ukgc",authority:"UKGC",licenseTypes:["Remote","Non-remote","Software"]}],upcomingEvents:[{name:"ICE London",slug:"ice-london-2026",date:"2026-02-10",city:"London"},{name:"Betting on Sports",slug:"bos-2026",date:"2026-09-15",city:"London"}]},{id:"mk-gibraltar",slug:"gibraltar",name:"Gibraltar",region:"Europe",countries:["Gibraltar"],cities:["Gibraltar"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English"],currency:"GBP",timezone:"CET",populationM:.03,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Gibraltar has long been a premium jurisdiction for iGaming, offering favorable tax rates and a well-established regulatory framework. Despite its small size, it hosts some of the industry's biggest names.",badges:[{label:"Tax-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:280,companiesCount:65,remoteRatio:30,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"bet365",slug:"bet365",openRoles:22,employeeRange:"1,001-5,000"},{name:"888 Holdings",slug:"888",openRoles:18,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Lottoland",slug:"lottoland",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:65,changePercent:5},{roleFamily:"Finance",count:40,changePercent:10},{roleFamily:"Compliance",count:35,changePercent:12}],salaryPulse:{currency:"GBP",medianAnnual:55e3,rangeMin:32e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:68e3},{role:"Finance",median:6e4},{role:"Compliance",median:52e3}]},regulators:[{name:"Gibraltar Gambling Commissioner",slug:"ggc",authority:"GGC",licenseTypes:["B2B","B2C"]}],upcomingEvents:[]},{id:"mk-spain",slug:"spain",name:"Spain",region:"Europe",countries:["Spain"],cities:["Madrid","Barcelona","Valencia"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["Spanish"],currency:"EUR",timezone:"CET",populationM:47,revenuePotentialM:1400,licensesRequired:2,isFeatured:!1,overview:"Spain's regulated market under the DGOJ provides a structured framework for online gambling. The market is competitive with strong brand presence from local and international operators.",badges:[{label:"Growing market",type:"positive"}],stats:{jobsCount:185,companiesCount:78,remoteRatio:40,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"Codere",slug:"codere",openRoles:15,employeeRange:"1,001-5,000"},{name:"Luckia",slug:"luckia",openRoles:8,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Marketing",count:45,changePercent:15},{roleFamily:"Engineering",count:38,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:42e3,rangeMin:25e3,rangeMax:9e4,topRoleFamilies:[{role:"Engineering",median:48e3},{role:"Marketing",median:38e3}]},regulators:[{name:"DGOJ",slug:"dgoj",authority:"DGOJ",licenseTypes:["General","Sports Betting"]}],upcomingEvents:[{name:"SBC Summit Barcelona",slug:"sbc-barcelona",date:"2026-09-16",city:"Barcelona"}]},{id:"mk-sweden",slug:"sweden",name:"Sweden",region:"Europe",countries:["Sweden"],cities:["Stockholm","Gothenburg","Malmö"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Swedish","English"],currency:"SEK",timezone:"CET",populationM:10,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Sweden's re-regulated market under Spelinspektionen has created a structured competitive environment. Stockholm is a thriving tech hub with a strong gaming talent pipeline.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:320,companiesCount:95,remoteRatio:65,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Betsson",slug:"betsson",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"LeoVegas",slug:"leovegas",openRoles:15,employeeRange:"501-1,000"},{name:"NetEnt (Evolution)",slug:"netent",openRoles:20,employeeRange:"1,001-5,000"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:10},{roleFamily:"Product",count:42,changePercent:7}],salaryPulse:{currency:"SEK",medianAnnual:54e4,rangeMin:32e4,rangeMax:11e5,topRoleFamilies:[{role:"Engineering",median:62e4},{role:"Product",median:58e4}]},regulators:[{name:"Spelinspektionen",slug:"spelinspektionen",authority:"SGA",licenseTypes:["Online Gambling","Land-based"]}],upcomingEvents:[]},{id:"mk-cyprus",slug:"cyprus",name:"Cyprus",region:"Europe",countries:["Cyprus"],cities:["Limassol","Nicosia","Larnaca"],status:"Regulated",verticals:["Casino","Sportsbook"],languages:["Greek","English"],currency:"EUR",timezone:"EET",populationM:1.2,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Cyprus has emerged as a popular alternative to Malta for iGaming companies, offering EU membership, favorable taxes, and a growing talent pool attracted by the Mediterranean lifestyle.",badges:[{label:"Growing hub",type:"positive"},{label:"Tax-friendly",type:"positive"}],stats:{jobsCount:220,companiesCount:85,remoteRatio:50,complianceIntensity:"Medium",hiringIntensity:"High"},topEmployers:[{name:"EveryMatrix",slug:"everymatrix",openRoles:18,employeeRange:"501-1,000"},{name:"Pragmatic Play",slug:"pragmatic-play",openRoles:22,employeeRange:"1,001-5,000",isClaimed:!0}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:20},{roleFamily:"Customer Support",count:40,changePercent:15}],salaryPulse:{currency:"EUR",medianAnnual:38e3,rangeMin:22e3,rangeMax:85e3,topRoleFamilies:[{role:"Engineering",median:45e3},{role:"Customer Support",median:28e3}]},regulators:[{name:"National Betting Authority",slug:"nba-cyprus",authority:"NBA",licenseTypes:["Class A","Class B"]}],upcomingEvents:[]},{id:"mk-brazil",slug:"brazil",name:"Brazil",region:"Latin America",countries:["Brazil"],cities:["São Paulo","Rio de Janeiro","Curitiba"],status:"Emerging",verticals:["Sportsbook","Casino"],languages:["Portuguese"],currency:"BRL",timezone:"BRT",populationM:214,revenuePotentialM:3500,licensesRequired:1,isFeatured:!0,overview:"Brazil represents the largest untapped iGaming opportunity in Latin America. With regulatory frameworks taking shape, international operators are racing to establish presence in this massive market.",badges:[{label:"High growth",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:145,companiesCount:42,remoteRatio:55,complianceIntensity:"Low",hiringIntensity:"High"},topEmployers:[{name:"Betano",slug:"betano",openRoles:20,employeeRange:"201-500"},{name:"Bet365 Brazil",slug:"bet365-brazil",openRoles:15,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:42,changePercent:35},{roleFamily:"Engineering",count:35,changePercent:28},{roleFamily:"Compliance",count:25,changePercent:40}],salaryPulse:{currency:"BRL",medianAnnual:18e4,rangeMin:8e4,rangeMax:45e4,topRoleFamilies:[{role:"Engineering",median:22e4},{role:"Marketing",median:16e4}]},regulators:[{name:"SPA/MF",slug:"spa-brazil",authority:"SPA",licenseTypes:["Sports Betting","Online Casino"]}],upcomingEvents:[{name:"BiS - Brazilian iGaming Summit",slug:"bis-2026",date:"2026-06-25",city:"São Paulo"}]},{id:"mk-canada",slug:"canada-ontario",name:"Canada (Ontario)",region:"North America",countries:["Canada"],cities:["Toronto","Ottawa"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English","French"],currency:"CAD",timezone:"EST",populationM:15,revenuePotentialM:2800,licensesRequired:2,isFeatured:!0,overview:"Ontario's regulated iGaming market launched in 2022 and has rapidly become one of North America's most competitive markets, attracting major international operators.",badges:[{label:"Fast-growing",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:380,companiesCount:55,remoteRatio:70,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"BetMGM",slug:"betmgm",openRoles:25,employeeRange:"501-1,000"},{name:"theScore",slug:"thescore",openRoles:18,employeeRange:"201-500"},{name:"PointsBet",slug:"pointsbet",openRoles:12,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:18},{roleFamily:"Marketing",count:65,changePercent:22},{roleFamily:"Compliance",count:55,changePercent:30}],salaryPulse:{currency:"CAD",medianAnnual:85e3,rangeMin:5e4,rangeMax:18e4,topRoleFamilies:[{role:"Engineering",median:105e3},{role:"Product",median:95e3},{role:"Compliance",median:78e3}]},regulators:[{name:"AGCO (iGO)",slug:"agco",authority:"AGCO",licenseTypes:["Operator","Supplier"]}],upcomingEvents:[{name:"Canadian Gaming Summit",slug:"cgs-2026",date:"2026-06-10",city:"Toronto"}]},{id:"mk-us",slug:"united-states",name:"United States",region:"North America",countries:["United States"],cities:["New York","New Jersey","Las Vegas","Chicago"],status:"Restricted",verticals:["Sportsbook","Casino","Poker","DFS"],languages:["English"],currency:"USD",timezone:"EST",populationM:330,revenuePotentialM:9500,licensesRequired:6,isFeatured:!0,overview:"The US iGaming market is expanding state-by-state, creating massive opportunities but also regulatory complexity. Sports betting is legal in 30+ states, while iCasino remains limited to a handful of jurisdictions.",badges:[{label:"Highest revenue potential",type:"positive"},{label:"Complex regulation",type:"warning"}],stats:{jobsCount:1800,companiesCount:280,remoteRatio:55,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"DraftKings",slug:"draftkings",openRoles:85,employeeRange:"5,001-10,000",isClaimed:!0},{name:"FanDuel",slug:"fanduel",openRoles:72,employeeRange:"5,001-10,000"},{name:"BetMGM",slug:"betmgm",openRoles:55,employeeRange:"1,001-5,000"},{name:"Caesars Digital",slug:"caesars",openRoles:40,employeeRange:"10,000+"}],trendingRoles:[{roleFamily:"Engineering",count:420,changePercent:14},{roleFamily:"Compliance",count:280,changePercent:32},{roleFamily:"Data Science",count:195,changePercent:20},{roleFamily:"Marketing",count:310,changePercent:8}],salaryPulse:{currency:"USD",medianAnnual:95e3,rangeMin:5e4,rangeMax:22e4,topRoleFamilies:[{role:"Engineering",median:125e3},{role:"Data Science",median:115e3},{role:"Product",median:11e4},{role:"Compliance",median:9e4}]},regulators:[{name:"NJ DGE",slug:"nj-dge",authority:"DGE",licenseTypes:["Casino","Sports Wagering"]},{name:"PGCB (Pennsylvania)",slug:"pgcb",authority:"PGCB",licenseTypes:["Interactive Gaming","Sports Wagering"]}],upcomingEvents:[{name:"G2E Las Vegas",slug:"g2e-2026",date:"2026-10-06",city:"Las Vegas"},{name:"SBC Summit North America",slug:"sbc-na-2026",date:"2026-05-13",city:"New York"}]},{id:"mk-philippines",slug:"philippines",name:"Philippines",region:"Asia-Pacific",countries:["Philippines"],cities:["Manila","Cebu","Clark"],status:"Regulated",verticals:["Casino","Sportsbook","Poker"],languages:["Filipino","English"],currency:"PHP",timezone:"PHT",populationM:115,revenuePotentialM:1200,licensesRequired:2,isFeatured:!1,overview:"The Philippines is a major hub for offshore gaming operations (POGOs) and has a growing domestic market regulated by PAGCOR. It offers cost-effective operations and a large English-speaking talent pool.",badges:[{label:"Cost-effective",type:"positive"},{label:"Offshore hub",type:"neutral"}],stats:{jobsCount:420,companiesCount:95,remoteRatio:35,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"PAGCOR",slug:"pagcor",openRoles:15,employeeRange:"5,001-10,000"},{name:"Philweb",slug:"philweb",openRoles:10,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Customer Support",count:120,changePercent:5},{roleFamily:"Engineering",count:65,changePercent:12}],salaryPulse:{currency:"PHP",medianAnnual:85e4,rangeMin:4e5,rangeMax:25e5,topRoleFamilies:[{role:"Engineering",median:12e5},{role:"Customer Support",median:55e4}]},regulators:[{name:"PAGCOR",slug:"pagcor-reg",authority:"PAGCOR",licenseTypes:["POGO","Domestic"]}],upcomingEvents:[]},{id:"mk-india",slug:"india",name:"India",region:"Asia-Pacific",countries:["India"],cities:["Bangalore","Mumbai","Goa","Hyderabad"],status:"Emerging",verticals:["Sportsbook","Fantasy Sports","Rummy"],languages:["Hindi","English"],currency:"INR",timezone:"IST",populationM:1400,revenuePotentialM:2e3,licensesRequired:1,isFeatured:!1,overview:"India is one of the world's most promising iGaming markets, driven by massive mobile adoption and a young population. Fantasy sports and real-money gaming are growing rapidly despite regulatory uncertainty.",badges:[{label:"Massive TAM",type:"positive"},{label:"Regulatory uncertainty",type:"warning"}],stats:{jobsCount:180,companiesCount:65,remoteRatio:60,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Dream11",slug:"dream11",openRoles:25,employeeRange:"1,001-5,000"},{name:"Games24x7",slug:"games24x7",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:25},{roleFamily:"Product",count:30,changePercent:18}],salaryPulse:{currency:"INR",medianAnnual:18e5,rangeMin:8e5,rangeMax:5e6,topRoleFamilies:[{role:"Engineering",median:22e5},{role:"Product",median:2e6}]},regulators:[],upcomingEvents:[{name:"SPiCE India",slug:"spice-india",date:"2026-03-18",city:"Goa"}]},{id:"mk-nigeria",slug:"nigeria",name:"Nigeria",region:"Africa",countries:["Nigeria"],cities:["Lagos","Abuja"],status:"Emerging",verticals:["Sportsbook"],languages:["English"],currency:"NGN",timezone:"WAT",populationM:220,revenuePotentialM:800,licensesRequired:1,isFeatured:!1,overview:"Nigeria is Africa's largest iGaming market, driven by sports betting popularity and mobile-first consumer behavior. The regulatory environment is evolving with state-level licensing.",badges:[{label:"Mobile-first",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:85,companiesCount:30,remoteRatio:40,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Bet9ja",slug:"bet9ja",openRoles:12,employeeRange:"501-1,000"},{name:"BetKing",slug:"betking",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Marketing",count:25,changePercent:30},{roleFamily:"Engineering",count:18,changePercent:20}],salaryPulse:{currency:"NGN",medianAnnual:12e6,rangeMin:5e6,rangeMax:35e6,topRoleFamilies:[{role:"Engineering",median:15e6},{role:"Marketing",median:1e7}]},regulators:[{name:"National Lottery Regulatory Commission",slug:"nlrc",authority:"NLRC",licenseTypes:["Sports Betting"]}],upcomingEvents:[]},{id:"mk-germany",slug:"germany",name:"Germany",region:"Europe",countries:["Germany"],cities:["Berlin","Hamburg","Munich","Frankfurt"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["German"],currency:"EUR",timezone:"CET",populationM:84,revenuePotentialM:2800,licensesRequired:3,isFeatured:!1,overview:"Germany's regulated market under the GGL has strict requirements including deposit limits and mandatory pauses. Despite restrictions, the market size makes it essential for European operators.",badges:[{label:"Strict regulation",type:"warning"},{label:"Large market",type:"positive"}],stats:{jobsCount:290,companiesCount:110,remoteRatio:50,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Tipico",slug:"tipico",openRoles:22,employeeRange:"1,001-5,000"},{name:"bwin",slug:"bwin",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Compliance",count:65,changePercent:28},{roleFamily:"Engineering",count:72,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:6e4,rangeMin:35e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Compliance",median:58e3}]},regulators:[{name:"GGL",slug:"ggl",authority:"GGL",licenseTypes:["Virtual Slots","Poker","Sports Betting"]}],upcomingEvents:[]},{id:"mk-colombia",slug:"colombia",name:"Colombia",region:"Latin America",countries:["Colombia"],cities:["Bogotá","Medellín"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Spanish"],currency:"COP",timezone:"COT",populationM:51,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Colombia was the first Latin American country to regulate online gambling, creating a model for the region. Coljuegos oversees licensing and the market continues to attract international operators.",badges:[{label:"LatAm pioneer",type:"positive"}],stats:{jobsCount:65,companiesCount:28,remoteRatio:45,complianceIntensity:"Medium",hiringIntensity:"Low"},topEmployers:[{name:"Betplay",slug:"betplay",openRoles:8,employeeRange:"201-500"},{name:"Wplay",slug:"wplay",openRoles:5,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:18,changePercent:12},{roleFamily:"Engineering",count:12,changePercent:8}],salaryPulse:{currency:"COP",medianAnnual:72e6,rangeMin:36e6,rangeMax:18e7,topRoleFamilies:[{role:"Engineering",median:9e7},{role:"Marketing",median:6e7}]},regulators:[{name:"Coljuegos",slug:"coljuegos",authority:"Coljuegos",licenseTypes:["Online Gambling"]}],upcomingEvents:[]}],Uz=t=>UN.find(a=>a.slug===t),Gz=["Europe","North America","Latin America","Asia-Pacific","Africa","Middle East"],$z=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(""),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState(!1),m=n.trim().length>=2&&i&&c.trim().length>=10,g=()=>{m&&(s==null||s({marketName:n.trim(),region:i,description:c.trim(),contactEmail:d.trim()||void 0}),x(!0))},f=()=>{r(""),l(""),h(""),u(""),x(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:f,children:e.jsx(Xe,{className:"sm:max-w-[480px]",children:y?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Suggestion Received!"}),e.jsx(it,{className:"text-center",children:"Thank you! We'll review your suggestion and add it to the directory if applicable."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:f,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(Dt,{className:"w-6 h-6 text-accent"})}),e.jsx(Le,{children:"Suggest a Market"}),e.jsx(it,{children:"Can't find a market you're interested in? Suggest it and we'll research and add it to the directory."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Market / Country Name *"}),e.jsx(ae,{placeholder:"e.g. Peru, South Korea, Kenya",value:n,onChange:k=>r(k.target.value),maxLength:80})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Region *"}),e.jsxs(Ye,{value:i,onValueChange:l,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select region"})}),e.jsx(Ge,{children:Gz.map(k=>e.jsx(me,{value:k,children:k},k))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Why should we add this market? *"}),e.jsx(rt,{placeholder:"Tell us about the iGaming activity in this market...",value:c,onChange:k=>h(k.target.value),rows:3,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Your Email ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional — for updates)"})]}),e.jsx(ae,{type:"email",placeholder:"you@example.com",value:d,onChange:k=>u(k.target.value)})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:f,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:g,disabled:!m,children:"Submit Suggestion"})]})]})})})},Wz=[{value:"hiring",label:"Hiring now"},{value:"revenue",label:"Revenue potential"},{value:"salary",label:"Salary (median)"},{value:"remote",label:"Remote friendliness"},{value:"compliance",label:"Compliance intensity"},{value:"name",label:"Name (A-Z)"}],Zz=({apiUrl:t,marketsData:a,itemsPerPage:s=12,onSuggestMarket:n})=>{const[r,i]=p.useState([]),[l,c]=p.useState(!0),[h,d]=p.useState(1),[u,y]=p.useState(s),[x,m]=p.useState(""),[g,f]=p.useState("hiring"),[k,v]=p.useState("grid"),[N,M]=p.useState(!1),[b,C]=p.useState({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]});p.useEffect(()=>{let D=!0;const q=async()=>{try{if(!t){D&&i(a??UN);return}const E=await fetch(t);if(!E.ok)throw new Error(`${E.status}`);const F=await E.json();D&&Array.isArray(F)&&i(F)}catch{D&&i(a??UN)}finally{D&&c(!1)}};return c(!0),q(),()=>{D=!1}},[t,a]);const S=p.useMemo(()=>{const D=Array.from(new Set(r.map(F=>F.region))).sort(),q=Array.from(new Set(r.map(F=>F.status))).sort(),E=Array.from(new Set(r.flatMap(F=>F.verticals))).sort();return[{key:"region",label:"Region",type:"checkbox",options:D.map(F=>({value:F,label:F}))},{key:"status",label:"Market Status",type:"checkbox",options:q.map(F=>({value:F,label:F}))},{key:"hiringIntensity",label:"Hiring Intensity",type:"checkbox",options:[{value:"High",label:"High"},{value:"Medium",label:"Medium"},{value:"Low",label:"Low"}]},{key:"verticals",label:"Verticals",type:"checkbox",searchable:!0,options:E.map(F=>({value:F,label:F}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"remote-friendly",label:"Remote-friendly (50%+)"}]}]},[r]),L=p.useMemo(()=>Object.entries(b).flatMap(([D,q])=>q.map(E=>({key:D,label:D.charAt(0).toUpperCase()+D.slice(1),value:E,onRemove:()=>C(F=>({...F,[D]:(F[D]??[]).filter(G=>G!==E)}))}))),[b]),w=p.useMemo(()=>{const D=x.trim().toLowerCase();return r.filter(q=>{var E;return!(D&&!`${q.name} ${q.region} ${((E=q.countries)==null?void 0:E.join(" "))??""}`.toLowerCase().includes(D)||b.region.length&&!b.region.includes(q.region)||b.status.length&&!b.status.includes(q.status)||b.hiringIntensity.length&&!b.hiringIntensity.includes(q.stats.hiringIntensity)||b.verticals.length&&!b.verticals.some(F=>q.verticals.includes(F))||b.signals.includes("featured")&&!q.isFeatured||b.signals.includes("remote-friendly")&&q.stats.remoteRatio<50)})},[r,b,x]),j=p.useMemo(()=>{const D=[...w];return D.sort((q,E)=>{switch(g){case"hiring":return E.stats.jobsCount-q.stats.jobsCount;case"revenue":return E.revenuePotentialM-q.revenuePotentialM;case"salary":return E.salaryPulse.medianAnnual-q.salaryPulse.medianAnnual;case"remote":return E.stats.remoteRatio-q.stats.remoteRatio;case"compliance":{const F={High:3,Medium:2,Low:1};return F[E.stats.complianceIntensity]-F[q.stats.complianceIntensity]}case"name":return q.name.localeCompare(E.name);default:return 0}}),D},[w,g]);p.useEffect(()=>{d(1)},[x,b,u]);const I=Math.max(1,Math.ceil(j.length/u)),T=j.slice((h-1)*u,h*u),A=()=>C({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]}),R=p.useCallback(D=>{n==null||n(D),console.log("[MarketsList] Suggest market:",D)},[n]);return e.jsxs(e.Fragment,{children:[e.jsx(Za,{title:"iGaming Markets — Career Intelligence",description:"Explore global iGaming markets by hiring intensity, salary levels, regulatory complexity, and remote-friendliness. Find where the opportunities are.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>M(!0),children:[e.jsx(St,{className:"w-4 h-4"}),"Suggest a Market"]}),search:{value:x,onChange:m,onSubmit:m,onClear:()=>m(""),placeholder:"Search markets (e.g. Brazil, Malta, Ontario...)"},filters:S,filterValues:b,onFilterChange:(D,q)=>C(E=>({...E,[D]:q})),onClearFilters:A,activeFilters:L,sort:{value:g,options:Wz,onChange:f},viewMode:k,onViewModeChange:v,pagination:{page:h,pageSize:u,totalPages:I,totalCount:j.length,toolbarTotalCount:r.length,toolbarTitle:"Global Markets",toolbarItemLabel:"markets",onPageChange:d,onPageSizeChange:D=>{y(D),d(1)},pageSizeOptions:[6,12,24]},resultsClassName:k==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:l?e.jsx(Wa,{totalColumns:u>6?6:u}):T.length?T.map(D=>e.jsx(Vz,{market:D,viewMode:k},D.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Dt,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No markets found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsxs("div",{className:"flex gap-3 justify-center",children:[e.jsx(P,{variant:"outline",onClick:A,children:"Clear all filters"}),e.jsx(P,{variant:"accent",onClick:()=>M(!0),children:"Suggest a market"})]})]})}),e.jsx($z,{open:N,onOpenChange:M,onSubmit:R})]})},Yz=({slug:t,name:a,acronym:s,country:n,region:r,jurisdiction:i,sectors:l,licenseTypes:c,scopeTags:h=[],establishedYear:d,complianceRating:u,website:y,isPrimary:x=!1,description:m,viewMode:g})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/regulators/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:r}),e.jsx(O,{variant:"outline",children:i}),x&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Primary"})]}),e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:a}),e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["(",s,")"]})]}),e.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:n}),m&&e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:m}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(tt,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),u.toFixed(1)," compliance"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(fs,{className:"h-3.5 w-3.5"}),"Since ",d]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Mc,{className:"h-3.5 w-3.5"}),c.length," license types"]})]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[l.slice(0,3).map(f=>e.jsx(O,{variant:"outline",className:"text-xs",children:f},f)),h.slice(0,2).map(f=>e.jsx(O,{variant:"accent",className:"text-xs",children:f},f))]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{variant:"outline",size:"sm",className:"flex-1",onClick:f=>{f.stopPropagation(),window.location.replace(`/regulators/${t}`)},children:[e.jsx(Ha,{className:"mr-1.5 h-3.5 w-3.5"})," Details"]}),y&&e.jsx(P,{variant:"outline",size:"sm",asChild:!0,onClick:f=>f.stopPropagation(),children:e.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:e.jsx(Rt,{className:"h-3.5 w-3.5"})})})]})]}),GN=[{id:"reg-1",slug:"uk-gambling-commission",name:"UK Gambling Commission",acronym:"UKGC",country:"United Kingdom",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Bingo","Lottery"],licenseTypes:["B2C","B2B","Remote"],scopeTags:["Player Protection","AML","Advertising Standards"],establishedYear:2007,complianceRating:4.8,isPrimary:!0,website:"https://www.gamblingcommission.gov.uk",registerUrl:"https://www.gamblingcommission.gov.uk/public-register",description:"The UK Gambling Commission regulates all commercial gambling in Great Britain, ensuring fairness, preventing crime, and protecting vulnerable players. It is widely regarded as one of the most stringent regulators globally.",scope:"Covers all forms of remote and land-based gambling including casinos, betting, bingo, lotteries, and gaming machines. Applies to both B2C operators and B2B suppliers serving the UK market.",careerImplications:"UKGC regulation creates high demand for compliance professionals, responsible gaming specialists, and AML analysts. Companies operating under UKGC licenses typically maintain dedicated UK compliance teams.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring adherence to LCCP conditions and AML/CTF requirements."},{roleFamily:"Responsible Gaming",description:"Implementing player protection measures, self-exclusion systems, and affordability checks."},{roleFamily:"Legal & Regulatory",description:"Monitoring regulatory changes and managing license conditions."},{roleFamily:"Risk & Fraud",description:"Identifying and mitigating fraud, money laundering, and match-fixing risks."}],keyRequirements:["Player protection & affordability checks","Anti-money laundering controls","Advertising & marketing compliance","Regular regulatory returns & reporting","Customer interaction and social responsibility"],linkedMarkets:[{name:"United Kingdom",slug:"united-kingdom"}],linkedCompanies:[{name:"Entain",slug:"entain",evidenceLevel:"verified",evidenceUrl:"https://www.gamblingcommission.gov.uk/public-register",licenseId:"001-042579-R"},{name:"Flutter Entertainment",slug:"flutter-entertainment",evidenceLevel:"verified"},{name:"bet365",slug:"bet365",evidenceLevel:"self-reported"}]},{id:"reg-2",slug:"malta-gaming-authority",name:"Malta Gaming Authority",acronym:"MGA",country:"Malta",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery","Fantasy Sports"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection","Responsible Gaming"],establishedYear:2015,complianceRating:4.7,isPrimary:!0,website:"https://www.mga.org.mt",registerUrl:"https://www.mga.org.mt/licensee-register/",description:"The Malta Gaming Authority is one of the world's most respected online gaming regulators. Its licensing framework has made Malta the European hub for iGaming, hosting hundreds of licensed operators and suppliers.",scope:"Regulates all forms of remote gaming from Malta, including casino, sports betting, poker, and skill games. Covers both B2C operations and B2B critical supply.",careerImplications:"Malta's MGA licensing has created one of the largest iGaming talent markets globally. The concentration of licensed operators drives massive demand for compliance, tech, and commercial roles.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing MGA license compliance, player fund protection, and AML obligations."},{roleFamily:"Legal & Regulatory",description:"Navigating multi-jurisdictional licensing requirements with MGA as the primary license."},{roleFamily:"Product & Technology",description:"Building compliant gaming platforms that meet MGA technical standards."},{roleFamily:"Payments",description:"Managing payment processing within MGA regulatory frameworks."}],keyRequirements:["Player fund protection (segregated accounts)","Responsible gaming tools","AML/CFT compliance","Fit and proper assessments","Regular auditing and reporting"],linkedMarkets:[{name:"Malta",slug:"malta"}],linkedCompanies:[{name:"Betsson Group",slug:"betsson-group",evidenceLevel:"verified",evidenceUrl:"https://www.mga.org.mt/licensee-register/"},{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"verified"},{name:"LeoVegas",slug:"leovegas",evidenceLevel:"self-reported"}]},{id:"reg-3",slug:"kansspelautoriteit",name:"Kansspelautoriteit",acronym:"KSA",country:"Netherlands",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Remote"],scopeTags:["Player Protection","Advertising Restrictions","AML"],establishedYear:2012,complianceRating:4.5,website:"https://kansspelautoriteit.nl",description:"The Dutch Gaming Authority oversees the regulated online gambling market in the Netherlands, which opened in October 2021 under the Remote Gambling Act (KOA).",scope:"Regulates online casino and sports betting operators serving Dutch consumers. Known for strict advertising and bonus restrictions.",careerImplications:"The relatively new Dutch market creates demand for compliance experts who understand KSA-specific advertising restrictions and player protection requirements.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring compliance with Dutch Remote Gambling Act requirements."},{roleFamily:"Marketing Compliance",description:"Managing strict advertising limitations and bonus restrictions."}],keyRequirements:["Strict advertising limitations","Cooling-off period enforcement","Centraal Register Uitsluiting Kansspelen (CRUKS)","Player loss limits"],linkedMarkets:[{name:"Netherlands",slug:"netherlands"}],linkedCompanies:[{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"self-reported"}]},{id:"reg-4",slug:"agco-ontario",name:"Alcohol and Gaming Commission of Ontario",acronym:"AGCO",country:"Canada",region:"North America",jurisdiction:"State",sectors:["Sportsbook","Casino"],licenseTypes:["Operator","Supplier"],scopeTags:["Player Protection","Responsible Gaming","AML"],establishedYear:1998,complianceRating:4.4,isPrimary:!0,website:"https://www.agco.ca",description:"AGCO regulates Ontario's iGaming market through iGaming Ontario (iGO), which opened in April 2022 as Canada's first regulated province-level online gaming market.",scope:"Oversees online sports betting and casino gaming in Ontario through the iGaming Ontario subsidiary. Covers both operators and gaming-related suppliers.",careerImplications:"Ontario's market opening created North America's fastest-growing iGaming talent pool, with demand for professionals experienced in both North American and European regulatory frameworks.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting AGCO standards and FINTRAC reporting requirements."},{roleFamily:"Responsible Gaming",description:"Implementing Ontario-specific player protection measures."}],keyRequirements:["FINTRAC AML registration","Responsible gaming commitments","Play-management tools","Advertising standards compliance"],linkedMarkets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],linkedCompanies:[{name:"theScore",slug:"thescore",evidenceLevel:"self-reported"}]},{id:"reg-5",slug:"spelinspektionen",name:"Spelinspektionen",acronym:"SGA",country:"Sweden",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Commercial Online Gaming"],scopeTags:["Player Protection","Bonus Restrictions","AML"],establishedYear:2019,complianceRating:4.3,website:"https://www.spelinspektionen.se",description:"The Swedish Gambling Authority supervises the regulated online gambling market under the Gambling Act (2018:1138), which re-regulated the Swedish market in January 2019.",scope:"Regulates commercial online gaming licenses in Sweden, covering sports betting and casino. Known for strict bonus limitations (first deposit only).",careerImplications:"Sweden's strict regulatory environment requires deep compliance expertise, particularly around bonus restrictions and responsible gaming mandates.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing Swedish Gambling Act compliance and Spelpaus integration."},{roleFamily:"Responsible Gaming",description:"Implementing mandatory deposit limits and self-exclusion (Spelpaus)."}],keyRequirements:["Bonus restrictions (welcome bonus only)","Spelpaus self-exclusion system","Moderate gambling messaging","SEK 3-second delay on in-play betting"],linkedMarkets:[{name:"Sweden",slug:"sweden"}],linkedCompanies:[]},{id:"reg-6",slug:"njdge",name:"New Jersey Division of Gaming Enforcement",acronym:"NJDGE",country:"United States",region:"North America",jurisdiction:"State",sectors:["Casino","Sportsbook"],licenseTypes:["Casino Service Industry","Online Sports Wagering"],scopeTags:["Licensing","Testing","AML","Geolocation"],establishedYear:1977,complianceRating:4.6,website:"https://www.njoag.gov/about/divisions-and-offices/division-of-gaming-enforcement-home/",description:"The NJDGE oversees all legal gambling activity in New Jersey, including Atlantic City casinos and the pioneering online gaming market launched in 2013.",scope:"Regulates casino gaming, online casino, and sports betting within New Jersey. Requires partnership with a land-based casino licensee for online operations.",careerImplications:"New Jersey's mature regulated market drives demand for US-compliance specialists, geolocation experts, and professionals with Atlantic City experience.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating NJ DGE compliance requirements and BSA/AML obligations."},{roleFamily:"Geolocation & Identity",description:"Implementing geofencing and KYC solutions required for state-level licensing."}],keyRequirements:["Land-based casino partnership required","Geolocation verification","Server location within NJ or approved states","Background investigations for key employees"],linkedMarkets:[{name:"United States",slug:"united-states"}],linkedCompanies:[]},{id:"reg-7",slug:"curacao-gaming-control-board",name:"Curaçao Gaming Control Board",acronym:"GCB",country:"Curaçao",region:"Caribbean",jurisdiction:"National",sectors:["Casino","Sportsbook","Poker","Lottery"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","Reform","AML"],establishedYear:2023,complianceRating:3.2,website:"https://www.gcb.cw",description:"Curaçao is undergoing major regulatory reform, transitioning from the legacy e-gaming sublicense system to a new framework under the Gaming Control Board (GCB), established in 2023.",scope:"Covers all forms of online gambling operated from Curaçao. The reform introduces stricter AML, KYC, and player protection requirements to replace the previous master-sublicense model.",careerImplications:"The regulatory reform creates new compliance roles as operators transition from legacy sublicenses to GCB-compliant frameworks. Knowledge of transitional requirements is highly valued.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating the transition from legacy sublicenses to new GCB requirements."},{roleFamily:"Legal & Regulatory",description:"Managing re-licensing and compliance with the new ordinance."}],keyRequirements:["Transition from sublicense to GCB license","Enhanced KYC/AML obligations","Player protection measures","Local substance requirements"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-8",slug:"gibraltar-gambling-commissioner",name:"Gibraltar Gambling Commissioner",acronym:"GGC",country:"Gibraltar",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection"],establishedYear:2005,complianceRating:4.5,isPrimary:!0,website:"https://www.gibraltar.gov.gi/gambling",description:"Gibraltar's Gambling Commissioner oversees one of the longest-established online gambling jurisdictions. Several major global operators are headquartered or licensed in Gibraltar.",scope:"Regulates remote gambling operations from Gibraltar, covering sports betting, casino, and poker. Known for a pragmatic, business-friendly but high-standard regulatory approach.",careerImplications:"Gibraltar hosts headquarters of major operators like bet365, 888, and Lottoland, creating a dense talent market for senior commercial, tech, and compliance professionals.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting GGC requirements and managing multi-jurisdictional compliance."},{roleFamily:"Senior Leadership",description:"Many C-suite and director-level roles based in Gibraltar due to operator HQs."}],keyRequirements:["Physical presence in Gibraltar","Adequate financial resources","Fit and proper person tests","Player funds protection"],linkedMarkets:[{name:"Gibraltar",slug:"gibraltar"}],linkedCompanies:[{name:"bet365",slug:"bet365",evidenceLevel:"verified"},{name:"888 Holdings",slug:"888-holdings",evidenceLevel:"self-reported"}]},{id:"reg-9",slug:"dgoj-spain",name:"Dirección General de Ordenación del Juego",acronym:"DGOJ",country:"Spain",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["General","Singular"],scopeTags:["Advertising Restrictions","Player Protection","AML"],establishedYear:2011,complianceRating:4.2,website:"https://www.ordenacionjuego.es",description:"Spain's DGOJ regulates the country's online gambling market under Royal Decree 958/2020, which introduced strict advertising limitations including a near-total ban on gambling advertising.",scope:"Oversees online gambling licensing in Spain, covering general licenses (casino, sports betting, poker) and singular licenses (specific formats). Enforced strict advertising reforms in 2021.",careerImplications:"Spain's strict ad regulations require specialized marketing compliance expertise. The market's restrictions have shifted demand toward CRM, retention, and organic acquisition roles.",careerRoles:[{roleFamily:"Marketing Compliance",description:"Navigating Spain's advertising ban and permitted marketing channels."},{roleFamily:"CRM & Retention",description:"Driving growth through compliant retention strategies under ad restrictions."}],keyRequirements:["Near-complete advertising ban (post-2021)","Self-exclusion (RGIAJ) integration","Deposit limit enforcement","Session time reminders"],linkedMarkets:[{name:"Spain",slug:"spain"}],linkedCompanies:[]},{id:"reg-10",slug:"isle-of-man-gsc",name:"Isle of Man Gambling Supervision Commission",acronym:"GSC",country:"Isle of Man",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery"],licenseTypes:["Online Gambling","Network Services","Software Supplier"],scopeTags:["Remote Gaming","E-Gaming","AML"],establishedYear:1962,complianceRating:4.4,website:"https://www.gov.im/gambling/",description:"The Isle of Man GSC is one of the oldest gambling regulators and was among the first to regulate online gambling. The island hosts several major B2B suppliers and operators.",scope:"Regulates all forms of gambling from the Isle of Man, with a strong focus on e-gaming (online). Known for a business-supportive environment with robust standards.",careerImplications:"Home to major B2B suppliers like Microgaming (now Games Global) and PokerStars, the Isle of Man offers specialized roles in game development, platform engineering, and regulatory technology.",careerRoles:[{roleFamily:"Platform Engineering",description:"Building and maintaining gaming platforms for B2B suppliers."},{roleFamily:"Game Development",description:"Creating online slots and table games for global markets."}],keyRequirements:["Comprehensive player protection","Data protection compliance","AML/CFT measures","Technical testing and certification"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-11",slug:"pagcor",name:"Philippine Amusement and Gaming Corporation",acronym:"PAGCOR",country:"Philippines",region:"Asia-Pacific",jurisdiction:"National",sectors:["Casino","Sportsbook"],licenseTypes:["POGO","Domestic"],scopeTags:["Offshore Gaming","AML","POGO"],establishedYear:1976,complianceRating:3,website:"https://www.pagcor.ph",description:"PAGCOR is both a regulator and operator in the Philippines. It historically oversaw the POGO (Philippine Offshore Gaming Operator) program, though this sector faced significant reforms and restrictions.",scope:"Regulates land-based and online gambling in the Philippines. The POGO program licensed offshore operators serving Asian markets, though it has been significantly curtailed.",careerImplications:"Despite POGO restrictions, the Philippines remains a talent hub for live dealer operations, customer support, and Asian-market-facing roles.",careerRoles:[{roleFamily:"Live Dealer Operations",description:"Managing large-scale live casino studios serving Asian markets."},{roleFamily:"Customer Support",description:"Multilingual support for Asia-Pacific-facing operations."}],keyRequirements:["PAGCOR franchise/license","Local employment requirements","AML compliance","Revenue sharing with government"],linkedMarkets:[{name:"Philippines",slug:"philippines"}],linkedCompanies:[]},{id:"reg-12",slug:"kahnawake-gaming-commission",name:"Kahnawake Gaming Commission",acronym:"KGC",country:"Canada",region:"North America",jurisdiction:"Regional",sectors:["Casino","Sportsbook","Poker"],licenseTypes:["Interactive Gaming","Client Provider"],scopeTags:["First Nations","Remote Gaming","Player Protection"],establishedYear:1999,complianceRating:3.5,website:"https://www.gamingcommission.ca",description:"The Kahnawake Gaming Commission, based in the Mohawk Territory of Kahnawake near Montreal, is one of the earliest online gambling regulators. It operates under First Nations governance.",scope:"Licenses and regulates interactive gaming operations from the Mohawk Territory. Historically a major licensing jurisdiction for operators serving multiple markets.",careerImplications:"KGC-licensed operations create demand for compliance professionals familiar with both First Nations governance structures and international online gaming standards.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing KGC regulatory requirements and cross-border compliance."}],keyRequirements:["Hosting on Mohawk Internet Technologies servers","Player dispute resolution","Regular compliance auditing","Financial suitability assessments"],linkedMarkets:[],linkedCompanies:[]}],Jz=t=>GN.find(a=>a.slug===t),Kz=[{value:"authority",label:"Top authority"},{value:"name",label:"Name (A-Z)"},{value:"rating",label:"Highest compliance score"},{value:"established",label:"Longest standing"}],M9={region:[],country:[],jurisdiction:[],licenseTypes:[],sectors:[],scopeTags:[],signals:[]},Xz=({apiUrl:t,regulatorsData:a,itemsPerPage:s=9})=>{const[n,r]=p.useState(a??[]),[i,l]=p.useState(!a),[c,h]=p.useState(1),[d,u]=p.useState(s),[y,x]=p.useState(""),[m,g]=p.useState("authority"),[f,k]=p.useState("grid"),[v,N]=p.useState(M9);p.useEffect(()=>{if(a)return;let I=!0;const T=async()=>{try{if(!t){I&&r(GN);return}const A=await fetch(t);if(!A.ok)throw new Error(`${A.status}`);const R=await A.json();I&&Array.isArray(R)&&r(R)}catch(A){console.error("Failed to fetch regulators",A),I&&r(GN)}finally{I&&l(!1)}};return l(!0),T(),()=>{I=!1}},[t,a]);const M=p.useMemo(()=>{const I=T=>Array.from(new Set(T)).sort();return[{key:"region",label:"Region",type:"checkbox",options:I(n.map(T=>T.region)).map(T=>({value:T,label:T}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:I(n.map(T=>T.country)).map(T=>({value:T,label:T}))},{key:"jurisdiction",label:"Jurisdiction",type:"checkbox",options:I(n.map(T=>T.jurisdiction)).map(T=>({value:T,label:T}))},{key:"licenseTypes",label:"License Types",type:"checkbox",searchable:!0,options:I(n.flatMap(T=>T.licenseTypes)).map(T=>({value:T,label:T}))},{key:"sectors",label:"Sectors",type:"checkbox",searchable:!0,options:I(n.flatMap(T=>T.sectors)).map(T=>({value:T,label:T}))},{key:"scopeTags",label:"Scope",type:"checkbox",options:I(n.flatMap(T=>T.scopeTags)).map(T=>({value:T,label:T}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"primary",label:"Primary only"}]}]},[n]),b=p.useMemo(()=>Object.entries(v).flatMap(([I,T])=>T.map(A=>({key:I,label:I.charAt(0).toUpperCase()+I.slice(1),value:A,onRemove:()=>N(R=>({...R,[I]:(R[I]??[]).filter(D=>D!==A)}))}))),[v]),C=p.useMemo(()=>{const I=y.trim().toLowerCase();return n.filter(T=>!(I&&!`${T.name} ${T.acronym} ${T.country} ${T.region}`.toLowerCase().includes(I)||v.region.length&&!v.region.includes(T.region)||v.country.length&&!v.country.includes(T.country)||v.jurisdiction.length&&!v.jurisdiction.includes(T.jurisdiction)||v.licenseTypes.length&&!v.licenseTypes.every(A=>T.licenseTypes.includes(A))||v.sectors.length&&!v.sectors.every(A=>T.sectors.includes(A))||v.scopeTags.length&&!v.scopeTags.every(A=>T.scopeTags.includes(A))||v.signals.includes("primary")&&!T.isPrimary))},[v,n,y]),S=p.useMemo(()=>{const I=[...C];return I.sort((T,A)=>{switch(m){case"name":return T.name.localeCompare(A.name);case"rating":return A.complianceRating-T.complianceRating;case"established":return T.establishedYear-A.establishedYear;default:return Number(A.isPrimary)-Number(T.isPrimary)||A.complianceRating-T.complianceRating}}),I},[C,m]);p.useEffect(()=>{h(1)},[y,v,d]);const L=Math.max(1,Math.ceil(S.length/d)),w=S.slice((c-1)*d,c*d),j=()=>N(M9);return e.jsx(Za,{title:"Regulators",description:"Review licensing authorities, jurisdictions, and regulatory scope across the global iGaming industry.",search:{value:y,onChange:x,onSubmit:x,onClear:()=>x(""),placeholder:"Search by name or acronym (e.g. MGA)"},filters:M,filterValues:v,onFilterChange:(I,T)=>N(A=>({...A,[I]:T})),onClearFilters:j,activeFilters:b,sort:{value:m,options:Kz,onChange:g},viewMode:f,onViewModeChange:k,pagination:{page:c,pageSize:d,totalPages:L,totalCount:S.length,toolbarTotalCount:n.length,toolbarTitle:"Regulatory Authorities",toolbarItemLabel:"regulators",onPageChange:h,onPageSizeChange:I=>{u(I),h(1)}},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:i?e.jsx(Wa,{totalColumns:d}):w.length?w.map(I=>e.jsx(Yz,{id:I.id,slug:I.slug,name:I.name,acronym:I.acronym,country:I.country,region:I.region,jurisdiction:I.jurisdiction,sectors:I.sectors,licenseTypes:I.licenseTypes,scopeTags:I.scopeTags,establishedYear:I.establishedYear,complianceRating:I.complianceRating,website:I.website,isPrimary:I.isPrimary,description:I.description,viewMode:f},I.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(fs,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No regulators found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:j,children:"Clear all filters"})]})})},Qz={Active:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",Reforming:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20",Emerging:"bg-accent/10 text-accent border-accent/20",Restricted:"bg-destructive/10 text-destructive border-destructive/20"},eq=({slug:t,name:a,region:s,status:n,regulatorNames:r,notes:i,gamblingSectors:l,keyFacts:c,onNavigate:h})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:s}),e.jsx(O,{variant:"outline",className:Qz[n]??"",children:n})]}),e.jsxs("h3",{className:"mb-1 text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Fe,{className:"h-4 w-4 text-accent flex-shrink-0"}),a]}),e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:i}),e.jsx("div",{className:"mb-3 space-y-1.5",children:r.map(d=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-foreground",children:[e.jsx(Ta,{className:"h-3.5 w-3.5 text-gaming-success flex-shrink-0"}),d]},d))}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:l.slice(0,4).map(d=>e.jsx(O,{variant:"outline",className:"text-xs",children:d},d))}),c.length>0&&e.jsx("div",{className:"mb-3 space-y-1",children:c.slice(0,2).map(d=>e.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[e.jsx(ac,{className:"h-3 w-3 mt-0.5 flex-shrink-0 text-accent"}),d]},d))}),h&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",onClick:()=>h(t),children:"View Jurisdiction Details"})]}),tq=[{id:"jur-1",slug:"united-kingdom",name:"United Kingdom",region:"Europe",status:"Active",regulatorIds:["reg-1"],regulatorNames:["UK Gambling Commission (UKGC)"],notes:"One of the most mature and strictly regulated online gambling markets globally. The Gambling Act 2005 provides the primary legal framework.",markets:[{name:"United Kingdom",slug:"united-kingdom"}],gamblingSectors:["Casino","Sportsbook","Bingo","Lottery","Poker"],keyFacts:["Gambling Act 2005 (updated 2023 White Paper)","Mandatory affordability checks","Strict advertising standards"]},{id:"jur-2",slug:"malta",name:"Malta",region:"Europe",status:"Active",regulatorIds:["reg-2"],regulatorNames:["Malta Gaming Authority (MGA)"],notes:"Europe's primary iGaming hub with 300+ licensed companies. The Gaming Act (2018) modernized the regulatory framework.",markets:[{name:"Malta",slug:"malta"}],gamblingSectors:["Casino","Sportsbook","Poker","Fantasy Sports"],keyFacts:["300+ licensed operators","Gaming Act 2018","EU single-market passporting advantages"]},{id:"jur-3",slug:"netherlands",name:"Netherlands",region:"Europe",status:"Active",regulatorIds:["reg-3"],regulatorNames:["Kansspelautoriteit (KSA)"],notes:"Market opened October 2021 under the Remote Gambling Act (KOA). Strict advertising and bonus restrictions introduced rapidly.",markets:[{name:"Netherlands",slug:"netherlands"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Remote Gambling Act (KOA) - 2021","CRUKS self-exclusion system","Advertising ban from 2025"]},{id:"jur-4",slug:"ontario-canada",name:"Ontario, Canada",region:"North America",status:"Active",regulatorIds:["reg-4"],regulatorNames:["AGCO / iGaming Ontario"],notes:"Canada's first provincially regulated iGaming market, launched April 2022. Rapidly became one of North America's largest markets.",markets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Launched April 2022","40+ licensed operators in year one","FINTRAC AML registration required"]},{id:"jur-5",slug:"sweden",name:"Sweden",region:"Europe",status:"Active",regulatorIds:["reg-5"],regulatorNames:["Spelinspektionen (SGA)"],notes:"Re-regulated in January 2019 with the Swedish Gambling Act. Known for restrictive bonus rules and the Spelpaus self-exclusion system.",markets:[{name:"Sweden",slug:"sweden"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Welcome bonus only (no reload bonuses)","Spelpaus mandatory self-exclusion","3-second delay on in-play bets"]},{id:"jur-6",slug:"curacao",name:"Curaçao",region:"Caribbean",status:"Reforming",regulatorIds:["reg-7"],regulatorNames:["Curaçao Gaming Control Board (GCB)"],notes:"Undergoing major reform from the legacy sublicense system to a modern regulatory framework under the GCB. Transition period through 2025–2026.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Reform ordinance enacted 2023","Legacy sublicenses being phased out","Enhanced KYC/AML requirements"]},{id:"jur-7",slug:"gibraltar",name:"Gibraltar",region:"Europe",status:"Active",regulatorIds:["reg-8"],regulatorNames:["Gibraltar Gambling Commissioner (GGC)"],notes:"One of the original online gambling jurisdictions. Home to major operator headquarters including bet365 and 888.",markets:[{name:"Gibraltar",slug:"gibraltar"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Major operator HQ hub","Business-friendly regulation","Physical presence required"]},{id:"jur-8",slug:"spain",name:"Spain",region:"Europe",status:"Active",regulatorIds:["reg-9"],regulatorNames:["DGOJ"],notes:"Strict advertising restrictions introduced in 2021 under Royal Decree 958/2020 have significantly impacted operator marketing strategies.",markets:[{name:"Spain",slug:"spain"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Near-total advertising ban since 2021","RGIAJ self-exclusion register","Strict bonus limitations"]},{id:"jur-9",slug:"isle-of-man",name:"Isle of Man",region:"Europe",status:"Active",regulatorIds:["reg-10"],regulatorNames:["Gambling Supervision Commission (GSC)"],notes:"Pioneer in e-gaming regulation. Home to major B2B suppliers and platform providers.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker","Lottery"],keyFacts:["One of the first online gaming jurisdictions","Strong B2B supplier presence","Tax-efficient structure"]},{id:"jur-10",slug:"philippines",name:"Philippines",region:"Asia-Pacific",status:"Reforming",regulatorIds:["reg-11"],regulatorNames:["PAGCOR"],notes:"Historically a major hub for offshore gaming operations (POGO). Significant regulatory reforms and restrictions have been introduced.",markets:[{name:"Philippines",slug:"philippines"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["POGO sector curtailed","Major live dealer studio hub","Government ownership of PAGCOR"]},{id:"jur-11",slug:"new-jersey-us",name:"New Jersey, USA",region:"North America",status:"Active",regulatorIds:["reg-6"],regulatorNames:["NJ Division of Gaming Enforcement"],notes:"The first US state to launch legal online casino (2013) and among the first for sports betting post-PASPA repeal (2018).",markets:[{name:"United States",slug:"united-states"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Pioneer US online gambling state","Casino partnership required","Strict geolocation requirements"]}],aq=[{value:"name",label:"Name (A-Z)"},{value:"status",label:"Status"},{value:"regulators",label:"Most regulators"}],N9={region:[],status:[],sectors:[]},sq=({jurisdictionsData:t})=>{const[a]=p.useState(t??tq),[s,n]=p.useState(!0),[r,i]=p.useState(1),[l,c]=p.useState(9),[h,d]=p.useState(""),[u,y]=p.useState("name"),[x,m]=p.useState("grid"),[g,f]=p.useState(N9);p.useEffect(()=>{const L=setTimeout(()=>n(!1),300);return()=>clearTimeout(L)},[]);const k=p.useMemo(()=>{const L=w=>Array.from(new Set(w)).sort();return[{key:"region",label:"Region",type:"checkbox",options:L(a.map(w=>w.region)).map(w=>({value:w,label:w}))},{key:"status",label:"Status",type:"checkbox",options:L(a.map(w=>w.status)).map(w=>({value:w,label:w}))},{key:"sectors",label:"Gambling Sectors",type:"checkbox",options:L(a.flatMap(w=>w.gamblingSectors)).map(w=>({value:w,label:w}))}]},[a]),v=p.useMemo(()=>Object.entries(g).flatMap(([L,w])=>w.map(j=>({key:L,label:L.charAt(0).toUpperCase()+L.slice(1),value:j,onRemove:()=>f(I=>({...I,[L]:(I[L]??[]).filter(T=>T!==j)}))}))),[g]),N=p.useMemo(()=>{const L=h.trim().toLowerCase();return a.filter(w=>!(L&&!`${w.name} ${w.region} ${w.regulatorNames.join(" ")}`.toLowerCase().includes(L)||g.region.length&&!g.region.includes(w.region)||g.status.length&&!g.status.includes(w.status)||g.sectors.length&&!g.sectors.every(j=>w.gamblingSectors.includes(j))))},[g,a,h]),M=p.useMemo(()=>{const L=[...N];return L.sort((w,j)=>{switch(u){case"status":return w.status.localeCompare(j.status);case"regulators":return j.regulatorNames.length-w.regulatorNames.length;default:return w.name.localeCompare(j.name)}}),L},[N,u]);p.useEffect(()=>{i(1)},[h,g,l]);const b=Math.max(1,Math.ceil(M.length/l)),C=M.slice((r-1)*l,r*l),S=()=>f(N9);return e.jsx(Za,{title:"Jurisdictions",description:"Explore regulated gambling jurisdictions, their status, and governing authorities.",search:{value:h,onChange:d,onSubmit:d,onClear:()=>d(""),placeholder:"Search jurisdictions"},filters:k,filterValues:g,onFilterChange:(L,w)=>f(j=>({...j,[L]:w})),onClearFilters:S,activeFilters:v,sort:{value:u,options:aq,onChange:y},viewMode:x,onViewModeChange:m,pagination:{page:r,pageSize:l,totalPages:b,totalCount:M.length,toolbarTotalCount:a.length,toolbarTitle:"Jurisdictions",toolbarItemLabel:"jurisdictions",onPageChange:i,onPageSizeChange:L=>{c(L),i(1)}},resultsClassName:x==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:s?e.jsx(Wa,{totalColumns:l}):C.length?C.map(L=>e.jsx(eq,{...L,viewMode:x},L.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Fe,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jurisdictions found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:S,children:"Clear all filters"})]})})},nq=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(""),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState("EUR"),[m,g]=p.useState(""),[f,k]=p.useState(!1),[v,N]=p.useState(!1),M=n.trim().length>=2&&i.trim().length>=5&&c.trim().length>=30&&m,b=()=>{M&&(s==null||s({companyName:n.trim(),title:i.trim(),body:c.trim(),amount:d.trim()||void 0,currency:d.trim()?y:void 0,relationship:m,isAnonymous:f}),N(!0))},C=()=>{r(""),l(""),h(""),u(""),x("EUR"),g(""),k(!1),N(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:C,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:v?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Complaint Submitted"}),e.jsx(it,{className:"text-center",children:"Your complaint has been received. We will review it and notify the company. You'll receive updates on the resolution process within 48 hours."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:C,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-destructive/10 flex items-center justify-center mb-2",children:e.jsx(ea,{className:"w-6 h-6 text-destructive"})}),e.jsx(Le,{children:"Submit a Complaint"}),e.jsx(it,{children:"File a formal complaint against an iGaming company. All complaints are reviewed before publishing and the company will be notified."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Company Name *"}),e.jsx(ae,{placeholder:"Enter the company name",value:n,onChange:S=>r(S.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Your Relationship *"}),e.jsxs(Ye,{value:m,onValueChange:g,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"How do you know this company?"})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"affiliate",children:"Affiliate / Partner"}),e.jsx(me,{value:"operator",children:"Operator / Client"}),e.jsx(me,{value:"employee",children:"Current/Former Employee"}),e.jsx(me,{value:"streamer",children:"Streamer / Influencer"}),e.jsx(me,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Complaint Title *"}),e.jsx(ae,{placeholder:"Briefly describe the issue",value:i,onChange:S=>l(S.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Describe the Issue *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 30 characters)"})]}),e.jsx(rt,{placeholder:"Provide detailed information about your complaint, including dates, communications, and any evidence...",value:c,onChange:S=>h(S.target.value),rows:5,maxLength:3e3})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Amount ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ae,{type:"number",placeholder:"e.g. 5000",value:d,onChange:S=>u(S.target.value),min:0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Currency"}),e.jsxs(Ye,{value:y,onValueChange:x,children:[e.jsx(Ue,{children:e.jsx(Je,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"EUR",children:"EUR"}),e.jsx(me,{value:"USD",children:"USD"}),e.jsx(me,{value:"GBP",children:"GBP"}),e.jsx(me,{value:"BTC",children:"BTC"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your identity won't be revealed publicly"})]}),e.jsx(vt,{checked:f,onCheckedChange:k})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this complaint is based on genuine experience. False or malicious complaints may result in account action."})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:C,children:"Cancel"}),e.jsx(P,{variant:"destructive",onClick:b,disabled:!M,children:"Submit Complaint"})]})]})})})},rq=[{id:"cmp-1",companyId:"alpha-affiliates",companySlug:"alpha-affiliates",companyName:"Alpha Affiliates",title:"Payment Delayed",body:"I'm posting because the situation with Alpha Affiliates (ViciBet) is unacceptable. Payments have been delayed for over 3 months with no clear communication from their team despite multiple follow-ups.",amount:"884",currency:"EUR",status:"unresolved",createdAt:"2026-02-16T10:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-2",companyId:"duelbits",companySlug:"duelbits",companyName:"Duelbits",title:"Unpaid Affiliate Commissions",body:"I am filing this complaint because Duelbits has failed to pay my affiliate commissions for the last two months. Despite providing all required documentation and following their payment process, I have received no response.",amount:"6076",currency:"USD",status:"resolved",createdAt:"2026-01-20T14:30:00Z",authorDisplayName:"Mike D.",isAnonymous:!1},{id:"cmp-3",companyId:"amigomedia",companySlug:"amigomedia",companyName:"AmigoMedia",title:"CPA Traffic Fraud Warning",body:"We are posting this as a formal, transparent complaint regarding our CPA campaign with AmigoMedia. After investigation, we found significant traffic quality issues including bot traffic and fake registrations.",amount:"4000",currency:"EUR",status:"resolved",createdAt:"2025-12-15T09:15:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-4",companyId:"eurogesee",companySlug:"eurogesee",companyName:"EUrogesee",title:"Complaint against EUrogesee for not abiding by the deal's conditions",body:"On December 5th we agreed on a 5 stream deal with the streamer. After the first two streams, EUrogesee changed the terms unilaterally without our consent, violating the original agreement.",amount:"200",currency:"EUR",status:"resolved",createdAt:"2025-12-01T16:00:00Z",authorDisplayName:"StreamerPro",isAnonymous:!1},{id:"cmp-5",companyId:"chilistakes",companySlug:"chilistakes",companyName:"Chilistakes",title:"Commission not fulfilled",body:"Following our initial contact in mid-September, we formalized our partnership agreement. Despite meeting all KPIs and delivering quality traffic, Chilistakes has not paid the agreed commission structure.",amount:"2880",currency:"EUR",status:"unresolved",createdAt:"2025-11-15T11:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-6",companyId:"streamer-rustyk",companySlug:"streamer-rustyk",companyName:"Streamer Rustyk",title:"Using fake account to boost results and taking payment but not streaming",body:"The streamer tried to boost his FTDs by creating fake accounts. After receiving the initial payment, they stopped streaming entirely and became unresponsive to all communication attempts.",amount:"770",currency:"EUR",status:"resolved",createdAt:"2025-11-10T08:30:00Z",authorDisplayName:"CasinoOps Team",isAnonymous:!1},{id:"cmp-7",companyId:"betmax-partners",companySlug:"betmax-partners",companyName:"BetMax Partners",title:"Revenue share calculation discrepancy",body:"We have discovered significant discrepancies in our revenue share calculations over the past 4 months. The reported net revenue does not match our own tracking data, resulting in underpayment of commissions.",amount:"3200",currency:"USD",status:"open",createdAt:"2026-02-05T12:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-8",companyId:"lucky-streak",companySlug:"lucky-streak",companyName:"Lucky Streak",title:"Integration support abandoned mid-project",body:"After signing a contract and beginning integration, Lucky Streak's technical support became completely unresponsive. We've invested significant development resources and cannot proceed without their API documentation updates.",amount:"15000",currency:"EUR",status:"open",createdAt:"2026-01-28T10:00:00Z",authorDisplayName:"DevTeam Lead",isAnonymous:!1}],AI={resolved:{label:"RESOLVED",color:"text-gaming-success",bgColor:"bg-gaming-success",icon:Tt},open:{label:"OPEN",color:"text-gaming-warning",bgColor:"bg-gaming-warning",icon:$t},unresolved:{label:"UNRESOLVED",color:"text-destructive",bgColor:"bg-destructive",icon:Na}},mN=9,iq=({complaintsData:t,onSubmitComplaint:a})=>{const[s,n]=p.useState("all"),[r,i]=p.useState("newest"),[l,c]=p.useState(1),[h,d]=p.useState(!1),u=t??rq,y=p.useCallback(k=>{a==null||a(k),console.log("[Complaints] Submit complaint:",k)},[a]),x=p.useMemo(()=>{let k=[...u];switch(s!=="all"&&(k=k.filter(v=>v.status===s)),r){case"newest":k.sort((v,N)=>new Date(N.createdAt).getTime()-new Date(v.createdAt).getTime());break;case"oldest":k.sort((v,N)=>new Date(v.createdAt).getTime()-new Date(N.createdAt).getTime());break;case"amount-high":k.sort((v,N)=>(Number(N.amount)||0)-(Number(v.amount)||0));break;case"amount-low":k.sort((v,N)=>(Number(v.amount)||0)-(Number(N.amount)||0));break}return k},[u,s,r]),m=Math.ceil(x.length/mN),g=x.slice((l-1)*mN,l*mN),f=p.useMemo(()=>{const k={resolved:0,open:0,unresolved:0};return u.forEach(v=>k[v.status]++),k},[a]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-destructive/10 flex items-center justify-center",children:e.jsx(ea,{className:"w-5 h-5 text-destructive"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Complaints"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Transparency matters. Browse and submit complaints about iGaming companies. We mediate disputes to help both parties reach a fair resolution."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"lg:col-span-3",children:[g.length===0?e.jsx(U,{children:e.jsxs(W,{className:"py-16 text-center",children:[e.jsx(ea,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No complaints found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:g.map(k=>e.jsx(oq,{complaint:k},k.id))}),m>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:m},(k,v)=>e.jsx(P,{variant:l===v+1?"accent":"outline",size:"sm",onClick:()=>c(v+1),children:v+1},v))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(P,{variant:"accent",className:"w-full gap-2",onClick:()=>d(!0),children:[e.jsx(ea,{className:"w-4 h-4"}),"Submit Complaint"]}),e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsx("button",{onClick:()=>{n("all"),c(1)},className:`text-sm font-medium w-full text-left px-2 py-1 rounded ${s==="all"?"text-accent":"text-muted-foreground hover:text-foreground"}`,children:"All complaints"}),["resolved","open","unresolved"].map(k=>{const v=AI[k];return e.jsxs("button",{onClick:()=>{n(k),c(1)},className:`flex items-center gap-2 text-sm w-full text-left px-2 py-1 rounded ${s===k?"text-accent font-medium":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${v.bgColor}`}),v.label," (",f[k],")"]},k)}),s!=="all"&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full mt-2",onClick:()=>{n("all"),c(1)},children:"Clear filter"})]})}),e.jsx(U,{children:e.jsxs(W,{className:"p-4",children:[e.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Sort by"}),e.jsxs(Ye,{value:r,onValueChange:k=>{i(k),c(1)},children:[e.jsx(Ue,{children:e.jsx(Je,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"newest",children:"Newest"}),e.jsx(me,{value:"oldest",children:"Oldest"}),e.jsx(me,{value:"amount-high",children:"Highest amount"}),e.jsx(me,{value:"amount-low",children:"Lowest amount"})]})]})]})})]})]})]}),e.jsx(nq,{open:h,onOpenChange:d,onSubmit:y}),e.jsx(cl,{})]})},oq=({complaint:t})=>{const a=AI[t.status],s=a.icon;return e.jsxs(U,{className:"overflow-hidden border-border/50 hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:`${a.bgColor} py-6 flex flex-col items-center justify-center text-white`,children:[e.jsx(s,{className:"w-10 h-10 mb-2"}),e.jsx("span",{className:"font-bold text-sm tracking-wider",children:a.label})]}),e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-sm text-foreground line-clamp-2 leading-snug",children:[t.title," – ",t.companyName]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3 leading-relaxed",children:t.body}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[t.amount&&e.jsxs("span",{className:"text-sm font-semibold text-foreground",children:[t.amount," ",t.currency]}),e.jsxs(O,{variant:"outline",className:`text-xs ${a.color} border-current`,children:["STATUS: ",a.label]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Gt,{className:"w-3 h-3"}),CC(new Date(t.createdAt),{addSuffix:!0})]})]})]})},lq={sm:"w-3.5 h-3.5",md:"w-5 h-5",lg:"w-6 h-6"},Gc=({rating:t,maxRating:a=5,size:s="md",interactive:n=!1,onRatingChange:r})=>e.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:a},(i,l)=>{const c=l<t;return e.jsx("button",{type:"button",disabled:!n,onClick:()=>n&&(r==null?void 0:r(l+1)),className:n?"cursor-pointer hover:scale-110 transition-transform":"cursor-default",children:e.jsx(tt,{className:`${lq[s]} ${c?"fill-gaming-gold text-gaming-gold":"fill-transparent text-muted-foreground/30"}`})},l)})}),cq=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(0),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState(""),[m,g]=p.useState(""),[f,k]=p.useState(""),[v,N]=p.useState(!1),[M,b]=p.useState(!1),C=n.trim().length>=2&&i>0&&c.trim().length>=5&&d.trim().length>=20&&f,S=()=>{!C||i===0||(s==null||s({companyName:n.trim(),title:c.trim(),body:d.trim(),rating:i,pros:y.trim()||void 0,cons:m.trim()||void 0,relationship:f,isAnonymous:v}),b(!0))},L=()=>{r(""),l(0),h(""),u(""),x(""),g(""),k(""),N(!1),b(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:L,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:M?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Review Submitted!"}),e.jsx(it,{className:"text-center",children:"Thank you for your review. It will be published after moderation (usually within 24-48 hours)."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:L,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-accent/20 to-primary/20 flex items-center justify-center mb-2",children:e.jsx(ft,{className:"w-6 h-6 text-accent"})}),e.jsx(Le,{children:"Write a Review"}),e.jsx(it,{children:"Share your experience with an iGaming company. All reviews are moderated before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Company Name *"}),e.jsx(ae,{placeholder:"Enter the company you're reviewing",value:n,onChange:w=>r(w.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Overall Rating *"}),e.jsx(Gc,{rating:i,size:"lg",interactive:!0,onRatingChange:w=>l(w)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Your Relationship *"}),e.jsxs(Ye,{value:f,onValueChange:k,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"How do you know this company?"})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"employee",children:"Current/Former Employee"}),e.jsx(me,{value:"client",children:"Client / Customer"}),e.jsx(me,{value:"partner",children:"Business Partner"}),e.jsx(me,{value:"competitor",children:"Industry Peer"}),e.jsx(me,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Review Title *"}),e.jsx(ae,{placeholder:"Summarize your experience in a few words",value:c,onChange:w=>h(w.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Your Review * ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(rt,{placeholder:"Share details about your experience...",value:d,onChange:w=>u(w.target.value),rows:4,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Pros ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(rt,{placeholder:"What did you like?",value:y,onChange:w=>x(w.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Cons ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(rt,{placeholder:"What could be improved?",value:m,onChange:w=>g(w.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your name won't be shown publicly"})]}),e.jsx(vt,{checked:v,onCheckedChange:N})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this review is based on genuine experience and complies with our community guidelines."})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:L,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:S,disabled:!C,children:"Submit Review"})]})]})})})},dq=[{id:"rev-1",companyId:"evolution",companySlug:"evolution",author:{id:"u1",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Outstanding Announcement Video by Evolution",body:"Evolution delivered an outstanding announcement video for our ICE Barcelona 2026 campaign. Their attention to detail, creativity, and professionalism made the entire process seamless. Extremely smooth to work with. We couldn't be happier with the result.",rating:5,pros:"Great culture, competitive salary, innovative products",cons:"Fast-paced environment can be demanding",status:"published",reactions:{useful:12,notUseful:1},createdAt:"2026-01-15T10:00:00Z",isVerified:!0,helpfulCount:12},{id:"rev-2",companyId:"evolution",companySlug:"evolution",author:{id:"u2",displayName:"Sarah M.",isAnonymous:!1,jobTitle:"Product Manager",relationship:"client"},title:"Reliable B2B partner for live casino",body:"We've been working with Evolution for over 3 years. Their live casino platform is best-in-class and their integration support is excellent. API documentation could be improved but overall a great partner.",rating:4,pros:"Best live casino product, reliable platform, great support team",cons:"API documentation could be more detailed",status:"published",reactions:{useful:8,notUseful:2},createdAt:"2025-11-20T14:30:00Z",isVerified:!0,helpfulCount:8},{id:"rev-3",companyId:"evolution",companySlug:"evolution",author:{id:"u3",displayName:"James K.",isAnonymous:!1,jobTitle:"CTO",relationship:"partner"},title:"Solid technology but expensive",body:"The technology is world-class and their game portfolio is unmatched. However, the pricing can be prohibitive for smaller operators. Great for established brands that can afford premium rates.",rating:3,pros:"World-class technology, huge game portfolio",cons:"High pricing, long contract negotiations",status:"published",reactions:{useful:15,notUseful:3},createdAt:"2025-09-05T09:15:00Z",isVerified:!1,helpfulCount:15},{id:"rev-4",companyId:"pragmatic-play",companySlug:"pragmatic-play",author:{id:"u4",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Great place to grow your career",body:"Pragmatic Play offers incredible learning opportunities. The team is talented and the company is growing fast. Work-life balance could be better during peak release periods.",rating:4,pros:"Career growth, talented team, innovative products",cons:"Work-life balance during crunch periods",status:"published",reactions:{useful:6,notUseful:0},createdAt:"2026-02-01T11:00:00Z",isVerified:!0,helpfulCount:6},{id:"rev-5",companyId:"betsson",companySlug:"betsson",author:{id:"u5",displayName:"Maria L.",isAnonymous:!1,jobTitle:"Affiliate Manager",relationship:"partner"},title:"Excellent affiliate program",body:"Betsson's affiliate program is one of the best in the industry. Transparent reporting, timely payments, and a dedicated affiliate manager who actually responds. Highly recommended for affiliates.",rating:5,pros:"Transparent reporting, timely payments, dedicated support",cons:"Could offer more creative materials",status:"published",reactions:{useful:20,notUseful:1},createdAt:"2025-12-10T16:45:00Z",isVerified:!0,helpfulCount:20},{id:"rev-6",companyId:"softswiss",companySlug:"softswiss",author:{id:"u6",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Innovative tech company with great perks",body:"SOFTSWISS is one of the best employers in the iGaming B2B space. The engineering culture is strong, Agile is done properly, and remote work is genuinely supported. Salaries are competitive for the region. Only downside is some bureaucracy as the company scales.",rating:5,pros:"Remote-friendly, strong engineering culture, competitive pay",cons:"Growing bureaucracy, some slow decision-making",status:"published",reactions:{useful:18,notUseful:2},createdAt:"2026-02-10T09:00:00Z",isVerified:!0,helpfulCount:18},{id:"rev-7",companyId:"softswiss",companySlug:"softswiss",author:{id:"u7",displayName:"Alex R.",isAnonymous:!1,jobTitle:"Integration Manager",relationship:"client"},title:"Reliable platform, responsive support",body:"We migrated our casino to SOFTSWISS last year. The migration was smooth, the game aggregator is excellent, and their support team is very responsive. The back-office tools could use a UI refresh but functionally they're solid.",rating:4,pros:"Smooth integration, vast game aggregator, responsive support",cons:"Back-office UI feels dated",status:"published",reactions:{useful:9,notUseful:1},createdAt:"2025-10-22T13:00:00Z",isVerified:!0,helpfulCount:9},{id:"rev-8",companyId:"softswiss",companySlug:"softswiss",author:{id:"u8",displayName:"Dmitry V.",isAnonymous:!1,jobTitle:"COO",relationship:"partner"},title:"Strong crypto-first platform",body:"If you're looking for the best crypto casino platform, SOFTSWISS is the clear leader. Their crypto payment processing is seamless and they understand the regulatory nuances of crypto gambling better than anyone else in the space.",rating:5,pros:"Best-in-class crypto support, regulatory expertise, scalable infrastructure",cons:"Premium pricing for smaller operators",status:"published",reactions:{useful:14,notUseful:0},createdAt:"2025-08-15T10:30:00Z",isVerified:!1,helpfulCount:14},{id:"rev-9",companyId:"microgaming",companySlug:"microgaming",author:{id:"u9",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Legacy brand with a lot of history",body:"Microgaming has a rich history in iGaming. The brand carries a lot of weight and the game portfolio is huge. However, the company feels a bit behind on modern tech compared to newer competitors.",rating:3,pros:"Brand recognition, massive game library, stable company",cons:"Slower innovation, legacy tech stack",status:"published",reactions:{useful:7,notUseful:3},createdAt:"2025-07-20T08:00:00Z",isVerified:!0,helpfulCount:7},{id:"rev-10",companyId:"playtech",companySlug:"playtech",author:{id:"u10",displayName:"Lisa T.",isAnonymous:!1,jobTitle:"Head of Content",relationship:"client"},title:"Comprehensive omni-channel solution",body:"Playtech offers one of the most comprehensive omni-channel solutions in the market. Their IMS platform is powerful and their live casino rivals Evolution. The integration process is lengthy though and requires significant resources.",rating:4,pros:"Omni-channel platform, powerful IMS, strong live casino",cons:"Complex integration, lengthy onboarding",status:"published",reactions:{useful:11,notUseful:2},createdAt:"2026-01-05T15:00:00Z",isVerified:!0,helpfulCount:11},{id:"rev-11",companyId:"betconstruct",companySlug:"betconstruct",author:{id:"u11",displayName:"Anonymous",isAnonymous:!0,relationship:"client"},title:"Good sportsbook, needs UX work",body:"BetConstruct's sportsbook platform is feature-rich and covers a wide range of markets. The odds engine is competitive. However, the front-end templates need modernization and the documentation could be clearer.",rating:3,pros:"Feature-rich sportsbook, competitive odds, good market coverage",cons:"Outdated UX templates, unclear documentation",status:"published",reactions:{useful:5,notUseful:1},createdAt:"2025-12-28T11:00:00Z",isVerified:!1,helpfulCount:5},{id:"rev-12",companyId:"yggdrasil",companySlug:"yggdrasil",author:{id:"u12",displayName:"Tom H.",isAnonymous:!1,jobTitle:"Game Designer",relationship:"employee"},title:"Creative freedom and cutting-edge tools",body:"Working at Yggdrasil as a game designer was an amazing experience. The GATI framework gives studios real creative freedom. The company culture genuinely celebrates innovation and quality over quantity.",rating:5,pros:"Creative freedom, innovative GATI framework, quality-first culture",cons:"Smaller scale compared to the big players",status:"published",reactions:{useful:16,notUseful:0},createdAt:"2026-02-18T10:00:00Z",isVerified:!0,helpfulCount:16}],hq=()=>dq.filter(t=>t.status==="published"),pN=12,uq=({reviewsData:t,onLeaveReview:a})=>{const s=p.useMemo(()=>t??hq(),[t]),[n,r]=p.useState(""),[i,l]=p.useState("newest"),[c,h]=p.useState("all"),[d,u]=p.useState(1),[y,x]=p.useState(!1),m=p.useCallback(N=>{a==null||a(N),console.log("[Reviews] Leave review:",N)},[a]),g=p.useMemo(()=>{let N=[...s];if(n.trim()){const M=n.toLowerCase();N=N.filter(b=>b.title.toLowerCase().includes(M)||b.body.toLowerCase().includes(M)||b.companySlug.toLowerCase().includes(M))}switch(c!=="all"&&(N=N.filter(M=>M.rating===Number(c))),i){case"newest":N.sort((M,b)=>new Date(b.createdAt).getTime()-new Date(M.createdAt).getTime());break;case"oldest":N.sort((M,b)=>new Date(M.createdAt).getTime()-new Date(b.createdAt).getTime());break;case"highest":N.sort((M,b)=>b.rating-M.rating);break;case"lowest":N.sort((M,b)=>M.rating-b.rating);break;case"most-helpful":N.sort((M,b)=>b.helpfulCount-M.helpfulCount);break}return N},[s,n,i,c]),f=Math.ceil(g.length/pN),k=g.slice((d-1)*pN,d*pN),v={employee:"Employee",client:"Client",partner:"Partner",competitor:"Industry Peer",other:"Other"};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(ft,{className:"w-5 h-5 text-accent"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Reviews"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"See what others are saying. Read honest reviews from employees, clients, and partners across the iGaming industry. Find trusted companies and share your own experience."}),e.jsxs(P,{variant:"accent",size:"sm",className:"mt-3 gap-1.5",onClick:()=>x(!0),children:[e.jsx(ft,{className:"w-4 h-4"}),"Add review"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(wt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ae,{placeholder:"Search reviews by company, title, or content...",value:n,onChange:N=>{r(N.target.value),u(1)},className:"pl-10"})]}),e.jsxs(Ye,{value:c,onValueChange:N=>{h(N),u(1)},children:[e.jsx(Ue,{className:"w-[150px]",children:e.jsx(Je,{placeholder:"Rating"})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"all",children:"All ratings"}),e.jsx(me,{value:"5",children:"5 stars"}),e.jsx(me,{value:"4",children:"4 stars"}),e.jsx(me,{value:"3",children:"3 stars"}),e.jsx(me,{value:"2",children:"2 stars"}),e.jsx(me,{value:"1",children:"1 star"})]})]}),e.jsxs(Ye,{value:i,onValueChange:N=>{l(N),u(1)},children:[e.jsx(Ue,{className:"w-[180px]",children:e.jsx(Je,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"newest",children:"Newest reviews"}),e.jsx(me,{value:"oldest",children:"Oldest reviews"}),e.jsx(me,{value:"highest",children:"Highest rated"}),e.jsx(me,{value:"lowest",children:"Lowest rated"}),e.jsx(me,{value:"most-helpful",children:"Most helpful"})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[g.length," review",g.length!==1?"s":""]}),k.length===0?e.jsx(U,{children:e.jsxs(W,{className:"py-16 text-center",children:[e.jsx(ft,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No reviews found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:k.map(N=>e.jsx(mq,{review:N,relationshipLabels:v},N.id))}),f>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:f},(N,M)=>e.jsx(P,{variant:d===M+1?"accent":"outline",size:"sm",onClick:()=>u(M+1),children:M+1},M))})]}),e.jsx(cq,{open:y,onOpenChange:x,onSubmit:m}),e.jsx(cl,{})]})},mq=({review:t,relationshipLabels:a})=>e.jsx(U,{className:"border-border/50 hover:shadow-md transition-shadow",children:e.jsxs(W,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary flex items-center justify-center flex-shrink-0",children:e.jsx(ss,{className:"w-5 h-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-foreground",children:t.author.displayName}),t.isVerified&&e.jsx(Ee,{className:"w-3.5 h-3.5 text-gaming-success"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.author.relationship&&e.jsx("span",{children:a[t.author.relationship]??t.author.relationship}),t.author.jobTitle&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.author.jobTitle})]})]})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:CC(new Date(t.createdAt),{addSuffix:!0})})]}),e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs(O,{variant:"secondary",className:"gap-1 text-xs",children:[e.jsx(Se,{className:"w-3 h-3"}),t.companySlug.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())]})}),e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm line-clamp-1",children:t.title}),e.jsx(Gc,{rating:t.rating,size:"sm"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed line-clamp-3",children:t.body}),(t.pros||t.cons)&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[t.pros&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-gaming-success uppercase tracking-wide",children:"Pros"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.pros})]}),t.cons&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-destructive uppercase tracking-wide",children:"Cons"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.cons})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-3 border-t border-border/50",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(Ll,{className:"w-3 h-3"}),"Useful ",t.helpfulCount>0&&`(${t.helpfulCount})`]}),e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(as,{className:"w-3 h-3"}),"Share"]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive gap-1.5 h-7 text-xs ml-auto",children:e.jsx(Yo,{className:"w-3 h-3"})})]})]})}),ya=ie.forwardRef(({className:t,value:a,...s},n)=>e.jsx(jN.Root,{ref:n,className:oe("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...s,children:e.jsx(jN.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));ya.displayName=jN.Root.displayName;function C9(t=window.location.pathname){const a=t.replace(/^\/+|\/+$/g,"").split("/"),s=a.findIndex(r=>r.toLowerCase()==="jobs");if(s===-1)return null;const n=a[s+1];return n?decodeURIComponent(n):null}function SC(){const[t,a]=p.useState(()=>C9());return p.useEffect(()=>{const s=()=>a(C9());return window.addEventListener("popstate",s),()=>window.removeEventListener("popstate",s)},[]),t}const pq={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},yq={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},xq=({marketData:t})=>{const a=SC(),s=p.useMemo(()=>t??(a?Uz(a):void 0),[t,a]);return s?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/markets/v2"),children:[e.jsx(La,{className:"w-4 h-4"})," All Markets"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(O,{className:`text-xs ${pq[s.status]}`,children:s.status}),s.isFeatured&&e.jsx(O,{className:"bg-gaming-gold text-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.overview}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.badges.map(n=>e.jsx(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:n.label},n.label))})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsx(td,{icon:Ce,label:"Active Jobs",value:s.stats.jobsCount.toLocaleString()}),e.jsx(td,{icon:Se,label:"Companies",value:s.stats.companiesCount.toLocaleString()}),e.jsx(td,{icon:Al,label:"Remote Ratio",value:`${s.stats.remoteRatio}%`}),e.jsx(td,{icon:Ts,label:`Median (${s.salaryPulse.currency})`,value:s.salaryPulse.medianAnnual.toLocaleString()})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 mt-6",children:[e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(Ba,{className:"w-4 h-4"})," Get alerts for this market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(Ua,{className:"w-4 h-4"})," Follow market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(ft,{className:"w-4 h-4"})," I work here"]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Xo,{className:`w-5 h-5 ${yq[s.stats.hiringIntensity]}`}),"Hiring Now",e.jsxs(O,{variant:"secondary",className:"text-xs ml-auto",children:[s.stats.jobsCount," jobs"]})]})}),e.jsxs(W,{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-3 uppercase tracking-wide",children:"Trending Role Families"}),e.jsx("div",{className:"space-y-3",children:s.trendingRoles.map(n=>e.jsx(gq,{role:n,maxCount:Math.max(...s.trendingRoles.map(r=>r.count))},n.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"w-5 h-5 text-accent"}),"Top Employers"]})}),e.jsx(W,{children:e.jsx("div",{className:"space-y-3",children:s.topEmployers.map((n,r)=>e.jsx(fq,{employer:n,rank:r+1},n.slug))})})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Ts,{className:"w-5 h-5 text-gaming-gold"}),"Salary Pulse"]})}),e.jsxs(W,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-4 text-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMin.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Min (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-accent",children:s.salaryPulse.medianAnnual.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Median (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMax.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Max (",s.salaryPulse.currency,")"]})]})]}),e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:"By Role Family"}),e.jsx("div",{className:"space-y-2",children:s.salaryPulse.topRoleFamilies.map(n=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-foreground",children:n.role}),e.jsxs("span",{className:"font-semibold text-foreground",children:[n.median.toLocaleString()," ",s.salaryPulse.currency]})]},n.role))}),e.jsxs(P,{variant:"outline",size:"sm",className:"mt-4 w-full gap-1.5",children:["View full Salary Guide ",e.jsx(la,{className:"w-3.5 h-3.5"})]})]})]}),s.regulators.length>0&&e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Ta,{className:"w-5 h-5 text-gaming-success"}),"Regulation & Licensing"]})}),e.jsx(W,{className:"space-y-4",children:s.regulators.map(n=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(Ta,{className:"w-5 h-5 text-gaming-success flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:n.name}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-1.5",children:["Authority: ",n.authority]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.licenseTypes.map(r=>e.jsx(O,{variant:"outline",className:"text-xs",children:r},r))})]})]},n.slug))})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Market Info"}),e.jsx(Pn,{label:"Region",value:s.region}),e.jsx(Pn,{label:"Currency",value:s.currency}),s.timezone&&e.jsx(Pn,{label:"Timezone",value:s.timezone}),e.jsx(Pn,{label:"Population",value:`${s.populationM.toLocaleString()}M`}),e.jsx(Pn,{label:"Revenue Potential",value:`$${s.revenuePotentialM.toLocaleString()}M`}),e.jsx(Pn,{label:"Languages",value:s.languages.join(", ")}),e.jsx(Pn,{label:"Verticals",value:s.verticals.join(", ")})]})}),s.upcomingEvents.length>0&&e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Pa,{className:"w-4 h-4 text-accent"}),"Upcoming Events"]}),s.upcomingEvents.slice(0,3).map(n=>e.jsxs("div",{className:"flex items-start gap-3 py-2 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-lg bg-accent/10 flex flex-col items-center justify-center flex-shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-accent leading-none",children:new Date(n.date).toLocaleString("en",{month:"short"}).toUpperCase()}),e.jsx("span",{className:"text-sm font-bold text-foreground leading-none",children:new Date(n.date).getDate()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:n.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n.city})]})]},n.slug)),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"View all events"})]})}),e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(aa,{className:"w-4 h-4 text-accent"}),"Latest News"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:['News articles tagged with "',s.name,'" will appear here once available.']}),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"Browse iGaming News"})]})})]})]})}),e.jsx(cl,{})]}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Dt,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Market Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The market you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/markets/v2"),children:"Browse Markets"})]})})},td=({icon:t,label:a,value:s})=>e.jsxs("div",{className:"bg-primary-foreground/10 rounded-lg p-3 text-center",children:[e.jsx(t,{className:"w-5 h-5 mx-auto mb-1 text-primary-foreground/70"}),e.jsx("p",{className:"text-xl font-bold text-primary-foreground",children:s}),e.jsx("p",{className:"text-xs text-primary-foreground/60",children:a})]}),gq=({role:t,maxCount:a})=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium text-foreground w-28 flex-shrink-0",children:t.roleFamily}),e.jsx(ya,{value:t.count/a*100,className:"h-2 flex-1"}),e.jsx("span",{className:"text-sm font-semibold text-foreground w-10 text-right",children:t.count}),e.jsxs("span",{className:`text-xs font-medium flex items-center gap-0.5 w-12 ${t.changePercent>=0?"text-gaming-success":"text-destructive"}`,children:[t.changePercent>=0?e.jsx(jt,{className:"w-3 h-3"}):e.jsx(jc,{className:"w-3 h-3"}),t.changePercent>=0?"+":"",t.changePercent,"%"]})]}),fq=({employer:t,rank:a})=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-secondary/50 transition-colors cursor-pointer",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center text-xs font-bold text-accent flex-shrink-0",children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name}),t.isClaimed&&e.jsx(O,{variant:"outline",className:"text-xs text-gaming-success border-gaming-success/30",children:"Verified"})]}),t.employeeRange&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.employeeRange," employees"]})]}),e.jsxs(O,{variant:"secondary",className:"text-xs gap-1",children:[e.jsx(Ce,{className:"w-3 h-3"}),t.openRoles," roles"]})]}),Pn=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]}),kq={verified:{label:"Verified",className:"bg-gaming-success/10 text-gaming-success border-gaming-success/20"},"self-reported":{label:"Self-reported",className:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},"community-suggested":{label:"Community",className:"bg-accent/10 text-accent border-accent/20"}},vq=({regulatorData:t})=>{const a=SC(),s=p.useMemo(()=>t??(a?Jz(a):void 0),[t,a]);return s?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/regulators/v2"),children:[e.jsx(La,{className:"w-4 h-4"})," All Regulators"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(O,{className:"bg-primary-foreground/20 text-primary-foreground border-primary-foreground/30",children:s.acronym}),s.isPrimary&&e.jsx(O,{className:"bg-gaming-gold text-foreground text-xs",children:"Primary Authority"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(Dt,{className:"w-3 h-3 mr-1"})," ",s.country]}),e.jsxs(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(Cl,{className:"w-3 h-3 mr-1"})," ",s.jurisdiction]}),e.jsxs(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:["Est. ",s.establishedYear]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[s.website&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Rt,{className:"w-4 h-4"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Ha,{className:"w-4 h-4"})," Licensee Register"]})})]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Cl,{className:"w-5 h-5 text-accent"})," Regulatory Scope"]})}),e.jsxs(W,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.scope}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"License Types:"}),s.licenseTypes.map(n=>e.jsx(O,{variant:"secondary",className:"text-xs",children:n},n))]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Sectors:"}),s.sectors.map(n=>e.jsx(O,{variant:"outline",className:"text-xs",children:n},n))]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Scope Tags:"}),s.scopeTags.map(n=>e.jsx(O,{variant:"accent",className:"text-xs",children:n},n))]})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"w-5 h-5 text-gaming-success"})," What This Means for Careers"]})}),e.jsxs(W,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.careerImplications}),e.jsx("h4",{className:"text-sm font-medium text-foreground mb-3 uppercase tracking-wide",children:"Common Role Families"}),e.jsx("div",{className:"space-y-3",children:s.careerRoles.map(n=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(qe,{className:"w-4 h-4 text-accent flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:n.roleFamily}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n.description})]})]},n.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(ea,{className:"w-5 h-5 text-gaming-warning"})," Key Requirements"]})}),e.jsxs(W,{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"High-level themes — not legal advice. See official pages for full details."}),e.jsx("ul",{className:"space-y-2",children:s.keyRequirements.map(n=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(Ta,{className:"w-4 h-4 text-gaming-success flex-shrink-0 mt-0.5"}),n]},n))})]})]}),s.linkedCompanies.length>0&&e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"w-5 h-5 text-accent"})," Licensed Companies"]})}),e.jsxs(W,{children:[e.jsx("div",{className:"space-y-3",children:s.linkedCompanies.map(n=>{const r=kq[n.evidenceLevel];return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Se,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:n.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{variant:"outline",className:`text-xs ${r.className}`,children:r.label}),n.evidenceUrl&&e.jsx(P,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",asChild:!0,children:e.jsx("a",{href:n.evidenceUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(Rt,{className:"w-3 h-3"})})})]})]},n.slug)})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3 flex items-start gap-1.5",children:[e.jsx(Ta,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Verified"})," = found in official register. ",e.jsx("strong",{children:"Self-reported"})," = company-asserted, pending verification."]})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Regulator Info"}),e.jsx(Tn,{label:"Acronym",value:s.acronym}),e.jsx(Tn,{label:"Country",value:s.country}),e.jsx(Tn,{label:"Region",value:s.region}),e.jsx(Tn,{label:"Jurisdiction",value:s.jurisdiction}),e.jsx(Tn,{label:"Established",value:String(s.establishedYear)}),e.jsx(Tn,{label:"Compliance Score",value:`${s.complianceRating.toFixed(1)} / 5.0`}),e.jsx(Tn,{label:"License Types",value:s.licenseTypes.join(", ")})]})}),s.linkedMarkets.length>0&&e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4 text-accent"})," Markets Covered"]}),s.linkedMarkets.map(n=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>window.location.replace(`/markets/${n.slug}`),children:[e.jsx(Dt,{className:"w-3.5 h-3.5"})," ",n.name]},n.slug))]})}),e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ut,{className:"w-4 h-4 text-accent"})," Resources"]}),s.website&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Rt,{className:"w-3.5 h-3.5"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Ha,{className:"w-3.5 h-3.5"})," Licensee Register"]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Links to official pages. We do not summarize legal text — see the regulator's website for full requirements."})]})})]})]})}),e.jsx(cl,{})]}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Ta,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Regulator Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The regulator you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/regulators/v2"),children:"Browse Regulators"})]})})},Tn=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]});function S9(t){window.location.assign(t)}function L9(t){window.history.length>1?window.history.back():window.location.assign(t)}function bq(t){const a=PI,s=t??{};return{id:s.id??a.id,title:s.title??a.title,company:s.company??a.company,companyLogo:s.companyLogo??a.companyLogo,location:s.location??a.location,salary:s.salary??void 0,jobType:s.jobType??a.jobType,experienceLevel:s.experienceLevel??a.experienceLevel,department:s.department??a.department,postedDate:s.postedDate??a.postedDate,applicationDeadline:s.applicationDeadline??void 0,description:s.description??a.description,requirements:Array.isArray(s.requirements)?s.requirements:[],responsibilities:Array.isArray(s.responsibilities)?s.responsibilities:[],benefits:Array.isArray(s.benefits)?s.benefits:[],skills:Array.isArray(s.skills)?s.skills:[],companyDescription:s.companyDescription??"",companySize:s.companySize??void 0,companyWebsite:s.companyWebsite??void 0,contactEmail:s.contactEmail??void 0,contactPhone:s.contactPhone??void 0,isRemote:s.isRemote??!1,isUrgent:s.isUrgent??!1,isFeatured:s.isFeatured??!1,applicationUrl:s.applicationUrl??void 0,viewCount:s.viewCount??void 0,applicantCount:s.applicantCount??void 0}}function wq(t){return!Array.isArray(t)||t.length===0?TI:t.map(a=>({id:a.id??"unknown",title:a.title??"Untitled",company:a.company??"",location:a.location??"",salary:a.salary??void 0,postedDate:a.postedDate??new Date().toISOString().slice(0,10)}))}const PI={id:"1",title:"Senior Game Developer",company:"Wazdan",companyLogo:"https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg?auto=compress&cs=tinysrgb&w=100",location:"Malta",salary:"€80,000 - €120,000",jobType:"Full-time",experienceLevel:"Senior Level",department:"Engineering",postedDate:"2025-01-15",applicationDeadline:"2025-02-15",description:"We are seeking a talented Senior Game Developer to join our innovative team at Wazdan...",requirements:["5+ years of experience in game development","Strong proficiency in C# and Unity","Experience with HTML5 and JavaScript","Knowledge of casino game mechanics","Understanding of RNG and game mathematics","Experience with version control systems (Git)","Strong problem-solving skills","Excellent communication skills in English"],responsibilities:["Design and develop high-quality casino games","Implement game features and mechanics","Optimize game performance across multiple platforms","Collaborate with artists and designers on game assets","Write clean, maintainable, and well-documented code","Participate in code reviews and technical discussions","Debug and resolve technical issues","Stay updated with industry trends and technologies"],benefits:["Competitive salary and performance bonuses","Health insurance coverage","Flexible working hours","Remote work options","Professional development opportunities","25 days paid vacation","Modern office in Malta","Team building events and activities"],skills:["Unity","C#","JavaScript","HTML5","CSS3","Git","Agile","Game Design"],companyDescription:"Wazdan is a leading provider of innovative casino games...",companySize:"100-200 employees",companyWebsite:"https://wazdan.com",contactEmail:"careers@wazdan.com",contactPhone:"+356 2123 4567",isRemote:!1,isUrgent:!0,isFeatured:!0,applicationUrl:"https://wazdan.com/careers/apply",viewCount:1247,applicantCount:23},TI=[{id:"2",title:"Frontend Game Developer",company:"Pragmatic Play",location:"Malta",salary:"€60,000 - €80,000",postedDate:"2025-01-10"},{id:"3",title:"Unity Developer",company:"Evolution Gaming",location:"Remote",salary:"€70,000 - €90,000",postedDate:"2025-01-12"},{id:"4",title:"Game Developer",company:"NetEnt",location:"Stockholm",salary:"€65,000 - €85,000",postedDate:"2025-01-08"}],jq=({job:t=PI,similarJobs:a=TI,onSkillClick:s})=>{var L;const n=SC(),[r,i]=p.useState(()=>wq(a)),[l,c]=p.useState(!1),[h,d]=p.useState(null),[u,y]=p.useState(!1),[x,m]=p.useState(!1),{savedJobs:g,toggleJob:f,isSaved:k}=fI(),v=bq(t);p.useEffect(()=>{(async()=>{c(!0);try{if(await new Promise(I=>setTimeout(I,300)),!n)throw new Error("Missing slug in URL.");i(r);const j=JSON.parse(localStorage.getItem("appliedJobs")||"[]");m(j.includes(n))}catch(j){d((j==null?void 0:j.message)||"Failed to load job details")}finally{c(!1)}})()},[n]);const N=()=>{n&&f(n)},M=()=>{if(!n)return;v!=null&&v.applicationUrl?window.open(v.applicationUrl,"_blank","noopener,noreferrer"):y(!0);const w=JSON.parse(localStorage.getItem("appliedJobs")||"[]");w.includes(n)||(w.push(n),localStorage.setItem("appliedJobs",JSON.stringify(w)),m(!0))},b=async()=>{if(navigator.share)try{await navigator.share({title:v==null?void 0:v.title,text:`Check out this job opportunity: ${v==null?void 0:v.title} at ${v==null?void 0:v.company}`,url:window.location.href})}catch(w){console.log("Error sharing:",w)}else navigator.clipboard.writeText(window.location.href),alert("Job URL copied to clipboard!")},C=w=>new Date(w).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),S=w=>{const j=new Date(w),T=Math.abs(new Date().getTime()-j.getTime());return Math.ceil(T/(1e3*60*60*24))};return l?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"Loading job details..."})]})}):h||!v?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Qt,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Job Not Found"}),e.jsx("p",{className:"text-gray-600 mb-4",children:h||"The job you are looking for does not exist."}),e.jsx("button",{onClick:()=>L9("/jobs"),className:"bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Back to Jobs"})]})}):e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("div",{className:"bg-white border-b border-gray-200",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:[e.jsxs("button",{onClick:()=>L9("/jobs"),className:"flex items-center text-gray-600 hover:text-gray-900 mb-4",children:[e.jsx(La,{className:"h-4 w-4 mr-2"}),"Back to Jobs"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"flex items-start space-x-4",children:[v.companyLogo&&e.jsx("img",{src:v.companyLogo,alt:`${v.company} logo`,className:"w-16 h-16 rounded-lg object-cover border border-gray-200"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[v.isUrgent&&e.jsx("span",{className:"bg-red-100 text-red-800 text-xs font-medium px-2 py-1 rounded-full",children:"Urgent"}),v.isFeatured&&e.jsx("span",{className:"bg-yellow-100 text-yellow-800 text-xs font-medium px-2 py-1 rounded-full",children:"Featured"})]}),e.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-gray-900 mb-2",children:v.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Se,{className:"h-4 w-4 mr-1"}),e.jsx("span",{className:"font-medium",children:v.company})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fe,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:v.location}),v.isRemote&&e.jsx("span",{className:"ml-1",children:"(Remote)"})]}),v.salary&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Ts,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:v.salary})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx($t,{className:"h-4 w-4 mr-1"}),e.jsxs("span",{children:[S(v.postedDate)," days ago"]})]})]})]})]})}),e.jsxs("div",{className:"flex items-center space-x-3 mt-4 lg:mt-0",children:[e.jsxs("button",{onClick:N,className:`flex items-center px-4 py-2 rounded-lg border transition-colors ${k(v.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(Ua,{className:`h-4 w-4 mr-2 ${k(v.id)?"fill-current":""}`}),k(v.id)?"Saved":"Save Job"]}),e.jsxs("button",{onClick:b,className:"flex items-center px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:[e.jsx(as,{className:"h-4 w-4 mr-2"}),"Share"]}),e.jsx("button",{onClick:M,disabled:x,className:`flex items-center px-6 py-2 rounded-lg font-medium transition-colors ${x?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:x?e.jsxs(e.Fragment,{children:[e.jsx(Tt,{className:"h-4 w-4 mr-2"}),"Applied"]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"h-4 w-4 mr-2"}),"Apply Now"]})})]})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Ce,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Job Type"}),e.jsx("p",{className:"font-medium",children:v.jobType})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Va,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Experience"}),e.jsx("p",{className:"font-medium",children:v.experienceLevel})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(qe,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Department"}),e.jsx("p",{className:"font-medium",children:v.department})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Gt,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Deadline"}),e.jsx("p",{className:"font-medium text-sm",children:v.applicationDeadline?C(v.applicationDeadline):"Open"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200",children:[e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-600",children:[e.jsxs("span",{children:[v.viewCount," views"]}),e.jsxs("span",{children:[v.applicantCount," applicants"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(tt,{className:"h-4 w-4 text-yellow-400 fill-current"}),e.jsx("span",{className:"text-sm text-gray-600",children:"4.8 company rating"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Job Description"}),e.jsx("div",{className:"prose prose-gray max-w-none",children:e.jsx("p",{className:"text-gray-700 leading-relaxed whitespace-pre-line",children:v.description})})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Key Responsibilities"}),e.jsx("ul",{className:"space-y-3",children:(L=v.responsibilities)==null?void 0:L.map((w,j)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Tt,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:w})]},j))})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Requirements"}),Array.isArray(v.requirements)?e.jsx("ul",{className:"space-y-3",children:v.requirements.map((w,j)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Tt,{className:"h-5 w-5 text-blue-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:w})]},j))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:v.requirements})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Required Skills"}),Array.isArray(v.skills)?e.jsx("div",{className:"flex flex-wrap gap-2",children:v.skills.map((w,j)=>e.jsx(tC,{name:w,color:"#2563EB",size:"sm",onClick:s?()=>s(w):void 0},`${w}-${j}`))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:v.skills})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Benefits & Perks"}),Array.isArray(v.benefits)?e.jsx("ul",{className:"space-y-3",children:v.benefits.map((w,j)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Tt,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:w})]},j))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:v.benefits})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:["About ",v.company]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-700 text-sm leading-relaxed",children:v.companyDescription}),e.jsxs("div",{className:"space-y-2 text-sm",children:[v.companySize&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(qe,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("span",{className:"text-gray-600",children:v.companySize})]}),v.companyWebsite&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Dt,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:v.companyWebsite,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Visit Website"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Contact Information"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[v.contactEmail&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(ca,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`mailto:${v.contactEmail}`,className:"text-blue-600 hover:text-blue-800",children:v.contactEmail})]}),v.contactPhone&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(dn,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`tel:${v.contactPhone}`,className:"text-blue-600 hover:text-blue-800",children:v.contactPhone})]})]})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Ready to Apply?"}),e.jsxs("p",{className:"text-gray-600 text-sm mb-4",children:["Join ",v.company," and take your career to the next level in the exciting world of iGaming."]}),e.jsx("button",{onClick:M,disabled:x,className:`w-full flex items-center justify-center px-6 py-3 rounded-lg font-medium transition-colors ${x?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:x?e.jsxs(e.Fragment,{children:[e.jsx(Tt,{className:"h-5 w-5 mr-2"}),"Application Submitted"]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"h-5 w-5 mr-2"}),"Apply for this Position"]})}),!x&&e.jsxs("div",{className:"mt-4 flex items-center space-x-2",children:[e.jsxs("button",{onClick:N,className:`flex-1 flex items-center justify-center px-4 py-2 rounded-lg border transition-colors ${k(v.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(Et,{className:`h-4 w-4 mr-2 ${k(v.id)?"fill-current":""}`}),k(v.id)?"Saved":"Save"]}),e.jsx("button",{className:"flex items-center justify-center p-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:e.jsx(Yo,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Similar Jobs"}),e.jsx("div",{className:"space-y-4",children:r.map(w=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>S9(`/jobs/${w.id}`),children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-1",children:w.title}),e.jsx("p",{className:"text-sm text-gray-600 mb-2",children:w.company}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fe,{className:"h-3 w-3 mr-1"}),e.jsx("span",{children:w.location})]}),e.jsxs("span",{children:[S(w.postedDate),"d ago"]})]}),w.salary&&e.jsx("p",{className:"text-sm font-medium text-blue-600 mt-2",children:w.salary})]},w.id))}),e.jsx("button",{onClick:()=>S9("/jobs"),className:"w-full mt-4 text-center text-blue-600 hover:text-blue-800 text-sm font-medium",children:"View All Jobs"})]})]})]})}),u&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-md w-full p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Apply for this Position"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"To apply for this position, please send your CV and cover letter to:"}),e.jsx("div",{className:"bg-gray-50 p-4 rounded-lg mb-4",children:e.jsx("p",{className:"font-medium",children:v.contactEmail})}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>y(!1),className:"flex-1 px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:"Close"}),e.jsx("button",{onClick:()=>{window.location.href=`mailto:${v.contactEmail}?subject=Application for ${v.title}&body=Dear Hiring Manager,%0D%0A%0D%0AI am interested in applying for the ${v.title} position at ${v.company}.%0D%0A%0D%0APlease find my CV attached.%0D%0A%0D%0ABest regards`,y(!1)},className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Send Email"})]})]})})]})},Mq=()=>e.jsx("div",{children:e.jsx("h2",{children:"Welcome to the Header!"})}),Nq=({article:t,isBookmarked:a,onToggleBookmark:s,onShare:n,onOpenArticle:r,layout:i="card",userAccess:l,positionInList:c})=>{const[h,d]=p.useState(!1),u=f=>{const k=new Date(f),N=Math.floor((new Date().getTime()-k.getTime())/(1e3*60*60));return N<1?"Just now":N<24?`${N}h ago`:N<48?"Yesterday":k.toLocaleDateString("en-US",{month:"short",day:"numeric"})},y=f=>f>=1e3?`${(f/1e3).toFixed(1)}k`:f.toString(),x=f=>f.length>1?f[1]:f[0],m=(f,k)=>f.length<=k?f:f.substring(0,k).trim()+"...",g=i==="grid"?"flex flex-col":"flex flex-col md:flex-row md:items-center";return e.jsxs("article",{className:`
|
|
7737
|
+
`,children:s.map(i=>e.jsx("option",{value:i,children:i},i))}),e.jsx("span",{className:"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M2 4l4 4 4-4"})})})]}),e.jsx("span",{className:"text-xs text-gray-400 hidden lg:inline-block select-none",children:"/ page"})]}),mI=({viewMode:t,onToggleViewMode:a,selectedItemsPerPage:s,onItemsPerPageChange:n,totalCount:r,startIndex:i,endIndex:l,title:c})=>e.jsx("div",{className:"lg:block hidden bg-white rounded-lg shadow-sm border border-gray-200 p-4 mb-6",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:c}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:i}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:l})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:r})," articles"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx(H7,{viewMode:t,onToggle:a}),e.jsx(NC,{value:s,onChange:n})]})]})}),kD=({title:t,description:a,ctaText:s,ctaLink:n,bgColor:r="bg-yellow-50",textColor:i="text-yellow-800"})=>e.jsx("div",{className:`promo-card ${r} p-4 rounded-lg shadow-sm hidden md:block`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:`font-bold text-lg ${i}`,children:t}),e.jsx("p",{className:`text-sm mt-1 ${i} opacity-90`,children:a})]}),e.jsx("a",{href:n,className:"bg-white text-yellow-600 hover:bg-yellow-50 px-4 py-2 rounded-md text-sm font-medium shadow-sm transition-colors",children:s})]})}),vD=({items:t,cardType:a,viewMode:s,savedJobs:n,onSaveJob:r,onViewJob:i,onApplyJob:l,firstItemRef:c=null,userAccess:h})=>{const[d,u]=p.useState([]),[y,x]=p.useState(null);p.useEffect(()=>{try{if(!Array.isArray(t)){console.error("❌ Items is not an array:",t),x("Invalid data format received"),u([]);return}const g=[...t];t.length>5&&g.splice(5,0,{id:"promo-1",title:"Promo",isPromo:!0}),u(g),x(null)}catch(g){console.error("Error processing items:",g),x(`Error processing items: ${g instanceof Error?g.message:String(g)}`),u([])}},[t]);const m=(g,f)=>{const v=f===0&&!g.isPromo?{ref:c}:{};try{if(g.isPromo)return e.jsx("div",{className:"col-span-full my-4",children:e.jsx(kD,{title:"Upgrade Your Job Search",description:"Get personalized job recommendations and stand out to employers.",ctaText:"Learn More",ctaLink:"#premium-features",bgColor:"bg-yellow-50",textColor:"text-yellow-800"})},`promo-${f}`);if(!g||typeof g!="object")return console.error("❌ Invalid item detected:",g),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Invalid Job Data"}),e.jsx("p",{className:"text-red-600 text-sm",children:"The job data is in an unexpected format."})]});const N=g.id?`${g._id}-${f}`:g.slug?`${g.slug}-${f}`:`item-${f}`;switch(a){case"job":return e.jsx("div",{...v,children:e.jsx(wC,{job:g,positionInList:f,onSaveJob:M=>r(M,f),onViewJob:(M,b,C)=>i(M,f,C),onApplyJob:l?(M,b,C)=>l(M,f,C):void 0,isSaved:n.includes(g.id||g.slug||g.link),userAccess:h})},N);default:return console.warn(`⚠️ Unknown cardType: ${a}`),e.jsxs("div",{className:"error-card bg-yellow-50 p-4 rounded-md border border-yellow-200",children:[e.jsx("p",{className:"text-yellow-800 font-medium",children:"Unknown Card Type"}),e.jsx("p",{className:"text-yellow-700 text-sm",children:"The specified card type is not supported."})]})}}catch(N){return console.error("Error rendering card:",N),e.jsxs("div",{className:"error-card bg-red-50 p-4 rounded-md border border-red-200",children:[e.jsx("p",{className:"text-red-800 font-medium",children:"Error Rendering Card"}),e.jsx("p",{className:"text-red-600 text-sm",children:N instanceof Error?N.message:String(N)})]})}};return y?e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Error Loading Items"}),e.jsx("p",{children:y})]}):d.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("h3",{children:"No items found matching your criteria"}),e.jsx("p",{children:"Try adjusting your filters or search term"})]}):e.jsx("div",{className:s==="grid"?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4":"flex flex-col gap-4","data-view-mode":s,children:d.map((g,f)=>m(g,f))})},V7=({currentPage:t,totalPages:a,onPageChange:s})=>{if(a<=1)return null;const n=5,r=Math.max(1,t-Math.floor(n/2)),i=Math.min(a,r+n-1),l=[];for(let c=r;c<=i;c++)l.push(c);return e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs("nav",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>s(Math.max(1,t-1)),disabled:t===1,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Cs,{})}),l.map(c=>e.jsx("button",{onClick:()=>s(c),className:`px-3 py-2 text-sm font-medium rounded-md ${t===c?"bg-yellow-600 text-white":"text-gray-700 bg-white border border-gray-300 hover:bg-gray-50"}`,children:c},c)),e.jsx("button",{onClick:()=>s(Math.min(a,t+1)),disabled:t===a,className:"px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(Ss,{})})]})})},bD=({jobs:t,onViewJob:a})=>!t||t.length===0?null:e.jsxs("div",{className:"last-visited-jobs mt-8 bg-white rounded-lg shadow p-4",children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Recently Viewed Jobs"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:t.map((s,n)=>e.jsxs("div",{className:"p-3 border rounded-md hover:shadow-md transition-shadow cursor-pointer",onClick:()=>a(s,n,"same_tab","last_visited"),children:[e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsx("img",{src:s.logo||"/placeholder.svg?height=30&width=30",alt:`${s.company} logo`,className:"w-6 h-6 mr-2"}),e.jsx("h3",{className:"font-medium text-sm truncate",children:s.title})]}),e.jsx("p",{className:"text-xs text-gray-600 truncate",children:s.company}),e.jsx("p",{className:"text-xs text-gray-500 truncate",children:s.location})]},s._id||s.slug||s.link))})]}),wD=(t,a,s="date")=>{if(a==="all")return t;const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate());return t.filter(i=>{const l=i[s]||i.created_at||i.published_at||i.scraped_at;if(!l)return!1;const c=new Date(l);switch(a){case"today":return c>=r;case"this_week":{const h=new Date(n);return h.setDate(n.getDate()-n.getDay()),h.setHours(0,0,0,0),c>=h}case"this_month":{const h=new Date(n.getFullYear(),n.getMonth(),1);return c>=h}case"last_30_days":{const h=new Date(n);return h.setDate(n.getDate()-30),c>=h}case"last_90_days":{const h=new Date(n);return h.setDate(n.getDate()-90),c>=h}default:return!0}})},jD=(t,a)=>t.filter(s=>{var n,r,i,l,c;if(a.jobTypes.length>0){const h=((n=s.department)==null?void 0:n.toLowerCase())||"";if(!a.jobTypes.some(d=>h.includes(d)))return!1}if(a.experienceLevels.length>0){const h=((r=s.title)==null?void 0:r.toLowerCase())||"";if(!a.experienceLevels.some(d=>!!(d==="senior"&&h.includes("senior")||d==="mid"&&(h.includes("mid")||h.includes("mid-level"))||d==="entry"&&(h.includes("junior")||h.includes("entry")))))return!1}return!(a.country&&!(((i=s.location)==null?void 0:i.toLowerCase())||((l=s.city)==null?void 0:l.toLowerCase())||"").includes(a.country.toLowerCase())||a.city&&!(((c=s.company_type)==null?void 0:c.toLowerCase())||"").includes(a.city.toLowerCase()))}),Lc=(t,a)=>{const s={};for(const n of t)for(const r of a){s[r]||(s[r]=new Set);const i=n[r];Array.isArray(i)?i.forEach(l=>{typeof l=="string"&&l.trim()&&s[r].add(l.trim())}):typeof i=="string"&&i.trim()&&s[r].add(i.trim())}return Object.fromEntries(Object.entries(s).map(([n,r])=>[n,Array.from(r)]))},pI=t=>{const a=new URLSearchParams(window.location.search);t==="all"?a.delete("date_filter"):a.set("date_filter",t);const s=`${window.location.pathname}?${a.toString()}`;window.history.replaceState({},"",s)},Go=(t,a,s,n,r="date")=>{let i=t.filter(l=>Object.entries(a).every(([c,h])=>{const d=l[c];return typeof d=="string"?d.toLowerCase()===h.toLowerCase():Array.isArray(d)?d.some(u=>typeof u=="string"&&u.toLowerCase()===h.toLowerCase()):!1}));return s.length>0&&(i=i.filter(l=>s.every(c=>{var h,d;return((h=l.title)==null?void 0:h.toLowerCase().includes(c.toLowerCase()))||((d=l.overview)==null?void 0:d.toLowerCase().includes(c.toLowerCase()))}))),i=wD(i,n,r),i},Kc=(t,a,s=[],n="date")=>{const r=h=>{const d=h[n]||h.created_at||h.published_at||h.scraped_at;return d?new Date(d).getTime():0},i=h=>{var u;const d=h.views??h.viewCount??((u=h.metrics)==null?void 0:u.views)??0;return typeof d=="number"?d:0},l=h=>{if(s.length===0)return 0;const d=(h.title??"").toLowerCase(),u=(h.overview??"").toLowerCase();return s.reduce((y,x)=>{const m=x.toLowerCase();let g=y;return d.includes(m)&&(g+=3),u.includes(m)&&(g+=1),g},0)},c=[...t];return c.sort((h,d)=>{switch(a){case"date_asc":return r(h)-r(d);case"views_desc":return i(d)-i(h);case"views_asc":return i(h)-i(d);case"relevance":{const u=l(d)-l(h);return u!==0?u:r(d)-r(h)}case"title_asc":{const u=(h.title??"").localeCompare(d.title??"",void 0,{sensitivity:"base"});return u!==0?u:r(d)-r(h)}case"date_desc":default:return r(d)-r(h)}}),c},yI=({dateFieldLabel:t,activeDateFilter:a,onDateFilterChange:s,filterKeys:n,searchableFilters:r,filtersData:i,activeFilters:l,handleFilterChange:c,toggleSavedJobsFilter:h,showOnlySaved:d,savedJobs:u})=>e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Filters"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:t}),e.jsx(cI,{activeDateFilter:a,onDateFilterChange:s,dateFieldLabel:""})]}),n.map(y=>{var x;return e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-2",children:y.replace(/_/g," ").replace(/^\w/,m=>m.toUpperCase())}),r.includes(y)?e.jsx(O7,{options:i[y]||[],value:l[y]||"",onChange:m=>c(y,m),placeholder:`Select ${y.replace(/_/g," ")}`,className:"w-full"}):e.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-yellow--500 focus:border-yellow--500 bg-white",value:l[y]||"",onChange:m=>c(y,m.target.value),children:[e.jsxs("option",{value:"",children:["Select ",y.replace(/_/g," ")]}),(x=i[y])==null?void 0:x.map(m=>e.jsx("option",{value:m,children:m},m))]})]},y)}),e.jsx("div",{className:"mt-6",children:e.jsxs("button",{onClick:h,className:`w-full px-4 py-2 rounded-lg flex items-center justify-center ${d?"bg-yellow-100 text-indigo-800":"bg-gray-100 text-gray-800 hover:bg-gray-200"}`,children:[e.jsx(Et,{size:16,className:"mr-2"}),e.jsxs("span",{children:["Saved Jobs (",u.length,")"]})]})})]})}),st=Ct.Root,xI=Ct.Trigger,MD=Ct.Portal,gI=ie.forwardRef(({className:t,...a},s)=>e.jsx(Ct.Overlay,{ref:s,className:oe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a}));gI.displayName=Ct.Overlay.displayName;const Xe=ie.forwardRef(({className:t,children:a,...s},n)=>e.jsxs(MD,{children:[e.jsx(gI,{}),e.jsxs(Ct.Content,{ref:n,className:oe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s,children:[a,e.jsxs(Ct.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(Hc.Cross2Icon,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xe.displayName=Ct.Content.displayName;const Oe=({className:t,...a})=>e.jsx("div",{className:oe("flex flex-col space-y-1.5 text-center sm:text-left",t),...a});Oe.displayName="DialogHeader";const at=({className:t,...a})=>e.jsx("div",{className:oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});at.displayName="DialogFooter";const Le=ie.forwardRef(({className:t,...a},s)=>e.jsx(Ct.Title,{ref:s,className:oe("text-lg font-semibold leading-none tracking-tight",t),...a}));Le.displayName=Ct.Title.displayName;const it=ie.forwardRef(({className:t,...a},s)=>e.jsx(Ct.Description,{ref:s,className:oe("text-sm text-muted-foreground",t),...a}));it.displayName=Ct.Description.displayName;const ND=_7("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),B=ie.forwardRef(({className:t,...a},s)=>e.jsx(tS.Root,{ref:s,className:oe(ND(),t),...a}));B.displayName=tS.Root.displayName;const CD=1,SD=1e6;let iN=0;function LD(){return iN=(iN+1)%Number.MAX_SAFE_INTEGER,iN.toString()}const oN=new Map,l9=t=>{if(oN.has(t))return;const a=setTimeout(()=>{oN.delete(t),k7({type:"REMOVE_TOAST",toastId:t})},SD);oN.set(t,a)},ID=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,CD)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(s=>s.id===a.toast.id?{...s,...a.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=a;return s?l9(s):t.toasts.forEach(n=>{l9(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===s||s===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(s=>s.id!==a.toastId)}}},AD=[];let lN={toasts:[]};function k7(t){lN=ID(lN,t),AD.forEach(a=>{a(lN)})}function c9({...t}){const a=LD(),s=r=>k7({type:"UPDATE_TOAST",toast:{...r,id:a}}),n=()=>k7({type:"DISMISS_TOAST",toastId:a});return k7({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:r=>{r||n()}}}),{id:a,dismiss:n,update:s}}const PD=new Set([200,201,202,204]);function TD(t){return t===400?"BAD_REQUEST":t===401?"UNAUTHORIZED":t===403?"FORBIDDEN":t===404?"NOT_FOUND":t===409?"CONFLICT":t===429?"RATE_LIMITED":t>=500?"SERVER":"UNKNOWN"}function RD(t){if(t.friendly)return t.friendly;switch(t.code){case"TIMEOUT":return"The request took too long. Please try again.";case"NETWORK":return"You appear to be offline or the server can’t be reached.";case"RATE_LIMITED":return"Too many requests. Please wait a moment and try again.";case"SERVER":return"The server had an issue. Please try again shortly.";case"CONFLICT":return"This email may already be subscribed.";case"BAD_REQUEST":return"Please check your input and try again.";case"UNAUTHORIZED":return"Please sign in to continue.";default:return"Something went wrong. Please try again."}}async function DD(t,a){const{timeoutMs:s=12e3,...n}=a??{},r=new AbortController,i=setTimeout(()=>r.abort(),s);try{const l=await fetch(t,{...n,signal:r.signal});if(PD.has(l.status)){if(l.status===204)return{ok:!0,data:void 0};const u=await l.text();return{ok:!0,data:u?JSON.parse(u):void 0}}let c=null;try{c=await l.json()}catch{}return{ok:!1,error:{code:TD(l.status),status:l.status,message:(c==null?void 0:c.message)||`${l.status} ${l.statusText}`,details:c}}}catch(l){const c=(l==null?void 0:l.name)==="AbortError";return{ok:!1,error:{code:c?"TIMEOUT":"NETWORK",message:c?"Request aborted by timeout":(l==null?void 0:l.message)||"Network error"}}}finally{clearTimeout(i)}}function _D({open:t,onOpenChange:a,onSubscriptionSuccess:s,searchQuery:n,filters:r,apiUrl:i="http://localhost:5147"}){const[l,c]=p.useState(""),[h,d]=p.useState(!1),[u,y]=p.useState(null),x=async m=>{if(m.preventDefault(),y(null),!l||!l.includes("@")){y("Please enter a valid email address.");return}d(!0);try{const g=await DD(`${i}/api/leads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,source:"filters_modal",utmCampaign:"jobs_filters",utmMedium:"ui",utmSource:"subscription_modal"}),timeoutMs:1e4});if(!g.ok){y(RD(g.error)),c9({title:"Subscription failed",description:g.error.message});return}localStorage.setItem("leadId",g.data.id),localStorage.setItem("email",l),c9({title:"You're subscribed",description:`We'll notify you at ${l} when new jobs match your criteria.`}),s==null||s(),c("")}finally{d(!1)}};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{className:"sm:max-w-md",children:[e.jsxs(Oe,{children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx(Ba,{className:"h-5 w-5 text-orange-500"}),"Create Job Alert"]}),e.jsx(it,{children:"Subscribe to get notified when new jobs matching your search criteria are posted."})]}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"email",children:"Email address"}),e.jsxs("div",{className:"relative",children:[e.jsx(ca,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{id:"email",type:"email",placeholder:"Enter your email address",value:l,onChange:m=>c(m.target.value),className:"pl-10",required:!0,"aria-invalid":!!u,"aria-describedby":u?"email-error":void 0})]}),u&&e.jsx("p",{id:"email-error",role:"alert",className:"text-sm text-red-600",children:u})]}),n&&e.jsxs("div",{className:"rounded-lg bg-muted p-3 text-sm",children:[e.jsx("p",{className:"font-medium",children:"Alert criteria:"}),e.jsxs("p",{className:"text-muted-foreground",children:['"',n,'"']})]}),e.jsxs(at,{className:"gap-2 sm:gap-0",children:[e.jsx(P,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:h,children:"Cancel"}),e.jsx(P,{type:"submit",disabled:h,children:h?"Creating Alert...":"Create Alert"})]})]})]})})}function fI(){const t="savedJobs",[a,s]=p.useState([]);return p.useEffect(()=>{try{const i=localStorage.getItem(t);i&&s(JSON.parse(i))}catch(i){console.error("Failed to load saved jobs:",i)}},[]),{savedJobs:a,toggleJob:i=>{s(l=>{const h=l.includes(i)?l.filter(d=>d!==i):[...l,i];try{localStorage.setItem(t,JSON.stringify(h))}catch(d){console.error("Failed to persist saved jobs:",d)}return h})},isSaved:i=>i?a.includes(i):!1}}const zD=({value:t,options:a,onChange:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Order by"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{"aria-label":"Order results",value:t,onChange:n=>s(n.target.value),className:"block w-full rounded-lg border border-gray-300 bg-white px-3 py-2 pr-9 text-sm text-gray-700 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-100",children:a.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),e.jsx("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400",children:"▼"})]})]}),qD=6,cN={jobTypes:[],experienceLevels:[],country:"",city:"",location:"",minSalary:"",maxSalary:"",industry:""},FD=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,banner:n,enableMobileFilter:r=!0,cardType:i,dateField:l="created_at",dateFieldLabel:c="Published",searchableFilters:h=["companies"],notification_url:d="http://localhost:5147",userAccess:u,onEmitEvent:y,eventContext:x,onPopularTagClick:m,onPopularTagRemove:g,allowPopularTagRemoval:f=!1})=>{var RC;const[k,v]=p.useState([]),[N,M]=p.useState([]),[b,C]=p.useState([]),[S,L]=p.useState(1),[w,j]=p.useState({}),[I,T]=p.useState([]),[A,R]=p.useState({}),[D,q]=p.useState(""),[E,F]=p.useState([]),[G,Z]=p.useState(!1),[$,Q]=p.useState(a),[te,K]=p.useState("grid"),[ee,ce]=p.useState(!1),[fe,de]=p.useState([]),[se,H]=p.useState(!0),[z,_]=p.useState(null),[V,J]=p.useState("all"),[pe,ke]=p.useState(!1),[Be,is]=p.useState(!1),[Bt,he]=p.useState({...cN}),[_e,_t]=p.useState({open:!1,type:"info",message:""}),[pt,sa]=p.useState("date_desc"),{savedJobs:fa,toggleJob:Sn}=fI(),Lt=B7(u),ot=p.useMemo(()=>({component:"Listing",...x??{}}),[x]),$s=p.useMemo(()=>[{value:"relevance",label:"Best match (relevance)"},{value:"date_desc",label:`${c} (newest)`},{value:"date_asc",label:`${c} (oldest)`},{value:"views_desc",label:"Most viewed"},{value:"views_asc",label:"Least viewed"},{value:"title_asc",label:"Title A → Z"}],[c]),lt=p.useCallback((X,ue)=>{y&&y({domain:"jobs",name:X,payload:ue,timestamp:new Date().toISOString(),context:ot})},[ot,y]),Ya=p.useCallback((X,ue)=>{y&&y({domain:"newsletter",name:X,payload:ue,timestamp:new Date().toISOString(),context:ot})},[ot,y]),_a=p.useCallback(async X=>{Ya("newsletter_subscribe_requested",X)},[Ya]),ka=p.useCallback(()=>({filters:{...w},advancedFilters:Bt,dateFilter:V}),[w,V,Bt]),os=p.useCallback(()=>({page:S,pageSize:$,totalResults:N.length,viewMode:te,showOnlySaved:ee}),[S,N.length,$,ee,te]),va=p.useRef(!1),Ja=(X,ue)=>{_t({open:!0,type:X,message:ue})};p.useEffect(()=>{try{const X=localStorage.getItem("lastVisitedJobs");X&&de(JSON.parse(X));try{localStorage.getItem("email")&&is(!0)}catch(ue){console.error("Error checking subscription state:",ue)}}catch(X){console.error("Error loading data from localStorage:",X)}},[]),p.useEffect(()=>{const ue=new URLSearchParams(window.location.search).get("date_filter");ue&&ue!=="all"&&J(ue)},[]),p.useEffect(()=>{if(!t){_("❌ Missing API URL for Listing component!"),H(!1);return}H(!0),_(null),(async()=>{try{const ue=await fetch(t);if(!ue.ok)throw new Error(`API responded with status: ${ue.status}`);const we=await ue.json();if(!Array.isArray(we))throw new Error("Expected an array but received: "+typeof we);const De=we.map((Yt,Ka)=>({...Yt,sponsored:Ka%7===0,topTag:uI(Yt.title||"")})),xt=Array.from(new Set(De.map(Yt=>Yt.topTag).filter(Yt=>typeof Yt=="string"))).slice(0,10);C(xt);const wa=Kc(De,pt,I,l);v(De),M(wa);const ls=Lc(De,s);R(ls)}catch(ue){console.error("Error fetching data:",ue),_(`Failed to load data: ${ue instanceof Error?ue.message:String(ue)}`);const we=yD(20),De=Kc(we,pt,I,l);v(we),M(De);const xt=Lc(we,s);R(xt)}finally{H(!1)}})()},[t,l,I,pt]),p.useEffect(()=>{const X=new URLSearchParams(window.location.search),ue={};s.forEach(xt=>{const wa=X.get(xt);wa&&(ue[xt]=wa)}),j(ue);const we=X.get("q")||X.get("searchTerm")||"";we&&q(we);const De={};s.forEach(xt=>{const wa=X.get(xt);wa&&(De[xt]=wa)}),j(De)},[]),p.useEffect(()=>{if(ee){const X=k.filter(we=>fa.includes(we.id||we.slug||we.link)),ue=Kc(X,pt,I,l);M(ue),L(1)}else ra()},[]),p.useEffect(()=>{va.current||se||!N.length&&!k.length||(lt("jobs_listing_viewed",{...ka(),...os()}),va.current=!0)},[k.length,lt,N.length,ka,os,se]);const na=p.useCallback(X=>{const ue=Lc(X,s);R(ue)},[s]),ra=p.useCallback(X=>{const ue=(X==null?void 0:X.baseItems)??k,we=(X==null?void 0:X.filters)??w,De=(X==null?void 0:X.search)??I,xt=(X==null?void 0:X.dateFilter)??V,wa=(X==null?void 0:X.advanced)??Bt;let ls=Go(ue,we,De,xt,l);ls=jD(ls,wa);const Yt=Kc(ls,pt,De,l);return M(Yt),((X==null?void 0:X.resetPage)??!0)&&L(1),((X==null?void 0:X.refreshFiltersData)??!0)&&na(Yt),Yt},[V,w,Bt,k,l,I,pt,na]);p.useEffect(()=>{ra({resetPage:!1,refreshFiltersData:!1})},[pt,ra]);const ge=(X,ue)=>{const we={...w};ue?we[X]=ue:delete we[X],ee&&ce(!1),j(we),ra({filters:we});const De={...ka(),filters:we};ue?lt("jobs_filter_selected",{key:X,value:ue,...De}):lt("jobs_filter_cleared",{key:X,...De})},Ie=()=>{is(!0),be().then(()=>ke(!1))},Te=p.useRef(null),ze=X=>{L(X),lt("jobs_listing_page_changed",{page:X,pageSize:$,totalResults:N.length}),setTimeout(()=>{var ue;(ue=Te.current)==null||ue.scrollIntoView({behavior:"smooth",block:"start"})},100)},Ne=X=>{ee&&ce(!1),J(X),ra({dateFilter:X}),pI(X),lt("jobs_date_filter_changed",{dateFilter:X})},Qe=X=>{if(q(X),X){const ue=k.map(we=>we.title).filter((we,De,xt)=>we&&we.toLowerCase().includes(X.toLowerCase())&&xt.indexOf(we)===De).slice(0,5);F(ue)}else F([])},dt=X=>{if(!X.trim())return;ee&&ce(!1);const ue=[...I,X.trim()];T(ue),ra({search:ue}),q(""),lt("jobs_search_submitted",{searchKeywords:ue,query:X.trim(),...ka()})},ye=X=>{const ue=I.filter(we=>we!==X);T(ue),ra({search:ue}),lt("jobs_search_filter_removed",{removedKeyword:X,remainingKeywords:ue})},Y=()=>{j({}),T([]),ce(!1),J("all"),he({...cN}),ra({filters:{},search:[],dateFilter:"all",advanced:cN}),lt("jobs_filters_cleared_all",{})},le=X=>{const ue=new Set,we=[];for(const De of X){const xt=`${De.key??""}|${De.value.toLowerCase()}`;ue.has(xt)||(ue.add(xt),we.push(De))}return we},xe=X=>X.replace(/\/+$/,""),be=async()=>{if(lt("jobs_alert_cta_clicked",{searchKeywords:I,query:D.trim()||void 0,...ka()}),!Be)ke(!0),lt("jobs_subscription_modal_opened",{});else{const X=localStorage.getItem("email"),ue=localStorage.getItem("leadId");if(!X||!ue){Ja("info","Please subscribe first to create alerts.");return}const we="keyword",De=(ja,cs)=>cs&&cs.trim()?{key:ja.toLowerCase(),value:cs.trim()}:null,xt=Object.entries(w).map(([ja,cs])=>De(ja,cs)).filter(ja=>ja!==null),wa=I.map(ja=>De(we,ja)).filter(ja=>ja!==null),ls=De(we,D),Yt=ls?[ls]:[],Ka=le([...xt,...wa,...Yt]);if(Ka.length===0){Ja("info","No filters/keywords to save.");return}try{const ja=xe(d??"http://localhost:5147"),cs=await fetch(`${ja}/api/leads/${ue}/preferences/bulk`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ka)});if(!cs.ok){let Wc="";try{Wc=await cs.text()}catch{}throw new Error(`${cs.status} ${cs.statusText} ${Wc}`.trim())}Ja("success","Alert saved. We’ll notify you about new matching jobs."),q(""),lt("jobs_alert_created",{preferences:Ka.filter(Wc=>Wc!==null)})}catch(ja){console.error("Create alert failed:",ja),Ja("error","Failed to save alert.")}}},Re=()=>{Z(!G)},Ft=N.length===0?0:(S-1)*$+1,$e=Math.min(S*$,N.length),yt=X=>{Q(X),L(1),lt("jobs_listing_items_per_page_changed",{pageSize:X})},Ul=()=>{K(X=>{const ue=X==="grid"?"list":"grid";return lt("jobs_listing_viewmode_changed",{viewMode:ue}),ue})},It=(X,ue,we="same_tab",De="listing")=>{const xt=X.id||X.slug||X.link;xt&&(de(wa=>{const ls=wa.filter(Ka=>(Ka.id||Ka.slug||Ka.link)!==xt),Yt=[X,...ls].slice(0,qD);try{localStorage.setItem("lastVisitedJobs",JSON.stringify(Yt))}catch(Ka){console.error("Error saving to localStorage:",Ka)}return Yt}),lt("job_opened",{jobId:xt,slug:X.slug,positionInList:ue,openedFrom:De,openedIn:we}))},ba=(X,ue)=>{const we=X.id||X.slug||X.link;if(!we)return;const De=fa.includes(we);Sn(we),lt(De?"job_unsaved":"job_saved",{jobId:we,slug:X.slug,positionInList:ue})},G7=(X,ue,we="external")=>{const De=X.id||X.slug||X.link;De&<("job_apply_clicked",{jobId:De,slug:X.slug,positionInList:ue,applyType:we})},TC=()=>{ce(!ee)},PA=Math.ceil(N.length/$),TA=N.slice((S-1)*$,S*$);return z&&!k.length?e.jsx("div",{className:"flex-grow p-8",children:e.jsx("div",{className:"max-w-7xl mx-auto",children:e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-800 rounded-lg p-6",children:[e.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Error Loading Jobs"}),e.jsx("p",{className:"mb-4",children:z}),e.jsx("button",{onClick:()=>window.location.reload(),className:"bg-red-100 hover:bg-red-200 text-red-800 font-medium py-2 px-4 rounded",children:"Retry"})]})})}):e.jsxs("div",{className:"flex flex-col min-h-screen pb-16 md:pb-0",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx(jC,{onSearchChange:Qe,searchPlaceholder:"Search jobs, companies, or keywords...",title:"Job Listings",description:"",popularTags:b,generateHref:X=>`/jobs?q=${X.toLowerCase().replace(/\s+/g,"+")}`,onTagClick:m,onTagRemove:g,allowTagRemoval:f}),e.jsxs("div",{className:"container mx-auto py-8 pb-20 md:pb-8",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:[e.jsx(hI,{data:k.map(X=>X.title).filter(Boolean),onSelect:X=>{dt(X)},onTyping:X=>{q(X),Qe(X)},placeholder:"Search for jobs, companies, or keywords...",className:"w-full",showSubmitButton:!0}),e.jsx("button",{className:"block md:hidden flex items-center justify-center p-3 bg-white border-2 border-gray-200 text-gray-700 rounded-xl hover:border-gray-300 hover:bg-gray-50 transition-all duration-200 focus:ring-4 focus:ring-gray-200 focus:outline-none hover:scale-105",onClick:Re,children:e.jsx(hn,{size:16,className:"mr-1.5"})})]}),e.jsx("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:e.jsx(MC,{filters:[...V!=="all"?[{key:"date",label:c,value:V.replace(/_/g," "),onRemove:()=>Ne("all")}]:[],...I.map(X=>({key:"search",label:"",value:X,onRemove:()=>ye(X)})),...Object.entries(w).map(([X,ue])=>({key:X,label:X.replace(/_/g," "),value:ue,onRemove:()=>ge(X,"")}))],onClearAll:Y,handleCreateAlert:be})})]}),r&&e.jsxs("button",{className:"md:hidden w-full mb-6 px-4 py-3 bg-yellow-600 text-white rounded-lg flex items-center justify-center",onClick:Re,"aria-expanded":G,children:[e.jsx(hn,{className:"w-4 h-4 mr-2"}),G?"Close Filters":"Filters"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:gap-6",children:[e.jsx(yI,{dateFieldLabel:"Date",activeDateFilter:V,onDateFilterChange:Ne,filterKeys:s,searchableFilters:h,filtersData:A,activeFilters:w,handleFilterChange:ge,toggleSavedJobsFilter:TC,showOnlySaved:ee,savedJobs:fa}),se?e.jsx(Wa,{}):e.jsxs("div",{className:"lg:gap-6 w-fit",children:[e.jsx(mI,{viewMode:te,onToggleViewMode:Ul,selectedItemsPerPage:$,onItemsPerPageChange:yt,totalCount:N.length,startIndex:Ft,endIndex:$e,title:"Latest Jobs"}),e.jsxs("div",{className:"",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("h3",{className:"text-xl font-semibold text-gray-900 flex items-center",children:[ee?"Saved Jobs":"Open Positions",V!=="all"&&!ee&&e.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",V.replace(/_/g," "),")"]})]}),e.jsxs("p",{className:"text-sm text-gray-600",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:N.length})," found"]})]}),e.jsx(zD,{value:pt,options:$s,onChange:sa})]})}),e.jsx(vD,{items:TA,cardType:i,viewMode:te,savedJobs:fa,onSaveJob:ba,onViewJob:It,onApplyJob:G7,firstItemRef:Te,userAccess:Lt}),N.length>0&&e.jsx("div",{className:"mt-6",children:e.jsx(V7,{currentPage:S,totalPages:PA,onPageChange:ze})})]}),fe.length>0&&e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:e.jsx(bD,{jobs:fe,onViewJob:It})})]}),e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:((RC=n==null?void 0:n.sidebar)==null?void 0:RC.enabled)&&e.jsxs("div",{className:"sticky top-4",children:[e.jsx(Ol,{position:"sidebar",url:n.sidebar.url,link:n.sidebar.link,alt:n.sidebar.alt}),e.jsx(E7,{onSubscribe:_a}),e.jsxs("div",{className:"mt-6 bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((X,ue)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+ue)}`,alt:`Featured employer ${ue+1}`,className:"w-10 h-10 object-contain"})},ue))})]})]})})]})]})]}),e.jsx(dI,{activeDateFilter:V,handleDateFilterChange:Ne,filterKeys:s,searchableFilters:h,dateFieldLabel:c,activeFilters:w,handleFilterChange:ge,toggleSavedJobsFilter:TC,filtersData:A,savedJobs:fa,showOnlySaved:ee,isMobileFilterOpen:G,toggleMobileFilter:Re}),e.jsx(cl,{}),e.jsx(oI,{open:_e.open,type:_e.type,message:_e.message,onClose:()=>_t(X=>({...X,open:!1}))}),e.jsx(_D,{open:pe,onOpenChange:ke,onSubscriptionSuccess:Ie,apiUrl:d})]})},kI=ie.forwardRef(({className:t,...a},s)=>e.jsxs(Ql.Root,{ref:s,className:oe("relative flex w-full touch-none select-none items-center",t),...a,children:[e.jsx(Ql.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(Ql.Range,{className:"absolute h-full bg-primary"})}),e.jsx(Ql.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));kI.displayName=Ql.Root.displayName;const vI=({title:t="Filters",sections:a,onFilterChange:s,onClearAll:n,activeFiltersCount:r,maxVisible:i=5,rangeConfig:l,savedCount:c=0,showSavedOnly:h=!1,onToggleSavedOnly:d,savedLabel:u="Saved Items",className:y=""})=>e.jsxs("div",{className:`bg-card rounded-lg shadow-sm border border-border sticky top-24 max-h-[calc(100vh-7rem)] overflow-y-auto scrollbar-thin ${y}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ds,{className:"w-5 h-5 text-accent"}),e.jsx("h2",{className:"font-semibold text-foreground",children:t}),r>0&&e.jsx("span",{className:"bg-accent text-accent-foreground text-xs font-bold px-2 py-0.5 rounded-full",children:r})]}),r>0&&e.jsx("button",{onClick:n,className:"text-sm text-accent hover:underline",children:"Clear all"})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[a.map(x=>e.jsx(ED,{section:x,onFilterChange:s,maxVisible:i,rangeConfig:l},x.key)),d&&e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsxs("button",{onClick:d,className:`w-full px-4 py-2.5 rounded-lg flex items-center justify-center gap-2 transition-colors ${h?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[e.jsx(Et,{className:"w-4 h-4"}),e.jsxs("span",{className:"font-medium",children:[u," (",c,")"]})]})})]})]}),ED=({section:t,onFilterChange:a,maxVisible:s,rangeConfig:n})=>{var b,C,S;const[r,i]=p.useState(t.defaultExpanded??!0),[l,c]=p.useState(""),[h,d]=p.useState(!1),u=t.maxVisible??s,y=p.useMemo(()=>{var I;const L=((I=t.options)==null?void 0:I.filter(T=>T.label.toLowerCase().includes(l.toLowerCase())))||[],w=L.filter(T=>t.selectedValues.includes(T.value)),j=L.filter(T=>!t.selectedValues.includes(T.value));return[...w,...j]},[t.options,l,t.selectedValues]),x=p.useMemo(()=>h||u>=y.length?y:y.slice(0,u),[y,h,u]),m=y.length>u,g=t.searchable!==!1&&(((b=t.options)==null?void 0:b.length)||0)>6,f=L=>{const w=t.selectedValues.includes(L)?t.selectedValues.filter(j=>j!==L):[...t.selectedValues,L];a(t.key,w)},k=L=>{a(t.key,L?[L]:[])},v=t.rangeConfig??n,N=t.selectedValues.length===2?t.selectedValues.map(Number):v?[v.min,v.max]:[0,100],M=L=>{if(v!=null&&v.formatLabel)return v.formatLabel(L);const w=(v==null?void 0:v.unit)||"";return((v==null?void 0:v.unitPosition)||"prefix")==="prefix"?`${w}${L.toLocaleString()}`:`${L.toLocaleString()}${w}`};return e.jsxs("div",{className:"border-b border-border pb-4 last:border-b-0 last:pb-0",children:[t.collapsible!==!1?e.jsxs("button",{onClick:()=>i(!r),className:"flex items-center justify-between w-full py-2 text-left",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.label}),r?e.jsx(cn,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(la,{className:"w-4 h-4 text-muted-foreground"})]}):e.jsx("h3",{className:"text-sm font-medium text-foreground py-2",children:t.label}),r&&e.jsxs("div",{className:"mt-2 space-y-2",children:[g&&t.type==="checkbox"&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx(wt,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx("input",{type:"text",value:l,onChange:L=>c(L.target.value),placeholder:`Search ${t.label.toLowerCase()}...`,className:"w-full h-8 pl-8 pr-8 text-sm rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),l&&e.jsx("button",{onClick:()=>c(""),className:"absolute right-2 top-1/2 -translate-y-1/2",children:e.jsx(Ve,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})]}),t.type==="checkbox"&&e.jsxs("div",{className:"space-y-2",children:[x.map(L=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(L.value),onChange:()=>f(L.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground group-hover:text-accent transition-colors flex-1 truncate",children:L.label}),L.count!==void 0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",L.count,")"]})]},L.value)),y.length===0&&l&&e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No matching options"}),m&&!l&&e.jsx("button",{onClick:()=>d(L=>!L),className:"text-sm text-accent hover:underline font-medium mt-1",children:h?"View less":`View more (${y.length-u})`})]}),(t.type==="select"||t.type==="searchable-select")&&e.jsxs("select",{value:t.selectedValues[0]||"",onChange:L=>k(L.target.value),className:"w-full h-9 px-3 rounded-md border border-input bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:[e.jsxs("option",{value:"",children:["All ",t.label]}),(C=t.options)==null?void 0:C.map(L=>e.jsxs("option",{value:L.value,children:[L.label,L.count!==void 0&&` (${L.count})`]},L.value))]}),t.type==="range"&&v&&e.jsxs("div",{className:"space-y-3 px-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[e.jsx("span",{children:M(N[0])}),e.jsx("span",{children:M(N[1])})]}),e.jsx(kI,{min:v.min,max:v.max,step:v.step??1,value:N,onValueChange:L=>{a(t.key,L.map(String))},className:"w-full"}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:M(v.min)}),e.jsx("span",{children:M(v.max)})]})]}),t.type==="toggle"&&((S=t.options)==null?void 0:S.map(L=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(L.value),onChange:()=>f(L.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground",children:L.label})]},L.value)))]})]})},OD=({isOpen:t,onClose:a,title:s="Filters",children:n})=>t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75 z-40",onClick:a}),e.jsxs("div",{className:"fixed inset-y-0 right-0 max-w-xs w-full bg-white shadow-xl z-50 overflow-y-auto",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-200 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:s}),e.jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100","aria-label":"Close filters",children:e.jsx("svg",{className:"h-6 w-6 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"p-4",children:n})]})]}):null,bI=({sort:t,viewMode:a,onViewModeChange:s,itemsPerPage:n,onItemsPerPageChange:r,itemsPerPageOptions:i,showItemsPerPage:l=!0,trailingSlot:c,className:h="",summaryTitle:d,startIndex:u,endIndex:y,totalCount:x,itemLabel:m="items"})=>{var v;const[g,f]=p.useState(!1);p.useEffect(()=>{var b;if(typeof window>"u"||typeof window.matchMedia!="function")return;const N=window.matchMedia("(max-width: 767px)"),M=()=>f(N.matches);return M(),(b=N.addEventListener)==null||b.call(N,"change",M),()=>{var C;return(C=N.removeEventListener)==null?void 0:C.call(N,"change",M)}},[]);const k=d&&typeof x=="number"&&typeof u=="number"&&typeof y=="number";return e.jsx("div",{className:`rounded-lg border border-gray-200 bg-white p-4 ${h}`,children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row items-center lg:justify-between",children:[e.jsx("div",{className:"flex-1 min-w-0 hidden lg:inline-block",children:k&&e.jsxs("div",{className:"mb-3 hidden lg:block",children:[e.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:d}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Showing ",e.jsx("span",{className:"font-semibold text-gray-900",children:u}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:x})," ",m]})]})}),e.jsx("div",{className:"w-full lg:w-auto",children:e.jsxs("div",{className:"flex w-full flex-nowrap items-center gap-1.5 lg:w-auto lg:justify-end",children:[k&&e.jsxs("div",{className:"min-w-0 flex-1 truncate whitespace-nowrap text-xs text-gray-600 lg:hidden",children:[e.jsx("span",{className:"font-semibold text-gray-900",children:u}),"–",e.jsx("span",{className:"font-semibold text-gray-900",children:y})," of"," ",e.jsx("span",{className:"font-semibold text-gray-900",children:x})," ",m]}),t&&((v=t.options)==null?void 0:v.length)>0&&e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-gray-500 whitespace-nowrap hidden lg:inline-block cursor-pointer select-none",children:t.label??"Order"}),e.jsx("select",{value:t.value,onChange:N=>t.onChange(N.target.value),className:"h-8 w-[7.5rem] pl-3 pr-8 rounded-lg border border-gray-200 bg-gray-50 text-xs lg:w-auto lg:text-sm focus:outline-none focus:ring-2 focus:ring-yellow-500",children:t.options.map(N=>e.jsx("option",{value:N.value,children:N.label},N.value))})]}),a&&s&&!g&&e.jsx(H7,{viewMode:a,onViewModeChange:s}),l&&n!==void 0&&r&&e.jsx(NC,{value:n,onChange:r,options:i,className:"shrink-0",selectClassName:"w-[4rem] lg:w-auto"}),c]})})]})})},wI=({value:t,onChange:a,onSubmit:s,onClear:n,onFilterClick:r,placeholder:i="Search...",suggestions:l=[],onSuggestionSelect:c,showFilterButton:h=!0,filterCount:d=0,className:u=""})=>{const[y,x]=p.useState(!1),m=g=>{g.key==="Enter"&&t.trim()&&(s(t.trim()),x(!1)),g.key==="Escape"&&x(!1)};return e.jsxs("div",{className:`relative ${u}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(wt,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),e.jsx("input",{type:"text",value:t,onChange:g=>{a(g.target.value),x(g.target.value.length>0)},onKeyDown:m,onFocus:()=>x(t.length>0&&l.length>0),onBlur:()=>setTimeout(()=>x(!1),200),placeholder:i,className:"w-full h-12 pl-10 pr-20 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"}),t&&n&&e.jsx("button",{onClick:n,"aria-label":"Clear search",className:"absolute right-14 top-1/2 -translate-y-1/2 p-1 hover:bg-muted rounded",children:e.jsx(Ve,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx("button",{onClick:()=>t.trim()&&s(t.trim()),className:"absolute right-2 top-1/2 -translate-y-1/2 bg-accent hover:bg-accent-hover text-accent-foreground p-2 rounded-md transition-colors",children:e.jsx(wt,{className:"h-4 w-4"})})]}),h&&r&&e.jsxs("button",{onClick:r,className:"lg:hidden flex items-center justify-center h-12 w-12 rounded-lg border border-input bg-background hover:bg-muted transition-colors relative",children:[e.jsx(hn,{className:"h-5 w-5 text-muted-foreground"}),d>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-accent text-accent-foreground text-xs font-bold w-5 h-5 rounded-full flex items-center justify-center",children:d})]})]}),y&&l.length>0&&e.jsx("ul",{className:"absolute z-20 mt-1 w-full bg-card border border-border rounded-lg shadow-lg max-h-60 overflow-y-auto",children:l.map((g,f)=>e.jsx("li",{children:e.jsxs("button",{className:"w-full px-4 py-2 text-left text-sm text-foreground hover:bg-muted flex items-center gap-2",onClick:()=>{c==null||c(g),x(!1)},children:[e.jsx(wt,{className:"h-4 w-4 text-muted-foreground"}),g]})},f))})]})},dN=({config:t,className:a=""})=>{const s=t.url.match(/\.(mp4|webm|ogg)$/i),n={sidebar:"w-full max-w-[300px] h-[250px]",top:"w-full h-[48px] md:h-[90px]",bottom:"w-full h-[48px] md:h-[90px]"};return e.jsx("div",{className:`flex justify-center items-center rounded-lg overflow-hidden bg-muted ${a}`,children:e.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"block",children:s?e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:`${n[t.position]} object-cover`,children:[e.jsx("source",{src:t.url,type:"video/mp4"}),"Your browser does not support the video tag."]}):e.jsx("img",{src:t.url,alt:t.alt??"Advertisement",className:`${n[t.position]} object-cover`})})})},Za=({title:t,description:a,headerPopularTags:s=[],sponsoredSlot:n,sidebarSlot:r,filtersPanel:i,mobileFiltersPanel:l,filters:c,filterValues:h,onFilterChange:d,onClearFilters:u,activeFilters:y,search:x,sort:m,viewMode:g,onViewModeChange:f,pagination:k,showToolbar:v=!0,toolbarTrailingSlot:N,resultsClassName:M="",banner:b,headerActions:C,children:S,maxFiltersVisible:L=5})=>{const[w,j]=p.useState(!1),[I,T]=p.useState(""),A=()=>j(!0);p.useEffect(()=>{if(typeof window>"u")return;const K=new URLSearchParams(window.location.search),ee=K.get("searchTerm")??K.get("q")??"";x&&ee&&(T(ee),x.onChange(ee),x.onSubmit&&x.onSubmit!==x.onChange&&x.onSubmit(ee)),!(!c||!d)&&c.forEach(ce=>{const fe=[...K.getAll(ce.key),...K.getAll(`filters[${ce.key}]`)],de=Array.from(new Set(fe.flatMap(se=>se.split(",")).map(se=>se.trim()).filter(Boolean)));de.length>0&&d(ce.key,de)})},[]);const R=!!(i||c&&c.length>0),D=p.useMemo(()=>c?c.map(K=>({...K,selectedValues:(h==null?void 0:h[K.key])??[]})):[],[c,h]),q=p.useMemo(()=>h?Object.values(h).reduce((K,ee)=>K+ee.length,0):y?y.length:0,[h,y]),E=(k==null?void 0:k.toolbarTotalCount)??(k==null?void 0:k.totalCount)??0,F=k&&E>0?(k.page-1)*k.pageSize+1:0,G=k&&E>0?Math.min(k.page*k.pageSize,E):0,Z=p.useMemo(()=>i||(c&&d&&u?e.jsx(vI,{sections:D,onFilterChange:d,onClearAll:u,activeFiltersCount:q,maxVisible:L}):null),[i,c,d,u,D,q]),$=l??Z,Q=p.useMemo(()=>{const K=y?[...y]:[],ee=I.trim();return ee&&!K.some(ce=>ce.key==="searchTerm"&&ce.value===ee)&&K.unshift({key:"searchTerm",label:"Search",value:ee,onRemove:()=>{T(""),x!=null&&x.onClear?x.onClear():x!=null&&x.onChange&&x.onChange("")}}),K},[y,x,I]),te=()=>{u==null||u(),T(""),x!=null&&x.onClear?x.onClear():x!=null&&x.onChange&&x.onChange("")};return e.jsxs("div",{className:"bg-gray-50",children:[e.jsx(jC,{onSearchChange:()=>{},title:t,description:a,sponsoredSlot:n,popularTags:s}),C&&e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-4 flex justify-end",children:C}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[x&&e.jsx("div",{className:"mb-4",children:e.jsx(wI,{value:x.value,onChange:x.onChange,onSubmit:K=>{const ee=K.trim();ee&&T(ee),x.onSubmit(K)},onClear:()=>{T(""),x.onClear?x.onClear():x.onChange("")},placeholder:x.placeholder,suggestions:x.suggestions,onSuggestionSelect:x.onSuggestionSelect,onFilterClick:R?A:void 0,filterCount:q,showFilterButton:R})}),v&&e.jsx(bI,{sort:m,viewMode:g,onViewModeChange:f,itemsPerPage:k==null?void 0:k.pageSize,onItemsPerPageChange:k==null?void 0:k.onPageSizeChange,itemsPerPageOptions:k==null?void 0:k.pageSizeOptions,showItemsPerPage:(k==null?void 0:k.showItemsPerPage)!==!1,trailingSlot:N,summaryTitle:(k==null?void 0:k.toolbarTitle)??t,totalCount:E,startIndex:F,endIndex:G,itemLabel:(k==null?void 0:k.toolbarItemLabel)??"items"}),Q.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(MC,{filters:Q,onClearAll:te})}),e.jsxs("div",{className:"mt-6 flex flex-col gap-6 lg:flex-row",children:[Z&&e.jsxs("aside",{className:"hidden lg:block lg:w-72 space-y-4",children:[Z,b&&b.position==="sidebar"&&e.jsx(dN,{config:b})]}),e.jsxs("div",{className:`flex-1 ${M}`,children:[b&&b.position==="top"&&e.jsx("div",{className:"mb-4",children:e.jsx(dN,{config:b})}),S,b&&b.position==="bottom"&&e.jsx("div",{className:"mt-4",children:e.jsx(dN,{config:b})}),k&&k.enabled!==!1&&e.jsx(V7,{currentPage:k.page,totalPages:k.totalPages,onPageChange:k.onPageChange})]}),r&&e.jsx("aside",{className:"lg:w-72",children:r})]})]}),$&&e.jsx(OD,{isOpen:w,onClose:()=>j(!1),children:$})]})},Ic=["categories","jobType","salaryRange","created","company","country","city","department","workplace","companySize"],BD={created_at:"created",createdAt:"created",published_at:"created",publishedAt:"created",job_type:"jobType",company_size:"companySize"},d9=t=>{const a=[];return t.forEach(s=>{const n=BD[s]??s;Ic.includes(n)&&!a.includes(n)&&a.push(n)}),a.length>0?a:[...Ic]},HD=[{value:"full-time",label:"Full-time"},{value:"part-time",label:"Part-time"},{value:"intern",label:"Intern"},{value:"seasonal",label:"Seasonal"},{value:"contract",label:"Contract"}],VD=[{value:"today",label:"Today"},{value:"this_week",label:"This week"},{value:"last_week",label:"Last week"},{value:"this_month",label:"This month"},{value:"last_3_months",label:"Last 3 months"},{value:"this_year",label:"This year"}],UD=[{value:"remote",label:"Remote"},{value:"hybrid",label:"Hybrid"},{value:"onsite",label:"On-site"}],GD=["company","country","city"],v7=(t,a)=>{if(typeof t=="string"){const s=t.trim();if(!s)return"";const n=s.match(new RegExp(`['"]${a}['"]\\s*:\\s*['"]([^'"]+)['"]`,"i"));if(n!=null&&n[1])return n[1].trim();if(s.startsWith("{")&&s.endsWith("}")){const r=s.replace(/([{,]\s*)'([^']+)'\s*:/g,'$1"$2":').replace(/:\s*'([^']*)'/g,': "$1"');try{const i=JSON.parse(r);return v7(i,a)}catch{return s}}return s}if(Array.isArray(t))return t.map(s=>v7(s,a)).find(Boolean)??"";if(t&&typeof t=="object"){const s=t,n=[a,"name","label","value","title"];for(const r of n){const i=s[r],l=v7(i,a);if(l)return l}}return""},Dl=(t,a)=>{const s=t[a];return v7(s,a)},$D=t=>{const a=Dl(t,"workplace")||Dl(t,"workplace_type");if(a)return a.toLowerCase();const s=(t.location??"").toLowerCase();return s.includes("remote")?"remote":s.includes("hybrid")?"hybrid":"onsite"},WD=(t,{optionSort:a="alphabetical",showOptionCounts:s=!0})=>{const n=t.reduce((r,i)=>{const l=i.trim();return l&&r.set(l,(r.get(l)??0)+1),r},new Map);return Array.from(n.entries()).sort(([r,i],[l,c])=>a==="count_desc"?c-i||r.localeCompare(l):a==="count_asc"&&i-c||r.localeCompare(l)).map(([r,i])=>({value:r,label:r,...s?{count:i}:{}}))},ZD=(t,a,s={})=>{const n=s.multiSelectKeys??GD;return a.map(r=>{if(r==="jobType")return{key:r,label:"Job Type",type:"checkbox",options:HD};if(r==="salaryRange"){const u=Math.max(1e5,...t.flatMap(y=>[Number(y.min_salary??0),Number(y.max_salary??0)]));return{key:r,label:"Salary Range",type:"range",rangeConfig:{min:0,max:u,step:1e3,unit:"$",unitPosition:"prefix"}}}if(r==="created")return{key:r,label:"Created",type:"checkbox",options:VD};if(r==="workplace")return{key:r,label:"Remote / Hybrid / On-site",type:"checkbox",options:UD};const i={categories:"Categories",company:"Company",country:"Country",city:"City",department:"Department",companySize:"Company Size"},l={categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"},c=WD(t.map(u=>Dl(u,l[r])),s),h=n.includes(r),d=["company","country","city"].includes(r);return{key:r,label:i[r],type:d&&!h?"searchable-select":"checkbox",searchable:r==="categories"||r==="department"||d&&h,options:c}})},YD=t=>new Date(t.created_at??t.published_at??t.scraped_at??0),JD=(t,a)=>{const s=new Date,n=YD(t);if(Number.isNaN(n.getTime()))return!1;const r=24*60*60*1e3,i=s.getTime()-n.getTime();switch(a){case"today":return n.toDateString()===s.toDateString();case"this_week":return i<=7*r;case"last_week":return i>7*r&&i<=14*r;case"this_month":return n.getMonth()===s.getMonth()&&n.getFullYear()===s.getFullYear();case"last_3_months":return i<=90*r;case"this_year":return n.getFullYear()===s.getFullYear();default:return!0}},KD=(t,a,s)=>{if(s.length===0)return!0;if(a==="salaryRange"){if(s.length<2)return!0;const[r,i]=s.map(Number),l=Number(t.min_salary??0),c=Number(t.max_salary??l);return!Number.isNaN(r)&&!Number.isNaN(i)&&c>=r&&l<=i}if(a==="created")return s.some(r=>JD(t,r));if(a==="jobType"){const r=Dl(t,"job_type")||Dl(t,"type");return s.includes(r.toLowerCase())}if(a==="workplace")return s.includes($D(t));const n={categories:"category",company:"company",country:"country",city:"city",department:"department",companySize:"company_size"};return s.includes(Dl(t,n[a]))},XD=[{value:"date_desc",label:"Newest"},{value:"date_asc",label:"Oldest"},{value:"title_asc",label:"Title (A-Z)"},{value:"company_asc",label:"Company (A-Z)"}],h9="savedJobs",QD=["vip","casino","marketing","sportsbook","compliance","money laundering","igaming","payments","crm","ai"],Xc=t=>new Date(t.created_at??t.published_at??t.scraped_at??0).getTime(),e_=({apiUrl:t,itemsPerPage:a=12,filterKeys:s,filterOptions:n,enablePagination:r=!0,enableMobileFilter:i=!0,searchableFilters:l=["company"],filterDisplayConfig:c,banner:h,cardType:d="job",userAccess:u,onEmitEvent:y,eventContext:x,initialJobs:m})=>{var z;const[g,f]=p.useState(m??[]),[k,v]=p.useState(!m),[N,M]=p.useState(""),[b,C]=p.useState({}),[S,L]=p.useState(1),[w,j]=p.useState(a),[I,T]=p.useState("date_desc"),[A,R]=p.useState("grid"),[D,q]=p.useState([]),E=B7(u),F=p.useMemo(()=>{const _=n??s??[...Ic];return d9(_)},[s,n]),G=p.useMemo(()=>({...c,multiSelectKeys:c!=null&&c.multiSelectKeys?d9(c.multiSelectKeys):void 0}),[c]);p.useEffect(()=>{try{const _=localStorage.getItem(h9);if(_){const V=JSON.parse(_);Array.isArray(V)&&q(V.filter(J=>typeof J=="string"))}}catch(_){console.error("Failed to load saved jobs",_)}},[]),p.useEffect(()=>{try{localStorage.setItem(h9,JSON.stringify(D))}catch(_){console.error("Failed to persist saved jobs",_)}},[D]),p.useEffect(()=>{if(m)return;let _=!0;const V=async()=>{try{const J=await fetch(t);if(!J.ok)throw new Error("Could not load jobs");const pe=await J.json();_&&Array.isArray(pe)&&f(pe)}catch(J){console.error("Failed to fetch jobs",J),_&&f([])}finally{_&&v(!1)}};return v(!0),V(),()=>{_=!1}},[t,m]),p.useEffect(()=>{if(typeof window>"u")return;const _=new URLSearchParams(window.location.search),V=_.get("searchTerm")??_.get("q")??"";V&&M(V);const J={};F.forEach(pe=>{const ke=[..._.getAll(pe),..._.getAll(`filters[${pe}]`),...pe==="created"?_.getAll("created_at"):[],...pe==="created"?_.getAll("filters[created_at]"):[]].flatMap(Be=>Be.split(",")).map(Be=>Be.trim()).filter(Boolean);ke.length&&(J[pe]=Array.from(new Set(ke)))}),Object.keys(J).length>0&&C(pe=>({...pe,...J}))},[F]);const Z=p.useMemo(()=>ZD(g,F,G).map(_=>({..._,searchable:_.searchable??l.includes(_.key)})),[g,G,F,l]),$=p.useMemo(()=>{const _=N.trim().toLowerCase();return g.filter(V=>!_||`${V.title} ${V.company} ${V.location??""}`.toLowerCase().includes(_)?Object.entries(b).every(([pe,ke])=>ke.length===0||!Ic.includes(pe)?!0:KD(V,pe,ke)):!1)},[g,N,b]),Q=p.useMemo(()=>{const _=[...$];return _.sort((V,J)=>{switch(I){case"date_asc":return Xc(V)-Xc(J);case"title_asc":return(V.title??"").localeCompare(J.title??"");case"company_asc":return(V.company??"").localeCompare(J.company??"");case"date_desc":default:return Xc(J)-Xc(V)}}),_},[$,I]),te=p.useMemo(()=>{const _=(S-1)*w;return Q.slice(_,_+w)},[S,w,Q]),K=Math.max(1,Math.ceil(Q.length/w));p.useEffect(()=>{L(1)},[N,b,w]);const ee=p.useMemo(()=>{const _={categories:"Categories",jobType:"Job Type",salaryRange:"Salary Range",created:"Created",company:"Company",country:"Country",city:"City",department:"Department",workplace:"Remote / Hybrid / On-site",companySize:"Company Size"};return Object.entries(b).flatMap(([V,J])=>J.map(pe=>({key:V,value:pe,label:Ic.includes(V)?_[V]:V,onRemove:()=>{C(ke=>({...ke,[V]:(ke[V]??[]).filter(Be=>Be!==pe)}))}})))},[b]),ce=_=>{const V=String(_.id??_._id??"");V&&q(J=>J.includes(V)?J.filter(pe=>pe!==V):[...J,V])},fe=()=>{},de=p.useCallback((_,V)=>{y&&y({domain:"newsletter",name:_,payload:V,timestamp:new Date().toISOString(),context:{component:"Listing",...x??{}}})},[x,y]),se=p.useCallback(_=>{de(_.name,_.payload)},[de]),H=(z=h==null?void 0:h.sidebar)!=null&&z.enabled?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"sticky top-4 space-y-6",children:[e.jsx(Ol,{position:"sidebar",url:h.sidebar.url,link:h.sidebar.link,alt:h.sidebar.alt}),e.jsx(E7,{onEmitEvent:se,isAuthenticated:u==null?void 0:u.registered,userEmail:u==null?void 0:u.email}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((_,V)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+V)}`,alt:`Featured employer ${V+1}`,className:"w-10 h-10 object-contain"})},V))})]})]})}):void 0;return e.jsx(e.Fragment,{children:e.jsx(Za,{title:"Jobs",description:"Discover fresh opportunities across iGaming teams.",headerPopularTags:QD,search:{value:N,onChange:M,onSubmit:M,onClear:()=>M(""),placeholder:"Search jobs"},filters:Z,filterValues:b,onFilterChange:(_,V)=>C(J=>({...J,[_]:V})),onClearFilters:()=>C({}),activeFilters:ee,sort:{value:I,options:XD,onChange:T},viewMode:A,onViewModeChange:R,pagination:{enabled:r,page:S,pageSize:w,totalPages:K,totalCount:Q.length,toolbarTotalCount:Q.length,toolbarTitle:"Latest Jobs",toolbarItemLabel:"jobs",onPageChange:L,onPageSizeChange:j},sidebarSlot:H,resultsClassName:A==="grid"?"grid gap-4 sm:grid-cols-2":"space-y-4",children:k?e.jsx(Wa,{totalColumns:w}):te.length>0?te.map((_,V)=>{const J=String(_.id??_._id??"");return e.jsx(wC,{job:_,positionInList:(S-1)*w+V,onSaveJob:ce,onViewJob:fe,isSaved:!!(J&&D.includes(J)),layout:A==="grid"?"grid":"list",userAccess:E},J||`${_.title}-${V}`)}):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Ce,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jobs found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>C({}),children:"Clear all filters"})]})})})},t_=_7("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-yellow-200/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",accent:"border-transparent bg-accent/20 text-accent hover:bg-accent/30 shadow-card",gaming:"border-transparent bg-gaming-gold/20 text-gaming-gold hover:bg-gaming-gold/30 shadow-card"}},defaultVariants:{variant:"default"}});function O({className:t,variant:a,...s}){return e.jsx("div",{className:oe(t_({variant:a}),t),...s})}const a_=t=>{const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},s_=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),n_=({title:t,organizer:a,category:s,format:n,city:r,country:i,date:l,attendeeCount:c,tags:h=[],isFeatured:d=!1,isFree:u=!1,link:y})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[d&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Featured"}),u&&e.jsx(O,{className:"bg-emerald-500/10 text-emerald-600",children:"Free"}),e.jsx(O,{variant:"outline",children:s}),e.jsx(O,{variant:"secondary",children:n})]}),e.jsx("h3",{className:"mb-2 line-clamp-2 text-lg font-semibold text-foreground",children:t}),e.jsxs("p",{className:"mb-3 text-sm text-muted-foreground",children:["by ",a]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pa,{className:"h-3.5 w-3.5"}),a_(l)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"h-3.5 w-3.5"}),r,", ",i]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(qe,{className:"h-3.5 w-3.5"}),s_(c)," attendees"]})]}),h.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:h.slice(0,3).map(x=>e.jsx(O,{variant:"outline",className:"text-xs",children:x},x))}),y&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:["View Event",e.jsx(Rt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),u9=[{id:"event-1",title:"European iGaming Leadership Summit",organizer:"iGaming Career",category:"Conference",format:"In-person",country:"Malta",city:"Valletta",date:"2026-05-12",attendeeCount:1200,tags:["leadership","strategy"],isFeatured:!0,link:"https://example.com/events/leadership-summit"},{id:"event-2",title:"AML Compliance Masterclass",organizer:"Compliance Academy",category:"Workshop",format:"Online",country:"Remote",city:"Remote",date:"2026-04-04",attendeeCount:380,tags:["compliance","aml"],isFree:!0,link:"https://example.com/events/aml-masterclass"},{id:"event-3",title:"Sportsbook Product Roundtable",organizer:"Bet Product Guild",category:"Roundtable",format:"Hybrid",country:"United Kingdom",city:"London",date:"2026-06-19",attendeeCount:540,tags:["sportsbook","product"],link:"https://example.com/events/sportsbook-roundtable"},{id:"event-4",title:"Affiliate Growth Forum",organizer:"Affiliate Network EU",category:"Forum",format:"In-person",country:"Spain",city:"Barcelona",date:"2026-03-21",attendeeCount:750,tags:["affiliate","marketing"],link:"https://example.com/events/affiliate-growth-forum"},{id:"event-5",title:"Responsible Gaming Webinar",organizer:"RG Alliance",category:"Webinar",format:"Online",country:"Remote",city:"Remote",date:"2026-02-28",attendeeCount:910,tags:["responsible-gaming","policy"],isFree:!0,link:"https://example.com/events/rg-webinar"},{id:"event-6",title:"Payments and Fraud Prevention Expo",organizer:"Fintech iGaming Expo",category:"Expo",format:"In-person",country:"Cyprus",city:"Limassol",date:"2026-07-10",attendeeCount:660,tags:["payments","fraud"],isFeatured:!0,link:"https://example.com/events/payments-fraud-expo"}],vt=ie.forwardRef(({className:t,...a},s)=>e.jsx(wN.Root,{className:oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...a,ref:s,children:e.jsx(wN.Thumb,{className:oe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));vt.displayName=wN.Root.displayName;const Ye=bt.Root,Je=bt.Value,Ue=ie.forwardRef(({className:t,children:a,...s},n)=>e.jsxs(bt.Trigger,{ref:n,className:oe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...s,children:[a,e.jsx(bt.Icon,{asChild:!0,children:e.jsx(Hc.ChevronDownIcon,{className:"h-4 w-4 opacity-50"})})]}));Ue.displayName=bt.Trigger.displayName;const jI=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.ScrollUpButton,{ref:s,className:oe("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(Hc.ChevronUpIcon,{className:"h-4 w-4"})}));jI.displayName=bt.ScrollUpButton.displayName;const MI=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.ScrollDownButton,{ref:s,className:oe("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(Hc.ChevronDownIcon,{className:"h-4 w-4"})}));MI.displayName=bt.ScrollDownButton.displayName;const Ge=ie.forwardRef(({className:t,children:a,position:s="popper",...n},r)=>e.jsx(bt.Portal,{children:e.jsxs(bt.Content,{ref:r,className:oe("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...n,children:[e.jsx(jI,{}),e.jsx(bt.Viewport,{className:oe("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(MI,{})]})}));Ge.displayName=bt.Content.displayName;const r_=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.Label,{ref:s,className:oe("px-2 py-1.5 text-sm font-semibold",t),...a}));r_.displayName=bt.Label.displayName;const me=ie.forwardRef(({className:t,children:a,...s},n)=>e.jsxs(bt.Item,{ref:n,className:oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(bt.ItemIndicator,{children:e.jsx(Hc.CheckIcon,{className:"h-4 w-4"})})}),e.jsx(bt.ItemText,{children:a})]}));me.displayName=bt.Item.displayName;const i_=ie.forwardRef(({className:t,...a},s)=>e.jsx(bt.Separator,{ref:s,className:oe("-mx-1 my-1 h-px bg-muted",t),...a}));i_.displayName=bt.Separator.displayName;const o_=["C-level","B2B","Regulators","Affiliates","Tech","Operators","Providers","General"],l_=["In-person","Online","Hybrid"],c_=["Conference","Summit","Expo","Webinar","Meetup","Awards","Hackathon"],d_=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(""),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState(""),[m,g]=p.useState(""),[f,k]=p.useState(""),[v,N]=p.useState(""),[M,b]=p.useState(""),[C,S]=p.useState(""),[L,w]=p.useState([]),[j,I]=p.useState(!1),[T,A]=p.useState(!1),R=n.trim().length>=3&&i.trim().length>=2&&c&&d&&y.trim().length>=2&&m.trim().length>=2&&f&&M.trim().length>=20,D=F=>{w(G=>G.includes(F)?G.filter(Z=>Z!==F):[...G,F])},q=()=>{!R||!d||(s==null||s({title:n.trim(),organizer:i.trim(),category:c,format:d,country:y.trim(),city:m.trim(),date:f,endDate:v||void 0,description:M.trim(),link:C.trim()||void 0,audience:L,isFree:j}),A(!0))},E=()=>{r(""),l(""),h(""),u(""),x(""),g(""),k(""),N(""),b(""),S(""),w([]),I(!1),A(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:E,children:e.jsx(Xe,{className:"sm:max-w-[560px]",children:T?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Event Submitted!"}),e.jsx(it,{className:"text-center",children:"Thank you for submitting your event. It will appear on the calendar after review (usually within 24-48 hours)."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:E,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(Pa,{className:"w-6 h-6 text-accent"})}),e.jsx(Le,{children:"Submit an Event"}),e.jsx(it,{children:"Add your iGaming event to our calendar. All submissions are reviewed before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Event Name *"}),e.jsx(ae,{placeholder:"e.g. ICE London 2026",value:n,onChange:F=>r(F.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Organizer *"}),e.jsx(ae,{placeholder:"e.g. Clarion Gaming",value:i,onChange:F=>l(F.target.value),maxLength:100})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Event Type *"}),e.jsxs(Ye,{value:c,onValueChange:h,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select type"})}),e.jsx(Ge,{children:c_.map(F=>e.jsx(me,{value:F,children:F},F))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Format *"}),e.jsxs(Ye,{value:d,onValueChange:F=>u(F),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select format"})}),e.jsx(Ge,{children:l_.map(F=>e.jsx(me,{value:F,children:F},F))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Country *"}),e.jsx(ae,{placeholder:"e.g. United Kingdom",value:y,onChange:F=>x(F.target.value),maxLength:60})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"City *"}),e.jsx(ae,{placeholder:"e.g. London",value:m,onChange:F=>g(F.target.value),maxLength:60})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Start Date *"}),e.jsx(ae,{type:"date",value:f,onChange:F=>k(F.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["End Date ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ae,{type:"date",value:v,onChange:F=>N(F.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Description *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(rt,{placeholder:"Describe the event, topics covered, who should attend...",value:M,onChange:F=>b(F.target.value),rows:3,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Event Website ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ae,{type:"url",placeholder:"https://...",value:C,onChange:F=>S(F.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Target Audience ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(select all that apply)"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:o_.map(F=>e.jsx("button",{type:"button",onClick:()=>D(F),className:`px-3 py-1.5 rounded-full text-xs font-medium border transition-colors ${L.includes(F)?"bg-accent text-accent-foreground border-accent":"bg-secondary text-muted-foreground border-border hover:border-accent/50"}`,children:F},F))})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Free event"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This event is free to attend"})]}),e.jsx(vt,{checked:j,onCheckedChange:I})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:E,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:q,disabled:!R,children:"Submit Event"})]})]})})})};function Ke(t){const a=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&a==="[object Date]"?new t.constructor(+t):typeof t=="number"||a==="[object Number]"||typeof t=="string"||a==="[object String]"?new Date(t):new Date(NaN)}function wn(t,a){return t instanceof Date?new t.constructor(a):new Date(a)}const NI=6048e5,h_=864e5,Qc=43200,m9=1440;let u_={};function Uc(){return u_}function Oc(t,a){var c,h,d,u;const s=Uc(),n=(a==null?void 0:a.weekStartsOn)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??s.weekStartsOn??((u=(d=s.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,r=Ke(t),i=r.getDay(),l=(i<n?7:0)+i-n;return r.setDate(r.getDate()-l),r.setHours(0,0,0,0),r}function T7(t){return Oc(t,{weekStartsOn:1})}function CI(t){const a=Ke(t),s=a.getFullYear(),n=wn(t,0);n.setFullYear(s+1,0,4),n.setHours(0,0,0,0);const r=T7(n),i=wn(t,0);i.setFullYear(s,0,4),i.setHours(0,0,0,0);const l=T7(i);return a.getTime()>=r.getTime()?s+1:a.getTime()>=l.getTime()?s:s-1}function p9(t){const a=Ke(t);return a.setHours(0,0,0,0),a}function R7(t){const a=Ke(t),s=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return s.setUTCFullYear(a.getFullYear()),+t-+s}function m_(t,a){const s=p9(t),n=p9(a),r=+s-R7(s),i=+n-R7(n);return Math.round((r-i)/h_)}function p_(t){const a=CI(t),s=wn(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),T7(s)}function b7(t,a){const s=Ke(t),n=Ke(a),r=s.getTime()-n.getTime();return r<0?-1:r>0?1:r}function y_(t){return wn(t,Date.now())}function x_(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function g_(t){if(!x_(t)&&typeof t!="number")return!1;const a=Ke(t);return!isNaN(Number(a))}function f_(t,a){const s=Ke(t),n=Ke(a),r=s.getFullYear()-n.getFullYear(),i=s.getMonth()-n.getMonth();return r*12+i}function k_(t){return a=>{const n=(t?Math[t]:Math.trunc)(a);return n===0?0:n}}function v_(t,a){return+Ke(t)-+Ke(a)}function b_(t){const a=Ke(t);return a.setHours(23,59,59,999),a}function w_(t){const a=Ke(t),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(23,59,59,999),a}function j_(t){const a=Ke(t);return+b_(a)==+w_(a)}function M_(t,a){const s=Ke(t),n=Ke(a),r=b7(s,n),i=Math.abs(f_(s,n));let l;if(i<1)l=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*i);let c=b7(s,n)===-r;j_(Ke(t))&&i===1&&b7(t,n)===1&&(c=!1),l=r*(i-Number(c))}return l===0?0:l}function N_(t,a,s){const n=v_(t,a)/1e3;return k_(s==null?void 0:s.roundingMethod)(n)}function C_(t){const a=Ke(t),s=wn(t,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}const S_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},L_=(t,a,s)=>{let n;const r=S_[t];return typeof r=="string"?n=r:a===1?n=r.one:n=r.other.replace("{{count}}",a.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+n:n+" ago":n};function hN(t){return(a={})=>{const s=a.width?String(a.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const I_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},A_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},P_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},T_={date:hN({formats:I_,defaultWidth:"full"}),time:hN({formats:A_,defaultWidth:"full"}),dateTime:hN({formats:P_,defaultWidth:"full"})},R_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},D_=(t,a,s,n)=>R_[t];function Jl(t){return(a,s)=>{const n=s!=null&&s.context?String(s.context):"standalone";let r;if(n==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,c=s!=null&&s.width?String(s.width):l;r=t.formattingValues[c]||t.formattingValues[l]}else{const l=t.defaultWidth,c=s!=null&&s.width?String(s.width):t.defaultWidth;r=t.values[c]||t.values[l]}const i=t.argumentCallback?t.argumentCallback(a):a;return r[i]}}const __={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},z_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},q_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},F_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},E_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},O_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},B_=(t,a)=>{const s=Number(t),n=s%100;if(n>20||n<10)switch(n%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},H_={ordinalNumber:B_,era:Jl({values:__,defaultWidth:"wide"}),quarter:Jl({values:z_,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Jl({values:q_,defaultWidth:"wide"}),day:Jl({values:F_,defaultWidth:"wide"}),dayPeriod:Jl({values:E_,defaultWidth:"wide",formattingValues:O_,defaultFormattingWidth:"wide"})};function Kl(t){return(a,s={})=>{const n=s.width,r=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=a.match(r);if(!i)return null;const l=i[0],c=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],h=Array.isArray(c)?U_(c,y=>y.test(l)):V_(c,y=>y.test(l));let d;d=t.valueCallback?t.valueCallback(h):h,d=s.valueCallback?s.valueCallback(d):d;const u=a.slice(l.length);return{value:d,rest:u}}}function V_(t,a){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a(t[s]))return s}function U_(t,a){for(let s=0;s<t.length;s++)if(a(t[s]))return s}function G_(t){return(a,s={})=>{const n=a.match(t.matchPattern);if(!n)return null;const r=n[0],i=a.match(t.parsePattern);if(!i)return null;let l=t.valueCallback?t.valueCallback(i[0]):i[0];l=s.valueCallback?s.valueCallback(l):l;const c=a.slice(r.length);return{value:l,rest:c}}}const $_=/^(\d+)(th|st|nd|rd)?/i,W_=/\d+/i,Z_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Y_={any:[/^b/i,/^(a|c)/i]},J_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},K_={any:[/1/i,/2/i,/3/i,/4/i]},X_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Q_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ez={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},tz={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},az={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sz={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},nz={ordinalNumber:G_({matchPattern:$_,parsePattern:W_,valueCallback:t=>parseInt(t,10)}),era:Kl({matchPatterns:Z_,defaultMatchWidth:"wide",parsePatterns:Y_,defaultParseWidth:"any"}),quarter:Kl({matchPatterns:J_,defaultMatchWidth:"wide",parsePatterns:K_,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Kl({matchPatterns:X_,defaultMatchWidth:"wide",parsePatterns:Q_,defaultParseWidth:"any"}),day:Kl({matchPatterns:ez,defaultMatchWidth:"wide",parsePatterns:tz,defaultParseWidth:"any"}),dayPeriod:Kl({matchPatterns:az,defaultMatchWidth:"any",parsePatterns:sz,defaultParseWidth:"any"})},SI={code:"en-US",formatDistance:L_,formatLong:T_,formatRelative:D_,localize:H_,match:nz,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rz(t){const a=Ke(t);return m_(a,C_(a))+1}function iz(t){const a=Ke(t),s=+T7(a)-+p_(a);return Math.round(s/NI)+1}function LI(t,a){var u,y,x,m;const s=Ke(t),n=s.getFullYear(),r=Uc(),i=(a==null?void 0:a.firstWeekContainsDate)??((y=(u=a==null?void 0:a.locale)==null?void 0:u.options)==null?void 0:y.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(x=r.locale)==null?void 0:x.options)==null?void 0:m.firstWeekContainsDate)??1,l=wn(t,0);l.setFullYear(n+1,0,i),l.setHours(0,0,0,0);const c=Oc(l,a),h=wn(t,0);h.setFullYear(n,0,i),h.setHours(0,0,0,0);const d=Oc(h,a);return s.getTime()>=c.getTime()?n+1:s.getTime()>=d.getTime()?n:n-1}function oz(t,a){var c,h,d,u;const s=Uc(),n=(a==null?void 0:a.firstWeekContainsDate)??((h=(c=a==null?void 0:a.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((u=(d=s.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,r=LI(t,a),i=wn(t,0);return i.setFullYear(r,0,n),i.setHours(0,0,0,0),Oc(i,a)}function lz(t,a){const s=Ke(t),n=+Oc(s,a)-+oz(s,a);return Math.round(n/NI)+1}function He(t,a){const s=t<0?"-":"",n=Math.abs(t).toString().padStart(a,"0");return s+n}const Js={y(t,a){const s=t.getFullYear(),n=s>0?s:1-s;return He(a==="yy"?n%100:n,a.length)},M(t,a){const s=t.getMonth();return a==="M"?String(s+1):He(s+1,2)},d(t,a){return He(t.getDate(),a.length)},a(t,a){const s=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(t,a){return He(t.getHours()%12||12,a.length)},H(t,a){return He(t.getHours(),a.length)},m(t,a){return He(t.getMinutes(),a.length)},s(t,a){return He(t.getSeconds(),a.length)},S(t,a){const s=a.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,s-3));return He(r,a.length)}},hl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},y9={G:function(t,a,s){const n=t.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});case"GGGG":default:return s.era(n,{width:"wide"})}},y:function(t,a,s){if(a==="yo"){const n=t.getFullYear(),r=n>0?n:1-n;return s.ordinalNumber(r,{unit:"year"})}return Js.y(t,a)},Y:function(t,a,s,n){const r=LI(t,n),i=r>0?r:1-r;if(a==="YY"){const l=i%100;return He(l,2)}return a==="Yo"?s.ordinalNumber(i,{unit:"year"}):He(i,a.length)},R:function(t,a){const s=CI(t);return He(s,a.length)},u:function(t,a){const s=t.getFullYear();return He(s,a.length)},Q:function(t,a,s){const n=Math.ceil((t.getMonth()+1)/3);switch(a){case"Q":return String(n);case"QQ":return He(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,a,s){const n=Math.ceil((t.getMonth()+1)/3);switch(a){case"q":return String(n);case"qq":return He(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,a,s){const n=t.getMonth();switch(a){case"M":case"MM":return Js.M(t,a);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(t,a,s){const n=t.getMonth();switch(a){case"L":return String(n+1);case"LL":return He(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(t,a,s,n){const r=lz(t,n);return a==="wo"?s.ordinalNumber(r,{unit:"week"}):He(r,a.length)},I:function(t,a,s){const n=iz(t);return a==="Io"?s.ordinalNumber(n,{unit:"week"}):He(n,a.length)},d:function(t,a,s){return a==="do"?s.ordinalNumber(t.getDate(),{unit:"date"}):Js.d(t,a)},D:function(t,a,s){const n=rz(t);return a==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):He(n,a.length)},E:function(t,a,s){const n=t.getDay();switch(a){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});case"EEEE":default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(t,a,s,n){const r=t.getDay(),i=(r-n.weekStartsOn+8)%7||7;switch(a){case"e":return String(i);case"ee":return He(i,2);case"eo":return s.ordinalNumber(i,{unit:"day"});case"eee":return s.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})}},c:function(t,a,s,n){const r=t.getDay(),i=(r-n.weekStartsOn+8)%7||7;switch(a){case"c":return String(i);case"cc":return He(i,a.length);case"co":return s.ordinalNumber(i,{unit:"day"});case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})}},i:function(t,a,s){const n=t.getDay(),r=n===0?7:n;switch(a){case"i":return String(r);case"ii":return He(r,a.length);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});case"iiii":default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(t,a,s){const r=t.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,a,s){const n=t.getHours();let r;switch(n===12?r=hl.noon:n===0?r=hl.midnight:r=n/12>=1?"pm":"am",a){case"b":case"bb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,a,s){const n=t.getHours();let r;switch(n>=17?r=hl.evening:n>=12?r=hl.afternoon:n>=4?r=hl.morning:r=hl.night,a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,a,s){if(a==="ho"){let n=t.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Js.h(t,a)},H:function(t,a,s){return a==="Ho"?s.ordinalNumber(t.getHours(),{unit:"hour"}):Js.H(t,a)},K:function(t,a,s){const n=t.getHours()%12;return a==="Ko"?s.ordinalNumber(n,{unit:"hour"}):He(n,a.length)},k:function(t,a,s){let n=t.getHours();return n===0&&(n=24),a==="ko"?s.ordinalNumber(n,{unit:"hour"}):He(n,a.length)},m:function(t,a,s){return a==="mo"?s.ordinalNumber(t.getMinutes(),{unit:"minute"}):Js.m(t,a)},s:function(t,a,s){return a==="so"?s.ordinalNumber(t.getSeconds(),{unit:"second"}):Js.s(t,a)},S:function(t,a){return Js.S(t,a)},X:function(t,a,s){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(a){case"X":return g9(n);case"XXXX":case"XX":return $o(n);case"XXXXX":case"XXX":default:return $o(n,":")}},x:function(t,a,s){const n=t.getTimezoneOffset();switch(a){case"x":return g9(n);case"xxxx":case"xx":return $o(n);case"xxxxx":case"xxx":default:return $o(n,":")}},O:function(t,a,s){const n=t.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+x9(n,":");case"OOOO":default:return"GMT"+$o(n,":")}},z:function(t,a,s){const n=t.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+x9(n,":");case"zzzz":default:return"GMT"+$o(n,":")}},t:function(t,a,s){const n=Math.trunc(t.getTime()/1e3);return He(n,a.length)},T:function(t,a,s){const n=t.getTime();return He(n,a.length)}};function x9(t,a=""){const s=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),i=n%60;return i===0?s+String(r):s+String(r)+a+He(i,2)}function g9(t,a){return t%60===0?(t>0?"-":"+")+He(Math.abs(t)/60,2):$o(t,a)}function $o(t,a=""){const s=t>0?"-":"+",n=Math.abs(t),r=He(Math.trunc(n/60),2),i=He(n%60,2);return s+r+a+i}const f9=(t,a)=>{switch(t){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},II=(t,a)=>{switch(t){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},cz=(t,a)=>{const s=t.match(/(P+)(p+)?/)||[],n=s[1],r=s[2];if(!r)return f9(t,a);let i;switch(n){case"P":i=a.dateTime({width:"short"});break;case"PP":i=a.dateTime({width:"medium"});break;case"PPP":i=a.dateTime({width:"long"});break;case"PPPP":default:i=a.dateTime({width:"full"});break}return i.replace("{{date}}",f9(n,a)).replace("{{time}}",II(r,a))},dz={p:II,P:cz},hz=/^D+$/,uz=/^Y+$/,mz=["D","DD","YY","YYYY"];function pz(t){return hz.test(t)}function yz(t){return uz.test(t)}function xz(t,a,s){const n=gz(t,a,s);if(console.warn(n),mz.includes(t))throw new RangeError(n)}function gz(t,a,s){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${a}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fz=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kz=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vz=/^'([^]*?)'?$/,bz=/''/g,wz=/[a-zA-Z]/;function jz(t,a,s){var u,y,x,m;const n=Uc(),r=n.locale??SI,i=n.firstWeekContainsDate??((y=(u=n.locale)==null?void 0:u.options)==null?void 0:y.firstWeekContainsDate)??1,l=n.weekStartsOn??((m=(x=n.locale)==null?void 0:x.options)==null?void 0:m.weekStartsOn)??0,c=Ke(t);if(!g_(c))throw new RangeError("Invalid time value");let h=a.match(kz).map(g=>{const f=g[0];if(f==="p"||f==="P"){const k=dz[f];return k(g,r.formatLong)}return g}).join("").match(fz).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const f=g[0];if(f==="'")return{isToken:!1,value:Mz(g)};if(y9[f])return{isToken:!0,value:g};if(f.match(wz))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:g}});r.localize.preprocessor&&(h=r.localize.preprocessor(c,h));const d={firstWeekContainsDate:i,weekStartsOn:l,locale:r};return h.map(g=>{if(!g.isToken)return g.value;const f=g.value;(yz(f)||pz(f))&&xz(f,a,String(t));const k=y9[f[0]];return k(c,f,r.localize,d)}).join("")}function Mz(t){const a=t.match(vz);return a?a[1].replace(bz,"'"):t}function Nz(t,a,s){const n=Uc(),r=(s==null?void 0:s.locale)??n.locale??SI,i=2520,l=b7(t,a);if(isNaN(l))throw new RangeError("Invalid time value");const c=Object.assign({},s,{addSuffix:s==null?void 0:s.addSuffix,comparison:l});let h,d;l>0?(h=Ke(a),d=Ke(t)):(h=Ke(t),d=Ke(a));const u=N_(d,h),y=(R7(d)-R7(h))/1e3,x=Math.round((u-y)/60);let m;if(x<2)return s!=null&&s.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,c):u<10?r.formatDistance("lessThanXSeconds",10,c):u<20?r.formatDistance("lessThanXSeconds",20,c):u<40?r.formatDistance("halfAMinute",0,c):u<60?r.formatDistance("lessThanXMinutes",1,c):r.formatDistance("xMinutes",1,c):x===0?r.formatDistance("lessThanXMinutes",1,c):r.formatDistance("xMinutes",x,c);if(x<45)return r.formatDistance("xMinutes",x,c);if(x<90)return r.formatDistance("aboutXHours",1,c);if(x<m9){const g=Math.round(x/60);return r.formatDistance("aboutXHours",g,c)}else{if(x<i)return r.formatDistance("xDays",1,c);if(x<Qc){const g=Math.round(x/m9);return r.formatDistance("xDays",g,c)}else if(x<Qc*2)return m=Math.round(x/Qc),r.formatDistance("aboutXMonths",m,c)}if(m=M_(d,h),m<12){const g=Math.round(x/Qc);return r.formatDistance("xMonths",g,c)}else{const g=m%12,f=Math.trunc(m/12);return g<3?r.formatDistance("aboutXYears",f,c):g<9?r.formatDistance("overXYears",f,c):r.formatDistance("almostXYears",f+1,c)}}function CC(t,a){return Nz(t,y_(t),a)}const Cz=t=>{const a=new Date(t);return{day:a.getDate(),month:a.toLocaleDateString("en-US",{month:"short"}).toUpperCase()}},Sz=(t,a)=>{const s=new Date(t),n={month:"short",day:"numeric"};if(!a)return s.toLocaleDateString("en-US",{...n,year:"numeric"});const r=new Date(a);return s.getMonth()===r.getMonth()?`${s.toLocaleDateString("en-US",n)} - ${r.getDate()}, ${r.getFullYear()}`:`${s.toLocaleDateString("en-US",n)} - ${r.toLocaleDateString("en-US",{...n,year:"numeric"})}`},Lz=t=>t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:t.toString(),Iz=({event:t})=>{const{day:a,month:s}=Cz(t.date),n=t.isFeatured;return e.jsxs("div",{className:`group relative flex gap-4 rounded-lg border bg-card p-4 transition-all duration-200 hover:shadow-card ${n?"border-accent/30 bg-accent/[0.02]":"border-border"}`,children:[e.jsxs("div",{className:`flex h-16 w-16 flex-shrink-0 flex-col items-center justify-center rounded-lg ${n?"bg-accent text-accent-foreground":"bg-primary text-primary-foreground"}`,children:[e.jsx("span",{className:"text-[10px] font-bold uppercase leading-none tracking-wider",children:s}),e.jsx("span",{className:"text-2xl font-bold leading-tight",children:a})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-1.5",children:[n&&e.jsx(O,{className:"bg-accent/10 text-accent text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Recommended"}),t.isFree&&e.jsx(O,{className:"bg-gaming-success/10 text-gaming-success text-[10px] px-1.5 py-0 font-semibold uppercase",children:"Free"}),e.jsx(O,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:t.category}),e.jsx(O,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:t.format})]}),e.jsx("h3",{className:"mb-1 text-base font-semibold leading-snug text-foreground group-hover:text-accent transition-colors",children:t.title}),t.description&&e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground leading-relaxed",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pa,{className:"h-3.5 w-3.5"}),Sz(t.date,t.endDate)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[t.format==="Online"?e.jsx(Dt,{className:"h-3.5 w-3.5"}):e.jsx(Fe,{className:"h-3.5 w-3.5"}),t.format==="Online"?"Online":`${t.city}, ${t.country}`]}),t.attendeeCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(qe,{className:"h-3.5 w-3.5"}),Lz(t.attendeeCount)," attendees"]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["by ",t.organizer]})]}),t.audience&&t.audience.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:t.audience.map(r=>e.jsx("span",{className:"rounded bg-secondary px-1.5 py-0.5 text-[10px] font-medium text-secondary-foreground",children:r},r))})]}),e.jsx("div",{className:"flex flex-shrink-0 flex-col items-end justify-between",children:t.link&&e.jsx(P,{variant:"outline",size:"sm",className:"text-xs",asChild:!0,children:e.jsxs("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",children:["Event Info",e.jsx(Rt,{className:"ml-1.5 h-3 w-3"})]})})})]})},Az=[{value:"upcoming",label:"Upcoming"},{value:"newest",label:"Newest added"},{value:"popular",label:"Most attendees"},{value:"name",label:"Name (A-Z)"}],Pz=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],Tz=[{value:"C-level",label:"C-level"},{value:"B2B",label:"B2B"},{value:"Regulators",label:"Regulators"},{value:"Affiliates",label:"Affiliates"},{value:"Tech",label:"Tech"},{value:"Operators",label:"Operators"},{value:"Providers",label:"Providers"},{value:"General",label:"General"}],Rz=({apiUrl:t,eventsData:a,itemsPerPage:s=20,enableMobileFilter:n=!0,onSubmitEvent:r})=>{const[i,l]=p.useState(!1),[c,h]=p.useState(a??[]),[d,u]=p.useState(!a),[y,x]=p.useState(1),[m,g]=p.useState(s),[f,k]=p.useState(""),[v,N]=p.useState("upcoming"),[M,b]=p.useState("list"),[C,S]=p.useState({category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]});p.useEffect(()=>{if(a)return;let q=!0;const E=async()=>{try{if(!t){q&&h(u9);return}const F=await fetch(t);if(!F.ok)throw new Error(`Failed loading events: ${F.status}`);const G=await F.json();q&&Array.isArray(G)&&h(G)}catch(F){console.error("Failed to fetch events list",F),q&&h(u9)}finally{q&&u(!1)}};return u(!0),E(),()=>{q=!1}},[t,a]);const L=p.useMemo(()=>{const q=Array.from(new Set(c.map(Z=>Z.category))).sort(),E=Array.from(new Set(c.map(Z=>Z.format))).sort(),F=Array.from(new Set(c.map(Z=>Z.country).filter(Z=>Z!=="Remote"))).sort(),G=Array.from(new Set(c.map(Z=>Z.organizer))).sort();return[{key:"month",label:"Month",type:"checkbox",options:Pz},{key:"audience",label:"Audience",type:"checkbox",options:Tz},{key:"category",label:"Event Type",type:"checkbox",options:q.map(Z=>({value:Z,label:Z}))},{key:"format",label:"Format",type:"checkbox",options:E.map(Z=>({value:Z,label:Z}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:F.map(Z=>({value:Z,label:Z}))},{key:"organizer",label:"Organizer",type:"searchable-select",searchable:!0,options:G.map(Z=>({value:Z,label:Z}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"free",label:"Free events only"}]}]},[c]),w=p.useMemo(()=>Object.entries(C).flatMap(([q,E])=>E.map(F=>({key:q,label:q.charAt(0).toUpperCase()+q.slice(1),value:F,onRemove:()=>S(G=>({...G,[q]:(G[q]??[]).filter(Z=>Z!==F)}))}))),[C]),j=p.useMemo(()=>{const q=f.trim().toLowerCase();return c.filter(E=>{if(q&&!`${E.title} ${E.organizer} ${E.city} ${E.country} ${E.description??""}`.toLowerCase().includes(q)||C.category.length&&!C.category.includes(E.category)||C.format.length&&!C.format.includes(E.format)||C.country.length&&!C.country.includes(E.country)||C.organizer.length&&!C.organizer.includes(E.organizer))return!1;if(C.month.length){const F=new Date(E.date).toISOString().slice(5,7);if(!C.month.includes(F))return!1}return!(C.audience.length&&(!E.audience||!C.audience.some(F=>E.audience.includes(F)))||C.signals.includes("featured")&&!E.isFeatured||C.signals.includes("free")&&!E.isFree)})},[c,C,f]),I=p.useMemo(()=>{const q=[...j];return q.sort((E,F)=>{switch(v){case"newest":return new Date(F.date).getTime()-new Date(E.date).getTime();case"popular":return F.attendeeCount-E.attendeeCount;case"name":return E.title.localeCompare(F.title);case"upcoming":default:return new Date(E.date).getTime()-new Date(F.date).getTime()}}),q},[j,v]);p.useEffect(()=>{x(1)},[f,C,m]);const T=Math.max(1,Math.ceil(I.length/m)),A=I.slice((y-1)*m,y*m),R=p.useMemo(()=>{if(M!=="list")return null;const q={};for(const E of A){const F=jz(new Date(E.date),"MMMM yyyy");q[F]||(q[F]=[]),q[F].push(E)}return q},[A,M]),D={category:[],format:[],country:[],month:[],audience:[],organizer:[],signals:[]};return e.jsxs(e.Fragment,{children:[e.jsx(Za,{title:"iGaming Events & Conferences Calendar",description:"Discover the most important iGaming conferences, expos, webinars, and networking events worldwide. Filter by region, audience, and event type.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>l(!0),children:[e.jsx(Pa,{className:"w-4 h-4"}),"Submit Event"]}),search:{value:f,onChange:k,onSubmit:k,onClear:()=>k(""),placeholder:"Search events by name, organizer, or location..."},filters:L,filterValues:C,onFilterChange:(q,E)=>S(F=>({...F,[q]:E})),onClearFilters:()=>S(D),activeFilters:w,sort:{value:v,options:Az,onChange:N},viewMode:M,onViewModeChange:b,pagination:{page:y,pageSize:m,totalPages:T,totalCount:I.length,toolbarTotalCount:c.length,toolbarTitle:"Events Calendar",toolbarItemLabel:"events",onPageChange:x,onPageSizeChange:q=>{g(q),x(1)},pageSizeOptions:[10,20,50]},resultsClassName:M==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"",children:d?e.jsx(Wa,{totalColumns:6}):A.length?M==="list"&&R?e.jsx("div",{className:"space-y-8",children:Object.entries(R).map(([q,E])=>e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex items-center rounded-md bg-accent px-3 py-1.5 text-sm font-bold text-accent-foreground uppercase tracking-wide",children:q}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.jsx("div",{className:"space-y-3",children:E.map(F=>e.jsx(Iz,{event:F},F.id))})]},q))}):A.map(q=>e.jsx(n_,{id:q.id,title:q.title,organizer:q.organizer,category:q.category,format:q.format,city:q.city,country:q.country,date:q.date,attendeeCount:q.attendeeCount,tags:q.tags,isFeatured:q.isFeatured,isFree:q.isFree,link:q.link,viewMode:M},q.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Pa,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No events found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsx(P,{variant:"outline",onClick:()=>S(D),children:"Clear all filters"})]})}),e.jsx(d_,{open:i,onOpenChange:l,onSubmit:q=>{r==null||r(q),console.log("[EventsList] Submit event:",q)}})]})},Dz=t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString(),_z=({name:t,type:a,city:s,country:n,shortDescription:r,services:i,tags:l=[],rating:c,reviewCount:h,website:d,isFeatured:u=!1})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:a}),u&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Featured"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:t}),e.jsx("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground",children:r}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"h-3.5 w-3.5"}),s,", ",n]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(tt,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),c.toFixed(1)," (",Dz(h),")"]})]}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:i.slice(0,3).map(y=>e.jsx(O,{variant:"outline",className:"text-xs",children:y},y))}),l.length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-1.5",children:l.slice(0,2).map(y=>e.jsx(O,{variant:"outline",className:"text-xs",children:y},y))}),d&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:["Visit Place",e.jsx(Rt,{className:"ml-2 h-3.5 w-3.5"})]})})]}),k9=[{id:"place-1",name:"Valletta Gaming Campus",type:"Innovation Hub",city:"Valletta",country:"Malta",shortDescription:"Innovation campus focused on sportsbook and casino startups.",services:["Events","Mentorship","Recruitment"],tags:["startup","community"],rating:4.8,reviewCount:132,isFeatured:!0,website:"https://example.com/places/valletta-campus"},{id:"place-2",name:"Barcelona Betting Labs",type:"Coworking",city:"Barcelona",country:"Spain",shortDescription:"Flexible workspaces for game, risk, and analytics teams.",services:["Coworking","Meeting Rooms","Events"],tags:["analytics","product"],rating:4.5,reviewCount:89,website:"https://example.com/places/barcelona-labs"},{id:"place-3",name:"Tallinn Compliance Center",type:"Office",city:"Tallinn",country:"Estonia",shortDescription:"Specialized compliance hub for regulated operators.",services:["Compliance Advisory","Training"],tags:["compliance","regulation"],rating:4.6,reviewCount:64,website:"https://example.com/places/tallinn-compliance-center"},{id:"place-4",name:"London iGaming Forum Hall",type:"Conference Venue",city:"London",country:"United Kingdom",shortDescription:"Large conference venue for iGaming networking and expos.",services:["Conferences","Streaming","Booths"],tags:["conference","networking"],rating:4.4,reviewCount:210,website:"https://example.com/places/london-forum-hall"},{id:"place-5",name:"Sofia Product Studio",type:"Office",city:"Sofia",country:"Bulgaria",shortDescription:"Product-focused office optimized for agile delivery teams.",services:["Product Sprints","Hiring Support"],tags:["product","engineering"],rating:4.3,reviewCount:48,website:"https://example.com/places/sofia-product-studio"},{id:"place-6",name:"Riga Talent House",type:"Coworking",city:"Riga",country:"Latvia",shortDescription:"Coworking location with hiring events and mentorship sessions.",services:["Coworking","Recruitment","Mentorship"],tags:["talent","recruitment"],rating:4.7,reviewCount:73,isFeatured:!0,website:"https://example.com/places/riga-talent-house"}],zz=[{value:"relevance",label:"Most relevant"},{value:"rating",label:"Highest rated"},{value:"reviews",label:"Most reviews"},{value:"name",label:"Name (A-Z)"}],qz=({apiUrl:t,itemsPerPage:a=9,enableMobileFilter:s=!0})=>{const[n,r]=p.useState([]),[i,l]=p.useState(!0),[c,h]=p.useState(1),[d,u]=p.useState(a),[y,x]=p.useState(""),[m,g]=p.useState("relevance"),[f,k]=p.useState("grid"),[v,N]=p.useState({type:[],country:[],city:[],services:[],tags:[],signals:[]});p.useEffect(()=>{let j=!0;const I=async()=>{try{if(!t){j&&r(k9);return}const T=await fetch(t);if(!T.ok)throw new Error(`Failed loading places: ${T.status}`);const A=await T.json();j&&Array.isArray(A)&&r(A)}catch(T){console.error("Failed to fetch places list",T),j&&r(k9)}finally{j&&l(!1)}};return l(!0),I(),()=>{j=!1}},[t]);const M=p.useMemo(()=>{const j=Array.from(new Set(n.map(D=>D.type))).sort(),I=Array.from(new Set(n.map(D=>D.country))).sort(),T=Array.from(new Set(n.map(D=>D.city))).sort(),A=Array.from(new Set(n.flatMap(D=>D.services))).sort(),R=Array.from(new Set(n.flatMap(D=>D.tags))).sort();return[{key:"type",label:"Type",type:"checkbox",options:j.map(D=>({value:D,label:D}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:I.map(D=>({value:D,label:D}))},{key:"city",label:"City",type:"searchable-select",searchable:!0,options:T.map(D=>({value:D,label:D}))},{key:"services",label:"Services",type:"checkbox",searchable:!0,options:A.map(D=>({value:D,label:D}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:R.map(D=>({value:D,label:D}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"}]}]},[n]),b=p.useMemo(()=>Object.entries(v).flatMap(([j,I])=>I.map(T=>({key:j,label:j.charAt(0).toUpperCase()+j.slice(1),value:T,onRemove:()=>{N(A=>({...A,[j]:(A[j]??[]).filter(R=>R!==T)}))}}))),[v]),C=p.useMemo(()=>{const j=y.trim().toLowerCase();return n.filter(I=>!(j&&!`${I.name} ${I.shortDescription} ${I.city} ${I.country}`.toLowerCase().includes(j)||v.type.length&&!v.type.includes(I.type)||v.country.length&&!v.country.includes(I.country)||v.city.length&&!v.city.includes(I.city)||v.services.length&&!v.services.every(T=>I.services.includes(T))||v.tags.length&&!v.tags.every(T=>I.tags.includes(T))||v.signals.includes("featured")&&!I.isFeatured))},[v,n,y]),S=p.useMemo(()=>{const j=[...C];return j.sort((I,T)=>{switch(m){case"rating":return T.rating-I.rating;case"reviews":return T.reviewCount-I.reviewCount;case"name":return I.name.localeCompare(T.name);case"relevance":default:return Number(T.isFeatured)-Number(I.isFeatured)||T.rating-I.rating}}),j},[C,m]);p.useEffect(()=>{h(1)},[y,v,d]);const L=Math.max(1,Math.ceil(S.length/d)),w=S.slice((c-1)*d,c*d);return e.jsx(Za,{title:"Places",description:"Browse offices, venues, and hubs where iGaming teams work and connect.",search:{value:y,onChange:x,onSubmit:x,onClear:()=>x(""),placeholder:"Search places"},filters:M,filterValues:v,onFilterChange:(j,I)=>N(T=>({...T,[j]:I})),onClearFilters:()=>N({type:[],country:[],city:[],services:[],tags:[],signals:[]}),activeFilters:b,sort:{value:m,options:zz,onChange:g},viewMode:f,onViewModeChange:k,pagination:{page:c,pageSize:d,totalPages:L,totalCount:S.length,toolbarTotalCount:n.length,toolbarTitle:"Popular Places",toolbarItemLabel:"places",onPageChange:h,onPageSizeChange:j=>{u(j),h(1)}},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:i?e.jsx(Wa,{totalColumns:d}):w.length?w.map(j=>e.jsx(_z,{id:j.id,name:j.name,type:j.type,city:j.city,country:j.country,shortDescription:j.shortDescription,services:j.services,tags:j.tags,rating:j.rating,reviewCount:j.reviewCount,website:j.website,isFeatured:j.isFeatured,viewMode:f},j.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Fe,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No places found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>N({type:[],country:[],city:[],services:[],tags:[],signals:[]}),children:"Clear all filters"})]})})},Fz={Low:"bg-gaming-success/10 text-gaming-success",Medium:"bg-gaming-warning/10 text-gaming-warning",High:"bg-destructive/10 text-destructive"},Ez=({slug:t,name:a,parentCategory:s,description:n,vendorCount:r,productCount:i,jobCount:l,complianceLevel:c,tags:h=[],isFeatured:d=!1,isTrending:u=!1,subcategories:y=[],topCompanies:x=[]})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/product-categories/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:s}),e.jsxs(O,{className:Fz[c],children:[c," Compliance"]}),d&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Featured"}),u&&e.jsx(O,{variant:"accent",children:"Trending"})]}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-foreground",children:a}),e.jsx("p",{className:"mb-3 line-clamp-2 text-sm text-muted-foreground",children:n}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),r," vendors"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ml,{className:"h-3.5 w-3.5"}),i," products"]}),l!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ce,{className:"h-3.5 w-3.5"}),l," jobs"]})]}),y.length>0&&e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[y.slice(0,3).map(m=>e.jsx(O,{variant:"outline",className:"text-xs",children:m.name},m.slug)),y.length>3&&e.jsxs(O,{variant:"outline",className:"text-xs text-muted-foreground",children:["+",y.length-3]})]}),x.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Top vendors:"}),e.jsxs("p",{className:"text-xs font-medium text-foreground",children:[x.slice(0,3).map(m=>m.name).join(", "),x.length>3&&` +${x.length-3} more`]})]}),e.jsxs(P,{variant:"outline",size:"sm",className:"w-full",onClick:m=>{m.stopPropagation(),window.location.replace(`/product-categories/${t}`)},children:[e.jsx(Ha,{className:"mr-1.5 h-3.5 w-3.5"})," Explore Category"]})]}),v9=[{id:"pc-1",slug:"sportsbook-platform",name:"Sportsbook Platform",parentCategory:"Core Platform",description:"Odds, trading, risk management, and real-time bet settlement stack.",longDescription:"End-to-end sportsbook capabilities covering pre-match and in-play pricing, trading tools, risk management, and low-latency bet placement and settlement.",synonyms:["sportsbook","betting platform","sports trading"],subcategories:[{name:"Risk Management",slug:"risk-management",description:"Exposure controls, limits, and automated risk tooling."},{name:"Trading Tools",slug:"trading-tools",description:"Odds management, feeds, and trader workbench features."}],vendorCount:42,productCount:68,jobCount:18,complianceLevel:"High",tags:["sportsbook","risk"],lastUpdated:"2026-01-22",isTrending:!0,isFeatured:!0,topCompanies:[{name:"Example Sportsbook Co",slug:"example-sportsbook-co",offeringsStrength:"core"}],sampleJobs:[{title:"Sportsbook Product Manager",company:"Example Sportsbook Co",location:"Remote",slug:"sportsbook-product-manager"}],keySkills:[{name:"Odds Modeling",demandLevel:"High"},{name:"Risk Management",demandLevel:"High"}],relatedCategories:[{name:"KYC and AML Tooling",slug:"kyc-and-aml-tooling"},{name:"Affiliate Tracking",slug:"affiliate-tracking"}]},{id:"pc-2",slug:"casino-aggregator",name:"Casino Aggregator",parentCategory:"Content",description:"Unified API layer for slots, live casino, and jackpots.",longDescription:"Aggregation platforms unify multiple game providers behind a single integration, handling lobbies, routing, reporting, and game lifecycle events.",synonyms:["game aggregator","casino aggregation","content aggregation"],subcategories:[{name:"Slots Aggregation",slug:"slots-aggregation",description:"Unified access to slot providers and catalogs."},{name:"Live Casino Aggregation",slug:"live-casino-aggregation",description:"Unified access to live dealer providers and tables."}],vendorCount:35,productCount:77,jobCount:14,complianceLevel:"Medium",tags:["casino","aggregation"],lastUpdated:"2026-02-05",isTrending:!0,topCompanies:[{name:"Example Aggregator Ltd",slug:"example-aggregator-ltd",offeringsStrength:"core"}],sampleJobs:[{title:"Integration Engineer (Casino)",company:"Example Aggregator Ltd",location:"EU (Hybrid)",slug:"integration-engineer-casino"}],keySkills:[{name:"API Integrations",demandLevel:"High"},{name:"Game Certification",demandLevel:"Medium"}],relatedCategories:[{name:"Player CRM",slug:"player-crm"},{name:"Responsible Gaming Suite",slug:"responsible-gaming-suite"}]},{id:"pc-3",slug:"kyc-and-aml-tooling",name:"KYC and AML Tooling",parentCategory:"Compliance",description:"Identity checks, sanctions screening, and ongoing AML monitoring.",longDescription:"Compliance tooling supporting onboarding verification, PEP/sanctions screening, transaction monitoring, case management, and audit-ready reporting.",synonyms:["identity verification","aml monitoring","compliance checks"],subcategories:[{name:"Identity Verification",slug:"identity-verification",description:"Document and biometric checks to verify identity."},{name:"Sanctions & PEP Screening",slug:"sanctions-pep-screening",description:"Watchlist checks and ongoing screening workflows."}],vendorCount:28,productCount:41,jobCount:22,complianceLevel:"High",tags:["kyc","aml"],lastUpdated:"2025-12-11",isFeatured:!0,topCompanies:[{name:"Example Compliance Inc",slug:"example-compliance-inc",offeringsStrength:"core"}],sampleJobs:[{title:"AML Compliance Analyst",company:"Example Compliance Inc",location:"UK",slug:"aml-compliance-analyst"}],keySkills:[{name:"AML",demandLevel:"High"},{name:"KYC",demandLevel:"High"}],relatedCategories:[{name:"Responsible Gaming Suite",slug:"responsible-gaming-suite"},{name:"Player CRM",slug:"player-crm"}]},{id:"pc-4",slug:"affiliate-tracking",name:"Affiliate Tracking",parentCategory:"Marketing",description:"Performance attribution and campaign lifecycle analytics.",longDescription:"Affiliate platforms manage partner tracking, attribution models, commission plans, fraud signals, and reporting across acquisition channels.",synonyms:["affiliate platform","attribution","commission tracking"],subcategories:[{name:"Attribution",slug:"attribution",description:"Clicks, signups, FTD, and multi-touch attribution models."},{name:"Commission Management",slug:"commission-management",description:"CPA/RevShare plans, tiers, and partner payouts."}],vendorCount:31,productCount:52,jobCount:9,complianceLevel:"Medium",tags:["affiliate","analytics"],lastUpdated:"2025-11-29",topCompanies:[{name:"Example Marketing Tech",slug:"example-marketing-tech",offeringsStrength:"core"}],sampleJobs:[{title:"Affiliate Manager",company:"Example Marketing Tech",location:"Remote",slug:"affiliate-manager"}],keySkills:[{name:"Attribution Modeling",demandLevel:"Medium"},{name:"Partner Management",demandLevel:"High"}],relatedCategories:[{name:"Player CRM",slug:"player-crm"},{name:"Casino Aggregator",slug:"casino-aggregator"}]},{id:"pc-5",slug:"player-crm",name:"Player CRM",parentCategory:"Operations",description:"Lifecycle messaging, segmentation, and player retention workflows.",longDescription:"CRMs centralize player segmentation, omnichannel communications, bonus orchestration, and retention automation for regulated iGaming operations.",synonyms:["crm","retention crm","lifecycle marketing"],subcategories:[{name:"Segmentation",slug:"segmentation",description:"Audience building from behavioral and transactional data."},{name:"Messaging",slug:"messaging",description:"Email, SMS, push, and on-site messaging journeys."}],vendorCount:39,productCount:59,jobCount:12,complianceLevel:"Low",tags:["crm","retention"],lastUpdated:"2026-02-10",topCompanies:[{name:"Example CRM Vendor",slug:"example-crm-vendor",offeringsStrength:"core"}],sampleJobs:[{title:"CRM Specialist",company:"Example CRM Vendor",location:"LATAM",slug:"crm-specialist"}],keySkills:[{name:"Lifecycle Marketing",demandLevel:"High"},{name:"Segmentation",demandLevel:"High"}],relatedCategories:[{name:"Affiliate Tracking",slug:"affiliate-tracking"},{name:"Responsible Gaming Suite",slug:"responsible-gaming-suite"}]},{id:"pc-6",slug:"responsible-gaming-suite",name:"Responsible Gaming Suite",parentCategory:"Compliance",description:"Affordability checks, self-exclusion, and safer gambling interventions.",longDescription:"Responsible gaming tooling supports safer gambling requirements including limits, interventions, affordability and vulnerability signals, and exclusion workflows.",synonyms:["rg","safer gambling","player protection"],subcategories:[{name:"Limits & Controls",slug:"limits-and-controls",description:"Deposit, loss, session, and wagering limits."},{name:"Self-Exclusion",slug:"self-exclusion",description:"Self-exclusion and cooling-off journeys and enforcement."}],vendorCount:24,productCount:36,jobCount:11,complianceLevel:"High",tags:["responsible-gaming","safeguards"],lastUpdated:"2026-01-31",isTrending:!0,topCompanies:[{name:"Example RG Provider",slug:"example-rg-provider",offeringsStrength:"core"}],sampleJobs:[{title:"RG Compliance Manager",company:"Example RG Provider",location:"US",slug:"rg-compliance-manager"}],keySkills:[{name:"Regulatory Compliance",demandLevel:"High"},{name:"Risk Analytics",demandLevel:"Medium"}],relatedCategories:[{name:"KYC and AML Tooling",slug:"kyc-and-aml-tooling"},{name:"Sportsbook Platform",slug:"sportsbook-platform"}]}],Oz=[{value:"popularity",label:"Most popular"},{value:"vendors",label:"Most vendors"},{value:"jobs",label:"Most jobs"},{value:"name",label:"Name (A-Z)"}],Bz=["Payments","KYC / AML","Platform (PAM)","Sportsbook","Casino Games / Studios","CRM / CDP","Affiliates","Fraud / Risk"],b9={parentCategory:[],complianceLevel:[],tags:[],signals:[]},Hz=({apiUrl:t})=>{const[a,s]=p.useState([]),[n,r]=p.useState(!0),[i,l]=p.useState(1),[c,h]=p.useState(9),[d,u]=p.useState(""),[y,x]=p.useState("popularity"),[m,g]=p.useState("grid"),[f,k]=p.useState(b9);p.useEffect(()=>{let w=!0;const j=async()=>{try{if(!t){w&&s(v9);return}const I=await fetch(t);if(!I.ok)throw new Error(`${I.status}`);const T=await I.json();w&&Array.isArray(T)&&s(T)}catch(I){console.error("Failed to fetch product categories",I),w&&s(v9)}finally{w&&r(!1)}};return r(!0),j(),()=>{w=!1}},[t]);const v=p.useMemo(()=>{const w=j=>Array.from(new Set(j)).sort();return[{key:"parentCategory",label:"Pillar",type:"checkbox",options:w(a.map(j=>j.parentCategory)).map(j=>({value:j,label:j}))},{key:"complianceLevel",label:"Compliance Level",type:"checkbox",options:w(a.map(j=>j.complianceLevel)).map(j=>({value:j,label:j}))},{key:"tags",label:"Tags",type:"checkbox",searchable:!0,options:w(a.flatMap(j=>j.tags)).map(j=>({value:j,label:j}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"trending",label:"Trending only"}]}]},[a]),N=p.useMemo(()=>Object.entries(f).flatMap(([w,j])=>j.map(I=>({key:w,label:w.charAt(0).toUpperCase()+w.slice(1),value:I,onRemove:()=>k(T=>({...T,[w]:(T[w]??[]).filter(A=>A!==I)}))}))),[f]),M=p.useMemo(()=>{const w=d.trim().toLowerCase();return a.filter(j=>!(w&&!`${j.name} ${j.description} ${j.parentCategory} ${j.synonyms.join(" ")}`.toLowerCase().includes(w)||f.parentCategory.length&&!f.parentCategory.includes(j.parentCategory)||f.complianceLevel.length&&!f.complianceLevel.includes(j.complianceLevel)||f.tags.length&&!f.tags.every(I=>j.tags.includes(I))||f.signals.includes("featured")&&!j.isFeatured||f.signals.includes("trending")&&!j.isTrending))},[a,f,d]),b=p.useMemo(()=>{const w=[...M];return w.sort((j,I)=>{switch(y){case"vendors":return I.vendorCount-j.vendorCount;case"jobs":return I.jobCount-j.jobCount;case"name":return j.name.localeCompare(I.name);default:return I.vendorCount+I.productCount-(j.vendorCount+j.productCount)}}),w},[M,y]);p.useEffect(()=>{l(1)},[d,f,c]);const C=Math.max(1,Math.ceil(b.length/c)),S=b.slice((i-1)*c,i*c),L=()=>k(b9);return e.jsx(Za,{title:"Product Categories",description:"Explore the iGaming B2B technology stack — platforms, content, payments, compliance, and more.",headerPopularTags:Bz,search:{value:d,onChange:u,onSubmit:u,onClear:()=>u(""),placeholder:"Search categories or synonyms (e.g. PAM, PSP)"},filters:v,filterValues:f,onFilterChange:(w,j)=>k(I=>({...I,[w]:j})),onClearFilters:L,activeFilters:N,sort:{value:y,options:Oz,onChange:x},viewMode:m,onViewModeChange:g,pagination:{page:i,pageSize:c,totalPages:C,totalCount:b.length,toolbarTotalCount:a.length,toolbarTitle:"B2B Stack Categories",toolbarItemLabel:"categories",onPageChange:l,onPageSizeChange:w=>{h(w),l(1)}},resultsClassName:m==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:n?e.jsx(Wa,{totalColumns:c}):S.length?S.map(w=>e.jsx(Ez,{id:w.id,slug:w.slug,name:w.name,parentCategory:w.parentCategory,description:w.description,vendorCount:w.vendorCount,productCount:w.productCount,jobCount:w.jobCount,complianceLevel:w.complianceLevel,tags:w.tags,isFeatured:w.isFeatured,isTrending:w.isTrending,subcategories:w.subcategories,topCompanies:w.topCompanies,viewMode:m},w.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(rc,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No categories found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:L,children:"Clear all filters"})]})})},w9={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},j9={positive:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",neutral:"bg-secondary text-muted-foreground border-border",warning:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},ed={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},Vz=({market:t,viewMode:a="grid"})=>a==="list"?e.jsx(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:t.name}),e.jsx(O,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(O,{className:`text-xs ${w9[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(O,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:t.overview}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.badges.map(s=>e.jsx(O,{variant:"outline",className:`text-xs ${j9[s.type]}`,children:s.label},s.label))})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center sm:min-w-[280px]",children:[e.jsx(uN,{icon:Ce,label:"Jobs",value:t.stats.jobsCount.toLocaleString()}),e.jsx(uN,{icon:Se,label:"Companies",value:t.stats.companiesCount.toLocaleString()}),e.jsx(uN,{icon:Al,label:"Remote",value:`${t.stats.remoteRatio}%`})]})]})}):e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer group",onClick:()=>window.location.replace(`/markets/${t.slug}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",className:"text-xs",children:t.region}),e.jsx(O,{className:`text-xs ${w9[t.status]}`,children:t.status}),t.isFeatured&&e.jsx(O,{className:"bg-primary text-primary-foreground text-xs",children:"Featured"})]}),e.jsx("h3",{className:"mb-1 text-lg font-semibold text-foreground group-hover:text-accent transition-colors",children:t.name}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-3 py-2 border-y border-border/50",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.jobsCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Jobs"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-lg font-bold text-foreground",children:t.stats.companiesCount.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Companies"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-lg font-bold text-foreground",children:[t.stats.remoteRatio,"%"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Remote"})]})]}),e.jsxs("div",{className:"flex gap-4 mb-3 text-xs",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Xo,{className:`h-3.5 w-3.5 ${ed[t.stats.hiringIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Hiring:"}),e.jsx("span",{className:`font-medium ${ed[t.stats.hiringIntensity]}`,children:t.stats.hiringIntensity})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ta,{className:`h-3.5 w-3.5 ${ed[t.stats.complianceIntensity]}`}),e.jsx("span",{className:"text-muted-foreground",children:"Compliance:"}),e.jsx("span",{className:`font-medium ${ed[t.stats.complianceIntensity]}`,children:t.stats.complianceIntensity})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:t.badges.slice(0,3).map(s=>e.jsx(O,{variant:"outline",className:`text-xs ${j9[s.type]}`,children:s.label},s.label))}),t.trendingRoles[0]&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(jt,{className:"h-3 w-3 text-gaming-success"}),e.jsxs("span",{children:["Trending: ",e.jsx("strong",{className:"text-foreground",children:t.trendingRoles[0].roleFamily})]}),e.jsxs("span",{className:"text-gaming-success",children:["+",t.trendingRoles[0].changePercent,"%"]})]})]}),uN=({icon:t,label:a,value:s})=>e.jsxs("div",{children:[e.jsx(t,{className:"h-4 w-4 mx-auto mb-0.5 text-muted-foreground"}),e.jsx("p",{className:"text-sm font-bold text-foreground",children:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a})]}),UN=[{id:"mk-malta",slug:"malta",name:"Malta",region:"Europe",countries:["Malta"],cities:["Sliema","St. Julian's","Birkirkara"],status:"Regulated",verticals:["Casino","Sportsbook","Poker","Live Casino"],languages:["English","Maltese"],currency:"EUR",timezone:"CET",populationM:.5,revenuePotentialM:2200,licensesRequired:4,isFeatured:!0,overview:"Malta is the undisputed hub of European iGaming, home to 300+ licensed operators and suppliers. The Malta Gaming Authority (MGA) provides one of the most recognized regulatory frameworks globally, making it the jurisdiction of choice for B2B and B2C companies.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High hiring",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:842,companiesCount:312,remoteRatio:62,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Evolution",slug:"evolution",openRoles:45,employeeRange:"10,000+",isClaimed:!0},{name:"Betsson",slug:"betsson",openRoles:32,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Kindred Group",slug:"kindred-group",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"SOFTSWISS",slug:"softswiss",openRoles:24,employeeRange:"501-1,000",isClaimed:!0},{name:"Yggdrasil",slug:"yggdrasil",openRoles:15,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:210,changePercent:12},{roleFamily:"Compliance",count:95,changePercent:18},{roleFamily:"Product",count:78,changePercent:8},{roleFamily:"Payments",count:52,changePercent:22},{roleFamily:"Marketing",count:68,changePercent:-3}],salaryPulse:{currency:"EUR",medianAnnual:52e3,rangeMin:28e3,rangeMax:12e4,topRoleFamilies:[{role:"Engineering",median:62e3},{role:"Product",median:58e3},{role:"Compliance",median:48e3},{role:"Marketing",median:45e3}]},regulators:[{name:"Malta Gaming Authority",slug:"mga",authority:"MGA",licenseTypes:["B2B","B2C","Type 1","Type 2","Type 3","Type 4"]}],upcomingEvents:[{name:"SiGMA Europe",slug:"sigma-europe",date:"2026-11-11",city:"Valletta"},{name:"Malta iGaming Seminar",slug:"migs-2026",date:"2026-06-15",city:"St. Julian's"}]},{id:"mk-uk",slug:"united-kingdom",name:"United Kingdom",region:"Europe",countries:["United Kingdom"],cities:["London","Manchester","Leeds","Edinburgh"],status:"Regulated",verticals:["Sportsbook","Casino","Poker","Bingo"],languages:["English"],currency:"GBP",timezone:"GMT",populationM:67,revenuePotentialM:5800,licensesRequired:3,isFeatured:!0,overview:"The UK is the world's most mature and tightly regulated iGaming market. The UK Gambling Commission (UKGC) sets global standards for player protection and responsible gambling. London is a key hub for iGaming headquarters and talent.",badges:[{label:"High compliance",type:"warning"},{label:"High hiring",type:"positive"}],stats:{jobsCount:1250,companiesCount:420,remoteRatio:45,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"Flutter Entertainment",slug:"flutter",openRoles:68,employeeRange:"10,000+",isClaimed:!0},{name:"Entain",slug:"entain",openRoles:55,employeeRange:"10,000+",isClaimed:!0},{name:"Playtech",slug:"playtech",openRoles:42,employeeRange:"5,001-10,000",isClaimed:!0},{name:"bet365",slug:"bet365",openRoles:38,employeeRange:"5,001-10,000"}],trendingRoles:[{roleFamily:"Compliance",count:185,changePercent:25},{roleFamily:"Engineering",count:320,changePercent:8},{roleFamily:"Data Science",count:120,changePercent:15},{roleFamily:"Responsible Gambling",count:65,changePercent:30}],salaryPulse:{currency:"GBP",medianAnnual:58e3,rangeMin:3e4,rangeMax:15e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Data Science",median:68e3},{role:"Product",median:65e3},{role:"Compliance",median:55e3}]},regulators:[{name:"UK Gambling Commission",slug:"ukgc",authority:"UKGC",licenseTypes:["Remote","Non-remote","Software"]}],upcomingEvents:[{name:"ICE London",slug:"ice-london-2026",date:"2026-02-10",city:"London"},{name:"Betting on Sports",slug:"bos-2026",date:"2026-09-15",city:"London"}]},{id:"mk-gibraltar",slug:"gibraltar",name:"Gibraltar",region:"Europe",countries:["Gibraltar"],cities:["Gibraltar"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English"],currency:"GBP",timezone:"CET",populationM:.03,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Gibraltar has long been a premium jurisdiction for iGaming, offering favorable tax rates and a well-established regulatory framework. Despite its small size, it hosts some of the industry's biggest names.",badges:[{label:"Tax-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:280,companiesCount:65,remoteRatio:30,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"bet365",slug:"bet365",openRoles:22,employeeRange:"1,001-5,000"},{name:"888 Holdings",slug:"888",openRoles:18,employeeRange:"1,001-5,000",isClaimed:!0},{name:"Lottoland",slug:"lottoland",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:65,changePercent:5},{roleFamily:"Finance",count:40,changePercent:10},{roleFamily:"Compliance",count:35,changePercent:12}],salaryPulse:{currency:"GBP",medianAnnual:55e3,rangeMin:32e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:68e3},{role:"Finance",median:6e4},{role:"Compliance",median:52e3}]},regulators:[{name:"Gibraltar Gambling Commissioner",slug:"ggc",authority:"GGC",licenseTypes:["B2B","B2C"]}],upcomingEvents:[]},{id:"mk-spain",slug:"spain",name:"Spain",region:"Europe",countries:["Spain"],cities:["Madrid","Barcelona","Valencia"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["Spanish"],currency:"EUR",timezone:"CET",populationM:47,revenuePotentialM:1400,licensesRequired:2,isFeatured:!1,overview:"Spain's regulated market under the DGOJ provides a structured framework for online gambling. The market is competitive with strong brand presence from local and international operators.",badges:[{label:"Growing market",type:"positive"}],stats:{jobsCount:185,companiesCount:78,remoteRatio:40,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"Codere",slug:"codere",openRoles:15,employeeRange:"1,001-5,000"},{name:"Luckia",slug:"luckia",openRoles:8,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Marketing",count:45,changePercent:15},{roleFamily:"Engineering",count:38,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:42e3,rangeMin:25e3,rangeMax:9e4,topRoleFamilies:[{role:"Engineering",median:48e3},{role:"Marketing",median:38e3}]},regulators:[{name:"DGOJ",slug:"dgoj",authority:"DGOJ",licenseTypes:["General","Sports Betting"]}],upcomingEvents:[{name:"SBC Summit Barcelona",slug:"sbc-barcelona",date:"2026-09-16",city:"Barcelona"}]},{id:"mk-sweden",slug:"sweden",name:"Sweden",region:"Europe",countries:["Sweden"],cities:["Stockholm","Gothenburg","Malmö"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Swedish","English"],currency:"SEK",timezone:"CET",populationM:10,revenuePotentialM:1800,licensesRequired:2,isFeatured:!1,overview:"Sweden's re-regulated market under Spelinspektionen has created a structured competitive environment. Stockholm is a thriving tech hub with a strong gaming talent pipeline.",badges:[{label:"Remote-friendly",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:320,companiesCount:95,remoteRatio:65,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Betsson",slug:"betsson",openRoles:28,employeeRange:"1,001-5,000",isClaimed:!0},{name:"LeoVegas",slug:"leovegas",openRoles:15,employeeRange:"501-1,000"},{name:"NetEnt (Evolution)",slug:"netent",openRoles:20,employeeRange:"1,001-5,000"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:10},{roleFamily:"Product",count:42,changePercent:7}],salaryPulse:{currency:"SEK",medianAnnual:54e4,rangeMin:32e4,rangeMax:11e5,topRoleFamilies:[{role:"Engineering",median:62e4},{role:"Product",median:58e4}]},regulators:[{name:"Spelinspektionen",slug:"spelinspektionen",authority:"SGA",licenseTypes:["Online Gambling","Land-based"]}],upcomingEvents:[]},{id:"mk-cyprus",slug:"cyprus",name:"Cyprus",region:"Europe",countries:["Cyprus"],cities:["Limassol","Nicosia","Larnaca"],status:"Regulated",verticals:["Casino","Sportsbook"],languages:["Greek","English"],currency:"EUR",timezone:"EET",populationM:1.2,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Cyprus has emerged as a popular alternative to Malta for iGaming companies, offering EU membership, favorable taxes, and a growing talent pool attracted by the Mediterranean lifestyle.",badges:[{label:"Growing hub",type:"positive"},{label:"Tax-friendly",type:"positive"}],stats:{jobsCount:220,companiesCount:85,remoteRatio:50,complianceIntensity:"Medium",hiringIntensity:"High"},topEmployers:[{name:"EveryMatrix",slug:"everymatrix",openRoles:18,employeeRange:"501-1,000"},{name:"Pragmatic Play",slug:"pragmatic-play",openRoles:22,employeeRange:"1,001-5,000",isClaimed:!0}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:20},{roleFamily:"Customer Support",count:40,changePercent:15}],salaryPulse:{currency:"EUR",medianAnnual:38e3,rangeMin:22e3,rangeMax:85e3,topRoleFamilies:[{role:"Engineering",median:45e3},{role:"Customer Support",median:28e3}]},regulators:[{name:"National Betting Authority",slug:"nba-cyprus",authority:"NBA",licenseTypes:["Class A","Class B"]}],upcomingEvents:[]},{id:"mk-brazil",slug:"brazil",name:"Brazil",region:"Latin America",countries:["Brazil"],cities:["São Paulo","Rio de Janeiro","Curitiba"],status:"Emerging",verticals:["Sportsbook","Casino"],languages:["Portuguese"],currency:"BRL",timezone:"BRT",populationM:214,revenuePotentialM:3500,licensesRequired:1,isFeatured:!0,overview:"Brazil represents the largest untapped iGaming opportunity in Latin America. With regulatory frameworks taking shape, international operators are racing to establish presence in this massive market.",badges:[{label:"High growth",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:145,companiesCount:42,remoteRatio:55,complianceIntensity:"Low",hiringIntensity:"High"},topEmployers:[{name:"Betano",slug:"betano",openRoles:20,employeeRange:"201-500"},{name:"Bet365 Brazil",slug:"bet365-brazil",openRoles:15,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:42,changePercent:35},{roleFamily:"Engineering",count:35,changePercent:28},{roleFamily:"Compliance",count:25,changePercent:40}],salaryPulse:{currency:"BRL",medianAnnual:18e4,rangeMin:8e4,rangeMax:45e4,topRoleFamilies:[{role:"Engineering",median:22e4},{role:"Marketing",median:16e4}]},regulators:[{name:"SPA/MF",slug:"spa-brazil",authority:"SPA",licenseTypes:["Sports Betting","Online Casino"]}],upcomingEvents:[{name:"BiS - Brazilian iGaming Summit",slug:"bis-2026",date:"2026-06-25",city:"São Paulo"}]},{id:"mk-canada",slug:"canada-ontario",name:"Canada (Ontario)",region:"North America",countries:["Canada"],cities:["Toronto","Ottawa"],status:"Regulated",verticals:["Sportsbook","Casino","Poker"],languages:["English","French"],currency:"CAD",timezone:"EST",populationM:15,revenuePotentialM:2800,licensesRequired:2,isFeatured:!0,overview:"Ontario's regulated iGaming market launched in 2022 and has rapidly become one of North America's most competitive markets, attracting major international operators.",badges:[{label:"Fast-growing",type:"positive"},{label:"High compliance",type:"neutral"}],stats:{jobsCount:380,companiesCount:55,remoteRatio:70,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"BetMGM",slug:"betmgm",openRoles:25,employeeRange:"501-1,000"},{name:"theScore",slug:"thescore",openRoles:18,employeeRange:"201-500"},{name:"PointsBet",slug:"pointsbet",openRoles:12,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Engineering",count:95,changePercent:18},{roleFamily:"Marketing",count:65,changePercent:22},{roleFamily:"Compliance",count:55,changePercent:30}],salaryPulse:{currency:"CAD",medianAnnual:85e3,rangeMin:5e4,rangeMax:18e4,topRoleFamilies:[{role:"Engineering",median:105e3},{role:"Product",median:95e3},{role:"Compliance",median:78e3}]},regulators:[{name:"AGCO (iGO)",slug:"agco",authority:"AGCO",licenseTypes:["Operator","Supplier"]}],upcomingEvents:[{name:"Canadian Gaming Summit",slug:"cgs-2026",date:"2026-06-10",city:"Toronto"}]},{id:"mk-us",slug:"united-states",name:"United States",region:"North America",countries:["United States"],cities:["New York","New Jersey","Las Vegas","Chicago"],status:"Restricted",verticals:["Sportsbook","Casino","Poker","DFS"],languages:["English"],currency:"USD",timezone:"EST",populationM:330,revenuePotentialM:9500,licensesRequired:6,isFeatured:!0,overview:"The US iGaming market is expanding state-by-state, creating massive opportunities but also regulatory complexity. Sports betting is legal in 30+ states, while iCasino remains limited to a handful of jurisdictions.",badges:[{label:"Highest revenue potential",type:"positive"},{label:"Complex regulation",type:"warning"}],stats:{jobsCount:1800,companiesCount:280,remoteRatio:55,complianceIntensity:"High",hiringIntensity:"High"},topEmployers:[{name:"DraftKings",slug:"draftkings",openRoles:85,employeeRange:"5,001-10,000",isClaimed:!0},{name:"FanDuel",slug:"fanduel",openRoles:72,employeeRange:"5,001-10,000"},{name:"BetMGM",slug:"betmgm",openRoles:55,employeeRange:"1,001-5,000"},{name:"Caesars Digital",slug:"caesars",openRoles:40,employeeRange:"10,000+"}],trendingRoles:[{roleFamily:"Engineering",count:420,changePercent:14},{roleFamily:"Compliance",count:280,changePercent:32},{roleFamily:"Data Science",count:195,changePercent:20},{roleFamily:"Marketing",count:310,changePercent:8}],salaryPulse:{currency:"USD",medianAnnual:95e3,rangeMin:5e4,rangeMax:22e4,topRoleFamilies:[{role:"Engineering",median:125e3},{role:"Data Science",median:115e3},{role:"Product",median:11e4},{role:"Compliance",median:9e4}]},regulators:[{name:"NJ DGE",slug:"nj-dge",authority:"DGE",licenseTypes:["Casino","Sports Wagering"]},{name:"PGCB (Pennsylvania)",slug:"pgcb",authority:"PGCB",licenseTypes:["Interactive Gaming","Sports Wagering"]}],upcomingEvents:[{name:"G2E Las Vegas",slug:"g2e-2026",date:"2026-10-06",city:"Las Vegas"},{name:"SBC Summit North America",slug:"sbc-na-2026",date:"2026-05-13",city:"New York"}]},{id:"mk-philippines",slug:"philippines",name:"Philippines",region:"Asia-Pacific",countries:["Philippines"],cities:["Manila","Cebu","Clark"],status:"Regulated",verticals:["Casino","Sportsbook","Poker"],languages:["Filipino","English"],currency:"PHP",timezone:"PHT",populationM:115,revenuePotentialM:1200,licensesRequired:2,isFeatured:!1,overview:"The Philippines is a major hub for offshore gaming operations (POGOs) and has a growing domestic market regulated by PAGCOR. It offers cost-effective operations and a large English-speaking talent pool.",badges:[{label:"Cost-effective",type:"positive"},{label:"Offshore hub",type:"neutral"}],stats:{jobsCount:420,companiesCount:95,remoteRatio:35,complianceIntensity:"Medium",hiringIntensity:"Medium"},topEmployers:[{name:"PAGCOR",slug:"pagcor",openRoles:15,employeeRange:"5,001-10,000"},{name:"Philweb",slug:"philweb",openRoles:10,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Customer Support",count:120,changePercent:5},{roleFamily:"Engineering",count:65,changePercent:12}],salaryPulse:{currency:"PHP",medianAnnual:85e4,rangeMin:4e5,rangeMax:25e5,topRoleFamilies:[{role:"Engineering",median:12e5},{role:"Customer Support",median:55e4}]},regulators:[{name:"PAGCOR",slug:"pagcor-reg",authority:"PAGCOR",licenseTypes:["POGO","Domestic"]}],upcomingEvents:[]},{id:"mk-india",slug:"india",name:"India",region:"Asia-Pacific",countries:["India"],cities:["Bangalore","Mumbai","Goa","Hyderabad"],status:"Emerging",verticals:["Sportsbook","Fantasy Sports","Rummy"],languages:["Hindi","English"],currency:"INR",timezone:"IST",populationM:1400,revenuePotentialM:2e3,licensesRequired:1,isFeatured:!1,overview:"India is one of the world's most promising iGaming markets, driven by massive mobile adoption and a young population. Fantasy sports and real-money gaming are growing rapidly despite regulatory uncertainty.",badges:[{label:"Massive TAM",type:"positive"},{label:"Regulatory uncertainty",type:"warning"}],stats:{jobsCount:180,companiesCount:65,remoteRatio:60,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Dream11",slug:"dream11",openRoles:25,employeeRange:"1,001-5,000"},{name:"Games24x7",slug:"games24x7",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Engineering",count:55,changePercent:25},{roleFamily:"Product",count:30,changePercent:18}],salaryPulse:{currency:"INR",medianAnnual:18e5,rangeMin:8e5,rangeMax:5e6,topRoleFamilies:[{role:"Engineering",median:22e5},{role:"Product",median:2e6}]},regulators:[],upcomingEvents:[{name:"SPiCE India",slug:"spice-india",date:"2026-03-18",city:"Goa"}]},{id:"mk-nigeria",slug:"nigeria",name:"Nigeria",region:"Africa",countries:["Nigeria"],cities:["Lagos","Abuja"],status:"Emerging",verticals:["Sportsbook"],languages:["English"],currency:"NGN",timezone:"WAT",populationM:220,revenuePotentialM:800,licensesRequired:1,isFeatured:!1,overview:"Nigeria is Africa's largest iGaming market, driven by sports betting popularity and mobile-first consumer behavior. The regulatory environment is evolving with state-level licensing.",badges:[{label:"Mobile-first",type:"positive"},{label:"Emerging regulation",type:"neutral"}],stats:{jobsCount:85,companiesCount:30,remoteRatio:40,complianceIntensity:"Low",hiringIntensity:"Medium"},topEmployers:[{name:"Bet9ja",slug:"bet9ja",openRoles:12,employeeRange:"501-1,000"},{name:"BetKing",slug:"betking",openRoles:8,employeeRange:"201-500"}],trendingRoles:[{roleFamily:"Marketing",count:25,changePercent:30},{roleFamily:"Engineering",count:18,changePercent:20}],salaryPulse:{currency:"NGN",medianAnnual:12e6,rangeMin:5e6,rangeMax:35e6,topRoleFamilies:[{role:"Engineering",median:15e6},{role:"Marketing",median:1e7}]},regulators:[{name:"National Lottery Regulatory Commission",slug:"nlrc",authority:"NLRC",licenseTypes:["Sports Betting"]}],upcomingEvents:[]},{id:"mk-germany",slug:"germany",name:"Germany",region:"Europe",countries:["Germany"],cities:["Berlin","Hamburg","Munich","Frankfurt"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["German"],currency:"EUR",timezone:"CET",populationM:84,revenuePotentialM:2800,licensesRequired:3,isFeatured:!1,overview:"Germany's regulated market under the GGL has strict requirements including deposit limits and mandatory pauses. Despite restrictions, the market size makes it essential for European operators.",badges:[{label:"Strict regulation",type:"warning"},{label:"Large market",type:"positive"}],stats:{jobsCount:290,companiesCount:110,remoteRatio:50,complianceIntensity:"High",hiringIntensity:"Medium"},topEmployers:[{name:"Tipico",slug:"tipico",openRoles:22,employeeRange:"1,001-5,000"},{name:"bwin",slug:"bwin",openRoles:15,employeeRange:"501-1,000"}],trendingRoles:[{roleFamily:"Compliance",count:65,changePercent:28},{roleFamily:"Engineering",count:72,changePercent:6}],salaryPulse:{currency:"EUR",medianAnnual:6e4,rangeMin:35e3,rangeMax:13e4,topRoleFamilies:[{role:"Engineering",median:72e3},{role:"Compliance",median:58e3}]},regulators:[{name:"GGL",slug:"ggl",authority:"GGL",licenseTypes:["Virtual Slots","Poker","Sports Betting"]}],upcomingEvents:[]},{id:"mk-colombia",slug:"colombia",name:"Colombia",region:"Latin America",countries:["Colombia"],cities:["Bogotá","Medellín"],status:"Regulated",verticals:["Sportsbook","Casino"],languages:["Spanish"],currency:"COP",timezone:"COT",populationM:51,revenuePotentialM:600,licensesRequired:2,isFeatured:!1,overview:"Colombia was the first Latin American country to regulate online gambling, creating a model for the region. Coljuegos oversees licensing and the market continues to attract international operators.",badges:[{label:"LatAm pioneer",type:"positive"}],stats:{jobsCount:65,companiesCount:28,remoteRatio:45,complianceIntensity:"Medium",hiringIntensity:"Low"},topEmployers:[{name:"Betplay",slug:"betplay",openRoles:8,employeeRange:"201-500"},{name:"Wplay",slug:"wplay",openRoles:5,employeeRange:"51-200"}],trendingRoles:[{roleFamily:"Marketing",count:18,changePercent:12},{roleFamily:"Engineering",count:12,changePercent:8}],salaryPulse:{currency:"COP",medianAnnual:72e6,rangeMin:36e6,rangeMax:18e7,topRoleFamilies:[{role:"Engineering",median:9e7},{role:"Marketing",median:6e7}]},regulators:[{name:"Coljuegos",slug:"coljuegos",authority:"Coljuegos",licenseTypes:["Online Gambling"]}],upcomingEvents:[]}],Uz=t=>UN.find(a=>a.slug===t),Gz=["Europe","North America","Latin America","Asia-Pacific","Africa","Middle East"],$z=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(""),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState(!1),m=n.trim().length>=2&&i&&c.trim().length>=10,g=()=>{m&&(s==null||s({marketName:n.trim(),region:i,description:c.trim(),contactEmail:d.trim()||void 0}),x(!0))},f=()=>{r(""),l(""),h(""),u(""),x(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:f,children:e.jsx(Xe,{className:"sm:max-w-[480px]",children:y?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Suggestion Received!"}),e.jsx(it,{className:"text-center",children:"Thank you! We'll review your suggestion and add it to the directory if applicable."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:f,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-2",children:e.jsx(Dt,{className:"w-6 h-6 text-accent"})}),e.jsx(Le,{children:"Suggest a Market"}),e.jsx(it,{children:"Can't find a market you're interested in? Suggest it and we'll research and add it to the directory."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Market / Country Name *"}),e.jsx(ae,{placeholder:"e.g. Peru, South Korea, Kenya",value:n,onChange:k=>r(k.target.value),maxLength:80})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Region *"}),e.jsxs(Ye,{value:i,onValueChange:l,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select region"})}),e.jsx(Ge,{children:Gz.map(k=>e.jsx(me,{value:k,children:k},k))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Why should we add this market? *"}),e.jsx(rt,{placeholder:"Tell us about the iGaming activity in this market...",value:c,onChange:k=>h(k.target.value),rows:3,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Your Email ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional — for updates)"})]}),e.jsx(ae,{type:"email",placeholder:"you@example.com",value:d,onChange:k=>u(k.target.value)})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:f,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:g,disabled:!m,children:"Submit Suggestion"})]})]})})})},Wz=[{value:"hiring",label:"Hiring now"},{value:"revenue",label:"Revenue potential"},{value:"salary",label:"Salary (median)"},{value:"remote",label:"Remote friendliness"},{value:"compliance",label:"Compliance intensity"},{value:"name",label:"Name (A-Z)"}],Zz=({apiUrl:t,marketsData:a,itemsPerPage:s=12,onSuggestMarket:n})=>{const[r,i]=p.useState([]),[l,c]=p.useState(!0),[h,d]=p.useState(1),[u,y]=p.useState(s),[x,m]=p.useState(""),[g,f]=p.useState("hiring"),[k,v]=p.useState("grid"),[N,M]=p.useState(!1),[b,C]=p.useState({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]});p.useEffect(()=>{let D=!0;const q=async()=>{try{if(!t){D&&i(a??UN);return}const E=await fetch(t);if(!E.ok)throw new Error(`${E.status}`);const F=await E.json();D&&Array.isArray(F)&&i(F)}catch{D&&i(a??UN)}finally{D&&c(!1)}};return c(!0),q(),()=>{D=!1}},[t,a]);const S=p.useMemo(()=>{const D=Array.from(new Set(r.map(F=>F.region))).sort(),q=Array.from(new Set(r.map(F=>F.status))).sort(),E=Array.from(new Set(r.flatMap(F=>F.verticals))).sort();return[{key:"region",label:"Region",type:"checkbox",options:D.map(F=>({value:F,label:F}))},{key:"status",label:"Market Status",type:"checkbox",options:q.map(F=>({value:F,label:F}))},{key:"hiringIntensity",label:"Hiring Intensity",type:"checkbox",options:[{value:"High",label:"High"},{value:"Medium",label:"Medium"},{value:"Low",label:"Low"}]},{key:"verticals",label:"Verticals",type:"checkbox",searchable:!0,options:E.map(F=>({value:F,label:F}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"featured",label:"Featured only"},{value:"remote-friendly",label:"Remote-friendly (50%+)"}]}]},[r]),L=p.useMemo(()=>Object.entries(b).flatMap(([D,q])=>q.map(E=>({key:D,label:D.charAt(0).toUpperCase()+D.slice(1),value:E,onRemove:()=>C(F=>({...F,[D]:(F[D]??[]).filter(G=>G!==E)}))}))),[b]),w=p.useMemo(()=>{const D=x.trim().toLowerCase();return r.filter(q=>{var E;return!(D&&!`${q.name} ${q.region} ${((E=q.countries)==null?void 0:E.join(" "))??""}`.toLowerCase().includes(D)||b.region.length&&!b.region.includes(q.region)||b.status.length&&!b.status.includes(q.status)||b.hiringIntensity.length&&!b.hiringIntensity.includes(q.stats.hiringIntensity)||b.verticals.length&&!b.verticals.some(F=>q.verticals.includes(F))||b.signals.includes("featured")&&!q.isFeatured||b.signals.includes("remote-friendly")&&q.stats.remoteRatio<50)})},[r,b,x]),j=p.useMemo(()=>{const D=[...w];return D.sort((q,E)=>{switch(g){case"hiring":return E.stats.jobsCount-q.stats.jobsCount;case"revenue":return E.revenuePotentialM-q.revenuePotentialM;case"salary":return E.salaryPulse.medianAnnual-q.salaryPulse.medianAnnual;case"remote":return E.stats.remoteRatio-q.stats.remoteRatio;case"compliance":{const F={High:3,Medium:2,Low:1};return F[E.stats.complianceIntensity]-F[q.stats.complianceIntensity]}case"name":return q.name.localeCompare(E.name);default:return 0}}),D},[w,g]);p.useEffect(()=>{d(1)},[x,b,u]);const I=Math.max(1,Math.ceil(j.length/u)),T=j.slice((h-1)*u,h*u),A=()=>C({region:[],status:[],verticals:[],hiringIntensity:[],signals:[]}),R=p.useCallback(D=>{n==null||n(D),console.log("[MarketsList] Suggest market:",D)},[n]);return e.jsxs(e.Fragment,{children:[e.jsx(Za,{title:"iGaming Markets — Career Intelligence",description:"Explore global iGaming markets by hiring intensity, salary levels, regulatory complexity, and remote-friendliness. Find where the opportunities are.",headerActions:e.jsxs(P,{variant:"accent",size:"sm",className:"gap-1.5",onClick:()=>M(!0),children:[e.jsx(St,{className:"w-4 h-4"}),"Suggest a Market"]}),search:{value:x,onChange:m,onSubmit:m,onClear:()=>m(""),placeholder:"Search markets (e.g. Brazil, Malta, Ontario...)"},filters:S,filterValues:b,onFilterChange:(D,q)=>C(E=>({...E,[D]:q})),onClearFilters:A,activeFilters:L,sort:{value:g,options:Wz,onChange:f},viewMode:k,onViewModeChange:v,pagination:{page:h,pageSize:u,totalPages:I,totalCount:j.length,toolbarTotalCount:r.length,toolbarTitle:"Global Markets",toolbarItemLabel:"markets",onPageChange:d,onPageSizeChange:D=>{y(D),d(1)},pageSizeOptions:[6,12,24]},resultsClassName:k==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:l?e.jsx(Wa,{totalColumns:u>6?6:u}):T.length?T.map(D=>e.jsx(Vz,{market:D,viewMode:k},D.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Dt,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No markets found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters or search."}),e.jsxs("div",{className:"flex gap-3 justify-center",children:[e.jsx(P,{variant:"outline",onClick:A,children:"Clear all filters"}),e.jsx(P,{variant:"accent",onClick:()=>M(!0),children:"Suggest a market"})]})]})}),e.jsx($z,{open:N,onOpenChange:M,onSubmit:R})]})},Yz=({slug:t,name:a,acronym:s,country:n,region:r,jurisdiction:i,sectors:l,licenseTypes:c,scopeTags:h=[],establishedYear:d,complianceRating:u,website:y,isPrimary:x=!1,description:m,viewMode:g})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card cursor-pointer",onClick:()=>window.location.replace(`/regulators/${t}`),children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:r}),e.jsx(O,{variant:"outline",children:i}),x&&e.jsx(O,{className:"bg-primary text-primary-foreground",children:"Primary"})]}),e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:a}),e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["(",s,")"]})]}),e.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:n}),m&&e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:m}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(tt,{className:"h-3.5 w-3.5 fill-gaming-gold text-gaming-gold"}),u.toFixed(1)," compliance"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(fs,{className:"h-3.5 w-3.5"}),"Since ",d]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Mc,{className:"h-3.5 w-3.5"}),c.length," license types"]})]}),e.jsxs("div",{className:"mb-3 flex flex-wrap gap-1.5",children:[l.slice(0,3).map(f=>e.jsx(O,{variant:"outline",className:"text-xs",children:f},f)),h.slice(0,2).map(f=>e.jsx(O,{variant:"accent",className:"text-xs",children:f},f))]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(P,{variant:"outline",size:"sm",className:"flex-1",onClick:f=>{f.stopPropagation(),window.location.replace(`/regulators/${t}`)},children:[e.jsx(Ha,{className:"mr-1.5 h-3.5 w-3.5"})," Details"]}),y&&e.jsx(P,{variant:"outline",size:"sm",asChild:!0,onClick:f=>f.stopPropagation(),children:e.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:e.jsx(Rt,{className:"h-3.5 w-3.5"})})})]})]}),GN=[{id:"reg-1",slug:"uk-gambling-commission",name:"UK Gambling Commission",acronym:"UKGC",country:"United Kingdom",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Bingo","Lottery"],licenseTypes:["B2C","B2B","Remote"],scopeTags:["Player Protection","AML","Advertising Standards"],establishedYear:2007,complianceRating:4.8,isPrimary:!0,website:"https://www.gamblingcommission.gov.uk",registerUrl:"https://www.gamblingcommission.gov.uk/public-register",description:"The UK Gambling Commission regulates all commercial gambling in Great Britain, ensuring fairness, preventing crime, and protecting vulnerable players. It is widely regarded as one of the most stringent regulators globally.",scope:"Covers all forms of remote and land-based gambling including casinos, betting, bingo, lotteries, and gaming machines. Applies to both B2C operators and B2B suppliers serving the UK market.",careerImplications:"UKGC regulation creates high demand for compliance professionals, responsible gaming specialists, and AML analysts. Companies operating under UKGC licenses typically maintain dedicated UK compliance teams.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring adherence to LCCP conditions and AML/CTF requirements."},{roleFamily:"Responsible Gaming",description:"Implementing player protection measures, self-exclusion systems, and affordability checks."},{roleFamily:"Legal & Regulatory",description:"Monitoring regulatory changes and managing license conditions."},{roleFamily:"Risk & Fraud",description:"Identifying and mitigating fraud, money laundering, and match-fixing risks."}],keyRequirements:["Player protection & affordability checks","Anti-money laundering controls","Advertising & marketing compliance","Regular regulatory returns & reporting","Customer interaction and social responsibility"],linkedMarkets:[{name:"United Kingdom",slug:"united-kingdom"}],linkedCompanies:[{name:"Entain",slug:"entain",evidenceLevel:"verified",evidenceUrl:"https://www.gamblingcommission.gov.uk/public-register",licenseId:"001-042579-R"},{name:"Flutter Entertainment",slug:"flutter-entertainment",evidenceLevel:"verified"},{name:"bet365",slug:"bet365",evidenceLevel:"self-reported"}]},{id:"reg-2",slug:"malta-gaming-authority",name:"Malta Gaming Authority",acronym:"MGA",country:"Malta",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery","Fantasy Sports"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection","Responsible Gaming"],establishedYear:2015,complianceRating:4.7,isPrimary:!0,website:"https://www.mga.org.mt",registerUrl:"https://www.mga.org.mt/licensee-register/",description:"The Malta Gaming Authority is one of the world's most respected online gaming regulators. Its licensing framework has made Malta the European hub for iGaming, hosting hundreds of licensed operators and suppliers.",scope:"Regulates all forms of remote gaming from Malta, including casino, sports betting, poker, and skill games. Covers both B2C operations and B2B critical supply.",careerImplications:"Malta's MGA licensing has created one of the largest iGaming talent markets globally. The concentration of licensed operators drives massive demand for compliance, tech, and commercial roles.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing MGA license compliance, player fund protection, and AML obligations."},{roleFamily:"Legal & Regulatory",description:"Navigating multi-jurisdictional licensing requirements with MGA as the primary license."},{roleFamily:"Product & Technology",description:"Building compliant gaming platforms that meet MGA technical standards."},{roleFamily:"Payments",description:"Managing payment processing within MGA regulatory frameworks."}],keyRequirements:["Player fund protection (segregated accounts)","Responsible gaming tools","AML/CFT compliance","Fit and proper assessments","Regular auditing and reporting"],linkedMarkets:[{name:"Malta",slug:"malta"}],linkedCompanies:[{name:"Betsson Group",slug:"betsson-group",evidenceLevel:"verified",evidenceUrl:"https://www.mga.org.mt/licensee-register/"},{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"verified"},{name:"LeoVegas",slug:"leovegas",evidenceLevel:"self-reported"}]},{id:"reg-3",slug:"kansspelautoriteit",name:"Kansspelautoriteit",acronym:"KSA",country:"Netherlands",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Remote"],scopeTags:["Player Protection","Advertising Restrictions","AML"],establishedYear:2012,complianceRating:4.5,website:"https://kansspelautoriteit.nl",description:"The Dutch Gaming Authority oversees the regulated online gambling market in the Netherlands, which opened in October 2021 under the Remote Gambling Act (KOA).",scope:"Regulates online casino and sports betting operators serving Dutch consumers. Known for strict advertising and bonus restrictions.",careerImplications:"The relatively new Dutch market creates demand for compliance experts who understand KSA-specific advertising restrictions and player protection requirements.",careerRoles:[{roleFamily:"Compliance & AML",description:"Ensuring compliance with Dutch Remote Gambling Act requirements."},{roleFamily:"Marketing Compliance",description:"Managing strict advertising limitations and bonus restrictions."}],keyRequirements:["Strict advertising limitations","Cooling-off period enforcement","Centraal Register Uitsluiting Kansspelen (CRUKS)","Player loss limits"],linkedMarkets:[{name:"Netherlands",slug:"netherlands"}],linkedCompanies:[{name:"Kindred Group",slug:"kindred-group",evidenceLevel:"self-reported"}]},{id:"reg-4",slug:"agco-ontario",name:"Alcohol and Gaming Commission of Ontario",acronym:"AGCO",country:"Canada",region:"North America",jurisdiction:"State",sectors:["Sportsbook","Casino"],licenseTypes:["Operator","Supplier"],scopeTags:["Player Protection","Responsible Gaming","AML"],establishedYear:1998,complianceRating:4.4,isPrimary:!0,website:"https://www.agco.ca",description:"AGCO regulates Ontario's iGaming market through iGaming Ontario (iGO), which opened in April 2022 as Canada's first regulated province-level online gaming market.",scope:"Oversees online sports betting and casino gaming in Ontario through the iGaming Ontario subsidiary. Covers both operators and gaming-related suppliers.",careerImplications:"Ontario's market opening created North America's fastest-growing iGaming talent pool, with demand for professionals experienced in both North American and European regulatory frameworks.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting AGCO standards and FINTRAC reporting requirements."},{roleFamily:"Responsible Gaming",description:"Implementing Ontario-specific player protection measures."}],keyRequirements:["FINTRAC AML registration","Responsible gaming commitments","Play-management tools","Advertising standards compliance"],linkedMarkets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],linkedCompanies:[{name:"theScore",slug:"thescore",evidenceLevel:"self-reported"}]},{id:"reg-5",slug:"spelinspektionen",name:"Spelinspektionen",acronym:"SGA",country:"Sweden",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino"],licenseTypes:["Commercial Online Gaming"],scopeTags:["Player Protection","Bonus Restrictions","AML"],establishedYear:2019,complianceRating:4.3,website:"https://www.spelinspektionen.se",description:"The Swedish Gambling Authority supervises the regulated online gambling market under the Gambling Act (2018:1138), which re-regulated the Swedish market in January 2019.",scope:"Regulates commercial online gaming licenses in Sweden, covering sports betting and casino. Known for strict bonus limitations (first deposit only).",careerImplications:"Sweden's strict regulatory environment requires deep compliance expertise, particularly around bonus restrictions and responsible gaming mandates.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing Swedish Gambling Act compliance and Spelpaus integration."},{roleFamily:"Responsible Gaming",description:"Implementing mandatory deposit limits and self-exclusion (Spelpaus)."}],keyRequirements:["Bonus restrictions (welcome bonus only)","Spelpaus self-exclusion system","Moderate gambling messaging","SEK 3-second delay on in-play betting"],linkedMarkets:[{name:"Sweden",slug:"sweden"}],linkedCompanies:[]},{id:"reg-6",slug:"njdge",name:"New Jersey Division of Gaming Enforcement",acronym:"NJDGE",country:"United States",region:"North America",jurisdiction:"State",sectors:["Casino","Sportsbook"],licenseTypes:["Casino Service Industry","Online Sports Wagering"],scopeTags:["Licensing","Testing","AML","Geolocation"],establishedYear:1977,complianceRating:4.6,website:"https://www.njoag.gov/about/divisions-and-offices/division-of-gaming-enforcement-home/",description:"The NJDGE oversees all legal gambling activity in New Jersey, including Atlantic City casinos and the pioneering online gaming market launched in 2013.",scope:"Regulates casino gaming, online casino, and sports betting within New Jersey. Requires partnership with a land-based casino licensee for online operations.",careerImplications:"New Jersey's mature regulated market drives demand for US-compliance specialists, geolocation experts, and professionals with Atlantic City experience.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating NJ DGE compliance requirements and BSA/AML obligations."},{roleFamily:"Geolocation & Identity",description:"Implementing geofencing and KYC solutions required for state-level licensing."}],keyRequirements:["Land-based casino partnership required","Geolocation verification","Server location within NJ or approved states","Background investigations for key employees"],linkedMarkets:[{name:"United States",slug:"united-states"}],linkedCompanies:[]},{id:"reg-7",slug:"curacao-gaming-control-board",name:"Curaçao Gaming Control Board",acronym:"GCB",country:"Curaçao",region:"Caribbean",jurisdiction:"National",sectors:["Casino","Sportsbook","Poker","Lottery"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","Reform","AML"],establishedYear:2023,complianceRating:3.2,website:"https://www.gcb.cw",description:"Curaçao is undergoing major regulatory reform, transitioning from the legacy e-gaming sublicense system to a new framework under the Gaming Control Board (GCB), established in 2023.",scope:"Covers all forms of online gambling operated from Curaçao. The reform introduces stricter AML, KYC, and player protection requirements to replace the previous master-sublicense model.",careerImplications:"The regulatory reform creates new compliance roles as operators transition from legacy sublicenses to GCB-compliant frameworks. Knowledge of transitional requirements is highly valued.",careerRoles:[{roleFamily:"Compliance & AML",description:"Navigating the transition from legacy sublicenses to new GCB requirements."},{roleFamily:"Legal & Regulatory",description:"Managing re-licensing and compliance with the new ordinance."}],keyRequirements:["Transition from sublicense to GCB license","Enhanced KYC/AML obligations","Player protection measures","Local substance requirements"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-8",slug:"gibraltar-gambling-commissioner",name:"Gibraltar Gambling Commissioner",acronym:"GGC",country:"Gibraltar",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["B2C","B2B"],scopeTags:["Remote Gaming","AML","Player Protection"],establishedYear:2005,complianceRating:4.5,isPrimary:!0,website:"https://www.gibraltar.gov.gi/gambling",description:"Gibraltar's Gambling Commissioner oversees one of the longest-established online gambling jurisdictions. Several major global operators are headquartered or licensed in Gibraltar.",scope:"Regulates remote gambling operations from Gibraltar, covering sports betting, casino, and poker. Known for a pragmatic, business-friendly but high-standard regulatory approach.",careerImplications:"Gibraltar hosts headquarters of major operators like bet365, 888, and Lottoland, creating a dense talent market for senior commercial, tech, and compliance professionals.",careerRoles:[{roleFamily:"Compliance & AML",description:"Meeting GGC requirements and managing multi-jurisdictional compliance."},{roleFamily:"Senior Leadership",description:"Many C-suite and director-level roles based in Gibraltar due to operator HQs."}],keyRequirements:["Physical presence in Gibraltar","Adequate financial resources","Fit and proper person tests","Player funds protection"],linkedMarkets:[{name:"Gibraltar",slug:"gibraltar"}],linkedCompanies:[{name:"bet365",slug:"bet365",evidenceLevel:"verified"},{name:"888 Holdings",slug:"888-holdings",evidenceLevel:"self-reported"}]},{id:"reg-9",slug:"dgoj-spain",name:"Dirección General de Ordenación del Juego",acronym:"DGOJ",country:"Spain",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker"],licenseTypes:["General","Singular"],scopeTags:["Advertising Restrictions","Player Protection","AML"],establishedYear:2011,complianceRating:4.2,website:"https://www.ordenacionjuego.es",description:"Spain's DGOJ regulates the country's online gambling market under Royal Decree 958/2020, which introduced strict advertising limitations including a near-total ban on gambling advertising.",scope:"Oversees online gambling licensing in Spain, covering general licenses (casino, sports betting, poker) and singular licenses (specific formats). Enforced strict advertising reforms in 2021.",careerImplications:"Spain's strict ad regulations require specialized marketing compliance expertise. The market's restrictions have shifted demand toward CRM, retention, and organic acquisition roles.",careerRoles:[{roleFamily:"Marketing Compliance",description:"Navigating Spain's advertising ban and permitted marketing channels."},{roleFamily:"CRM & Retention",description:"Driving growth through compliant retention strategies under ad restrictions."}],keyRequirements:["Near-complete advertising ban (post-2021)","Self-exclusion (RGIAJ) integration","Deposit limit enforcement","Session time reminders"],linkedMarkets:[{name:"Spain",slug:"spain"}],linkedCompanies:[]},{id:"reg-10",slug:"isle-of-man-gsc",name:"Isle of Man Gambling Supervision Commission",acronym:"GSC",country:"Isle of Man",region:"Europe",jurisdiction:"National",sectors:["Sportsbook","Casino","Poker","Lottery"],licenseTypes:["Online Gambling","Network Services","Software Supplier"],scopeTags:["Remote Gaming","E-Gaming","AML"],establishedYear:1962,complianceRating:4.4,website:"https://www.gov.im/gambling/",description:"The Isle of Man GSC is one of the oldest gambling regulators and was among the first to regulate online gambling. The island hosts several major B2B suppliers and operators.",scope:"Regulates all forms of gambling from the Isle of Man, with a strong focus on e-gaming (online). Known for a business-supportive environment with robust standards.",careerImplications:"Home to major B2B suppliers like Microgaming (now Games Global) and PokerStars, the Isle of Man offers specialized roles in game development, platform engineering, and regulatory technology.",careerRoles:[{roleFamily:"Platform Engineering",description:"Building and maintaining gaming platforms for B2B suppliers."},{roleFamily:"Game Development",description:"Creating online slots and table games for global markets."}],keyRequirements:["Comprehensive player protection","Data protection compliance","AML/CFT measures","Technical testing and certification"],linkedMarkets:[],linkedCompanies:[]},{id:"reg-11",slug:"pagcor",name:"Philippine Amusement and Gaming Corporation",acronym:"PAGCOR",country:"Philippines",region:"Asia-Pacific",jurisdiction:"National",sectors:["Casino","Sportsbook"],licenseTypes:["POGO","Domestic"],scopeTags:["Offshore Gaming","AML","POGO"],establishedYear:1976,complianceRating:3,website:"https://www.pagcor.ph",description:"PAGCOR is both a regulator and operator in the Philippines. It historically oversaw the POGO (Philippine Offshore Gaming Operator) program, though this sector faced significant reforms and restrictions.",scope:"Regulates land-based and online gambling in the Philippines. The POGO program licensed offshore operators serving Asian markets, though it has been significantly curtailed.",careerImplications:"Despite POGO restrictions, the Philippines remains a talent hub for live dealer operations, customer support, and Asian-market-facing roles.",careerRoles:[{roleFamily:"Live Dealer Operations",description:"Managing large-scale live casino studios serving Asian markets."},{roleFamily:"Customer Support",description:"Multilingual support for Asia-Pacific-facing operations."}],keyRequirements:["PAGCOR franchise/license","Local employment requirements","AML compliance","Revenue sharing with government"],linkedMarkets:[{name:"Philippines",slug:"philippines"}],linkedCompanies:[]},{id:"reg-12",slug:"kahnawake-gaming-commission",name:"Kahnawake Gaming Commission",acronym:"KGC",country:"Canada",region:"North America",jurisdiction:"Regional",sectors:["Casino","Sportsbook","Poker"],licenseTypes:["Interactive Gaming","Client Provider"],scopeTags:["First Nations","Remote Gaming","Player Protection"],establishedYear:1999,complianceRating:3.5,website:"https://www.gamingcommission.ca",description:"The Kahnawake Gaming Commission, based in the Mohawk Territory of Kahnawake near Montreal, is one of the earliest online gambling regulators. It operates under First Nations governance.",scope:"Licenses and regulates interactive gaming operations from the Mohawk Territory. Historically a major licensing jurisdiction for operators serving multiple markets.",careerImplications:"KGC-licensed operations create demand for compliance professionals familiar with both First Nations governance structures and international online gaming standards.",careerRoles:[{roleFamily:"Compliance & AML",description:"Managing KGC regulatory requirements and cross-border compliance."}],keyRequirements:["Hosting on Mohawk Internet Technologies servers","Player dispute resolution","Regular compliance auditing","Financial suitability assessments"],linkedMarkets:[],linkedCompanies:[]}],Jz=t=>GN.find(a=>a.slug===t),Kz=[{value:"authority",label:"Top authority"},{value:"name",label:"Name (A-Z)"},{value:"rating",label:"Highest compliance score"},{value:"established",label:"Longest standing"}],M9={region:[],country:[],jurisdiction:[],licenseTypes:[],sectors:[],scopeTags:[],signals:[]},Xz=({apiUrl:t,regulatorsData:a,itemsPerPage:s=9})=>{const[n,r]=p.useState(a??[]),[i,l]=p.useState(!a),[c,h]=p.useState(1),[d,u]=p.useState(s),[y,x]=p.useState(""),[m,g]=p.useState("authority"),[f,k]=p.useState("grid"),[v,N]=p.useState(M9);p.useEffect(()=>{if(a)return;let I=!0;const T=async()=>{try{if(!t){I&&r(GN);return}const A=await fetch(t);if(!A.ok)throw new Error(`${A.status}`);const R=await A.json();I&&Array.isArray(R)&&r(R)}catch(A){console.error("Failed to fetch regulators",A),I&&r(GN)}finally{I&&l(!1)}};return l(!0),T(),()=>{I=!1}},[t,a]);const M=p.useMemo(()=>{const I=T=>Array.from(new Set(T)).sort();return[{key:"region",label:"Region",type:"checkbox",options:I(n.map(T=>T.region)).map(T=>({value:T,label:T}))},{key:"country",label:"Country",type:"searchable-select",searchable:!0,options:I(n.map(T=>T.country)).map(T=>({value:T,label:T}))},{key:"jurisdiction",label:"Jurisdiction",type:"checkbox",options:I(n.map(T=>T.jurisdiction)).map(T=>({value:T,label:T}))},{key:"licenseTypes",label:"License Types",type:"checkbox",searchable:!0,options:I(n.flatMap(T=>T.licenseTypes)).map(T=>({value:T,label:T}))},{key:"sectors",label:"Sectors",type:"checkbox",searchable:!0,options:I(n.flatMap(T=>T.sectors)).map(T=>({value:T,label:T}))},{key:"scopeTags",label:"Scope",type:"checkbox",options:I(n.flatMap(T=>T.scopeTags)).map(T=>({value:T,label:T}))},{key:"signals",label:"Signals",type:"toggle",options:[{value:"primary",label:"Primary only"}]}]},[n]),b=p.useMemo(()=>Object.entries(v).flatMap(([I,T])=>T.map(A=>({key:I,label:I.charAt(0).toUpperCase()+I.slice(1),value:A,onRemove:()=>N(R=>({...R,[I]:(R[I]??[]).filter(D=>D!==A)}))}))),[v]),C=p.useMemo(()=>{const I=y.trim().toLowerCase();return n.filter(T=>!(I&&!`${T.name} ${T.acronym} ${T.country} ${T.region}`.toLowerCase().includes(I)||v.region.length&&!v.region.includes(T.region)||v.country.length&&!v.country.includes(T.country)||v.jurisdiction.length&&!v.jurisdiction.includes(T.jurisdiction)||v.licenseTypes.length&&!v.licenseTypes.every(A=>T.licenseTypes.includes(A))||v.sectors.length&&!v.sectors.every(A=>T.sectors.includes(A))||v.scopeTags.length&&!v.scopeTags.every(A=>T.scopeTags.includes(A))||v.signals.includes("primary")&&!T.isPrimary))},[v,n,y]),S=p.useMemo(()=>{const I=[...C];return I.sort((T,A)=>{switch(m){case"name":return T.name.localeCompare(A.name);case"rating":return A.complianceRating-T.complianceRating;case"established":return T.establishedYear-A.establishedYear;default:return Number(A.isPrimary)-Number(T.isPrimary)||A.complianceRating-T.complianceRating}}),I},[C,m]);p.useEffect(()=>{h(1)},[y,v,d]);const L=Math.max(1,Math.ceil(S.length/d)),w=S.slice((c-1)*d,c*d),j=()=>N(M9);return e.jsx(Za,{title:"Regulators",description:"Review licensing authorities, jurisdictions, and regulatory scope across the global iGaming industry.",search:{value:y,onChange:x,onSubmit:x,onClear:()=>x(""),placeholder:"Search by name or acronym (e.g. MGA)"},filters:M,filterValues:v,onFilterChange:(I,T)=>N(A=>({...A,[I]:T})),onClearFilters:j,activeFilters:b,sort:{value:m,options:Kz,onChange:g},viewMode:f,onViewModeChange:k,pagination:{page:c,pageSize:d,totalPages:L,totalCount:S.length,toolbarTotalCount:n.length,toolbarTitle:"Regulatory Authorities",toolbarItemLabel:"regulators",onPageChange:h,onPageSizeChange:I=>{u(I),h(1)}},resultsClassName:f==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:i?e.jsx(Wa,{totalColumns:d}):w.length?w.map(I=>e.jsx(Yz,{id:I.id,slug:I.slug,name:I.name,acronym:I.acronym,country:I.country,region:I.region,jurisdiction:I.jurisdiction,sectors:I.sectors,licenseTypes:I.licenseTypes,scopeTags:I.scopeTags,establishedYear:I.establishedYear,complianceRating:I.complianceRating,website:I.website,isPrimary:I.isPrimary,description:I.description,viewMode:f},I.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(fs,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No regulators found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:j,children:"Clear all filters"})]})})},Qz={Active:"bg-gaming-success/10 text-gaming-success border-gaming-success/20",Reforming:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20",Emerging:"bg-accent/10 text-accent border-accent/20",Restricted:"bg-destructive/10 text-destructive border-destructive/20"},eq=({slug:t,name:a,region:s,status:n,regulatorNames:r,notes:i,gamblingSectors:l,keyFacts:c,onNavigate:h})=>e.jsxs(U,{className:"border border-transparent p-4 transition-all duration-200 hover:border-accent/20 hover:shadow-card",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx(O,{variant:"secondary",children:s}),e.jsx(O,{variant:"outline",className:Qz[n]??"",children:n})]}),e.jsxs("h3",{className:"mb-1 text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Fe,{className:"h-4 w-4 text-accent flex-shrink-0"}),a]}),e.jsx("p",{className:"mb-3 text-xs text-muted-foreground line-clamp-2",children:i}),e.jsx("div",{className:"mb-3 space-y-1.5",children:r.map(d=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-foreground",children:[e.jsx(Ta,{className:"h-3.5 w-3.5 text-gaming-success flex-shrink-0"}),d]},d))}),e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:l.slice(0,4).map(d=>e.jsx(O,{variant:"outline",className:"text-xs",children:d},d))}),c.length>0&&e.jsx("div",{className:"mb-3 space-y-1",children:c.slice(0,2).map(d=>e.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[e.jsx(ac,{className:"h-3 w-3 mt-0.5 flex-shrink-0 text-accent"}),d]},d))}),h&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",onClick:()=>h(t),children:"View Jurisdiction Details"})]}),tq=[{id:"jur-1",slug:"united-kingdom",name:"United Kingdom",region:"Europe",status:"Active",regulatorIds:["reg-1"],regulatorNames:["UK Gambling Commission (UKGC)"],notes:"One of the most mature and strictly regulated online gambling markets globally. The Gambling Act 2005 provides the primary legal framework.",markets:[{name:"United Kingdom",slug:"united-kingdom"}],gamblingSectors:["Casino","Sportsbook","Bingo","Lottery","Poker"],keyFacts:["Gambling Act 2005 (updated 2023 White Paper)","Mandatory affordability checks","Strict advertising standards"]},{id:"jur-2",slug:"malta",name:"Malta",region:"Europe",status:"Active",regulatorIds:["reg-2"],regulatorNames:["Malta Gaming Authority (MGA)"],notes:"Europe's primary iGaming hub with 300+ licensed companies. The Gaming Act (2018) modernized the regulatory framework.",markets:[{name:"Malta",slug:"malta"}],gamblingSectors:["Casino","Sportsbook","Poker","Fantasy Sports"],keyFacts:["300+ licensed operators","Gaming Act 2018","EU single-market passporting advantages"]},{id:"jur-3",slug:"netherlands",name:"Netherlands",region:"Europe",status:"Active",regulatorIds:["reg-3"],regulatorNames:["Kansspelautoriteit (KSA)"],notes:"Market opened October 2021 under the Remote Gambling Act (KOA). Strict advertising and bonus restrictions introduced rapidly.",markets:[{name:"Netherlands",slug:"netherlands"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Remote Gambling Act (KOA) - 2021","CRUKS self-exclusion system","Advertising ban from 2025"]},{id:"jur-4",slug:"ontario-canada",name:"Ontario, Canada",region:"North America",status:"Active",regulatorIds:["reg-4"],regulatorNames:["AGCO / iGaming Ontario"],notes:"Canada's first provincially regulated iGaming market, launched April 2022. Rapidly became one of North America's largest markets.",markets:[{name:"Canada (Ontario)",slug:"canada-ontario"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Launched April 2022","40+ licensed operators in year one","FINTRAC AML registration required"]},{id:"jur-5",slug:"sweden",name:"Sweden",region:"Europe",status:"Active",regulatorIds:["reg-5"],regulatorNames:["Spelinspektionen (SGA)"],notes:"Re-regulated in January 2019 with the Swedish Gambling Act. Known for restrictive bonus rules and the Spelpaus self-exclusion system.",markets:[{name:"Sweden",slug:"sweden"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Welcome bonus only (no reload bonuses)","Spelpaus mandatory self-exclusion","3-second delay on in-play bets"]},{id:"jur-6",slug:"curacao",name:"Curaçao",region:"Caribbean",status:"Reforming",regulatorIds:["reg-7"],regulatorNames:["Curaçao Gaming Control Board (GCB)"],notes:"Undergoing major reform from the legacy sublicense system to a modern regulatory framework under the GCB. Transition period through 2025–2026.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Reform ordinance enacted 2023","Legacy sublicenses being phased out","Enhanced KYC/AML requirements"]},{id:"jur-7",slug:"gibraltar",name:"Gibraltar",region:"Europe",status:"Active",regulatorIds:["reg-8"],regulatorNames:["Gibraltar Gambling Commissioner (GGC)"],notes:"One of the original online gambling jurisdictions. Home to major operator headquarters including bet365 and 888.",markets:[{name:"Gibraltar",slug:"gibraltar"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Major operator HQ hub","Business-friendly regulation","Physical presence required"]},{id:"jur-8",slug:"spain",name:"Spain",region:"Europe",status:"Active",regulatorIds:["reg-9"],regulatorNames:["DGOJ"],notes:"Strict advertising restrictions introduced in 2021 under Royal Decree 958/2020 have significantly impacted operator marketing strategies.",markets:[{name:"Spain",slug:"spain"}],gamblingSectors:["Casino","Sportsbook","Poker"],keyFacts:["Near-total advertising ban since 2021","RGIAJ self-exclusion register","Strict bonus limitations"]},{id:"jur-9",slug:"isle-of-man",name:"Isle of Man",region:"Europe",status:"Active",regulatorIds:["reg-10"],regulatorNames:["Gambling Supervision Commission (GSC)"],notes:"Pioneer in e-gaming regulation. Home to major B2B suppliers and platform providers.",markets:[],gamblingSectors:["Casino","Sportsbook","Poker","Lottery"],keyFacts:["One of the first online gaming jurisdictions","Strong B2B supplier presence","Tax-efficient structure"]},{id:"jur-10",slug:"philippines",name:"Philippines",region:"Asia-Pacific",status:"Reforming",regulatorIds:["reg-11"],regulatorNames:["PAGCOR"],notes:"Historically a major hub for offshore gaming operations (POGO). Significant regulatory reforms and restrictions have been introduced.",markets:[{name:"Philippines",slug:"philippines"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["POGO sector curtailed","Major live dealer studio hub","Government ownership of PAGCOR"]},{id:"jur-11",slug:"new-jersey-us",name:"New Jersey, USA",region:"North America",status:"Active",regulatorIds:["reg-6"],regulatorNames:["NJ Division of Gaming Enforcement"],notes:"The first US state to launch legal online casino (2013) and among the first for sports betting post-PASPA repeal (2018).",markets:[{name:"United States",slug:"united-states"}],gamblingSectors:["Casino","Sportsbook"],keyFacts:["Pioneer US online gambling state","Casino partnership required","Strict geolocation requirements"]}],aq=[{value:"name",label:"Name (A-Z)"},{value:"status",label:"Status"},{value:"regulators",label:"Most regulators"}],N9={region:[],status:[],sectors:[]},sq=({jurisdictionsData:t})=>{const[a]=p.useState(t??tq),[s,n]=p.useState(!0),[r,i]=p.useState(1),[l,c]=p.useState(9),[h,d]=p.useState(""),[u,y]=p.useState("name"),[x,m]=p.useState("grid"),[g,f]=p.useState(N9);p.useEffect(()=>{const L=setTimeout(()=>n(!1),300);return()=>clearTimeout(L)},[]);const k=p.useMemo(()=>{const L=w=>Array.from(new Set(w)).sort();return[{key:"region",label:"Region",type:"checkbox",options:L(a.map(w=>w.region)).map(w=>({value:w,label:w}))},{key:"status",label:"Status",type:"checkbox",options:L(a.map(w=>w.status)).map(w=>({value:w,label:w}))},{key:"sectors",label:"Gambling Sectors",type:"checkbox",options:L(a.flatMap(w=>w.gamblingSectors)).map(w=>({value:w,label:w}))}]},[a]),v=p.useMemo(()=>Object.entries(g).flatMap(([L,w])=>w.map(j=>({key:L,label:L.charAt(0).toUpperCase()+L.slice(1),value:j,onRemove:()=>f(I=>({...I,[L]:(I[L]??[]).filter(T=>T!==j)}))}))),[g]),N=p.useMemo(()=>{const L=h.trim().toLowerCase();return a.filter(w=>!(L&&!`${w.name} ${w.region} ${w.regulatorNames.join(" ")}`.toLowerCase().includes(L)||g.region.length&&!g.region.includes(w.region)||g.status.length&&!g.status.includes(w.status)||g.sectors.length&&!g.sectors.every(j=>w.gamblingSectors.includes(j))))},[g,a,h]),M=p.useMemo(()=>{const L=[...N];return L.sort((w,j)=>{switch(u){case"status":return w.status.localeCompare(j.status);case"regulators":return j.regulatorNames.length-w.regulatorNames.length;default:return w.name.localeCompare(j.name)}}),L},[N,u]);p.useEffect(()=>{i(1)},[h,g,l]);const b=Math.max(1,Math.ceil(M.length/l)),C=M.slice((r-1)*l,r*l),S=()=>f(N9);return e.jsx(Za,{title:"Jurisdictions",description:"Explore regulated gambling jurisdictions, their status, and governing authorities.",search:{value:h,onChange:d,onSubmit:d,onClear:()=>d(""),placeholder:"Search jurisdictions"},filters:k,filterValues:g,onFilterChange:(L,w)=>f(j=>({...j,[L]:w})),onClearFilters:S,activeFilters:v,sort:{value:u,options:aq,onChange:y},viewMode:x,onViewModeChange:m,pagination:{page:r,pageSize:l,totalPages:b,totalCount:M.length,toolbarTotalCount:a.length,toolbarTitle:"Jurisdictions",toolbarItemLabel:"jurisdictions",onPageChange:i,onPageSizeChange:L=>{c(L),i(1)}},resultsClassName:x==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:s?e.jsx(Wa,{totalColumns:l}):C.length?C.map(L=>e.jsx(eq,{...L,viewMode:x},L.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(Fe,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No jurisdictions found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:S,children:"Clear all filters"})]})})},nq=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(""),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState("EUR"),[m,g]=p.useState(""),[f,k]=p.useState(!1),[v,N]=p.useState(!1),M=n.trim().length>=2&&i.trim().length>=5&&c.trim().length>=30&&m,b=()=>{M&&(s==null||s({companyName:n.trim(),title:i.trim(),body:c.trim(),amount:d.trim()||void 0,currency:d.trim()?y:void 0,relationship:m,isAnonymous:f}),N(!0))},C=()=>{r(""),l(""),h(""),u(""),x("EUR"),g(""),k(!1),N(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:C,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:v?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Complaint Submitted"}),e.jsx(it,{className:"text-center",children:"Your complaint has been received. We will review it and notify the company. You'll receive updates on the resolution process within 48 hours."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:C,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-destructive/10 flex items-center justify-center mb-2",children:e.jsx(ea,{className:"w-6 h-6 text-destructive"})}),e.jsx(Le,{children:"Submit a Complaint"}),e.jsx(it,{children:"File a formal complaint against an iGaming company. All complaints are reviewed before publishing and the company will be notified."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Company Name *"}),e.jsx(ae,{placeholder:"Enter the company name",value:n,onChange:S=>r(S.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Your Relationship *"}),e.jsxs(Ye,{value:m,onValueChange:g,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"How do you know this company?"})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"affiliate",children:"Affiliate / Partner"}),e.jsx(me,{value:"operator",children:"Operator / Client"}),e.jsx(me,{value:"employee",children:"Current/Former Employee"}),e.jsx(me,{value:"streamer",children:"Streamer / Influencer"}),e.jsx(me,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Complaint Title *"}),e.jsx(ae,{placeholder:"Briefly describe the issue",value:i,onChange:S=>l(S.target.value),maxLength:150})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Describe the Issue *"," ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 30 characters)"})]}),e.jsx(rt,{placeholder:"Provide detailed information about your complaint, including dates, communications, and any evidence...",value:c,onChange:S=>h(S.target.value),rows:5,maxLength:3e3})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Amount ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(ae,{type:"number",placeholder:"e.g. 5000",value:d,onChange:S=>u(S.target.value),min:0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Currency"}),e.jsxs(Ye,{value:y,onValueChange:x,children:[e.jsx(Ue,{children:e.jsx(Je,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"EUR",children:"EUR"}),e.jsx(me,{value:"USD",children:"USD"}),e.jsx(me,{value:"GBP",children:"GBP"}),e.jsx(me,{value:"BTC",children:"BTC"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your identity won't be revealed publicly"})]}),e.jsx(vt,{checked:f,onCheckedChange:k})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this complaint is based on genuine experience. False or malicious complaints may result in account action."})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:C,children:"Cancel"}),e.jsx(P,{variant:"destructive",onClick:b,disabled:!M,children:"Submit Complaint"})]})]})})})},rq=[{id:"cmp-1",companyId:"alpha-affiliates",companySlug:"alpha-affiliates",companyName:"Alpha Affiliates",title:"Payment Delayed",body:"I'm posting because the situation with Alpha Affiliates (ViciBet) is unacceptable. Payments have been delayed for over 3 months with no clear communication from their team despite multiple follow-ups.",amount:"884",currency:"EUR",status:"unresolved",createdAt:"2026-02-16T10:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-2",companyId:"duelbits",companySlug:"duelbits",companyName:"Duelbits",title:"Unpaid Affiliate Commissions",body:"I am filing this complaint because Duelbits has failed to pay my affiliate commissions for the last two months. Despite providing all required documentation and following their payment process, I have received no response.",amount:"6076",currency:"USD",status:"resolved",createdAt:"2026-01-20T14:30:00Z",authorDisplayName:"Mike D.",isAnonymous:!1},{id:"cmp-3",companyId:"amigomedia",companySlug:"amigomedia",companyName:"AmigoMedia",title:"CPA Traffic Fraud Warning",body:"We are posting this as a formal, transparent complaint regarding our CPA campaign with AmigoMedia. After investigation, we found significant traffic quality issues including bot traffic and fake registrations.",amount:"4000",currency:"EUR",status:"resolved",createdAt:"2025-12-15T09:15:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-4",companyId:"eurogesee",companySlug:"eurogesee",companyName:"EUrogesee",title:"Complaint against EUrogesee for not abiding by the deal's conditions",body:"On December 5th we agreed on a 5 stream deal with the streamer. After the first two streams, EUrogesee changed the terms unilaterally without our consent, violating the original agreement.",amount:"200",currency:"EUR",status:"resolved",createdAt:"2025-12-01T16:00:00Z",authorDisplayName:"StreamerPro",isAnonymous:!1},{id:"cmp-5",companyId:"chilistakes",companySlug:"chilistakes",companyName:"Chilistakes",title:"Commission not fulfilled",body:"Following our initial contact in mid-September, we formalized our partnership agreement. Despite meeting all KPIs and delivering quality traffic, Chilistakes has not paid the agreed commission structure.",amount:"2880",currency:"EUR",status:"unresolved",createdAt:"2025-11-15T11:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-6",companyId:"streamer-rustyk",companySlug:"streamer-rustyk",companyName:"Streamer Rustyk",title:"Using fake account to boost results and taking payment but not streaming",body:"The streamer tried to boost his FTDs by creating fake accounts. After receiving the initial payment, they stopped streaming entirely and became unresponsive to all communication attempts.",amount:"770",currency:"EUR",status:"resolved",createdAt:"2025-11-10T08:30:00Z",authorDisplayName:"CasinoOps Team",isAnonymous:!1},{id:"cmp-7",companyId:"betmax-partners",companySlug:"betmax-partners",companyName:"BetMax Partners",title:"Revenue share calculation discrepancy",body:"We have discovered significant discrepancies in our revenue share calculations over the past 4 months. The reported net revenue does not match our own tracking data, resulting in underpayment of commissions.",amount:"3200",currency:"USD",status:"open",createdAt:"2026-02-05T12:00:00Z",authorDisplayName:"Anonymous",isAnonymous:!0},{id:"cmp-8",companyId:"lucky-streak",companySlug:"lucky-streak",companyName:"Lucky Streak",title:"Integration support abandoned mid-project",body:"After signing a contract and beginning integration, Lucky Streak's technical support became completely unresponsive. We've invested significant development resources and cannot proceed without their API documentation updates.",amount:"15000",currency:"EUR",status:"open",createdAt:"2026-01-28T10:00:00Z",authorDisplayName:"DevTeam Lead",isAnonymous:!1}],AI={resolved:{label:"RESOLVED",color:"text-gaming-success",bgColor:"bg-gaming-success",icon:Tt},open:{label:"OPEN",color:"text-gaming-warning",bgColor:"bg-gaming-warning",icon:$t},unresolved:{label:"UNRESOLVED",color:"text-destructive",bgColor:"bg-destructive",icon:Na}},mN=9,iq=({complaintsData:t,onSubmitComplaint:a})=>{const[s,n]=p.useState("all"),[r,i]=p.useState("newest"),[l,c]=p.useState(1),[h,d]=p.useState(!1),u=t??rq,y=p.useCallback(k=>{a==null||a(k),console.log("[Complaints] Submit complaint:",k)},[a]),x=p.useMemo(()=>{let k=[...u];switch(s!=="all"&&(k=k.filter(v=>v.status===s)),r){case"newest":k.sort((v,N)=>new Date(N.createdAt).getTime()-new Date(v.createdAt).getTime());break;case"oldest":k.sort((v,N)=>new Date(v.createdAt).getTime()-new Date(N.createdAt).getTime());break;case"amount-high":k.sort((v,N)=>(Number(N.amount)||0)-(Number(v.amount)||0));break;case"amount-low":k.sort((v,N)=>(Number(v.amount)||0)-(Number(N.amount)||0));break}return k},[u,s,r]),m=Math.ceil(x.length/mN),g=x.slice((l-1)*mN,l*mN),f=p.useMemo(()=>{const k={resolved:0,open:0,unresolved:0};return u.forEach(v=>k[v.status]++),k},[a]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-destructive/10 flex items-center justify-center",children:e.jsx(ea,{className:"w-5 h-5 text-destructive"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Complaints"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Transparency matters. Browse and submit complaints about iGaming companies. We mediate disputes to help both parties reach a fair resolution."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"lg:col-span-3",children:[g.length===0?e.jsx(U,{children:e.jsxs(W,{className:"py-16 text-center",children:[e.jsx(ea,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No complaints found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:g.map(k=>e.jsx(oq,{complaint:k},k.id))}),m>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:m},(k,v)=>e.jsx(P,{variant:l===v+1?"accent":"outline",size:"sm",onClick:()=>c(v+1),children:v+1},v))})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(P,{variant:"accent",className:"w-full gap-2",onClick:()=>d(!0),children:[e.jsx(ea,{className:"w-4 h-4"}),"Submit Complaint"]}),e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsx("button",{onClick:()=>{n("all"),c(1)},className:`text-sm font-medium w-full text-left px-2 py-1 rounded ${s==="all"?"text-accent":"text-muted-foreground hover:text-foreground"}`,children:"All complaints"}),["resolved","open","unresolved"].map(k=>{const v=AI[k];return e.jsxs("button",{onClick:()=>{n(k),c(1)},className:`flex items-center gap-2 text-sm w-full text-left px-2 py-1 rounded ${s===k?"text-accent font-medium":"text-muted-foreground hover:text-foreground"}`,children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${v.bgColor}`}),v.label," (",f[k],")"]},k)}),s!=="all"&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full mt-2",onClick:()=>{n("all"),c(1)},children:"Clear filter"})]})}),e.jsx(U,{children:e.jsxs(W,{className:"p-4",children:[e.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Sort by"}),e.jsxs(Ye,{value:r,onValueChange:k=>{i(k),c(1)},children:[e.jsx(Ue,{children:e.jsx(Je,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"newest",children:"Newest"}),e.jsx(me,{value:"oldest",children:"Oldest"}),e.jsx(me,{value:"amount-high",children:"Highest amount"}),e.jsx(me,{value:"amount-low",children:"Lowest amount"})]})]})]})})]})]})]}),e.jsx(nq,{open:h,onOpenChange:d,onSubmit:y}),e.jsx(cl,{})]})},oq=({complaint:t})=>{const a=AI[t.status],s=a.icon;return e.jsxs(U,{className:"overflow-hidden border-border/50 hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:`${a.bgColor} py-6 flex flex-col items-center justify-center text-white`,children:[e.jsx(s,{className:"w-10 h-10 mb-2"}),e.jsx("span",{className:"font-bold text-sm tracking-wider",children:a.label})]}),e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-sm text-foreground line-clamp-2 leading-snug",children:[t.title," – ",t.companyName]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-3 leading-relaxed",children:t.body}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[t.amount&&e.jsxs("span",{className:"text-sm font-semibold text-foreground",children:[t.amount," ",t.currency]}),e.jsxs(O,{variant:"outline",className:`text-xs ${a.color} border-current`,children:["STATUS: ",a.label]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Gt,{className:"w-3 h-3"}),CC(new Date(t.createdAt),{addSuffix:!0})]})]})]})},lq={sm:"w-3.5 h-3.5",md:"w-5 h-5",lg:"w-6 h-6"},Gc=({rating:t,maxRating:a=5,size:s="md",interactive:n=!1,onRatingChange:r})=>e.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:a},(i,l)=>{const c=l<t;return e.jsx("button",{type:"button",disabled:!n,onClick:()=>n&&(r==null?void 0:r(l+1)),className:n?"cursor-pointer hover:scale-110 transition-transform":"cursor-default",children:e.jsx(tt,{className:`${lq[s]} ${c?"fill-gaming-gold text-gaming-gold":"fill-transparent text-muted-foreground/30"}`})},l)})}),cq=({open:t,onOpenChange:a,onSubmit:s})=>{const[n,r]=p.useState(""),[i,l]=p.useState(0),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState(""),[m,g]=p.useState(""),[f,k]=p.useState(""),[v,N]=p.useState(!1),[M,b]=p.useState(!1),C=n.trim().length>=2&&i>0&&c.trim().length>=5&&d.trim().length>=20&&f,S=()=>{!C||i===0||(s==null||s({companyName:n.trim(),title:c.trim(),body:d.trim(),rating:i,pros:y.trim()||void 0,cons:m.trim()||void 0,relationship:f,isAnonymous:v}),b(!0))},L=()=>{r(""),l(0),h(""),u(""),x(""),g(""),k(""),N(!1),b(!1),a(!1)};return e.jsx(st,{open:t,onOpenChange:L,children:e.jsx(Xe,{className:"sm:max-w-[520px]",children:M?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-gaming-success/10 flex items-center justify-center mx-auto mb-4",children:e.jsx(Tt,{className:"w-8 h-8 text-gaming-success"})}),e.jsx(Le,{children:"Review Submitted!"}),e.jsx(it,{className:"text-center",children:"Thank you for your review. It will be published after moderation (usually within 24-48 hours)."})]}),e.jsx(at,{children:e.jsx(P,{variant:"accent",onClick:L,className:"w-full",children:"Done"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-accent/20 to-primary/20 flex items-center justify-center mb-2",children:e.jsx(ft,{className:"w-6 h-6 text-accent"})}),e.jsx(Le,{children:"Write a Review"}),e.jsx(it,{children:"Share your experience with an iGaming company. All reviews are moderated before publishing."})]}),e.jsxs("div",{className:"space-y-4 py-2 max-h-[60vh] overflow-y-auto",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Company Name *"}),e.jsx(ae,{placeholder:"Enter the company you're reviewing",value:n,onChange:w=>r(w.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Overall Rating *"}),e.jsx(Gc,{rating:i,size:"lg",interactive:!0,onRatingChange:w=>l(w)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Your Relationship *"}),e.jsxs(Ye,{value:f,onValueChange:k,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"How do you know this company?"})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"employee",children:"Current/Former Employee"}),e.jsx(me,{value:"client",children:"Client / Customer"}),e.jsx(me,{value:"partner",children:"Business Partner"}),e.jsx(me,{value:"competitor",children:"Industry Peer"}),e.jsx(me,{value:"other",children:"Other"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Review Title *"}),e.jsx(ae,{placeholder:"Summarize your experience in a few words",value:c,onChange:w=>h(w.target.value),maxLength:120})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Your Review * ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(min 20 characters)"})]}),e.jsx(rt,{placeholder:"Share details about your experience...",value:d,onChange:w=>u(w.target.value),rows:4,maxLength:2e3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Pros ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(rt,{placeholder:"What did you like?",value:y,onChange:w=>x(w.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Cons ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(optional)"})]}),e.jsx(rt,{placeholder:"What could be improved?",value:m,onChange:w=>g(w.target.value),rows:2,maxLength:500})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your name won't be shown publicly"})]}),e.jsx(vt,{checked:v,onCheckedChange:N})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"By submitting, you confirm this review is based on genuine experience and complies with our community guidelines."})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:L,children:"Cancel"}),e.jsx(P,{variant:"accent",onClick:S,disabled:!C,children:"Submit Review"})]})]})})})},dq=[{id:"rev-1",companyId:"evolution",companySlug:"evolution",author:{id:"u1",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Outstanding Announcement Video by Evolution",body:"Evolution delivered an outstanding announcement video for our ICE Barcelona 2026 campaign. Their attention to detail, creativity, and professionalism made the entire process seamless. Extremely smooth to work with. We couldn't be happier with the result.",rating:5,pros:"Great culture, competitive salary, innovative products",cons:"Fast-paced environment can be demanding",status:"published",reactions:{useful:12,notUseful:1},createdAt:"2026-01-15T10:00:00Z",isVerified:!0,helpfulCount:12},{id:"rev-2",companyId:"evolution",companySlug:"evolution",author:{id:"u2",displayName:"Sarah M.",isAnonymous:!1,jobTitle:"Product Manager",relationship:"client"},title:"Reliable B2B partner for live casino",body:"We've been working with Evolution for over 3 years. Their live casino platform is best-in-class and their integration support is excellent. API documentation could be improved but overall a great partner.",rating:4,pros:"Best live casino product, reliable platform, great support team",cons:"API documentation could be more detailed",status:"published",reactions:{useful:8,notUseful:2},createdAt:"2025-11-20T14:30:00Z",isVerified:!0,helpfulCount:8},{id:"rev-3",companyId:"evolution",companySlug:"evolution",author:{id:"u3",displayName:"James K.",isAnonymous:!1,jobTitle:"CTO",relationship:"partner"},title:"Solid technology but expensive",body:"The technology is world-class and their game portfolio is unmatched. However, the pricing can be prohibitive for smaller operators. Great for established brands that can afford premium rates.",rating:3,pros:"World-class technology, huge game portfolio",cons:"High pricing, long contract negotiations",status:"published",reactions:{useful:15,notUseful:3},createdAt:"2025-09-05T09:15:00Z",isVerified:!1,helpfulCount:15},{id:"rev-4",companyId:"pragmatic-play",companySlug:"pragmatic-play",author:{id:"u4",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Great place to grow your career",body:"Pragmatic Play offers incredible learning opportunities. The team is talented and the company is growing fast. Work-life balance could be better during peak release periods.",rating:4,pros:"Career growth, talented team, innovative products",cons:"Work-life balance during crunch periods",status:"published",reactions:{useful:6,notUseful:0},createdAt:"2026-02-01T11:00:00Z",isVerified:!0,helpfulCount:6},{id:"rev-5",companyId:"betsson",companySlug:"betsson",author:{id:"u5",displayName:"Maria L.",isAnonymous:!1,jobTitle:"Affiliate Manager",relationship:"partner"},title:"Excellent affiliate program",body:"Betsson's affiliate program is one of the best in the industry. Transparent reporting, timely payments, and a dedicated affiliate manager who actually responds. Highly recommended for affiliates.",rating:5,pros:"Transparent reporting, timely payments, dedicated support",cons:"Could offer more creative materials",status:"published",reactions:{useful:20,notUseful:1},createdAt:"2025-12-10T16:45:00Z",isVerified:!0,helpfulCount:20},{id:"rev-6",companyId:"softswiss",companySlug:"softswiss",author:{id:"u6",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Innovative tech company with great perks",body:"SOFTSWISS is one of the best employers in the iGaming B2B space. The engineering culture is strong, Agile is done properly, and remote work is genuinely supported. Salaries are competitive for the region. Only downside is some bureaucracy as the company scales.",rating:5,pros:"Remote-friendly, strong engineering culture, competitive pay",cons:"Growing bureaucracy, some slow decision-making",status:"published",reactions:{useful:18,notUseful:2},createdAt:"2026-02-10T09:00:00Z",isVerified:!0,helpfulCount:18},{id:"rev-7",companyId:"softswiss",companySlug:"softswiss",author:{id:"u7",displayName:"Alex R.",isAnonymous:!1,jobTitle:"Integration Manager",relationship:"client"},title:"Reliable platform, responsive support",body:"We migrated our casino to SOFTSWISS last year. The migration was smooth, the game aggregator is excellent, and their support team is very responsive. The back-office tools could use a UI refresh but functionally they're solid.",rating:4,pros:"Smooth integration, vast game aggregator, responsive support",cons:"Back-office UI feels dated",status:"published",reactions:{useful:9,notUseful:1},createdAt:"2025-10-22T13:00:00Z",isVerified:!0,helpfulCount:9},{id:"rev-8",companyId:"softswiss",companySlug:"softswiss",author:{id:"u8",displayName:"Dmitry V.",isAnonymous:!1,jobTitle:"COO",relationship:"partner"},title:"Strong crypto-first platform",body:"If you're looking for the best crypto casino platform, SOFTSWISS is the clear leader. Their crypto payment processing is seamless and they understand the regulatory nuances of crypto gambling better than anyone else in the space.",rating:5,pros:"Best-in-class crypto support, regulatory expertise, scalable infrastructure",cons:"Premium pricing for smaller operators",status:"published",reactions:{useful:14,notUseful:0},createdAt:"2025-08-15T10:30:00Z",isVerified:!1,helpfulCount:14},{id:"rev-9",companyId:"microgaming",companySlug:"microgaming",author:{id:"u9",displayName:"Anonymous",isAnonymous:!0,relationship:"employee"},title:"Legacy brand with a lot of history",body:"Microgaming has a rich history in iGaming. The brand carries a lot of weight and the game portfolio is huge. However, the company feels a bit behind on modern tech compared to newer competitors.",rating:3,pros:"Brand recognition, massive game library, stable company",cons:"Slower innovation, legacy tech stack",status:"published",reactions:{useful:7,notUseful:3},createdAt:"2025-07-20T08:00:00Z",isVerified:!0,helpfulCount:7},{id:"rev-10",companyId:"playtech",companySlug:"playtech",author:{id:"u10",displayName:"Lisa T.",isAnonymous:!1,jobTitle:"Head of Content",relationship:"client"},title:"Comprehensive omni-channel solution",body:"Playtech offers one of the most comprehensive omni-channel solutions in the market. Their IMS platform is powerful and their live casino rivals Evolution. The integration process is lengthy though and requires significant resources.",rating:4,pros:"Omni-channel platform, powerful IMS, strong live casino",cons:"Complex integration, lengthy onboarding",status:"published",reactions:{useful:11,notUseful:2},createdAt:"2026-01-05T15:00:00Z",isVerified:!0,helpfulCount:11},{id:"rev-11",companyId:"betconstruct",companySlug:"betconstruct",author:{id:"u11",displayName:"Anonymous",isAnonymous:!0,relationship:"client"},title:"Good sportsbook, needs UX work",body:"BetConstruct's sportsbook platform is feature-rich and covers a wide range of markets. The odds engine is competitive. However, the front-end templates need modernization and the documentation could be clearer.",rating:3,pros:"Feature-rich sportsbook, competitive odds, good market coverage",cons:"Outdated UX templates, unclear documentation",status:"published",reactions:{useful:5,notUseful:1},createdAt:"2025-12-28T11:00:00Z",isVerified:!1,helpfulCount:5},{id:"rev-12",companyId:"yggdrasil",companySlug:"yggdrasil",author:{id:"u12",displayName:"Tom H.",isAnonymous:!1,jobTitle:"Game Designer",relationship:"employee"},title:"Creative freedom and cutting-edge tools",body:"Working at Yggdrasil as a game designer was an amazing experience. The GATI framework gives studios real creative freedom. The company culture genuinely celebrates innovation and quality over quantity.",rating:5,pros:"Creative freedom, innovative GATI framework, quality-first culture",cons:"Smaller scale compared to the big players",status:"published",reactions:{useful:16,notUseful:0},createdAt:"2026-02-18T10:00:00Z",isVerified:!0,helpfulCount:16}],hq=()=>dq.filter(t=>t.status==="published"),pN=12,uq=({reviewsData:t,onLeaveReview:a})=>{const s=p.useMemo(()=>t??hq(),[t]),[n,r]=p.useState(""),[i,l]=p.useState("newest"),[c,h]=p.useState("all"),[d,u]=p.useState(1),[y,x]=p.useState(!1),m=p.useCallback(N=>{a==null||a(N),console.log("[Reviews] Leave review:",N)},[a]),g=p.useMemo(()=>{let N=[...s];if(n.trim()){const M=n.toLowerCase();N=N.filter(b=>b.title.toLowerCase().includes(M)||b.body.toLowerCase().includes(M)||b.companySlug.toLowerCase().includes(M))}switch(c!=="all"&&(N=N.filter(M=>M.rating===Number(c))),i){case"newest":N.sort((M,b)=>new Date(b.createdAt).getTime()-new Date(M.createdAt).getTime());break;case"oldest":N.sort((M,b)=>new Date(M.createdAt).getTime()-new Date(b.createdAt).getTime());break;case"highest":N.sort((M,b)=>b.rating-M.rating);break;case"lowest":N.sort((M,b)=>M.rating-b.rating);break;case"most-helpful":N.sort((M,b)=>b.helpfulCount-M.helpfulCount);break}return N},[s,n,i,c]),f=Math.ceil(g.length/pN),k=g.slice((d-1)*pN,d*pN),v={employee:"Employee",client:"Client",partner:"Partner",competitor:"Industry Peer",other:"Other"};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(ft,{className:"w-5 h-5 text-accent"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"iGaming Reviews"})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"See what others are saying. Read honest reviews from employees, clients, and partners across the iGaming industry. Find trusted companies and share your own experience."}),e.jsxs(P,{variant:"accent",size:"sm",className:"mt-3 gap-1.5",onClick:()=>x(!0),children:[e.jsx(ft,{className:"w-4 h-4"}),"Add review"]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(wt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ae,{placeholder:"Search reviews by company, title, or content...",value:n,onChange:N=>{r(N.target.value),u(1)},className:"pl-10"})]}),e.jsxs(Ye,{value:c,onValueChange:N=>{h(N),u(1)},children:[e.jsx(Ue,{className:"w-[150px]",children:e.jsx(Je,{placeholder:"Rating"})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"all",children:"All ratings"}),e.jsx(me,{value:"5",children:"5 stars"}),e.jsx(me,{value:"4",children:"4 stars"}),e.jsx(me,{value:"3",children:"3 stars"}),e.jsx(me,{value:"2",children:"2 stars"}),e.jsx(me,{value:"1",children:"1 star"})]})]}),e.jsxs(Ye,{value:i,onValueChange:N=>{l(N),u(1)},children:[e.jsx(Ue,{className:"w-[180px]",children:e.jsx(Je,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"newest",children:"Newest reviews"}),e.jsx(me,{value:"oldest",children:"Oldest reviews"}),e.jsx(me,{value:"highest",children:"Highest rated"}),e.jsx(me,{value:"lowest",children:"Lowest rated"}),e.jsx(me,{value:"most-helpful",children:"Most helpful"})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[g.length," review",g.length!==1?"s":""]}),k.length===0?e.jsx(U,{children:e.jsxs(W,{className:"py-16 text-center",children:[e.jsx(ft,{className:"w-12 h-12 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No reviews found matching your criteria."})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:k.map(N=>e.jsx(mq,{review:N,relationshipLabels:v},N.id))}),f>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:f},(N,M)=>e.jsx(P,{variant:d===M+1?"accent":"outline",size:"sm",onClick:()=>u(M+1),children:M+1},M))})]}),e.jsx(cq,{open:y,onOpenChange:x,onSubmit:m}),e.jsx(cl,{})]})},mq=({review:t,relationshipLabels:a})=>e.jsx(U,{className:"border-border/50 hover:shadow-md transition-shadow",children:e.jsxs(W,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-secondary flex items-center justify-center flex-shrink-0",children:e.jsx(ss,{className:"w-5 h-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm text-foreground",children:t.author.displayName}),t.isVerified&&e.jsx(Ee,{className:"w-3.5 h-3.5 text-gaming-success"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.author.relationship&&e.jsx("span",{children:a[t.author.relationship]??t.author.relationship}),t.author.jobTitle&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.author.jobTitle})]})]})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:CC(new Date(t.createdAt),{addSuffix:!0})})]}),e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs(O,{variant:"secondary",className:"gap-1 text-xs",children:[e.jsx(Se,{className:"w-3 h-3"}),t.companySlug.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())]})}),e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm line-clamp-1",children:t.title}),e.jsx(Gc,{rating:t.rating,size:"sm"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed line-clamp-3",children:t.body}),(t.pros||t.cons)&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[t.pros&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-gaming-success uppercase tracking-wide",children:"Pros"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.pros})]}),t.cons&&e.jsxs("div",{className:"text-xs",children:[e.jsx("span",{className:"font-medium text-destructive uppercase tracking-wide",children:"Cons"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 line-clamp-2",children:t.cons})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-3 border-t border-border/50",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(Ll,{className:"w-3 h-3"}),"Useful ",t.helpfulCount>0&&`(${t.helpfulCount})`]}),e.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-accent gap-1.5 h-7 text-xs",children:[e.jsx(as,{className:"w-3 h-3"}),"Share"]}),e.jsx(P,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive gap-1.5 h-7 text-xs ml-auto",children:e.jsx(Yo,{className:"w-3 h-3"})})]})]})}),ya=ie.forwardRef(({className:t,value:a,...s},n)=>e.jsx(jN.Root,{ref:n,className:oe("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...s,children:e.jsx(jN.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));ya.displayName=jN.Root.displayName;function C9(t=window.location.pathname){const a=t.replace(/^\/+|\/+$/g,"").split("/"),s=a.findIndex(r=>r.toLowerCase()==="jobs");if(s===-1)return null;const n=a[s+1];return n?decodeURIComponent(n):null}function SC(){const[t,a]=p.useState(()=>C9());return p.useEffect(()=>{const s=()=>a(C9());return window.addEventListener("popstate",s),()=>window.removeEventListener("popstate",s)},[]),t}const pq={Regulated:"bg-gaming-success/10 text-gaming-success",Restricted:"bg-destructive/10 text-destructive",Emerging:"bg-gaming-warning/10 text-gaming-warning"},yq={Low:"text-muted-foreground",Medium:"text-gaming-warning",High:"text-gaming-success"},xq=({marketData:t})=>{const a=SC(),s=p.useMemo(()=>t??(a?Uz(a):void 0),[t,a]);return s?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/markets/v2"),children:[e.jsx(La,{className:"w-4 h-4"})," All Markets"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(O,{className:`text-xs ${pq[s.status]}`,children:s.status}),s.isFeatured&&e.jsx(O,{className:"bg-gaming-gold text-foreground text-xs",children:"Featured"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.overview}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.badges.map(n=>e.jsx(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:n.label},n.label))})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[e.jsx(td,{icon:Ce,label:"Active Jobs",value:s.stats.jobsCount.toLocaleString()}),e.jsx(td,{icon:Se,label:"Companies",value:s.stats.companiesCount.toLocaleString()}),e.jsx(td,{icon:Al,label:"Remote Ratio",value:`${s.stats.remoteRatio}%`}),e.jsx(td,{icon:Ts,label:`Median (${s.salaryPulse.currency})`,value:s.salaryPulse.medianAnnual.toLocaleString()})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 mt-6",children:[e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(Ba,{className:"w-4 h-4"})," Get alerts for this market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(Ua,{className:"w-4 h-4"})," Follow market"]}),e.jsxs(P,{variant:"secondary",size:"sm",className:"gap-1.5",children:[e.jsx(ft,{className:"w-4 h-4"})," I work here"]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Xo,{className:`w-5 h-5 ${yq[s.stats.hiringIntensity]}`}),"Hiring Now",e.jsxs(O,{variant:"secondary",className:"text-xs ml-auto",children:[s.stats.jobsCount," jobs"]})]})}),e.jsxs(W,{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-3 uppercase tracking-wide",children:"Trending Role Families"}),e.jsx("div",{className:"space-y-3",children:s.trendingRoles.map(n=>e.jsx(gq,{role:n,maxCount:Math.max(...s.trendingRoles.map(r=>r.count))},n.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"w-5 h-5 text-accent"}),"Top Employers"]})}),e.jsx(W,{children:e.jsx("div",{className:"space-y-3",children:s.topEmployers.map((n,r)=>e.jsx(fq,{employer:n,rank:r+1},n.slug))})})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Ts,{className:"w-5 h-5 text-gaming-gold"}),"Salary Pulse"]})}),e.jsxs(W,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-4 text-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMin.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Min (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-accent",children:s.salaryPulse.medianAnnual.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Median (",s.salaryPulse.currency,")"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:s.salaryPulse.rangeMax.toLocaleString()}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Max (",s.salaryPulse.currency,")"]})]})]}),e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:"By Role Family"}),e.jsx("div",{className:"space-y-2",children:s.salaryPulse.topRoleFamilies.map(n=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-foreground",children:n.role}),e.jsxs("span",{className:"font-semibold text-foreground",children:[n.median.toLocaleString()," ",s.salaryPulse.currency]})]},n.role))}),e.jsxs(P,{variant:"outline",size:"sm",className:"mt-4 w-full gap-1.5",children:["View full Salary Guide ",e.jsx(la,{className:"w-3.5 h-3.5"})]})]})]}),s.regulators.length>0&&e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Ta,{className:"w-5 h-5 text-gaming-success"}),"Regulation & Licensing"]})}),e.jsx(W,{className:"space-y-4",children:s.regulators.map(n=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(Ta,{className:"w-5 h-5 text-gaming-success flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:n.name}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-1.5",children:["Authority: ",n.authority]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.licenseTypes.map(r=>e.jsx(O,{variant:"outline",className:"text-xs",children:r},r))})]})]},n.slug))})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Market Info"}),e.jsx(Pn,{label:"Region",value:s.region}),e.jsx(Pn,{label:"Currency",value:s.currency}),s.timezone&&e.jsx(Pn,{label:"Timezone",value:s.timezone}),e.jsx(Pn,{label:"Population",value:`${s.populationM.toLocaleString()}M`}),e.jsx(Pn,{label:"Revenue Potential",value:`$${s.revenuePotentialM.toLocaleString()}M`}),e.jsx(Pn,{label:"Languages",value:s.languages.join(", ")}),e.jsx(Pn,{label:"Verticals",value:s.verticals.join(", ")})]})}),s.upcomingEvents.length>0&&e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Pa,{className:"w-4 h-4 text-accent"}),"Upcoming Events"]}),s.upcomingEvents.slice(0,3).map(n=>e.jsxs("div",{className:"flex items-start gap-3 py-2 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"w-10 h-10 rounded-lg bg-accent/10 flex flex-col items-center justify-center flex-shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-accent leading-none",children:new Date(n.date).toLocaleString("en",{month:"short"}).toUpperCase()}),e.jsx("span",{className:"text-sm font-bold text-foreground leading-none",children:new Date(n.date).getDate()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:n.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n.city})]})]},n.slug)),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"View all events"})]})}),e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(aa,{className:"w-4 h-4 text-accent"}),"Latest News"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:['News articles tagged with "',s.name,'" will appear here once available.']}),e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"Browse iGaming News"})]})})]})]})}),e.jsx(cl,{})]}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Dt,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Market Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The market you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/markets/v2"),children:"Browse Markets"})]})})},td=({icon:t,label:a,value:s})=>e.jsxs("div",{className:"bg-primary-foreground/10 rounded-lg p-3 text-center",children:[e.jsx(t,{className:"w-5 h-5 mx-auto mb-1 text-primary-foreground/70"}),e.jsx("p",{className:"text-xl font-bold text-primary-foreground",children:s}),e.jsx("p",{className:"text-xs text-primary-foreground/60",children:a})]}),gq=({role:t,maxCount:a})=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium text-foreground w-28 flex-shrink-0",children:t.roleFamily}),e.jsx(ya,{value:t.count/a*100,className:"h-2 flex-1"}),e.jsx("span",{className:"text-sm font-semibold text-foreground w-10 text-right",children:t.count}),e.jsxs("span",{className:`text-xs font-medium flex items-center gap-0.5 w-12 ${t.changePercent>=0?"text-gaming-success":"text-destructive"}`,children:[t.changePercent>=0?e.jsx(jt,{className:"w-3 h-3"}):e.jsx(jc,{className:"w-3 h-3"}),t.changePercent>=0?"+":"",t.changePercent,"%"]})]}),fq=({employer:t,rank:a})=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg hover:bg-secondary/50 transition-colors cursor-pointer",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center text-xs font-bold text-accent flex-shrink-0",children:a}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name}),t.isClaimed&&e.jsx(O,{variant:"outline",className:"text-xs text-gaming-success border-gaming-success/30",children:"Verified"})]}),t.employeeRange&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.employeeRange," employees"]})]}),e.jsxs(O,{variant:"secondary",className:"text-xs gap-1",children:[e.jsx(Ce,{className:"w-3 h-3"}),t.openRoles," roles"]})]}),Pn=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]}),kq={verified:{label:"Verified",className:"bg-gaming-success/10 text-gaming-success border-gaming-success/20"},"self-reported":{label:"Self-reported",className:"bg-gaming-warning/10 text-gaming-warning border-gaming-warning/20"},"community-suggested":{label:"Community",className:"bg-accent/10 text-accent border-accent/20"}},vq=({regulatorData:t})=>{const a=SC(),s=p.useMemo(()=>t??(a?Jz(a):void 0),[t,a]);return s?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("section",{className:"bg-gradient-to-br from-primary to-primary/80 text-primary-foreground py-10",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs(P,{variant:"ghost",size:"sm",className:"text-primary-foreground/70 hover:text-primary-foreground mb-4 gap-1.5",onClick:()=>window.location.replace("/regulators/v2"),children:[e.jsx(La,{className:"w-4 h-4"})," All Regulators"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.name}),e.jsx(O,{className:"bg-primary-foreground/20 text-primary-foreground border-primary-foreground/30",children:s.acronym}),s.isPrimary&&e.jsx(O,{className:"bg-gaming-gold text-foreground text-xs",children:"Primary Authority"})]}),e.jsx("p",{className:"text-primary-foreground/80 max-w-2xl mb-4",children:s.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(Dt,{className:"w-3 h-3 mr-1"})," ",s.country]}),e.jsxs(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:[e.jsx(Cl,{className:"w-3 h-3 mr-1"})," ",s.jurisdiction]}),e.jsxs(O,{variant:"outline",className:"text-xs border-primary-foreground/30 text-primary-foreground/90",children:["Est. ",s.establishedYear]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[s.website&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Rt,{className:"w-4 h-4"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"secondary",size:"sm",className:"gap-1.5",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Ha,{className:"w-4 h-4"})," Licensee Register"]})})]})]})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Cl,{className:"w-5 h-5 text-accent"})," Regulatory Scope"]})}),e.jsxs(W,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.scope}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"License Types:"}),s.licenseTypes.map(n=>e.jsx(O,{variant:"secondary",className:"text-xs",children:n},n))]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Sectors:"}),s.sectors.map(n=>e.jsx(O,{variant:"outline",className:"text-xs",children:n},n))]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mr-2",children:"Scope Tags:"}),s.scopeTags.map(n=>e.jsx(O,{variant:"accent",className:"text-xs",children:n},n))]})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"w-5 h-5 text-gaming-success"})," What This Means for Careers"]})}),e.jsxs(W,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s.careerImplications}),e.jsx("h4",{className:"text-sm font-medium text-foreground mb-3 uppercase tracking-wide",children:"Common Role Families"}),e.jsx("div",{className:"space-y-3",children:s.careerRoles.map(n=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-border/50",children:[e.jsx(qe,{className:"w-4 h-4 text-accent flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:n.roleFamily}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n.description})]})]},n.roleFamily))})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(ea,{className:"w-5 h-5 text-gaming-warning"})," Key Requirements"]})}),e.jsxs(W,{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"High-level themes — not legal advice. See official pages for full details."}),e.jsx("ul",{className:"space-y-2",children:s.keyRequirements.map(n=>e.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[e.jsx(Ta,{className:"w-4 h-4 text-gaming-success flex-shrink-0 mt-0.5"}),n]},n))})]})]}),s.linkedCompanies.length>0&&e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"w-5 h-5 text-accent"})," Licensed Companies"]})}),e.jsxs(W,{children:[e.jsx("div",{className:"space-y-3",children:s.linkedCompanies.map(n=>{const r=kq[n.evidenceLevel];return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Se,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:n.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{variant:"outline",className:`text-xs ${r.className}`,children:r.label}),n.evidenceUrl&&e.jsx(P,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",asChild:!0,children:e.jsx("a",{href:n.evidenceUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(Rt,{className:"w-3 h-3"})})})]})]},n.slug)})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3 flex items-start gap-1.5",children:[e.jsx(Ta,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Verified"})," = found in official register. ",e.jsx("strong",{children:"Self-reported"})," = company-asserted, pending verification."]})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Regulator Info"}),e.jsx(Tn,{label:"Acronym",value:s.acronym}),e.jsx(Tn,{label:"Country",value:s.country}),e.jsx(Tn,{label:"Region",value:s.region}),e.jsx(Tn,{label:"Jurisdiction",value:s.jurisdiction}),e.jsx(Tn,{label:"Established",value:String(s.establishedYear)}),e.jsx(Tn,{label:"Compliance Score",value:`${s.complianceRating.toFixed(1)} / 5.0`}),e.jsx(Tn,{label:"License Types",value:s.licenseTypes.join(", ")})]})}),s.linkedMarkets.length>0&&e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4 text-accent"})," Markets Covered"]}),s.linkedMarkets.map(n=>e.jsxs(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>window.location.replace(`/markets/${n.slug}`),children:[e.jsx(Dt,{className:"w-3.5 h-3.5"})," ",n.name]},n.slug))]})}),e.jsx(U,{children:e.jsxs(W,{className:"p-4 space-y-3",children:[e.jsxs("h3",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ut,{className:"w-4 h-4 text-accent"})," Resources"]}),s.website&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Rt,{className:"w-3.5 h-3.5"})," Official Website"]})}),s.registerUrl&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",asChild:!0,children:e.jsxs("a",{href:s.registerUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Ha,{className:"w-3.5 h-3.5"})," Licensee Register"]})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Links to official pages. We do not summarize legal text — see the regulator's website for full requirements."})]})})]})]})}),e.jsx(cl,{})]}):e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[e.jsx(Ta,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Regulator Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The regulator you're looking for doesn't exist."}),e.jsx(P,{variant:"accent",onClick:()=>window.location.replace("/regulators/v2"),children:"Browse Regulators"})]})})},Tn=({label:t,value:a})=>e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:t}),e.jsx("span",{className:"text-foreground font-medium text-right max-w-[60%]",children:a})]});function S9(t){window.location.assign(t)}function L9(t){window.history.length>1?window.history.back():window.location.assign(t)}function bq(t){const a=PI,s=t??{};return{id:s.id??a.id,title:s.title??a.title,company:s.company??a.company,companyLogo:s.companyLogo??a.companyLogo,location:s.location??a.location,salary:s.salary??void 0,jobType:s.jobType??a.jobType,experienceLevel:s.experienceLevel??a.experienceLevel,department:s.department??a.department,postedDate:s.postedDate??a.postedDate,applicationDeadline:s.applicationDeadline??void 0,description:s.description??a.description,requirements:Array.isArray(s.requirements)?s.requirements:[],responsibilities:Array.isArray(s.responsibilities)?s.responsibilities:[],benefits:Array.isArray(s.benefits)?s.benefits:[],skills:Array.isArray(s.skills)?s.skills:[],companyDescription:s.companyDescription??"",companySize:s.companySize??void 0,companyWebsite:s.companyWebsite??void 0,contactEmail:s.contactEmail??void 0,contactPhone:s.contactPhone??void 0,isRemote:s.isRemote??!1,isUrgent:s.isUrgent??!1,isFeatured:s.isFeatured??!1,applicationUrl:s.applicationUrl??void 0,viewCount:s.viewCount??void 0,applicantCount:s.applicantCount??void 0}}function wq(t){return!Array.isArray(t)||t.length===0?TI:t.map(a=>({id:a.id??"unknown",title:a.title??"Untitled",company:a.company??"",location:a.location??"",salary:a.salary??void 0,postedDate:a.postedDate??new Date().toISOString().slice(0,10)}))}const PI={id:"1",title:"Senior Game Developer",company:"Wazdan",companyLogo:"https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg?auto=compress&cs=tinysrgb&w=100",location:"Malta",salary:"€80,000 - €120,000",jobType:"Full-time",experienceLevel:"Senior Level",department:"Engineering",postedDate:"2025-01-15",applicationDeadline:"2025-02-15",description:"We are seeking a talented Senior Game Developer to join our innovative team at Wazdan...",requirements:["5+ years of experience in game development","Strong proficiency in C# and Unity","Experience with HTML5 and JavaScript","Knowledge of casino game mechanics","Understanding of RNG and game mathematics","Experience with version control systems (Git)","Strong problem-solving skills","Excellent communication skills in English"],responsibilities:["Design and develop high-quality casino games","Implement game features and mechanics","Optimize game performance across multiple platforms","Collaborate with artists and designers on game assets","Write clean, maintainable, and well-documented code","Participate in code reviews and technical discussions","Debug and resolve technical issues","Stay updated with industry trends and technologies"],benefits:["Competitive salary and performance bonuses","Health insurance coverage","Flexible working hours","Remote work options","Professional development opportunities","25 days paid vacation","Modern office in Malta","Team building events and activities"],skills:["Unity","C#","JavaScript","HTML5","CSS3","Git","Agile","Game Design"],companyDescription:"Wazdan is a leading provider of innovative casino games...",companySize:"100-200 employees",companyWebsite:"https://wazdan.com",contactEmail:"careers@wazdan.com",contactPhone:"+356 2123 4567",isRemote:!1,isUrgent:!0,isFeatured:!0,applicationUrl:"https://wazdan.com/careers/apply",viewCount:1247,applicantCount:23},TI=[{id:"2",title:"Frontend Game Developer",company:"Pragmatic Play",location:"Malta",salary:"€60,000 - €80,000",postedDate:"2025-01-10"},{id:"3",title:"Unity Developer",company:"Evolution Gaming",location:"Remote",salary:"€70,000 - €90,000",postedDate:"2025-01-12"},{id:"4",title:"Game Developer",company:"NetEnt",location:"Stockholm",salary:"€65,000 - €85,000",postedDate:"2025-01-08"}],jq=({job:t=PI,similarJobs:a=TI,onSkillClick:s})=>{var L;const n=SC(),[r,i]=p.useState(()=>wq(a)),[l,c]=p.useState(!1),[h,d]=p.useState(null),[u,y]=p.useState(!1),[x,m]=p.useState(!1),{savedJobs:g,toggleJob:f,isSaved:k}=fI(),v=bq(t);p.useEffect(()=>{(async()=>{c(!0);try{if(await new Promise(I=>setTimeout(I,300)),!n)throw new Error("Missing slug in URL.");i(r);const j=JSON.parse(localStorage.getItem("appliedJobs")||"[]");m(j.includes(n))}catch(j){d((j==null?void 0:j.message)||"Failed to load job details")}finally{c(!1)}})()},[n]);const N=()=>{n&&f(n)},M=()=>{if(!n)return;v!=null&&v.applicationUrl?window.open(v.applicationUrl,"_blank","noopener,noreferrer"):y(!0);const w=JSON.parse(localStorage.getItem("appliedJobs")||"[]");w.includes(n)||(w.push(n),localStorage.setItem("appliedJobs",JSON.stringify(w)),m(!0))},b=async()=>{if(navigator.share)try{await navigator.share({title:v==null?void 0:v.title,text:`Check out this job opportunity: ${v==null?void 0:v.title} at ${v==null?void 0:v.company}`,url:window.location.href})}catch(w){console.log("Error sharing:",w)}else navigator.clipboard.writeText(window.location.href),alert("Job URL copied to clipboard!")},C=w=>new Date(w).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),S=w=>{const j=new Date(w),T=Math.abs(new Date().getTime()-j.getTime());return Math.ceil(T/(1e3*60*60*24))};return l?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),e.jsx("p",{className:"mt-4 text-gray-600",children:"Loading job details..."})]})}):h||!v?e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(Qt,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Job Not Found"}),e.jsx("p",{className:"text-gray-600 mb-4",children:h||"The job you are looking for does not exist."}),e.jsx("button",{onClick:()=>L9("/jobs"),className:"bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Back to Jobs"})]})}):e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("div",{className:"bg-white border-b border-gray-200",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:[e.jsxs("button",{onClick:()=>L9("/jobs"),className:"flex items-center text-gray-600 hover:text-gray-900 mb-4",children:[e.jsx(La,{className:"h-4 w-4 mr-2"}),"Back to Jobs"]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"flex items-start space-x-4",children:[v.companyLogo&&e.jsx("img",{src:v.companyLogo,alt:`${v.company} logo`,className:"w-16 h-16 rounded-lg object-cover border border-gray-200"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[v.isUrgent&&e.jsx("span",{className:"bg-red-100 text-red-800 text-xs font-medium px-2 py-1 rounded-full",children:"Urgent"}),v.isFeatured&&e.jsx("span",{className:"bg-yellow-100 text-yellow-800 text-xs font-medium px-2 py-1 rounded-full",children:"Featured"})]}),e.jsx("h1",{className:"text-2xl lg:text-3xl font-bold text-gray-900 mb-2",children:v.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Se,{className:"h-4 w-4 mr-1"}),e.jsx("span",{className:"font-medium",children:v.company})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fe,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:v.location}),v.isRemote&&e.jsx("span",{className:"ml-1",children:"(Remote)"})]}),v.salary&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Ts,{className:"h-4 w-4 mr-1"}),e.jsx("span",{children:v.salary})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx($t,{className:"h-4 w-4 mr-1"}),e.jsxs("span",{children:[S(v.postedDate)," days ago"]})]})]})]})]})}),e.jsxs("div",{className:"flex items-center space-x-3 mt-4 lg:mt-0",children:[e.jsxs("button",{onClick:N,className:`flex items-center px-4 py-2 rounded-lg border transition-colors ${k(v.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(Ua,{className:`h-4 w-4 mr-2 ${k(v.id)?"fill-current":""}`}),k(v.id)?"Saved":"Save Job"]}),e.jsxs("button",{onClick:b,className:"flex items-center px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:[e.jsx(as,{className:"h-4 w-4 mr-2"}),"Share"]}),e.jsx("button",{onClick:M,disabled:x,className:`flex items-center px-6 py-2 rounded-lg font-medium transition-colors ${x?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:x?e.jsxs(e.Fragment,{children:[e.jsx(Tt,{className:"h-4 w-4 mr-2"}),"Applied"]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"h-4 w-4 mr-2"}),"Apply Now"]})})]})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Ce,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Job Type"}),e.jsx("p",{className:"font-medium",children:v.jobType})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Va,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Experience"}),e.jsx("p",{className:"font-medium",children:v.experienceLevel})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(qe,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Department"}),e.jsx("p",{className:"font-medium",children:v.department})]}),e.jsxs("div",{className:"text-center p-4 bg-gray-50 rounded-lg",children:[e.jsx(Gt,{className:"h-6 w-6 text-blue-600 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Deadline"}),e.jsx("p",{className:"font-medium text-sm",children:v.applicationDeadline?C(v.applicationDeadline):"Open"})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200",children:[e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-600",children:[e.jsxs("span",{children:[v.viewCount," views"]}),e.jsxs("span",{children:[v.applicantCount," applicants"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(tt,{className:"h-4 w-4 text-yellow-400 fill-current"}),e.jsx("span",{className:"text-sm text-gray-600",children:"4.8 company rating"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Job Description"}),e.jsx("div",{className:"prose prose-gray max-w-none",children:e.jsx("p",{className:"text-gray-700 leading-relaxed whitespace-pre-line",children:v.description})})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Key Responsibilities"}),e.jsx("ul",{className:"space-y-3",children:(L=v.responsibilities)==null?void 0:L.map((w,j)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Tt,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:w})]},j))})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Requirements"}),Array.isArray(v.requirements)?e.jsx("ul",{className:"space-y-3",children:v.requirements.map((w,j)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Tt,{className:"h-5 w-5 text-blue-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:w})]},j))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:v.requirements})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Required Skills"}),Array.isArray(v.skills)?e.jsx("div",{className:"flex flex-wrap gap-2",children:v.skills.map((w,j)=>e.jsx(tC,{name:w,color:"#2563EB",size:"sm",onClick:s?()=>s(w):void 0},`${w}-${j}`))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:v.skills})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Benefits & Perks"}),Array.isArray(v.benefits)?e.jsx("ul",{className:"space-y-3",children:v.benefits.map((w,j)=>e.jsxs("li",{className:"flex items-start",children:[e.jsx(Tt,{className:"h-5 w-5 text-green-500 mr-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-gray-700",children:w})]},j))}):e.jsx("p",{className:"text-gray-700 whitespace-pre-line",children:v.benefits})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:["About ",v.company]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-700 text-sm leading-relaxed",children:v.companyDescription}),e.jsxs("div",{className:"space-y-2 text-sm",children:[v.companySize&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(qe,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("span",{className:"text-gray-600",children:v.companySize})]}),v.companyWebsite&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(Dt,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:v.companyWebsite,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Visit Website"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Contact Information"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[v.contactEmail&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(ca,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`mailto:${v.contactEmail}`,className:"text-blue-600 hover:text-blue-800",children:v.contactEmail})]}),v.contactPhone&&e.jsxs("div",{className:"flex items-center",children:[e.jsx(dn,{className:"h-4 w-4 text-gray-400 mr-2"}),e.jsx("a",{href:`tel:${v.contactPhone}`,className:"text-blue-600 hover:text-blue-800",children:v.contactPhone})]})]})]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Ready to Apply?"}),e.jsxs("p",{className:"text-gray-600 text-sm mb-4",children:["Join ",v.company," and take your career to the next level in the exciting world of iGaming."]}),e.jsx("button",{onClick:M,disabled:x,className:`w-full flex items-center justify-center px-6 py-3 rounded-lg font-medium transition-colors ${x?"bg-green-100 text-green-800 cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:x?e.jsxs(e.Fragment,{children:[e.jsx(Tt,{className:"h-5 w-5 mr-2"}),"Application Submitted"]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"h-5 w-5 mr-2"}),"Apply for this Position"]})}),!x&&e.jsxs("div",{className:"mt-4 flex items-center space-x-2",children:[e.jsxs("button",{onClick:N,className:`flex-1 flex items-center justify-center px-4 py-2 rounded-lg border transition-colors ${k(v.id)?"bg-blue-50 border-blue-200 text-blue-700":"bg-white border-gray-300 text-gray-700 hover:bg-gray-50"}`,children:[e.jsx(Et,{className:`h-4 w-4 mr-2 ${k(v.id)?"fill-current":""}`}),k(v.id)?"Saved":"Save"]}),e.jsx("button",{className:"flex items-center justify-center p-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:e.jsx(Yo,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Similar Jobs"}),e.jsx("div",{className:"space-y-4",children:r.map(w=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>S9(`/jobs/${w.id}`),children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-1",children:w.title}),e.jsx("p",{className:"text-sm text-gray-600 mb-2",children:w.company}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fe,{className:"h-3 w-3 mr-1"}),e.jsx("span",{children:w.location})]}),e.jsxs("span",{children:[S(w.postedDate),"d ago"]})]}),w.salary&&e.jsx("p",{className:"text-sm font-medium text-blue-600 mt-2",children:w.salary})]},w.id))}),e.jsx("button",{onClick:()=>S9("/jobs"),className:"w-full mt-4 text-center text-blue-600 hover:text-blue-800 text-sm font-medium",children:"View All Jobs"})]})]})]})}),u&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-md w-full p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Apply for this Position"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"To apply for this position, please send your CV and cover letter to:"}),e.jsx("div",{className:"bg-gray-50 p-4 rounded-lg mb-4",children:e.jsx("p",{className:"font-medium",children:v.contactEmail})}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{onClick:()=>y(!1),className:"flex-1 px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:"Close"}),e.jsx("button",{onClick:()=>{window.location.href=`mailto:${v.contactEmail}?subject=Application for ${v.title}&body=Dear Hiring Manager,%0D%0A%0D%0AI am interested in applying for the ${v.title} position at ${v.company}.%0D%0A%0D%0APlease find my CV attached.%0D%0A%0D%0ABest regards`,y(!1)},className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Send Email"})]})]})})]})},Mq=()=>e.jsx("div",{children:e.jsx("h2",{children:"Welcome to the Header!"})}),Nq=({article:t,isBookmarked:a,onToggleBookmark:s,onShare:n,onOpenArticle:r,layout:i="card",userAccess:l,positionInList:c})=>{const[h,d]=p.useState(!1),u=f=>{const k=new Date(f),N=Math.floor((new Date().getTime()-k.getTime())/(1e3*60*60));return N<1?"Just now":N<24?`${N}h ago`:N<48?"Yesterday":k.toLocaleDateString("en-US",{month:"short",day:"numeric"})},y=f=>f>=1e3?`${(f/1e3).toFixed(1)}k`:f.toString(),x=f=>f.length>1?f[1]:f[0],m=(f,k)=>f.length<=k?f:f.substring(0,k).trim()+"...",g=i==="grid"?"flex flex-col":"flex flex-col md:flex-row md:items-center";return e.jsxs("article",{className:`
|
|
7738
7738
|
news-grid bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden
|
|
7739
7739
|
hover:shadow-md transition-shadow duration-300 ${g}
|
|
7740
7740
|
`,children:[e.jsxs("div",{className:`relative ${i==="list"?"md:w-1/3 md:flex-shrink-0":""}`,children:[e.jsx("img",{src:t.image||"/placeholder.svg?height=200&width=400&text=News",alt:t.title,className:`w-full h-48 object-cover transition-opacity duration-300 ${h?"opacity-100":"opacity-0"} ${i==="list"?"md:h-32":""}`,onLoad:()=>d(!0)}),!h&&e.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:e.jsx("div",{className:"w-12 h-12 text-gray-400",children:"📰"})}),e.jsxs("div",{className:"absolute top-3 left-3 flex flex-wrap gap-1",children:[t.isBreaking&&e.jsx("span",{className:"px-2 py-1 bg-red-500 text-white text-xs font-semibold rounded animate-pulse",children:"BREAKING"}),t.isTrending&&e.jsxs("span",{className:"px-2 py-1 bg-orange-500 text-white text-xs font-semibold rounded flex items-center",children:[e.jsx(jt,{className:"w-3 h-3 mr-1"}),"TRENDING"]})]}),e.jsx("button",{onClick:()=>s(t._id,c),className:`absolute top-3 right-3 p-2 rounded-full transition-colors ${a?"bg-yellow-500 text-white":"bg-white text-gray-600 hover:bg-gray-100"} ${l.allowSaving?"":"opacity-60 cursor-not-allowed"}`,"aria-label":a?"Remove bookmark":"Add bookmark",disabled:!l.allowSaving,title:l.allowSaving?void 0:"Sign in to save articles",children:e.jsx(Et,{className:`w-4 h-4 ${a?"fill-current":""}`})})]}),e.jsxs("div",{className:`p-4 ${i==="list"?"md:w-2/3":""}`,children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.categories.slice(0,2).map((f,k)=>e.jsx("a",{href:`?category=${f}`,children:e.jsx("span",{className:"px-2 py-1 bg-yellow-100 text-yellow-800 text-xs font-medium rounded-full",children:f},k)}))}),e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2 line-clamp-2 hover:text-yellow-600 transition-colors",children:l.maskExternalLinks?e.jsx("button",{className:"text-left w-full text-gray-700 cursor-not-allowed","aria-label":"Sign in to view article",title:"Sign in to view external article",children:t.title}):e.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",onClick:()=>r==null?void 0:r(t,c,"new_tab",t.isTrending?"trending":t.isBreaking?"breaking":"listing"),children:t.title})}),e.jsx("p",{className:"text-sm text-gray-700 mb-3 line-clamp-3",children:m(t.content,i==="list"?150:200)}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 mb-3",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("span",{children:["By ",x(t.author)]}),e.jsx("span",{children:t.company})]}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx($t,{className:"w-4 h-4 mr-1"}),e.jsxs("span",{children:[t.readTime,"m read"]})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(Rs,{className:"w-4 h-4 mr-1"}),e.jsx("span",{children:y(t.viewCount||0)})]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.tags.slice(0,3).map((f,k)=>e.jsxs("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 text-xs rounded",children:["#",f]},k))}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-gray-500",children:u(t.date)}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-700",children:lI[l.status]}),l.note&&e.jsx("span",{className:"text-xs text-gray-500",children:l.note})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{onClick:()=>n(t,c),className:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full transition-colors","aria-label":"Share article",children:e.jsx(as,{className:"w-4 h-4"})}),l.maskExternalLinks?e.jsx("button",{className:"flex items-center px-3 py-1.5 bg-gray-200 text-gray-600 text-sm font-medium rounded-lg cursor-not-allowed","aria-label":"Sign in to read",children:"Sign in to read"}):e.jsxs("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-3 py-1.5 bg-yellow-600 text-white text-sm font-medium rounded-lg hover:bg-yellow-700 transition-colors",onClick:()=>r==null?void 0:r(t,c,"new_tab",t.isTrending?"trending":t.isBreaking?"breaking":"listing"),children:["Read More",e.jsx(Rt,{className:"w-3 h-3 ml-1"})]})]})]})]})]})},Cq=({apiUrl:t="http://localhost:5000/api/news",filterKeys:a=["categories","author","company"],searchableFilters:s=["company","author","categories"],defaultFilters:n={categories:[],tags:[],authors:[],companies:[],dateRange:["",""],readTime:[0,999]},defaultSort:r="latest",bookmarkStorageKey:i="news-bookmarks",itemsPerPage:l=12,dateFieldLabel:c="Published",userAccess:h,onEmitEvent:d,eventContext:u})=>{const[y,x]=p.useState([]),[m,g]=p.useState([]),[f,k]=p.useState([]),[v,N]=p.useState({}),[M,b]=p.useState(""),[C,S]=p.useState({}),[L,w]=p.useState(!1),[j,I]=p.useState(l),[T,A]=p.useState(new Set),[R,D]=p.useState(r),[q,E]=p.useState("grid"),[F,G]=p.useState(1),[Z,$]=p.useState([]),[Q,te]=p.useState(!1),[K,ee]=p.useState([]),[ce,fe]=p.useState([]),[de,se]=p.useState(!0),[H,z]=p.useState("all"),[_,V]=p.useState(""),J=Y=>Y.trim().toLowerCase().replace(/\s+/g,"-"),[pe,ke]=p.useState(n),[Be,is]=p.useState(null),Bt=B7(h),he=p.useMemo(()=>({component:"NewsPage",...u??{}}),[u]),_e=p.useCallback((Y,le)=>{d&&d({domain:"news",name:Y,payload:le,timestamp:new Date().toISOString(),context:he})},[he,d]),_t=p.useCallback(()=>({filters:{...C},categories:pe.categories.length?pe.categories:C.categories?[C.categories]:[],tags:pe.tags,authors:pe.authors.length?pe.authors:C.author?[C.author]:[],companies:pe.companies.length?pe.companies:C.company?[C.company]:[],dateFilter:H,readTimeRange:pe.readTime}),[H,C,pe]),pt=p.useCallback(()=>({page:F,pageSize:j,totalResults:m.length,sortBy:R,viewMode:q}),[F,m.length,j,R,q]),sa=p.useRef(!1),fa=p.useCallback((Y,le)=>{d&&d({domain:"newsletter",name:Y,payload:le,timestamp:new Date().toISOString(),context:he})},[he,d]),Sn=p.useCallback(async Y=>{fa("newsletter_subscribe_requested",Y)},[fa]);p.useEffect(()=>{const Y=localStorage.getItem(i);Y&&A(new Set(JSON.parse(Y)))},[i]),p.useEffect(()=>{const Y=new URLSearchParams(window.location.search),le={};a.forEach($e=>{const yt=Y.get($e);yt&&(le[$e]=yt)}),S(le);const xe=Y.get("q"),be=Y.get("categories");let Re=[...y];if(xe&&(Re=Re.filter($e=>$e.title.toLowerCase().includes(xe.toLowerCase())),b(xe),Lt(xe)),be){const $e=be.trim().toLowerCase().replace(/\s+/g,"-");ke(yt=>({...yt,categories:[$e]})),Re=Re.filter(yt=>yt.categories.some(Ul=>J(Ul)===$e))}k(Re);const Ft={};a.forEach($e=>{const yt=Y.get($e);yt&&(Ft[$e]=yt)}),S(Ft)},[y]),p.useEffect(()=>{const le=new URLSearchParams(window.location.search).get("date_filter");if(le&&le!=="all"){z(le);const xe=Go(y,C,K,le);g(xe),G(1),ot(xe)}},[y]);const Lt=Y=>{if(!Y.trim())return;const le=[...K,Y.trim()];ee(le);const xe=Go(y,C,le,H);g(xe),G(1),ot(xe),b(""),_e("news_search_submitted",{query:Y,searchFilters:le,..._t()})},ot=Y=>{const le=Lc(Y,a);N(le)},$s=Y=>{z(Y),lt(Y),pI(Y)},lt=Y=>{const le=Go(y,C,K,Y);g(le),G(1),ot(le)};p.useEffect(()=>{localStorage.setItem(i,JSON.stringify(Array.from(T)))},[T,i]),p.useEffect(()=>{se(!0),is(null),(async()=>{try{const le=await fetch(t);if(!le.ok)throw new Error(`API responded with status: ${le.status}`);const xe=await le.json();if(!Array.isArray(xe))throw new Error("Expected an array but received: "+typeof xe);const be=xe.map(It=>({...It,categories:Array.isArray(It.categories)?It.categories:[],topTag:gD(It.title||"")})),Re={};for(const It of be){const ba=It.topTag;ba&&(Re[ba]=(Re[ba]||0)+1)}const Ft=Object.entries(Re).sort((It,ba)=>ba[1]-It[1]).slice(0,10).map(([It])=>It);fe(Ft);const $e=new Set;be.forEach(It=>{It.categories.forEach(ba=>{$e.add(J(ba))})});const yt=Array.from($e).map(It=>({id:It,name:It.replace(/-/g," ").replace(/\b\w/g,ba=>ba.toUpperCase()),icon:"📰",count:be.filter(ba=>ba.categories.some(G7=>J(G7)===It)).length,color:"bg-gray-100 text-gray-800"}));x(be),g(be),k(be),$(yt);const Ul=Lc(be,a);N(Ul)}catch(le){console.error("Failed to fetch articles",le)}finally{se(!1)}})()},[t]);const Ya=()=>{E(Y=>{const le=Y==="grid"?"list":"grid";return _e("news_listing_viewmode_changed",{viewMode:le}),le})};p.useMemo(()=>y.filter(Y=>Y.isTrending).slice(0,6),[y]),p.useMemo(()=>y.filter(Y=>Y.isBreaking),[y]);const _a=Math.ceil(m.length/j),ka=m.slice((F-1)*j,F*j),os=(Y,le)=>{Bt.allowSaving&&A(xe=>{const be=new Set(xe),Re=be.has(Y);return Re?be.delete(Y):be.add(Y),_e(Re?"news_article_unbookmarked":"news_article_bookmarked",{articleId:Y,positionInList:le}),be})},va=(Y,le)=>{navigator.share?navigator.share({title:Y.title,text:Y.title,url:Y.link}):(navigator.clipboard.writeText(Y.link),alert("Article link copied to clipboard!")),_e("news_article_shared",{articleId:Y._id,channel:"copy_link"})},Ja=(Y,le,xe="new_tab",be="listing")=>{_e("news_article_opened",{articleId:Y._id,slug:Y.slug,positionInList:le,openedFrom:be,openedIn:xe})},na=()=>{te(!Q)},ra=m.length===0?0:(F-1)*j+1,ge=Math.min(F*j,m.length),Ie=()=>{ke({categories:[],tags:[],authors:[],companies:[],dateRange:["",""],readTime:[0,999]}),G(1);const Y=Go(y,C,K,H);g(Y),G(1),ot(Y)},Te=()=>{S({}),ee([]),z("all"),Ie(),g(y),G(1),ot(y),_e("news_filters_cleared_all",{})},ze=p.useRef(null),Ne=Y=>{G(Y),_e("news_listing_page_changed",{page:Y,pageSize:j,totalResults:m.length}),setTimeout(()=>{var le;(le=ze.current)==null||le.scrollIntoView({behavior:"smooth",block:"start"})},100)},Qe=Y=>{I(Y),G(1),_e("news_listing_items_per_page_changed",{pageSize:Y})},dt=(Y,le)=>{const xe={...C};le?xe[Y]=le:delete xe[Y];const be=Go(y,xe,K,H);S(xe),g(be),G(1),ot(be);const Re=_t();le?_e("news_filter_selected",{key:Y,value:le,...Re}):_e("news_filter_cleared",{key:Y,...Re})},ye=Y=>{const le=K.filter(be=>be!==Y);ee(le);const xe=Go(y,C,le,H);g(xe),G(1),ot(xe),_e("news_search_filter_removed",{removedKeyword:Y,remainingKeywords:le})};return p.useEffect(()=>{sa.current||de||!m.length&&!y.length||(_e("news_listing_viewed",{..._t(),...pt()}),sa.current=!0)},[y.length,_e,m.length,_t,pt,de]),e.jsxs("div",{className:"flex flex-col min-h-screen pb-16 md:pb-0",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx(jC,{onSearchChange:Y=>{const le=y.filter(xe=>xe.title.toLowerCase().includes(Y.toLowerCase()));k(le),b(Y)},title:"Latest News",popularTags:ce,generateHref:Y=>`/news?q=${Y.replace(/\s+/g,"+")}`}),e.jsxs("div",{className:"container mx-auto py-8 pb-20 md:pb-8",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:[e.jsx(hI,{data:y.map(Y=>Y.title),onSelect:Y=>{Lt(Y)},onTyping:Y=>{w(!!Y),Y||(k(y),b(""))},placeholder:"Search news, topics, or authors...",showSubmitButton:!0,className:"w-full"}),e.jsx("button",{className:"block md:hidden flex items-center justify-center p-3 bg-white border-2 border-gray-200 text-gray-700 rounded-xl hover:border-gray-300 hover:bg-gray-50 transition-all duration-200 focus:ring-4 focus:ring-gray-200 focus:outline-none hover:scale-105",onClick:na,children:e.jsx(hn,{size:16,className:"mr-1.5"})}),M&&e.jsxs("div",{className:"flex gap-2 mt-3 px-4 sm:px-6 lg:px-8",children:[e.jsxs("span",{className:"bg-yellow-100 text-indigo-800 rounded-full px-3 py-1 text-sm flex items-center",children:[M,e.jsx("button",{onClick:()=>{k(y),b("")},className:"ml-2 text-indigo-600 hover:text-indigo-800",children:"×"})]}),e.jsx("button",{className:"text-sm text-gray-600 hover:underline",onClick:()=>{k(y),b("")},children:"Clear Search"})]})]}),e.jsx("div",{className:"max-w-7xl mx-auto md:pb-8",children:e.jsx("div",{className:"block w-full",children:e.jsx("div",{className:"relative flex items-center gap-2 sm:my-6 my-2",children:e.jsx(MC,{filters:[..._?[{key:"categories",label:"Categories",value:_.replace(/-/g," "),onRemove:()=>V("")}]:[],...K.map(Y=>({key:"search",label:"",value:Y,onRemove:()=>ye(Y)})),...Object.entries(C).map(([Y,le])=>({key:Y,label:Y.replace(/_/g," "),value:le,onRemove:()=>dt(Y,"")}))],onClearAll:Te})})})})]}),e.jsx("main",{className:"max-w-7xl mx-auto px-4 pb-8 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:gap-6",children:[e.jsx(yI,{dateFieldLabel:"Date",activeDateFilter:H,onDateFilterChange:$s,filterKeys:a,searchableFilters:s,filtersData:v,activeFilters:C,handleFilterChange:dt,toggleSavedJobsFilter:()=>console.log("toggle saved jobs filter"),showOnlySaved:!1,savedJobs:[]}),de?e.jsx(Wa,{}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"lg:w-2/4",children:[e.jsx(mI,{viewMode:q,onToggleViewMode:Ya,selectedItemsPerPage:j,onItemsPerPageChange:Qe,totalCount:m.length,startIndex:ra,endIndex:ge,title:"Latest News"}),m.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:q==="grid"?"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 gap-6":"space-y-6",children:ka.map((Y,le)=>e.jsx("div",{ref:le===0?ze:null,children:e.jsx(Nq,{article:Y,isBookmarked:T.has(Y._id),positionInList:le,onToggleBookmark:xe=>os(xe,le),onShare:xe=>va(xe),onOpenArticle:Ja,layout:q,userAccess:Bt})},Y._id))}),_a>1&&e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsx(V7,{currentPage:F,totalPages:_a,onPageChange:Ne})})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(aa,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No articles found"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"Try adjusting your search criteria or filters to find more articles."}),e.jsx("button",{onClick:Te,className:"px-4 py-2 bg-yellow-600 text-white rounded-lg hover:bg-yellow-700 transition-colors",children:"Clear All Filters"})]})]})}),e.jsx("div",{className:"hidden lg:block lg:w-1/4 space-y-6",children:e.jsxs("div",{className:"sticky top-4",children:[e.jsx(Ol,{position:"sidebar",url:"https://video-previews.elements.envatousercontent.com/h264-video-previews/e08912ad-6856-4e36-89b5-cf1465cc79cb/32651312.mp4",link:"",alt:""}),e.jsx(E7,{onSubscribe:Sn}),e.jsxs("div",{className:"mt-6 bg-white rounded-lg shadow-sm border border-gray-200 p-5",children:[e.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Featured Employers"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:[...Array(6)].map((Y,le)=>e.jsx("div",{className:"flex items-center justify-center p-2 bg-gray-50 rounded-md",children:e.jsx("img",{src:`/placeholder.svg?height=40&width=40&text=${String.fromCharCode(65+le)}`,alt:`Featured employer ${le+1}`,className:"w-10 h-10 object-contain"})},le))})]})]})})]})})]})]}),e.jsx(dI,{activeDateFilter:H,handleDateFilterChange:$s,filterKeys:a,searchableFilters:s,dateFieldLabel:c,activeFilters:C,handleFilterChange:dt,filtersData:v,isMobileFilterOpen:Q,toggleMobileFilter:na})]})},Sq=({id:t,title:a,excerpt:s,image:n,category:r,author:i,company:l,companyLogo:c,companySlug:h,publishedAt:d,readTime:u,viewCount:y,isBreaking:x=!1,isTrending:m=!1,isBookmarked:g=!1,link:f,onBookmark:k,onShare:v,onCompanyClick:N,viewMode:M="grid"})=>{const b=C=>C?C>=1e3?`${(C/1e3).toFixed(1)}k`:C.toString():null;return e.jsxs(U,{className:"overflow-hidden hover:shadow-card transition-all duration-200 border border-transparent hover:border-accent/20 group",children:[e.jsxs("div",{className:"relative aspect-[16/9] overflow-hidden",children:[e.jsx("img",{src:n||"/placeholder.svg",alt:a,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}),e.jsxs("div",{className:"absolute top-3 left-3 flex flex-wrap gap-1.5",children:[x&&e.jsx(O,{className:"bg-red-500 text-white animate-pulse",children:"BREAKING"}),m&&e.jsxs(O,{className:"bg-orange-500 text-white flex items-center gap-1",children:[e.jsx(jt,{className:"w-3 h-3"}),"TRENDING"]})]}),e.jsx("div",{className:"absolute bottom-3 left-3",children:e.jsx(O,{variant:"secondary",className:"bg-background/90 backdrop-blur-sm",children:r})})]}),e.jsxs("div",{className:"p-4",children:[l&&e.jsxs("button",{onClick:()=>h&&(N==null?void 0:N(h)),className:"flex items-center gap-2 mb-3 group/company",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-secondary flex items-center justify-center overflow-hidden",children:c?e.jsx("img",{src:c,alt:l,className:"w-full h-full object-cover"}):e.jsx(Se,{className:"w-3 h-3 text-muted-foreground"})}),e.jsx("span",{className:"text-sm text-muted-foreground group-hover/company:text-accent transition-colors",children:l}),h&&e.jsx("span",{className:"text-xs text-accent opacity-0 group-hover/company:opacity-100 transition-opacity",children:"View profile →"})]}),e.jsx("h3",{className:"text-lg font-bold text-foreground line-clamp-2 mb-2 group-hover:text-accent transition-colors cursor-pointer",children:a}),s&&M==="list"&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-3 hidden lg:block",children:s}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{children:d}),u&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx($t,{className:"w-3 h-3"}),u," min"]}),y&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Rs,{className:"w-3 h-3"}),b(y)]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>k==null?void 0:k(t),children:e.jsx(Et,{className:`w-4 h-4 ${g?"fill-accent text-accent":""}`})}),e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>v==null?void 0:v(t),children:e.jsx(as,{className:"w-4 h-4"})}),f&&e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8",asChild:!0,children:e.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:e.jsx(Rt,{className:"w-4 h-4"})})})]})]})]})]})},I9=[{_id:"68374b58e8908d9dbd8d927d",author:["marjoriepreston","Marjorie Preston"],categories:["Integrated resorts","Land-based casino regulation","Tourism"],company:"iGaming Business",content:`Prime Minister Paetongtarn Shinawatra laid out Thailand's proposed 3.78 trillion baht ($168.3 billion) budget on Wednesday, which could offset some of the impact of US tariff hikes on the Thai economy. The US is Thailand's leading source of export goods.
|
|
@@ -7922,6 +7922,6 @@ The partnership is expected to close in Q3 2025, subject to regulatory approvals
|
|
|
7922
7922
|
window.dataLayer.push({ event: 'consent_granted' });
|
|
7923
7923
|
// gtag('consent', 'update', { ad_storage: 'granted', analytics_storage: 'granted' });
|
|
7924
7924
|
`;function zE({allow:t="analytics",scriptId:a="ga",scriptStrategy:s="afterInteractive",scriptContent:n=_E}){return e.jsx(WR,{allow:t,children:e.jsx(DE,{id:a,strategy:s,children:n})})}const qE=_7("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-0 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Vs=ie.forwardRef(({className:t,variant:a,...s},n)=>e.jsx("div",{ref:n,role:"alert",className:oe(qE({variant:a}),t),...s}));Vs.displayName="Alert";const Bc=ie.forwardRef(({className:t,...a},s)=>e.jsx("h5",{ref:s,className:oe("mb-1 font-medium leading-none tracking-tight",t),...a}));Bc.displayName="AlertTitle";const Us=ie.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:oe("text-sm [&_p]:leading-relaxed",t),...a}));Us.displayName="AlertDescription";function FE({onSubmit:t,onForgotPassword:a,onRegisterClick:s,isLoading:n=!1,error:r,title:i="Welcome Back",description:l="Sign in to your account to continue",identifierLabel:c="Email or Username",identifierPlaceholder:h="you@example.com",rememberMeStorageKey:d="igaming-auth-remember-me",rememberIdentifierPersistKey:u="igaming-auth-identifier",defaultPrefilledIdentifier:y,defaultRememberMe:x=!1,signButton:m="Sign In",signingInButton:g="Signing In..."}){const[f,k]=p.useState(y??""),[v,N]=p.useState(null),[M,b]=p.useState(""),[C,S]=p.useState(null),[L,w]=p.useState(x),[j,I]=p.useState({}),T=p.useRef(null),A=p.useRef(!!y),R=p.useRef(!1),D=p.useRef(!1),q=$=>{D.current=!0,w($)};p.useEffect(()=>{if(!(typeof window>"u"))try{const $=window.localStorage.getItem(d),Q=window.localStorage.getItem(u),te=$===null?x:$==="true";$!==null&&w(te),te&&Q&&(k(Q),A.current=!0),R.current=!0}catch{}},[x,u,d]),p.useEffect(()=>{typeof window>"u"||A.current&&f&&T.current&&(T.current.focus(),A.current=!1)},[f]),p.useEffect(()=>{if(!(typeof window>"u")&&R.current&&D.current)try{window.localStorage.setItem(d,String(L))}catch{}},[L,d]);const E=$=>/^\s/.test($)||/\s$/.test($)||/[\t\n\r]/.test($),F=$=>E($)?"Email or username cannot start or end with spaces.":null,G=$=>E($)?"Password cannot start or end with spaces.":null,Z=$=>{$.preventDefault();const Q=F(f),te=G(M);if(Q||te){N(Q),S(te);return}if(N(null),S(null),typeof window<"u")try{L?window.localStorage.setItem(u,f):window.localStorage.removeItem(u)}catch{}t(f,M,L)};return e.jsxs(U,{className:"w-full max-w-md",children:[e.jsxs(ne,{className:"space-y-1",children:[e.jsx(re,{className:"text-2xl font-bold",children:i}),e.jsx(Ae,{children:l})]}),e.jsxs("form",{onSubmit:Z,children:[e.jsxs(W,{className:"space-y-4",children:[r&&e.jsxs(Vs,{variant:"destructive",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsx(Us,{children:r})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"identifier",children:c}),e.jsxs("div",{className:"relative",children:[e.jsx(ca,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{id:"identifier",type:"text",placeholder:h,value:f,onChange:$=>{const Q=$.target.value;k(Q),N(F(Q))},className:"pl-10",required:!0,disabled:n,"aria-invalid":!!v,"aria-describedby":v?"identifier-error":void 0})]}),v&&e.jsx("p",{id:"identifier-error",className:"text-sm text-destructive",children:v})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(xs,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{id:"password",type:j.password?"text":"password",placeholder:"••••••••",value:M,onChange:$=>{const Q=$.target.value;b(Q),S(G(Q))},ref:T,className:"pl-10 pr-20",required:!0,disabled:n,"aria-invalid":!!C,"aria-describedby":C?"password-error":void 0}),e.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs font-medium text-muted-foreground hover:text-foreground",onClick:()=>I($=>({...$,password:!$.password})),disabled:n,children:j.password?"Hide":"Show"})]}),C&&e.jsx("p",{id:"password-error",className:"text-sm text-destructive",children:C})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Xt,{id:"remember",checked:L,onCheckedChange:$=>q($),disabled:n}),e.jsx(B,{htmlFor:"remember",className:"text-sm font-normal cursor-pointer",children:"Remember me"})]}),a&&e.jsx("button",{type:"button",onClick:a,className:"text-sm text-accent hover:underline",disabled:n,children:"Forgot password?"})]})]}),e.jsxs(gn,{className:"flex flex-col space-y-4",children:[e.jsx(P,{type:"submit",className:"w-full bg-accent text-accent-foreground hover:bg-accent/90",disabled:n||!!v||!!C,children:n?g:m}),s&&e.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:["Don't have an account?"," ",e.jsx("button",{type:"button",onClick:s,className:"text-accent hover:underline font-medium",disabled:n,children:"Create account"})]})]})]})]})}const EE=({onSubmit:t,onForgotPassword:a,onRegisterClick:s,isLoading:n=!1,error:r="",appName:i="Your App",logo:l,identifierLabel:c="Email or Username",identifierPlaceholder:h="you@example.com",rememberIdentifierPersistKey:d="igaming-auth-identifier",rememberMeStorageKey:u="igaming-auth-remember-me",defaultPrefilledIdentifier:y,signButtonTxt:x="Sign In",signingInButtonTxt:m="Signing In..."})=>e.jsx("div",{className:"flex items-center justify-center bg-gradient-to-r from-[#0f1219] to-[#1a2236] p-4 md:min-h-screen",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[l||e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-accent",children:e.jsx("span",{className:"text-xl font-bold text-accent-foreground",children:"APP"})}),e.jsx("span",{className:"text-2xl font-bold text-white",children:i})]}),e.jsx("p",{className:"text-gray-300",children:"Access your dashboard"})]}),e.jsx(FE,{onSubmit:t,onForgotPassword:a,onRegisterClick:s,isLoading:n,error:r,identifierLabel:c,identifierPlaceholder:h,rememberIdentifierPersistKey:d,defaultPrefilledIdentifier:y,signButton:x,rememberMeStorageKey:u,signingInButton:m})]})});function OE({onSubmit:t,fields:a,onLoginClick:s,isLoading:n=!1,error:r,title:i="Create Account",description:l="Join us to access exclusive opportunities"}){const[c,h]=p.useState({}),[d,u]=p.useState(""),y=(m,g)=>h(f=>({...f,[m]:g})),x=m=>{if(m.preventDefault(),u(""),"password"in c&&("confirmPassword"in c||"password2"in c)){const f=c.confirmPassword??c.password2;if(c.password!==f){u("Passwords do not match");return}}const g={...c};if("confirmPassword"in g&&!("password2"in g)&&(g.password2=g.confirmPassword,delete g.confirmPassword),"fullName"in g&&!("first_name"in g)&&!("last_name"in g)){const f=String(g.fullName||"").trim().split(/\s+/).filter(Boolean);f.length>0&&(g.first_name=f[0],f.length>1&&(g.last_name=f.slice(1).join(" "))),delete g.fullName}t(g)};return e.jsxs(U,{className:"w-full max-w-md",children:[e.jsxs(ne,{className:"space-y-1",children:[e.jsx(re,{className:"text-2xl font-bold",children:i}),e.jsx(Ae,{children:l})]}),e.jsxs("form",{onSubmit:x,children:[e.jsxs(W,{className:"space-y-4",children:[(r||d)&&e.jsxs(Vs,{variant:"destructive",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsx(Us,{children:r||d})]}),a.map(m=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:m.name,children:m.label}),e.jsx(ae,{id:m.name,type:m.type||"text",placeholder:m.placeholder,required:m.required,disabled:n,value:c[m.name]||"",onChange:g=>y(m.name,g.target.value)})]},m.name))]}),e.jsxs(gn,{className:"flex flex-col space-y-4",children:[e.jsx(P,{type:"submit",className:"w-full bg-accent text-accent-foreground hover:bg-accent/90",disabled:n,children:n?"Creating account...":"Create Account"}),s&&e.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:["Already have an account?"," ",e.jsx("button",{type:"button",onClick:s,className:"text-accent hover:underline font-medium",disabled:n,children:"Sign in"})]})]})]})]})}const BE=({onSubmit:t,fields:a,onLoginClick:s,isLoading:n=!1,error:r="",appName:i="Your App",logo:l,title:c="Create Account",description:h="Join us to access exclusive opportunities"})=>e.jsx("div",{className:"flex items-center justify-center bg-gradient-to-r from-[#0f1219] to-[#1a2236] p-4 md:min-h-screen ",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[l||e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-accent",children:e.jsx("span",{className:"text-xl font-bold text-accent-foreground",children:"APP"})}),e.jsx("span",{className:"text-2xl font-bold text-white",children:i})]}),e.jsx("p",{className:"text-gray-300",children:"Start your journey"})]}),e.jsx(OE,{onSubmit:t,fields:a,onLoginClick:s,isLoading:n,error:r,title:c,description:h})]})}),HE=t=>{let a=0;return t.length>=8&&(a+=1),/[A-Z]/.test(t)&&(a+=1),/[a-z]/.test(t)&&(a+=1),/\d/.test(t)&&(a+=1),/[^A-Za-z0-9]/.test(t)&&(a+=1),t?a<=2?{label:"Weak",score:a}:a<=4?{label:"Good",score:a}:{label:"Strong",score:a}:{label:"",score:0}};function VE({onSubmit:t,fields:a,optionalFields:s=[],onLoginClick:n,isLoading:r=!1,error:i,onClearError:l,title:c="Create Account",description:h="Join iGaming Career in seconds",privacyNote:d="We respect your privacy. Your data is protected and never shared without consent."}){const[u,y]=p.useState({}),[x,m]=p.useState(""),[g,f]=p.useState(!1),[k,v]=p.useState({}),N=p.useMemo(()=>{const w=a.find(j=>j.type==="password"||j.name==="password");return w&&u[w.name]||""},[a,u]),M=p.useMemo(()=>HE(N),[N]),b=(w,j)=>{l==null||l(),y(I=>({...I,[w]:j}))},C=w=>{if(w.preventDefault(),m(""),"password"in u&&("confirmPassword"in u||"password2"in u)){const I=u.confirmPassword??u.password2;if(u.password!==I){m("Passwords do not match");return}}const j={...u};if("confirmPassword"in j&&!("password2"in j)&&(j.password2=j.confirmPassword,delete j.confirmPassword),"fullName"in j&&!("first_name"in j)&&!("last_name"in j)){const I=String(j.fullName||"").trim().split(/\s+/).filter(Boolean);I.length>0&&(j.first_name=I[0],I.length>1&&(j.last_name=I.slice(1).join(" "))),delete j.fullName}t(j)},S=w=>e.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs font-medium text-muted-foreground hover:text-foreground",onClick:()=>v(j=>({...j,[w]:!j[w]})),disabled:r,children:k[w]?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(uc,{className:"h-3.5 w-3.5"})," Hide"]}):e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Rs,{className:"h-3.5 w-3.5"})," Show"]})}),L=w=>{const j=w.type==="password"||w.name.toLowerCase().includes("password");return e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:w.name,children:w.label}),e.jsxs("div",{className:j?"relative":void 0,children:[e.jsx(ae,{id:w.name,type:j?k[w.name]?"text":"password":w.type||"text",placeholder:w.placeholder,required:w.required,disabled:r,value:u[w.name]||"",onChange:I=>b(w.name,I.target.value),className:j?"pr-20":void 0}),j?S(w.name):null]}),j&&w.name==="password"&&M.label?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Ta,{className:"h-3.5 w-3.5"})," Strength:"]}),e.jsx("span",{className:M.label==="Weak"?"text-destructive":M.label==="Good"?"text-amber-500":"text-emerald-500",children:M.label})]}):null]},w.name)};return e.jsxs(U,{className:"w-full max-w-md",children:[e.jsxs(ne,{className:"space-y-1",children:[e.jsx(re,{className:"text-2xl font-bold",children:c}),e.jsx(Ae,{children:h})]}),e.jsxs("form",{onSubmit:C,children:[e.jsxs(W,{className:"space-y-4",children:[(i||x)&&e.jsxs(Vs,{variant:"destructive",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsx(Us,{children:i||x})]}),e.jsx("div",{className:"space-y-4",children:a.map(w=>L(w))}),s.length>0&&e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>f(w=>!w),className:"text-sm font-medium text-accent hover:underline",disabled:r,children:g?"Hide optional details":"Complete your profile (optional)"}),g&&e.jsx("div",{className:"space-y-4 rounded-lg border border-dashed border-muted-foreground/40 p-4",children:s.map(w=>L(w))})]})]}),e.jsxs(gn,{className:"flex flex-col space-y-4",children:[e.jsx(P,{type:"submit",className:"w-full bg-accent text-accent-foreground hover:bg-accent/90",disabled:r,children:r?"Creating account...":"Create Account"}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:d}),n&&e.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:["Already have an account?"," ",e.jsx("button",{type:"button",onClick:n,className:"text-accent hover:underline font-medium",disabled:r,children:"Sign in"})]})]})]})]})}const UE=({onSubmit:t,fields:a,optionalFields:s,onLoginClick:n,isLoading:r=!1,error:i="",onClearError:l,appName:c="Your App",logo:h,title:d="Create Account",description:u="Join iGaming Career in seconds",privacyNote:y})=>e.jsx("div",{className:"flex items-center justify-center bg-gradient-to-r from-[#0f1219] to-[#1a2236] p-4 md:min-h-screen",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[h||e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-accent",children:e.jsx("span",{className:"text-xl font-bold text-accent-foreground",children:"APP"})}),e.jsx("span",{className:"text-2xl font-bold text-white",children:c})]}),e.jsx("p",{className:"text-gray-300",children:"Start your journey"})]}),e.jsx(VE,{onSubmit:t,fields:a,optionalFields:s,onLoginClick:n,isLoading:r,error:i,onClearError:l,title:d,description:u,privacyNote:y})]})});function GE({onSubmit:t,onBackToLogin:a,isLoading:s=!1,error:n,success:r=!1,title:i="Reset Password",description:l="Enter your email address and we'll send you a link to reset your password",successMessage:c="If an account exists with that email, you will receive a password reset link shortly. Please check your inbox and spam folder.",sendResetBtnText:h="Send Reset Link",sendingResetBtnText:d="Sending...",backToLoginBtnText:u="Back to Login",mutedText:y="We'll send you an email with instructions to reset your password"}){const[x,m]=p.useState(""),g=f=>{f.preventDefault(),t(x)};return r?e.jsxs(U,{className:"w-full max-w-md",children:[e.jsxs(ne,{className:"space-y-1",children:[e.jsx("div",{className:"flex items-center justify-center mb-4",children:e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:e.jsx(Tt,{className:"h-6 w-6 text-green-600"})})}),e.jsx(re,{className:"text-2xl font-bold text-center",children:"Check Your Email"}),e.jsx(Ae,{className:"text-center",children:c})]}),e.jsx(gn,{className:"flex flex-col space-y-4",children:a&&e.jsxs(P,{type:"button",variant:"outline",className:"w-full",onClick:a,children:[e.jsx(La,{className:"mr-2 h-4 w-4"}),u]})})]}):e.jsxs(U,{className:"w-full max-w-md",children:[e.jsxs(ne,{className:"space-y-1",children:[e.jsx(re,{className:"text-2xl font-bold",children:i}),e.jsx(Ae,{children:l})]}),e.jsxs("form",{onSubmit:g,children:[e.jsxs(W,{className:"space-y-4",children:[n&&e.jsxs(Vs,{variant:"destructive",children:[e.jsx(Qt,{className:"h-4 w-4"}),e.jsx(Us,{children:n})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"email",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(ca,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{id:"email",type:"email",placeholder:"you@example.com",value:x,onChange:f=>m(f.target.value),className:"pl-10",required:!0,disabled:s})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:y})]})]}),e.jsxs(gn,{className:"flex flex-col space-y-4",children:[e.jsx(P,{type:"submit",className:"w-full bg-accent text-accent-foreground hover:bg-accent/90",disabled:s,children:s?d:h}),a&&e.jsxs(P,{type:"button",variant:"ghost",className:"w-full",onClick:a,disabled:s,children:[e.jsx(La,{className:"mr-2 h-4 w-4"}),u]})]})]})]})}const $E=({onSubmit:t,onBackToLogin:a,isLoading:s=!1,error:n="",success:r=!1,appName:i="Your App",logo:l,title:c="Reset Password",description:h="Enter your email address and we'll send you a link to reset your password",successMessage:d="If an account exists with that email, you will receive a password reset link shortly. Please check your inbox and spam folder.",sendResetBtnText:u="Send Reset Link",sendingResetBtnText:y="Sending...",backToLoginBtnText:x="Back to Login",mutedText:m="We'll send you an email with instructions to reset your password"})=>e.jsx("div",{className:"flex items-center justify-center bg-gradient-to-r from-[#0f1219] to-[#1a2236] p-4 md:min-h-screen ",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"mb-8 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[l||e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-accent",children:e.jsx("span",{className:"text-xl font-bold text-accent-foreground",children:"APP"})}),e.jsx("span",{className:"text-2xl font-bold text-white",children:i})]}),e.jsx("p",{className:"text-gray-300",children:"Recover your account access"})]}),e.jsx(GE,{onSubmit:t,onBackToLogin:a,isLoading:s,error:n,success:r,title:c,description:h,successMessage:d,sendResetBtnText:u,sendingResetBtnText:y,backToLoginBtnText:x,mutedText:m})]})}),WE=["Save and track your favorite jobs","Unlock full job descriptions","Get personalized recommendations"],ZE=t=>{if(!t)return"continue";const a=t.trim();return a.length===0?"continue":a.toLowerCase()},YE=({open:t,onClose:a,onLogin:s,onRegister:n,appName:r="Your App",attemptedAction:i,title:l="Sign in to continue",description:c,helperContent:h})=>{const d=ZE(i),u=c??`Please sign in to ${d} and keep your progress synced with ${r}.`;return e.jsx(st,{open:t,onOpenChange:y=>!y&&a(),children:e.jsxs(Xe,{className:"sm:max-w-lg",children:[e.jsxs(Oe,{className:"space-y-2",children:[e.jsxs(Le,{className:"flex items-center gap-2 text-xl font-semibold",children:[e.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-accent/10 text-accent",children:e.jsx(Qt,{className:"h-5 w-5"})}),l]}),e.jsx(it,{className:"text-base text-muted-foreground",children:u})]}),e.jsxs("div",{className:"mt-2 space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border/60 bg-muted/30 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(Fa,{className:"h-4 w-4 text-accent"}),"Why create an account?"]}),e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:WE.map(y=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"mt-1 block h-1.5 w-1.5 rounded-full bg-accent","aria-hidden":!0}),e.jsx("span",{children:y})]},y))})]}),h&&e.jsx("div",{className:"rounded-md bg-card p-4 text-sm text-muted-foreground shadow-sm",children:h})]}),e.jsx(Q9.Separator,{className:"my-4"}),e.jsxs(at,{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(P,{variant:"outline",onClick:n,className:"w-full",children:"Create account"}),e.jsx(P,{onClick:s,className:"w-full bg-accent text-accent-foreground hover:bg-accent/90",children:"Sign in"}),e.jsx(P,{variant:"ghost",onClick:a,className:"w-full sm:col-span-2 text-muted-foreground",children:"Maybe later"})]})]})})};function JE({emailVerified:t,onResend:a,onChangeEmail:s,isResending:n=!1,error:r,variant:i="inline",dismissible:l=!1,onDismiss:c}){if(t)return null;const h=i==="compact",d=i==="page",u=h?"text-sm":"text-base",y=h?"p-3":"p-5",x=h?"flex w-full flex-col gap-3":"flex w-full flex-col gap-4 md:flex-row md:items-center md:justify-between";return e.jsxs(Vs,{className:`border-border bg-card ${y}`,"aria-live":"polite","aria-busy":n,children:[e.jsx(ca,{className:h?"h-4 w-4":"h-5 w-5","aria-hidden":"true"}),e.jsxs("div",{className:x,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Bc,{className:u,children:"Verify your email to continue"}),e.jsx(Us,{className:"text-muted-foreground",children:d?"Verify your email address to unlock profile editing and personalized job alerts.":"Confirm your email to unlock the rest of your iGaming profile features."}),r&&e.jsx("p",{className:"text-sm font-medium text-destructive",role:"alert",children:r})]}),e.jsxs("div",{className:h?"flex flex-col gap-2":"flex flex-col gap-2 sm:flex-row",children:[e.jsxs(P,{type:"button",size:h?"sm":"default",onClick:a,disabled:n,"aria-disabled":n,children:[n&&e.jsx(Ze,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),n?"Resending":"Resend verification"]}),e.jsx(P,{type:"button",variant:"outline",size:h?"sm":"default",onClick:s,children:"Change email"})]}),l&&e.jsx(P,{type:"button",variant:"ghost",size:h?"icon":"sm",className:h?"ml-auto h-8 w-8 self-start":"ml-auto self-start",onClick:c,"aria-label":"Dismiss verification reminder",children:e.jsx(Ve,{className:h?"h-4 w-4":"h-5 w-5"})})]})]})}const KE=[{icon:kl,label:"Dashboard",path:"/dashboard"},{icon:Ce,label:"My Jobs",path:"/dashboard/jobs"},{icon:Ut,label:"Courses",path:"/dashboard/courses"},{icon:Ga,label:"Settings",path:"/dashboard/settings"}];function XE({children:t,user:a={name:"User",email:"user@example.com"},onLogout:s,onNavigate:n,currentPath:r="/dashboard",notificationCount:i=0}){return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"flex",children:[e.jsxs("aside",{className:"hidden md:flex w-64 flex-col border-r bg-card h-[calc(100vh-4rem)]",children:[e.jsx("nav",{className:"flex-1 space-y-1 p-4",children:KE.map(l=>{const c=l.icon,h=r===l.path;return e.jsxs("button",{onClick:()=>n==null?void 0:n(l.path),className:`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${h?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[e.jsx(c,{className:"h-4 w-4"}),l.label]},l.path)})}),s&&e.jsx("div",{className:"border-t p-4",children:e.jsxs(P,{variant:"ghost",className:"w-full justify-start text-muted-foreground hover:text-foreground",onClick:s,children:[e.jsx(wl,{className:"mr-3 h-4 w-4"}),"Logout"]})})]}),e.jsx("main",{className:"flex-1 p-6 md:p-8",children:t})]})})}const QE=["Compliance consulting","Game dev","Affiliate setup","UI/UX"];function eO({onStartSetup:t,isCandidateActive:a=!0}){const s=a?"Takes ~2 minutes • Visible when ready • Can keep full-time job search active":"Takes ~2 minutes • Visible when ready • Freelance-only visibility";return e.jsxs(U,{className:"border-amber-500/30 bg-amber-500/5",children:[e.jsxs(ne,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fa,{className:"h-5 w-5 text-amber-500"}),e.jsx(re,{className:"text-lg",children:"Offer freelance services in iGaming"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Get leads from operators, providers & agencies"})]}),e.jsxs(W,{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:QE.map(n=>e.jsx(O,{variant:"secondary",className:"text-xs",children:n},n))}),e.jsxs(P,{onClick:t,className:"w-full bg-orange-500 hover:bg-orange-600 text-white",children:["Start Freelancer Setup",e.jsx(Ia,{className:"ml-2 h-4 w-4"})]}),e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:s})]})]})}function tO({freelancerData:t,stats:a,onToggleVisibility:s,onEditProfile:n,onPromote:r}){const i=t.profileStrength<80?"Add portfolio & rate to unlock more leads":"Great job! Your profile is well optimized";return e.jsxs(U,{className:"border-amber-500/30 bg-amber-500/5",children:[e.jsx(ne,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fa,{className:"h-5 w-5 text-amber-500"}),e.jsx(re,{className:"text-lg",children:"Freelancer Dashboard"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Visibility:"}),e.jsx(vt,{checked:a.visibility,onCheckedChange:s}),e.jsx(O,{variant:a.visibility?"default":"secondary",children:a.visibility?"ON":"OFF"})]})]})}),e.jsxs(W,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Profile Strength"}),e.jsxs("span",{className:"font-medium",children:[t.profileStrength,"%"]})]}),e.jsx(ya,{value:t.profileStrength,className:"h-2"}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(vl,{className:"h-3 w-3"}),i]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"text-center p-3 bg-background rounded-lg",children:[e.jsx("div",{className:"flex items-center justify-center gap-1 text-muted-foreground mb-1",children:e.jsx(Rs,{className:"h-4 w-4"})}),e.jsx("p",{className:"text-2xl font-bold",children:a.viewsThisWeek}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Views this week"})]}),e.jsxs("div",{className:"text-center p-3 bg-background rounded-lg",children:[e.jsx("div",{className:"flex items-center justify-center gap-1 text-muted-foreground mb-1",children:e.jsx(ft,{className:"h-4 w-4"})}),e.jsx("p",{className:"text-2xl font-bold",children:a.inquiries}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Inquiries"})]}),e.jsx("div",{className:"p-3 bg-background rounded-lg flex flex-col items-center justify-center",children:e.jsxs(P,{variant:"outline",size:"sm",onClick:r,className:"w-full",children:[e.jsx(jt,{className:"h-4 w-4 mr-1"}),"Promote"]})})]}),a.inquiries===0&&e.jsxs("div",{className:"bg-background rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"No leads yet"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"💡 Tip: Add 3+ portfolio items to appear higher in searches"})]}),e.jsxs(P,{variant:"outline",className:"w-full",onClick:n,children:[e.jsx(Kt,{className:"h-4 w-4 mr-2"}),"Manage Freelancer Profile"]})]})]})}function aO({emailVerified:t,onResend:a,onChangeEmail:s,isResending:n=!1,error:r,variant:i="inline",dismissible:l=!1,onDismiss:c}){if(t)return null;const h=i==="compact",d=i==="page",u=h?"text-sm":"text-base",y=h?"p-3":"p-5",x=h?"flex w-full flex-col gap-3":"flex w-full flex-col gap-4 md:flex-row md:items-center md:justify-between";return e.jsxs(Vs,{className:`border-border bg-card ${y}`,"aria-live":"polite","aria-busy":n,children:[e.jsx(ca,{className:h?"h-4 w-4":"h-5 w-5","aria-hidden":"true"}),e.jsxs("div",{className:x,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Bc,{className:u,children:"Verify your email to continue"}),e.jsx(Us,{className:"text-muted-foreground",children:d?"Verify your email address to unlock profile editing and personalized job alerts.":"Confirm your email to unlock the rest of your iGaming profile features."}),r&&e.jsx("p",{className:"text-sm font-medium text-destructive",role:"alert",children:r})]}),e.jsxs("div",{className:h?"flex flex-col gap-2":"flex flex-col gap-2 sm:flex-row",children:[e.jsxs(P,{type:"button",size:h?"sm":"default",onClick:a,disabled:n,"aria-disabled":n,children:[n&&e.jsx(Ze,{className:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),n?"Resending":"Resend verification"]}),e.jsx(P,{type:"button",variant:"outline",size:h?"sm":"default",onClick:s,children:"Change email"})]}),l&&e.jsx(P,{type:"button",variant:"ghost",size:h?"icon":"sm",className:h?"ml-auto h-8 w-8 self-start":"ml-auto self-start",onClick:c,"aria-label":"Dismiss verification reminder",children:e.jsx(Ve,{className:h?"h-4 w-4":"h-5 w-5"})})]})]})}const sO={complete:{label:"Complete",badgeVariant:"default",Icon:Ee},pending:{label:"Pending",badgeVariant:"secondary",Icon:Ps},blocked:{label:"Blocked",badgeVariant:"outline",Icon:xs}},nO=t=>{const a=t.filter(n=>n.status==="complete").length,s=t.filter(n=>n.status!=="blocked").length;return s===0?100:a/s*100};function nA({emailVerified:t,profileComplete:a,steps:s,progress:n,onActionClick:r,variant:i="full"}){const l=n??nO(s),c=Math.min(100,Math.max(0,l)),h=s.filter(x=>x.status==="complete").length,d=s.filter(x=>x.status!=="blocked").length,u=i==="compact",y=typeof t=="boolean"||typeof a=="boolean";return e.jsxs(U,{className:u?"rounded-xl":void 0,children:[e.jsxs(ne,{className:u?"space-y-2 pb-4":void 0,children:[e.jsx(re,{className:u?"text-lg":void 0,children:"Onboarding progress"}),e.jsx(Ae,{className:u?"text-sm":void 0,children:"Complete the steps below to unlock your full iGaming profile experience."}),y&&e.jsxs("div",{className:u?"flex flex-wrap gap-2 pt-1":"flex flex-wrap gap-2",children:[typeof t=="boolean"&&e.jsxs(O,{variant:t?"default":"outline",children:["Email ",t?"verified":"not verified"]}),typeof a=="boolean"&&e.jsxs(O,{variant:a?"default":"outline",children:["Profile ",a?"complete":"incomplete"]})]})]}),e.jsxs(W,{className:u?"space-y-4":"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[e.jsxs("span",{children:[h," of ",d," steps completed"]}),e.jsxs("span",{className:"font-medium text-foreground",children:[Math.round(c),"%"]})]}),e.jsx(ya,{value:c,"aria-label":"Onboarding progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(c),className:u?"h-2":void 0})]}),e.jsx("ul",{className:u?"space-y-3":"space-y-4",children:s.map(x=>{const m=sO[x.status],g=x.status==="blocked",f=!r||g;return e.jsxs("li",{className:u?"flex flex-col gap-2 rounded-lg border border-border bg-muted/30 p-3":"flex flex-col gap-3 rounded-lg border border-border bg-muted/30 p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:u?"mt-0.5 inline-flex h-8 w-8 items-center justify-center rounded-full border border-border bg-background":"mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-full border border-border bg-background","aria-hidden":"true",children:e.jsx(m.Icon,{className:u?"h-4 w-4":"h-5 w-5"})}),e.jsx("div",{children:e.jsx("p",{className:u?"text-sm font-semibold":"text-base font-semibold",children:x.label})})]}),e.jsx(O,{variant:m.badgeVariant,"aria-label":`${x.label} status: ${m.label}`,children:m.label})]}),x.helperText&&e.jsx("p",{className:u?"text-xs text-muted-foreground":"text-sm text-muted-foreground",children:x.helperText}),x.nextAction&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(P,{type:"button",size:u?"sm":"default",variant:g?"outline":"default",onClick:()=>{var k;return r==null?void 0:r((k=x.nextAction)==null?void 0:k.actionId,x.id)},disabled:f,"aria-disabled":f,children:x.nextAction.label}),g&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Complete the previous step to continue."})]})]},x.id)})})]})]})}const rO={complete:{label:"Complete",Icon:Ee,badgeVariant:"default"},pending:{label:"Pending",Icon:Ps,badgeVariant:"secondary"},blocked:{label:"Blocked",Icon:xs,badgeVariant:"outline"}};function iO({steps:t,onActionClick:a,variant:s="full"}){const n=s==="compact";return e.jsx("ul",{className:oe("space-y-3",n?"text-sm":"text-base"),children:t.map(r=>{const i=rO[r.status],l=r.status==="complete",c=r.status==="pending"&&r.nextAction,h=!a;return e.jsxs("li",{className:oe("flex flex-col gap-2 rounded-lg border border-border bg-muted/30",n?"p-3":"p-4",l&&"opacity-70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:oe("inline-flex items-center justify-center rounded-full border border-border bg-background",n?"h-8 w-8":"h-9 w-9"),"aria-hidden":"true",children:e.jsx(i.Icon,{className:n?"h-4 w-4":"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("p",{className:oe("font-semibold",l?"text-muted-foreground":"text-foreground"),children:r.label}),e.jsx("span",{className:"sr-only",children:i.label}),r.helperText&&e.jsx("p",{className:oe("text-muted-foreground",n?"text-xs":"text-sm"),children:r.helperText})]})]}),e.jsx(O,{variant:i.badgeVariant,"aria-label":`${r.label} status: ${i.label}`,children:i.label})]}),c&&r.nextAction&&e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.jsx(P,{type:"button",size:n?"sm":"default",onClick:()=>a==null?void 0:a(r.nextAction.actionId,r.id),disabled:h,"aria-disabled":h,children:r.nextAction.label})})]},r.id)})})}const IC=Pc.Root,AC=Pc.Trigger,U7=ie.forwardRef(({className:t,align:a="center",sideOffset:s=4,...n},r)=>e.jsx(Pc.Portal,{children:e.jsx(Pc.Content,{ref:r,align:a,sideOffset:s,className:oe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",t),...n})}));U7.displayName=Pc.Content.displayName;function rA({open:t,onOpenChange:a,emailVerified:s,profileComplete:n,steps:r,onActionClick:i,onResendVerification:l,onChangeEmail:c,isResending:h=!1,resendError:d,onDismiss:u,dismissLabel:y="I'll do this later",title:x="Welcome! Let's get you set up",description:m="Complete these steps to unlock all features and personalize your experience."}){const g=r.every(k=>k.status==="complete"),f=()=>{u==null||u(),a(!1)};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{className:"max-h-[90vh] overflow-y-auto sm:max-w-xl",children:[e.jsxs(Oe,{children:[e.jsx(Le,{className:"text-xl",children:x}),e.jsx(it,{children:m})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[!s&&l&&c&&e.jsx(aO,{emailVerified:s,onResend:l,onChangeEmail:c,isResending:h,error:d,variant:"compact"}),e.jsx(nA,{emailVerified:s,profileComplete:n,steps:r,onActionClick:i,variant:"compact"})]}),e.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-between",children:[!g&&e.jsx(P,{variant:"ghost",onClick:f,children:y}),g&&e.jsx(P,{onClick:()=>a(!1),className:"w-full sm:w-auto",children:"Get started"})]})]})})}const iA=t=>{const a=[];return a.push({id:"email_verification",label:"Verify your email",status:t.email_verified?"complete":"pending",helperText:t.email_verified?`Verified on ${t.email_verified_at?new Date(t.email_verified_at).toLocaleDateString():"N/A"}`:"Check your inbox for the verification link",nextAction:t.email_verified?void 0:{label:"Resend verification",actionId:"resend_verification"}}),a.push({id:"profile_required_fields",label:"Complete your profile",status:t.profile_complete?"complete":t.email_verified?"pending":"blocked",helperText:t.profile_complete?"All required fields are filled":"Add your first name, last name, and country",nextAction:t.profile_complete||!t.email_verified?void 0:{label:"Edit profile",actionId:"edit_profile"}}),a},YN=t=>{const a=t.filter(n=>n.status==="complete").length,s=t.filter(n=>n.status!=="blocked").length;return s===0?100:Math.round(a/s*100)},oO={emailVerified:!1,profileComplete:!1,steps:[],progress:0,showModal:!1,isDismissed:!1};function lO(){const[t,a]=p.useState(oO),s=p.useCallback(()=>{a(d=>({...d,showModal:!0}))},[]),n=p.useCallback(()=>{a(d=>({...d,showModal:!1}))},[]),r=p.useCallback(()=>{a(d=>({...d,showModal:!1,isDismissed:!0}))},[]),i=p.useCallback(()=>{a(d=>({...d,isDismissed:!1}))},[]),l=p.useCallback(d=>{const u=iA(d),y=YN(u);a(x=>({...x,emailVerified:d.email_verified,profileComplete:d.profile_complete,steps:u,progress:y}))},[]),c=p.useCallback(d=>{a(u=>{const y=u.steps.map(g=>g.id===d?{...g,status:"complete",nextAction:void 0}:d==="email_verification"&&g.id==="profile_required_fields"&&g.status==="blocked"?{...g,status:"pending",nextAction:{label:"Edit profile",actionId:"edit_profile"}}:g),x=d==="email_verification"?!0:u.emailVerified,m=d==="profile_required_fields"?!0:u.profileComplete;return{...u,emailVerified:x,profileComplete:m,steps:y,progress:YN(y)}})},[]),h=t.steps.length>0&&t.steps.every(d=>d.status==="complete");return{...t,openModal:s,closeModal:n,dismissOnboarding:r,resetDismissal:i,updateFromBackend:l,markStepComplete:c,isComplete:h}}const oA=p.createContext(null);function cO({children:t}){const a=lO();return e.jsx(oA.Provider,{value:a,children:t})}function lA(){const t=p.useContext(oA);if(!t)throw new Error("useOnboardingContext must be used within OnboardingProvider");return t}var dO=t=>{switch(t){case"success":return mO;case"info":return yO;case"warning":return pO;case"error":return xO;default:return null}},hO=Array(12).fill(0),uO=({visible:t,className:a})=>p.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":t},p.createElement("div",{className:"sonner-spinner"},hO.map((s,n)=>p.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),mO=p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},p.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),pO=p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},p.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),yO=p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},p.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),xO=p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},p.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),gO=p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},p.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),fO=()=>{let[t,a]=p.useState(document.hidden);return p.useEffect(()=>{let s=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),t},JN=1,kO=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var a;let{message:s,...n}=t,r=typeof(t==null?void 0:t.id)=="number"||((a=t.id)==null?void 0:a.length)>0?t.id:JN++,i=this.toasts.find(c=>c.id===r),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(c=>c.id===r?(this.publish({...c,...t,id:r,title:s}),{...c,...t,id:r,dismissible:l,title:s}):c):this.addToast({title:s,...n,dismissible:l,id:r}),r},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),this.subscribers.forEach(a=>a({id:t,dismiss:!0})),t),this.message=(t,a)=>this.create({...a,message:t}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let n=t instanceof Promise?t:t(),r=s!==void 0,i,l=n.then(async h=>{if(i=["resolve",h],p.isValidElement(h))r=!1,this.create({id:s,type:"default",message:h});else if(bO(h)&&!h.ok){r=!1;let d=typeof a.error=="function"?await a.error(`HTTP error! status: ${h.status}`):a.error,u=typeof a.description=="function"?await a.description(`HTTP error! status: ${h.status}`):a.description;this.create({id:s,type:"error",message:d,description:u})}else if(a.success!==void 0){r=!1;let d=typeof a.success=="function"?await a.success(h):a.success,u=typeof a.description=="function"?await a.description(h):a.description;this.create({id:s,type:"success",message:d,description:u})}}).catch(async h=>{if(i=["reject",h],a.error!==void 0){r=!1;let d=typeof a.error=="function"?await a.error(h):a.error,u=typeof a.description=="function"?await a.description(h):a.description;this.create({id:s,type:"error",message:d,description:u})}}).finally(()=>{var h;r&&(this.dismiss(s),s=void 0),(h=a.finally)==null||h.call(a)}),c=()=>new Promise((h,d)=>l.then(()=>i[0]==="reject"?d(i[1]):h(i[1])).catch(d));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,a)=>{let s=(a==null?void 0:a.id)||JN++;return this.create({jsx:t(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},oa=new kO,vO=(t,a)=>{let s=(a==null?void 0:a.id)||JN++;return oa.addToast({title:t,...a,id:s}),s},bO=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",wO=vO,jO=()=>oa.toasts,MO=()=>oa.getActiveToasts(),us=Object.assign(wO,{success:oa.success,info:oa.info,warning:oa.warning,error:oa.error,custom:oa.custom,message:oa.message,promise:oa.promise,dismiss:oa.dismiss,loading:oa.loading},{getHistory:jO,getToasts:MO});function NO(t,{insertAt:a}={}){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",a==="top"&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}NO(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
7925
|
-
`);function rd(t){return t.label!==void 0}var CO=3,SO="32px",LO="16px",E9=4e3,IO=356,AO=14,PO=20,TO=200;function Xa(...t){return t.filter(Boolean).join(" ")}function RO(t){let[a,s]=t.split("-"),n=[];return a&&n.push(a),s&&n.push(s),n}var DO=t=>{var a,s,n,r,i,l,c,h,d,u,y;let{invert:x,toast:m,unstyled:g,interacting:f,setHeights:k,visibleToasts:v,heights:N,index:M,toasts:b,expanded:C,removeToast:S,defaultRichColors:L,closeButton:w,style:j,cancelButtonStyle:I,actionButtonStyle:T,className:A="",descriptionClassName:R="",duration:D,position:q,gap:E,loadingIcon:F,expandByDefault:G,classNames:Z,icons:$,closeButtonAriaLabel:Q="Close toast",pauseWhenPageIsHidden:te}=t,[K,ee]=p.useState(null),[ce,fe]=p.useState(null),[de,se]=p.useState(!1),[H,z]=p.useState(!1),[_,V]=p.useState(!1),[J,pe]=p.useState(!1),[ke,Be]=p.useState(!1),[is,Bt]=p.useState(0),[he,_e]=p.useState(0),_t=p.useRef(m.duration||D||E9),pt=p.useRef(null),sa=p.useRef(null),fa=M===0,Sn=M+1<=v,Lt=m.type,ot=m.dismissible!==!1,$s=m.className||"",lt=m.descriptionClassName||"",Ya=p.useMemo(()=>N.findIndex(ye=>ye.toastId===m.id)||0,[N,m.id]),_a=p.useMemo(()=>{var ye;return(ye=m.closeButton)!=null?ye:w},[m.closeButton,w]),ka=p.useMemo(()=>m.duration||D||E9,[m.duration,D]),os=p.useRef(0),va=p.useRef(0),Ja=p.useRef(0),na=p.useRef(null),[ra,ge]=q.split("-"),Ie=p.useMemo(()=>N.reduce((ye,Y,le)=>le>=Ya?ye:ye+Y.height,0),[N,Ya]),Te=fO(),ze=m.invert||x,Ne=Lt==="loading";va.current=p.useMemo(()=>Ya*E+Ie,[Ya,Ie]),p.useEffect(()=>{_t.current=ka},[ka]),p.useEffect(()=>{se(!0)},[]),p.useEffect(()=>{let ye=sa.current;if(ye){let Y=ye.getBoundingClientRect().height;return _e(Y),k(le=>[{toastId:m.id,height:Y,position:m.position},...le]),()=>k(le=>le.filter(xe=>xe.toastId!==m.id))}},[k,m.id]),p.useLayoutEffect(()=>{if(!de)return;let ye=sa.current,Y=ye.style.height;ye.style.height="auto";let le=ye.getBoundingClientRect().height;ye.style.height=Y,_e(le),k(xe=>xe.find(be=>be.toastId===m.id)?xe.map(be=>be.toastId===m.id?{...be,height:le}:be):[{toastId:m.id,height:le,position:m.position},...xe])},[de,m.title,m.description,k,m.id]);let Qe=p.useCallback(()=>{z(!0),Bt(va.current),k(ye=>ye.filter(Y=>Y.toastId!==m.id)),setTimeout(()=>{S(m)},TO)},[m,S,k,va]);p.useEffect(()=>{if(m.promise&&Lt==="loading"||m.duration===1/0||m.type==="loading")return;let ye;return C||f||te&&Te?(()=>{if(Ja.current<os.current){let Y=new Date().getTime()-os.current;_t.current=_t.current-Y}Ja.current=new Date().getTime()})():_t.current!==1/0&&(os.current=new Date().getTime(),ye=setTimeout(()=>{var Y;(Y=m.onAutoClose)==null||Y.call(m,m),Qe()},_t.current)),()=>clearTimeout(ye)},[C,f,m,Lt,te,Te,Qe]),p.useEffect(()=>{m.delete&&Qe()},[Qe,m.delete]);function dt(){var ye,Y,le;return $!=null&&$.loading?p.createElement("div",{className:Xa(Z==null?void 0:Z.loader,(ye=m==null?void 0:m.classNames)==null?void 0:ye.loader,"sonner-loader"),"data-visible":Lt==="loading"},$.loading):F?p.createElement("div",{className:Xa(Z==null?void 0:Z.loader,(Y=m==null?void 0:m.classNames)==null?void 0:Y.loader,"sonner-loader"),"data-visible":Lt==="loading"},F):p.createElement(uO,{className:Xa(Z==null?void 0:Z.loader,(le=m==null?void 0:m.classNames)==null?void 0:le.loader),visible:Lt==="loading"})}return p.createElement("li",{tabIndex:0,ref:sa,className:Xa(A,$s,Z==null?void 0:Z.toast,(a=m==null?void 0:m.classNames)==null?void 0:a.toast,Z==null?void 0:Z.default,Z==null?void 0:Z[Lt],(s=m==null?void 0:m.classNames)==null?void 0:s[Lt]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:L,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":de,"data-promise":!!m.promise,"data-swiped":ke,"data-removed":H,"data-visible":Sn,"data-y-position":ra,"data-x-position":ge,"data-index":M,"data-front":fa,"data-swiping":_,"data-dismissible":ot,"data-type":Lt,"data-invert":ze,"data-swipe-out":J,"data-swipe-direction":ce,"data-expanded":!!(C||G&&de),style:{"--index":M,"--toasts-before":M,"--z-index":b.length-M,"--offset":`${H?is:va.current}px`,"--initial-height":G?"auto":`${he}px`,...j,...m.style},onDragEnd:()=>{V(!1),ee(null),na.current=null},onPointerDown:ye=>{Ne||!ot||(pt.current=new Date,Bt(va.current),ye.target.setPointerCapture(ye.pointerId),ye.target.tagName!=="BUTTON"&&(V(!0),na.current={x:ye.clientX,y:ye.clientY}))},onPointerUp:()=>{var ye,Y,le,xe;if(J||!ot)return;na.current=null;let be=Number(((ye=sa.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Re=Number(((Y=sa.current)==null?void 0:Y.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ft=new Date().getTime()-((le=pt.current)==null?void 0:le.getTime()),$e=K==="x"?be:Re,yt=Math.abs($e)/Ft;if(Math.abs($e)>=PO||yt>.11){Bt(va.current),(xe=m.onDismiss)==null||xe.call(m,m),fe(K==="x"?be>0?"right":"left":Re>0?"down":"up"),Qe(),pe(!0),Be(!1);return}V(!1),ee(null)},onPointerMove:ye=>{var Y,le,xe,be;if(!na.current||!ot||((Y=window.getSelection())==null?void 0:Y.toString().length)>0)return;let Re=ye.clientY-na.current.y,Ft=ye.clientX-na.current.x,$e=(le=t.swipeDirections)!=null?le:RO(q);!K&&(Math.abs(Ft)>1||Math.abs(Re)>1)&&ee(Math.abs(Ft)>Math.abs(Re)?"x":"y");let yt={x:0,y:0};K==="y"?($e.includes("top")||$e.includes("bottom"))&&($e.includes("top")&&Re<0||$e.includes("bottom")&&Re>0)&&(yt.y=Re):K==="x"&&($e.includes("left")||$e.includes("right"))&&($e.includes("left")&&Ft<0||$e.includes("right")&&Ft>0)&&(yt.x=Ft),(Math.abs(yt.x)>0||Math.abs(yt.y)>0)&&Be(!0),(xe=sa.current)==null||xe.style.setProperty("--swipe-amount-x",`${yt.x}px`),(be=sa.current)==null||be.style.setProperty("--swipe-amount-y",`${yt.y}px`)}},_a&&!m.jsx?p.createElement("button",{"aria-label":Q,"data-disabled":Ne,"data-close-button":!0,onClick:Ne||!ot?()=>{}:()=>{var ye;Qe(),(ye=m.onDismiss)==null||ye.call(m,m)},className:Xa(Z==null?void 0:Z.closeButton,(r=m==null?void 0:m.classNames)==null?void 0:r.closeButton)},(i=$==null?void 0:$.close)!=null?i:gO):null,m.jsx||p.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:p.createElement(p.Fragment,null,Lt||m.icon||m.promise?p.createElement("div",{"data-icon":"",className:Xa(Z==null?void 0:Z.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||dt():null,m.type!=="loading"?m.icon||($==null?void 0:$[Lt])||dO(Lt):null):null,p.createElement("div",{"data-content":"",className:Xa(Z==null?void 0:Z.content,(c=m==null?void 0:m.classNames)==null?void 0:c.content)},p.createElement("div",{"data-title":"",className:Xa(Z==null?void 0:Z.title,(h=m==null?void 0:m.classNames)==null?void 0:h.title)},typeof m.title=="function"?m.title():m.title),m.description?p.createElement("div",{"data-description":"",className:Xa(R,lt,Z==null?void 0:Z.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),p.isValidElement(m.cancel)?m.cancel:m.cancel&&rd(m.cancel)?p.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:ye=>{var Y,le;rd(m.cancel)&&ot&&((le=(Y=m.cancel).onClick)==null||le.call(Y,ye),Qe())},className:Xa(Z==null?void 0:Z.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,p.isValidElement(m.action)?m.action:m.action&&rd(m.action)?p.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:ye=>{var Y,le;rd(m.action)&&((le=(Y=m.action).onClick)==null||le.call(Y,ye),!ye.defaultPrevented&&Qe())},className:Xa(Z==null?void 0:Z.actionButton,(y=m==null?void 0:m.classNames)==null?void 0:y.actionButton)},m.action.label):null))};function O9(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function _O(t,a){let s={};return[t,a].forEach((n,r)=>{let i=r===1,l=i?"--mobile-offset":"--offset",c=i?LO:SO;function h(d){["top","right","bottom","left"].forEach(u=>{s[`${l}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?h(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?s[`${l}-${d}`]=c:s[`${l}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):h(c)}),s}p.forwardRef(function(t,a){let{invert:s,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:l,className:c,offset:h,mobileOffset:d,theme:u="light",richColors:y,duration:x,style:m,visibleToasts:g=CO,toastOptions:f,dir:k=O9(),gap:v=AO,loadingIcon:N,icons:M,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:C}=t,[S,L]=p.useState([]),w=p.useMemo(()=>Array.from(new Set([n].concat(S.filter(te=>te.position).map(te=>te.position)))),[S,n]),[j,I]=p.useState([]),[T,A]=p.useState(!1),[R,D]=p.useState(!1),[q,E]=p.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=p.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=p.useRef(null),$=p.useRef(!1),Q=p.useCallback(te=>{L(K=>{var ee;return(ee=K.find(ce=>ce.id===te.id))!=null&&ee.delete||oa.dismiss(te.id),K.filter(({id:ce})=>ce!==te.id)})},[]);return p.useEffect(()=>oa.subscribe(te=>{if(te.dismiss){L(K=>K.map(ee=>ee.id===te.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{eS.flushSync(()=>{L(K=>{let ee=K.findIndex(ce=>ce.id===te.id);return ee!==-1?[...K.slice(0,ee),{...K[ee],...te},...K.slice(ee+1)]:[te,...K]})})})}),[]),p.useEffect(()=>{if(u!=="system"){E(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light")),typeof window>"u")return;let te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:K})=>{E(K?"dark":"light")})}catch{te.addListener(({matches:ee})=>{try{E(ee?"dark":"light")}catch(ce){console.error(ce)}})}},[u]),p.useEffect(()=>{S.length<=1&&A(!1)},[S]),p.useEffect(()=>{let te=K=>{var ee,ce;r.every(fe=>K[fe]||K.code===fe)&&(A(!0),(ee=F.current)==null||ee.focus()),K.code==="Escape"&&(document.activeElement===F.current||(ce=F.current)!=null&&ce.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[r]),p.useEffect(()=>{if(F.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,$.current=!1)}},[F.current]),p.createElement("section",{ref:a,"aria-label":`${b} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},w.map((te,K)=>{var ee;let[ce,fe]=te.split("-");return S.length?p.createElement("ol",{key:te,dir:k==="auto"?O9():k,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":ce,"data-lifted":T&&S.length>1&&!i,"data-x-position":fe,style:{"--front-toast-height":`${((ee=j[0])==null?void 0:ee.height)||0}px`,"--width":`${IO}px`,"--gap":`${v}px`,...m,..._O(h,d)},onBlur:de=>{$.current&&!de.currentTarget.contains(de.relatedTarget)&&($.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||$.current||($.current=!0,Z.current=de.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{R||A(!1)},onDragEnd:()=>A(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},S.filter(de=>!de.position&&K===0||de.position===te).map((de,se)=>{var H,z;return p.createElement(DO,{key:de.id,icons:M,index:se,toast:de,defaultRichColors:y,duration:(H=f==null?void 0:f.duration)!=null?H:x,className:f==null?void 0:f.className,descriptionClassName:f==null?void 0:f.descriptionClassName,invert:s,visibleToasts:g,closeButton:(z=f==null?void 0:f.closeButton)!=null?z:l,interacting:R,position:te,style:f==null?void 0:f.style,unstyled:f==null?void 0:f.unstyled,classNames:f==null?void 0:f.classNames,cancelButtonStyle:f==null?void 0:f.cancelButtonStyle,actionButtonStyle:f==null?void 0:f.actionButtonStyle,removeToast:Q,toasts:S.filter(_=>_.position==de.position),heights:j.filter(_=>_.position==de.position),setHeights:I,expandByDefault:i,gap:v,loadingIcon:N,expanded:T,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});function zO({onComplete:t,onClose:a}){const{showModal:s,closeModal:n,dismissOnboarding:r,emailVerified:i,profileComplete:l,steps:c,isComplete:h}=lA(),[d,u]=p.useState(!1),[y,x]=p.useState(null),m=async()=>{u(!0),x(null),await new Promise(N=>setTimeout(N,1500)),x("We could not resend the verification email yet. Try again soon."),u(!1)},g=()=>{us.info("Email change flow would open here")},f=(N,M)=>{if(N)switch(N){case"resend_verification":m();break;case"edit_profile":us.info("Navigate to profile editing"),n(),a==null||a();break;default:console.log("Unknown action:",N,"for step:",M)}},k=()=>{r(),us.info("You can complete onboarding anytime from your dashboard"),a==null||a()},v=N=>{N||(n(),h&&t?t():a==null||a())};return e.jsx(rA,{open:s,onOpenChange:v,emailVerified:i,profileComplete:l,steps:c,onActionClick:f,onResendVerification:m,onChangeEmail:g,isResending:d,resendError:y,onDismiss:k})}const qO={complete:{Icon:Ee,iconClass:"text-primary",bgClass:"bg-primary/10"},pending:{Icon:Ps,iconClass:"text-amber-500",bgClass:"bg-amber-500/10"},blocked:{Icon:xs,iconClass:"text-muted-foreground",bgClass:"bg-muted"}};function cA({emailVerified:t,profileComplete:a,steps:s,progress:n,onActionClick:r,onOpenFullOnboarding:i,className:l}){if(s.every(u=>u.status==="complete"))return e.jsx(U,{className:l,children:e.jsxs(W,{className:"flex items-center gap-4 py-6",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:e.jsx(Ee,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold",children:"Onboarding complete!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You have full access to all features. Start exploring jobs and opportunities."})]})]})});const h=s.filter(u=>u.status==="complete").length,d=s.length;return e.jsxs(U,{className:l,children:[e.jsxs(ne,{className:"pb-3",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs(re,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Qt,{className:"h-5 w-5 text-amber-500"}),"Complete your setup"]}),e.jsxs(Ae,{className:"mt-1",children:[h," of ",d," steps done — finish to unlock all features"]})]})}),e.jsx(ya,{value:n,className:"mt-3 h-2","aria-label":"Onboarding progress"})]}),e.jsxs(W,{className:"pt-0",children:[e.jsx("div",{className:"divide-y divide-border rounded-lg border",children:s.map(u=>{const y=qO[u.status],x=y.Icon,m=u.status==="blocked",g=u.status==="pending",f=u.nextAction&&g;return e.jsxs("div",{className:"flex items-center gap-3 p-3 first:rounded-t-lg last:rounded-b-lg",children:[e.jsx("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full ${y.bgClass}`,children:e.jsx(x,{className:`h-4 w-4 ${y.iconClass}`})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:u.label}),u.helperText&&e.jsx("p",{className:"text-xs text-muted-foreground",children:u.helperText}),u.missingFields&&u.missingFields.length>0&&u.status!=="complete"&&e.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1",children:[u.missingFields.filter(k=>k.required).map(k=>e.jsx(O,{variant:"destructive",className:"text-[10px] px-1.5 py-0",children:k.label},k.key)),u.missingFields.filter(k=>!k.required).map(k=>e.jsxs(O,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[k.label," (optional)"]},k.key))]})]}),f&&u.nextAction&&e.jsxs(P,{size:"sm",variant:"default",onClick:()=>r==null?void 0:r(u.nextAction.actionId,u.id),children:[u.nextAction.label,e.jsx(la,{className:"ml-1 h-3 w-3"})]}),m&&e.jsx(O,{variant:"outline",className:"text-xs",children:"Locked"}),u.status==="complete"&&e.jsx(O,{variant:"default",className:"text-xs",children:"Done"})]},u.id)})}),i&&e.jsx(P,{variant:"link",size:"sm",className:"mt-3 h-auto p-0 text-xs",onClick:i,children:"View full onboarding details"})]})]})}function FO({userName:t,feedItems:a,alerts:s,snapshot:n,onSave:r,onApply:i,onEnroll:l,onRead:c,freelancerData:h,freelancerStats:d,isCandidateActive:u=!0,onStartFreelancerSetup:y,onFreelancerUpdate:x,onboardingSteps:m,emailVerified:g=!1,profileComplete:f=!1,onboardingProgress:k=0,onOnboardingAction:v,onOpenOnboarding:N}){const M=m&&m.length>0&&!m.every(S=>S.status==="complete"),b=S=>{switch(S){case"job":return Ce;case"course":return Ut;case"news":return aa;default:return Ce}},C=S=>{switch(S.type){case"job":return e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>r(S.id),children:"Save"}),e.jsx(P,{size:"sm",onClick:()=>i(S.id),children:"Apply"})]});case"course":return e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>r(S.id),children:"Save"}),e.jsx(P,{size:"sm",onClick:()=>l(S.id),children:"Enroll"})]});case"news":return e.jsx(P,{size:"sm",onClick:()=>c(S.id),children:"Read"});default:return null}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-3xl font-bold",children:["Welcome back, ",t," 👋"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Your personalized iGaming career hub"})]}),M&&m&&e.jsx(cA,{emailVerified:g,profileComplete:f,steps:m,progress:k,onActionClick:v,onOpenFullOnboarding:N}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsx("h3",{className:"text-xl font-semibold",children:"Your Feed"}),a.map(S=>{const L=b(S.type);return e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5 text-primary"}),e.jsx(O,{variant:"secondary",children:S.type})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:S.timestamp})]}),e.jsx(re,{className:"text-lg mt-2",children:S.title}),S.company&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(yl,{className:"h-4 w-4"}),S.company]}),S.location&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"h-4 w-4"}),S.location]})]}),e.jsx(Ae,{children:S.description})]}),e.jsxs(W,{children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:S.tags.map(w=>e.jsx(O,{variant:"outline",children:w},w))}),S.reason&&e.jsxs("p",{className:"text-xs text-muted-foreground mb-3 italic",children:["💡 ",S.reason]}),e.jsx("div",{className:"flex gap-2",children:C(S)})]})]},S.id)})]}),e.jsxs("div",{className:"space-y-4",children:[h&&d?e.jsx(tO,{freelancerData:h,stats:d,onToggleVisibility:S=>x==null?void 0:x({action:"toggle-visibility",visible:S}),onEditProfile:()=>x==null?void 0:x({action:"edit-profile"}),onPromote:()=>console.log("Promote freelancer profile")}):y?e.jsx(eO,{onStartSetup:y,isCandidateActive:u}):null,e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(jt,{className:"h-5 w-5"}),"Your iGaming Career Snapshot"]})}),e.jsx(W,{className:"space-y-3",children:n.map(S=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:S.label}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"font-semibold",children:S.value}),S.trend&&e.jsx("span",{className:"text-xs text-green-600 ml-2",children:S.trend})]})]},S.label))})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx($t,{className:"h-5 w-5"}),"Alerts & Notifications"]})}),e.jsx(W,{className:"space-y-3",children:s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No new alerts"}):s.map(S=>e.jsxs("div",{className:"p-3 rounded-lg bg-secondary/50 text-sm",children:[e.jsx(O,{variant:"outline",className:"mb-2",children:S.type}),e.jsx("p",{children:S.message})]},S.id))})]})]})]})]})}function EO({open:t,onClose:a,onAdded:s,existingExperience:n,onUpdated:r}){const i=new Date().getFullYear(),l=Array.from({length:40},(m,g)=>`${i-g}`),[c,h]=p.useState({title:"",company:"",startYear:"",endYear:"",isPresent:!1,location:"",summary:"",tags:""});p.useEffect(()=>{if(n){const[m,g]=n.period.split(" - ");h({title:n.title,company:n.company,startYear:m||"",endYear:g==="Present"?"":g||"",isPresent:g==="Present",location:n.location||"",summary:n.summary||"",tags:n.tags.join(", ")})}else h({title:"",company:"",startYear:"",endYear:"",isPresent:!1,location:"",summary:"",tags:""})},[n,t]);const[d,u]=p.useState(!1),y=(m,g)=>h(f=>({...f,[m]:g})),x=()=>{const m=c.isPresent?`${c.startYear} - Present`:`${c.startYear} - ${c.endYear}`,g={id:(n==null?void 0:n.id)||`temp-${Date.now()}`,title:c.title,company:c.company,period:m,summary:c.summary.trim()||void 0,location:c.location.trim()||void 0,tags:c.tags.split(",").map(f=>f.trim()).filter(Boolean)};n?r==null||r(g):s(g),h({title:"",company:"",startYear:"",endYear:"",isPresent:!1,location:"",summary:"",tags:""}),a()};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Le,{children:n?"Edit Work Experience":"Add Work Experience"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(B,{children:"Title"}),e.jsx(ae,{value:c.title,onChange:m=>y("title",m.target.value)})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Company"}),e.jsx(ae,{value:c.company,onChange:m=>y("company",m.target.value)})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Location (optional)"}),e.jsx(ae,{value:c.location,onChange:m=>y("location",m.target.value),placeholder:"e.g., Malta or Remote"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(B,{children:"Start Year"}),e.jsxs(Ye,{onValueChange:m=>y("startYear",m),value:c.startYear,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select year"})}),e.jsx(Ge,{children:l.map(m=>e.jsx(me,{value:m,children:m},m))})]})]}),!c.isPresent&&e.jsxs("div",{children:[e.jsx(B,{children:"End Year"}),e.jsxs(Ye,{onValueChange:m=>y("endYear",m),value:c.endYear,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select year"})}),e.jsx(Ge,{children:l.map(m=>e.jsx(me,{value:m,children:m},m))})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:"present",type:"checkbox",checked:c.isPresent,onChange:m=>y("isPresent",m.target.checked),className:"w-4 h-4 accent-primary"}),e.jsx(B,{htmlFor:"present",children:"I currently work here"})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Summary (optional)"}),e.jsx(rt,{placeholder:"e.g., Led product roadmap for iGaming platform",value:c.summary,onChange:m=>y("summary",m.target.value)})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Tags (comma-separated)"}),e.jsx(rt,{placeholder:"e.g., Product Strategy, iGaming, Agile",value:c.tags,onChange:m=>y("tags",m.target.value)})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:x,disabled:d||!c.title||!c.company||!c.startYear||!c.isPresent&&!c.endYear,children:d?"Saving...":n?"Save Changes":"Add Experience"})]})]})})}function B9({open:t,onClose:a,onAdded:s,title:n,placeholder:r}){const[i,l]=p.useState("");p.useEffect(()=>{t||l("")},[t]);const c=()=>{i.trim()&&(s(i.trim()),l(""),a())};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:n})}),e.jsx("div",{className:"space-y-4 py-2",children:e.jsxs("div",{children:[e.jsx(B,{children:n}),e.jsx(ae,{value:i,onChange:h=>l(h.target.value),placeholder:r||"Type and save"})]})}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,disabled:!i.trim(),children:"Add"})]})]})})}const H9=["Product Management","Project Management","Agile","Scrum","Leadership","Communication","Stakeholder Management","Game Design","Data Analysis","Marketing Strategy","UX/UI Design","Regulatory Compliance","Casino Operations","Sportsbook Operations","Frontend Development","Backend Development","React","TypeScript","Python","SQL","Kubernetes","Cloud Infrastructure"];function OO({open:t,onClose:a,onAdded:s}){const[n,r]=p.useState(""),[i,l]=p.useState(H9),c=()=>{n.trim()&&(s(n.trim()),r(""),a())},h=d=>{r(d);const u=H9.filter(y=>y.toLowerCase().includes(d.toLowerCase()));l(u)};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:"Add Skill"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"skill",children:"Skill Name"}),e.jsx(ae,{id:"skill",placeholder:"e.g. Product Strategy",value:n,onChange:d=>h(d.target.value)})]}),n&&i.length>0&&e.jsx("div",{className:"border rounded-md p-2 space-y-1 max-h-40 overflow-y-auto",children:i.map(d=>e.jsx("div",{className:"cursor-pointer px-2 py-1 hover:bg-muted rounded-md text-sm",onClick:()=>{r(d)},children:d},d))})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,disabled:!n.trim(),children:"Add Skill"})]})]})})}const V9=["Regulation","Technology","Market Trends","Responsible Gaming","Game Design","Payments","Marketing","AI in iGaming","Player Retention","Security"];function BO({open:t,onClose:a,onAdded:s}){const[n,r]=p.useState(""),[i,l]=p.useState(V9),c=()=>{n.trim()&&(s(n.trim()),r(""),a())},h=d=>{r(d),l(V9.filter(u=>u.toLowerCase().includes(d.toLowerCase())))};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:"Add Interested Topic"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"topic",children:"Topic"}),e.jsx(ae,{id:"topic",placeholder:"e.g. Game Design",value:n,onChange:d=>h(d.target.value)})]}),n&&i.length>0&&e.jsx("div",{className:"border rounded-md p-2 space-y-1 max-h-40 overflow-y-auto",children:i.map(d=>e.jsx("div",{className:"cursor-pointer px-2 py-1 hover:bg-muted rounded-md text-sm",onClick:()=>r(d),children:d},d))})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,disabled:!n.trim(),children:"Add Topic"})]})]})})}const HO=["English","Spanish","French","German","Italian","Portuguese","Polish","Turkish","Swedish","Norwegian","Finnish","Danish","Dutch","Japanese","Chinese","Korean"],VO=["Native","Fluent","Intermediate","Basic"];function UO({open:t,onClose:a,onAdded:s}){const[n,r]=p.useState({name:"",proficiency:""}),i=()=>{if(!n.name||!n.proficiency)return;const l={name:n.name,proficiency:n.proficiency};s(l),r({name:"",proficiency:""}),a()};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:"Add Language"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(B,{children:"Language"}),e.jsxs(Ye,{value:n.name,onValueChange:l=>r(c=>({...c,name:l})),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select a language"})}),e.jsx(Ge,{children:HO.map(l=>e.jsx(me,{value:l,children:l},l))})]})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Proficiency"}),e.jsxs(Ye,{value:n.proficiency,onValueChange:l=>r(c=>({...c,proficiency:l})),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select proficiency"})}),e.jsx(Ge,{children:VO.map(l=>e.jsx(me,{value:l,children:l},l))})]})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:i,disabled:!n.name||!n.proficiency,children:"Add"})]})]})})}function GO({profile:t,onUpdate:a,isSaving:s=!1,onboarding:n,emailVerified:r=!0}){var de,se,H;const[i,l]=p.useState(t),c=p.useRef(!1);p.useEffect(()=>{!c.current&&t&&t.personalDetails&&(l(t),c.current=!0)},[t]);const[h,d]=p.useState(!1),[u,y]=p.useState(null);p.useState(null);const[x,m]=p.useState(null),[g,f]=p.useState(!1),[k,v]=p.useState(!1),[N,M]=p.useState(!1),[b,C]=p.useState(!1),[S,L]=p.useState(!1),[w,j]=p.useState(!1),[I,T]=p.useState({firstName:!1,lastName:!1,country:!1}),A=p.useMemo(()=>{var _;const z={};return(_=n==null?void 0:n.missingFields)==null||_.forEach(V=>{z[V.key]={required:V.required,hint:V.hint}}),z},[n]),R={firstName:"first_name",lastName:"last_name",country:"country",phone:"phone",nationality:"nationality"},D=z=>{var V;const _=R[z];return!!((V=A[_])!=null&&V.required)},q=["Full-time","Part-time","Contract","Freelance","Internship","Temporary"],E=["English","Spanish","French","German","Italian","Portuguese","Polish","Turkish","Swedish","Norwegian","Finnish","Danish","Dutch","Japanese","Chinese","Korean"],F=()=>{u&&(l(z=>{const _={...z,workExperience:z.workExperience.filter(V=>V.id!==u)};return a({type:"profile",payload:_}),_}),y(null))},G=(z,_,V)=>{l(J=>({...J,[z]:{...J[z],[_]:V}}))},Z=(z,_,V)=>{l(J=>({...J,[z]:{...J[z],[_]:V}}))},$=!((de=i.personalDetails.firstName)!=null&&de.trim()),Q=!((se=i.personalDetails.lastName)!=null&&se.trim()),te=!((H=i.personalDetails.country)!=null&&H.trim()),K=()=>{j(!0),!($||Q||te)&&a({type:"profile",payload:i})},ee=(I.firstName||w)&&$,ce=(I.lastName||w)&&Q,fe=(I.country||w)&&te;return console.log(r),e.jsxs("div",{className:"space-y-6",children:[(n==null?void 0:n.enabled)&&n.missingFields&&n.missingFields.length>0&&e.jsxs(Vs,{variant:"default",className:"border-amber-500/50 bg-amber-500/5",children:[e.jsx(Qt,{className:"h-4 w-4 text-amber-500"}),e.jsx(Bc,{children:n.title||"Complete your profile to finish onboarding"}),e.jsxs(Us,{className:"mt-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:n.description||"These fields are required before you can access all features."}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[n.missingFields.filter(z=>z.required).map(z=>e.jsxs(O,{variant:"destructive",className:"text-xs",children:[z.label,z.hint&&e.jsxs("span",{className:"ml-1 opacity-70",children:["— ",z.hint]})]},z.key)),n.missingFields.filter(z=>!z.required).map(z=>e.jsxs(O,{variant:"outline",className:"text-xs",children:[z.label," (optional)"]},z.key))]})]})]}),(n==null?void 0:n.enabled)&&(!n.missingFields||n.missingFields.length===0)&&e.jsxs(Vs,{variant:"default",className:"border-primary/50 bg-primary/5",children:[e.jsx(Ee,{className:"h-4 w-4 text-primary"}),e.jsx(Bc,{children:"Profile complete!"}),e.jsx(Us,{children:"All required fields are filled. You have full access to all features."})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Your Profile"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your professional information"})]}),e.jsx(P,{onClick:K,disabled:s,children:s?"Saving...":"Save Changes"})]}),e.jsxs(ns,{defaultValue:"personal",className:"w-full",children:[e.jsxs(rs,{className:"grid w-full grid-cols-3 lg:grid-cols-7",children:[e.jsx(Me,{value:"personal",children:"Personal"}),e.jsx(Me,{value:"experience",children:"Experience"}),e.jsx(Me,{value:"job-search",children:"Job Search"}),e.jsx(Me,{value:"skills",children:"Skills"}),e.jsx(Me,{value:"languages",children:"Languages"}),e.jsx(Me,{value:"alerts",children:"Alerts"}),e.jsx(Me,{value:"preferences",children:"Preferences"})]}),e.jsx(ve,{value:"personal",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Personal Details"}),e.jsx(Ae,{children:"Update your personal information"})]}),e.jsx(W,{className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"firstName",children:"First Name *"}),e.jsx(ae,{id:"firstName",value:i.personalDetails.firstName??"",required:!0,className:ee?"border-destructive":"",onChange:z=>G("personalDetails","firstName",z.target.value),onBlur:()=>T(z=>({...z,firstName:!0}))}),ee||D("firstName")?e.jsx("p",{className:"text-xs text-destructive",children:"First name is required."}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"lastName",children:"Last Name *"}),e.jsx(ae,{id:"lastName",value:i.personalDetails.lastName??"",required:!0,className:ce?"border-destructive":"",onChange:z=>G("personalDetails","lastName",z.target.value),onBlur:()=>T(z=>({...z,lastName:!0}))}),ce||D("lastName")?e.jsx("p",{className:"text-xs text-destructive",children:"Last name is required."}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"email",children:"Email"}),e.jsx(ae,{id:"email",type:"email",value:i.personalDetails.email??"",onChange:z=>G("personalDetails","email",z.target.value)}),r?null:e.jsx("p",{className:"text-xs text-destructive",children:"Email is not verified."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"phone",children:"Phone"}),e.jsx(ae,{id:"phone",value:i.personalDetails.phone??"",onChange:z=>G("personalDetails","phone",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"city",children:"City"}),e.jsx(ae,{id:"city",value:i.personalDetails.city??"",onChange:z=>G("personalDetails","city",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"country",children:"Country *"}),e.jsx(ae,{id:"country",value:i.personalDetails.country??"",required:!0,className:fe?"border-destructive":"",onChange:z=>G("personalDetails","country",z.target.value),onBlur:()=>T(z=>({...z,country:!0}))}),fe||D("country")?e.jsx("p",{className:"text-xs text-destructive",children:"Country is required."}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"dob",children:"Date of Birth"}),e.jsx(ae,{id:"dob",type:"date",value:i.personalDetails.dob??"",onChange:z=>G("personalDetails","dob",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"address",children:"Address"}),e.jsx(ae,{id:"address",value:i.personalDetails.address??"",onChange:z=>G("personalDetails","address",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"nationality",children:"Nationality"}),e.jsx(ae,{id:"nationality",value:i.personalDetails.nationality??"",onChange:z=>G("personalDetails","nationality",z.target.value)})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(B,{htmlFor:"summary",children:"Summary"}),e.jsx(ae,{id:"summary",value:i.personalDetails.summary??"",onChange:z=>G("personalDetails","summary",z.target.value)})]})]})})]})}),e.jsx(ve,{value:"experience",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Work Experience"}),e.jsx(Ae,{children:"Your iGaming industry experience"})]}),e.jsxs(W,{className:"space-y-4",children:[i.workExperience.map(z=>e.jsxs("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:z.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:z.company}),e.jsx("p",{className:"text-xs text-muted-foreground",children:z.period}),z.location&&e.jsx("p",{className:"text-xs text-muted-foreground",children:z.location})]}),e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>{const _=i.workExperience.find(V=>V.id===z.id);m(_||null),d(!0)},children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>y(z.id),children:"Delete"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:z.tags.map(_=>e.jsx(O,{variant:"secondary",children:_},_))}),z.summary&&e.jsx("p",{className:"text-sm text-muted-foreground",children:z.summary})]},z.id)),e.jsx(P,{variant:"outline",className:"w-full",onClick:()=>d(!0),children:"Add Experience"})]})]})}),e.jsx(EO,{open:h,onClose:()=>{d(!1),m(null)},existingExperience:x,onAdded:z=>{l(_=>({..._,workExperience:[..._.workExperience,z]}))},onUpdated:z=>{l(_=>({..._,workExperience:_.workExperience.map(V=>V.id===z.id?z:V)}))}}),e.jsx(jn,{open:!!u,onOpenChange:()=>y(null),children:e.jsxs(qs,{children:[e.jsxs(Fs,{children:[e.jsx(Os,{children:"Delete Experience"}),e.jsx(Bs,{children:"Are you sure you want to delete this work experience? This action cannot be undone."})]}),e.jsxs(Es,{children:[e.jsx(Hs,{children:"Cancel"}),e.jsx(Cn,{onClick:F,className:"bg-destructive text-white",children:"Delete"})]})]})}),e.jsxs(ve,{value:"job-search",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Job Search Details"}),e.jsx(Ae,{children:"Define your ideal job preferences"})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Desired Roles"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.jobSearchDetails.desiredRoles.map(z=>e.jsxs(O,{variant:"secondary",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,desiredRoles:Array.from(new Set([..._.jobSearchDetails.desiredRoles,z]))}})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>f(!0),children:"Add Role"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Preferred Locations"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.jobSearchDetails.locations.map(z=>e.jsxs(O,{variant:"secondary",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,locations:_.jobSearchDetails.locations.filter(V=>V!==z)}})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>v(!0),children:"Add Location"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Employment Type"}),e.jsxs(IC,{children:[e.jsx(AC,{asChild:!0,children:e.jsx(P,{variant:"outline",className:"w-full justify-between",children:i.jobSearchDetails.employmentType.length>0?i.jobSearchDetails.employmentType.join(", "):"Select Employment Type"})}),e.jsx(U7,{className:"w-64 p-2 space-y-2",children:q.map(z=>{const _=i.jobSearchDetails.employmentType.includes(z);return e.jsxs("div",{className:"flex items-center space-x-2",onClick:()=>l(V=>{const pe=V.jobSearchDetails.employmentType.includes(z)?V.jobSearchDetails.employmentType.filter(ke=>ke!==z):[...V.jobSearchDetails.employmentType,z];return{...V,jobSearchDetails:{...V.jobSearchDetails,employmentType:pe}}}),children:[e.jsx(Xt,{checked:_}),e.jsx(B,{className:"text-sm",children:z})]},z)})})]})]})]})]}),e.jsx(B9,{open:g,onClose:()=>f(!1),title:"Add Desired Role",placeholder:"e.g. Senior Product Manager",onAdded:z=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,desiredRoles:[..._.jobSearchDetails.desiredRoles,z]}}))}),e.jsx(B9,{open:k,onClose:()=>v(!1),title:"Add Preferred Location",placeholder:"e.g. Malta or Remote",onAdded:z=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,locations:[..._.jobSearchDetails.locations,z]}}))})]}),e.jsxs(ve,{value:"skills",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Skill Set"}),e.jsx(Ae,{children:"Your professional skills and expertise"})]}),e.jsxs(W,{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:i.skills.map(z=>e.jsxs(O,{variant:"secondary",className:"flex items-center gap-1",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,skills:_.skills.filter(V=>V!==z)})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",onClick:()=>M(!0),children:"Add Skill"})]})]}),e.jsx(OO,{open:N,onClose:()=>M(!1),onAdded:z=>l(_=>({..._,skills:Array.from(new Set([..._.skills,z]))}))})]}),e.jsxs(ve,{value:"languages",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Languages"}),e.jsx(Ae,{children:"Your spoken and professional languages"})]}),e.jsxs(W,{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:i.languages.map((z,_)=>e.jsxs(O,{variant:"secondary",className:"flex items-center gap-1",children:[z.name," — ",z.proficiency,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(V=>({...V,languages:V.languages.filter((J,pe)=>pe!==_)})),children:"✕"})]},`${z.name}-${_}`))}),e.jsx(P,{variant:"outline",onClick:()=>L(!0),children:"Add Language"})]})]}),e.jsx(UO,{open:S,onClose:()=>L(!1),onAdded:z=>l(_=>({..._,languages:[..._.languages,z]}))})]}),e.jsx(ve,{value:"alerts",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Alerts & Subscriptions"}),e.jsx(Ae,{children:"Manage your notification preferences"})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"job-alerts",className:"text-base",children:"Job Alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Get notified about new job matches"})]}),e.jsx(vt,{id:"job-alerts",checked:i.alerts.jobAlerts,onCheckedChange:z=>Z("alerts","jobAlerts",z)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"course-alerts",className:"text-base",children:"Course Alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Updates on new courses and training"})]}),e.jsx(vt,{id:"course-alerts",checked:i.alerts.courseAlerts,onCheckedChange:z=>Z("alerts","courseAlerts",z)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"news-alerts",className:"text-base",children:"News Alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Industry news and updates"})]}),e.jsx(vt,{id:"news-alerts",checked:i.alerts.newsAlerts,onCheckedChange:z=>Z("alerts","newsAlerts",z)})]})]})]})}),e.jsxs(ve,{value:"preferences",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Preferences"}),e.jsx(Ae,{children:"Customize your platform experience"})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Interested Topics"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.preferences.topics.map(z=>e.jsxs(O,{variant:"secondary",className:"flex items-center gap-1",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,preferences:{..._.preferences,topics:_.preferences.topics.filter(V=>V!==z)}})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>C(!0),children:"Manage Topics"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"language",children:"Language"}),e.jsxs(Ye,{value:i.preferences.language,onValueChange:z=>G("preferences","language",z),children:[e.jsx(Ue,{id:"language",children:e.jsx(Je,{placeholder:"Select your preferred language"})}),e.jsx(Ge,{children:E.map(z=>e.jsx(me,{value:z,children:z},z))})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"email-notif",className:"text-base",children:"Email Notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive updates via email"})]}),e.jsx(vt,{id:"email-notif",checked:i.preferences.emailNotifications,onCheckedChange:z=>Z("preferences","emailNotifications",z)})]})]})]}),e.jsx(BO,{open:b,onClose:()=>C(!1),onAdded:z=>l(_=>({..._,preferences:{..._.preferences,topics:Array.from(new Set([..._.preferences.topics,z]))}}))})]})]})]})}const $O=t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,U9=800;function WO({onCVChange:t,previewText:a,previewStatus:s="idle",previewErrorMessage:n}){const[r,i]=p.useState(!1),[l,c]=p.useState(null),[h,d]=p.useState(null),[u,y]=p.useState(null),[x,m]=p.useState(!1);p.useEffect(()=>()=>{h&&URL.revokeObjectURL(h)},[h]);const g=p.useMemo(()=>l?{name:l.name,size:$O(l.size),lastModified:new Date(l.lastModified).toLocaleDateString()}:null,[l]),f=async b=>{var L;const C=(L=b.target.files)==null?void 0:L[0];if(!C)return;if(C.type!=="application/pdf"){y("Only PDF files are supported.");return}h&&URL.revokeObjectURL(h);const S=URL.createObjectURL(C);c(C),d(S),m(!1),t(C)},k=()=>{h&&URL.revokeObjectURL(h),c(null),d(null),y(null),m(!1),t(null)},v=(a==null?void 0:a.replace(/\s{2,}/g," ").replace(/\n{3,}/g,`
|
|
7925
|
+
`);function rd(t){return t.label!==void 0}var CO=3,SO="32px",LO="16px",E9=4e3,IO=356,AO=14,PO=20,TO=200;function Xa(...t){return t.filter(Boolean).join(" ")}function RO(t){let[a,s]=t.split("-"),n=[];return a&&n.push(a),s&&n.push(s),n}var DO=t=>{var a,s,n,r,i,l,c,h,d,u,y;let{invert:x,toast:m,unstyled:g,interacting:f,setHeights:k,visibleToasts:v,heights:N,index:M,toasts:b,expanded:C,removeToast:S,defaultRichColors:L,closeButton:w,style:j,cancelButtonStyle:I,actionButtonStyle:T,className:A="",descriptionClassName:R="",duration:D,position:q,gap:E,loadingIcon:F,expandByDefault:G,classNames:Z,icons:$,closeButtonAriaLabel:Q="Close toast",pauseWhenPageIsHidden:te}=t,[K,ee]=p.useState(null),[ce,fe]=p.useState(null),[de,se]=p.useState(!1),[H,z]=p.useState(!1),[_,V]=p.useState(!1),[J,pe]=p.useState(!1),[ke,Be]=p.useState(!1),[is,Bt]=p.useState(0),[he,_e]=p.useState(0),_t=p.useRef(m.duration||D||E9),pt=p.useRef(null),sa=p.useRef(null),fa=M===0,Sn=M+1<=v,Lt=m.type,ot=m.dismissible!==!1,$s=m.className||"",lt=m.descriptionClassName||"",Ya=p.useMemo(()=>N.findIndex(ye=>ye.toastId===m.id)||0,[N,m.id]),_a=p.useMemo(()=>{var ye;return(ye=m.closeButton)!=null?ye:w},[m.closeButton,w]),ka=p.useMemo(()=>m.duration||D||E9,[m.duration,D]),os=p.useRef(0),va=p.useRef(0),Ja=p.useRef(0),na=p.useRef(null),[ra,ge]=q.split("-"),Ie=p.useMemo(()=>N.reduce((ye,Y,le)=>le>=Ya?ye:ye+Y.height,0),[N,Ya]),Te=fO(),ze=m.invert||x,Ne=Lt==="loading";va.current=p.useMemo(()=>Ya*E+Ie,[Ya,Ie]),p.useEffect(()=>{_t.current=ka},[ka]),p.useEffect(()=>{se(!0)},[]),p.useEffect(()=>{let ye=sa.current;if(ye){let Y=ye.getBoundingClientRect().height;return _e(Y),k(le=>[{toastId:m.id,height:Y,position:m.position},...le]),()=>k(le=>le.filter(xe=>xe.toastId!==m.id))}},[k,m.id]),p.useLayoutEffect(()=>{if(!de)return;let ye=sa.current,Y=ye.style.height;ye.style.height="auto";let le=ye.getBoundingClientRect().height;ye.style.height=Y,_e(le),k(xe=>xe.find(be=>be.toastId===m.id)?xe.map(be=>be.toastId===m.id?{...be,height:le}:be):[{toastId:m.id,height:le,position:m.position},...xe])},[de,m.title,m.description,k,m.id]);let Qe=p.useCallback(()=>{z(!0),Bt(va.current),k(ye=>ye.filter(Y=>Y.toastId!==m.id)),setTimeout(()=>{S(m)},TO)},[m,S,k,va]);p.useEffect(()=>{if(m.promise&&Lt==="loading"||m.duration===1/0||m.type==="loading")return;let ye;return C||f||te&&Te?(()=>{if(Ja.current<os.current){let Y=new Date().getTime()-os.current;_t.current=_t.current-Y}Ja.current=new Date().getTime()})():_t.current!==1/0&&(os.current=new Date().getTime(),ye=setTimeout(()=>{var Y;(Y=m.onAutoClose)==null||Y.call(m,m),Qe()},_t.current)),()=>clearTimeout(ye)},[C,f,m,Lt,te,Te,Qe]),p.useEffect(()=>{m.delete&&Qe()},[Qe,m.delete]);function dt(){var ye,Y,le;return $!=null&&$.loading?p.createElement("div",{className:Xa(Z==null?void 0:Z.loader,(ye=m==null?void 0:m.classNames)==null?void 0:ye.loader,"sonner-loader"),"data-visible":Lt==="loading"},$.loading):F?p.createElement("div",{className:Xa(Z==null?void 0:Z.loader,(Y=m==null?void 0:m.classNames)==null?void 0:Y.loader,"sonner-loader"),"data-visible":Lt==="loading"},F):p.createElement(uO,{className:Xa(Z==null?void 0:Z.loader,(le=m==null?void 0:m.classNames)==null?void 0:le.loader),visible:Lt==="loading"})}return p.createElement("li",{tabIndex:0,ref:sa,className:Xa(A,$s,Z==null?void 0:Z.toast,(a=m==null?void 0:m.classNames)==null?void 0:a.toast,Z==null?void 0:Z.default,Z==null?void 0:Z[Lt],(s=m==null?void 0:m.classNames)==null?void 0:s[Lt]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:L,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":de,"data-promise":!!m.promise,"data-swiped":ke,"data-removed":H,"data-visible":Sn,"data-y-position":ra,"data-x-position":ge,"data-index":M,"data-front":fa,"data-swiping":_,"data-dismissible":ot,"data-type":Lt,"data-invert":ze,"data-swipe-out":J,"data-swipe-direction":ce,"data-expanded":!!(C||G&&de),style:{"--index":M,"--toasts-before":M,"--z-index":b.length-M,"--offset":`${H?is:va.current}px`,"--initial-height":G?"auto":`${he}px`,...j,...m.style},onDragEnd:()=>{V(!1),ee(null),na.current=null},onPointerDown:ye=>{Ne||!ot||(pt.current=new Date,Bt(va.current),ye.target.setPointerCapture(ye.pointerId),ye.target.tagName!=="BUTTON"&&(V(!0),na.current={x:ye.clientX,y:ye.clientY}))},onPointerUp:()=>{var ye,Y,le,xe;if(J||!ot)return;na.current=null;let be=Number(((ye=sa.current)==null?void 0:ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Re=Number(((Y=sa.current)==null?void 0:Y.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ft=new Date().getTime()-((le=pt.current)==null?void 0:le.getTime()),$e=K==="x"?be:Re,yt=Math.abs($e)/Ft;if(Math.abs($e)>=PO||yt>.11){Bt(va.current),(xe=m.onDismiss)==null||xe.call(m,m),fe(K==="x"?be>0?"right":"left":Re>0?"down":"up"),Qe(),pe(!0),Be(!1);return}V(!1),ee(null)},onPointerMove:ye=>{var Y,le,xe,be;if(!na.current||!ot||((Y=window.getSelection())==null?void 0:Y.toString().length)>0)return;let Re=ye.clientY-na.current.y,Ft=ye.clientX-na.current.x,$e=(le=t.swipeDirections)!=null?le:RO(q);!K&&(Math.abs(Ft)>1||Math.abs(Re)>1)&&ee(Math.abs(Ft)>Math.abs(Re)?"x":"y");let yt={x:0,y:0};K==="y"?($e.includes("top")||$e.includes("bottom"))&&($e.includes("top")&&Re<0||$e.includes("bottom")&&Re>0)&&(yt.y=Re):K==="x"&&($e.includes("left")||$e.includes("right"))&&($e.includes("left")&&Ft<0||$e.includes("right")&&Ft>0)&&(yt.x=Ft),(Math.abs(yt.x)>0||Math.abs(yt.y)>0)&&Be(!0),(xe=sa.current)==null||xe.style.setProperty("--swipe-amount-x",`${yt.x}px`),(be=sa.current)==null||be.style.setProperty("--swipe-amount-y",`${yt.y}px`)}},_a&&!m.jsx?p.createElement("button",{"aria-label":Q,"data-disabled":Ne,"data-close-button":!0,onClick:Ne||!ot?()=>{}:()=>{var ye;Qe(),(ye=m.onDismiss)==null||ye.call(m,m)},className:Xa(Z==null?void 0:Z.closeButton,(r=m==null?void 0:m.classNames)==null?void 0:r.closeButton)},(i=$==null?void 0:$.close)!=null?i:gO):null,m.jsx||p.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:p.createElement(p.Fragment,null,Lt||m.icon||m.promise?p.createElement("div",{"data-icon":"",className:Xa(Z==null?void 0:Z.icon,(l=m==null?void 0:m.classNames)==null?void 0:l.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||dt():null,m.type!=="loading"?m.icon||($==null?void 0:$[Lt])||dO(Lt):null):null,p.createElement("div",{"data-content":"",className:Xa(Z==null?void 0:Z.content,(c=m==null?void 0:m.classNames)==null?void 0:c.content)},p.createElement("div",{"data-title":"",className:Xa(Z==null?void 0:Z.title,(h=m==null?void 0:m.classNames)==null?void 0:h.title)},typeof m.title=="function"?m.title():m.title),m.description?p.createElement("div",{"data-description":"",className:Xa(R,lt,Z==null?void 0:Z.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),p.isValidElement(m.cancel)?m.cancel:m.cancel&&rd(m.cancel)?p.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:ye=>{var Y,le;rd(m.cancel)&&ot&&((le=(Y=m.cancel).onClick)==null||le.call(Y,ye),Qe())},className:Xa(Z==null?void 0:Z.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,p.isValidElement(m.action)?m.action:m.action&&rd(m.action)?p.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:ye=>{var Y,le;rd(m.action)&&((le=(Y=m.action).onClick)==null||le.call(Y,ye),!ye.defaultPrevented&&Qe())},className:Xa(Z==null?void 0:Z.actionButton,(y=m==null?void 0:m.classNames)==null?void 0:y.actionButton)},m.action.label):null))};function O9(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function _O(t,a){let s={};return[t,a].forEach((n,r)=>{let i=r===1,l=i?"--mobile-offset":"--offset",c=i?LO:SO;function h(d){["top","right","bottom","left"].forEach(u=>{s[`${l}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?h(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?s[`${l}-${d}`]=c:s[`${l}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):h(c)}),s}p.forwardRef(function(t,a){let{invert:s,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:i,closeButton:l,className:c,offset:h,mobileOffset:d,theme:u="light",richColors:y,duration:x,style:m,visibleToasts:g=CO,toastOptions:f,dir:k=O9(),gap:v=AO,loadingIcon:N,icons:M,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:C}=t,[S,L]=p.useState([]),w=p.useMemo(()=>Array.from(new Set([n].concat(S.filter(te=>te.position).map(te=>te.position)))),[S,n]),[j,I]=p.useState([]),[T,A]=p.useState(!1),[R,D]=p.useState(!1),[q,E]=p.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=p.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=p.useRef(null),$=p.useRef(!1),Q=p.useCallback(te=>{L(K=>{var ee;return(ee=K.find(ce=>ce.id===te.id))!=null&&ee.delete||oa.dismiss(te.id),K.filter(({id:ce})=>ce!==te.id)})},[]);return p.useEffect(()=>oa.subscribe(te=>{if(te.dismiss){L(K=>K.map(ee=>ee.id===te.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{eS.flushSync(()=>{L(K=>{let ee=K.findIndex(ce=>ce.id===te.id);return ee!==-1?[...K.slice(0,ee),{...K[ee],...te},...K.slice(ee+1)]:[te,...K]})})})}),[]),p.useEffect(()=>{if(u!=="system"){E(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light")),typeof window>"u")return;let te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:K})=>{E(K?"dark":"light")})}catch{te.addListener(({matches:ee})=>{try{E(ee?"dark":"light")}catch(ce){console.error(ce)}})}},[u]),p.useEffect(()=>{S.length<=1&&A(!1)},[S]),p.useEffect(()=>{let te=K=>{var ee,ce;r.every(fe=>K[fe]||K.code===fe)&&(A(!0),(ee=F.current)==null||ee.focus()),K.code==="Escape"&&(document.activeElement===F.current||(ce=F.current)!=null&&ce.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[r]),p.useEffect(()=>{if(F.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,$.current=!1)}},[F.current]),p.createElement("section",{ref:a,"aria-label":`${b} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},w.map((te,K)=>{var ee;let[ce,fe]=te.split("-");return S.length?p.createElement("ol",{key:te,dir:k==="auto"?O9():k,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":ce,"data-lifted":T&&S.length>1&&!i,"data-x-position":fe,style:{"--front-toast-height":`${((ee=j[0])==null?void 0:ee.height)||0}px`,"--width":`${IO}px`,"--gap":`${v}px`,...m,..._O(h,d)},onBlur:de=>{$.current&&!de.currentTarget.contains(de.relatedTarget)&&($.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||$.current||($.current=!0,Z.current=de.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{R||A(!1)},onDragEnd:()=>A(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},S.filter(de=>!de.position&&K===0||de.position===te).map((de,se)=>{var H,z;return p.createElement(DO,{key:de.id,icons:M,index:se,toast:de,defaultRichColors:y,duration:(H=f==null?void 0:f.duration)!=null?H:x,className:f==null?void 0:f.className,descriptionClassName:f==null?void 0:f.descriptionClassName,invert:s,visibleToasts:g,closeButton:(z=f==null?void 0:f.closeButton)!=null?z:l,interacting:R,position:te,style:f==null?void 0:f.style,unstyled:f==null?void 0:f.unstyled,classNames:f==null?void 0:f.classNames,cancelButtonStyle:f==null?void 0:f.cancelButtonStyle,actionButtonStyle:f==null?void 0:f.actionButtonStyle,removeToast:Q,toasts:S.filter(_=>_.position==de.position),heights:j.filter(_=>_.position==de.position),setHeights:I,expandByDefault:i,gap:v,loadingIcon:N,expanded:T,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});function zO({onComplete:t,onClose:a}){const{showModal:s,closeModal:n,dismissOnboarding:r,emailVerified:i,profileComplete:l,steps:c,isComplete:h}=lA(),[d,u]=p.useState(!1),[y,x]=p.useState(null),m=async()=>{u(!0),x(null),await new Promise(N=>setTimeout(N,1500)),x("We could not resend the verification email yet. Try again soon."),u(!1)},g=()=>{us.info("Email change flow would open here")},f=(N,M)=>{if(N)switch(N){case"resend_verification":m();break;case"edit_profile":us.info("Navigate to profile editing"),n(),a==null||a();break;default:console.log("Unknown action:",N,"for step:",M)}},k=()=>{r(),us.info("You can complete onboarding anytime from your dashboard"),a==null||a()},v=N=>{N||(n(),h&&t?t():a==null||a())};return e.jsx(rA,{open:s,onOpenChange:v,emailVerified:i,profileComplete:l,steps:c,onActionClick:f,onResendVerification:m,onChangeEmail:g,isResending:d,resendError:y,onDismiss:k})}const qO={complete:{Icon:Ee,iconClass:"text-primary",bgClass:"bg-primary/10"},pending:{Icon:Ps,iconClass:"text-amber-500",bgClass:"bg-amber-500/10"},blocked:{Icon:xs,iconClass:"text-muted-foreground",bgClass:"bg-muted"}};function cA({emailVerified:t,profileComplete:a,steps:s,progress:n,onActionClick:r,onOpenFullOnboarding:i,className:l}){if(s.every(u=>u.status==="complete"))return e.jsx(U,{className:l,children:e.jsxs(W,{className:"flex items-center gap-4 py-6",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:e.jsx(Ee,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold",children:"Onboarding complete!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You have full access to all features. Start exploring jobs and opportunities."})]})]})});const h=s.filter(u=>u.status==="complete").length,d=s.length;return e.jsxs(U,{className:l,children:[e.jsxs(ne,{className:"pb-3",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs(re,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Qt,{className:"h-5 w-5 text-amber-500"}),"Complete your setup"]}),e.jsxs(Ae,{className:"mt-1",children:[h," of ",d," steps done — finish to unlock all features"]})]})}),e.jsx(ya,{value:n,className:"mt-3 h-2","aria-label":"Onboarding progress"})]}),e.jsxs(W,{className:"pt-0",children:[e.jsx("div",{className:"divide-y divide-border rounded-lg border",children:s.map(u=>{const y=qO[u.status],x=y.Icon,m=u.status==="blocked",g=u.status==="pending",f=u.nextAction&&g;return e.jsxs("div",{className:"flex items-center gap-3 p-3 first:rounded-t-lg last:rounded-b-lg",children:[e.jsx("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full ${y.bgClass}`,children:e.jsx(x,{className:`h-4 w-4 ${y.iconClass}`})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:u.label}),u.helperText&&e.jsx("p",{className:"text-xs text-muted-foreground",children:u.helperText}),u.missingFields&&u.missingFields.length>0&&u.status!=="complete"&&e.jsxs("div",{className:"mt-1.5 flex flex-wrap gap-1",children:[u.missingFields.filter(k=>k.required).map(k=>e.jsx(O,{variant:"destructive",className:"text-[10px] px-1.5 py-0",children:k.label},k.key)),u.missingFields.filter(k=>!k.required).map(k=>e.jsxs(O,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[k.label," (optional)"]},k.key))]})]}),f&&u.nextAction&&e.jsxs(P,{size:"sm",variant:"default",onClick:()=>r==null?void 0:r(u.nextAction.actionId,u.id),children:[u.nextAction.label,e.jsx(la,{className:"ml-1 h-3 w-3"})]}),m&&e.jsx(O,{variant:"outline",className:"text-xs",children:"Locked"}),u.status==="complete"&&e.jsx(O,{variant:"default",className:"text-xs",children:"Done"})]},u.id)})}),i&&e.jsx(P,{variant:"link",size:"sm",className:"mt-3 h-auto p-0 text-xs",onClick:i,children:"View full onboarding details"})]})]})}function FO({userName:t,feedItems:a,alerts:s,snapshot:n,onSave:r,onApply:i,onEnroll:l,onRead:c,freelancerData:h,freelancerStats:d,isCandidateActive:u=!0,onStartFreelancerSetup:y,onFreelancerUpdate:x,onboardingSteps:m,emailVerified:g=!1,profileComplete:f=!1,onboardingProgress:k=0,onOnboardingAction:v,onOpenOnboarding:N}){const M=m&&m.length>0&&!m.every(S=>S.status==="complete"),b=S=>{switch(S){case"job":return Ce;case"course":return Ut;case"news":return aa;default:return Ce}},C=S=>{switch(S.type){case"job":return e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>r(S.id),children:"Save"}),e.jsx(P,{size:"sm",onClick:()=>i(S.id),children:"Apply"})]});case"course":return e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>r(S.id),children:"Save"}),e.jsx(P,{size:"sm",onClick:()=>l(S.id),children:"Enroll"})]});case"news":return e.jsx(P,{size:"sm",onClick:()=>c(S.id),children:"Read"});default:return null}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-3xl font-bold",children:["Welcome back, ",t," 👋"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Your personalized iGaming career hub"})]}),M&&m&&e.jsx(cA,{emailVerified:g,profileComplete:f,steps:m,progress:k,onActionClick:v,onOpenFullOnboarding:N}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsx("h3",{className:"text-xl font-semibold",children:"Your Feed"}),a.map(S=>{const L=b(S.type);return e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5 text-primary"}),e.jsx(O,{variant:"secondary",children:S.type})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:S.timestamp})]}),e.jsx(re,{className:"text-lg mt-2",children:S.title}),S.company&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(yl,{className:"h-4 w-4"}),S.company]}),S.location&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"h-4 w-4"}),S.location]})]}),e.jsx(Ae,{children:S.description})]}),e.jsxs(W,{children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:S.tags.map(w=>e.jsx(O,{variant:"outline",children:w},w))}),S.reason&&e.jsxs("p",{className:"text-xs text-muted-foreground mb-3 italic",children:["💡 ",S.reason]}),e.jsx("div",{className:"flex gap-2",children:C(S)})]})]},S.id)})]}),e.jsxs("div",{className:"space-y-4",children:[h&&d?e.jsx(tO,{freelancerData:h,stats:d,onToggleVisibility:S=>x==null?void 0:x({action:"toggle-visibility",visible:S}),onEditProfile:()=>x==null?void 0:x({action:"edit-profile"}),onPromote:()=>console.log("Promote freelancer profile")}):y?e.jsx(eO,{onStartSetup:y,isCandidateActive:u}):null,e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(jt,{className:"h-5 w-5"}),"Your iGaming Career Snapshot"]})}),e.jsx(W,{className:"space-y-3",children:n.map(S=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:S.label}),e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"font-semibold",children:S.value}),S.trend&&e.jsx("span",{className:"text-xs text-green-600 ml-2",children:S.trend})]})]},S.label))})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx($t,{className:"h-5 w-5"}),"Alerts & Notifications"]})}),e.jsx(W,{className:"space-y-3",children:s.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No new alerts"}):s.map(S=>e.jsxs("div",{className:"p-3 rounded-lg bg-secondary/50 text-sm",children:[e.jsx(O,{variant:"outline",className:"mb-2",children:S.type}),e.jsx("p",{children:S.message})]},S.id))})]})]})]})]})}function EO({open:t,onClose:a,onAdded:s,existingExperience:n,onUpdated:r}){const i=new Date().getFullYear(),l=Array.from({length:40},(m,g)=>`${i-g}`),[c,h]=p.useState({title:"",company:"",startYear:"",endYear:"",isPresent:!1,location:"",summary:"",tags:""});p.useEffect(()=>{if(n){const[m,g]=n.period.split(" - ");h({title:n.title,company:n.company,startYear:m||"",endYear:g==="Present"?"":g||"",isPresent:g==="Present",location:n.location||"",summary:n.summary||"",tags:n.tags.join(", ")})}else h({title:"",company:"",startYear:"",endYear:"",isPresent:!1,location:"",summary:"",tags:""})},[n,t]);const[d,u]=p.useState(!1),y=(m,g)=>h(f=>({...f,[m]:g})),x=()=>{const m=c.isPresent?`${c.startYear} - Present`:`${c.startYear} - ${c.endYear}`,g={id:(n==null?void 0:n.id)||`temp-${Date.now()}`,title:c.title,company:c.company,period:m,summary:c.summary.trim()||void 0,location:c.location.trim()||void 0,tags:c.tags.split(",").map(f=>f.trim()).filter(Boolean)};n?r==null||r(g):s(g),h({title:"",company:"",startYear:"",endYear:"",isPresent:!1,location:"",summary:"",tags:""}),a()};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Le,{children:n?"Edit Work Experience":"Add Work Experience"}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(B,{children:"Title"}),e.jsx(ae,{value:c.title,onChange:m=>y("title",m.target.value)})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Company"}),e.jsx(ae,{value:c.company,onChange:m=>y("company",m.target.value)})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Location (optional)"}),e.jsx(ae,{value:c.location,onChange:m=>y("location",m.target.value),placeholder:"e.g., Malta or Remote"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(B,{children:"Start Year"}),e.jsxs(Ye,{onValueChange:m=>y("startYear",m),value:c.startYear,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select year"})}),e.jsx(Ge,{children:l.map(m=>e.jsx(me,{value:m,children:m},m))})]})]}),!c.isPresent&&e.jsxs("div",{children:[e.jsx(B,{children:"End Year"}),e.jsxs(Ye,{onValueChange:m=>y("endYear",m),value:c.endYear,children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select year"})}),e.jsx(Ge,{children:l.map(m=>e.jsx(me,{value:m,children:m},m))})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{id:"present",type:"checkbox",checked:c.isPresent,onChange:m=>y("isPresent",m.target.checked),className:"w-4 h-4 accent-primary"}),e.jsx(B,{htmlFor:"present",children:"I currently work here"})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Summary (optional)"}),e.jsx(rt,{placeholder:"e.g., Led product roadmap for iGaming platform",value:c.summary,onChange:m=>y("summary",m.target.value)})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Tags (comma-separated)"}),e.jsx(rt,{placeholder:"e.g., Product Strategy, iGaming, Agile",value:c.tags,onChange:m=>y("tags",m.target.value)})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:x,disabled:d||!c.title||!c.company||!c.startYear||!c.isPresent&&!c.endYear,children:d?"Saving...":n?"Save Changes":"Add Experience"})]})]})})}function B9({open:t,onClose:a,onAdded:s,title:n,placeholder:r}){const[i,l]=p.useState("");p.useEffect(()=>{t||l("")},[t]);const c=()=>{i.trim()&&(s(i.trim()),l(""),a())};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:n})}),e.jsx("div",{className:"space-y-4 py-2",children:e.jsxs("div",{children:[e.jsx(B,{children:n}),e.jsx(ae,{value:i,onChange:h=>l(h.target.value),placeholder:r||"Type and save"})]})}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,disabled:!i.trim(),children:"Add"})]})]})})}const H9=["Product Management","Project Management","Agile","Scrum","Leadership","Communication","Stakeholder Management","Game Design","Data Analysis","Marketing Strategy","UX/UI Design","Regulatory Compliance","Casino Operations","Sportsbook Operations","Frontend Development","Backend Development","React","TypeScript","Python","SQL","Kubernetes","Cloud Infrastructure"];function OO({open:t,onClose:a,onAdded:s}){const[n,r]=p.useState(""),[i,l]=p.useState(H9),c=()=>{n.trim()&&(s(n.trim()),r(""),a())},h=d=>{r(d);const u=H9.filter(y=>y.toLowerCase().includes(d.toLowerCase()));l(u)};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:"Add Skill"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"skill",children:"Skill Name"}),e.jsx(ae,{id:"skill",placeholder:"e.g. Product Strategy",value:n,onChange:d=>h(d.target.value)})]}),n&&i.length>0&&e.jsx("div",{className:"border rounded-md p-2 space-y-1 max-h-40 overflow-y-auto",children:i.map(d=>e.jsx("div",{className:"cursor-pointer px-2 py-1 hover:bg-muted rounded-md text-sm",onClick:()=>{r(d)},children:d},d))})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,disabled:!n.trim(),children:"Add Skill"})]})]})})}const V9=["Regulation","Technology","Market Trends","Responsible Gaming","Game Design","Payments","Marketing","AI in iGaming","Player Retention","Security"];function BO({open:t,onClose:a,onAdded:s}){const[n,r]=p.useState(""),[i,l]=p.useState(V9),c=()=>{n.trim()&&(s(n.trim()),r(""),a())},h=d=>{r(d),l(V9.filter(u=>u.toLowerCase().includes(d.toLowerCase())))};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:"Add Interested Topic"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"topic",children:"Topic"}),e.jsx(ae,{id:"topic",placeholder:"e.g. Game Design",value:n,onChange:d=>h(d.target.value)})]}),n&&i.length>0&&e.jsx("div",{className:"border rounded-md p-2 space-y-1 max-h-40 overflow-y-auto",children:i.map(d=>e.jsx("div",{className:"cursor-pointer px-2 py-1 hover:bg-muted rounded-md text-sm",onClick:()=>r(d),children:d},d))})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:c,disabled:!n.trim(),children:"Add Topic"})]})]})})}const HO=["English","Spanish","French","German","Italian","Portuguese","Polish","Turkish","Swedish","Norwegian","Finnish","Danish","Dutch","Japanese","Chinese","Korean"],VO=["Native","Fluent","Intermediate","Basic"];function UO({open:t,onClose:a,onAdded:s}){const[n,r]=p.useState({name:"",proficiency:""}),i=()=>{if(!n.name||!n.proficiency)return;const l={name:n.name,proficiency:n.proficiency};s(l),r({name:"",proficiency:""}),a()};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{children:[e.jsx(Oe,{children:e.jsx(Le,{children:"Add Language"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{children:[e.jsx(B,{children:"Language"}),e.jsxs(Ye,{value:n.name,onValueChange:l=>r(c=>({...c,name:l})),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select a language"})}),e.jsx(Ge,{children:HO.map(l=>e.jsx(me,{value:l,children:l},l))})]})]}),e.jsxs("div",{children:[e.jsx(B,{children:"Proficiency"}),e.jsxs(Ye,{value:n.proficiency,onValueChange:l=>r(c=>({...c,proficiency:l})),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select proficiency"})}),e.jsx(Ge,{children:VO.map(l=>e.jsx(me,{value:l,children:l},l))})]})]})]}),e.jsxs(at,{children:[e.jsx(P,{variant:"outline",onClick:a,children:"Cancel"}),e.jsx(P,{onClick:i,disabled:!n.name||!n.proficiency,children:"Add"})]})]})})}function GO({profile:t,onUpdate:a,isSaving:s=!1,onboarding:n,emailVerified:r=!0}){var de,se,H;const[i,l]=p.useState(t),c=p.useRef(!1);p.useEffect(()=>{!c.current&&t&&t.personalDetails&&(l(t),c.current=!0)},[t]);const[h,d]=p.useState(!1),[u,y]=p.useState(null);p.useState(null);const[x,m]=p.useState(null),[g,f]=p.useState(!1),[k,v]=p.useState(!1),[N,M]=p.useState(!1),[b,C]=p.useState(!1),[S,L]=p.useState(!1),[w,j]=p.useState(!1),[I,T]=p.useState({firstName:!1,lastName:!1,country:!1}),A=p.useMemo(()=>{var _;const z={};return(_=n==null?void 0:n.missingFields)==null||_.forEach(V=>{z[V.key]={required:V.required,hint:V.hint}}),z},[n]),R={firstName:"first_name",lastName:"last_name",country:"country",phone:"phone",nationality:"nationality"},D=z=>{var V;const _=R[z];return!!((V=A[_])!=null&&V.required)},q=["Full-time","Part-time","Contract","Freelance","Internship","Temporary"],E=["English","Spanish","French","German","Italian","Portuguese","Polish","Turkish","Swedish","Norwegian","Finnish","Danish","Dutch","Japanese","Chinese","Korean"],F=()=>{u&&(l(z=>{const _={...z,workExperience:z.workExperience.filter(V=>V.id!==u)};return a({type:"profile",payload:_}),_}),y(null))},G=(z,_,V)=>{l(J=>({...J,[z]:{...J[z],[_]:V}}))},Z=(z,_,V)=>{l(J=>({...J,[z]:{...J[z],[_]:V}}))},$=!((de=i.personalDetails.firstName)!=null&&de.trim()),Q=!((se=i.personalDetails.lastName)!=null&&se.trim()),te=!((H=i.personalDetails.country)!=null&&H.trim()),K=()=>{j(!0),!($||Q||te)&&a({type:"profile",payload:i})},ee=(I.firstName||w)&&$,ce=(I.lastName||w)&&Q,fe=(I.country||w)&&te;return e.jsxs("div",{className:"space-y-6",children:[(n==null?void 0:n.enabled)&&n.missingFields&&n.missingFields.length>0&&e.jsxs(Vs,{variant:"default",className:"border-amber-500/50 bg-amber-500/5",children:[e.jsx(Qt,{className:"h-4 w-4 text-amber-500"}),e.jsx(Bc,{children:n.title||"Complete your profile to finish onboarding"}),e.jsxs(Us,{className:"mt-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:n.description||"These fields are required before you can access all features."}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[n.missingFields.filter(z=>z.required).map(z=>e.jsxs(O,{variant:"destructive",className:"text-xs",children:[z.label,z.hint&&e.jsxs("span",{className:"ml-1 opacity-70",children:["— ",z.hint]})]},z.key)),n.missingFields.filter(z=>!z.required).map(z=>e.jsxs(O,{variant:"outline",className:"text-xs",children:[z.label," (optional)"]},z.key))]})]})]}),(n==null?void 0:n.enabled)&&(!n.missingFields||n.missingFields.length===0)&&e.jsxs(Vs,{variant:"default",className:"border-primary/50 bg-primary/5",children:[e.jsx(Ee,{className:"h-4 w-4 text-primary"}),e.jsx(Bc,{children:"Profile complete!"}),e.jsx(Us,{children:"All required fields are filled. You have full access to all features."})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Your Profile"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your professional information"})]}),e.jsx(P,{onClick:K,disabled:s,children:s?"Saving...":"Save Changes"})]}),e.jsxs(ns,{defaultValue:"personal",className:"w-full",children:[e.jsxs(rs,{className:"grid w-full grid-cols-3 lg:grid-cols-7",children:[e.jsx(Me,{value:"personal",children:"Personal"}),e.jsx(Me,{value:"experience",children:"Experience"}),e.jsx(Me,{value:"job-search",children:"Job Search"}),e.jsx(Me,{value:"skills",children:"Skills"}),e.jsx(Me,{value:"languages",children:"Languages"}),e.jsx(Me,{value:"alerts",children:"Alerts"}),e.jsx(Me,{value:"preferences",children:"Preferences"})]}),e.jsx(ve,{value:"personal",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Personal Details"}),e.jsx(Ae,{children:"Update your personal information"})]}),e.jsx(W,{className:"space-y-4",children:e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"firstName",children:"First Name *"}),e.jsx(ae,{id:"firstName",value:i.personalDetails.firstName??"",required:!0,className:ee?"border-destructive":"",onChange:z=>G("personalDetails","firstName",z.target.value),onBlur:()=>T(z=>({...z,firstName:!0}))}),ee||D("firstName")?e.jsx("p",{className:"text-xs text-destructive",children:"First name is required."}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"lastName",children:"Last Name *"}),e.jsx(ae,{id:"lastName",value:i.personalDetails.lastName??"",required:!0,className:ce?"border-destructive":"",onChange:z=>G("personalDetails","lastName",z.target.value),onBlur:()=>T(z=>({...z,lastName:!0}))}),ce||D("lastName")?e.jsx("p",{className:"text-xs text-destructive",children:"Last name is required."}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"email",children:"Email"}),e.jsx(ae,{id:"email",type:"email",value:i.personalDetails.email??"",onChange:z=>G("personalDetails","email",z.target.value)}),r?null:e.jsx("p",{className:"text-xs text-destructive",children:"Email is not verified."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"phone",children:"Phone"}),e.jsx(ae,{id:"phone",value:i.personalDetails.phone??"",onChange:z=>G("personalDetails","phone",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"city",children:"City"}),e.jsx(ae,{id:"city",value:i.personalDetails.city??"",onChange:z=>G("personalDetails","city",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"country",children:"Country *"}),e.jsx(ae,{id:"country",value:i.personalDetails.country??"",required:!0,className:fe?"border-destructive":"",onChange:z=>G("personalDetails","country",z.target.value),onBlur:()=>T(z=>({...z,country:!0}))}),fe||D("country")?e.jsx("p",{className:"text-xs text-destructive",children:"Country is required."}):null]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"dob",children:"Date of Birth"}),e.jsx(ae,{id:"dob",type:"date",value:i.personalDetails.dob??"",onChange:z=>G("personalDetails","dob",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"address",children:"Address"}),e.jsx(ae,{id:"address",value:i.personalDetails.address??"",onChange:z=>G("personalDetails","address",z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"nationality",children:"Nationality"}),e.jsx(ae,{id:"nationality",value:i.personalDetails.nationality??"",onChange:z=>G("personalDetails","nationality",z.target.value)})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx(B,{htmlFor:"summary",children:"Summary"}),e.jsx(ae,{id:"summary",value:i.personalDetails.summary??"",onChange:z=>G("personalDetails","summary",z.target.value)})]})]})})]})}),e.jsx(ve,{value:"experience",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Work Experience"}),e.jsx(Ae,{children:"Your iGaming industry experience"})]}),e.jsxs(W,{className:"space-y-4",children:[i.workExperience.map(z=>e.jsxs("div",{className:"p-4 border rounded-lg space-y-2 relative group",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:z.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:z.company}),e.jsx("p",{className:"text-xs text-muted-foreground",children:z.period}),z.location&&e.jsx("p",{className:"text-xs text-muted-foreground",children:z.location})]}),e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:()=>{const _=i.workExperience.find(V=>V.id===z.id);m(_||null),d(!0)},children:"Edit"}),e.jsx(P,{variant:"destructive",size:"sm",onClick:()=>y(z.id),children:"Delete"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:z.tags.map(_=>e.jsx(O,{variant:"secondary",children:_},_))}),z.summary&&e.jsx("p",{className:"text-sm text-muted-foreground",children:z.summary})]},z.id)),e.jsx(P,{variant:"outline",className:"w-full",onClick:()=>d(!0),children:"Add Experience"})]})]})}),e.jsx(EO,{open:h,onClose:()=>{d(!1),m(null)},existingExperience:x,onAdded:z=>{l(_=>({..._,workExperience:[..._.workExperience,z]}))},onUpdated:z=>{l(_=>({..._,workExperience:_.workExperience.map(V=>V.id===z.id?z:V)}))}}),e.jsx(jn,{open:!!u,onOpenChange:()=>y(null),children:e.jsxs(qs,{children:[e.jsxs(Fs,{children:[e.jsx(Os,{children:"Delete Experience"}),e.jsx(Bs,{children:"Are you sure you want to delete this work experience? This action cannot be undone."})]}),e.jsxs(Es,{children:[e.jsx(Hs,{children:"Cancel"}),e.jsx(Cn,{onClick:F,className:"bg-destructive text-white",children:"Delete"})]})]})}),e.jsxs(ve,{value:"job-search",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Job Search Details"}),e.jsx(Ae,{children:"Define your ideal job preferences"})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Desired Roles"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.jobSearchDetails.desiredRoles.map(z=>e.jsxs(O,{variant:"secondary",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,desiredRoles:Array.from(new Set([..._.jobSearchDetails.desiredRoles,z]))}})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>f(!0),children:"Add Role"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Preferred Locations"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.jobSearchDetails.locations.map(z=>e.jsxs(O,{variant:"secondary",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,locations:_.jobSearchDetails.locations.filter(V=>V!==z)}})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>v(!0),children:"Add Location"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Employment Type"}),e.jsxs(IC,{children:[e.jsx(AC,{asChild:!0,children:e.jsx(P,{variant:"outline",className:"w-full justify-between",children:i.jobSearchDetails.employmentType.length>0?i.jobSearchDetails.employmentType.join(", "):"Select Employment Type"})}),e.jsx(U7,{className:"w-64 p-2 space-y-2",children:q.map(z=>{const _=i.jobSearchDetails.employmentType.includes(z);return e.jsxs("div",{className:"flex items-center space-x-2",onClick:()=>l(V=>{const pe=V.jobSearchDetails.employmentType.includes(z)?V.jobSearchDetails.employmentType.filter(ke=>ke!==z):[...V.jobSearchDetails.employmentType,z];return{...V,jobSearchDetails:{...V.jobSearchDetails,employmentType:pe}}}),children:[e.jsx(Xt,{checked:_}),e.jsx(B,{className:"text-sm",children:z})]},z)})})]})]})]})]}),e.jsx(B9,{open:g,onClose:()=>f(!1),title:"Add Desired Role",placeholder:"e.g. Senior Product Manager",onAdded:z=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,desiredRoles:[..._.jobSearchDetails.desiredRoles,z]}}))}),e.jsx(B9,{open:k,onClose:()=>v(!1),title:"Add Preferred Location",placeholder:"e.g. Malta or Remote",onAdded:z=>l(_=>({..._,jobSearchDetails:{..._.jobSearchDetails,locations:[..._.jobSearchDetails.locations,z]}}))})]}),e.jsxs(ve,{value:"skills",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Skill Set"}),e.jsx(Ae,{children:"Your professional skills and expertise"})]}),e.jsxs(W,{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:i.skills.map(z=>e.jsxs(O,{variant:"secondary",className:"flex items-center gap-1",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,skills:_.skills.filter(V=>V!==z)})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",onClick:()=>M(!0),children:"Add Skill"})]})]}),e.jsx(OO,{open:N,onClose:()=>M(!1),onAdded:z=>l(_=>({..._,skills:Array.from(new Set([..._.skills,z]))}))})]}),e.jsxs(ve,{value:"languages",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Languages"}),e.jsx(Ae,{children:"Your spoken and professional languages"})]}),e.jsxs(W,{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:i.languages.map((z,_)=>e.jsxs(O,{variant:"secondary",className:"flex items-center gap-1",children:[z.name," — ",z.proficiency,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(V=>({...V,languages:V.languages.filter((J,pe)=>pe!==_)})),children:"✕"})]},`${z.name}-${_}`))}),e.jsx(P,{variant:"outline",onClick:()=>L(!0),children:"Add Language"})]})]}),e.jsx(UO,{open:S,onClose:()=>L(!1),onAdded:z=>l(_=>({..._,languages:[..._.languages,z]}))})]}),e.jsx(ve,{value:"alerts",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Alerts & Subscriptions"}),e.jsx(Ae,{children:"Manage your notification preferences"})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"job-alerts",className:"text-base",children:"Job Alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Get notified about new job matches"})]}),e.jsx(vt,{id:"job-alerts",checked:i.alerts.jobAlerts,onCheckedChange:z=>Z("alerts","jobAlerts",z)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"course-alerts",className:"text-base",children:"Course Alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Updates on new courses and training"})]}),e.jsx(vt,{id:"course-alerts",checked:i.alerts.courseAlerts,onCheckedChange:z=>Z("alerts","courseAlerts",z)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"news-alerts",className:"text-base",children:"News Alerts"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Industry news and updates"})]}),e.jsx(vt,{id:"news-alerts",checked:i.alerts.newsAlerts,onCheckedChange:z=>Z("alerts","newsAlerts",z)})]})]})]})}),e.jsxs(ve,{value:"preferences",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:"Preferences"}),e.jsx(Ae,{children:"Customize your platform experience"})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Interested Topics"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:i.preferences.topics.map(z=>e.jsxs(O,{variant:"secondary",className:"flex items-center gap-1",children:[z,e.jsx(P,{variant:"ghost",size:"sm",className:"ml-1 text-xs text-muted-foreground hover:text-destructive",onClick:()=>l(_=>({..._,preferences:{..._.preferences,topics:_.preferences.topics.filter(V=>V!==z)}})),children:"✕"})]},z))}),e.jsx(P,{variant:"outline",size:"sm",onClick:()=>C(!0),children:"Manage Topics"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"language",children:"Language"}),e.jsxs(Ye,{value:i.preferences.language,onValueChange:z=>G("preferences","language",z),children:[e.jsx(Ue,{id:"language",children:e.jsx(Je,{placeholder:"Select your preferred language"})}),e.jsx(Ge,{children:E.map(z=>e.jsx(me,{value:z,children:z},z))})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"email-notif",className:"text-base",children:"Email Notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive updates via email"})]}),e.jsx(vt,{id:"email-notif",checked:i.preferences.emailNotifications,onCheckedChange:z=>Z("preferences","emailNotifications",z)})]})]})]}),e.jsx(BO,{open:b,onClose:()=>C(!1),onAdded:z=>l(_=>({..._,preferences:{..._.preferences,topics:Array.from(new Set([..._.preferences.topics,z]))}}))})]})]})]})}const $O=t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,U9=800;function WO({onCVChange:t,previewText:a,previewStatus:s="idle",previewErrorMessage:n}){const[r,i]=p.useState(!1),[l,c]=p.useState(null),[h,d]=p.useState(null),[u,y]=p.useState(null),[x,m]=p.useState(!1);p.useEffect(()=>()=>{h&&URL.revokeObjectURL(h)},[h]);const g=p.useMemo(()=>l?{name:l.name,size:$O(l.size),lastModified:new Date(l.lastModified).toLocaleDateString()}:null,[l]),f=async b=>{var L;const C=(L=b.target.files)==null?void 0:L[0];if(!C)return;if(C.type!=="application/pdf"){y("Only PDF files are supported.");return}h&&URL.revokeObjectURL(h);const S=URL.createObjectURL(C);c(C),d(S),m(!1),t(C)},k=()=>{h&&URL.revokeObjectURL(h),c(null),d(null),y(null),m(!1),t(null)},v=(a==null?void 0:a.replace(/\s{2,}/g," ").replace(/\n{3,}/g,`
|
|
7926
7926
|
|
|
7927
7927
|
`).trim())??"",N=v.length>U9,M=x?v:N?`${v.slice(0,U9)}…`:v;return e.jsxs(st,{open:r,onOpenChange:i,children:[e.jsx(xI,{asChild:!0,children:e.jsxs(P,{children:[e.jsx(an,{className:"h-4 w-4 mr-2"}),"Upload CV"]})}),e.jsxs(Xe,{className:"sm:max-w-2xl",children:[e.jsxs(Oe,{children:[e.jsx(Le,{children:"Upload your CV"}),e.jsx(it,{children:"Add a PDF so we can extract key details and keep it ready for job applications."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{type:"file",accept:"application/pdf",onChange:f}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Accepted format: PDF only. Text extraction should be handled by the host application if needed."})]}),u&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:u}),l&&g&&e.jsxs("div",{className:"rounded-md border border-muted p-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ha,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:g.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.size," • Updated ",g.lastModified]})]})]}),e.jsx(O,{variant:"secondary",children:"Stored"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[h&&e.jsx(P,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",children:"View PDF"})}),e.jsxs(P,{variant:"destructive",size:"sm",onClick:k,children:[e.jsx(un,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]}),e.jsxs("div",{className:"rounded-md border border-muted p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"font-medium",children:"Extracted preview"}),s==="parsing"&&e.jsx(O,{variant:"outline",children:"Parsing..."})]}),s==="error"?e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n||"Text preview is unavailable for this file."}):M?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-2 max-h-48 overflow-y-auto rounded-md border bg-muted/30 p-2",children:e.jsx("p",{className:"whitespace-pre-wrap text-sm text-muted-foreground",children:M})}),N&&e.jsx(P,{variant:"link",size:"sm",className:"px-0",onClick:()=>m(b=>!b),children:x?"Show less":"Show full text"})]}):e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Upload a PDF to preview extracted text from the host app."})]})]}),e.jsx(at,{children:e.jsx(P,{variant:"outline",onClick:()=>i(!1),children:"Close"})})]})]})}function ZO({savedJobs:t,applications:a,recommendedJobs:s,onApply:n,onRemove:r,onUploadCV:i,cvPreviewText:l,cvPreviewStatus:c,cvPreviewErrorMessage:h,onSetAlert:d,onUpdateProfile:u}){const y=N=>({savedJobs:N.saved,recommendedJobs:N.recommended,applications:N.applications}),[x,m]=p.useState({saved:t||[],recommended:s||[],applications:a||[]});p.useEffect(()=>{m({saved:t||[],recommended:s||[],applications:a||[]})},[t,s,a]);const g=N=>{m(M=>{if(M.saved.some(S=>S.id===N.id))return M;const C={...M,saved:[...M.saved,N]};return u==null||u({type:"jobs",payload:y(C)}),C})},f=N=>{m(M=>{const b={...M,saved:M.saved.filter(C=>C.id!==N)};return u==null||u({type:"jobs",payload:y(b)}),b})},k=N=>{m(M=>{const b={...M,recommended:M.recommended.filter(C=>C.id!==N)};return u==null||u({type:"jobs",payload:y(b)}),b})},v=N=>{const M=x.recommended.find(b=>b.id===N);M&&(m(b=>{const C={...b,applications:[...b.applications,{...M,status:"Applied",appliedDate:new Date().toLocaleDateString()}]};return u==null||u({type:"jobs",payload:y(C)}),C}),n(N))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Jobs"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your job search"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{variant:"outline",onClick:d,children:"Set Job Alerts"}),e.jsx(WO,{onCVChange:i,previewText:l,previewStatus:c,previewErrorMessage:h})]})]}),e.jsxs(ns,{defaultValue:"recommended",className:"w-full",children:[e.jsxs(rs,{className:"grid w-full grid-cols-3 lg:grid-cols-3",children:[e.jsxs(Me,{value:"recommended",children:["Recommended (",x.recommended.length,")"]}),e.jsxs(Me,{value:"saved",children:[e.jsx(Aa,{className:"h-4 w-4 mr-2"}),"Saved (",x.saved.length,")"]}),e.jsxs(Me,{value:"applications",children:[e.jsx(Ce,{className:"h-4 w-4 mr-2"}),"Applications (",x.applications.length,")"]})]}),e.jsx(ve,{value:"recommended",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4",children:x.recommended.map(N=>e.jsx(w7,{job:N,view:"recommended",isSaved:x.saved.some(M=>M.id===N.id),onApply:v,onSave:g,onRemove:k},N.id))})}),e.jsx(ve,{value:"saved",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4",children:x.saved.length===0?e.jsx(U,{children:e.jsxs(W,{className:"flex flex-col items-center justify-center py-10",children:[e.jsx(Aa,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No saved jobs yet"}),e.jsx(P,{variant:"link",className:"mt-2",children:"Browse Jobs"})]})}):x.saved.map(N=>e.jsx(w7,{job:N,view:"saved",onRemove:f},N.id))})}),e.jsx(ve,{value:"applications",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4",children:x.applications.length===0?e.jsx(U,{children:e.jsxs(W,{className:"flex flex-col items-center justify-center py-10",children:[e.jsx(Ce,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No applications yet"}),e.jsx(P,{variant:"link",className:"mt-2",children:"Start Applying"})]})}):x.applications.map(N=>e.jsx(w7,{job:N,view:"applications",onViewApplication:()=>{}},N.id))})})]})]})}function YO({enrolledCourses:t,savedCourses:a,recommendedCourses:s,certificates:n,onEnroll:r,onContinue:i,onExplore:l,onSave:c,onRemoveSaved:h,onRemoveRecommended:d}){const[u,y]=p.useState({enrolled:t||[],recommended:s||[],saved:a||[]});p.useEffect(()=>{y({enrolled:t||[],recommended:s||[],saved:a||[]})},[t,s,a]);const x=v=>r(v),m=v=>{y(N=>{if(N.saved.some(C=>C.id===v.id))return N;const b={...N,saved:[...N.saved,{...v,saved:!0}],recommended:N.recommended.map(C=>C.id===v.id?{...C,saved:!0}:C)};return c==null||c(v.id),b})},g=v=>{y(N=>{const M={...N,saved:N.saved.filter(b=>b.id!==v),recommended:N.recommended.map(b=>b.id===v?{...b,saved:!1}:b)};return h==null||h(v),M})},f=v=>{y(N=>{const M={...N,recommended:N.recommended.filter(b=>b.id!==v)};return d==null||d(v),M})},k=({course:v,view:N})=>{const M=u.saved.some(b=>b.id===v.id);return e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(re,{className:"text-lg",children:v.title}),e.jsx(Ae,{children:v.provider})]}),e.jsx(O,{variant:"outline",children:v.level})]})}),e.jsx(W,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsx("span",{children:v.duration}),v.certificate&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Vt,{className:"h-4 w-4"}),"Certificate"]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:v.tags.map(b=>e.jsx(O,{variant:"secondary",children:b},b))}),N==="enrolled"&&v.progress!==void 0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Progress"}),e.jsxs("span",{className:"font-medium",children:[v.progress,"%"]})]}),e.jsx(ya,{value:v.progress})]}),N==="recommended"&&v.reason&&e.jsxs("p",{className:"text-xs text-muted-foreground italic",children:["💡 ",v.reason]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[N==="enrolled"&&e.jsx(P,{className:"sm:w-auto w-full",onClick:()=>i(v.id),children:"Continue Learning"}),N==="recommended"&&e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"sm:w-auto w-full",onClick:()=>x(v.id),children:"Enroll Now"}),e.jsx(P,{variant:M?"secondary":"outline",className:"sm:w-auto w-full",size:"sm",disabled:M,onClick:()=>m(v),children:M?"Saved":"Save Course"}),e.jsx(P,{variant:"destructive",size:"sm",className:"sm:w-auto w-full",onClick:()=>f(v.id),children:"Remove"}),!d&&e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Remove not available yet"})]}),N==="saved"&&e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"sm:w-auto w-full",size:"sm",onClick:()=>x(v.id),children:"Start Course"}),e.jsx(P,{variant:"destructive",size:"sm",className:"sm:w-auto w-full",onClick:()=>g(v.id),children:"Remove Saved"}),!h&&e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Remove from saved not available yet"})]})]})]})})]})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Courses"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Advance your iGaming career"})]}),e.jsx(P,{onClick:l,children:"Explore All Courses"})]}),e.jsxs(ns,{defaultValue:"enrolled",className:"w-full",children:[e.jsxs(rs,{className:"grid w-full grid-cols-3 lg:grid-cols-4",children:[e.jsxs(Me,{value:"enrolled",children:[e.jsx(Ut,{className:"h-4 w-4 mr-2"}),"Enrolled (",u.enrolled.length,")"]}),e.jsxs(Me,{value:"recommended",children:[e.jsx(jt,{className:"h-4 w-4 mr-2"}),"Recommended (",u.recommended.length,")"]}),e.jsxs(Me,{value:"saved",children:[e.jsx(Aa,{className:"h-4 w-4 mr-2"}),"Saved (",u.saved.length,")"]}),e.jsxs(Me,{value:"certificates",children:[e.jsx(Vt,{className:"h-4 w-4 mr-2"}),"Certificates (",n.length,")"]})]}),e.jsx(ve,{value:"enrolled",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:u.enrolled.length===0?e.jsx(U,{className:"md:col-span-2",children:e.jsxs(W,{className:"flex flex-col items-center justify-center py-10",children:[e.jsx(Ut,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No enrolled courses yet"}),e.jsx(P,{variant:"link",className:"mt-2",onClick:l,children:"Browse Courses"})]})}):u.enrolled.map(v=>e.jsx(k,{course:v,view:"enrolled"},v.id))})}),e.jsx(ve,{value:"recommended",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:u.recommended.map(v=>e.jsx(k,{course:v,view:"recommended"},v.id))})}),e.jsx(ve,{value:"saved",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:u.saved.length===0?e.jsx(U,{className:"md:col-span-2",children:e.jsxs(W,{className:"flex flex-col items-center justify-center py-10",children:[e.jsx(Aa,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No saved courses yet"}),e.jsx(P,{variant:"link",className:"mt-2",onClick:l,children:"Browse Courses"}),!c&&e.jsx("p",{className:"text-[11px] text-muted-foreground mt-2",children:"Saving courses not available yet"})]})}):u.saved.map(v=>e.jsx(k,{course:v,view:"saved"},v.id))})}),e.jsx(ve,{value:"certificates",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:n.length===0?e.jsx(U,{className:"md:col-span-2",children:e.jsxs(W,{className:"flex flex-col items-center justify-center py-10",children:[e.jsx(Vt,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No certificates yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Complete courses to earn certificates"})]})}):n.map(v=>e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-accent/10",children:e.jsx(Vt,{className:"h-6 w-6 text-accent"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(re,{className:"text-base",children:v.title}),e.jsx(Ae,{children:v.issuer}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Issued: ",v.date]})]})]})}),e.jsx(W,{children:e.jsx(P,{variant:"outline",size:"sm",className:"w-full",children:"Download Certificate"})})]},v.id))})})]})]})}function JO({recommendedNews:t,savedArticles:a,categories:s,selectedCategory:n,onRead:r,onSave:i,onRemoveSaved:l,onRemoveRecommended:c,onCategoryChange:h,onManagePreferences:d}){const[u,y]=p.useState({recommended:t||[],saved:a||[]});p.useEffect(()=>{y({recommended:t||[],saved:a||[]})},[t,a]);const x=f=>{y(k=>{if(k.saved.some(M=>M.id===f.id))return k;const N={recommended:k.recommended.map(M=>M.id===f.id?{...M,saved:!0}:M),saved:[...k.saved,{...f,saved:!0}]};return i(f.id),N})},m=f=>{y(k=>{const v={recommended:k.recommended.map(N=>N.id===f?{...N,saved:!1}:N),saved:k.saved.filter(N=>N.id!==f)};return l==null||l(f),v})},g=f=>{y(k=>{const v={...k,recommended:k.recommended.filter(N=>N.id!==f)};return c==null||c(f),v})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"News"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Stay updated with iGaming industry"})]}),e.jsxs(P,{variant:"outline",onClick:d,children:[e.jsx(Ds,{className:"h-4 w-4 mr-2"}),"Preferences"]})]}),e.jsxs(ns,{defaultValue:"recommended",className:"w-full",children:[e.jsxs(rs,{children:[e.jsxs(Me,{value:"recommended",children:[e.jsx(aa,{className:"h-4 w-4 mr-2"}),"Recommended (",u.recommended.length,")"]}),e.jsxs(Me,{value:"saved",children:[e.jsx(Aa,{className:"h-4 w-4 mr-2"}),"Saved (",u.saved.length,")"]})]}),e.jsxs(ve,{value:"recommended",className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx(P,{variant:n==="all"?"default":"outline",size:"sm",onClick:()=>h("all"),children:"All"}),s.map(f=>e.jsx(P,{variant:n===f?"default":"outline",size:"sm",onClick:()=>h(f),children:f},f))]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:u.recommended.map(f=>e.jsx($N,{article:f,view:"recommended",isSaved:u.saved.some(k=>k.id===f.id),onRead:r,onSave:x,onRemove:g},f.id))})]}),e.jsx(ve,{value:"saved",className:"space-y-4",children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:u.saved.length===0?e.jsx(U,{className:"md:col-span-2",children:e.jsxs(W,{className:"flex flex-col items-center justify-center py-10",children:[e.jsx(Aa,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No saved articles yet"}),e.jsx(P,{variant:"link",className:"mt-2",onClick:d,children:"Browse News"})]})}):u.saved.map(f=>e.jsx($N,{article:f,view:"saved",onRead:r,onRemove:m},f.id))})})]})]})}const KO=["Malta","Remote","Gibraltar","Sweden","UK","Cyprus","Isle of Man","Curacao"],XO=["Casino Ops","Sportsbook","Compliance","Affiliate","Game Dev","Live Casino","Payments","UI/UX","Marketing","Legal","HR","Data Analytics"],QO=["Compliance","KYC/AML","Regulatory Consulting","Risk Management","Product Management","Game Development","Unity","C#","Affiliate Management","iGaming Platforms","Payment Integration"],D7=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tc.Root,{className:oe("grid gap-2",t),...a,ref:s}));D7.displayName=Tc.Root.displayName;const Is=ie.forwardRef(({className:t,...a},s)=>e.jsx(Tc.Item,{ref:s,className:oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(Tc.Indicator,{className:"flex items-center justify-center",children:e.jsx(Ps,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Is.displayName=Tc.Item.displayName;const eB=t=>{let a=0;return t.headline&&(a+=20),t.bio&&t.bio.length>=100&&(a+=20),t.primarySkills&&t.primarySkills.length>=3&&(a+=20),(t.hourlyRateMin||t.hourlyRateMax)&&(a+=15),t.availability&&(a+=10),t.portfolioItems&&t.portfolioItems.length>0&&(a+=15),Math.min(100,a)};function tB({open:t,onOpenChange:a,isCandidateActive:s=!0,onComplete:n,onSaveDraft:r}){var j,I,T;const[i,l]=p.useState(1),[c,h]=p.useState({appearanceMode:s?"both_freelance_fulltime":"freelance_only",preferredLocations:[],verticals:[],headline:"",bio:"",primarySkills:[],availability:"part_time",portfolioItems:[]}),[d,u]=p.useState(""),[y,x]=p.useState(""),[m,g]=p.useState(""),[f,k]=p.useState(""),v=eB(c),N=(((j=c.verticals)==null?void 0:j.length)??0)>=3,M=p.useCallback((A,R)=>{h(D=>{const q=D[A]||[],E=q.includes(R);return{...D,[A]:E?q.filter(F=>F!==R):[...q,R]}})},[]),b=p.useCallback((A,R,D)=>{R.trim()&&(h(q=>({...q,[A]:[...q[A]||[],R.trim()]})),D(""))},[]),C=p.useCallback(()=>{if(!f.trim())return;const A={id:`link-${Date.now()}`,type:"link",title:f,url:f};h(R=>({...R,portfolioItems:[...R.portfolioItems||[],A]})),k("")},[f]),S=p.useCallback(A=>{h(R=>({...R,portfolioItems:(R.portfolioItems||[]).filter(D=>D.id!==A)}))},[]),L=()=>{const A=new Date().toISOString(),R={appearanceMode:c.appearanceMode||"both_freelance_fulltime",preferredLocations:c.preferredLocations||[],verticals:c.verticals||[],headline:c.headline||"",bio:c.bio||"",primarySkills:c.primarySkills||[],hourlyRateMin:c.hourlyRateMin,hourlyRateMax:c.hourlyRateMax,availability:c.availability||"part_time",portfolioItems:c.portfolioItems||[],isPublic:!0,isDraft:!1,profileStrength:v,createdAt:A,updatedAt:A};n(R),a(!1)},w=()=>{r({...c,isDraft:!0,isPublic:!1}),a(!1)};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsx(Xe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:i===1?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsx(Le,{children:"Set Up as Freelancer"}),e.jsx(it,{children:"Great! Let's make you discoverable."})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs(B,{className:"text-sm font-medium",children:["How do you want to appear? ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(D7,{value:c.appearanceMode,onValueChange:A=>h(R=>({...R,appearanceMode:A})),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Is,{value:"freelance_only",id:"freelance_only"}),e.jsx(B,{htmlFor:"freelance_only",className:"font-normal",children:"Freelance gigs only"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Is,{value:"both_freelance_fulltime",id:"both"}),e.jsx(B,{htmlFor:"both",className:"font-normal",children:"Both freelance + open to full-time jobs"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(B,{className:"text-sm font-medium",children:"Preferred locations"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:KO.map(A=>{var R,D;return e.jsxs(O,{variant:(R=c.preferredLocations)!=null&&R.includes(A)?"default":"outline",className:"cursor-pointer",onClick:()=>M("preferredLocations",A),children:[A,((D=c.preferredLocations)==null?void 0:D.includes(A))&&e.jsx(Ve,{className:"ml-1 h-3 w-3"})]},A)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{placeholder:"+ Add location",value:d,onChange:A=>u(A.target.value),onKeyDown:A=>A.key==="Enter"&&b("preferredLocations",d,u),className:"flex-1"}),e.jsx(P,{variant:"outline",size:"icon",onClick:()=>b("preferredLocations",d,u),children:e.jsx(St,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(B,{className:"text-sm font-medium",children:["Your main freelance verticals (pick 3–5) ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:XO.map(A=>{var R,D;return e.jsxs(O,{variant:(R=c.verticals)!=null&&R.includes(A)?"default":"outline",className:"cursor-pointer",onClick:()=>M("verticals",A),children:[A,((D=c.verticals)==null?void 0:D.includes(A))&&e.jsx(Ve,{className:"ml-1 h-3 w-3"})]},A)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{placeholder:"+ Custom vertical",value:y,onChange:A=>x(A.target.value),onKeyDown:A=>A.key==="Enter"&&b("verticals",y,x),className:"flex-1"}),e.jsx(P,{variant:"outline",size:"icon",onClick:()=>b("verticals",y,x),children:e.jsx(St,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected: ",((I=c.verticals)==null?void 0:I.length)??0,"/5"]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(P,{onClick:()=>l(2),disabled:!N,children:["Continue",e.jsx(Ia,{className:"ml-2 h-4 w-4"})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(Le,{children:"Freelancer Profile Setup"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ya,{value:v,className:"flex-1 h-2"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[v,"% complete"]})]})]})}),e.jsxs("div",{className:"space-y-5 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{htmlFor:"headline",children:["Headline ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ae,{id:"headline",placeholder:'e.g. "iGaming AML Specialist | Ex-MGA Auditor"',value:c.headline,onChange:A=>h(R=>({...R,headline:A.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"bio",children:"Short Bio (150–300 chars)"}),e.jsx(rt,{id:"bio",placeholder:"Tell clients what you do best...",value:c.bio,onChange:A=>h(R=>({...R,bio:A.target.value})),maxLength:300,rows:3}),e.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[((T=c.bio)==null?void 0:T.length)??0,"/300"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Primary Skills"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:QO.map(A=>{var R,D;return e.jsxs(O,{variant:(R=c.primarySkills)!=null&&R.includes(A)?"default":"outline",className:"cursor-pointer",onClick:()=>M("primarySkills",A),children:[A,((D=c.primarySkills)==null?void 0:D.includes(A))&&e.jsx(Ve,{className:"ml-1 h-3 w-3"})]},A)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{placeholder:"+ Add skill",value:m,onChange:A=>g(A.target.value),onKeyDown:A=>A.key==="Enter"&&b("primarySkills",m,g),className:"flex-1"}),e.jsx(P,{variant:"outline",size:"icon",onClick:()=>b("primarySkills",m,g),children:e.jsx(St,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Hourly Rate (optional)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"€"}),e.jsx(ae,{type:"number",placeholder:"Min",className:"w-24",value:c.hourlyRateMin??"",onChange:A=>h(R=>({...R,hourlyRateMin:Number(A.target.value)||void 0}))}),e.jsx("span",{className:"text-muted-foreground",children:"–"}),e.jsx(ae,{type:"number",placeholder:"Max",className:"w-24",value:c.hourlyRateMax??"",onChange:A=>h(R=>({...R,hourlyRateMax:Number(A.target.value)||void 0}))}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"/hr"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Typical range: €50–€150 for iGaming experts"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Availability"}),e.jsxs(D7,{value:c.availability,onValueChange:A=>h(R=>({...R,availability:A})),className:"flex flex-wrap gap-4",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Is,{value:"full_time",id:"avail_full"}),e.jsx(B,{htmlFor:"avail_full",className:"font-normal",children:"Full-time freelance"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Is,{value:"part_time",id:"avail_part"}),e.jsx(B,{htmlFor:"avail_part",className:"font-normal",children:"Part-time"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Is,{value:"project_based",id:"avail_project"}),e.jsx(B,{htmlFor:"avail_project",className:"font-normal",children:"Project-based only"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Portfolio / Proof"}),e.jsxs("div",{className:"border-2 border-dashed rounded-lg p-4 text-center",children:[e.jsx(Il,{className:"mx-auto h-8 w-8 text-muted-foreground mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Add PDF, images, case studies, GitHub links..."})]}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(ae,{placeholder:"Paste URL to portfolio item",value:f,onChange:A=>k(A.target.value),onKeyDown:A=>A.key==="Enter"&&C(),className:"flex-1"}),e.jsx(P,{variant:"outline",size:"icon",onClick:C,children:e.jsx(St,{className:"h-4 w-4"})})]}),c.portfolioItems&&c.portfolioItems.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:c.portfolioItems.map(A=>e.jsxs(O,{variant:"secondary",className:"pr-1",children:[A.title.length>30?`${A.title.slice(0,30)}...`:A.title,e.jsx("button",{onClick:()=>S(A.id),className:"ml-1 hover:text-destructive",children:e.jsx(Ve,{className:"h-3 w-3"})})]},A.id))})]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsx(P,{variant:"ghost",onClick:()=>l(1),children:"Back"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{variant:"link",onClick:w,className:"text-muted-foreground",children:"Save as Draft"}),e.jsx(P,{onClick:L,disabled:!c.headline,className:"bg-orange-500 hover:bg-orange-600 text-white",children:"Save & Go Public"})]})]})]})})})}const aB={title:"Change Password",description:"Submit the new credentials to emit an update-password event.",currentPasswordLabel:"Current password",newPasswordLabel:"New password",confirmPasswordLabel:"Confirm new password",mismatchError:"New password and confirmation do not match.",cancelButton:"Cancel",submitButton:"Update Password"},ws={headerTitle:"Settings",headerDescription:"Manage your account preferences",tabs:{notifications:"Notifications",account:"Account",subscription:"Subscription",connected:"Connected"},notifications:{title:"Notification Preferences",description:"Choose how you want to be notified",email:{label:"Email Notifications",description:"Receive updates via email"},push:{label:"Push Notifications",description:"Browser push notifications"},weekly:{label:"Weekly Digest",description:"Summary of activities"},contentAlertsTitle:"Content Alerts",jobAlertsLabel:"Job Alerts",courseUpdatesLabel:"Course Updates",newsDigestLabel:"News Digest"},account:{passwordTitle:"Password",passwordDescription:"Change your account password",changePasswordButton:"Change Password",deleteTitle:"Delete Account",deleteDescription:"Permanently delete your account and all data",deleteButton:"Delete Account"},subscription:{title:"Subscription Plan",description:"Manage your membership",premiumBadge:"Premium",premiumBenefitsTitle:"Premium Benefits",premiumBenefits:["✓ Unlimited job applications","✓ Access to all courses","✓ Priority support","✓ Advanced analytics","✓ Ad-free experience"],manageButton:"Manage Subscription",upgradeMessage:"Upgrade to Premium to unlock exclusive features",upgradeButton:"Upgrade to Premium"},connected:{title:"Connected Accounts",description:"Manage linked accounts and integrations",disconnectButton:"Disconnect",connectButton:"Connect"}};function sB({open:t,onOpenChange:a,onSubmit:s,text:n}){const[r,i]=p.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[l,c]=p.useState(null),[h,d]=p.useState({}),u={...aB,...n};p.useEffect(()=>{t||(i({currentPassword:"",newPassword:"",confirmPassword:""}),c(null),d({}))},[t]);const y=x=>{if(x.preventDefault(),r.newPassword!==r.confirmPassword){c(u.mismatchError);return}s({currentPassword:r.currentPassword,newPassword:r.newPassword,confirmPassword:r.confirmPassword}),a(!1)};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{className:"sm:max-w-md",children:[e.jsxs(Oe,{children:[e.jsx(Le,{children:u.title}),e.jsx(it,{children:u.description})]}),e.jsxs("form",{className:"space-y-4",onSubmit:y,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"current-password",children:u.currentPasswordLabel}),e.jsxs("div",{className:"relative",children:[e.jsx(ae,{id:"current-password",type:h.currentPassword?"text":"password",value:r.currentPassword,onChange:x=>i(m=>({...m,currentPassword:x.target.value})),autoComplete:"current-password",className:"pr-20"}),e.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs font-medium text-muted-foreground hover:text-foreground",onClick:()=>d(x=>({...x,currentPassword:!x.currentPassword})),children:h.currentPassword?"Hide":"Show"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"new-password",children:u.newPasswordLabel}),e.jsxs("div",{className:"relative",children:[e.jsx(ae,{id:"new-password",type:h.newPassword?"text":"password",value:r.newPassword,onChange:x=>i(m=>({...m,newPassword:x.target.value})),autoComplete:"new-password",className:"pr-20"}),e.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs font-medium text-muted-foreground hover:text-foreground",onClick:()=>d(x=>({...x,newPassword:!x.newPassword})),children:h.newPassword?"Hide":"Show"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"confirm-password",children:u.confirmPasswordLabel}),e.jsxs("div",{className:"relative",children:[e.jsx(ae,{id:"confirm-password",type:h.confirmPassword?"text":"password",value:r.confirmPassword,onChange:x=>{i(m=>({...m,confirmPassword:x.target.value})),c(null)},autoComplete:"new-password",className:"pr-20"}),e.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs font-medium text-muted-foreground hover:text-foreground",onClick:()=>d(x=>({...x,confirmPassword:!x.confirmPassword})),children:h.confirmPassword?"Hide":"Show"})]}),l?e.jsx("p",{className:"text-sm text-destructive",children:l}):null]}),e.jsxs(at,{className:"gap-2 sm:gap-0",children:[e.jsx(P,{type:"button",variant:"outline",onClick:()=>a(!1),children:u.cancelButton}),e.jsx(P,{type:"submit",children:u.submitButton})]})]})]})})}function nB({settings:t,onUpdate:a,text:s,changePasswordText:n}){var m,g,f;const{notifications:r,connectedAccounts:i,subscription:l}=t,[c,h]=p.useState(!1),d={...ws,...s,tabs:{...ws.tabs,...s==null?void 0:s.tabs},notifications:{...ws.notifications,...s==null?void 0:s.notifications,email:{...ws.notifications.email,...(m=s==null?void 0:s.notifications)==null?void 0:m.email},push:{...ws.notifications.push,...(g=s==null?void 0:s.notifications)==null?void 0:g.push},weekly:{...ws.notifications.weekly,...(f=s==null?void 0:s.notifications)==null?void 0:f.weekly}},account:{...ws.account,...s==null?void 0:s.account},subscription:{...ws.subscription,...s==null?void 0:s.subscription},connected:{...ws.connected,...s==null?void 0:s.connected}},u=k=>{a({action:"notifications",updates:k})},y=k=>{a({action:"connect-account",platform:k})},x=k=>{a({action:"disconnect-account",accountId:k})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:d.headerTitle}),e.jsx("p",{className:"text-muted-foreground mt-1",children:d.headerDescription})]}),e.jsxs(ns,{defaultValue:"notifications",className:"w-full",children:[e.jsxs(rs,{className:"grid w-full grid-cols-3 lg:grid-cols-7",children:[e.jsxs(Me,{value:"notifications",children:[e.jsx(Ba,{className:"h-4 w-4 mr-2"}),d.tabs.notifications]}),e.jsxs(Me,{value:"account",children:[e.jsx(fs,{className:"h-4 w-4 mr-2"}),d.tabs.account]}),e.jsxs(Me,{value:"subscription",children:[e.jsx(dc,{className:"h-4 w-4 mr-2"}),d.tabs.subscription]}),e.jsxs(Me,{value:"connected",children:[e.jsx(pc,{className:"h-4 w-4 mr-2"}),d.tabs.connected]})]}),e.jsx(ve,{value:"notifications",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:d.notifications.title}),e.jsx(Ae,{children:d.notifications.description})]}),e.jsxs(W,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"email-notif",className:"text-base",children:d.notifications.email.label}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.notifications.email.description})]}),e.jsx(vt,{id:"email-notif",checked:r.emailNotifications,onCheckedChange:k=>u({emailNotifications:k})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"push-notif",className:"text-base",children:d.notifications.push.label}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.notifications.push.description})]}),e.jsx(vt,{id:"push-notif",checked:r.pushNotifications,onCheckedChange:k=>u({pushNotifications:k})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(B,{htmlFor:"weekly-digest",className:"text-base",children:d.notifications.weekly.label}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.notifications.weekly.description})]}),e.jsx(vt,{id:"weekly-digest",checked:r.weeklyDigest,onCheckedChange:k=>u({weeklyDigest:k})})]}),e.jsxs("div",{className:"border-t pt-4 space-y-4",children:[e.jsx("h4",{className:"font-medium",children:d.notifications.contentAlertsTitle}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(B,{htmlFor:"job-alerts-set",children:d.notifications.jobAlertsLabel}),e.jsx(vt,{id:"job-alerts-set",checked:r.jobAlerts,onCheckedChange:k=>u({jobAlerts:k})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(B,{htmlFor:"course-updates",children:d.notifications.courseUpdatesLabel}),e.jsx(vt,{id:"course-updates",checked:r.courseUpdates,onCheckedChange:k=>u({courseUpdates:k})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(B,{htmlFor:"news-digest",children:d.notifications.newsDigestLabel}),e.jsx(vt,{id:"news-digest",checked:r.newsDigest,onCheckedChange:k=>u({newsDigest:k})})]})]})]})]})}),e.jsx(ve,{value:"account",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:d.account.passwordTitle}),e.jsx(Ae,{children:d.account.passwordDescription})]}),e.jsx(W,{children:e.jsx(P,{onClick:()=>h(!0),children:d.account.changePasswordButton})})]}),e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:d.account.deleteTitle}),e.jsx(Ae,{children:d.account.deleteDescription})]}),e.jsx(W,{children:e.jsx(P,{variant:"destructive",onClick:()=>a({action:"delete-account"}),children:d.account.deleteButton})})]})]})}),e.jsx(sB,{open:c,onOpenChange:h,text:n,onSubmit:k=>a({action:"update-password",details:k})}),e.jsx(ve,{value:"subscription",children:e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx(re,{children:d.subscription.title}),e.jsx(Ae,{children:d.subscription.description})]}),l.isPremium&&e.jsx(O,{children:d.subscription.premiumBadge})]})}),e.jsx(W,{className:"space-y-4",children:l.isPremium?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 border rounded-lg bg-accent/5",children:[e.jsx("h4",{className:"font-semibold mb-2",children:d.subscription.premiumBenefitsTitle}),e.jsx("ul",{className:"space-y-1 text-sm text-muted-foreground",children:d.subscription.premiumBenefits.map(k=>e.jsx("li",{children:k},k))})]}),e.jsx(P,{variant:"outline",children:d.subscription.manageButton})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:d.subscription.upgradeMessage}),e.jsx(P,{onClick:()=>a({action:"upgrade",plan:"premium"}),children:d.subscription.upgradeButton})]})})]})}),e.jsx(ve,{value:"connected",children:e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:d.connected.title}),e.jsx(Ae,{children:d.connected.description})]}),e.jsx(W,{className:"space-y-4",children:i.map(k=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium",children:k.platform}),k.connected&&k.email&&e.jsx("p",{className:"text-sm text-muted-foreground",children:k.email})]}),k.connected?e.jsx(P,{variant:"outline",size:"sm",onClick:()=>x(k.id),children:d.connected.disconnectButton}):e.jsx(P,{size:"sm",onClick:()=>y(k.platform),children:d.connected.connectButton})]},k.id))})]})})]})]})}const rB={COMPANY_OWNER:["create","join"],COMPANY_RECRUITER:["create","join"],COMPANY_EMPLOYEE:["join","suggest"]},G9={COMPANY_OWNER:"create",COMPANY_RECRUITER:"create",COMPANY_EMPLOYEE:"join"},iB={COMPANY_OWNER:["manage_brand","manage_jobs","manage_team","view_analytics","manage_settings","view_candidates","contact_candidates"],COMPANY_RECRUITER:["manage_jobs","view_candidates","contact_candidates","view_analytics"],COMPANY_EMPLOYEE:["view_company","view_courses","view_events","connect_colleagues"]},vN=(t,a)=>{var s;return((s=iB[t])==null?void 0:s.includes(a))??!1},oB=["Executive / Leadership","Human Resources","Recruitment","Marketing","Sales","Account Management","Product","Engineering","Design","Compliance / Legal","Finance","Operations","Customer Support","Other"],lB=["Just me","2-5 people","6-15 people","16-50 people","50+ people"];function cB({companyName:t,companyStats:a,profileStrength:s=75,recentActivity:n=[],onNavigate:r}){return e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{className:"bg-gradient-to-r from-primary to-primary/80 text-primary-foreground",children:e.jsx(W,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-1",children:"Welcome back!"}),e.jsxs("p",{className:"opacity-90",children:["Manage ",t,"'s presence on iGaming Career"]})]}),e.jsx("div",{className:"hidden md:block p-4 bg-white/10 rounded-xl",children:e.jsx(Se,{className:"h-10 w-10"})})]})})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsx(U,{children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(Ce,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.openRoles}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Open Roles"})]})]})})}),e.jsx(U,{children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-accent/10",children:e.jsx(qe,{className:"h-5 w-5 text-accent"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.totalApplicants}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Applicants"})]})]})})}),e.jsx(U,{children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-green-100",children:e.jsx(Rs,{className:"h-5 w-5 text-green-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.profileViews}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Profile Views"})]})]})})}),e.jsx(U,{children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-purple-100",children:e.jsx(qe,{className:"h-5 w-5 text-purple-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.teamMembers}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Team Members"})]})]})})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(Ce,{className:"h-5 w-5"}),"Job Management"]})}),e.jsxs(W,{className:"space-y-3",children:[e.jsxs(P,{onClick:()=>r("jobs"),className:"w-full justify-start",variant:"outline",children:[e.jsx(Ms,{className:"mr-2 h-4 w-4"}),"Post a New Job"]}),e.jsxs(P,{onClick:()=>r("candidates"),className:"w-full justify-start",variant:"outline",children:[e.jsx(qe,{className:"mr-2 h-4 w-4"}),"Review Applicants"]})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(Se,{className:"h-5 w-5"}),"Brand Management"]})}),e.jsxs(W,{className:"space-y-3",children:[e.jsxs(P,{onClick:()=>r("settings"),className:"w-full justify-start",variant:"outline",children:[e.jsx(Kt,{className:"mr-2 h-4 w-4"}),"Edit Company Profile"]}),e.jsxs(P,{onClick:()=>r("settings"),className:"w-full justify-start",variant:"outline",children:[e.jsx(qe,{className:"mr-2 h-4 w-4"}),"Manage Team"]})]})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(jt,{className:"h-5 w-5"}),"Company Profile Strength"]})}),e.jsx(W,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Profile completion"}),e.jsxs(O,{variant:"secondary",children:[s,"%"]})]}),e.jsx(ya,{value:s,className:"h-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete your profile to attract more candidates. Add company photos, benefits, and culture description."}),e.jsx(P,{variant:"link",className:"p-0 h-auto",children:"View suggestions →"})]})})]}),e.jsxs(U,{children:[e.jsxs(ne,{className:"flex flex-row items-center justify-between",children:[e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(Xs,{className:"h-5 w-5"}),"Recent Activity"]}),e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>r("candidates"),children:"View All"})]}),e.jsx(W,{children:e.jsx("div",{className:"space-y-4",children:n.map((i,l)=>e.jsxs("div",{className:`flex items-center justify-between py-2 ${l<n.length-1?"border-b":""}`,children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i.subtitle})]}),e.jsx(O,{variant:i.badgeVariant??"default",children:i.badge})]},i.id))})})]})]})}function dB({companyName:t,recruiterStats:a,pipeline:s,upcomingInterviews:n=[],activeListings:r=[],onNavigate:i}){const l=s.reduce((c,h)=>c+h.count,0);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:"Recruiter Dashboard"}),e.jsxs("p",{className:"text-muted-foreground",children:["Manage hiring for ",t]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsx(U,{children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(Ce,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.activeJobs}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Active Jobs"})]})]})})}),e.jsx(U,{className:"border-accent/50 bg-accent/5",children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-accent/20",children:e.jsx(qe,{className:"h-5 w-5 text-accent"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.newApplicants}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"New Applicants"})]})]})})}),e.jsx(U,{children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-green-100",children:e.jsx(Gt,{className:"h-5 w-5 text-green-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.interviewsThisWeek}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Interviews"})]})]})})}),e.jsx(U,{children:e.jsx(W,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-yellow-100",children:e.jsx($t,{className:"h-5 w-5 text-yellow-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:a.pendingReviews}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending Review"})]})]})})})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(P,{onClick:()=>i("jobs"),children:[e.jsx(Ms,{className:"mr-2 h-4 w-4"}),"Post New Job"]}),e.jsxs(P,{variant:"outline",onClick:()=>i("candidates"),children:[e.jsx(mn,{className:"mr-2 h-4 w-4"}),"Review Applicants"]}),e.jsxs(P,{variant:"outline",onClick:()=>i("candidates"),children:[e.jsx(wt,{className:"mr-2 h-4 w-4"}),"Search Candidates"]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs(U,{children:[e.jsx(ne,{children:e.jsx(re,{className:"text-lg",children:"Candidate Pipeline"})}),e.jsxs(W,{children:[e.jsx("div",{className:"space-y-4",children:s.map(c=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{children:c.stage}),e.jsx("span",{className:"font-medium",children:c.count})]}),e.jsx(ya,{value:l>0?c.count/l*100:0,className:"h-2"})]},c.stage))}),e.jsxs(P,{variant:"link",className:"mt-4 p-0",onClick:()=>i("candidates"),children:["View all candidates",e.jsx(Ia,{className:"ml-1 h-4 w-4"})]})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsx(re,{className:"text-lg",children:"Upcoming Interviews"})}),e.jsx(W,{children:e.jsx("div",{className:"space-y-4",children:n.map(c=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg bg-muted/50 p-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:e.jsx(Gt,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:c.candidateName}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[c.role," • ",c.scheduleLabel]})]}),e.jsx(P,{size:"sm",variant:"ghost",children:e.jsx(ft,{className:"h-4 w-4"})})]},c.id))})})]})]}),e.jsxs(U,{children:[e.jsxs(ne,{className:"flex flex-row items-center justify-between",children:[e.jsx(re,{className:"text-lg",children:"Active Job Listings"}),e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>i("jobs"),children:"View All"})]}),e.jsx(W,{children:e.jsx("div",{className:"space-y-3",children:r.map(c=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:c.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.location})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{variant:c.badgeVariant??"default",children:c.applicantsLabel}),e.jsx(P,{size:"sm",variant:"outline",children:"Review"})]})]},c.id))})})]})]})}function hB({companyName:t,employeeName:a,announcements:s,coursesInProgress:n,upcomingEvents:r,colleagueCount:i,onNavigate:l}){return e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{className:"bg-gradient-to-r from-primary to-primary/80 text-primary-foreground",children:e.jsx(W,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold mb-1",children:["Welcome, ",a,"!"]}),e.jsxs("p",{className:"opacity-90 flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4"}),t]})]}),e.jsx("div",{className:"hidden md:flex items-center gap-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-3xl font-bold",children:i}),e.jsx("p",{className:"text-sm opacity-80",children:"Colleagues"})]})})]})})}),s.length>0&&e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(Ba,{className:"h-5 w-5"}),"Company Announcements"]})}),e.jsx(W,{children:e.jsx("div",{className:"space-y-3",children:s.map(c=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[c.isNew&&e.jsx(O,{variant:"default",className:"bg-accent text-accent-foreground",children:"New"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:c.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c.date})]})]}),e.jsx(P,{size:"sm",variant:"ghost",children:"Read"})]},c.id))})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs(U,{children:[e.jsxs(ne,{className:"flex flex-row items-center justify-between",children:[e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(Va,{className:"h-5 w-5"}),"Your Learning"]}),e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>l("courses"),children:"Browse All"})]}),e.jsx(W,{children:n.length>0?e.jsxs("div",{className:"space-y-4",children:[n.map(c=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:c.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:c.provider})]}),e.jsxs(O,{variant:"secondary",children:[c.progress,"%"]})]}),e.jsx(ya,{value:c.progress,className:"h-1.5"})]},c.id)),e.jsxs(P,{variant:"outline",className:"w-full mt-2",onClick:()=>l("courses"),children:["Continue Learning",e.jsx(Ia,{className:"ml-2 h-4 w-4"})]})]}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(Ut,{className:"h-12 w-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"Start learning with iGaming courses"}),e.jsx(P,{onClick:()=>l("courses"),children:"Browse Courses"})]})})]}),e.jsxs(U,{children:[e.jsxs(ne,{className:"flex flex-row items-center justify-between",children:[e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(Gt,{className:"h-5 w-5"}),"Events & Conferences"]}),e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>l("events"),children:"View All"})]}),e.jsx(W,{children:r.length>0?e.jsx("div",{className:"space-y-3",children:r.map(c=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(Gt,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium",children:c.title}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("span",{children:c.date}),e.jsx("span",{children:"•"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"h-3 w-3"}),c.location]})]}),e.jsx(O,{variant:"outline",className:"mt-2",children:c.type})]})]},c.id))}):e.jsxs("div",{className:"text-center py-6",children:[e.jsx(Gt,{className:"h-12 w-12 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground mb-3",children:"No upcoming events"}),e.jsx(P,{variant:"outline",onClick:()=>l("events"),children:"Explore Events"})]})})]})]}),e.jsxs(U,{children:[e.jsxs(ne,{className:"flex flex-row items-center justify-between",children:[e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(aa,{className:"h-5 w-5"}),"Industry News"]}),e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>l("news"),children:"View All"})]}),e.jsx(W,{children:e.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-lg border",children:[e.jsx(O,{variant:"secondary",className:"mb-2",children:"Regulation"}),e.jsx("h4",{className:"font-medium mb-1",children:"New MGA Guidelines for 2025"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Malta Gaming Authority releases updated compliance requirements..."}),e.jsxs(P,{variant:"link",className:"p-0 h-auto",children:["Read more",e.jsx(Rt,{className:"ml-1 h-3 w-3"})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border",children:[e.jsx(O,{variant:"secondary",className:"mb-2",children:"Technology"}),e.jsx("h4",{className:"font-medium mb-1",children:"AI in iGaming: 2025 Trends"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"How artificial intelligence is reshaping the industry..."}),e.jsxs(P,{variant:"link",className:"p-0 h-auto",children:["Read more",e.jsx(Rt,{className:"ml-1 h-3 w-3"})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border",children:[e.jsx(O,{variant:"secondary",className:"mb-2",children:"Market"}),e.jsx("h4",{className:"font-medium mb-1",children:"US Market Expansion Updates"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Latest developments in US state-by-state legalization..."}),e.jsxs(P,{variant:"link",className:"p-0 h-auto",children:["Read more",e.jsx(Rt,{className:"ml-1 h-3 w-3"})]})]})]})})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"text-lg flex items-center gap-2",children:[e.jsx(qe,{className:"h-5 w-5"}),"Connect with Colleagues"]})}),e.jsx(W,{children:e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium",children:[i," colleagues from ",t]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect and collaborate with your team on the platform"})]}),e.jsxs(P,{onClick:()=>l("people"),children:["View Team",e.jsx(Ia,{className:"ml-2 h-4 w-4"})]})]})})]})]})}const j7={stats:{openRoles:5,totalApplicants:47,profileViews:1234,teamMembers:12},profileStrength:75,recentActivity:[{id:"owner-activity-1",title:"New application",subtitle:"Senior Product Manager role",badge:"2 hours ago"},{id:"owner-activity-2",title:"Job posting viewed",subtitle:"Frontend Developer - 45 views today",badge:"Today",badgeVariant:"secondary"},{id:"owner-activity-3",title:"Profile visit",subtitle:"Company page visited from job listing",badge:"Yesterday",badgeVariant:"secondary"}]},Xl={stats:{activeJobs:5,newApplicants:12,interviewsThisWeek:4,pendingReviews:8},pipeline:[{stage:"Applied",count:25,color:"bg-blue-500"},{stage:"Screening",count:12,color:"bg-yellow-500"},{stage:"Interview",count:6,color:"bg-purple-500"},{stage:"Offer",count:2,color:"bg-green-500"}],upcomingInterviews:[{id:"recruiter-interview-1",candidateName:"John Smith",role:"Senior Developer",scheduleLabel:"Today 2:00 PM"},{id:"recruiter-interview-2",candidateName:"Sarah Johnson",role:"Product Manager",scheduleLabel:"Tomorrow 10:00 AM"},{id:"recruiter-interview-3",candidateName:"Mike Chen",role:"UX Designer",scheduleLabel:"Feb 8, 3:00 PM"}],activeListings:[{id:"recruiter-job-1",title:"Senior Frontend Developer",location:"Malta • Full-time",applicantsLabel:"12 applicants"},{id:"recruiter-job-2",title:"Product Manager",location:"Remote • Full-time",applicantsLabel:"8 applicants"},{id:"recruiter-job-3",title:"Compliance Officer",location:"Gibraltar • Full-time",applicantsLabel:"5 applicants",badgeVariant:"secondary"}]},id={announcements:[{id:"employee-announcement-1",title:"Q1 All-Hands Meeting - Feb 15",date:"Today",isNew:!0},{id:"employee-announcement-2",title:"New Office Opening in Malta",date:"Yesterday",isNew:!0},{id:"employee-announcement-3",title:"Updated Benefits Package",date:"3 days ago",isNew:!1}],coursesInProgress:[{id:"employee-course-1",title:"AML Compliance Fundamentals",progress:75,provider:"iGaming Academy"},{id:"employee-course-2",title:"Responsible Gaming",progress:40,provider:"RG Council"}],upcomingEvents:[{id:"employee-event-1",title:"ICE London 2025",date:"Feb 4-6, 2025",location:"London, UK",type:"Conference"},{id:"employee-event-2",title:"SBC Summit",date:"Mar 12-14, 2025",location:"Barcelona",type:"Summit"}],colleagueCount:j7.stats.teamMembers};function dA({userRole:t,companyName:a,companySlug:s,userName:n,data:r,activeTab:i,onTabChange:l,onNavigateToPersonalDashboard:c}){const[h,d]=p.useState(i??"overview"),u=i??h,y=p.useMemo(()=>{var M,b;return{...j7,...r==null?void 0:r.owner,stats:{...j7.stats,...(M=r==null?void 0:r.owner)==null?void 0:M.stats},recentActivity:((b=r==null?void 0:r.owner)==null?void 0:b.recentActivity)??j7.recentActivity}},[r==null?void 0:r.owner]),x=p.useMemo(()=>{var M,b,C,S;return{...Xl,...r==null?void 0:r.recruiter,stats:{...Xl.stats,...(M=r==null?void 0:r.recruiter)==null?void 0:M.stats},pipeline:((b=r==null?void 0:r.recruiter)==null?void 0:b.pipeline)??Xl.pipeline,upcomingInterviews:((C=r==null?void 0:r.recruiter)==null?void 0:C.upcomingInterviews)??Xl.upcomingInterviews,activeListings:((S=r==null?void 0:r.recruiter)==null?void 0:S.activeListings)??Xl.activeListings}},[r==null?void 0:r.recruiter]),m=p.useMemo(()=>{var M,b,C,S;return{...id,...r==null?void 0:r.employee,announcements:((M=r==null?void 0:r.employee)==null?void 0:M.announcements)??id.announcements,coursesInProgress:((b=r==null?void 0:r.employee)==null?void 0:b.coursesInProgress)??id.coursesInProgress,upcomingEvents:((C=r==null?void 0:r.employee)==null?void 0:C.upcomingEvents)??id.upcomingEvents,colleagueCount:((S=r==null?void 0:r.employee)==null?void 0:S.colleagueCount)??y.stats.teamMembers}},[r==null?void 0:r.employee,y.stats.teamMembers]),g=vN(t,"manage_jobs"),f=vN(t,"view_candidates"),k=vN(t,"manage_settings"),v=M=>{const b=M;i||d(b),l==null||l(b)},N=()=>{switch(t){case"COMPANY_OWNER":return e.jsx(cB,{companyName:a,companyStats:y.stats,profileStrength:y.profileStrength,recentActivity:y.recentActivity,onNavigate:v});case"COMPANY_RECRUITER":return e.jsx(dB,{companyName:a,recruiterStats:x.stats,pipeline:x.pipeline,upcomingInterviews:x.upcomingInterviews,activeListings:x.activeListings,onNavigate:v});case"COMPANY_EMPLOYEE":return e.jsx(hB,{companyName:a,employeeName:n,announcements:m.announcements,coursesInProgress:m.coursesInProgress,upcomingEvents:m.upcomingEvents,colleagueCount:m.colleagueCount,onNavigate:v})}};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("div",{className:"border-b bg-card",children:e.jsx("div",{className:"container mx-auto px-4 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[c&&e.jsxs(P,{variant:"ghost",size:"sm",onClick:c,children:[e.jsx(La,{className:"mr-2 h-4 w-4"}),"Personal Dashboard"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:e.jsx(Se,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold",children:a}),e.jsx("p",{className:"text-sm capitalize text-muted-foreground",children:t.replace("COMPANY_","").replace("_"," ").toLowerCase()})]})]})]}),k&&e.jsx(P,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:`/company-admin/${s}`,children:[e.jsx(Ga,{className:"mr-2 h-4 w-4"}),"Admin Panel"]})})]})})}),e.jsx("div",{className:"container mx-auto px-4 py-6",children:e.jsxs(ns,{value:u,onValueChange:M=>v(M),children:[e.jsxs(rs,{className:"mb-6 flex h-auto flex-wrap gap-1",children:[e.jsxs(Me,{value:"overview",className:"flex items-center gap-2",children:[e.jsx(kl,{className:"h-4 w-4"}),"Overview"]}),g&&e.jsxs(Me,{value:"jobs",className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"h-4 w-4"}),"Jobs"]}),f&&e.jsxs(Me,{value:"candidates",className:"flex items-center gap-2",children:[e.jsx(qe,{className:"h-4 w-4"}),"Candidates"]}),e.jsxs(Me,{value:"events",className:"flex items-center gap-2",children:[e.jsx(Gt,{className:"h-4 w-4"}),"Events"]}),e.jsxs(Me,{value:"courses",className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-4 w-4"}),"Courses"]}),e.jsxs(Me,{value:"news",className:"flex items-center gap-2",children:[e.jsx(aa,{className:"h-4 w-4"}),"News"]}),k&&e.jsxs(Me,{value:"settings",className:"flex items-center gap-2",children:[e.jsx(Ga,{className:"h-4 w-4"}),"Settings"]})]}),e.jsx(ve,{value:"overview",children:N()}),e.jsx(ve,{value:"jobs",children:e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(Ce,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"Job Management"}),e.jsxs("p",{className:"mb-4 text-muted-foreground",children:["Create and manage job postings for ",a]}),e.jsx(P,{children:"Post a New Job"})]})}),e.jsx(ve,{value:"candidates",children:e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(qe,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"Candidate Pipeline"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Review and manage applicants for your open positions"}),e.jsx(P,{children:"View Applicants"})]})}),e.jsx(ve,{value:"events",children:e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(Gt,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"Events & Conferences"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Discover and attend iGaming events"}),e.jsx(P,{children:"Browse Events"})]})}),e.jsx(ve,{value:"courses",children:e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(Ut,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"Learning & Development"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Enhance your skills with industry courses"}),e.jsx(P,{children:"Browse Courses"})]})}),e.jsx(ve,{value:"news",children:e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(aa,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"Industry News"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Stay updated with the latest company and market news"}),e.jsx(P,{children:"Browse News"})]})}),e.jsx(ve,{value:"settings",children:e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(Ga,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"Company Settings"}),e.jsxs("p",{className:"mb-4 text-muted-foreground",children:["Manage ",a,"'s profile and preferences"]}),e.jsx(P,{children:"Edit Settings"})]})})]})})]})}const uB={owner:"COMPANY_OWNER",recruiter:"COMPANY_RECRUITER",companyEmployee:"COMPANY_EMPLOYEE"},mB=Mt.Root,pB=Mt.Trigger,yB=ie.forwardRef(({className:t,inset:a,children:s,...n},r)=>e.jsxs(Mt.SubTrigger,{ref:r,className:oe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",t),...n,children:[s,e.jsx(la,{className:"ml-auto h-4 w-4"})]}));yB.displayName=Mt.SubTrigger.displayName;const xB=ie.forwardRef(({className:t,...a},s)=>e.jsx(Mt.SubContent,{ref:s,className:oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));xB.displayName=Mt.SubContent.displayName;const hA=ie.forwardRef(({className:t,sideOffset:a=4,...s},n)=>e.jsx(Mt.Portal,{children:e.jsx(Mt.Content,{ref:n,sideOffset:a,className:oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));hA.displayName=Mt.Content.displayName;const Ks=ie.forwardRef(({className:t,inset:a,...s},n)=>e.jsx(Mt.Item,{ref:n,className:oe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",t),...s}));Ks.displayName=Mt.Item.displayName;const gB=ie.forwardRef(({className:t,children:a,checked:s,...n},r)=>e.jsxs(Mt.CheckboxItem,{ref:r,className:oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:s,...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Mt.ItemIndicator,{children:e.jsx(ln,{className:"h-4 w-4"})})}),a]}));gB.displayName=Mt.CheckboxItem.displayName;const fB=ie.forwardRef(({className:t,children:a,...s},n)=>e.jsxs(Mt.RadioItem,{ref:n,className:oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Mt.ItemIndicator,{children:e.jsx(Ps,{className:"h-2 w-2 fill-current"})})}),a]}));fB.displayName=Mt.RadioItem.displayName;const kB=ie.forwardRef(({className:t,inset:a,...s},n)=>e.jsx(Mt.Label,{ref:n,className:oe("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",t),...s}));kB.displayName=Mt.Label.displayName;const KN=ie.forwardRef(({className:t,...a},s)=>e.jsx(Mt.Separator,{ref:s,className:oe("-mx-1 my-1 h-px bg-muted",t),...a}));KN.displayName=Mt.Separator.displayName;const vB={active:{label:"Active",variant:"default",icon:Tt},paused:{label:"Paused",variant:"secondary",icon:tn},snoozed:{label:"Snoozed",variant:"outline",icon:Jo},expired:{label:"Expired",variant:"secondary",icon:ea}};function bB({status:t,snoozedUntil:a,className:s}){const n=vB[t],r=n.icon;return e.jsxs(O,{variant:n.variant,className:s,children:[e.jsx(r,{className:"h-3 w-3 mr-1"}),n.label,t==="snoozed"&&a&&e.jsxs("span",{className:"ml-1 opacity-70",children:["until ",new Date(a).toLocaleDateString()]})]})}const wB={instant:"Instant",daily:"Daily digest",weekly:"Weekly digest"},jB=[{label:"7 days",days:7},{label:"14 days",days:14},{label:"30 days",days:30}];function MB({alert:t,onEdit:a,onDelete:s,onSnooze:n,onToggle:r,onReactivate:i,onDuplicate:l}){const[c,h]=p.useState(!1),[d,u]=p.useState(!1),y=t.status==="snoozed",x=t.status==="paused",m=t.status==="active",f=((k,v,N="EUR")=>{if(!k&&!v)return null;const M=b=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(b);return k&&v?`${N} ${M(k)} – ${M(v)}`:k?`${N} ${M(k)}+`:`Up to ${N} ${M(v)}`})(t.salaryMin,t.salaryMax,t.salaryCurrency);return e.jsxs(e.Fragment,{children:[e.jsxs(U,{className:`transition-all ${y||x?"opacity-70":""}`,children:[e.jsx(ne,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-base truncate",children:t.title||"Untitled Alert"}),e.jsx(bB,{status:t.status,snoozedUntil:t.snoozedUntil})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Created ",new Date(t.createdAt).toLocaleDateString()," · ",e.jsx($t,{className:"inline h-3 w-3"})," ",wB[t.frequency]]})]}),e.jsxs(mB,{children:[e.jsx(pB,{asChild:!0,children:e.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",children:e.jsx(sn,{className:"h-4 w-4"})})}),e.jsxs(hA,{align:"end",children:[e.jsxs(Ks,{onClick:()=>a(t.id),children:[e.jsx(fc,{className:"h-4 w-4 mr-2"})," Edit"]}),e.jsxs(Ks,{onClick:()=>l(t.id),children:[e.jsx(cc,{className:"h-4 w-4 mr-2"})," Duplicate"]}),e.jsx(KN,{}),m&&e.jsxs(Ks,{onClick:()=>r(t.id,"paused"),children:[e.jsx(Nl,{className:"h-4 w-4 mr-2"})," Pause"]}),x&&e.jsxs(Ks,{onClick:()=>i(t.id),children:[e.jsx(gs,{className:"h-4 w-4 mr-2"})," Reactivate"]}),y&&e.jsxs(Ks,{onClick:()=>i(t.id),children:[e.jsx(gs,{className:"h-4 w-4 mr-2"})," Wake up"]}),m&&e.jsxs(Ks,{onClick:()=>u(!0),children:[e.jsx(Jo,{className:"h-4 w-4 mr-2"})," Snooze…"]}),e.jsx(KN,{}),e.jsxs(Ks,{className:"text-destructive focus:text-destructive",onClick:()=>h(!0),children:[e.jsx(un,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})]})}),e.jsxs(W,{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.keywords.map(k=>e.jsx(O,{variant:"secondary",className:"text-xs",children:k},k)),t.departments.map(k=>e.jsxs(O,{variant:"outline",className:"text-xs",children:[e.jsx(Ce,{className:"h-3 w-3 mr-1"}),k]},k)),t.locations.map(k=>e.jsxs(O,{variant:"outline",className:"text-xs",children:[e.jsx(Fe,{className:"h-3 w-3 mr-1"}),k]},k)),t.workplaceType.map(k=>e.jsx(O,{variant:"accent",className:"text-xs",children:k},k)),f&&e.jsxs(O,{variant:"outline",className:"text-xs",children:[e.jsx(Ts,{className:"h-3 w-3 mr-1"}),f]})]}),(t.matchedCount!==void 0||t.matchedThisWeek!==void 0)&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground pt-1 border-t",children:[t.matchedThisWeek!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(jt,{className:"h-3.5 w-3.5 text-green-600"}),e.jsx("span",{className:"font-medium text-foreground",children:t.matchedThisWeek})," this week"]}),t.matchedCount!==void 0&&e.jsxs("span",{children:[t.matchedCount," total matches"]})]})]})]}),e.jsx(jn,{open:d,onOpenChange:u,children:e.jsxs(qs,{children:[e.jsxs(Fs,{children:[e.jsx(Os,{children:"Snooze Alert"}),e.jsx(Bs,{children:"Pause notifications for this alert temporarily."})]}),e.jsx("div",{className:"flex flex-wrap gap-2 py-4",children:jB.map(k=>e.jsx(P,{variant:"outline",onClick:()=>{n(t.id,k.days),u(!1)},children:k.label},k.days))}),e.jsx(Es,{children:e.jsx(Hs,{children:"Cancel"})})]})}),e.jsx(jn,{open:c,onOpenChange:h,children:e.jsxs(qs,{children:[e.jsxs(Fs,{children:[e.jsx(Os,{children:"Delete alert?"}),e.jsxs(Bs,{children:["This will permanently remove “",t.title||"this alert","” and you'll stop receiving notifications. This action cannot be undone."]})]}),e.jsxs(Es,{children:[e.jsx(Hs,{children:"Cancel"}),e.jsx(Cn,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>s(t.id),children:"Delete Alert"})]})]})})]})}const NB=["Engineering","Product","Design","Marketing","Sales","Operations","Finance","HR","Legal","Compliance","Customer Support","Data"],CB=["Remote","Hybrid","On-site"],SB=[{value:"instant",label:"Instant – as soon as posted"},{value:"daily",label:"Daily digest"},{value:"weekly",label:"Weekly digest"}],LB=["EUR","USD","GBP","SEK"];function $9(t){return{title:(t==null?void 0:t.title)??"",keywords:(t==null?void 0:t.keywords)??[],departments:(t==null?void 0:t.departments)??[],locations:(t==null?void 0:t.locations)??[],workplaceType:(t==null?void 0:t.workplaceType)??[],salaryMin:t==null?void 0:t.salaryMin,salaryMax:t==null?void 0:t.salaryMax,salaryCurrency:(t==null?void 0:t.salaryCurrency)??"EUR",frequency:(t==null?void 0:t.frequency)??"daily"}}function IB({open:t,onOpenChange:a,alert:s,onSubmit:n}){const r=!!s,[i,l]=p.useState(()=>$9(s)),[c,h]=p.useState(""),[d,u]=p.useState(""),[y,x]=p.useState(s==null?void 0:s.id);(s==null?void 0:s.id)!==y&&(x(s==null?void 0:s.id),l($9(s)),h(""),u(""));const m=b=>l(C=>({...C,...b})),g=(b,C)=>{const S=C.trim();!S||i[b].includes(S)||m({[b]:[...i[b],S]})},f=(b,C)=>{m({[b]:i[b].filter(S=>S!==C)})},k=b=>{m({departments:i.departments.includes(b)?i.departments.filter(C=>C!==b):[...i.departments,b]})},v=b=>{m({workplaceType:i.workplaceType.includes(b)?i.workplaceType.filter(C=>C!==b):[...i.workplaceType,b]})},N=()=>{const b=i.title.trim()||[...i.keywords.slice(0,2),...i.locations.slice(0,1)].join(", ")||"My Alert";n({...i,title:b}),a(!1)},M=i.keywords.length>0||i.departments.length>0||i.locations.length>0||i.workplaceType.length>0;return e.jsx(st,{open:t,onOpenChange:a,children:e.jsxs(Xe,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[e.jsxs(Oe,{children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx(As,{className:"h-5 w-5 text-primary"}),r?"Edit Alert":"Create New Alert"]}),e.jsx(it,{children:r?"Update your alert criteria to refine your job matches.":"Set your criteria and we'll notify you when matching jobs are posted."})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Alert name (optional)"}),e.jsx(ae,{placeholder:"e.g. Senior roles in Malta",value:i.title,onChange:b=>m({title:b.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave empty to auto-generate from criteria."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Keywords / Job titles"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{placeholder:"e.g. Product Manager, Slots…",value:c,onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),g("keywords",c),h(""))}}),e.jsx(P,{size:"sm",variant:"secondary",onClick:()=>{g("keywords",c),h("")},children:"Add"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.keywords.map(b=>e.jsxs(O,{variant:"secondary",className:"gap-1",children:[b,e.jsx(Ve,{className:"h-3 w-3 cursor-pointer",onClick:()=>f("keywords",b)})]},b))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Departments"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:NB.map(b=>e.jsx(O,{variant:i.departments.includes(b)?"default":"outline",className:"cursor-pointer",onClick:()=>k(b),children:b},b))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Locations"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{placeholder:"e.g. Malta, London, Stockholm…",value:d,onChange:b=>u(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),g("locations",d),u(""))}}),e.jsx(P,{size:"sm",variant:"secondary",onClick:()=>{g("locations",d),u("")},children:"Add"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.locations.map(b=>e.jsxs(O,{variant:"secondary",className:"gap-1",children:[b,e.jsx(Ve,{className:"h-3 w-3 cursor-pointer",onClick:()=>f("locations",b)})]},b))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Workplace type"}),e.jsx("div",{className:"flex gap-2",children:CB.map(b=>e.jsx(O,{variant:i.workplaceType.includes(b)?"default":"outline",className:"cursor-pointer",onClick:()=>v(b),children:b},b))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Salary range (optional)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ye,{value:i.salaryCurrency,onValueChange:b=>m({salaryCurrency:b}),children:[e.jsx(Ue,{className:"w-20",children:e.jsx(Je,{})}),e.jsx(Ge,{children:LB.map(b=>e.jsx(me,{value:b,children:b},b))})]}),e.jsx(ae,{type:"number",placeholder:"Min",value:i.salaryMin??"",onChange:b=>m({salaryMin:b.target.value?Number(b.target.value):void 0}),className:"w-24"}),e.jsx("span",{className:"text-muted-foreground",children:"–"}),e.jsx(ae,{type:"number",placeholder:"Max",value:i.salaryMax??"",onChange:b=>m({salaryMax:b.target.value?Number(b.target.value):void 0}),className:"w-24"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Notification frequency"}),e.jsxs(Ye,{value:i.frequency,onValueChange:b=>m({frequency:b}),children:[e.jsx(Ue,{children:e.jsx(Je,{})}),e.jsx(Ge,{children:SB.map(b=>e.jsx(me,{value:b.value,children:b.label},b.value))})]})]})]}),e.jsxs(at,{className:"gap-2 sm:gap-0",children:[e.jsx(P,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(P,{onClick:N,disabled:!M,children:r?"Save Changes":"Create Alert"})]})]})})}function AB({onCreateAlert:t}){return e.jsx(U,{children:e.jsxs(W,{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("div",{className:"rounded-full bg-primary/10 p-4 mb-4",children:e.jsx(As,{className:"h-10 w-10 text-primary"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No job alerts yet"}),e.jsx("p",{className:"text-muted-foreground max-w-sm mb-6",children:"Create your first alert to get notified when jobs matching your criteria are posted. Stay ahead of the competition in the iGaming industry."}),e.jsxs(P,{onClick:t,children:[e.jsx(St,{className:"h-4 w-4 mr-2"}),"Create Your First Alert"]})]})})}function PB({insights:t,onManageAlerts:a,compact:s=!1}){const n=[{label:"Active Alerts",value:t.activeAlerts,icon:As,color:"text-primary"},{label:"Matched This Week",value:t.totalMatchedThisWeek,icon:jt,color:"text-green-600"},{label:"Paused",value:t.pausedAlerts,icon:Nl,color:"text-muted-foreground"},{label:"Snoozed",value:t.snoozedAlerts,icon:Jo,color:"text-muted-foreground"}];return s?e.jsxs(U,{children:[e.jsx(ne,{className:"pb-3",children:e.jsxs(re,{className:"text-base flex items-center gap-2",children:[e.jsx(As,{className:"h-4 w-4 text-primary"}),"Job Alerts"]})}),e.jsxs(W,{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[t.activeAlerts," active alert(s)"]}),e.jsxs("span",{className:"font-medium text-green-600",children:[t.totalMatchedThisWeek," matches this week"]})]}),a&&e.jsx(P,{variant:"outline",size:"sm",className:"w-full",onClick:a,children:"Manage Alerts"})]})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:n.map(r=>{const i=r.icon;return e.jsx(U,{children:e.jsxs(W,{className:"pt-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(i,{className:`h-4 w-4 ${r.color}`}),e.jsx("span",{className:"text-sm text-muted-foreground",children:r.label})]}),e.jsx("p",{className:"text-2xl font-bold",children:r.value})]})},r.label)})})}const TB=[{id:"1",title:"Senior Product roles in Malta",keywords:["Product Manager","Head of Product"],departments:["Product"],locations:["Malta"],workplaceType:["Hybrid","On-site"],salaryCurrency:"EUR",salaryMin:6e4,salaryMax:1e5,frequency:"daily",status:"active",matchedCount:47,matchedThisWeek:5,createdAt:"2026-01-15T10:00:00Z"},{id:"2",title:"Remote Engineering",keywords:["Frontend Developer","React","TypeScript"],departments:["Engineering"],locations:[],workplaceType:["Remote"],salaryCurrency:"EUR",frequency:"instant",status:"active",matchedCount:124,matchedThisWeek:12,createdAt:"2026-01-20T14:00:00Z"},{id:"3",title:"Compliance in Nordics",keywords:["Compliance Officer","AML"],departments:["Compliance","Legal"],locations:["Stockholm","Helsinki","Copenhagen"],workplaceType:[],salaryCurrency:"SEK",frequency:"weekly",status:"paused",matchedCount:18,matchedThisWeek:0,createdAt:"2026-02-01T09:00:00Z"},{id:"4",title:"Marketing roles",keywords:["Marketing Manager","CRM"],departments:["Marketing"],locations:["London","Gibraltar"],workplaceType:["Hybrid"],salaryCurrency:"GBP",salaryMin:5e4,frequency:"daily",status:"snoozed",snoozedUntil:"2026-02-20T00:00:00Z",matchedCount:33,matchedThisWeek:2,createdAt:"2025-12-10T08:00:00Z"}];function RB({alerts:t,onAction:a,loading:s=!1}){const[n,r]=p.useState(TB),i=t??n,[l,c]=p.useState(!1),[h,d]=p.useState(null),[u,y]=p.useState(""),[x,m]=p.useState("all"),g=p.useMemo(()=>({totalAlerts:i.length,activeAlerts:i.filter(C=>C.status==="active").length,pausedAlerts:i.filter(C=>C.status==="paused").length,snoozedAlerts:i.filter(C=>C.status==="snoozed").length,totalMatchedThisWeek:i.reduce((C,S)=>C+(S.matchedThisWeek??0),0),totalMatchedAllTime:i.reduce((C,S)=>C+(S.matchedCount??0),0)}),[i]),f=p.useMemo(()=>{let C=i;if(x!=="all"&&(C=C.filter(S=>S.status===x)),u.trim()){const S=u.toLowerCase();C=C.filter(L=>L.title.toLowerCase().includes(S)||L.keywords.some(w=>w.toLowerCase().includes(S))||L.locations.some(w=>w.toLowerCase().includes(S))||L.departments.some(w=>w.toLowerCase().includes(S)))}return C},[i,x,u]),k=C=>{if(a){a(C);return}switch(C.action){case"create":{const S={id:crypto.randomUUID(),...C.values,status:"active",matchedCount:0,matchedThisWeek:0,createdAt:new Date().toISOString()};r(L=>[S,...L]),us.success("Alert created",{description:`"${S.title}" is now active.`});break}case"update":{r(S=>S.map(L=>L.id===C.alertId?{...L,...C.values,updatedAt:new Date().toISOString()}:L)),us.success("Alert updated");break}case"delete":{r(S=>S.filter(L=>L.id!==C.alertId)),us.success("Alert deleted");break}case"toggle":{r(S=>S.map(L=>L.id===C.alertId?{...L,status:C.status,snoozedUntil:null}:L)),us.info(`Alert ${C.status}`);break}case"snooze":{const S=new Date;S.setDate(S.getDate()+C.days),r(L=>L.map(w=>w.id===C.alertId?{...w,status:"snoozed",snoozedUntil:S.toISOString()}:w)),us.info(`Alert snoozed for ${C.days} days`);break}case"reactivate":{r(S=>S.map(L=>L.id===C.alertId?{...L,status:"active",snoozedUntil:null}:L)),us.success("Alert reactivated");break}case"duplicate":{const S=i.find(w=>w.id===C.alertId);if(!S)return;const L={...S,id:crypto.randomUUID(),title:`${S.title} (copy)`,status:"active",snoozedUntil:null,matchedCount:0,matchedThisWeek:0,createdAt:new Date().toISOString()};r(w=>[L,...w]),us.success("Alert duplicated");break}}},v=C=>k({action:"create",values:C}),N=C=>{const S=i.find(L=>L.id===C);S&&(d(S),c(!0))},M=C=>{h?k({action:"update",alertId:h.id,values:C}):v(C),d(null)},b=()=>{d(null),c(!0)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-bold",children:"Job Alerts"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Get notified when jobs matching your criteria are posted."})]}),e.jsxs(P,{onClick:b,children:[e.jsx(St,{className:"h-4 w-4 mr-2"}),"New Alert"]})]}),i.length>0&&e.jsx(PB,{insights:g}),i.length>0&&e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(wt,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(ae,{placeholder:"Search alerts…",value:u,onChange:C=>y(C.target.value),className:"pl-9"})]}),e.jsxs(Ye,{value:x,onValueChange:C=>m(C),children:[e.jsx(Ue,{className:"w-40",children:e.jsx(Je,{placeholder:"All statuses"})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"all",children:"All statuses"}),e.jsx(me,{value:"active",children:"Active"}),e.jsx(me,{value:"paused",children:"Paused"}),e.jsx(me,{value:"snoozed",children:"Snoozed"})]})]})]}),i.length===0?e.jsx(AB,{onCreateAlert:b}):f.length===0?e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No alerts match your search."}):e.jsx("div",{className:"grid gap-4",children:f.map(C=>e.jsx(MB,{alert:C,onEdit:N,onDelete:S=>k({action:"delete",alertId:S}),onSnooze:(S,L)=>k({action:"snooze",alertId:S,days:L}),onToggle:(S,L)=>k({action:"toggle",alertId:S,status:L}),onReactivate:S=>k({action:"reactivate",alertId:S}),onDuplicate:S=>k({action:"duplicate",alertId:S})},C.id))}),e.jsx(IB,{open:l,onOpenChange:C=>{c(C),C||d(null)},alert:h,onSubmit:M})]})}function DB({user:t,profileData:a,role:s="jobSeeker",companyName:n="Company",companySlug:r="company",companyDashboardData:i,jobsDashboard:l,alerts:c=[],snapshot:h=[],feedItems:d=[],onUploadCV:u,cvPreviewText:y,cvPreviewStatus:x,cvPreviewErrorMessage:m,coursesData:g,newsData:f,settingsData:k,onUpdateProfile:v,activeTab:N,tabPaths:M,onTabChange:b,freelancerData:C,freelancerStats:S,isCandidateActive:L=!0,onFreelancerUpdate:w,onboardingSteps:j,emailVerified:I=!1,profileComplete:T=!1,onboardingProgress:A=0,onOnboardingAction:R,onOpenOnboarding:D,jobAlerts:q,onAlertAction:E}){var Bt;const F=a??{personalDetails:{},workExperience:[],jobSearchDetails:{desiredRoles:[],locations:[],employmentType:[]},skills:[],languages:[],alerts:{jobAlerts:!1,courseAlerts:!1,newsAlerts:!1},preferences:{topics:[],language:"English",emailNotifications:!0}},G=v??(async he=>{console.log("Dashboard update event:",he)}),[Z,$]=p.useState(N??"overview"),[Q,te]=p.useState(!1);p.useEffect(()=>{N&&$(N)},[N]);const K=l||F.jobsDashboard||{savedJobs:[],recommendedJobs:[],applications:[]},ee=()=>{window.dispatchEvent(new CustomEvent("logout"))},ce={overview:"/dashboard",profile:"/dashboard/profile",jobs:"/dashboard/jobs",alerts:"/dashboard/alerts",courses:"/dashboard/courses",news:"/dashboard/news",settings:"/dashboard/settings",...M},fe=he=>{var _t;const _e=((_t=Object.entries(ce).find(([,pt])=>pt===he))==null?void 0:_t[0])??null;if(_e){N||$(_e),b==null||b({tab:_e,path:he});return}b==null||b({tab:Z,path:he})},de=async he=>{await G({type:"courses",payload:he})},se=he=>{he.action==="edit-profile"&&te(!0),w==null||w(he)},H=he=>{w==null||w({action:"complete-step-2",data:he}),te(!1)},z=he=>{w==null||w({action:"save-draft",data:he}),te(!1)},_=(...he)=>console.log("Action:",...he),V=async he=>{await G({type:"news",payload:he})},J=k||{notifications:{emailNotifications:!0,pushNotifications:!1,weeklyDigest:!0,jobAlerts:!0,courseUpdates:!0,newsDigest:!1},connectedAccounts:[{id:"google_89213",platform:"Google",connected:!0,email:t.email},{id:"linkedin_55521",platform:"LinkedIn",connected:!1}],subscription:{isPremium:!1,plan:"free",renewalDate:null}},pe=async he=>{await G({type:"settings",payload:he})},ke=he=>{const _e=he;N||$(_e),b==null||b({tab:_e,path:ce[_e]})},Be=N??Z,is=ce[Be]??"/dashboard";return s==="owner"||s==="recruiter"||s==="companyEmployee"?e.jsx(dA,{userRole:uB[s],companyName:n,companySlug:r,userName:t.name,data:i}):e.jsx(XE,{user:t,onLogout:ee,onNavigate:fe,currentPath:is,notificationCount:c.length,children:e.jsxs(ns,{value:Be,onValueChange:ke,className:"w-full",children:[e.jsxs(rs,{className:"grid w-full grid-cols-3 lg:grid-cols-7",children:[e.jsxs(Me,{value:"overview",className:"flex items-center gap-2",children:[e.jsx(Ns,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Overview"})]}),e.jsxs(Me,{value:"profile",className:"flex items-center gap-2",children:[e.jsx(ss,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Profile"})]}),e.jsxs(Me,{value:"jobs",className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Jobs"})]}),e.jsxs(Me,{value:"alerts",className:"flex items-center gap-2",children:[e.jsx(As,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Alerts"})]}),e.jsxs(Me,{value:"courses",className:"flex items-center gap-2",children:[e.jsx(Ut,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Courses"})]}),e.jsxs(Me,{value:"news",className:"flex items-center gap-2",children:[e.jsx(aa,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"News"})]}),e.jsxs(Me,{value:"settings",className:"flex items-center gap-2",children:[e.jsx(Ga,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Settings"})]})]}),e.jsx(ve,{value:"overview",className:"mt-6",children:e.jsx(FO,{userName:t.name,feedItems:d,alerts:c,snapshot:h,onSave:_,onApply:_,onEnroll:he=>de({action:"enroll",courseId:he}),onRead:he=>V({action:"read",articleId:he}),freelancerData:C,freelancerStats:S,isCandidateActive:L,onStartFreelancerSetup:()=>te(!0),onFreelancerUpdate:se,onboardingSteps:j,emailVerified:I,profileComplete:T,onboardingProgress:A,onOnboardingAction:R,onOpenOnboarding:D})}),e.jsx(tB,{open:Q,onOpenChange:te,isCandidateActive:L,onComplete:H,onSaveDraft:z}),e.jsx(ve,{value:"profile",className:"mt-6",children:e.jsx(GO,{profile:F,onUpdate:he=>G(he),emailVerified:I,onboarding:j?{enabled:!T,missingFields:(Bt=j.find(he=>he.id==="profile_required_fields"))==null?void 0:Bt.missingFields}:void 0})}),e.jsx(ve,{value:"jobs",className:"mt-6",children:e.jsx(ZO,{savedJobs:K.savedJobs,applications:K.applications,recommendedJobs:K.recommendedJobs,onApply:he=>console.log("Applied:",he),onRemove:he=>console.log("Removed:",he),onUploadCV:u??(he=>console.log("Upload CV changed:",(he==null?void 0:he.name)||"removed")),cvPreviewText:y,cvPreviewStatus:x,cvPreviewErrorMessage:m,onSetAlert:()=>console.log("Set alerts clicked"),onUpdateProfile:async he=>{await G({type:"jobs",payload:he.payload})}})}),e.jsx(ve,{value:"courses",className:"mt-6",children:e.jsx(YO,{enrolledCourses:(g==null?void 0:g.enrolledCourses)||[],savedCourses:(g==null?void 0:g.savedCourses)||[],recommendedCourses:(g==null?void 0:g.recommendedCourses)||[],certificates:(g==null?void 0:g.certificates)||[],onEnroll:he=>de({action:"enroll",courseId:he}),onContinue:he=>de({action:"continue",courseId:he}),onExplore:()=>de({action:"explore"}),onSave:he=>de({action:"save",courseId:he}),onRemoveSaved:he=>de({action:"remove-saved",courseId:he}),onRemoveRecommended:he=>de({action:"remove-recommended",courseId:he})})}),e.jsx(ve,{value:"news",className:"mt-6",children:e.jsx(JO,{recommendedNews:(f==null?void 0:f.recommendedNews)||[],savedArticles:(f==null?void 0:f.savedArticles)||[],categories:(f==null?void 0:f.categories)||[],selectedCategory:(f==null?void 0:f.selectedCategory)||"all",onRead:he=>V({action:"read",articleId:he}),onSave:he=>V({action:"save",articleId:he}),onRemoveSaved:he=>V({action:"remove-saved",articleId:he}),onRemoveRecommended:he=>V({action:"remove-recommended",articleId:he}),onCategoryChange:he=>V({action:"category",category:he}),onManagePreferences:()=>V({action:"manage-preferences"})})}),e.jsx(ve,{value:"settings",className:"mt-6",children:e.jsx(nB,{settings:J,onUpdate:pe})}),e.jsx(ve,{value:"alerts",className:"mt-6",children:e.jsx(RB,{alerts:q,onAction:E})})]})})}const _B=({emailVerified:t,profileComplete:a,requiredSteps:s})=>{const n=[],r=s??[],i=r.includes("email_verification")||r.length===0&&t===!1,l=r.includes("profile_required_fields")||r.length===0&&a===!1;return i&&t===!1&&n.push("Verify your email address"),l&&a===!1&&n.push("Complete your profile"),!n.length&&r.length>0&&n.push("Complete required onboarding steps"),n};function zB({children:t,onClick:a,emailVerified:s,profileComplete:n,requiredSteps:r,isBlocked:i,blockedReason:l,ctaLabel:c,onCtaClick:h,variant:d="tooltip"}){const u=_B({emailVerified:s,profileComplete:n,requiredSteps:r}),y=i??u.length>0,x=l??(u.length?u.join(" and "):"Complete onboarding to continue."),m=ie.isValidElement(t)?t.props.onClick:void 0,[g,f]=ie.useState(!1),k=d==="tooltip",v=()=>{if(y){k||f(!0);return}m==null||m(),a==null||a()};function N(b){return ie.isValidElement(b)}const M=e.jsx("span",{className:oe("inline-flex",y?"cursor-not-allowed":"cursor-pointer"),onClick:v,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&y&&(b.preventDefault(),k||f(!0))},onMouseEnter:()=>y&&k&&f(!0),onMouseLeave:()=>y&&k&&f(!1),onFocus:()=>y&&k&&f(!0),onBlur:()=>y&&k&&f(!1),role:y?"button":void 0,tabIndex:y?0:void 0,"aria-disabled":y,children:N(t)?ie.cloneElement(t,{className:oe(t.props.className,y&&"pointer-events-none opacity-60"),disabled:y||t.props.disabled}):t});return y?k?e.jsxs(IC,{open:g,onOpenChange:f,children:[e.jsx(AC,{asChild:!0,children:M}),e.jsxs(U7,{className:"w-64 text-sm",sideOffset:8,children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Action unavailable"}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:x}),c&&h&&e.jsx(P,{type:"button",variant:"link",className:"mt-2 h-auto p-0 text-sm",onClick:()=>{f(!1),h()},children:c})]})]}):e.jsxs(st,{open:g,onOpenChange:f,children:[e.jsx(xI,{asChild:!0,children:M}),e.jsxs(Xe,{children:[e.jsxs(Oe,{children:[e.jsx(Le,{children:"Complete onboarding to continue"}),e.jsx(it,{children:x})]}),(c||h)&&e.jsxs(at,{children:[c&&h&&e.jsx(P,{type:"button",onClick:()=>{f(!1),h()},children:c}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>f(!1),children:"Close"})]})]})]}):M}const uA=({freelancer:t,loading:a=!1,followLoading:s=!1,followDisabled:n=!1,onToggleFollow:r,onFollowAction:i,saveLoading:l=!1,saveDisabled:c=!1,onToggleSave:h,onSaveAction:d,onContact:u,onBack:y,onEmitEvent:x})=>{if(a)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("div",{className:"text-center text-muted-foreground",children:"Loading profile..."})});if(!t)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Freelancer not found"}),e.jsx("a",{href:"/freelancers",className:"text-accent hover:underline",children:"Back to Freelancers"})]})});const m=t.isSaved??!1,g=t.isFollowing??!1,f=n||s,k=c||l,v=I=>{x==null||x({domain:"freelancers",name:I,payload:{freelancerId:t.id,slug:t.slug,name:t.name,source:"profile"},timestamp:new Date().toISOString(),context:{component:"FreelancerProfile"}})};p.useEffect(()=>{v("freelancer_profile_viewed")},[t.id]);const N=()=>{if(f)return;const I=!g;r==null||r(t.id,I),i==null||i({freelancerId:t.id,freelancerSlug:t.slug,action:I?"follow":"unfollow"}),v(I?"freelancer_followed":"freelancer_unfollowed")},M=()=>{if(k)return;const I=!m;h==null||h(t.id,I),d==null||d({freelancerId:t.id,freelancerSlug:t.slug,freelancerName:t.name,action:I?"save":"unsave"}),v(I?"freelancer_saved":"freelancer_unsaved")},b=()=>{u==null||u(t.id),v("freelancer_contact_clicked")},C=t.name.split(" ").map(I=>I[0]).join("").toUpperCase(),S=I=>{switch(I){case"available":return"bg-green-500";case"limited":return"bg-yellow-500";case"unavailable":return"bg-red-500";default:return"bg-gray-500"}},L=I=>{switch(I){case"available":return"Available Now";case"limited":return"Limited Availability";case"unavailable":return"Not Available";default:return I}},w=I=>{switch(I){case"freelancer":return"Freelancer";case"coach":return"Coach";case"mentor":return"Mentor";case"consultant":return"Consultant";case"influencer":return"Influencer";case"streamer":return"Streamer";default:return I}},j=[{id:1,author:"John Smith",company:"BetCasino Ltd",rating:5,date:"2024-01-15",content:"Exceptional expertise in compliance. Helped us secure our MGA license in record time. Highly recommended!"},{id:2,author:"Sarah Johnson",company:"GameTech Solutions",rating:5,date:"2024-01-10",content:"Professional, responsive, and incredibly knowledgeable. A true expert in the iGaming industry."},{id:3,author:"Michael Brown",company:"Lucky Spin Gaming",rating:4,date:"2023-12-20",content:"Great communication and delivered results on time. Would definitely work with again."}];return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"bg-card border-b border-border sticky top-0 z-50",children:e.jsx("div",{className:"container mx-auto px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[y?e.jsxs("button",{type:"button",onClick:y,className:"flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(ts,{className:"w-5 h-5"}),e.jsx("span",{className:"font-medium",children:"Back to Talent"})]}):e.jsxs("a",{href:"/freelancers",className:"flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[e.jsx(ts,{className:"w-5 h-5"}),e.jsx("span",{className:"font-medium",children:"Back to Talent"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(P,{variant:"outline",size:"sm",onClick:N,disabled:f,children:[s?e.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(Ua,{className:`w-4 h-4 mr-2 ${g?"fill-rose-500 text-rose-500":""}`}),g?"Following":"Follow"]}),e.jsxs(P,{variant:"outline",size:"sm",onClick:M,disabled:k,children:[l?e.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(Et,{className:`w-4 h-4 mr-2 ${m?"fill-accent text-accent":""}`}),m?"Saved":"Save"]}),e.jsxs(P,{variant:"outline",size:"sm",children:[e.jsx(as,{className:"w-4 h-4 mr-2"}),"Share"]}),e.jsxs(P,{variant:"accent",size:"sm",onClick:b,children:[e.jsx(ft,{className:"w-4 h-4 mr-2"}),"Contact"]})]})]})})}),e.jsx("div",{className:"bg-gradient-to-r from-primary via-primary/90 to-accent/80 h-32 md:h-48"}),e.jsx("div",{className:"container mx-auto px-4 -mt-16 md:-mt-20 pb-12",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsx(U,{className:"overflow-visible",children:e.jsx(W,{className:"pt-0",children:e.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[e.jsxs("div",{className:"-mt-12 md:-mt-16 relative",children:[e.jsxs(vn,{className:"w-28 h-28 md:w-36 md:h-36 border-4 border-card shadow-lg",children:[e.jsx(il,{src:t.avatar}),e.jsx(bn,{className:"bg-gradient-to-br from-accent to-accent/80 text-white text-3xl md:text-4xl font-bold",children:C})]}),t.isVerified&&e.jsx("div",{className:"absolute -bottom-1 -right-1 bg-card rounded-full p-1",children:e.jsx(Qa,{className:"w-6 h-6 text-accent"})})]}),e.jsxs("div",{className:"flex-1 pt-2 md:pt-6",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground",children:t.name}),t.isTopRated&&e.jsxs(O,{variant:"gaming",className:"gap-1",children:[e.jsx(Vt,{className:"w-3 h-3"}),"Top Rated"]}),t.isRisingTalent&&e.jsxs(O,{variant:"accent",className:"gap-1",children:[e.jsx(jt,{className:"w-3 h-3"}),"Rising Talent"]})]}),e.jsx("p",{className:"text-lg text-muted-foreground mt-1",children:t.title}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1 italic",children:['"',t.tagline,'"']}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 mt-3 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Fe,{className:"w-4 h-4 text-accent"}),t.location.city,","," ",t.location.country]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx($t,{className:"w-4 h-4 text-accent"}),t.location.timezone]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Dt,{className:"w-4 h-4 text-accent"}),t.responseTime]})]})]}),e.jsxs("div",{className:"flex gap-6 text-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-accent",children:[t.yearsOfExperience,"+"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Years Exp."})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-accent",children:t.completedProjects}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Projects"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-center gap-1 text-2xl font-bold text-accent",children:[e.jsx(tt,{className:"w-5 h-5 fill-gaming-gold text-gaming-gold"}),t.rating]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["(",t.reviewCount,")"]})]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-4",children:[e.jsx(O,{variant:"secondary",children:w(t.type)}),e.jsx(O,{variant:"outline",children:t.experienceLevel}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${S(t.availability)}`}),e.jsx("span",{className:"text-sm text-muted-foreground",children:L(t.availability)})]})]})]})]})})}),e.jsxs(ns,{defaultValue:"overview",className:"space-y-6",children:[e.jsxs(rs,{className:"flex-wrap h-auto gap-1 bg-secondary/50 p-1",children:[e.jsxs(Me,{value:"overview",children:[e.jsx(Ce,{className:"w-4 h-4 mr-1.5"}),"Overview"]}),e.jsxs(Me,{value:"portfolio",children:[e.jsx(gs,{className:"w-4 h-4 mr-1.5"}),"Portfolio"]}),e.jsxs(Me,{value:"reviews",children:[e.jsx(tt,{className:"w-4 h-4 mr-1.5"}),"Reviews"]})]}),e.jsxs(ve,{value:"overview",className:"space-y-6",children:[e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(qe,{className:"w-5 h-5 text-accent"}),"About"]})}),e.jsx(W,{children:e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:t.bio})})]}),t.highlights.length>0&&e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Vt,{className:"w-5 h-5 text-accent"}),"Key Highlights"]})}),e.jsx(W,{children:e.jsx("ul",{className:"space-y-3",children:t.highlights.map((I,T)=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(Ee,{className:"w-5 h-5 text-green-500 flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"text-muted-foreground",children:I})]},T))})})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Va,{className:"w-5 h-5 text-accent"}),"Skills & Expertise"]})}),e.jsxs(W,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Specializations"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.specializations.map(I=>e.jsx(O,{variant:"accent",children:I},I))})]}),e.jsx(xn,{}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Skills"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.skills.map(I=>e.jsx(O,{variant:"outline",children:I},I))})]})]})]}),t.certifications.length>0&&e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Qa,{className:"w-5 h-5 text-accent"}),"Certifications"]})}),e.jsx(W,{children:e.jsx("div",{className:"flex flex-wrap gap-2",children:t.certifications.map(I=>e.jsxs(O,{variant:"secondary",className:"gap-1",children:[e.jsx(Qa,{className:"w-3 h-3"}),I]},I))})})]})]}),e.jsx(ve,{value:"portfolio",className:"space-y-6",children:t.portfolio.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:t.portfolio.map((I,T)=>e.jsxs(U,{className:"overflow-hidden group cursor-pointer hover:shadow-lg transition-shadow",children:[e.jsxs("div",{className:"aspect-video relative bg-muted",children:[e.jsx("img",{src:I.thumbnail,alt:I.title,className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:e.jsx(Rt,{className:"w-8 h-8 text-white"})})]}),e.jsxs(W,{className:"p-4",children:[e.jsx("h3",{className:"font-semibold",children:I.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:I.description})]})]},T))}):e.jsx(U,{children:e.jsxs(W,{className:"py-12 text-center text-muted-foreground",children:[e.jsx(gs,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"No portfolio items available yet."})]})})}),e.jsxs(ve,{value:"reviews",className:"space-y-6",children:[e.jsx(U,{children:e.jsx(W,{className:"py-6",children:e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-4xl font-bold text-foreground",children:t.rating}),e.jsx("div",{className:"flex items-center gap-1 mt-1",children:[...Array(5)].map((I,T)=>e.jsx(tt,{className:`w-4 h-4 ${T<Math.floor(t.rating)?"fill-gaming-gold text-gaming-gold":"text-muted"}`},T))}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[t.reviewCount," reviews"]})]}),e.jsx("div",{className:"flex-1 space-y-2",children:[5,4,3,2,1].map(I=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm w-3",children:I}),e.jsx(tt,{className:"w-3 h-3 text-gaming-gold"}),e.jsx(ya,{value:I===5?80:I===4?15:5,className:"h-2 flex-1"})]},I))})]})})}),e.jsx("div",{className:"space-y-4",children:j.map(I=>e.jsx(U,{children:e.jsx(W,{className:"py-4",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(vn,{className:"w-10 h-10",children:e.jsx(bn,{className:"bg-muted",children:I.author[0]})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:I.author}),e.jsx("p",{className:"text-sm text-muted-foreground",children:I.company})]}),e.jsx("div",{className:"flex items-center gap-1",children:[...Array(5)].map((T,A)=>e.jsx(tt,{className:`w-4 h-4 ${A<I.rating?"fill-gaming-gold text-gaming-gold":"text-muted"}`},A))})]}),e.jsxs("div",{className:"mt-3 flex items-start gap-2",children:[e.jsx(Ko,{className:"w-4 h-4 text-muted-foreground flex-shrink-0 mt-1"}),e.jsx("p",{className:"text-muted-foreground",children:I.content})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:new Date(I.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})})},I.id))})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(U,{className:"sticky top-20",children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(Ts,{className:"w-5 h-5 text-accent"}),"Pricing"]})}),e.jsxs(W,{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-secondary/50 rounded-lg",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Hourly Rate"}),e.jsxs("p",{className:"text-2xl font-bold text-foreground",children:[t.hourlyRate.currency," ",t.hourlyRate.min," -"," ",t.hourlyRate.max]})]}),t.sessionRate&&e.jsxs("div",{className:"p-4 bg-accent/10 rounded-lg",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t.type==="mentor"||t.type==="coach"?"Session Rate":"Consultation"}),e.jsxs("p",{className:"text-2xl font-bold text-accent",children:[t.sessionRate.currency," ",t.sessionRate.price]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.sessionRate.duration})]}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsxs(P,{onClick:b,className:"w-full",variant:"accent",children:[e.jsx(ft,{className:"w-4 h-4 mr-2"}),"Send Message"]}),(t.type==="mentor"||t.type==="coach")&&e.jsxs(P,{className:"w-full",variant:"outline",children:[e.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Book Session"]})]}),e.jsx(xn,{}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Success Rate"}),e.jsxs("span",{className:"font-medium",children:[t.successRate,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Response Time"}),e.jsx("span",{className:"font-medium",children:t.responseTime})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Member Since"}),e.jsx("span",{className:"font-medium",children:new Date(t.joinedDate).toLocaleDateString("en-US",{year:"numeric",month:"short"})})]})]})]})]}),e.jsxs(U,{children:[e.jsx(ne,{children:e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx(fl,{className:"w-5 h-5 text-accent"}),"Languages"]})}),e.jsx(W,{children:e.jsx("div",{className:"flex flex-wrap gap-2",children:t.languages.map(I=>e.jsx(O,{variant:"outline",children:I},I))})})]}),t.isVerified&&e.jsx(U,{className:"bg-accent/5 border-accent/20",children:e.jsx(W,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Qa,{className:"w-8 h-8 text-accent"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:"Verified Professional"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Identity and credentials verified"})]})]})})})]})]})})]})},W9={freelancer:e.jsx(Ce,{className:"w-3.5 h-3.5"}),coach:e.jsx(Va,{className:"w-3.5 h-3.5"}),mentor:e.jsx(qe,{className:"w-3.5 h-3.5"}),consultant:e.jsx(vl,{className:"w-3.5 h-3.5"}),streamer:e.jsx(tt,{className:"w-3.5 h-3.5"}),influencer:e.jsx(jt,{className:"w-3.5 h-3.5"})},Z9={freelancer:"Freelancer",coach:"Coach",mentor:"Mentor",consultant:"Consultant",streamer:"Streamer",influencer:"Influencer"},Y9={freelancer:"bg-blue-500/10 text-blue-600 border-blue-200",coach:"bg-green-500/10 text-green-600 border-green-200",mentor:"bg-purple-500/10 text-purple-600 border-purple-200",consultant:"bg-orange-500/10 text-orange-600 border-orange-200",streamer:"bg-rose-500/10 text-rose-600 border-rose-200",influencer:"bg-cyan-500/10 text-cyan-600 border-cyan-200"},J9={available:"bg-emerald-500/10 text-emerald-600",limited:"bg-amber-500/10 text-amber-600",unavailable:"bg-red-500/10 text-red-500"},qB={available:"Available Now",limited:"Limited Availability",unavailable:"Not Available"},mA=({freelancer:t,viewMode:a,isSaved:s,isFollowing:n,followDisabled:r=!1,followLoading:i=!1,onToggleFollow:l,onFollowAction:c,saveDisabled:h=!1,saveLoading:d=!1,onToggleSave:u,onSaveAction:y,onContact:x,onViewProfile:m,onEmitEvent:g,positionInList:f})=>{const k=s??t.isSaved??!1,v=n??t.isFollowing??!1,N=r||i,M=h||d,b=(I,T,A)=>I===T?`${A} ${I}/hr`:`${A} ${I}-${T}/hr`,C=I=>I.split(" ").map(T=>T[0]).join("").toUpperCase(),S=()=>{if(N)return;const I=!v;l==null||l(t.id,I),c==null||c({freelancerId:t.id,freelancerSlug:t.slug,action:I?"follow":"unfollow"}),g==null||g({domain:"freelancers",name:I?"freelancer_followed":"freelancer_unfollowed",payload:{freelancerId:t.id,slug:t.slug,name:t.name,positionInList:f,source:"listing"},timestamp:new Date().toISOString(),context:{component:"Freelancers"}})},L=()=>{if(M)return;const I=!k;u==null||u(t.id,I),y==null||y({freelancerId:t.id,freelancerSlug:t.slug,freelancerName:t.name,action:I?"save":"unsave"}),g==null||g({domain:"freelancers",name:I?"freelancer_saved":"freelancer_unsaved",payload:{freelancerId:t.id,slug:t.slug,name:t.name,positionInList:f,source:"listing"},timestamp:new Date().toISOString(),context:{component:"Freelancers"}})},w=()=>{x==null||x(t.id),g==null||g({domain:"freelancers",name:"freelancer_contact_clicked",payload:{freelancerId:t.id,slug:t.slug,name:t.name,positionInList:f,source:"listing"},timestamp:new Date().toISOString(),context:{component:"Freelancers"}})},j=()=>{m==null||m(t.id),g==null||g({domain:"freelancers",name:"freelancer_profile_opened",payload:{freelancerId:t.id,slug:t.slug,name:t.name,positionInList:f,source:"listing",openedIn:"same_tab"},timestamp:new Date().toISOString(),context:{component:"Freelancers"}})};return a==="list"?e.jsx(U,{className:"p-4 hover:shadow-md transition-all border-border bg-card group",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsxs("div",{className:"relative",children:[e.jsxs(vn,{className:"w-16 h-16",children:[e.jsx(il,{src:t.avatar,alt:t.name}),e.jsx(bn,{className:"bg-accent/20 text-accent font-semibold",children:C(t.name)})]}),t.isVerified&&e.jsx(Ee,{className:"absolute -bottom-1 -right-1 w-5 h-5 text-blue-500 bg-white rounded-full"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-foreground truncate",children:t.name}),t.isTopRated&&e.jsxs(O,{variant:"outline",className:"bg-amber-500/10 text-amber-600 border-amber-200 text-xs",children:[e.jsx(Vt,{className:"w-3 h-3 mr-1"}),"Top Rated"]}),t.isRisingTalent&&e.jsxs(O,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-200 text-xs",children:[e.jsx(jt,{className:"w-3 h-3 mr-1"}),"Rising Talent"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:t.title}),e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[e.jsxs(O,{variant:"outline",className:`${Y9[t.type]} text-xs`,children:[W9[t.type],e.jsx("span",{className:"ml-1",children:Z9[t.type]})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fe,{className:"w-3 h-3"}),t.location.city,", ",t.location.country]})]})]}),e.jsxs("div",{className:"flex-shrink-0 text-right",children:[e.jsx("div",{className:"font-semibold text-foreground",children:b(t.hourlyRate.min,t.hourlyRate.max,t.hourlyRate.currency)}),e.jsxs("div",{className:"mt-1 flex items-center justify-end gap-1",children:[e.jsx("button",{onClick:S,disabled:N,className:"p-1.5 rounded-full hover:bg-muted transition-colors disabled:cursor-not-allowed disabled:opacity-60","aria-label":v?"Unfollow":"Follow",children:i?e.jsx(Ze,{className:"w-5 h-5 animate-spin text-muted-foreground"}):e.jsx(Ua,{className:`w-5 h-5 ${v?"text-rose-500 fill-rose-500":"text-muted-foreground"}`})}),e.jsx("button",{onClick:L,disabled:M,className:"p-1.5 rounded-full hover:bg-muted transition-colors disabled:cursor-not-allowed disabled:opacity-60","aria-label":k?"Remove from saved":"Save",children:d?e.jsx(Ze,{className:"w-5 h-5 animate-spin text-muted-foreground"}):k?e.jsx(Aa,{className:"w-5 h-5 text-accent"}):e.jsx(Et,{className:"w-5 h-5 text-muted-foreground"})})]})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-1",children:t.tagline}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-3",children:[t.skills.slice(0,5).map(I=>e.jsx(O,{variant:"secondary",className:"text-xs",children:I},I)),t.skills.length>5&&e.jsxs(O,{variant:"outline",className:"text-xs text-muted-foreground",children:["+",t.skills.length-5," more"]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-4",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(tt,{className:"w-4 h-4 text-amber-500 fill-amber-500"}),e.jsx("span",{className:"font-medium",children:t.rating}),e.jsxs("span",{className:"text-muted-foreground",children:["(",t.reviewCount,")"]})]}),e.jsxs("span",{className:"text-muted-foreground",children:[t.completedProjects," projects"]}),e.jsxs("span",{className:"text-muted-foreground",children:[t.successRate,"% success"]}),e.jsx(O,{variant:"outline",className:J9[t.availability],children:qB[t.availability]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{variant:"outline",size:"sm",onClick:j,children:"View Profile"}),e.jsxs(P,{size:"sm",onClick:w,className:"bg-accent hover:bg-accent/90 text-accent-foreground",children:[e.jsx(xc,{className:"w-4 h-4 mr-1"}),"Contact"]})]})]})]})]})}):e.jsxs(U,{className:"p-4 hover:shadow-md transition-all border-border bg-card group flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(vn,{className:"w-12 h-12",children:[e.jsx(il,{src:t.avatar,alt:t.name}),e.jsx(bn,{className:"bg-accent/20 text-accent font-semibold text-sm",children:C(t.name)})]}),t.isVerified&&e.jsx(Ee,{className:"absolute -bottom-0.5 -right-0.5 w-4 h-4 text-blue-500 bg-white rounded-full"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm truncate",children:t.name}),e.jsxs(O,{variant:"outline",className:`${Y9[t.type]} text-xs mt-0.5`,children:[W9[t.type],e.jsx("span",{className:"ml-1",children:Z9[t.type]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:S,disabled:N,className:"p-1.5 rounded-full hover:bg-muted transition-colors disabled:cursor-not-allowed disabled:opacity-60","aria-label":v?"Unfollow":"Follow",children:i?e.jsx(Ze,{className:"w-5 h-5 animate-spin text-muted-foreground"}):e.jsx(Ua,{className:`w-5 h-5 ${v?"text-rose-500 fill-rose-500":"text-muted-foreground"}`})}),e.jsx("button",{onClick:L,disabled:M,className:"p-1.5 rounded-full hover:bg-muted transition-colors disabled:cursor-not-allowed disabled:opacity-60","aria-label":k?"Remove from saved":"Save",children:d?e.jsx(Ze,{className:"w-5 h-5 animate-spin text-muted-foreground"}):k?e.jsx(Aa,{className:"w-5 h-5 text-accent"}):e.jsx(Et,{className:"w-5 h-5 text-muted-foreground"})})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-3",children:[t.isTopRated&&e.jsxs(O,{variant:"outline",className:"bg-amber-500/10 text-amber-600 border-amber-200 text-xs",children:[e.jsx(Vt,{className:"w-3 h-3 mr-0.5"}),"Top Rated"]}),t.isRisingTalent&&e.jsxs(O,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-200 text-xs",children:[e.jsx(jt,{className:"w-3 h-3 mr-0.5"}),"Rising"]}),e.jsx(O,{variant:"outline",className:`${J9[t.availability]} text-xs`,children:t.availability==="available"?"Available":t.availability==="limited"?"Limited":"Busy"})]}),e.jsx("h4",{className:"font-medium text-foreground text-sm mt-3 line-clamp-1",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2 flex-grow",children:t.tagline}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mt-2",children:[e.jsx(Fe,{className:"w-3 h-3"}),t.location.city,", ",t.location.country]}),e.jsxs("div",{className:"flex flex-wrap gap-1 mt-3",children:[t.skills.slice(0,3).map(I=>e.jsx(O,{variant:"secondary",className:"text-xs",children:I},I)),t.skills.length>3&&e.jsxs(O,{variant:"outline",className:"text-xs text-muted-foreground",children:["+",t.skills.length-3]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-3 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(tt,{className:"w-4 h-4 text-amber-500 fill-amber-500"}),e.jsx("span",{className:"font-medium text-sm",children:t.rating}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.reviewCount,")"]})]}),e.jsx("div",{className:"font-semibold text-sm text-foreground",children:b(t.hourlyRate.min,t.hourlyRate.max,t.hourlyRate.currency)})]}),e.jsx(P,{className:"w-full mt-3 bg-accent hover:bg-accent/90 text-accent-foreground",size:"sm",onClick:j,children:"View Profile"})]})},FB=({title:t,description:a,popularTags:s=[],selectedTags:n=[],onTagClick:r,onTagRemove:i,className:l=""})=>e.jsxs("div",{className:`bg-card border-b border-border ${l}`,children:[e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground",children:t}),a&&e.jsx("p",{className:"hidden lg:block text-muted-foreground mt-1",children:a})]})})}),s.length>0&&e.jsx("div",{className:"border-t border-border",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3",children:e.jsxs("div",{className:"flex items-center gap-3 overflow-x-auto scrollbar-hide",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground flex-shrink-0",children:"Popular:"}),e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:s.map(c=>{const h=n.includes(c.value);return e.jsxs("button",{onClick:()=>r==null?void 0:r(c.value),className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-sm font-medium border transition-all ${h?"bg-accent text-accent-foreground border-accent":"bg-accent/10 text-accent border-accent/30 hover:bg-accent/20"}`,children:["#",c.label,h&&i&&e.jsx(Ve,{className:"w-3.5 h-3.5 hover:text-accent-foreground/80",onClick:d=>{d.stopPropagation(),i(c.value)}})]},c.value)})})]})})})]}),EB=({viewMode:t,onViewModeChange:a,itemsPerPage:s,onItemsPerPageChange:n,itemsPerPageOptions:r=[5,10,20,50],sortBy:i,onSortChange:l,sortOptions:c,pagination:h,title:d,itemLabel:u="items",icon:y,className:x=""})=>e.jsx("div",{className:`bg-card rounded-lg shadow-sm border border-border p-4 ${x}`,children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[y&&e.jsx(y,{className:"w-5 h-5 text-muted-foreground"}),e.jsxs("div",{children:[d&&e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:d}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing"," ",e.jsx("span",{className:"font-semibold text-foreground",children:h.startIndex}),"–",e.jsx("span",{className:"font-semibold text-foreground",children:h.endIndex})," ","of"," ",e.jsx("span",{className:"font-semibold text-foreground",children:h.totalItems})," ",u]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Order by"}),e.jsx("select",{value:i,onChange:m=>l(m.target.value),className:"h-9 px-3 rounded-md border border-input bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:c.map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))})]}),e.jsxs("div",{className:"flex bg-muted p-1 rounded-lg",children:[e.jsxs("button",{onClick:()=>a("grid"),className:`px-3 py-1.5 rounded-md flex items-center gap-1.5 transition-colors ${t==="grid"?"bg-accent text-accent-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"aria-label":"Grid view","aria-pressed":t==="grid",children:[e.jsx(qa,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium hidden sm:inline",children:"Grid"})]}),e.jsxs("button",{onClick:()=>a("list"),className:`px-3 py-1.5 rounded-md flex items-center gap-1.5 transition-colors ${t==="list"?"bg-accent text-accent-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,"aria-label":"List view","aria-pressed":t==="list",children:[e.jsx(bl,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium hidden sm:inline",children:"List"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"Show:"}),e.jsx("select",{value:s,onChange:m=>n(Number(m.target.value)),className:"h-9 px-2 rounded-md border border-input bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:r.map(m=>e.jsx("option",{value:m,children:m},m))})]})]})]})}),OB=({pagination:t,onPageChange:a,maxPagesToShow:s=5,showFirstLast:n=!0,className:r=""})=>{const{currentPage:i,totalPages:l}=t;if(l<=1)return null;const h=(()=>{const d=[];let u=Math.max(1,i-Math.floor(s/2)),y=Math.min(l,u+s-1);y-u+1<s&&(u=Math.max(1,y-s+1)),u>1&&(d.push(1),u>2&&d.push("ellipsis"));for(let x=u;x<=y;x++)(x!==1&&x!==l||u===1&&x===1||y===l&&x===l)&&d.push(x);return y<l&&(y<l-1&&d.push("ellipsis"),d.push(l)),d})();return e.jsx("div",{className:`flex justify-center ${r}`,children:e.jsxs("nav",{className:"flex items-center gap-1","aria-label":"Pagination",children:[n&&e.jsx("button",{onClick:()=>a(1),disabled:i===1,className:"p-2 rounded-md text-muted-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-colors","aria-label":"First page",children:e.jsx(ic,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>a(i-1),disabled:i===1,className:"p-2 rounded-md text-muted-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-colors","aria-label":"Previous page",children:e.jsx(ts,{className:"w-4 h-4"})}),e.jsx("div",{className:"flex items-center gap-1",children:h.map((d,u)=>d==="ellipsis"?e.jsx("span",{className:"px-2 py-1 text-muted-foreground",children:"..."},`ellipsis-${u}`):e.jsx("button",{onClick:()=>a(d),className:`min-w-[36px] h-9 px-3 rounded-md text-sm font-medium transition-colors ${i===d?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,"aria-label":`Page ${d}`,"aria-current":i===d?"page":void 0,children:d},d))}),e.jsx("button",{onClick:()=>a(i+1),disabled:i===l,className:"p-2 rounded-md text-muted-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-colors","aria-label":"Next page",children:e.jsx(la,{className:"w-4 h-4"})}),n&&e.jsx("button",{onClick:()=>a(l),disabled:i===l,className:"p-2 rounded-md text-muted-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-colors","aria-label":"Last page",children:e.jsx(oc,{className:"w-4 h-4"})})]})})},BB=({icon:t=kc,title:a="No results found",description:s="Try adjusting your search criteria or filters to find more results.",actionLabel:n="Clear All Filters",onAction:r,className:i=""})=>e.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-4 ${i}`,children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mb-4",children:e.jsx(t,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:a}),e.jsx("p",{className:"text-muted-foreground text-center max-w-md mb-6",children:s}),r&&e.jsx("button",{onClick:r,className:"px-6 py-2.5 bg-accent hover:bg-accent-hover text-accent-foreground font-medium rounded-lg transition-colors",children:n})]}),HB=({isOpen:t,onClose:a,title:s="Filters",sections:n,onFilterChange:r,onApply:i,onClearAll:l,savedCount:c=0,showSavedOnly:h=!1,onToggleSavedOnly:d,savedLabel:u="Saved Items"})=>t?e.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:a,"aria-hidden":"true"}),e.jsxs("div",{className:"absolute inset-y-0 right-0 w-full max-w-sm bg-background shadow-xl flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ds,{className:"w-5 h-5 text-accent"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s})]}),e.jsx("button",{onClick:a,className:"p-2 rounded-lg hover:bg-muted transition-colors","aria-label":"Close filters",children:e.jsx(Ve,{className:"w-5 h-5 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[n.map(y=>e.jsx(VB,{section:y,onFilterChange:r},y.key)),d&&e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsxs("button",{onClick:d,className:`w-full px-4 py-2.5 rounded-lg flex items-center justify-center gap-2 transition-colors ${h?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:[e.jsx(Et,{className:"w-4 h-4"}),e.jsxs("span",{className:"font-medium",children:[u," (",c,")"]})]})})]}),e.jsxs("div",{className:"p-4 border-t border-border space-y-2",children:[e.jsx("button",{onClick:()=>{i(),a()},className:"w-full py-2.5 bg-accent hover:bg-accent-hover text-accent-foreground font-medium rounded-lg transition-colors",children:"Apply Filters"}),e.jsx("button",{onClick:l,className:"w-full py-2.5 bg-muted hover:bg-muted/80 text-muted-foreground font-medium rounded-lg transition-colors",children:"Clear All"})]})]})]}):null,VB=({section:t,onFilterChange:a})=>{var u,y,x;const[s,n]=p.useState(t.defaultExpanded??!0),[r,i]=p.useState(""),l=((u=t.options)==null?void 0:u.filter(m=>m.label.toLowerCase().includes(r.toLowerCase())))||[],c=m=>{const g=t.selectedValues.includes(m)?t.selectedValues.filter(f=>f!==m):[...t.selectedValues,m];a(t.key,g)},h=m=>{a(t.key,m?[m]:[])},d=t.searchable&&(((y=t.options)==null?void 0:y.length)||0)>6;return e.jsxs("div",{className:"border-b border-border pb-4 last:border-b-0",children:[e.jsxs("button",{onClick:()=>n(!s),className:"flex items-center justify-between w-full py-2",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.label}),s?e.jsx(cn,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(la,{className:"w-4 h-4 text-muted-foreground"})]}),s&&e.jsxs("div",{className:"mt-2 space-y-2",children:[d&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx(wt,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx("input",{type:"text",value:r,onChange:m=>i(m.target.value),placeholder:`Search ${t.label.toLowerCase()}...`,className:"w-full h-9 pl-8 pr-3 text-sm rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),t.type==="checkbox"&&e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:l.map(m=>e.jsxs("label",{className:"flex items-center gap-3 p-2 rounded-md hover:bg-muted cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.selectedValues.includes(m.value),onChange:()=>c(m.value),className:"h-4 w-4 rounded border-input text-accent focus:ring-accent"}),e.jsx("span",{className:"text-sm text-foreground flex-1",children:m.label}),m.count!==void 0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:m.count})]},m.value))}),(t.type==="select"||t.type==="searchable-select")&&e.jsxs("select",{value:t.selectedValues[0]||"",onChange:m=>h(m.target.value),className:"w-full h-10 px-3 rounded-md border border-input bg-background text-sm focus:outline-none focus:ring-2 focus:ring-ring",children:[e.jsxs("option",{value:"",children:["All ",t.label]}),(x=t.options)==null?void 0:x.map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))]})]})]})},UB=({filters:t,onRemove:a,onClearAll:s,onCreateAlert:n,showCreateAlert:r=!0,className:i=""})=>t.length===0?null:e.jsxs("div",{className:`flex flex-wrap items-center gap-2 ${i}`,children:[t.map(l=>e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-accent/10 text-accent border border-accent/20 rounded-full text-sm",children:[l.label&&e.jsxs("span",{className:"font-medium",children:[l.label,":"]}),e.jsx("span",{children:l.displayValue||l.value}),e.jsx("button",{onClick:()=>a(l.key,l.value),className:"ml-1 hover:text-accent-hover transition-colors","aria-label":`Remove ${l.label||l.key} filter`,children:e.jsx(Ve,{className:"w-3.5 h-3.5"})})]},`${l.key}-${l.value}`)),e.jsx("button",{onClick:s,className:"inline-flex items-center px-3 py-1.5 bg-muted text-muted-foreground hover:bg-muted/80 rounded-full text-sm font-medium transition-colors",children:"Clear All"}),r&&n&&e.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-primary/10 text-primary hover:bg-primary/20 rounded-full text-sm font-medium transition-colors",children:[e.jsx(Ba,{className:"w-3.5 h-3.5"}),"Create Alert"]})]}),GB=[{label:"compliance",value:"compliance"},{label:"CRM",value:"crm"},{label:"trading",value:"trading"},{label:"marketing",value:"marketing"},{label:"analytics",value:"analytics"},{label:"payments",value:"payments"},{label:"game-design",value:"game-design"},{label:"LatAm",value:"latam"}],$B=[{value:"relevance",label:"Most Relevant"},{value:"rating",label:"Highest Rated"},{value:"reviews",label:"Most Reviews"},{value:"rate_asc",label:"Rate: Low to High"},{value:"rate_desc",label:"Rate: High to Low"},{value:"newest",label:"Newest Members"}],pA=({freelancers:t,filterOptions:a,loading:s,page:n,pageSize:r,totalCount:i,totalPages:l,onPageChange:c,onPageSizeChange:h,filters:d,onFiltersChange:u,onClearFilters:y,viewMode:x,onViewModeChange:m,followDisabled:g=!1,followLoading:f=!1,onToggleFollow:k,onFollowAction:v,saveDisabled:N=!1,saveLoading:M=!1,onToggleSave:b,onSaveAction:C,onEmitEvent:S})=>{const[L,w]=p.useState(d.search??""),[j,I]=p.useState(!1),T=d.tags??[],A=d.sortBy??"relevance";p.useEffect(()=>{w(d.search??"")},[d.search]);const R=p.useMemo(()=>t.filter(_=>_.isSaved).length,[t]),D=i===0?0:(n-1)*r+1,q=Math.min(n*r,i),E={currentPage:n,totalPages:l,totalItems:i,itemsPerPage:r,startIndex:D,endIndex:q},F=[{key:"types",label:"Type",type:"checkbox",searchable:!1,defaultExpanded:!0,options:a.types,selectedValues:d.types},{key:"specializations",label:"Specialization",type:"checkbox",searchable:!0,defaultExpanded:!0,options:a.specializations,selectedValues:d.specializations},{key:"experienceLevel",label:"Experience Level",type:"checkbox",searchable:!1,defaultExpanded:!0,options:a.experienceLevels,selectedValues:d.experienceLevel},{key:"locations",label:"Location",type:"checkbox",searchable:!0,defaultExpanded:!1,options:a.locations,selectedValues:d.locations},{key:"languages",label:"Language",type:"checkbox",searchable:!0,defaultExpanded:!1,options:a.languages,selectedValues:d.languages},{key:"availability",label:"Availability",type:"checkbox",searchable:!1,defaultExpanded:!1,options:a.availability,selectedValues:d.availability},{key:"signals",label:"Preferences",type:"toggle",defaultExpanded:!0,options:[{value:"verifiedOnly",label:"Verified Only"},{value:"topRatedOnly",label:"Top Rated Only"}],selectedValues:[...d.verifiedOnly?["verifiedOnly"]:[],...d.topRatedOnly?["topRatedOnly"]:[]]}],G=d.types.length+d.specializations.length+d.experienceLevel.length+d.locations.length+d.languages.length+d.availability.length+(d.verifiedOnly?1:0)+(d.topRatedOnly?1:0)+T.length,Z=[...d.types.map(_=>{var V;return{key:"types",label:"Type",value:_,displayValue:((V=a.types.find(J=>J.value===_))==null?void 0:V.label)??_}}),...d.specializations.map(_=>{var V;return{key:"specializations",label:"Spec",value:_,displayValue:((V=a.specializations.find(J=>J.value===_))==null?void 0:V.label)??_}}),...d.experienceLevel.map(_=>{var V;return{key:"experienceLevel",label:"Level",value:_,displayValue:((V=a.experienceLevels.find(J=>J.value===_))==null?void 0:V.label)??_}}),...d.locations.map(_=>{var V;return{key:"locations",label:"Location",value:_,displayValue:((V=a.locations.find(J=>J.value===_))==null?void 0:V.label)??_}}),...d.languages.map(_=>{var V;return{key:"languages",label:"Language",value:_,displayValue:((V=a.languages.find(J=>J.value===_))==null?void 0:V.label)??_}}),...d.availability.map(_=>{var V;return{key:"availability",label:"Avail",value:_,displayValue:((V=a.availability.find(J=>J.value===_))==null?void 0:V.label)??_}}),...d.verifiedOnly?[{key:"verifiedOnly",label:"",value:"verifiedOnly",displayValue:"Verified Only"}]:[],...d.topRatedOnly?[{key:"topRatedOnly",label:"",value:"topRatedOnly",displayValue:"Top Rated Only"}]:[],...T.map(_=>({key:"tag",label:"Tag",value:_,displayValue:`#${_}`}))],$=_=>{u({...d,search:_}),c(1)},Q=_=>{const V=T.includes(_)?T.filter(J=>J!==_):[...T,_];u({...d,tags:V}),c(1)},te=_=>{u({...d,tags:T.filter(V=>V!==_)}),c(1)},K=(_,V)=>{u(_==="signals"?{...d,verifiedOnly:V.includes("verifiedOnly"),topRatedOnly:V.includes("topRatedOnly")}:{...d,[_]:V}),c(1)},ee=(_,V)=>{u(_==="tag"?{...d,tags:T.filter(J=>J!==V)}:_==="verifiedOnly"?{...d,verifiedOnly:!1}:_==="topRatedOnly"?{...d,topRatedOnly:!1}:{...d,[_]:d[_].filter(J=>J!==V)}),c(1)},ce=()=>{y(),w(""),c(1)},fe=_=>m(_),de=_=>{h(_)},se=_=>{u({...d,sortBy:_}),c(1)},H=_=>{c(_),window.scrollTo({top:0,behavior:"smooth"})},z=_=>{console.log("Contact freelancer:",_)};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(FB,{title:"iGaming Talent Marketplace",description:"Connect with top freelancers, coaches, mentors, and consultants specializing in the iGaming industry.",popularTags:GB,selectedTags:T,onTagClick:Q,onTagRemove:te}),e.jsx("div",{className:"bg-secondary/30 border-b border-border",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:e.jsx(wI,{value:L,onChange:w,onSubmit:$,onClear:()=>{w(""),u({...d,search:""})},onFilterClick:()=>I(!0),placeholder:"Search by skill, specialization, or name...",filterCount:G})})}),e.jsx("section",{className:"py-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[Z.length>0&&e.jsx(UB,{filters:Z,onRemove:ee,onClearAll:ce,showCreateAlert:!0,onCreateAlert:()=>console.log("Create alert"),className:"mb-4"}),e.jsxs("div",{className:"flex gap-6",children:[e.jsx("aside",{className:"hidden lg:block w-72 flex-shrink-0",children:e.jsx("div",{className:"sticky top-24",children:e.jsx(vI,{title:"Filters",sections:F,onFilterChange:K,onClearAll:ce,activeFiltersCount:G,savedCount:R,savedLabel:"Saved Talent"})})}),e.jsxs("main",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"hidden lg:block",children:e.jsx(EB,{viewMode:x,onViewModeChange:fe,sortBy:A,sortOptions:$B,onSortChange:se,itemsPerPage:r,onItemsPerPageChange:de,pagination:E,itemLabel:"talent"})}),s?e.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-muted-foreground",children:e.jsx("span",{children:"Loading talent..."})}):t.length===0?e.jsx(BB,{icon:qe,title:"No talent found",description:"Try adjusting your search or filter criteria to find more results.",actionLabel:"Clear All Filters",onAction:ce}):e.jsx("div",{className:x==="grid"?"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4 mt-4":"flex flex-col gap-4 mt-4",children:t.map((_,V)=>e.jsx(mA,{freelancer:_,viewMode:x,isSaved:_.isSaved,isFollowing:_.isFollowing,followDisabled:g,followLoading:f,onToggleFollow:k,onFollowAction:v,saveDisabled:N,saveLoading:M,onToggleSave:b,onSaveAction:C,onContact:z,onViewProfile:()=>console.log(_.id),onEmitEvent:S,positionInList:V+1},_.id))}),!s&&l>1&&e.jsx(OB,{pagination:E,onPageChange:H,className:"mt-8"})]})]})]})}),e.jsx(HB,{isOpen:j,onClose:()=>I(!1),sections:F,onFilterChange:K,onApply:()=>I(!1),onClearAll:ce,savedCount:R,savedLabel:"Saved Talent"}),e.jsx(cl,{})]})},Mn=[{id:"1",name:"Marcus Chen",slug:"marcus-chen",avatar:"/placeholder.svg",title:"iGaming Compliance Consultant",tagline:"Helping operators navigate regulatory landscapes across 15+ jurisdictions",type:"consultant",specializations:["Compliance","Licensing","Responsible Gaming"],skills:["MGA Licensing","UKGC Compliance","AML/KYC","Risk Assessment","Policy Development"],experienceLevel:"Expert",yearsOfExperience:12,location:{country:"Malta",city:"Sliema",timezone:"CET"},hourlyRate:{min:150,max:250,currency:"EUR"},rating:4.9,reviewCount:127,completedProjects:89,successRate:98,responseTime:"< 2 hours",availability:"available",languages:["English","Mandarin","Maltese"],bio:"Former Head of Compliance at a major iGaming operator with extensive experience in obtaining and maintaining licenses across European and emerging markets.",highlights:["Secured 12+ gaming licenses for clients","Led compliance teams at tier-1 operators","Speaker at ICE London and SBC Summit"],certifications:["CGMA","CAMS","ICA Diploma"],portfolio:[],isVerified:!0,isTopRated:!0,isFeatured:!0,isRisingTalent:!1,joinedDate:"2021-03-15",lastActive:"2024-01-20",isSaved:!1},{id:"2",name:"Sofia Rodriguez",slug:"sofia-rodriguez",avatar:"/placeholder.svg",title:"CRM & Retention Strategy Coach",tagline:"Transforming player engagement through data-driven retention strategies",type:"coach",specializations:["CRM","Player Retention","Marketing Automation"],skills:["Optimove","Salesforce","Player Segmentation","Lifecycle Marketing","Bonus Optimization"],experienceLevel:"Expert",yearsOfExperience:8,location:{country:"Spain",city:"Barcelona",timezone:"CET"},hourlyRate:{min:120,max:180,currency:"EUR"},sessionRate:{duration:"60 min",price:150,currency:"EUR"},rating:4.8,reviewCount:94,completedProjects:156,successRate:96,responseTime:"< 4 hours",availability:"available",languages:["English","Spanish","Portuguese"],bio:"I help iGaming companies maximize player lifetime value through strategic CRM implementation and team coaching.",highlights:["Increased client retention rates by 35% on average","Trained 50+ CRM professionals","Built retention programs for 3 unicorn startups"],certifications:["Optimove Certified Expert","HubSpot Marketing"],portfolio:[],isVerified:!0,isTopRated:!0,isFeatured:!0,isRisingTalent:!1,joinedDate:"2020-08-22",lastActive:"2024-01-21",isSaved:!0},{id:"3",name:"James O'Brien",slug:"james-obrien",avatar:"/placeholder.svg",title:"Sports Trading Mentor",tagline:"Ex-Betfair trader teaching the art of odds compilation and risk management",type:"mentor",specializations:["Sports Trading","Odds Compilation","Risk Management"],skills:["Football Trading","In-Play Markets","Pricing Models","Liability Management","Market Making"],experienceLevel:"Expert",yearsOfExperience:15,location:{country:"United Kingdom",city:"London",timezone:"GMT"},hourlyRate:{min:200,max:300,currency:"GBP"},sessionRate:{duration:"90 min",price:275,currency:"GBP"},rating:5,reviewCount:52,completedProjects:38,successRate:100,responseTime:"< 24 hours",availability:"limited",languages:["English"],bio:"15 years of experience in sports trading at Betfair, Paddy Power, and as an independent consultant. I mentor aspiring traders and help sportsbooks optimize their trading operations.",highlights:["Managed £50M+ in liabilities","Trained traders at 5 major sportsbooks","Developed proprietary pricing algorithms"],certifications:[],portfolio:[],isVerified:!0,isTopRated:!0,isFeatured:!1,isRisingTalent:!1,joinedDate:"2022-01-10",lastActive:"2024-01-19",isSaved:!1},{id:"4",name:"Elena Kowalski",slug:"elena-kowalski",avatar:"/placeholder.svg",title:"Freelance Game Designer",tagline:"Creating engaging slot mechanics and bonus features that players love",type:"freelancer",specializations:["Game Design","Slots","Math Models"],skills:["Slot Design","Game Math","Feature Design","Unity","Volatility Modeling"],experienceLevel:"Intermediate",yearsOfExperience:5,location:{country:"Poland",city:"Warsaw",timezone:"CET"},hourlyRate:{min:60,max:90,currency:"EUR"},rating:4.7,reviewCount:43,completedProjects:28,successRate:95,responseTime:"< 6 hours",availability:"available",languages:["English","Polish","German"],bio:"Passionate game designer specializing in slot games. I combine mathematical precision with creative mechanics to deliver games that perform.",highlights:["Designed 15+ launched slot titles","Featured game at ICE 2023","Average 4.5/5 player rating"],certifications:["Unity Certified Developer"],portfolio:[{title:"Golden Dragon Slots",description:"High-volatility Asian-themed slot with cascading reels",thumbnail:"/placeholder.svg"}],isVerified:!0,isTopRated:!1,isFeatured:!1,isRisingTalent:!0,joinedDate:"2023-02-18",lastActive:"2024-01-21",isSaved:!1},{id:"5",name:"David Andersson",slug:"david-andersson",avatar:"/placeholder.svg",title:"Affiliate Marketing Consultant",tagline:"Building and scaling affiliate programs for iGaming operators",type:"consultant",specializations:["Affiliate Marketing","Partner Management","Performance Marketing"],skills:["Affiliate Programs","Income Access","NetRefer","SEO","Content Strategy"],experienceLevel:"Expert",yearsOfExperience:10,location:{country:"Sweden",city:"Stockholm",timezone:"CET"},hourlyRate:{min:130,max:200,currency:"EUR"},rating:4.8,reviewCount:76,completedProjects:67,successRate:97,responseTime:"< 3 hours",availability:"available",languages:["English","Swedish","Norwegian"],bio:"Former Affiliate Director at LeoVegas. I help operators build, optimize, and scale their affiliate programs for sustainable growth.",highlights:["Grew affiliate revenue 400% at previous role","Managed 2000+ affiliate relationships","Launched programs in 8 markets"],certifications:["Google Analytics","Google Ads"],portfolio:[],isVerified:!0,isTopRated:!0,isFeatured:!0,isRisingTalent:!1,joinedDate:"2021-06-01",lastActive:"2024-01-20",isSaved:!1},{id:"6",name:"Anna Petrova",slug:"anna-petrova",avatar:"/placeholder.svg",title:"Product Management Coach",tagline:"Coaching iGaming PMs to build products players can't put down",type:"coach",specializations:["Product Management","Sportsbook","Casino"],skills:["Roadmapping","User Research","Agile","A/B Testing","OKRs"],experienceLevel:"Expert",yearsOfExperience:9,location:{country:"Estonia",city:"Tallinn",timezone:"EET"},hourlyRate:{min:100,max:160,currency:"EUR"},sessionRate:{duration:"60 min",price:120,currency:"EUR"},rating:4.9,reviewCount:88,completedProjects:112,successRate:99,responseTime:"< 4 hours",availability:"available",languages:["English","Russian","Estonian"],bio:"I help product managers in iGaming level up their skills through 1:1 coaching, workshops, and hands-on project support.",highlights:["Coached 100+ PMs across 20 companies","Former VP Product at Playtech","Built products serving 5M+ users"],certifications:["SVPG Certified","Pragmatic Marketing"],portfolio:[],isVerified:!0,isTopRated:!0,isFeatured:!1,isRisingTalent:!1,joinedDate:"2020-11-05",lastActive:"2024-01-21",isSaved:!1},{id:"7",name:"Thomas Müller",slug:"thomas-muller",avatar:"/placeholder.svg",title:"Payment Solutions Freelancer",tagline:"Integrating payment systems and optimizing transaction flows for gaming",type:"freelancer",specializations:["Payments","Integration","Fintech"],skills:["Payment Gateways","Crypto Payments","API Integration","PCI DSS","Fraud Prevention"],experienceLevel:"Intermediate",yearsOfExperience:6,location:{country:"Germany",city:"Berlin",timezone:"CET"},hourlyRate:{min:80,max:120,currency:"EUR"},rating:4.6,reviewCount:31,completedProjects:24,successRate:92,responseTime:"< 8 hours",availability:"limited",languages:["English","German"],bio:"Specialized in payment integrations for the iGaming industry. From traditional methods to crypto, I handle the full payment stack.",highlights:["Integrated 50+ payment providers","Reduced checkout abandonment by 25%","PCI DSS implementation experience"],certifications:["PCI DSS Professional","Stripe Certified"],portfolio:[],isVerified:!0,isTopRated:!1,isFeatured:!1,isRisingTalent:!0,joinedDate:"2023-05-12",lastActive:"2024-01-18",isSaved:!1},{id:"8",name:"Maria Santos",slug:"maria-santos",avatar:"/placeholder.svg",title:"LatAm Market Entry Mentor",tagline:"Your guide to launching and scaling in Latin American markets",type:"mentor",specializations:["Market Entry","LatAm","Business Development"],skills:["Brazil Regulations","Colombia Licensing","Local Partnerships","Cultural Adaptation"],experienceLevel:"Expert",yearsOfExperience:11,location:{country:"Brazil",city:"São Paulo",timezone:"BRT"},hourlyRate:{min:100,max:150,currency:"USD"},sessionRate:{duration:"60 min",price:125,currency:"USD"},rating:4.8,reviewCount:45,completedProjects:33,successRate:94,responseTime:"< 6 hours",availability:"available",languages:["English","Portuguese","Spanish"],bio:"Helping international operators successfully enter and expand in Latin American markets. Deep expertise in Brazil, Colombia, and Argentina.",highlights:["Guided 8 operators into LatAm","Former GM at major LatAm operator","Network across 5 LatAm jurisdictions"],certifications:[],portfolio:[],isVerified:!0,isTopRated:!1,isFeatured:!0,isRisingTalent:!1,joinedDate:"2021-09-28",lastActive:"2024-01-20",isSaved:!1},{id:"9",name:"Alex Thompson",slug:"alex-thompson",avatar:"/placeholder.svg",title:"Data Analytics Freelancer",tagline:"Turning player data into actionable insights and predictive models",type:"freelancer",specializations:["Data Analytics","BI","Player Insights"],skills:["Python","SQL","Tableau","Power BI","Machine Learning","Player Segmentation"],experienceLevel:"Intermediate",yearsOfExperience:4,location:{country:"Ireland",city:"Dublin",timezone:"GMT"},hourlyRate:{min:70,max:100,currency:"EUR"},rating:4.5,reviewCount:22,completedProjects:18,successRate:89,responseTime:"< 12 hours",availability:"available",languages:["English"],bio:"Data analyst specializing in player behavior analysis, churn prediction, and building dashboards that drive decisions.",highlights:["Built ML models predicting VIP potential","Created real-time dashboards for 3 operators","Reduced churn by 18% through insights"],certifications:["Google Data Analytics","Tableau Desktop Specialist"],portfolio:[],isVerified:!0,isTopRated:!1,isFeatured:!1,isRisingTalent:!0,joinedDate:"2023-08-01",lastActive:"2024-01-21",isSaved:!1},{id:"10",name:"Yuki Tanaka",slug:"yuki-tanaka",avatar:"/placeholder.svg",title:"Asian Markets Consultant",tagline:"Expert in Japan, Philippines, and emerging Asian gaming markets",type:"consultant",specializations:["Asian Markets","Licensing","Localization"],skills:["Japan Regulations","PAGCOR","Market Research","Cultural Localization"],experienceLevel:"Expert",yearsOfExperience:14,location:{country:"Japan",city:"Tokyo",timezone:"JST"},hourlyRate:{min:180,max:280,currency:"USD"},rating:4.9,reviewCount:38,completedProjects:29,successRate:97,responseTime:"< 8 hours",availability:"limited",languages:["English","Japanese","Mandarin"],bio:"Bridging Western operators with Asian opportunities. Deep regulatory knowledge and local networks across key Asian jurisdictions.",highlights:["Advised on 5 PAGCOR licenses","Former regulatory affairs at major Japanese gaming firm","Connected 20+ Western operators to Asian partners"],certifications:[],portfolio:[],isVerified:!0,isTopRated:!0,isFeatured:!1,isRisingTalent:!1,joinedDate:"2020-04-15",lastActive:"2024-01-19",isSaved:!1}],WB=[...new Set(Mn.flatMap(t=>t.specializations))].sort();[...new Set(Mn.flatMap(t=>t.skills))].sort();const ZB=[...new Set(Mn.map(t=>t.location.country))].sort(),YB=[...new Set(Mn.flatMap(t=>t.languages))].sort(),JB=[{value:"relevance",label:"Most relevant"},{value:"rating",label:"Highest rated"},{value:"reviews",label:"Most reviews"},{value:"rate-asc",label:"Rate: low to high"},{value:"rate-desc",label:"Rate: high to low"},{value:"newest",label:"Newest members"}],KB=({apiUrl:t,itemsPerPage:a=9,enableMobileFilter:s=!0,initialFreelancers:n})=>{const[r,i]=p.useState(n??[]),[l,c]=p.useState(!n),[h,d]=p.useState(1),[u,y]=p.useState(a),[x,m]=p.useState(""),[g,f]=p.useState("relevance"),[k,v]=p.useState("grid"),[N,M]=p.useState({type:[],specialization:[],experience:[],location:[],language:[],availability:[],signals:[]});p.useEffect(()=>{if(n)return;let A=!0;const R=async()=>{try{if(!t){A&&i(Mn);return}const D=await fetch(t);if(!D.ok)throw new Error(`Failed loading freelancers: ${D.status}`);const q=await D.json();A&&Array.isArray(q)&&i(q)}catch(D){console.error("Failed to fetch freelancers list",D),A&&i(Mn)}finally{A&&c(!1)}};return c(!0),R(),()=>{A=!1}},[t,n]);const b=p.useMemo(()=>{const A=Array.from(new Set(r.map(G=>G.type))).sort(),R=Array.from(new Set(r.flatMap(G=>G.specializations||[]).filter(Boolean))).sort((G,Z)=>G.localeCompare(Z)),D=Array.from(new Set(r.map(G=>G.experienceLevel).filter(Boolean))).sort((G,Z)=>G.localeCompare(Z)),q=Array.from(new Set(r.map(G=>G.location.country).filter(Boolean))).sort((G,Z)=>G.localeCompare(Z)),E=Array.from(new Set(r.flatMap(G=>G.languages||[]).filter(Boolean))).sort((G,Z)=>G.localeCompare(Z)),F=Array.from(new Set(r.map(G=>G.availability).filter(Boolean))).sort();return[{key:"type",label:"Type",type:"checkbox",options:A.map(G=>({value:G,label:G}))},{key:"specialization",label:"Specialization",type:"checkbox",searchable:!0,options:R.map(G=>({value:G,label:G}))},{key:"experience",label:"Experience",type:"checkbox",options:D.map(G=>({value:G,label:G}))},{key:"location",label:"Location",type:"searchable-select",searchable:!0,options:q.map(G=>({value:G,label:G}))},{key:"language",label:"Language",type:"searchable-select",searchable:!0,options:E.map(G=>({value:G,label:G}))},{key:"availability",label:"Availability",type:"checkbox",options:F.map(G=>({value:G,label:G}))},{key:"signals",label:"Preferences",type:"toggle",options:[{value:"verified",label:"Verified only"},{value:"top-rated",label:"Top rated only"}]}]},[r]),C=p.useMemo(()=>Object.entries(N).flatMap(([A,R])=>R.map(D=>({key:A,label:A.charAt(0).toUpperCase()+A.slice(1),value:D,onRemove:()=>{M(q=>({...q,[A]:q[A].filter(E=>E!==D)}))}}))),[N]),S=p.useMemo(()=>{const A=x.trim().toLowerCase();return r.filter(R=>!(A&&!`${R.name} ${R.title} ${R.tagline} ${R.skills.join(" ")}`.toLowerCase().includes(A)||N.type.length>0&&!N.type.includes(R.type)||N.specialization.length>0&&!N.specialization.some(D=>R.specializations.includes(D))||N.experience.length>0&&!N.experience.includes(R.experienceLevel)||N.location.length>0&&!N.location.includes(R.location.country)||N.language.length>0&&!N.language.some(D=>R.languages.includes(D))||N.availability.length>0&&!N.availability.includes(R.availability)||N.signals.includes("verified")&&!R.isVerified||N.signals.includes("top-rated")&&!R.isTopRated))},[N,r,x]),L=p.useMemo(()=>{const A=[...S];return A.sort((R,D)=>{switch(g){case"rating":return D.rating-R.rating;case"reviews":return D.reviewCount-R.reviewCount;case"rate-asc":return R.hourlyRate.min-D.hourlyRate.min;case"rate-desc":return D.hourlyRate.max-R.hourlyRate.max;case"newest":return new Date(D.joinedDate).getTime()-new Date(R.joinedDate).getTime();case"relevance":default:return Number(D.isFeatured)-Number(R.isFeatured)||D.rating-R.rating}}),A},[S,g]);p.useEffect(()=>{d(1)},[x,N,u]);const w=Math.max(1,Math.ceil(L.length/u)),j=L.slice((h-1)*u,h*u),I=(A,R)=>{i(D=>D.map(q=>q.id===A?{...q,isSaved:R}:q))},T=(A,R)=>{i(D=>D.map(q=>q.id===A?{...q,isFollowing:R}:q))};return e.jsx(Za,{title:"Freelancers",description:"Connect with vetted iGaming freelancers, mentors, and consultants.",search:{value:x,onChange:m,onSubmit:m,onClear:()=>m(""),placeholder:"Search freelancers"},filters:b,filterValues:N,onFilterChange:(A,R)=>M(D=>({...D,[A]:R})),onClearFilters:()=>M({type:[],specialization:[],experience:[],location:[],language:[],availability:[],signals:[]}),activeFilters:C,sort:{value:g,options:JB,onChange:f},viewMode:k,onViewModeChange:v,pagination:{page:h,pageSize:u,totalPages:w,totalCount:L.length,toolbarTotalCount:r.length,toolbarTitle:"Available Talent",toolbarItemLabel:"freelancers",onPageChange:d,onPageSizeChange:A=>{y(A),d(1)}},resultsClassName:k==="grid"?"grid gap-4 sm:grid-cols-2 xl:grid-cols-3":"grid gap-4",children:l?e.jsx(Wa,{totalColumns:u}):j.length?j.map((A,R)=>e.jsx(mA,{freelancer:A,viewMode:k,isSaved:A.isSaved,isFollowing:A.isFollowing,onToggleFollow:T,onToggleSave:I,onViewProfile:()=>{},onContact:()=>{},positionInList:R+1},A.id)):e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(qe,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No freelancers found"}),e.jsx("p",{className:"mb-4 text-muted-foreground",children:"Try adjusting your filters."}),e.jsx(P,{variant:"outline",onClick:()=>M({type:[],specialization:[],experience:[],location:[],language:[],availability:[],signals:[]}),children:"Clear all filters"})]})})},XB=[{value:"freelancer",label:"Freelancer"},{value:"coach",label:"Coach"},{value:"mentor",label:"Mentor"},{value:"consultant",label:"Consultant"},{value:"streamer",label:"Streamer"},{value:"influencer",label:"Influencer"}],QB=[{value:"Entry",label:"Entry Level"},{value:"Intermediate",label:"Intermediate"},{value:"Expert",label:"Expert"},{value:"Top Rated",label:"Top Rated"}],eH=[{value:"available",label:"Available Now"},{value:"limited",label:"Limited Availability"}],K9={search:"",tags:[],sortBy:"relevance",types:[],specializations:[],experienceLevel:[],locations:[],languages:[],priceRange:null,availability:[],verifiedOnly:!1,topRatedOnly:!1},tH=()=>{const[t,a]=p.useState(Mn),[s,n]=p.useState(K9),[r,i]=p.useState(1),[l,c]=p.useState(10),[h,d]=p.useState("grid"),u=p.useMemo(()=>({types:XB.map(S=>({...S,count:t.filter(L=>L.type===S.value).length})),specializations:WB.map(S=>({value:S,label:S,count:t.filter(L=>L.specializations.includes(S)).length})),experienceLevels:QB.map(S=>({...S,count:t.filter(L=>L.experienceLevel===S.value).length})),locations:ZB.map(S=>({value:S,label:S,count:t.filter(L=>L.location.country===S).length})),languages:YB.map(S=>({value:S,label:S,count:t.filter(L=>L.languages.includes(S)).length})),availability:eH.map(S=>({...S,count:t.filter(L=>L.availability===S.value).length}))}),[t]),y=p.useMemo(()=>{let S=[...t];if(s.search){const L=s.search.toLowerCase();S=S.filter(w=>w.name.toLowerCase().includes(L)||w.title.toLowerCase().includes(L)||w.tagline.toLowerCase().includes(L)||w.skills.some(j=>j.toLowerCase().includes(L))||w.specializations.some(j=>j.toLowerCase().includes(L)))}if(s.types.length>0&&(S=S.filter(L=>s.types.includes(L.type))),s.specializations.length>0&&(S=S.filter(L=>L.specializations.some(w=>s.specializations.includes(w)))),s.experienceLevel.length>0&&(S=S.filter(L=>s.experienceLevel.includes(L.experienceLevel))),s.locations.length>0&&(S=S.filter(L=>s.locations.includes(L.location.country))),s.languages.length>0&&(S=S.filter(L=>L.languages.some(w=>s.languages.includes(w)))),s.availability.length>0&&(S=S.filter(L=>s.availability.includes(L.availability))),s.verifiedOnly&&(S=S.filter(L=>L.isVerified)),s.topRatedOnly&&(S=S.filter(L=>L.isTopRated)),(s.tags??[]).length>0){const L=s.tags??[];S=S.filter(w=>L.some(j=>w.specializations.some(I=>I.toLowerCase().includes(j))||w.skills.some(I=>I.toLowerCase().includes(j))||w.title.toLowerCase().includes(j)))}switch(s.sortBy){case"rating":S.sort((L,w)=>w.rating-L.rating);break;case"reviews":S.sort((L,w)=>w.reviewCount-L.reviewCount);break;case"rate_asc":S.sort((L,w)=>L.hourlyRate.min-w.hourlyRate.min);break;case"rate_desc":S.sort((L,w)=>w.hourlyRate.max-L.hourlyRate.max);break;case"newest":S.sort((L,w)=>new Date(w.joinedDate).getTime()-new Date(L.joinedDate).getTime());break;default:S.sort((L,w)=>L.isFeatured!==w.isFeatured?L.isFeatured?-1:1:L.isTopRated!==w.isTopRated?L.isTopRated?-1:1:w.rating-L.rating)}return S},[s,t]),x=y.length,m=Math.ceil(x/l),g=y.slice((r-1)*l,r*l),f=S=>{n(S),i(1)},k=()=>{n(K9),i(1)},v=S=>{i(S)},N=S=>{c(S),i(1)},M=S=>{d(S)},b=(S,L)=>{a(w=>w.map(j=>j.id===S?{...j,isSaved:L}:j))},C=(S,L)=>{a(w=>w.map(j=>j.id===S?{...j,isFollowing:L}:j))};return e.jsx(pA,{freelancers:g,filterOptions:u,loading:!1,page:r,pageSize:l,totalCount:x,totalPages:m,onPageChange:v,onPageSizeChange:N,filters:s,onFiltersChange:f,onClearFilters:k,viewMode:h,onViewModeChange:M,onToggleSave:b,onToggleFollow:C})},aH=()=>{const[t,a]=p.useState(Mn[0]??null),s=(r,i)=>{a(l=>l&&l.id===r?{...l,isSaved:i}:l)},n=(r,i)=>{a(l=>l&&l.id===r?{...l,isFollowing:i}:l)};return e.jsx(uA,{freelancer:t,onToggleSave:s,onToggleFollow:n,onContact:r=>console.log("Contact freelancer:",r)})},sH=({suggestions:t,selectedId:a,onSelect:s,onApprove:n,onReject:r,emptyState:i="No suggestions match the current filters.",title:l="Taxonomy suggestions"})=>e.jsxs(U,{children:[e.jsx(ne,{children:e.jsx(re,{children:l})}),e.jsx(W,{children:t.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:i}):e.jsx("div",{className:"space-y-3",children:t.map(c=>e.jsx("div",{className:`rounded-lg border p-4 transition hover:bg-muted/50 ${a===c.id?"border-primary bg-muted/40":"bg-background"}`,children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("button",{type:"button",onClick:()=>s==null?void 0:s(c),className:"flex-1 text-left",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:c.term}),c.status&&e.jsx(O,{variant:c.status==="approved"?"default":c.status==="rejected"?"destructive":"secondary",children:c.status})]}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Namespace: ",c.namespace||"Unassigned",e.jsx(xn,{orientation:"vertical",className:"mx-2 inline-flex h-4 align-middle"}),"Canonical: ",c.canonical||"Pending"]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[c.scopes.map(h=>e.jsx(O,{variant:"outline",children:h},h)),typeof c.count=="number"&&e.jsxs(O,{variant:"secondary",children:[c.count," occurrences"]})]})]}),(n||r)&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&e.jsx(P,{type:"button",variant:"outline",onClick:()=>r(c),children:"Reject"}),n&&e.jsx(P,{type:"button",onClick:()=>n(c),children:"Approve"})]})]})},c.id))})})]}),yA=({title:t="Examples",examples:a=[],emptyState:s="No examples were provided for this suggestion."})=>e.jsxs(U,{children:[e.jsx(ne,{children:e.jsx(re,{children:t})}),e.jsx(W,{children:a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:s}):e.jsx(QL,{className:"h-56 pr-4",children:e.jsx("ul",{className:"space-y-3",children:a.map((n,r)=>e.jsx("li",{className:"rounded-lg border bg-muted/40 p-3 text-sm",children:n},`${n}-${r}`))})})})]}),nH=({suggestion:t,title:a="Suggestion detail",description:s="Review the suggestion before approving or rejecting.",emptyState:n="Select a suggestion to view more information.",approveForm:r})=>t?e.jsxs("div",{className:"space-y-6",children:[e.jsxs(U,{children:[e.jsxs(ne,{children:[e.jsx(re,{children:a}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s})]}),e.jsxs(W,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:t.term}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.status&&e.jsx(O,{variant:t.status==="approved"?"default":t.status==="rejected"?"destructive":"secondary",children:t.status}),t.count!==void 0&&e.jsxs(O,{variant:"secondary",children:[t.count," occurrences"]}),t.source&&e.jsx(O,{variant:"outline",children:t.source})]})]}),e.jsx(xn,{}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Namespace"}),e.jsx("p",{className:"text-base text-foreground",children:t.namespace||"Unassigned"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Canonical term"}),e.jsx("p",{className:"text-base text-foreground",children:t.canonical||"Pending"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Scopes"}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:t.scopes.length===0?e.jsx("span",{className:"text-sm text-muted-foreground",children:"No scopes assigned"}):t.scopes.map(i=>e.jsx(O,{variant:"outline",children:i},i))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Last updated"}),e.jsx("p",{className:"text-base text-foreground",children:t.updatedAt||"Not available"})]})]})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,360px)]",children:[e.jsx(yA,{examples:t.examples}),r&&e.jsx("div",{children:r})]})]}):e.jsxs(U,{children:[e.jsx(ne,{children:e.jsx(re,{children:a})}),e.jsx(W,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:n})})]}),rH=({namespaceOptions:t,scopeOptions:a,defaultNamespace:s="",defaultCanonical:n="",defaultScopes:r=[],isSubmitting:i=!1,onApprove:l,onReject:c,approveLabel:h="Approve",rejectLabel:d="Reject"})=>{const[u,y]=p.useState(s),[x,m]=p.useState(n),[g,f]=p.useState(r);p.useEffect(()=>{y(s)},[s]),p.useEffect(()=>{m(n)},[n]),p.useEffect(()=>{f(r)},[r]);const k=p.useMemo(()=>[...a].sort(),[a]),v=M=>{f(b=>b.includes(M)?b.filter(C=>C!==M):[...b,M])},N=()=>{l({namespace:u.trim(),canonical:x.trim(),scopes:g})};return e.jsxs(U,{children:[e.jsx(ne,{children:e.jsx(re,{children:"Approval details"})}),e.jsxs(W,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"taxonomy-namespace",children:"Namespace"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(M=>e.jsx(P,{type:"button",variant:u===M?"default":"outline",size:"sm",onClick:()=>y(M),children:M},M))}),e.jsx(ae,{id:"taxonomy-namespace",value:u,onChange:M=>y(M.target.value),placeholder:"Enter namespace"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"taxonomy-canonical",children:"Canonical term"}),e.jsx(ae,{id:"taxonomy-canonical",value:x,onChange:M=>m(M.target.value),placeholder:"Normalized taxonomy value"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Scopes"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:k.map(M=>e.jsxs("label",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[e.jsx(Xt,{checked:g.includes(M),onCheckedChange:()=>v(M)}),e.jsx("span",{children:M})]},M))}),g.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:g.map(M=>e.jsx(O,{variant:"secondary",children:M},M))})]})]}),e.jsxs(gn,{className:"flex flex-col gap-3 sm:flex-row sm:justify-end",children:[e.jsx(P,{type:"button",variant:"outline",onClick:c,disabled:i,children:d}),e.jsx(P,{type:"button",onClick:N,disabled:i,children:h})]})]})},xA=ie.forwardRef(({className:t,...a},s)=>e.jsx(xa.Command,{ref:s,className:oe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...a}));xA.displayName=xa.Command.displayName;const gA=ie.forwardRef(({className:t,...a},s)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(wt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(xa.Command.Input,{ref:s,className:oe("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...a})]}));gA.displayName=xa.Command.Input.displayName;const fA=ie.forwardRef(({className:t,...a},s)=>e.jsx(xa.Command.List,{ref:s,className:oe("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...a}));fA.displayName=xa.Command.List.displayName;const kA=ie.forwardRef((t,a)=>e.jsx(xa.Command.Empty,{ref:a,className:"py-6 text-center text-sm",...t}));kA.displayName=xa.Command.Empty.displayName;const vA=ie.forwardRef(({className:t,...a},s)=>e.jsx(xa.Command.Group,{ref:s,className:oe("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...a}));vA.displayName=xa.Command.Group.displayName;const iH=ie.forwardRef(({className:t,...a},s)=>e.jsx(xa.Command.Separator,{ref:s,className:oe("-mx-1 h-px bg-border",t),...a}));iH.displayName=xa.Command.Separator.displayName;const bA=ie.forwardRef(({className:t,...a},s)=>e.jsx(xa.Command.Item,{ref:s,className:oe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...a}));bA.displayName=xa.Command.Item.displayName;const oH=(t,a)=>{var s;if(a===1){let n=0;return t.associationType&&(n+=20),t.associationType==="create"?(t.companyName&&(n+=20),t.companyType&&(n+=15),t.verticals&&t.verticals.length>0&&(n+=10),(s=t.headquarters)!=null&&s.country&&(n+=10)):t.associationType==="join"?t.companyId&&(n+=55):t.associationType==="suggest"&&t.companyName&&(n+=55),Math.min(50,n)}else{let n=50;return t.jobTitle&&(n+=25),t.department&&(n+=25),Math.min(100,n)}};function lH({open:t,onOpenChange:a,userRole:s,onComplete:n,onSaveDraft:r,onSuggestCompany:i,companies:l=[]}){var fe,de,se;const[c,h]=p.useState(1),[d,u]=p.useState({associationType:G9[s],verticals:[],headquarters:{city:"",country:""},jobTitle:"",department:""}),[y,x]=p.useState(""),[m,g]=p.useState(!1),[f,k]=p.useState(""),[v,N]=p.useState(!1),[M,b]=p.useState(null),[C,S]=p.useState(!1),L=oH(d,c),w=p.useMemo(()=>rB[s],[s]),j=d.associationType&&w.includes(d.associationType)?d.associationType:G9[s],I=p.useMemo(()=>{if(!f.trim())return l;const H=f.toLowerCase();return l.filter(z=>z.name.toLowerCase().includes(H)||z.slug.toLowerCase().includes(H))},[l,f]),T=p.useMemo(()=>{if(d.companyId)return l.find(H=>String(H.id)===d.companyId)},[l,d.companyId]),A=d.associationType==="create"?d.companyName&&d.companyType&&(((fe=d.verticals)==null?void 0:fe.length)??0)>=1:(d.associationType==="join"||d.associationType==="suggest"&&d.companyName&&d.companyWebsite)&&d.companyId,R=d.jobTitle&&d.department,D=v||j==="suggest",q=()=>({companyId:void 0,companyName:void 0,companyWebsite:void 0,companyLinkedinUrl:void 0}),E=H=>{w.includes(H)&&(u(z=>({...z,associationType:H,...q()})),N(!1),b(null))},F=p.useCallback(H=>{u(z=>{const _=z.verticals||[],V=_.includes(H);return{...z,verticals:V?_.filter(J=>J!==H):[..._,H]}})},[]),G=p.useCallback(()=>{y.trim()&&(u(H=>({...H,verticals:[...H.verticals||[],y.trim()]})),x(""))},[y]),Z=H=>{u(z=>({...z,associationType:"join",companyId:String(H.id),companyName:H.name,companyWebsite:void 0,companyLinkedinUrl:void 0})),N(!1),b(null),g(!1),k("")},$=H=>{if(!H)return!0;try{const z=new URL(H);return["http:","https:"].includes(z.protocol)}catch{return!1}},Q=async H=>{const z=new URL(H),_=`https://r.jina.ai/http://${z.host}${z.pathname}${z.search}`;return(await fetch(_,{method:"GET"})).status===200},te=async()=>{var V,J,pe;const H=(V=d.companyName)==null?void 0:V.trim(),z=(J=d.companyWebsite)==null?void 0:J.trim(),_=(pe=d.companyLinkedinUrl)==null?void 0:pe.trim();if(!H){b("Company name is required.");return}if(!z){b("Official website is required.");return}if(!$(z)){b("Please enter a valid website URL.");return}if(_&&!$(_)){b("Please enter a valid LinkedIn URL.");return}if(b(null),!w.includes("suggest")){b("Unable to submit your company suggestion right now. Please try again.");return}S(!0);try{if(!await Q(z)){b("Official website verification failed. The URL must return HTTP 200.");return}}catch{b("Unable to verify the official website right now. Please try again.");return}finally{S(!1)}i==null||i({companyName:H,companyWebsite:z,officialPage:z,companyLinkedinUrl:_||void 0}),u(ke=>({...ke,associationType:"suggest",companyId:ke.companyId||`draft-${Date.now()}`,companyName:H,companyWebsite:z,companyLinkedinUrl:_||void 0})),h(2)},K=()=>{const H=new Date().toISOString(),z={associationType:j,companyId:d.companyId,companyName:d.companyName,companyType:d.companyType,companyWebsite:d.companyWebsite,companyLinkedinUrl:d.companyLinkedinUrl,verticals:d.verticals||[],headquarters:d.headquarters,jobTitle:d.jobTitle||"",department:d.department||"",teamSize:d.teamSize,isComplete:!0,isDraft:!1,createdAt:H,updatedAt:H};n(z),a(!1)},ee=()=>{const H=new Date().toISOString();r({...d,isDraft:!0,isComplete:!1,updatedAt:H}),a(!1)},ce=()=>{switch(s){case"COMPANY_OWNER":return"Business Owner";case"COMPANY_RECRUITER":return"Recruiter";case"COMPANY_EMPLOYEE":return"Employee"}};return e.jsx(st,{open:t,onOpenChange:a,children:e.jsx(Xe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",onInteractOutside:H=>H.preventDefault(),onEscapeKeyDown:H=>H.preventDefault(),children:c===1?e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(Se,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(Le,{children:"Company Association"}),e.jsx(it,{children:"Step 1 of 2"})]})]}),e.jsx(ya,{value:L,className:"h-2"})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs(B,{className:"text-sm font-medium",children:["How do you want to connect?"," ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(D7,{value:j,onValueChange:H=>E(H),className:"space-y-3",children:[w.includes("create")&&e.jsxs("div",{className:`flex items-start space-x-3 p-4 rounded-lg border-2 cursor-pointer transition-colors ${j==="create"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>E("create"),children:[e.jsx(Is,{value:"create",id:"create",className:"mt-1"}),e.jsxs("div",{children:[e.jsx(B,{htmlFor:"create",className:"font-medium cursor-pointer",children:"I'm creating a new company"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set up your company profile from scratch"})]})]}),w.includes("join")&&e.jsxs("div",{className:`flex items-start space-x-3 p-4 rounded-lg border-2 cursor-pointer transition-colors ${j==="join"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>E("join"),children:[e.jsx(Is,{value:"join",id:"join",className:"mt-1"}),e.jsxs("div",{children:[e.jsx(B,{htmlFor:"join",className:"font-medium cursor-pointer",children:"I'm joining an existing company"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect to your employer's profile"})]})]}),w.includes("suggest")&&e.jsxs("div",{className:`flex items-start space-x-3 p-4 rounded-lg border-2 cursor-pointer transition-colors ${j==="suggest"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>E("suggest"),children:[e.jsx(Is,{value:"suggest",id:"suggest",className:"mt-1"}),e.jsxs("div",{children:[e.jsx(B,{htmlFor:"suggest",className:"font-medium cursor-pointer",children:"My company isn't listed"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Suggest your company for review"})]})]})]})]}),j==="create"&&e.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-top-2 duration-200",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{htmlFor:"companyName",children:["Company Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ae,{id:"companyName",placeholder:"e.g. Betsson Group",value:d.companyName||"",onChange:H=>u(z=>({...z,companyName:H.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Company Type ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Ye,{value:d.companyType||"",onValueChange:H=>u(z=>({...z,companyType:H})),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select type..."})}),e.jsx(Ge,{children:cE.map(H=>e.jsx(me,{value:H,children:H},H))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Verticals ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:hE.map(H=>{var z,_;return e.jsxs(O,{variant:(z=d.verticals)!=null&&z.includes(H)?"default":"outline",className:"cursor-pointer",onClick:()=>F(H),children:[H,((_=d.verticals)==null?void 0:_.includes(H))&&e.jsx(Ve,{className:"ml-1 h-3 w-3"})]},H)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{placeholder:"+ Custom vertical",value:y,onChange:H=>x(H.target.value),onKeyDown:H=>H.key==="Enter"&&G(),className:"flex-1"}),e.jsx(P,{variant:"outline",size:"icon",onClick:G,children:e.jsx(St,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Headquarters"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(ae,{placeholder:"City",value:((de=d.headquarters)==null?void 0:de.city)||"",onChange:H=>u(z=>{var _;return{...z,headquarters:{...z.headquarters,city:H.target.value,country:((_=z.headquarters)==null?void 0:_.country)||""}}})}),e.jsxs(Ye,{value:((se=d.headquarters)==null?void 0:se.country)||"",onValueChange:H=>u(z=>{var _;return{...z,headquarters:{...z.headquarters,city:((_=z.headquarters)==null?void 0:_.city)||"",country:H}}}),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Country"})}),e.jsx(Ge,{children:KI.map(H=>e.jsx(me,{value:H,children:H},H))})]})]})]})]}),(j==="join"||j==="suggest"||D)&&e.jsx("div",{className:"space-y-4 animate-in fade-in slide-in-from-top-2 duration-200",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:[j==="suggest"?"Suggest your company":"Select your company"," ",j==="join"&&e.jsx("span",{className:"text-destructive",children:"*"})]}),l.length===0?e.jsxs("div",{className:"p-4 rounded-lg border border-dashed bg-muted/50 text-center",children:[e.jsx(Se,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No companies available to join yet."}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"If you can't find your company, suggest it for review."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(IC,{open:m,onOpenChange:g,children:[e.jsx(AC,{asChild:!0,children:e.jsxs(P,{variant:"outline",role:"combobox","aria-expanded":m,className:"w-full justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{className:"h-4 w-4 text-muted-foreground"}),T?e.jsx("span",{children:T.name}):e.jsx("span",{className:"text-muted-foreground",children:"Search for your company..."})]}),e.jsx(lc,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(U7,{className:"w-[400px] p-0",align:"start",children:e.jsxs(xA,{children:[e.jsx(gA,{placeholder:"Type to search companies...",value:f,onValueChange:k}),e.jsxs(fA,{children:[e.jsx(kA,{children:e.jsx("div",{className:"py-4 text-center",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:['No companies found matching "',f,'"']})})}),e.jsx(vA,{heading:"Companies",children:I.map(H=>e.jsxs(bA,{value:H.name,onSelect:()=>Z(H),className:"cursor-pointer",children:[e.jsx(ln,{className:oe("mr-2 h-4 w-4",d.companyId===H.id?"opacity-100":"opacity-0")}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:H.name}),e.jsx("span",{className:"text-xs text-muted-foreground",children:H.slug})]})]},H.id))})]})]})})]}),T&&e.jsxs("div",{className:"p-3 rounded-lg bg-primary/5 border border-primary/20 flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(Se,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-sm",children:T.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Selected company"})]}),e.jsx(P,{variant:"ghost",size:"sm",onClick:()=>u(H=>({...H,companyId:void 0,companyName:void 0})),children:e.jsx(Ve,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your request to join will need approval from a company admin."}),!D&&w.includes("suggest")?e.jsx(e.Fragment,{}):e.jsxs("div",{className:"rounded-lg border p-4 space-y-3 bg-muted/30",children:[e.jsx(P,{type:"button",variant:"ghost",className:"h-auto p-0 text-sm",onClick:()=>{N(!1),b(null),u(H=>({...H,associationType:"join",companyName:void 0,companyWebsite:void 0,companyLinkedinUrl:void 0,companyId:void 0}))},children:"← Back to company search"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{htmlFor:"suggestCompanyName",children:["Name ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ae,{id:"suggestCompanyName",placeholder:"e.g. Acme Gaming",value:d.companyName||"",onChange:H=>u(z=>({...z,companyName:H.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{htmlFor:"suggestCompanyWebsite",children:["Official website ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ae,{id:"suggestCompanyWebsite",placeholder:"https://example.com",value:d.companyWebsite||"",onChange:H=>u(z=>({...z,companyWebsite:H.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{htmlFor:"suggestCompanyLinkedin",children:"LinkedIn (optional)"}),e.jsx(ae,{id:"suggestCompanyLinkedin",placeholder:"https://linkedin.com/company/example",value:d.companyLinkedinUrl||"",onChange:H=>u(z=>({...z,companyLinkedinUrl:H.target.value}))})]}),M&&e.jsx("p",{className:"text-sm text-destructive",children:M}),e.jsx(P,{type:"button",onClick:te,disabled:C,children:C?"Verifying website...":"Suggest company"})]})]})]})})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(P,{onClick:()=>h(2),disabled:!A,children:["Continue",e.jsx(Ia,{className:"ml-2 h-4 w-4"})]})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Oe,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(Se,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(Le,{children:"Your Role Details"}),e.jsxs(it,{children:["Step 2 of 2 • ",ce()]})]})]}),e.jsx(ya,{value:L,className:"h-2"})]}),e.jsxs("div",{className:"space-y-5 py-4",children:[d.companyName&&e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50 border",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:d.associationType==="create"?"Creating":d.associationType==="suggest"?"Suggested (draft)":"Joining"}),e.jsx("p",{className:"font-medium",children:d.companyName}),d.associationType==="suggest"&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Draft company suggestion submitted. Your onboarding will remain pending review."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{htmlFor:"jobTitle",children:["Your Job Title ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(ae,{id:"jobTitle",placeholder:"e.g. Head of Talent Acquisition",value:d.jobTitle||"",onChange:H=>u(z=>({...z,jobTitle:H.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(B,{children:["Department ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsxs(Ye,{value:d.department||"",onValueChange:H=>u(z=>({...z,department:H})),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select department..."})}),e.jsx(Ge,{children:oB.map(H=>e.jsx(me,{value:H,children:H},H))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(B,{children:"Team Size (optional)"}),e.jsxs(Ye,{value:d.teamSize||"",onValueChange:H=>u(z=>({...z,teamSize:H})),children:[e.jsx(Ue,{children:e.jsx(Je,{placeholder:"Select team size..."})}),e.jsx(Ge,{children:lB.map(H=>e.jsx(me,{value:H,children:H},H))})]})]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs(P,{variant:"ghost",onClick:()=>h(1),children:[e.jsx(La,{className:"mr-2 h-4 w-4"}),"Back"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{variant:"outline",onClick:ee,children:"Save Draft"}),e.jsx(P,{onClick:K,disabled:!R,children:"Complete Setup"})]})]})]})})})}const wA=5e3,cH=220,ps={ADD:"ADD",UPDATE:"UPDATE",DISMISS:"DISMISS",REMOVE:"REMOVE",CLEAR:"CLEAR"},M7=[];let sl={notifications:[]},bN=0;const es=new Map,Ac=new Map,dH=()=>(bN=(bN+1)%Number.MAX_SAFE_INTEGER,bN.toString()),jA=t=>{if(t.persistent||t.duration===0||t.duration===1/0)return;const a=t.duration??wA;es.has(t.id)&&clearTimeout(es.get(t.id));const s=setTimeout(()=>{PC(t.id)},a);es.set(t.id,s)},X9=t=>{if(Ac.has(t))return;const a=setTimeout(()=>{Ac.delete(t),$c({type:ps.REMOVE,id:t})},cH);Ac.set(t,a)},hH=(t,a)=>{switch(a.type){case ps.ADD:return{notifications:[a.notification,...t.notifications]};case ps.UPDATE:return{notifications:t.notifications.map(s=>s.id===a.notification.id?{...s,...a.notification}:s)};case ps.DISMISS:return{notifications:t.notifications.map(s=>a.id===void 0||s.id===a.id?{...s,status:"leaving"}:s)};case ps.REMOVE:return a.id?{notifications:t.notifications.filter(s=>s.id!==a.id)}:{notifications:[]};case ps.CLEAR:return{notifications:[]};default:return t}},$c=t=>{sl=hH(sl,t),M7.forEach(a=>a(sl))},MA=t=>{const s={id:t.id??dH(),type:t.type??"info",title:t.title,message:t.message,content:t.content,duration:t.duration??wA,persistent:t.persistent??!1,actions:t.actions,icon:t.icon,className:t.className,titleClassName:t.titleClassName,messageClassName:t.messageClassName,role:t.role,ariaLabel:t.ariaLabel,onDismiss:t.onDismiss,status:"active",createdAt:Date.now()};return $c({type:ps.ADD,notification:s}),jA(s),s},NA=t=>{$c({type:ps.UPDATE,notification:t});const a=sl.notifications.find(s=>s.id===t.id);a&&jA({...a,...t})},PC=t=>{var a;if(t){const s=sl.notifications.find(n=>n.id===t);(a=s==null?void 0:s.onDismiss)==null||a.call(s,t),es.has(t)&&(clearTimeout(es.get(t)),es.delete(t)),X9(t)}else sl.notifications.forEach(s=>{var n;(n=s.onDismiss)==null||n.call(s,s.id),es.has(s.id)&&(clearTimeout(es.get(s.id)),es.delete(s.id)),X9(s.id)});$c({type:ps.DISMISS,id:t})},CA=()=>{es.forEach(t=>clearTimeout(t)),es.clear(),Ac.forEach(t=>clearTimeout(t)),Ac.clear(),$c({type:ps.CLEAR})},SA=()=>{const[t,a]=ie.useState(sl);return ie.useEffect(()=>(M7.push(a),()=>{const s=M7.indexOf(a);s>-1&&M7.splice(s,1)}),[]),{notifications:t.notifications,notify:MA,update:NA,dismiss:PC,clear:CA}},uH={success:{container:"border-emerald-200 bg-emerald-50 text-emerald-950",icon:"text-emerald-600",title:"text-emerald-950"},error:{container:"border-red-200 bg-red-50 text-red-950",icon:"text-red-600",title:"text-red-950"},warning:{container:"border-amber-200 bg-amber-50 text-amber-950",icon:"text-amber-600",title:"text-amber-950"},info:{container:"border-blue-200 bg-blue-50 text-blue-950",icon:"text-blue-600",title:"text-blue-950"},custom:{container:"border-border bg-background text-foreground",icon:"text-foreground",title:"text-foreground"}},mH={success:Ee,error:Na,warning:ea,info:gl,custom:gl},pH={primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"bg-transparent text-current hover:bg-black/5"},yH=({notification:t,onDismiss:a,actionClassName:s,closeButtonClassName:n,notificationClassName:r,titleClassName:i,messageClassName:l,variantClassNames:c,iconClassNames:h,renderIcon:d})=>{const u=uH[t.type],y=mH[t.type],x=t.role??(t.type==="error"?"alert":"status"),m=x==="alert"?"assertive":"polite";return e.jsx("div",{role:x,"aria-live":m,"aria-label":t.ariaLabel,className:oe("pointer-events-auto w-full max-w-sm rounded-lg border px-4 py-3 shadow-lg transition-all duration-200",t.status==="leaving"?"opacity-0 translate-y-2":"opacity-100 translate-y-0",u.container,c==null?void 0:c[t.type],r,t.className),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:t.icon??(d?d(t.type):e.jsx(y,{className:oe("h-5 w-5",u.icon,h==null?void 0:h[t.type])}))}),e.jsxs("div",{className:"flex-1",children:[t.content?t.content:e.jsxs(e.Fragment,{children:[t.title&&e.jsx("div",{className:oe("text-sm font-semibold",u.title,i,t.titleClassName),children:t.title}),t.message&&e.jsx("div",{className:oe("text-sm opacity-90",l,t.messageClassName),children:t.message})]}),t.actions&&t.actions.length>0&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.actions.map(g=>{const f=oe("inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium transition-colors",pH[g.variant??"secondary"],s),k=()=>{var v;(v=g.onClick)==null||v.call(g,t.id),g.autoDismiss!==!1&&a(t.id)};return g.href?e.jsx("a",{href:g.href,target:g.target,rel:g.target==="_blank"?"noreferrer":void 0,className:f,onClick:k,"aria-label":g.ariaLabel,children:g.label},g.label):e.jsx("button",{type:"button",className:f,onClick:k,"aria-label":g.ariaLabel,children:g.label},g.label)})})]}),e.jsxs("button",{type:"button",onClick:()=>a(t.id),className:oe("rounded-md p-1 text-current/60 transition hover:text-current focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",n),"aria-label":"Dismiss notification",children:[e.jsx("span",{className:"sr-only",children:"Dismiss"}),e.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",children:e.jsx("path",{d:"M6 6l12 12M18 6l-12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})]})]})})},xH={"top-left":"top-4 left-4 items-start","top-right":"top-4 right-4 items-end","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","bottom-left":"bottom-4 left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center",center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 items-center"},LA=({notifications:t,placement:a="top-right",containerClassName:s,containerStyle:n,stackClassName:r,notificationClassName:i,titleClassName:l,messageClassName:c,actionClassName:h,closeButtonClassName:d,variantClassNames:u,iconClassNames:y,renderIcon:x,onDismiss:m,maxVisible:g})=>{const f=g?t.slice(0,g):t;return f.length===0?null:e.jsx("div",{className:oe("pointer-events-none fixed z-[100] flex max-h-screen w-full flex-col gap-3 px-4",xH[a],s),style:n,children:e.jsx("div",{className:oe("flex w-full flex-col gap-3",r),children:f.map(k=>e.jsx(yH,{notification:k,onDismiss:m,notificationClassName:i,titleClassName:l,messageClassName:c,actionClassName:h,closeButtonClassName:d,variantClassNames:u,iconClassNames:y,renderIcon:x},k.id))})})},IA=ie.createContext(null),gH=({children:t,placement:a,containerClassName:s,containerStyle:n,stackClassName:r,notificationClassName:i,titleClassName:l,messageClassName:c,actionClassName:h,closeButtonClassName:d,variantClassNames:u,iconClassNames:y,renderIcon:x,maxVisible:m})=>{const g=SA();return e.jsxs(IA.Provider,{value:g,children:[t,e.jsx(LA,{notifications:g.notifications,placement:a,containerClassName:s,containerStyle:n,stackClassName:r,notificationClassName:i,titleClassName:l,messageClassName:c,actionClassName:h,closeButtonClassName:d,variantClassNames:u,iconClassNames:y,renderIcon:x,onDismiss:g.dismiss,maxVisible:m})]})},AA=()=>{const t=ie.useContext(IA),a=SA();return t||a},fH={"bottom-right":{button:"bottom-6 right-6",panel:"bottom-20 right-6"},"bottom-left":{button:"bottom-6 left-6",panel:"bottom-20 left-6"},"top-right":{button:"top-6 right-6",panel:"top-20 right-6"},"top-left":{button:"top-6 left-6",panel:"top-20 left-6"}},kH=[{label:"Profile updated",payload:{type:"success",title:"Profile updated",message:"Your changes were saved successfully."}},{label:"Login failed",payload:{type:"error",title:"Login failed",message:"We couldn't sign you in. Please try again.",actions:[{label:"Retry",variant:"primary",onClick:()=>{}}]}},{label:"Missing fields",payload:{type:"warning",title:"Missing fields",message:"Fill out the required fields before continuing."}},{label:"New message",payload:{type:"info",title:"New message",message:"You received a new message from Support."}},{label:"Backend error",payload:{type:"error",title:"Backend error",message:"We hit an issue on our side. Please report this error.",actions:[{label:"Report",variant:"secondary",onClick:()=>{}}]}}],vH=["success","error","warning","info"],bH=({position:t="bottom-right",buttonLabel:a="Test notifications",panelTitle:s="Notification tester",defaultType:n="success",defaultTitle:r="Notification title",defaultMessage:i="Notification message",allowCustomMessage:l=!0,allowCustomTitle:c=!0,allowActions:h=!0,allowDuration:d=!0,allowPersistent:u=!0,showAllTypes:y=!0,presetCases:x,onTrigger:m})=>{const{notify:g}=AA(),[f,k]=ie.useState(!1),[v,N]=ie.useState(n),[M,b]=ie.useState(r),[C,S]=ie.useState(i),[L,w]=ie.useState("5000"),[j,I]=ie.useState(!1),[T,A]=ie.useState(!1),[R,D]=ie.useState("View details"),q=x&&x.length>0?x:kH,E=y?vH:[n];ie.useEffect(()=>{N(n)},[n]),ie.useEffect(()=>{b(r)},[r]),ie.useEffect(()=>{S(i)},[i]),ie.useEffect(()=>{if(!f)return;const $=Q=>{Q.key==="Escape"&&k(!1)};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[f]);const F=$=>{g($),m==null||m($)},G=$=>{$.preventDefault();const Q=Number.parseInt(L,10),te=Number.isFinite(Q)&&Q>=0;F({type:v,title:c?M:r,message:l?C:i,duration:d&&!j&&te?Q:void 0,persistent:u?j:void 0,actions:h&&T&&R?[{label:R,variant:"primary",onClick:()=>{}}]:void 0})},Z=fH[t];return e.jsxs("div",{className:"fixed z-50",children:[e.jsx("button",{type:"button",className:oe("fixed inline-flex items-center justify-center rounded-full bg-primary px-4 py-3 text-sm font-semibold text-primary-foreground shadow-lg transition hover:bg-primary/90",Z.button),onClick:()=>k($=>!$),children:a}),f&&e.jsxs("div",{className:oe("fixed w-[320px] rounded-2xl border border-border bg-background p-4 shadow-2xl",Z.panel),children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-semibold text-foreground",children:s}),e.jsxs("button",{type:"button",className:"rounded-md p-1 text-muted-foreground transition hover:text-foreground",onClick:()=>k(!1),children:[e.jsx("span",{className:"sr-only",children:"Close"}),e.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",children:e.jsx("path",{d:"M6 6l12 12M18 6l-12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})]})]}),e.jsxs("form",{className:"space-y-3",onSubmit:G,children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",htmlFor:"notification-type",children:"Type"}),e.jsx("select",{id:"notification-type",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm",value:v,onChange:$=>N($.target.value),children:E.map($=>e.jsx("option",{value:$,children:$},$))})]}),c?e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",htmlFor:"notification-title",children:"Title"}),e.jsx("input",{id:"notification-title",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm",value:M,onChange:$=>b($.target.value)})]}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Title: ",r]}),l?e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",htmlFor:"notification-message",children:"Message"}),e.jsx("textarea",{id:"notification-message",className:"w-full resize-none rounded-md border border-border bg-background px-3 py-2 text-sm",rows:3,value:C,onChange:$=>S($.target.value)})]}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Message: ",i]}),d&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground",htmlFor:"notification-duration",children:"Duration (ms)"}),e.jsx("input",{id:"notification-duration",type:"number",min:0,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm",value:L,onChange:$=>w($.target.value),disabled:u&&j})]}),u&&e.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-border",checked:j,onChange:$=>I($.target.checked)}),"Persistent"]}),h&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-border",checked:T,onChange:$=>A($.target.checked)}),"Include action button"]}),T&&e.jsx("input",{className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm",value:R,onChange:$=>D($.target.value),placeholder:"Action label"})]}),e.jsx("button",{type:"submit",className:"w-full rounded-md bg-primary px-3 py-2 text-sm font-semibold text-primary-foreground transition hover:bg-primary/90",children:"Trigger notification"})]}),q.length>0&&e.jsxs("div",{className:"mt-4 border-t border-border pt-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-foreground",children:"Quick cases"}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:q.map($=>e.jsx("button",{type:"button",className:"rounded-full border border-border px-3 py-1 text-xs text-foreground transition hover:bg-muted",onClick:()=>F($.payload),children:$.label},$.label))})]})]})]})};exports.Advantages=uL;exports.Analytics=zE;exports.Banner=Ol;exports.Button=P;exports.CandidateCard=GI;exports.CandidateProfile=zq;exports.Cart=NL;exports.Chatbot=ML;exports.CompaniesList=BI;exports.CompanyAdminCandidates=$I;exports.CompanyAdminEditDialog=jE;exports.CompanyAdminEvents=ZI;exports.CompanyAdminJobs=YI;exports.CompanyAdminNews=JI;exports.CompanyAdminOverview=XI;exports.CompanyAdminPeople=QI;exports.CompanyAdminProducts=eA;exports.CompanyAdminSettings=tA;exports.CompanyAdminShell=wE;exports.CompanyClaim=GF;exports.CompanyDashboard=dA;exports.CompanyDetail=DF;exports.CompanyDirectory=Kq;exports.CompanyDirectoryContainer=UF;exports.CompanyGroupDetail=_F;exports.CompanyOnboardingModal=lH;exports.Complaints=iq;exports.ConsentBanner=iI;exports.ConsentProvider=rI;exports.CourseTypes=SL;exports.Courses=yL;exports.CoursesList=RI;exports.CoursesPage=_q;exports.Dashboard=DB;exports.DashboardOnboardingSection=cA;exports.Destinations=xL;exports.DirectoryShell=Za;exports.DirectoryToolbar=bI;exports.DirectoryViewModeToggle=H7;exports.EventsList=Rz;exports.ExamplesPanel=yA;exports.FAQ=wL;exports.FeatureJobs=yR;exports.Features=bL;exports.Footer=mD;exports.FooterLib=aI;exports.ForEmployers=LL;exports.ForgotPassword=$E;exports.FreelancerProfile=uA;exports.FreelancerProfileContainer=aH;exports.Freelancers=pA;exports.FreelancersContainer=tH;exports.FreelancersList=KB;exports.Gallery=jL;exports.GroupPrices=_P;exports.Header=Mq;exports.HeaderAlternative=tI;exports.Hero=gL;exports.HeroAlternative=IL;exports.HomePage=pR;exports.IgamingCareerHome=aD;exports.Input=ae;exports.JobDetailPage=jq;exports.JobListings=uD;exports.JobSearchWidget=RL;exports.JobsList=e_;exports.JurisdictionsList=sq;exports.Listing=FD;exports.Login=EE;exports.MarketDetail=xq;exports.MarketsList=Zz;exports.MobileNav=cl;exports.Navbar=pD;exports.NewsList=Pq;exports.NewsPage=Cq;exports.Newsletter=sD;exports.NewsletterV2=TL;exports.NotificationModal=oI;exports.NotificationProvider=gH;exports.NotificationTester=bH;exports.NotificationViewport=LA;exports.OnboardingChecklist=iO;exports.OnboardingDashboard=nA;exports.OnboardingModal=rA;exports.OnboardingPopup=zO;exports.OnboardingProvider=cO;exports.Partners=sI;exports.PlacesList=qz;exports.ProductCategoriesList=Hz;exports.Register=BE;exports.RegisterV2=UE;exports.RegulatorDetail=vq;exports.RegulatorsList=Xz;exports.Reviews=uq;exports.SearchableSelect=O7;exports.Services=fL;exports.ServicesNoIcons=CL;exports.ShieldedActionButton=zB;exports.SidebarNewsletter=nD;exports.SidebarNewsletterV2=E7;exports.SignInPromptModal=YE;exports.SlidingSummary=zP;exports.TagBadge=tC;exports.TagPicker=RP;exports.TaxonomyApproveForm=rH;exports.TaxonomySuggestionDetail=nH;exports.TaxonomySuggestionTable=sH;exports.Testimonials=kL;exports.Textarea=rt;exports.TrustSignals=PL;exports.UserIdentityMenu=VN;exports.ValueProposition=AL;exports.VerificationBanner=JE;exports.Videos=vL;exports.calculateOnboardingProgress=YN;exports.canEditSection=ME;exports.clearNotifications=CA;exports.dismiss=PC;exports.getEnabledPermissions=NE;exports.mapBackendFlagsToSteps=iA;exports.notify=MA;exports.updateNotification=NA;exports.useConsent=bC;exports.useNotification=AA;exports.useOnboardingContext=lA;
|