import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Mi as a,ki as t}from"./vendor-frame-CwiylG4Y.js";import{fo as s}from"./shared-6-Cf_fMhRZ.js";import{nn as i,rn as r}from"./vendor-all-2-BJdkbLSj.js";var l=e(a()),o={clay:"#dd8164",sky:"#77a3cf",olive:"#839569",fig:"#c8728f",coral:"#efd9d9",cactus:"#cbdcd5",heather:"#d7d6e1"},n=["coral","cactus","heather"];function d(e){return n.includes(e)}var c=[{tier:"pro",name:"Pro",descriptionId:"gift.plan.pro.description",descriptionDefault:"For the curious"},{tier:"max_5x",name:"Max 5x",descriptionId:"gift.plan.max5x.description",descriptionDefault:"For the enthusiast"},{tier:"max_20x",name:"Max 20x",descriptionId:"gift.plan.max20x.description",descriptionDefault:"For the power user"}],m=[{months:1,labelId:"gift.duration.1month",labelDefault:"1 month"},{months:3,labelId:"gift.duration.3months",labelDefault:"3 months"},{months:6,labelId:"gift.duration.6months",labelDefault:"6 months"},{months:12,labelId:"gift.duration.1year",labelDefault:"1 year"}];function f(e,a){return 1===a?e.formatMessage({defaultMessage:"1 month",id:"p1dNdsvErg"}):12===a?e.formatMessage({defaultMessage:"1 year",id:"rwIPgHMeIl"}):e.formatMessage({defaultMessage:"{count} months",id:"TVtPcia8AQ"},{count:a})}function u(e,a){return 1===a?e.formatMessage({defaultMessage:"A month",id:"YtUcA+BM6Q"}):12===a?e.formatMessage({defaultMessage:"A year",id:"rZ1RTSogBQ"}):e.formatMessage({defaultMessage:"{count} months",id:"TVtPcia8AQ"},{count:a})}var g=t();function h({tier:e,duration:a,cardColor:t,toName:n,giftMessage:m,showDetails:u=!1,variant:h="purchase",hideText:x=!1}){const p=r(),M=e?c.find(a=>a.tier===e)?.name??"":"",b=d(t),v=(0,l.useMemo)(()=>{if(!e||!a)return"";const t=f(p,a);return p.formatMessage({defaultMessage:"{duration} of Claude {tier}",id:"54MZG42xgX"},{duration:t,tier:M})},[e,a,M,p]);return(0,g.jsxs)("div",{className:"relative w-72",children:[(0,g.jsxs)("div",{className:"relative aspect-[3/2] rounded-2xl overflow-hidden shadow-lg ring-1 ring-inset ring-always-white/30",style:{backgroundColor:o[t]??o.clay},children:["redeem"!==h&&(0,g.jsx)("div",{className:"absolute inset-0 scale-110 translate-x-2",children:(0,g.jsx)(s,{src:"/images/gift/hatch-intersect.svg",alt:"",fill:!0,className:"object-cover "+(b?"opacity-25":"opacity-[0.08]")})}),(0,g.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[(0,g.jsx)(s,{src:"redeem"===h?"/images/gift/gift-receiving.gif":"/images/gift/gift-giving.gif",alt:"",width:"redeem"===h?180:120,height:"redeem"===h?135:90,className:"object-contain"}),!x&&(0,g.jsx)("div",{className:"text-center mt-1.5 "+(b?"text-always-black/80":"text-always-white"),children:e&&a?(0,g.jsx)("div",{className:"font-small-bold",children:v}):(0,g.jsx)("div",{className:"text-[10px] "+(b?"text-always-black/60":"text-always-white/60"),children:(0,g.jsx)(i,{defaultMessage:"Select a plan and duration",id:"9P55UNw+MA"})})})]})]}),u&&(n||m)&&(0,g.jsxs)("div",{className:"mt-4 rounded-xl bg-bg-100/50 border-[0.5px] border-border-300 p-4",children:[n&&(0,g.jsx)("div",{className:"font-small-bold text-text-100 mb-1",children:(0,g.jsx)(i,{defaultMessage:"To: {name}",id:"maMyHsXUNu",values:{name:n}})}),m&&(0,g.jsx)("p",{className:"font-small text-text-200",children:m})]})]})}export{f as a,c as i,o as n,u as o,m as r,d as s,h as t};