1import{l as E,r as c,j as e,L as x}from"./vendor-react-aro8yD9l.js";import{a as b}from"./index-CAwCAWZT.js";import"./vendor-charts-DStlN2dP.js";import"./vendor-pdf-BLcQqIzu.js";function u(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 0 0 0-1.69L9.54 5.98A.998.998 0 0 0 8 6.82z"})})}function C(){return e.jsx("span",{className:"lp-live-dot","aria-label":"LIVE"})}function y(n){return n?new Date(n*1e3).toLocaleDateString("ro-RO",{day:"numeric",month:"long",year:"numeric"}):""}function R(){const n=E(),[j,_]=c.useState(null),[v,o]=c.useState(!0),[i,f]=c.useState(null),[t,k]=c.useState(null),[d,N]=c.useState(!1),[p,h]=c.useState(""),m=c.useRef(null);c.useEffect(()=>{const l=localStorage.getItem("user");if(!l||l==="undefined"||l==="null"){o(!1);return}try{const a=JSON.parse(l);_(a),L(a)}catch{o(!1)}},[]);async function L(l){var a;try{const r=await b.getJSON({mode:"live",action:"check_access",user_id:(l==null?void 0:l.user_id)||(l==null?void 0:l.id)||0});f(r),((r==null?void 0:r.has_access)===!0||(r==null?void 0:r.has_access)==="true")&&w(((a=r==null?void 0:r.etapa)==null?void 0:a.etapa_id)||0)}catch{f({has_access:!1,etapa:null})}finally{o(!1)}}async function w(l){N(!0),h("");try{const a=await b.getJSON({mode:"live",action:"get_playback_url",etapa_id:l});a!=null&&a.success?k(a):h((a==null?void 0:a.message)||"Playerul nu este configurat pentru aceastÄ etapÄ.")}catch{h("Eroare la încÄrcarea playerului.")}finally{N(!1)}}c.useEffect(()=>{const l=t==null?void 0:t.embed_src;if(!l||!m.current)return;const a=m.current;a.innerHTML="";const r=document.createElement("script");return r.type="text/javascript",r.src=l,a.appendChild(r),()=>{a.innerHTML=""}},[t==null?void 0:t.embed_src]);const s=i==null?void 0:i.etapa,S=(i==null?void 0:i.has_access)===!0||(i==null?void 0:i.has_access)==="true";if(!v&&!j)return e.jsx("div",{className:"lp-wrap",children:e.jsx("div",{className:"lp-hero lp-hero--gate",children:e.jsxs("div",{className:"lp-hero-inner",children:[e.jsxs("span",{className:"lp-badge",children:[e.jsx(u,{})," LIVE"]}),e.jsxs("h1",{className:"lp-hero-title",children:["RoDrift ",e.jsx("span",{className:"lp-red",children:"LIVE"})]}),e.jsx("p",{className:"lp-hero-sub",children:"UrmÄreÈte cursele în timp real â calificÄri, battles Èi toatÄ adrenalina driftului românesc."}),e.jsxs("div",{className:"lp-gate-actions",children:[e.jsx("button",{className:"lp-btn lp-btn--primary",onClick:()=>n("/login"),children:"AutentificÄ-te"}),e.jsx("button",{className:"lp-btn lp-btn--ghost",onClick:()=>n("/inregistrare"),children:"CreeazÄ cont"})]})]})})});if(v)return e.jsxs("div",{className:"lp-wrap lp-loading",children:[e.jsx("div",{className:"lp-spinner"}),e.jsx("p",{children:"Se verificÄ accesul..."})]});if(!S)return e.jsx("div",{className:"lp-wrap",children:e.jsx("div",{className:"lp-hero lp-hero--gate",children:e.jsxs("div",{className:"lp-hero-inner",children:[e.jsxs("span",{className:"lp-badge",children:[e.jsx(u,{})," LIVE"]}),e.jsxs("h1",{className:"lp-hero-title",children:["RoDrift ",e.jsx("span",{className:"lp-red",children:"LIVE"})]}),s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"lp-stage-label",children:s.title}),e.jsxs("p",{className:"lp-stage-meta",children:[y(s.date)," · ",s.location]})]}):e.jsx("p",{className:"lp-hero-sub",children:"Nu existÄ o etapÄ activÄ Ã®n acest moment."}),e.jsx("p",{className:"lp-hero-sub lp-no-access-hint",children:"Pentru a urmÄri transmisiunea LIVE ai nevoie de un bilet LIVE sau un abonament activ."}),e.jsxs("div",{className:"lp-gate-actions",children:[e.jsx(x,{to:"/shop",className:"lp-btn lp-btn--primary",children:"CumpÄrÄ bilet LIVE"}),(s==null?void 0:s.etapa_id)&&e.jsx(x,{to:`/etapa/${s.url||s.etapa_id}`,className:"lp-btn lp-btn--ghost",children:"Despre etapÄ"})]})]})})});const g=[{key:"video_calificari_semipro",label:"CalificÄri Semi-Pro"},{key:"video_calificari_pro",label:"CalificÄri Pro"},{key:"video_battle_semipro",label:"Battles Semi-Pro"},{key:"video_battle_pro",label:"Battles Pro"},{key:"emisiune",label:"RoDrift Show"}].filter(l=>s==null?void 0:s[l.key]);return e.jsxs("div",{className:"lp-wrap",children:[e.jsx("div",{className:"lp-topbar",children:e.jsxs("div",{className:"container-default lp-topbar-inner",children:[e.jsxs("div",{className:"lp-topbar-left",children:[e.jsx(C,{}),e.jsx("span",{className:"lp-topbar-live",children:"LIVE"}),s&&e.jsxs("span",{className:"lp-topbar-stage",children:[s.title,s.location?` · ${s.location}`:""]})]}),e.jsx("div",{className:"lp-topbar-right",children:(s==null?void 0:s.etapa_id)&&e.jsx(x,{to:`/eta
1pa/${s.url||s.etapa_id}`,className:"lp-topbar-link",children:"Despre etapÄ â"})})]})}),e.jsx("div",{className:"lp-player-wrap",children:e.jsxs("div",{className:"lp-player-ratio",children:[d&&e.jsxs("div",{className:"lp-player-loading",children:[e.jsx("div",{className:"lp-spinner"}),e.jsx("p",{children:"Se încarcÄ playerul..."})]}),!d&&p&&e.jsx("div",{className:"lp-player-error",children:e.jsx("p",{children:p})}),e.jsx("div",{ref:m,className:"lp-player-dejastream",style:{width:"100%",height:"100%",display:!d&&!p&&(t!=null&&t.embed_src)?"block":"none"}})]})}),e.jsxs("div",{className:"container-default lp-content",children:[s&&e.jsxs("div",{className:"lp-stage-info",children:[e.jsx("h2",{className:"lp-stage-title",children:s.title}),e.jsxs("div",{className:"lp-stage-details",children:[s.date&&e.jsxs("span",{className:"lp-stage-detail",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M16 2v4M8 2v4M3 10h18"})]}),y(s.date)]}),s.location&&e.jsxs("span",{className:"lp-stage-detail",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"}),e.jsx("circle",{cx:"12",cy:"9",r:"2.5"})]}),s.location]})]})]}),g.length>0&&e.jsxs("div",{className:"lp-videos",children:[e.jsx("h3",{className:"lp-videos-title",children:"UrmÄreÈte înregistrÄrile"}),e.jsx("div",{className:"lp-videos-grid",children:g.map(l=>e.jsxs("a",{href:`/watch?etapa=${s.etapa_id}&video=${l.key}`,className:"lp-video-card",children:[e.jsx(u,{}),e.jsx("span",{children:l.label})]},l.key))})]})]})]})}export{R as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.