PageSourceSearch

https://oeneo.ai/assets/customer-portal-button-B1kmK7Nc.js

js oeneo.ai collected 2026-10-05 16:12:04 UTC 5,248 bytes, 1 lines download raw bytes

1import{Mk as v,Ml as m,Mm as L,Mn as u,Mo as r,Mp as S,Mq as E,Mr as T,Ms as A,Mt as D,Mu as R,Mv as B,Mw as F,Mx as G,My as U,Mz as z,MA as K,MB as O,MC as k,MD as V,ME as Y,MF as H,MG as Q,MH as q,MI as J,MJ as W,MK as X,ML as Z,MM as $,MN as ee,MO as ie,MP as se,ai as re,r as C,m as i,Gy as ae,Gz as te,GA as ne,MQ as le,GD as ce,MR as oe,MS as de,MT as me,MU as ue,a3 as g,MV as x,M3 as y,O as _e,R as pe,mS as N,a5 as ge,LQ as b,MW as fe,mU as h,MX as M}from"./main-BVeaUmEJ.js";import{f as p,a as xe,c as ye,b as be}from"./billing-model-uylJWD-X.js";function he(e){return[{type:"subscription",priceId:e.pricing.monthly.priceId,amount:e.pricing.monthly.amount,currency:e.pricing.monthly.currency,interval:"month",creditsPerPeriod:e.pricing.monthly.creditsPerPeriod,trialPeriodDays:e.pricing.monthly.trialPeriodDays,allowPromotionCode:e.pricing.monthly.allowPromotionCode,disabled:!u||e.pricing.monthly.disabled},...e.pricing.yearly?[{type:"subscription",priceId:e.pricing.yearly.priceId,amount:e.pricing.yearly.amount,currency:e.pricing.yearly.currency,interval:"year",creditsPerPeriod:e.pricing.yearly.creditsPerPeriod,trialPeriodDays:e.pricing.yearly.trialPeriodDays,allowPromotionCode:e.pricing.yearly.allowPromotionCode,disabled:!u||e.pricing.yearly.disabled}]:[]]}function Me(){const e=!u||!0;return[{id:v.id,prices:[],isFree:!0,isLifetime:!1},...L.map(s=>({id:s.id,prices:he(s),isFree:!1,isLifetime:!1,popular:s.popular,disabled:s.discontinued})),{id:m.id,prices:[{type:"one_time",priceId:m.priceId,amount:m.amount,currency:m.currency,allowPromotionCode:m.allowPromotionCode,disabled:e}],isFree:!1,isLifetime:!0,disabled:e}]}const P={free:0,basic:1,plus:2,pro:3,lifetime:4};function ve(e,s){return(P[e]??-1)-(P[s]??-1)}const Pe={free:{name:()=>W(),description:()=>J(),features:()=>[Q({count:re}),...r(q())],limits:()=>r(H())},basic:{name:()=>Y(),description:()=>V(),features:()=>r(k()),limits:()=>r(O())},plus:{name:()=>K(),description:()=>z(),features:()=>r(U()),limits:()=>r(G())},pro:{name:()=>F(),description:()=>B(),features:()=>r(R()),limits:()=>r(D())},lifetime:{name:()=>A(),description:()=>T(),features:()=>r(E()),limits:()=>r(S())}};function Le(){return Me().map(e=>{const s=Pe[e.id];return{...e,name:s?.name()??e.id,description:s?.description()??"",features:s?.features()??[],limits:s?.limits()??[]}})}const I={starter:{name:()=>se(),tagline:()=>ie()},creator:{name:()=>ee(),tagline:()=>$()},studio:{name:()=>Z(),tagline:()=>X()}};function Ce(e){return I[e]?.name()??e}function Ne(e){return I[e]?.tagline()??""}function Ie(e){if(b.length===0)return 0;const s=b.reduce((a,t)=>t.amount/t.credits<a.amount/a.credits?t:a);if(e.credits<=s.credits)return 0;const n=e.amount/e.credits,c=s.amount/s.credits;return Math.round((1-n/c)*100)}function Se({pack:e,cancelUrl:s,isAuthenticated:n=!0,onCheckout:c,quantity:a=1,successUrl:t}){const[o,_]=C.useTransition(),l=!!e.priceId.trim(),d=u&&!e.disabled&&l,f=Ie(e),j=()=>{!d||!n||(c?.(),_(async()=>{const w=await ye({data:{planId:e.id,priceId:e.priceId,quantity:a,successUrl:t,cancelUrl:s,metadata:{checkoutKind:"credit_pack",packId:e.id,quantity:String(a)}}});window.location.href=w.url}))};return i.jsxs(ae,{className:ge("flex min-h-64 flex-col shadow-sm transition-all duration-300 motion-safe:hover:-translate-y-1 hover:shadow-lg",e.bestValue&&"border-accent-emerald/50"),children:[i.jsx(te,{children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx(ne,{children:Ce(e.id)}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:Ne(e.id)})]}),e.bestValue?i.jsx("span",{className:"inline-flex shrink-0 items-center rounded-md bg-accent-emerald px-2 py-1 text-xs font-bold text-white",children:le()}):null]})}),i.jsxs(ce,{className:"mt-auto flex flex-col gap-3",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-3xl font-semibold tabular-nums",children:p(e.credits)}),i.jsx("div",{className:"text-sm text-muted-foreground",children:oe()})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xl font-semibold text-primary",children:xe(e.amount,e.currency)}),i.jsx("div",{className:"text-xs text-muted-foreground",children:de()})]}),f>0?i.jsx("span",{className:"inline-flex w-fit items-center rounded-md bg-accent-emerald-bg px-2 py-0.5 text-xs font-semibold text-accent-emerald",children:me({percent:String(f)})}):null,i.jsx("p",{className:"text-xs text-muted-foreground",children:ue({count:e.validDays}
1)}),n?i.jsxs(g,{className:"w-full",onClick:j,disabled:o||!d,children:[o?i.jsx(N,{className:"size-4 animate-spin"}):null,d?x({count:p(e.credits)}):y()]}):i.jsx(g,{className:"w-full",disabled:!d,render:i.jsx(_e,{to:pe.Login}),children:d?x({count:p(e.credits)}):y()})]})]})}function Ee({returnUrl:e,variant:s="default",size:n="default",className:c,children:a}){const[t,o]=C.useState(!1),_=async()=>{try{o(!0);const l=await be({data:{returnUrl:e}});l?.url?window.location.href=l.url:h.error(M())}catch(l){console.error("Customer portal error:",l),h.error(M())}finally{o(!1)}};return i.jsx(g,{variant:s,size:n,className:c,onClick:_,disabled:t,children:t?i.jsxs(i.Fragment,{children:[i.jsx(N,{className:"mr-2 size-4 animate-spin"}),fe()]}):a})}export{Se as C,Ee as a,ve as c,Le as g};

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.