import{n as e}from"./chunk-B3pr0VN8.js";import{o as t}from"./billingCopy-19NcY4pu.js";var n=e({CUSTOM_RECHARGE_CENTS_PER_POINT:()=>100,DEFAULT_CUSTOM_RECHARGE_YUAN:()=>``,MIN_CUSTOM_RECHARGE_CENTS:()=>500,MIN_CUSTOM_RECHARGE_YUAN:()=>5,POINTS_PER_YUAN:()=>1,POINT_CENTS:()=>100,buildPointsPayUrl:()=>f,getCustomPointsFromAmountCents:()=>s,getPointPackage:()=>u,listPointPackages:()=>l,sanitizeRechargeYuanInput:()=>o,suggestBetterPackage:()=>d}),r=500,i=500/100,a=``,o=e=>String(e||``).replace(/\D/g,``),s=e=>{let t=Math.max(0,Math.floor(Number(e||0)));return Math.max(0,Math.floor(t/100))},c=[{id:`p10`,name:`¥9`,title:`￥9`,amountCents:900,points:10,originalPoints:9,note:`少量体验`,summary:`充 ¥9 到账 10 积分（送 1）`},{id:`p30`,name:`¥19`,title:`￥19`,amountCents:1900,points:30,originalPoints:19,note:`日常划算`,summary:`充 ¥19 到账 30 积分（送 11，主推）`},{id:`custom`,name:`自由包`,title:`自定义`,amountCents:0,points:0,note:`按需充值`,summary:`5 元起充，1 元 = 1 积分，整数元`}],l=()=>c.slice(),u=e=>c.find(t=>t.id===String(e||``).trim().toLowerCase())||null,d=e=>{let t=Math.max(0,Math.floor(Number(e||0)));if(t<=0)return null;let n=s(t),r=c.filter(e=>e.id!==`custom`).slice().sort((e,t)=>t.amountCents-e.amountCents);for(let e of r)if(e.amountCents<=t&&e.points>n)return e;return null},f=e=>{let n=u(e?.packageId),r=t(n?{packageId:n.id}:void 0);if(!e?.absolute)return r;try{let e=String(globalThis?.location?.protocol||``);return`${(e===`chrome-extension:`||e===`moz-extension:`?`https://bysjob.com`:String(globalThis?.location?.origin||``).replace(/\/+$/g,``))||`https://bysjob.com`}${r}`}catch{return`https://bysjob.com${r}`}};export{l as a,d as c,s as i,r as n,n as o,i as r,o as s,a as t};