1import{u as hs,k as bs,r,j as e,dl as he,e as Ms,y as $s,g as Is,dm as Os,dn as As,C as Ce,dp as Fs,a as te,dq as us,dr as W,ds as Us,dt as Bs,du as qs,dv as zs,bA as Ks,dw as Ue,ag as Ae,dx as ys,dy as fs}from"./index-Bp6scR--.js";import{E as Gs,l as Ys,u as Js,a as Hs,P as Ws}from"./index-DhdyZXHb.js";import{o as ds}from"./browser-DGrThwre.js";const Vs=[{key:"too_expensive",emoji:"ð¸"},{key:"missing_features",emoji:"ð§©"},{key:"unused",emoji:"ð´"},{key:"switched_service",emoji:"âï¸"},{key:"too_complex",emoji:"ð¤¯"},{key:"low_quality",emoji:"â ï¸"},{key:"customer_service",emoji:"ð"},{key:"other",emoji:"ð¬"}],Qs={de:"de-DE",tr:"tr-TR",en:"en-US",ar:"ar"},F=(s,n={})=>String(s||"").replace(/\{(\w+)\}/g,(m,u)=>n[u]===void 0?"":String(n[u]));function Zs(s,n){if(!s)return"â";try{return new Date(s).toLocaleDateString(n,{day:"2-digit",month:"long",year:"numeric"})}catch{return"â"}}function Xs(s,n){if(!s)return"â";const m=new Date(s);if(Number.isNaN(m.getTime()))return"â";try{return m.toLocaleString(n,{dateStyle:"medium",timeStyle:"short"})}catch{return m.toISOString()}}function et(s,n,m){if(!s)return null;try{return new Intl.NumberFormat(m,{style:"currency",currency:(n||"eur").toUpperCase(),minimumFractionDigits:2}).format(s/100)}catch{return null}}function st(){const{t:s,language:n}=hs(),m=Qs[n]||n||"en-US",{isPremium:u,tier:d,subscriptionStatus:p,cancelAtPeriodEnd:j,nextBillingDate:b,cardBrand:S,cardLast4:D,subAmount:k,subCurrency:B,cancelSubscription:ae,resumeSubscription:v,refreshStatus:w}=bs(),[q,V]=r.useState(!1),[Q,z]=r.useState("intro"),[T,L]=r.useState(null),[N,ie]=r.useState(""),[C,K]=r.useState(!1),[E,M]=r.useState(""),[o,Z]=r.useState(null),G=p==="lifetime"||d==="lifetime",R=d?s(`premium.tier.${d}`):"",y=R&&R!==`premium.tier.${d}`?R:d?d[0].toUpperCase()+d.slice(1):"Premium",I=r.useMemo(()=>et(k,B,m),[k,B,m]),h=_=>Zs(_,m);if(!u||G)return G?e.jsxs("div",{className:"sub-mgmt-card sub-mgmt-card--lifetime",children:[e.jsxs("div",{className:"sub-mgmt-head",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"sub-mgmt-eyebrow",children:["ð ",s("premium.lifetime.name")]}),e.jsx("h3",{className:"sub-mgmt-title",children:s("premium.lifetime.activeTitle")})]}),e.jsx("span",{className:"sub-mgmt-badge sub-mgmt-badge--gold",children:s("premium.badge.active")})]}),e.jsx("p",{className:"sub-mgmt-sub",children:s("premium.lifetime.activeDesc")})]}):null;const Y=()=>{V(!1),setTimeout(()=>{z("intro"),L(null),ie(""),M(""),Z(null)},250)},ue=async()=>{K(!0),M("");try{const _=await ae({reason:T,comment:N.trim()||null,language:n});Z(_),z("done"),w==null||w()}catch{M(s("subscription.error.cancel"))}finally{K(!1)}},be=async()=>{K(!0),M("");try{await v(),w==null||w()}catch{M(s("subscription.error.resume"))}finally{K(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`sub-mgmt-card ${j?"sub-mgmt-card--cancelling":""}`,children:[e.jsxs("div",{className:"sub-mgmt-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"sub-mgmt-eyebrow",children:j?`â³ ${s("subscription.status.cancelling")}`:`â ${F(s("subscription.status.activePlan"),{tier:y})}`}),e.jsx("h3",{className:"sub-mgmt-title",children:j?F(s("subscription.status.endsOn"),{date:h(b)}):F(s(I?"subscription.status.nextChargeWithPrice":"subscription.status.nextCharge"),{date:h(b),price:I})})]}),e.jsx("span",{className:`sub-mgmt-badge ${j?"sub-mgmt-badge--warn":"sub-mgmt-badge--ok"}`,children:s(j?"subscription.status.cancelled":"premium.badge.active")})]}),S&&D&&e.jsxs("div",{className:"sub-mgmt-payment",children:[e.jsx("span",{className:"sub-mgmt-card-brand",children:S.toUpperCase()}),e.jsxs("span",{children:["â¢â¢â¢â¢ ",D]})]}),j?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"sub-mgmt-sub",children:F(s("subscription.status.accessUntil"),{date:h(b)})}),e.jsx("div",{className:"sub-mgmt-actions",children:e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--primary",onClick:be,disabled:C,children:s(C?"subscription.resume.loading":"subscription.resume.cta")})}),E&&e.jsx("div",{className:"sub-mgmt-err",children:E})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"sub-mgmt-sub",children:s("subscription.status.activeDesc")}),e.jsx("div",{className:"sub-mgmt-actions",children:e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--ghost",onClick:()=>V(!0),children:s("subscription.cancel.cta")})})]})]}),q&&he.createPortal(e.jsx("div",{className:"sub-mgmt-overlay",onClick:_=>{_.target===_.currentTarget&&!C&&Y()},children:e.jsxs("div",{className:"sub-mgmt-modal",role:"dialog","aria-modal":"true","aria-labelledby":"sub-mgmt-mtitle",children:[e.jsx("button",{className:"sub-mgmt-close",onClick:Y,"aria-label":s("premium.common.close"),disabled:C,children:"â"}),Q==="intro"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sub-mgmt-modal-emoji",children:"ð¢"}),e.jsx("h2",{id:"sub-mgmt-mtitle",className:"sub-mgmt-modal-title",children:F(s("subscription.intro.title"),{tier:y})}),e.jsx("p",{className:"sub-mgmt-modal-desc",children:F(s("subscription.intro.desc"),{date:h(b)})}),e.jsxs("div",{className:"sub-mgmt-info-row",children:[e.jsxs("div",{className:"sub-mgmt-info",children:[e.jsx("span",{className:"sub-mgmt-info-label",children:s("subscription.info.activeUntil")}),e.jsx("strong",{children:h(b)})]}),I&&e.jsxs("div",{className:"sub-mgmt-info",children:[e.jsx("span",{className:"sub-mgmt-info-label",children:s("subscription.info.currentPlan")}),e.jsxs("strong",{children:[y," · ",I]})]})]}),e.jsxs("div",{className:"sub-mgmt-modal-actions",children:[e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--secondary",onClick:Y,children:s("subscription.intro.stay")}),e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--ghost",onClick:()=>z("reason"),children:s("subscription.intro.continue")})]})]}),Q==="reason"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sub-mgmt-modal-emoji",children:"ð¬"}),e.jsx("h2",{className:"sub-mgmt-modal-title",children:s("subscription.reason.title")}),e.jsx("p",{className:"sub-mgmt-modal-desc",children:s("subscription.reason.desc")}),e.jsx("div",{className:"sub-mgmt-reasons",children:Vs.map(_=>e.jsxs("button",{className:`sub-mgmt-reason ${T===_.key?"sub-mgmt-reason--active":""}`,onClick:()=>L(_.key),type:"button",children:[e.jsx("span",{className:"sub-mgmt-reason-emoji",children:_.emoji}),e.jsx("span",{children:s(`subscription.reason.${_.key}`)})]},_.key))}),T&&e.jsx("textarea",{className:"sub-mgmt-comment",placeholder:s("subscription.reason.placeholder"),value:N,onChange:_=>ie(_.target.value.slice(0,500)),rows:3,maxLength:500}),e.jsxs("div",{className:"sub-mgmt-modal-actions",children:[e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--secondary",onClick:()=>z("intro"),children:s("subscription.common.back")}),e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--ghost",onClick:()=>z("confirm"),children:s("subscription.common.continue")})]})]}),Q==="confirm"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sub-mgmt-modal-emoji",children:"â ï¸"}),e.jsx("h2",{className:"sub-mgmt-modal-title",children:s("subscription.confirm.title")}),e.jsx("p",{className:"sub-mgmt-modal-desc",children:s("subscription.confirm.desc")}),e.jsxs("ul",{className:"sub-mgmt-confirm-list",children:[e.jsxs("li",{children:[e.jsx("span",{children:"ð
"}),e.jsxs("div",{children:[e.jsx("strong",{children:F(s("subscription.confirm.activeUntil"),{date:h(b)})}),e.jsx("small",{children:s("subscription.confirm.activeUntilSub")})]})]}),e.jsxs("li",{children:[e.jsx("span",{children:"ð"}),e.jsxs("div",{children:[e.jsx("strong",{children:s("subscription.confirm.noCharge")}
1),e.jsx("small",{children:s("subscription.confirm.noChargeSub")})]})]}),e.jsxs("li",{children:[e.jsx("span",{children:"â©ï¸"}),e.jsxs("div",{children:[e.jsx("strong",{children:s("subscription.confirm.reconsider")}),e.jsx("small",{children:s("subscription.confirm.reconsiderSub")})]})]}),e.jsxs("li",{children:[e.jsx("span",{children:"â¹ï¸"}),e.jsxs("div",{children:[e.jsx("strong",{children:s("subscription.confirm.noRefund")}),e.jsx("small",{children:s("subscription.confirm.noRefundSub")})]})]})]}),E&&e.jsx("div",{className:"sub-mgmt-err",children:E}),e.jsxs("div",{className:"sub-mgmt-modal-actions",children:[e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--secondary",onClick:()=>z("reason"),disabled:C,children:s("subscription.common.back")}),e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--danger",onClick:ue,disabled:C,children:s(C?"subscription.cancel.loading":"subscription.cancel.final")})]})]}),Q==="done"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sub-mgmt-modal-emoji",children:"â
"}),e.jsx("h2",{className:"sub-mgmt-modal-title",children:s("subscription.done.title")}),e.jsx("p",{className:"sub-mgmt-modal-desc",children:F(s("subscription.done.desc"),{date:h((o==null?void 0:o.periodEnd)||b)})}),e.jsxs("div",{className:"sub-mgmt-receipt",children:[e.jsxs("div",{className:"sub-mgmt-receipt-row",children:[e.jsx("span",{children:s("cancelSubscription.done.receipt")}),e.jsx("strong",{children:e.jsx("bdi",{dir:"ltr",children:(o==null?void 0:o.receiptId)||"â"})})]}),e.jsxs("div",{className:"sub-mgmt-receipt-row",children:[e.jsx("span",{children:s("subscription.done.received")}),e.jsx("strong",{children:e.jsx("bdi",{dir:"ltr",children:Xs(o==null?void 0:o.receivedAt,m)})})]}),e.jsxs("div",{className:"sub-mgmt-receipt-row",children:[e.jsx("span",{children:s("subscription.done.ends")}),e.jsx("strong",{children:h((o==null?void 0:o.periodEnd)||b)})]}),e.jsxs("div",{className:"sub-mgmt-receipt-row",children:[e.jsx("span",{children:s("subscription.done.plan")}),e.jsxs("strong",{children:["Imantree ",y]})]})]}),e.jsx("p",{className:"sub-mgmt-modal-fineprint",children:F(s((o==null?void 0:o.confirmationEmailSent)===!0?"subscription.done.fineprint":"subscription.done.fineprintEmailFailed"),{date:h((o==null?void 0:o.periodEnd)||b)})}),e.jsx("div",{className:"sub-mgmt-modal-actions",children:e.jsx("button",{className:"sub-mgmt-btn sub-mgmt-btn--primary",onClick:Y,children:s("premium.common.close")})})]})]})}),document.body)]})}const tt=Object.freeze({card:{translationKey:"premium.pay.method.card"},apple_pay:{brand:"Apple Pay"},google_pay:{brand:"Google Pay"},link:{brand:"Link"},paypal:{brand:"PayPal"},klarna:{brand:"Klarna"},sepa_debit:{brand:"SEPA"}});function at(s,n){return Array.isArray(s)?s.flatMap(m=>{const u=tt[m];if(!u)return[];if(u.brand)return[u.brand];const d=typeof n=="function"?n(u.translationKey):null;return d&&d!==u.translationKey?[d]:[]}):[]}const P=Ce.isNativePlatform(),Fe=P?Ce.getPlatform():"web",it=P&&Fe==="ios",rt="pk_live_51SlwYFLy4gh2xV0YNvJJyim78GOWmKIJROeObpUq1ob1GuP9C4AdD6ktramT7UEmCCiqeNXQYNKCMd6ci0L0wK7U00ejdlegYg";let Oe;const ps=s=>P?null:(Oe||(Oe=Ys(s||rt)),Oe),U=["light","plus","pro"],Se={light:{icon:"ð±"},plus:{icon:"ð¸",recommended:!0},pro:{icon:"ð³"}},nt=4,x=(s,n)=>typeof s=="string"&&n?s.replace(/\{(\w+)\}/g,(m,u)=>n[u]!==void 0?String(n[u]):""):s;function lt({t:s,onDone:n,onError:m}){const u=Js(),d=Hs(),[p,j]=r.useState(!1),b=async S=>{if(S.preventDefault(),!(!u||!d)){j(!0);try{const{error:D}=await u.confirmPayment({elements:d,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(D){m(s("premium.error.generic"));return}n()}catch{m(s("premium.error.generic"))}finally{j(!1)}}};return e.jsxs("form",{onSubmit:b,className:"pm-3ds-form",children:[e.jsx(Ws,{}),e.jsx("button",{type:"submit",disabled:!u||p,className:"pm-btn pm-btn--primary pm-btn--block",children:s(p?"premium.threeds.confirming":"premium.threeds.confirm")})]})}function yt(){var is,rs,ns;const{t:s,language:n}=hs(),m=Ms();$s();const{user:u,isAuthenticated:d}=Is(),{isPremium:p,subscriptionStatus:j,premiumSource:b,tier:S,startCheckout:D,openPortal:k,restorePurchases:B,checkoutLoading:ae,refreshStatus:v,billingInterval:w,premiumSeats:q,managesGiftSubscriptions:V,managedGiftSubscriptionCount:Q}=bs(),z=(u==null?void 0:u.role)==="admin",T=U.includes(S)?S:null,L=j==="lifetime",N=["active","trialing","past_due","gifted"].includes(j),ie=z||!p&&!N,C=b==="gift"&&N,K=!P&&b==="revenuecat"&&N,E=Os(w),M=As(q),[o,Z]=r.useState("yearly"),[G,R]=r.useState("yearly"),[y,I]=r.useState(()=>p&&T||"plus"),[h,Y]=r.useState(1),[ue,be]=r.useState(!1),[_,Be]=r.useState(!1),[ye,xs]=r.useState(!1),[fe,qe]=r.useState(null),[$,ge]=r.useState(!1),[ze,X]=r.useState(null),[Pe,Ke]=r.useState(""),[Ge,xe]=r.useState(""),[je,ke]=r.useState(""),[we,re]=r.useState(null),[O,ne]=r.useState(null),[Ye,Je]=r.useState(!1),[He,le]=r.useState(""),Te=r.useRef(null),We=r.useRef(null),Ee=r.useRef(null),[c,Ve]=r.useState(()=>P?dt():gs()),f=r.useCallback((t,l)=>{clearTimeout(Ee.current),qe({type:t,text:l}),Ee.current=setTimeout(()=>qe(null),t==="error"?7e3:5e3)},[]),Re=r.useCallback(()=>{var t,l;(l=(t=Te.current)==null?void 0:t.scrollIntoView)==null||l.call(t,{block:"start",behavior:"smooth"})},[]);r.useEffect(()=>{let t=!0;Ce.isNativePlatform()&&Fs.getPricing(c).then(a=>{t&&(a!=null&&a.tiers)&&Ve(i=>({...i,...a,lifetime_remaining:i.lifetime_remaining??a.lifetime_remaining,lifetime_total:i.lifetime_total??a.lifetime_total,lifetime_available:i.lifetime_available===!1?!1:a.lifetime_available}))}).catch(a=>console.warn("[Pricing] Native RevenueCat pricing fetch error:",a));const l=encodeURIComponent(Intl.DateTimeFormat().resolvedOptions().timeZone||"");return te(`/api/stripe/pricing?lang=${encodeURIComponent(n||navigator.language||"de")}&tz=${l}`).then(a=>a.ok?a.json():null).then(a=>{t&&(a!=null&&a.tiers)&&Ve(i=>Ce.isNativePlatform()&&i.isNativeStore?{...i,lifetime_remaining:a.lifetime_remaining??i.lifetime_remaining,lifetime_total:a.lifetime_total??i.lifetime_total,lifetime_available:a.lifetime_available===!1?!1:i.lifetime_available,stripePublishableKey:a.stripePublishableKey||i.stripePublishableKey,payment_methods:a.payment_methods||i.payment_methods}:{...i,...a}
1)}).catch(a=>console.warn("[Pricing] konnte nicht geladen werden:",a.message)),()=>{t=!1}},[n]);const Qe=r.useRef(null);r.useEffect(()=>{if(!N||!T)return;const t=`${T}:${E||"unknown"}:${M}`;Qe.current!==t&&(Qe.current=t,I(T),E&&(Z(E),R(E)),Y(M))},[N,T,E,M]);const ce=((rs=(is=c.tiers)==null?void 0:is[y])==null?void 0:rs.max_seats)||1;r.useEffect(()=>{Y(t=>t>ce?ce:t),ce<=1&&be(!1)},[ce]),r.useEffect(()=>{const l=new URLSearchParams(window.location.search).get("status");l==="success"?(f("success",s("premium.successDesc")),v(),window.history.replaceState({},"","/premium")):l==="canceled"&&window.history.replaceState({},"","/premium")},[v]),r.useEffect(()=>{p||us("premium_page_view",{source:"organic",platform:Fe})},[p]),r.useEffect(()=>{if(!ie)return;const t=new URLSearchParams(window.location.search).get("ref")||new URLSearchParams(window.location.search).get("partner"),l=localStorage.getItem("pending_partner_code"),a=(t||l||"").trim().toUpperCase();d&&a?te("/api/partner/redeem",{method:"POST",body:JSON.stringify({code:a})}).then(i=>i.ok?i.json():null).then(i=>{i!=null&&i.code&&(re(i.code),ne({discountPct:i.discountPct,discountMonths:i.discountMonths,yearlyDiscountPct:i.yearlyDiscountPct}))}).catch(()=>{}):d?te("/api/partner/redeem").then(i=>i.ok?i.json():null).then(i=>{i!=null&&i.code&&(re(i.code),(i.discountPct||i.yearlyDiscountPct)&&ne({discountPct:i.discountPct,discountMonths:i.discountMonths,yearlyDiscountPct:i.yearlyDiscountPct}))}).catch(()=>{}):a&&te(`/api/partner/check/${encodeURIComponent(a)}`).then(i=>i.ok?i.json():null).then(i=>{i!=null&&i.valid&&i.code&&(re(i.code),ne({discountPct:i.discountPct,discountMonths:i.discountMonths,yearlyDiscountPct:i.yearlyDiscountPct}))}).catch(()=>{})},[ie,d]),r.useEffect(()=>{const t=We.current,l=Te.current;if(!l)return;if(!t){l.style.setProperty("--pm-cta-h","0px");return}const a=()=>{l.style.setProperty("--pm-cta-h",`${Math.ceil(t.offsetHeight)}px`)};if(a(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(a);return i.observe(t),()=>i.disconnect()},[L]),r.useEffect(()=>()=>clearTimeout(Ee.current),[]);const me=r.useCallback(t=>t?c.symbolPos==="left"?`${c.symbol}${t}`:`${t} ${c.symbol}`:"â",[c.symbol,c.symbolPos]),oe=r.useCallback(t=>{if(!t)return 0;const l=c.decimal||",",a=l===","?/[^0-9,-]/g:/[^0-9.-]/g,i=parseFloat(String(t).replace(a,"").replace(l,"."));return Number.isFinite(i)?i:0},[c.decimal]),De=r.useCallback((t,l)=>{const a=c.decimal||",",i=a===","?".":",",[A,H]=t.toFixed(l).split("."),se=A.replace(/\B(?=(\d{3})+(?!\d))/g,i);return H?`${se}${a}${H}`:se},[c.decimal]),Le=r.useCallback((t,l,a)=>{var os;const i=(os=c.tiers)==null?void 0:os[t];if(!i)return{total:0,totalStr:"",savings:0,savingsStr:""};const A=l==="yearly"?i.yearly:i.monthly,H=oe(A),se=(l==="yearly"?i.addon_yearly_seats:i.addon_monthly_seats)||[],ls=Math.max(1,Math.min(i.max_seats||1,a));let ve=H;for(let Ie=2;Ie<=ls;Ie++)ve+=oe(se[Ie-2]||"0");const cs=Math.max(0,H*ls-ve),ms=String(A||"").includes(c.decimal||",")?2:0;return{total:ve,totalStr:De(ve,ms),savings:cs,savingsStr:De(cs,ms)}},[c.tiers,c.decimal,oe,De]),g=G==="lifetime",Me=c.lifetime_available===!1,Ze=r.useMemo(()=>at(c.payment_methods,s),[c.payment_methods,s]),ee=r.useMemo(()=>({monthly:U.some(t=>W(c,t,"monthly")),yearly:U.some(t=>W(c,t,"yearly"))}),[c]),de=W(c,g?null:y,g?"lifetime":o),J=r.useMemo(()=>Us(window.location.search,c),[c]),Xe=r.useRef(!1);r.useEffect(()=>{if(!(Xe.current||!J||p)){if(Xe.current=!0,J.plan==="lifetime"){R("lifetime");return}I(J.tier),Z(J.billing),R(J.plan)}},[J,p]),r.useEffect(()=>{if(J||!P||p||g||de)return;let t=o,l=U.find(a=>W(c,a,t));l||(t=["yearly","monthly"].find(a=>ee[a]),l=t?U.find(a=>W(c,a,t)):null),!(!t||!l)&&(t!==o&&(Z(t),R(t)),l!==y&&I(l))},[c,o,y,ee,p,g,de,J]);const es=t=>s(`premium.tier.${t}`),$e=g?s("premium.lifetime.name"):es(y),ss=r.useMemo(()=>{var i,A;const t=((i=c.tiers)==null?void 0:i[y])||((A=c.tiers)==null?void 0:A.plus);if(!t)return 0;const l=oe(t.monthly)*12,a=oe(t.yearly);return!l||!a?0:Math.round((1-a/l)*100)},[c.tiers,y,oe]),js=r.useMemo(()=>Le(y,o,h),[Le,y,o,h]),Ne=Bs({hasRecurringSubscription:N,isGiftRecipient:C,isLifetimePlan:g,selectedTier:y,currentTier:T,selectedBilling:o,currentBilling:E,selectedSeats:h,currentSeats:M}),pe=P&&N&&["stripe","revenuecat"].includes(b)&&!L&&!C,_e=N&&!L&&b==="revenuecat"&&g,Ns=me(g?c.lifetime:js.totalStr),ts=g?"":s(o==="yearly"?"premium.perYearShort":"premium.perMonthShort"),_s=Ne||pe||_e?s("premium.cta.manage"):g?s("premium.cta.lifetime"):p||N?x(s("premium.cta.switch"),{tier:$e}):x(s("premium.cta.subscribe"),{tier:$e}),as=r.useCallback(async(t="")=>{if(!W(c,y,o)){f("error",s("premium.error.noOffer"));return}ge(!0);try{const l={tier:y,plan:o,seats:h};t.trim()&&(l.promoCode=t.trim());const a=await te("/api/stripe/upgrade-intent",{method:"POST",body:JSON.stringify(l)}),i=await a.json().catch(()=>({}));if(a.status===401){f("error",s("premium.error.login"));return}if(!a.ok){f("error",s("premium.error.switch"));return}if(i.requiresAction&&i.clientSecret){X(null),xe(i.clientSecret);return}X(null),Ke(""),f("success",s("premium.successDesc")),await v(),Re()}catch{X(null),f("error",s("premium.error.switch"))}finally{ge(!1)}},[c,y,o,h,s,f,v]),vs=r.useCallback(async()=>
1{if(!d){m("/auth?redirect=/premium");return}if(_e){if(!P){f("error",s("premium.error.cancelStoreFirst"));return}try{await k()}catch{f("error",s("premium.error.cancelStoreFirst"))}return}if(Ne||pe){try{await k()}catch(t){f("error",s((t==null?void 0:t.code)==="STORE_MANAGEMENT_REQUIRED"?"premium.error.cancelStoreFirst":"premium.error.generic"))}return}if(!de){f("error",s("premium.error.noOffer"));return}if(us("checkout_started",{platform:Fe}),N&&b==="stripe"&&!g){X("ask");return}try{const t=await D({tier:g?null:y,plan:G,seats:g?1:h,promoCode:we||void 0});if((t==null?void 0:t.status)==="error"){f("error",s("premium.error.generic"));return}if((t==null?void 0:t.status)==="no_offer"){f("error",s("premium.error.noOffer"));return}if((t==null?void 0:t.status)==="cancelled")return;((t==null?void 0:t.status)==="purchased"||t!=null&&t.upgraded)&&(f("success",s("premium.successDesc")),v(),Re())}catch(t){f("error",s((t==null?void 0:t.code)==="STORE_SUBSCRIPTION_ACTIVE"?"premium.error.cancelStoreFirst":"premium.error.generic"))}},[Ne,pe,_e,de,k,g,y,G,h,p,N,b,j,D,v,f,Re,s,d,m]),Ss=r.useCallback(async()=>{try{const t=await B();f(t!=null&&t.isPremium?"success":"error",t!=null&&t.isPremium?s("premium.restore.success"):s("premium.restore.none"))}catch{f("error",s("premium.restore.failed"))}},[B,f,s]),Cs=r.useCallback(async()=>{ge(!0);try{await k({manageGifts:!0})}catch{f("error",s("premium.error.generic"))}finally{ge(!1)}},[k,f,s]),Ps=r.useCallback(async()=>{const t=je.trim().toUpperCase();if(t){Je(!0),le("");try{if(d){const l=await te("/api/partner/redeem",{method:"POST",body:JSON.stringify({code:t})}),a=await l.json().catch(()=>({}));if(l.ok){re(a.code);try{localStorage.setItem("pending_partner_code",a.code),sessionStorage.setItem("pending_partner_code",a.code)}catch{}(a.discountPct||a.yearlyDiscountPct)&&ne({discountPct:a.discountPct,discountMonths:a.discountMonths,yearlyDiscountPct:a.yearlyDiscountPct}),ke(""),le(x(s("premium.partner.ok"),{name:a.partnerName||t}))}else le(s("premium.partner.invalid"))}else{const l=await te(`/api/partner/check/${encodeURIComponent(t)}`),a=await l.json().catch(()=>({}));if(l.ok&&a.valid){re(a.code);try{localStorage.setItem("pending_partner_code",a.code),sessionStorage.setItem("pending_partner_code",a.code)}catch{}ne({discountPct:a.discountPct,discountMonths:a.discountMonths,yearlyDiscountPct:a.yearlyDiscountPct}),ke(""),le(x(s("premium.partner.ok"),{name:a.partnerName||t}))}else le(s("premium.partner.invalid"))}}catch{le(s("premium.partner.network"))}finally{Je(!1)}}},[je,d,s]),ks=r.useCallback(t=>{W(c,t,o)&&(I(t),R(o))},[c,o]),ws=r.useCallback(()=>{Me||R("lifetime")},[Me]),Ts=r.useCallback(t=>{ee[t]&&(Z(t),R(t))},[ee]),Es=!L&&!C&&!K||ye,Rs=!L&&!C&&!K,Ds=!P||!!c.lifetime,Ls=!P&&!g&&ce>1;return e.jsxs("div",{className:"pm-screen premium-screen",ref:Te,children:[e.jsxs("div",{className:"pm-content",children:[e.jsx("div",{className:"pm-notice-slot",role:"status","aria-live":"polite",children:fe&&e.jsxs("div",{className:`pm-notice pm-notice--${fe.type}`,children:[e.jsx("span",{className:"pm-notice-icon",children:fe.type==="success"?"ð":"â ï¸"}),e.jsx("span",{className:"pm-notice-text",children:fe.text})]})}),!P&&b==="stripe"&&N&&e.jsx(st,{}),V&&e.jsxs("section",{className:"pm-card pm-card--status",children:[e.jsxs("div",{className:"pm-status-head",children:[e.jsxs("span",{className:"pm-status-eyebrow",children:["ð ",s("premium.gift.payerTitle")]}),e.jsx("span",{className:"pm-pill pm-pill--active",children:s("premium.badge.active")})]}),e.jsx("p",{className:"pm-status-text",children:Q>0?x(s("premium.gift.payerDescCount"),{count:Q}):s("premium.gift.payerDesc")}),e.jsx("button",{type:"button",className:"pm-btn pm-btn--secondary pm-btn--block",onClick:Cs,disabled:$,children:s("premium.gift.payerManage")})]}),C&&e.jsxs("section",{className:"pm-card pm-card--status",children:[e.jsxs("div",{className:"pm-status-head",children:[e.jsxs("span",{className:"pm-status-eyebrow",children:["ð ",s("premium.gift.badge")]}),e.jsx("span",{className:"pm-pill pm-pill--active",children:s("premium.badge.active")})]}),e.jsx("h2",{className:"pm-status-title",children:s("premium.gift.activeTitle")}),e.jsx("p",{className:"pm-status-text",children:s("premium.gift.activeDesc")})]}),K&&e.jsxs("section",{className:"pm-card pm-card--status",children:[e.jsxs("div",{className:"pm-status-head",children:[e.jsxs("span",{className:"pm-status-eyebrow",children:["ð± ",s("premium.store.webBadge")]}),e.jsx("span",{className:"pm-pill pm-pill--active",children:s("premium.badge.active")})]}),e.jsx("h2",{className:"pm-status-title",children:s("premium.store.webTitle")}),e.jsx("p",{className:"pm-status-text",children:s("premium.store.webDesc")})]}),pe&&e.jsxs("section",{className:"pm-card pm-card--status",children:[e.jsxs("div",{className:"pm-status-head",children:[e.jsx("span",{className:"pm-status-eyebrow",children:"ð Imantree Premium"}),e.jsx("span",{className:"pm-pill pm-pill--active",children:s("premium.badge.active")})]}),e.jsx("h2",{className:"pm-status-title",children:s("premium.activeTitle")}),e.jsx("p",{className:"pm-status-text",children:s("premium.activeSub")})]}),L&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"pm-card pm-card--lifetime-active",children:[e.jsxs("div",{className:"pm-status-head",children:[e.jsxs("span",{className:"pm-status-eyebrow",children:["ð ",s("premium.lifetime.name")]}),e.jsx("span",{className:"pm-pill pm-pill--gold",children:s("premium.badge.active")})]}),e.jsx("h2",{className:"pm-status-title",children:s("premium.lifetime.activeTitle")}),e.jsx("p",{className:"pm-status-text",children:s("premium.lifetime.activeDesc")})]}),e.jsxs("button",{type:"button",className:"pm-disclosure",onClick:()=>xs(t=>!t),"aria-expanded":ye,children:[s(ye?"premium.lifetime.hidePlans":"premium.lifetime.showPlans"),e.jsx("span",{className:`pm-chevron ${ye?"is-open":""}`,"aria-hidden":"true",children:"â¾"})]})]}),!p&&!L&&e.jsxs("header",{className:"pm-hero",children:[e.jsx("h1",{className:"pm-hero-title",children:s("premium.chooseTitle")}),e.jsx("p",{className:"pm-hero-sub",children:s("premium.chooseSub")})]}),Es&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"pm-billing",role:"radiogroup","aria-label":s("premium.chooseTitle"),children:["monthly","yearly"].filter(t=>ee[t]).map(t=>e.jsxs("button",{type:"button",role:"radio","aria-checked":o===t&&!g,"aria-disabled":!ee[t],className:`pm-billing-opt ${o===t&&!g?"is-active":""}`,onClick:()=>Ts(t),disabled:!ee[t],children:[s(`premium.billing.${t}`),t==="yearly"&&ss>0&&e.jsx("span",{className:"pm-billing-save",children:x(s("premium.billing.save"),{pct:ss})})]},t))}),e.jsxs("div",{className:"pm-plans",role:"radiogroup","aria-label":s("premium.chooseTitle"),children:[U.map(t=>{var l;return e.jsx(ct,{id:t,t:s,icon:Se[t].icon,name:es(t),tagline:s(`premium.tier.${t}.tagline`),prices:(l=c.tiers)==null?void 0:l[t],billing:o,selected:!g&&y===t,available:W(c,t,o),recommended:Se[t].recommended&&!p,current:p&&T===t,fmtPrice
1:me,onSelect:()=>ks(t)},t)}),Ds&&e.jsx(mt,{t:s,pricing:c,selected:g,soldOut:Me,fmtPrice:me,onSelect:ws})]}),Ls&&e.jsxs("section",{className:"pm-seats",children:[e.jsxs("button",{type:"button",className:"pm-disclosure",onClick:()=>be(t=>!t),"aria-expanded":ue,"aria-controls":"pm-seats-body",children:[e.jsxs("span",{className:"pm-disclosure-label",children:["ð¨âð©âð§âð¦ ",s("premium.seats.toggle"),h>1&&e.jsx("span",{className:"pm-disclosure-value",children:h===2?s("premium.seats.partner"):x(s("premium.seats.family"),{n:h})})]}),e.jsx("span",{className:`pm-chevron ${ue?"is-open":""}`,"aria-hidden":"true",children:"â¾"})]}),ue&&e.jsxs("div",{className:"pm-seats-body",id:"pm-seats-body",children:[e.jsx("p",{className:"pm-seats-hint",children:s("premium.seats.hint")}),e.jsx("div",{className:"pm-seats-opts",role:"radiogroup","aria-label":s("premium.seats.title"),children:Array.from({length:ce},(t,l)=>l+1).map(t=>{var H,se;const{totalStr:l,savingsStr:a,savings:i}=Le(y,o,t),A=t>1?Math.round((((se=(H=c.partner)==null?void 0:H.discounts)==null?void 0:se[t-2])??.3)*100):0;return e.jsxs("button",{type:"button",role:"radio","aria-checked":h===t,className:`pm-seat ${h===t?"is-active":""}`,onClick:()=>Y(t),children:[e.jsx("span",{className:"pm-seat-icon","aria-hidden":"true",children:t===1?"ð¤":t===2?"ð¥":"ð¨âð©âð§âð¦"}),e.jsx("span",{className:"pm-seat-label",children:t===1?s("premium.seats.solo"):t===2?s("premium.seats.partner"):x(s("premium.seats.family"),{n:t})}),e.jsxs("span",{className:"pm-seat-price",children:[me(l),e.jsx("small",{children:s(o==="yearly"?"premium.perYearShort":"premium.perMonthShort")})]}),t>1&&e.jsx("span",{className:"pm-seat-badge",children:i>0?x(s("premium.seats.save"),{amount:me(a)}):x(s("premium.seats.discount"),{pct:A,n:t})})]},t)})})]})]}),e.jsxs("button",{type:"button",className:"pm-disclosure pm-disclosure--link",onClick:()=>Be(!0),children:[e.jsxs("span",{className:"pm-disclosure-label",children:["ð ",x(s("premium.compare.open"),{n:Ue.length})]}),e.jsx("span",{className:"pm-chevron","aria-hidden":"true",children:"âº"})]}),e.jsxs("section",{className:"pm-included",children:[e.jsxs("h2",{className:"pm-included-title",children:[e.jsx("span",{className:"pm-included-check","aria-hidden":"true",children:"â"}),s("premium.includedTitle")]}),e.jsx("ul",{className:"pm-included-list",children:qs.map(t=>e.jsxs("li",{children:[e.jsx("span",{className:"pm-included-icon","aria-hidden":"true",children:t.icon}),e.jsx("span",{children:zs(t,s)})]},t.key))})]})]}),ie&&e.jsxs("section",{className:"pm-partner",children:[we?e.jsxs("div",{className:"pm-partner-active-box",style:{padding:"12px 14px",borderRadius:"12px",background:"var(--color-surface-2, rgba(255,255,255,0.06))",border:"1px solid rgba(255,255,255,0.1)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("p",{className:"pm-partner-active",style:{margin:0,fontWeight:600},children:["ð¤ ",x(s("premium.partner.active"),{code:we})]}),e.jsx("button",{type:"button",style:{background:"transparent",border:"none",color:"#94a3b8",cursor:"pointer",fontSize:"0.8rem",padding:"2px 6px",textDecoration:"underline"},onClick:()=>{re(null),ne(null);try{localStorage.removeItem("pending_partner_code"),sessionStorage.removeItem("pending_partner_code")}catch{}},children:s("premium.partner.change")})]}),e.jsx("p",{style:{margin:"4px 0 0 0",fontSize:"0.85rem",color:"var(--color-text-secondary, #94a3b8)"},children:G==="lifetime"?s("premium.partner.hintLifetime"):G==="yearly"?x(s("premium.partner.hintYearly"),{pct:(O==null?void 0:O.yearlyDiscountPct)||2.5,months:3}):x(s("premium.partner.hintMonthly"),{pct:(O==null?void 0:O.discountPct)||10,n:(O==null?void 0:O.discountMonths)||3})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"pm-partner-label",htmlFor:"pm-partner-input",children:["ð¤ ",s("premium.partner.desc")]}),e.jsxs("div",{className:"pm-partner-row",children:[e.jsx("input",{id:"pm-partner-input",type:"text",className:"pm-input",value:je,onChange:t=>ke(t.target.value.toUpperCase()),placeholder:s("premium.partner.placeholder"),autoCapitalize:"characters",autoCorrect:"off",spellCheck:!1}),e.jsx("button",{type:"button",className:"pm-btn pm-btn--secondary",onClick:Ps,disabled:Ye||!je.trim(),children:Ye?"â¦":s("premium.partner.activate")})]})]}),He&&e.jsx("p",{className:"pm-partner-msg",children:He})]}),!p&&!N&&e.jsxs("section",{className:"pm-why",children:[e.jsx("h2",{className:"pm-why-title",children:s("premium.why.title")}),e.jsxs("ul",{className:"pm-why-list",children:[e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:"ð«"}),s("premium.why.adFree")]}),e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:"ð"}),s("premium.why.sources")]}),e.jsxs("li",{children:[e.jsx("span",{"aria-hidden":"true",children:"ð"}),s("premium.why.privacy")]})]})]}),e.jsxs("footer",{className:"pm-foot",children:[e.jsx("p",{className:"pm-foot-pay",children:P?s("premium.pay.store"):Ze.length?Ze.join(" · "):s("premium.pay.web")}),P&&e.jsx("button",{type:"button",className:"pm-foot-link",onClick:Ss,children:s("premium.cta.restore")}),e.jsxs("p",{className:"pm-foot-legal",children:[e.jsx("a",{href:"https://imantree.com/terms",onClick:t=>{t.preventDefault(),ds(it?"https://www.apple.com/legal/internet-services/itunes/dev/stdeula/":"https://imantree.com/terms")},children:s("premium.termsOfUse")}),e.jsx("span",{"aria-hidden":"true",children:" ⢠"}),e.jsx("a",{href:`https://imantree.com/${n==="de"?"datenschutz":"privacy"}`,onClick:t=>{t.preventDefault(),ds(`https://imantree.com/${n==="de"?"datenschutz":"privacy"}`)},children:s("premium.privacyPolicy")})]})]})]}),Rs&&he.createPortal(e.jsxs("div",{className:"pm-cta",ref:We,id:"premium-cta-bar",children:[e.jsxs("div",{className:"pm-cta-summary",children:[e.jsx("span",{className:"pm-cta-icon","aria-hidden":"true",children:g?"â¾ï¸":(ns=Se[y])==null?void 0:ns.icon}),e.jsxs("div",{className:"pm-cta-meta",children:[e.jsx("span",{className:"pm-cta-plan",children:$e}),e.jsx("span",{className:"pm-cta-sub",children:[s(g?"premium.lifetime.tagline":`premium.billing.${o}`),h>1&&!g?h===2?s("premium.seats.partner"):x(s("premium.seats.family"),{n:h}
1):null].filter(Boolean).join(" · ")})]}),e.jsxs("div",{className:"pm-cta-price",children:[e.jsx("span",{children:Ns}),ts&&e.jsx("span",{className:"pm-cta-per",children:ts})]})]}),e.jsx("button",{type:"button",className:"pm-cta-btn",onClick:vs,id:"premium-cta",disabled:ae||$||!(Ne||pe||_e)&&!de,children:ae||$?e.jsx("span",{className:"pm-spinner","aria-label":s("premium.promo.applying")}):_s}),e.jsxs("div",{className:"pm-cta-trust",children:[e.jsxs("span",{children:["ð ",s("premium.trust.secure")]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{children:s("premium.trust.cancel")})]})]}),document.body),_&&he.createPortal(e.jsx(ot,{t:s,onClose:()=>Be(!1)}),document.body),ze&&he.createPortal(e.jsx("div",{className:"pm-overlay",onClick:()=>!$&&X(null),children:e.jsx("div",{className:"pm-dialog",role:"dialog","aria-modal":"true",onClick:t=>t.stopPropagation(),children:ze==="ask"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"pm-dialog-emoji","aria-hidden":"true",children:"ðï¸"}),e.jsx("h2",{className:"pm-dialog-title",children:s("premium.promo.title")}),e.jsx("p",{className:"pm-dialog-text",children:s("premium.promo.desc")}),e.jsxs("div",{className:"pm-dialog-actions",children:[e.jsx("button",{type:"button",className:"pm-btn pm-btn--secondary",onClick:()=>as(""),disabled:$,children:s($?"premium.switching":"premium.promo.no")}),e.jsx("button",{type:"button",className:"pm-btn pm-btn--primary",onClick:()=>X("input"),disabled:$,children:s("premium.promo.yes")})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"pm-dialog-emoji","aria-hidden":"true",children:"ð"}),e.jsx("h2",{className:"pm-dialog-title",children:s("premium.promo.enterTitle")}),e.jsx("p",{className:"pm-dialog-text",children:s("premium.promo.enterDesc")}),e.jsx("input",{type:"text",className:"pm-input pm-input--code",value:Pe,onChange:t=>Ke(t.target.value.toUpperCase()),placeholder:s("premium.promo.placeholder"),autoCapitalize:"characters",autoCorrect:"off",spellCheck:!1,autoFocus:!0}),e.jsxs("div",{className:"pm-dialog-actions",children:[e.jsx("button",{type:"button",className:"pm-btn pm-btn--secondary",onClick:()=>X("ask"),disabled:$,children:s("premium.promo.back")}),e.jsx("button",{type:"button",className:"pm-btn pm-btn--primary",onClick:()=>as(Pe),disabled:$||!Pe.trim(),children:s($?"premium.promo.applying":"premium.promo.apply")})]})]})})}),document.body),Ge&&he.createPortal(e.jsx("div",{className:"pm-overlay",onClick:()=>xe(""),children:e.jsxs("div",{className:"pm-dialog",role:"dialog","aria-modal":"true",onClick:t=>t.stopPropagation(),children:[e.jsx("h2",{className:"pm-dialog-title",children:s("premium.threeds.title")}),e.jsx("p",{className:"pm-dialog-text",children:s("premium.threeds.desc")}),ps(c.stripePublishableKey)&&e.jsx(Gs,{stripe:ps(c.stripePublishableKey),options:{clientSecret:Ge,locale:Ks(n),appearance:{theme:"night",variables:{colorPrimary:"#52b788",colorBackground:"#13231a",colorText:"#f3fff6",borderRadius:"12px"}}},children:e.jsx(lt,{t:s,onDone:async()=>{xe(""),f("success",s("premium.successDesc")),await v()},onError:t=>f("error",t)})}),e.jsx("button",{type:"button",className:"pm-btn pm-btn--ghost pm-btn--block",onClick:()=>xe(""),children:s("premium.common.cancel")})]})}),document.body)]})}function ct({id:s,t:n,icon:m,name:u,tagline:d,prices:p,billing:j,selected:b,available:S,recommended:D,current:k,fmtPrice:B,onSelect:ae}){const v=p||{},w=j==="yearly"?v.monthly_eq:v.monthly;return e.jsxs("button",{type:"button",role:"radio","aria-checked":b&&S,"aria-disabled":!S,disabled:!S,className:`pm-plan ${b&&S?"is-selected":""} ${D?"is-recommended":""} ${S?"":"is-soldout"}`,onClick:ae,id:`tier-${s}`,children:[k&&e.jsx("span",{className:"pm-plan-badge pm-plan-badge--current",children:n("premium.badge.current")}),D&&!k&&e.jsx("span",{className:"pm-plan-badge",children:n("premium.badge.recommended")}),e.jsx("span",{className:"pm-plan-radio","aria-hidden":"true"}),e.jsxs("span",{className:"pm-plan-main",children:[e.jsxs("span",{className:"pm-plan-name",children:[e.jsx("span",{className:"pm-plan-icon","aria-hidden":"true",children:m}),u]}),e.jsx("span",{className:"pm-plan-tagline",children:d})]}),e.jsxs("span",{className:"pm-plan-pricing",children:[e.jsx("span",{className:"pm-plan-price",children:w?B(w):"â"}),e.jsx("span",{className:"pm-plan-unit",children:n("premium.perMonth")}),j==="yearly"&&v.yearly&&e.jsx("span",{className:"pm-plan-yearly",children:x(n("premium.billedYearly"),{price:B(v.yearly)})})]}),b&&e.jsx("ul",{className:"pm-plan-limits",children:Ue.slice(0,nt).map(q=>{var V;return e.jsxs("li",{children:[e.jsx("span",{className:"pm-plan-limit-icon","aria-hidden":"true",children:(V=Ae[q])==null?void 0:V.icon}),e.jsx("span",{className:"pm-plan-limit-label",children:ys(q,n)}),e.jsx("span",{className:"pm-plan-limit-value",children:fs(q,s,n)})]},q)})})]})}
1function mt({t:s,pricing:n,selected:m,soldOut:u,fmtPrice:d,onSelect:p}){return e.jsxs("button",{type:"button",role:"radio","aria-checked":m,"aria-disabled":u,disabled:u,className:`pm-plan pm-plan--lifetime ${m?"is-selected":""} ${u?"is-soldout":""}`,onClick:p,id:"lifetime-card",children:[e.jsx("span",{className:"pm-plan-radio","aria-hidden":"true"}),e.jsxs("span",{className:"pm-plan-main",children:[e.jsxs("span",{className:"pm-plan-name",children:[e.jsx("span",{className:"pm-plan-icon","aria-hidden":"true",children:"â¾ï¸"}),s("premium.lifetime.name")]}),e.jsx("span",{className:"pm-plan-tagline",children:s("premium.lifetime.tagline")}),e.jsx("span",{className:"pm-plan-note",children:u?s("premium.lifetime.soldOutHint"):x(s("premium.lifetime.seatsLeft"),{n:n.lifetime_remaining??"â¦",total:n.lifetime_total??1e3})}),e.jsx("span",{className:"pm-plan-tagline",children:s("premium.lifetime.note")})]}),e.jsxs("span",{className:"pm-plan-pricing",children:[e.jsx("span",{className:"pm-plan-price",children:d(n.lifetime)}),n.lifetime_regular&&e.jsx("span",{className:"pm-plan-strike",children:x(s("premium.lifetime.instead"),{price:d(n.lifetime_regular)})})]})]})}function ot({t:s,onClose:n}){return r.useEffect(()=>{const m=u=>{u.key==="Escape"&&n()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]),e.jsx("div",{className:"pm-overlay pm-overlay--sheet",onClick:n,children:e.jsxs("div",{className:"pm-sheet",role:"dialog","aria-modal":"true",onClick:m=>m.stopPropagation(),children:[e.jsxs("div",{className:"pm-sheet-head",children:[e.jsx("h2",{className:"pm-sheet-title",children:s("premium.compare.title")}),e.jsx("button",{type:"button",className:"pm-sheet-close",onClick:n,"aria-label":s("premium.common.close"),children:"â"})]}),e.jsx("div",{className:"pm-sheet-body",children:e.jsxs("table",{className:"pm-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col"}),U.map(m=>e.jsxs("th",{scope:"col",children:[e.jsx("span",{"aria-hidden":"true",children:Se[m].icon}),e.jsx("span",{children:s(`premium.tier.${m}`)})]},m))]})}),e.jsx("tbody",{children:Ue.map(m=>{var u;return e.jsxs("tr",{children:[e.jsxs("th",{scope:"row",children:[e.jsx("span",{className:"pm-table-icon","aria-hidden":"true",children:(u=Ae[m])==null?void 0:u.icon}),ys(m,s)]}),U.map(d=>{var p;return e.jsx("td",{className:((p=Ae[m])==null?void 0:p[d])===1/0?"is-unlimited":"",children:fs(m,d,s)},d)})]},m)})})]})})]})})}const ut={currency:"EUR",symbol:"â¬",symbolPos:"right",decimal:",",tiers:{light:{monthly:"6,99",yearly:"59,99",monthly_eq:"5,00",max_seats:1,addon_monthly_seats:[],addon_yearly_seats:[]},plus:{monthly:"12,99",yearly:"99,99",monthly_eq:"8,33",max_seats:2,addon_monthly_seats:["9,09"],addon_yearly_seats:["69,99"]},pro:{monthly:"19,99",yearly:"149,99",monthly_eq:"12,50",max_seats:5,addon_monthly_seats:["13,99","11,99","10,00","8,00"],addon_yearly_seats:["105","90","75","60"]}},partner:{discounts:[.3,.4,.5,.6]},lifetime:"49",lifetime_regular:"99",lifetime_remaining:null,lifetime_total:1e3};function gs(){const s=(localStorage.getItem("imantree_language")||navigator.language||"").toLowerCase(),n=(Intl.DateTimeFormat().resolvedOptions().timeZone||"").toLowerCase();return n.includes("istanbul")||s.startsWith("tr")||s.includes(",tr")||s.includes("tr-")?{currency:"TRY",symbol:"âº",symbolPos:"left",decimal:",",tiers:{light:{monthly:"299",yearly:"2.499",monthly_eq:"208",max_seats:1,addon_monthly_seats:[],addon_yearly_seats:[]},plus:{monthly:"599",yearly:"4.999",monthly_eq:"417",max_seats:2,addon_monthly_seats:["419"],addon_yearly_seats:["3.499"]},pro:{monthly:"999",yearly:"8.299",monthly_eq:"692",max_seats:5,addon_monthly_seats:["699","599","499","399"],addon_yearly_seats:["5.809","4.979","4.149","3.319"]}},partner:{discounts:[.3,.4,.5,.6]},lifetime:"2.999",lifetime_regular:"5.999",lifetime_remaining:null,lifetime_total:1e3}:n.includes("zurich")||s.includes("de-ch")||s.includes("fr-ch")?{currency:"CHF",symbol:"CHF",symbolPos:"right",decimal:".",tiers:{light:{monthly:"9.90",yearly:"79.00",monthly_eq:"6.58",max_seats:1,addon_monthly_seats:[],addon_yearly_seats:[]},plus:{monthly:"19.90",yearly:"159.00",monthly_eq:"13.25",max_seats:2,addon_monthly_seats:["13.93"],addon_yearly_seats:["111.30"]},pro:{monthly:"29.90",yearly:"239.00",monthly_eq:"19.92",max_seats:5,addon_monthly_seats:["20.93","17.94","14.95","11.96"],addon_yearly_seats:["167.30","143.40","119.50","95.60"]}},partner:{discounts:[.3,.4,.5,.6]},lifetime:"99",lifetime_regular:"199",lifetime_remaining:null,lifetime_total:1e3}:n.includes("new_york")||n.includes("los_angeles")||n.includes("chicago")||n.includes("denver")||s.includes("en-us")?{currency:"USD",symbol:"$",symbolPos:"left",decimal:".",tiers:{light:{monthly:"9.99",yearly:"79.00",monthly_eq:"6.58",max_seats:1,addon_monthly_seats:[],addon_yearly_seats:[]},plus:{monthly:"19.99",yearly:"149.00",monthly_eq:"12.42",max_seats:2,addon_monthly_seats:["13.99"],addon_yearly_seats:["104.30"]},pro:{monthly:"29.99",yearly:"229.00",monthly_eq:"19.08",max_seats:5,addon_monthly_seats:["20.99","17.99","15.00","12.00"],addon_yearly_seats:["160.30","137.40","114.50","91.60"]}},partner:{discounts:[.3,.4,.5,.6]},lifetime:"79",lifetime_regular:"149",lifetime_remaining:null,lifetime_total:1e3}:ut}function dt(){const s=gs();return{...s,isNativeStore:!0,tiers:Object.fromEntries(U.map(n=>[n,{...s.tiers[n],monthly:null,yearly:null,monthly_eq:null,monthly_available:!1,yearly_available:!1,availability:{monthly:!1,yearly:!1},addon_monthly_seats:[],addon_yearly_seats:[],addon_monthly:null,addon_yearly:null}])),lifetime:null,lifetime_regular:null,lifetime_available:null}}export{ut as DEFAULT_PRICING,yt as default,gs as getInitialDefaultPricing,dt as getInitialNativePricing};
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.