PageSourceSearch

https://app.klubio.eu/assets/index-CTBZnV85.js

js klubio.eu collected 2026-10-09 22:55:47 UTC 11,154 bytes, 10 lines download raw bytes

1import{p as B,r as i,j as e}from"./vendor-router-v39WASOe.js";import{J as _,as as E,c as M,q,a8 as w,C as G,at as U}from"./index-CS8snvjH.js";import{a as Y}from"./club-DcKlHCmF.js";import{a as N,b as L}from"./vendor-query-Byrllmfh.js";import{A as z}from"./auth-language-selector-BBmiYHgQ.js";import{C as I}from"./clock-wlw12KRO.js";import{C as k}from"./check-BHg_eT5R.js";import{D as K}from"./download-B-N9C1Qn.js";import{S as H}from"./star-CC6RPN2O.js";import"./vendor-react-Dazix4UH.js";import"./vendor-charts-CS-x8tQe.js";import"./vendor-firebase-DYX7IyiA.js";import"./dropdown-menu-CdqNpiEe.js";import"./index-BdhRKl2d.js";import"./index-BETOTK_N.js";import"./index-CCzCf0yx.js";import"./index-BxfR3SFH.js";import"./Combination-iYepWJ2Q.js";import"./index-blvjbkM-.js";import"./index-DeFgaC9i.js";import"./index-DsFHy6lQ.js";import"./chevron-right-B8X3u6l0.js";import"./globe-Hy20Q8GV.js";const V=t=>N({queryKey:["payment_result",t],queryFn:async()=>{const{data:n}=await _.get(`/api/v1/payment-result/${t}`);return n},enabled:!!t,retry:!1}),W=()=>L({mutationFn:async({sessionId:t,rating:n,comment:a})=>{await _.post(`/api/v1/payment-result/${t}/feedback`,{session_id:t,rating:n,comment:a})}}),X=t=>N({queryKey:["payment_page_config_published",t],queryFn:async()=>{const{data:n}=await _.get("/api/v1/payment-page-config/published",{withCredentials:!0,headers:{"X-Club-Slug":t}});return n},enabled:!!t});function J(t,n){const a=parseFloat(t);if(isNaN(a))return t;const s=(n||"EUR").toUpperCase();try{return new Intl.NumberFormat(void 0,{style:"currency",currency:s}).format(a)}catch{return`${a.toFixed(2)} ${s}`}}function ke(){const{clubSlug:t}=B({strict:!1}),{status:n,payment:a}=E.useSearch(),{t:s}=M("public");i.useEffect(()=>{q(t)},[t]);const{data:r}=Y(t),{data:l}=X(t),{data:c}=V(a),u=r?.name||t,x=r?.logo_url,f=i.useMemo(()=>{const p={};return r?.primary_color&&(p["--primary"]=r.primary_color),r?.secondary_color&&(p["--secondary"]=r.secondary_color),p},[r?.primary_color,r?.secondary_color]),m=n==="success",b=n==="cancelled",j=n==="pending",g=l?.accent_color||"#22c55e",d=l?.style==="celebration"&&m,o=l?.success_title||s("payment_result.success_title","Payment successful!"),C=l?.success_message||s("payment_result.success_desc","Your payment has been received. The invoice will be updated shortly."),S=l?.cancelled_title||s("payment_result.cancelled_title","Payment cancelled"),P=l?.cancelled_message||s("payment_result.cancelled_desc","The payment was not completed. You can try again from your invoices page."),T=l?.pending_title||s("payment_result.pending_title","Payment pending"),$=l?.pending_message||s("payment_result.pending_desc","Your payment is being processed. The invoice will be updated once the payment is confirmed."),F=l?.error_title||s("payment_result.error_title","Something went wrong"),R=l?.error_message||s("payment_result.error_desc","There was a problem processing your payment. Please try again or contact support."),D=l?.show_receipt_link!==!1,v=c?.amount?J(c.amount,c.currency):null,h=c?.invoice_number,y={success:{icon:k,iconBg:g,title:o,desc:C},cancelled:{icon:w,iconBg:"#9ca3af",title:S,desc:P},pending:{icon:I,iconBg:"#d97706",title:T,desc:$},error:{icon:w,iconBg:"#ef4444",title:F,desc:R}}[m?"success":b?"cancelled":j?"pending":"error"],A=y.icon;return e.jsxs("div",{className:"min-h-screen flex flex-col lg:flex-row lg:items-start",style:f,children:[d&&e.jsx(ee,{}),e.jsxs("div",{className:"w-full lg:w-1/2 flex flex-col bg-white lg:bg-[#f5f7fa] min-h-screen lg:min-h-screen",children:[e.jsx("div",{className:"h-1 shrink-0",style:{backgroundColor:g}}),e.jsxs("div",{className:"px-6 lg:px-10 pt-6 lg:pt-8 shrink-0 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[x?e.jsx("img",{src:x,alt:u,className:"h-9 lg:h-11 w-auto object-contain"}):e.jsx("div",{className:"h-9 lg:h-11 w-9 lg:w-11 rounded-xl bg-gray-200 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-base lg:text-lg font-bold text-gray-500",children:u.charAt(0).toUpperCase()})}),e.jsx("span",{className:"font-semibold text-gray-900 text-sm hidden sm:block",children:u})]}),e.jsx(z,{})]}),e.jsx("div",{className:"flex-1 flex flex-col justify-center px-6 lg:px-12 xl:px-16 py-8",children:e.jsxs("div",{className:"max-w-[440px] w-full mx-auto lg:mx-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-full flex items-center justify-center shrink-0",style:{backgroundColor:y.iconBg},children:e.jsx(A,{className:"w-5 h-5 text-white",strokeWidth:3})}),e.jsx("h1",{className:"text-2xl lg:text-[2rem] font-bold text-gray-900 leading-tight",children:y.title})]}),e.jsx("p",{className:"text-gray-500 leading-relaxed mb-8",children:y.desc}),m&&(v||h)&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-700 mb-3",children:s("payment_result.payment_summary","Payment Summary")}
1),e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100 px-4",children:[h&&e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsx("span",{className:"text-sm text-gray-500",children:s("payment_result.invoice_ref","Invoice")}),e.jsx("span",{className:"text-sm text-gray-900 font-medium",children:h})]}),v&&e.jsxs("div",{className:"flex items-center justify-between py-3",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:s("payment_result.total","Total")}),e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:v})]})]})]}),D&&a&&m&&e.jsxs("a",{href:`https://club-api.sportsoftware.ai/api/v1/payment-result/${a}/pdf`,download:!0,onClick:p=>{G.isNativePlatform()&&(p.preventDefault(),U(p.currentTarget.href,`receipt-${h||a}.pdf`).catch(()=>{}))},className:"inline-flex items-center gap-1.5 text-sm text-blue-600 hover:text-blue-700 underline underline-offset-2 transition-colors",children:[e.jsx(K,{className:"w-4 h-4"}),s("payment_result.download_receipt","Download receipt (PDF)")]})]})}),e.jsxs("div",{className:"px-6 lg:px-10 pb-8 shrink-0 border-t border-gray-200 pt-6 flex flex-col sm:flex-row sm:items-end sm:justify-between gap-4",children:[e.jsx("div",{className:"min-w-0",children:e.jsx(Q,{t:s,sessionId:a})}),e.jsx("a",{href:"https://klubio.eu",target:"_blank",rel:"noopener noreferrer",className:"shrink-0",children:e.jsx("img",{src:"https://sportsoftware.ams3.cdn.digitaloceanspaces.com/klubio-assets/klubio-logo-text-with-badge.png",alt:"Klubio",className:"h-9 object-contain opacity-60 hover:opacity-100 transition-opacity"})})]})]}),e.jsx(Z,{config:l??void 0,logoUrl:x,clubName:u})]})}const O={1:"Very poor",2:"Poor",3:"Okay",4:"Good",5:"Excellent"};function Q({t,sessionId:n}){const[a,s]=i.useState(0),[r,l]=i.useState(0),[c,u]=i.useState(""),[x,f]=i.useState(!1),m=i.useRef(null),b=W(),j=o=>{l(o),setTimeout(()=>m.current?.focus(),50)},g=()=>{n&&r>0&&b.mutate({sessionId:n,rating:r,comment:c}),f(!0)},d=a||r;return x?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[e.jsx(k,{className:"w-4 h-4 text-green-500 shrink-0"}),t("payment_result.rating_thanks","Thanks for your feedback!")]}):e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400 mb-2.5",children:t("payment_result.rating_prompt","How was your payment experience?")}),e.jsxs("div",{className:"flex items-center gap-1 mb-1",onMouseLeave:()=>s(0),children:[[1,2,3,4,5].map(o=>e.jsx("button",{type:"button",onClick:()=>j(o),onMouseEnter:()=>s(o),className:"p-0.5 transition-transform hover:scale-110 active:scale-95","aria-label":`${o} star`,children:e.jsx(H,{className:"w-6 h-6 transition-colors",fill:o<=d?"#f59e0b":"none",stroke:o<=d?"#f59e0b":"#d1d5db",strokeWidth:1.5})},o)),d>0&&e.jsx("span",{className:"ml-1.5 text-xs text-gray-400",children:t(`payment_result.rating_${d}`,O[d])})]}),r>0&&e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsx("textarea",{ref:m,value:c,onChange:o=>u(o.target.value),placeholder:t("payment_result.rating_feedback_placeholder","Any comments? (optional)"),rows:2,className:"w-full text-sm text-gray-700 placeholder-gray-400 bg-white border border-gray-200 rounded-xl px-3 py-2.5 resize-none focus:outline-none focus:ring-2 focus:ring-gray-200 focus:border-gray-300 transition-all"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:g,className:"px-4 py-1.5 rounded-full text-xs font-semibold bg-gray-900 text-white hover:bg-gray-700 transition-colors",children:t("payment_result.rating_submit","Submit")}),e.jsx("button",{type:"button",onClick:()=>f(!0),className:"px-4 py-1.5 rounded-full text-xs font-medium text-gray-400 hover:text-gray-600 transition-colors",children:t("payment_result.rating_skip","Skip")})]})]})]})}function Z({config:t,logoUrl:n,clubName:a}){const s=t?.right_panel_type||"primary",r=s==="image"?t?.right_panel_image_url:"",l=s==="custom_color"?t?.right_panel_color||"#6366f1":void 0,c=!l&&!r;return e.jsxs("div",{className:`hidden lg:flex lg:w-1/2 ${c?"bg-primary":""} flex-col items-center justify-center relative overflow-hidden lg:sticky lg:top-0 lg:h-screen`,style:l?{backgroundColor:l}:void 0,children:[r&&e.jsxs(e.Fragment,{children:[e.jsx("img",{src:r,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black/50"})]}),!r&&e.jsxs("div",{className:"absolute inset-0 opacity-10 pointer-events-none",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-64 h-64 roun
1ded-full bg-white"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-48 h-48 rounded-full bg-white"}),e.jsx("div",{className:"absolute top-1/2 right-1/3 w-32 h-32 rounded-full bg-white"})]}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center text-center px-12",children:[n?e.jsx("img",{src:n,alt:a,className:"w-24 h-24 object-contain mb-6 drop-shadow-lg"}):e.jsx("span",{className:"text-4xl font-bold text-white mb-6",children:a.charAt(0).toUpperCase()}),e.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:a})]})]})}function ee(){const[t,n]=i.useState(!0);return i.useEffect(()=>{const a=setTimeout(()=>n(!1),4e3);return()=>clearTimeout(a)},[]),t?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
2        @keyframes confetti-fall {
3          0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
4          100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
5        }
6        @keyframes confetti-container-fade {
7          0%, 70% { opacity: 1; }
8          100% { opacity: 0; }
9        }
10      `}),e.jsx("div",{className:"fixed inset-0 pointer-events-none overflow-hidden z-50",style:{animation:"confetti-container-fade 4s ease-out forwards"},children:Array.from({length:40}).map((a,s)=>e.jsx("div",{className:"absolute",style:{width:s%3===0?10:7,height:s%3===0?10:s%3===1?14:7,borderRadius:s%2===0?"50%":"2px",backgroundColor:["#22c55e","#3b82f6","#f59e0b","#ec4899","#8b5cf6","#f97316"][s%6],left:`${(s*2.5+.5)%99}%`,top:"-20px",animation:`confetti-fall ${3+s%5*.8}s ease-in ${s*.12}s infinite`}},s))})]}):null}export{ke as component};

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.