PageSourceSearch

https://cdn.buymeacoffee.com/static/prod/1052/build/assets/ChooseCurrency-CjK3g2rp.js

js buymeacoffee.com collected 2026-09-24 06:04:14 UTC 4,141 bytes, 1 lines download raw bytes

1import{a as e,i as t}from"./dist-DiEP1Qns.js";import{D as n,E as r,On as i,Zn as a,_ as o,b as s,bt as c,ct as l,mt as u,o as d,qt as f,tr as p,vn as m,y as h}from"./runtime-core.esm-bundler-BKdLzFmX.js";import{t as g}from"./appVariables-if8fQ3xE.js";import{t as _}from"./Modal-B-U8Tfwa.js";import{t as v}from"./Button-D-DnbTTq.js";import{i as y,r as b,t as x}from"./helper-D5ziWoUd.js";import{t as S}from"./DropDown-CvKtSNwl.js";import{t as C}from"./Arrow-BomPYjmh.js";import{t as w}from"./request-DiNf7PXB.js";var T={class:`mr-1`},E={"aria-modal":`true`,role:`menu`,class:`w-full block p-3 font-cr-regular overflow-auto choose-currency`},D=[`onClick`],O={class:`justify-between flex text-md p-2 text-black font-cr-regular hover:bg-dark/5 rounded-[10px] cursor-pointer`},k={"aria-hidden":`true`},A={key:0,class:`bg-dark/5 mx-1.5 h-[1px] my-1`},j={class:`mr-1`},M={key:0},N={class:`w-full block p-3 font-cr-regular h-[70dvh] overflow-y-auto`},P=[`onClick`],F={class:`justify-between flex text-md p-2 py-4 text-black font-cr-regular hover:bg-dark/5 rounded-[10px] cursor-pointer`},I={"aria-hidden":`true`},L={key:0,class:`bg-dark/5 mx-1.5 h-[1px] my-1`},R={__name:`ChooseCurrency`,props:[`fromPage`],setup(R){let z=m(`USD`),B=m(x.getCurrencySymbol(z.value)),V=m(Object.entries(b).map(([e,t])=>({name:t,code:e,symbol:y[e]}))),H=m(!1),U=m(!1),W=t({currency:`USD`});l(()=>{g.IsBrowser&&(W.currency=x.getCookieValue(`currency`),z.value=x.getCookieValue(`currency`),B.value=x.getCurrencySymbol(z.value))});let G=async t=>{z.value=t.code,x.deleteCookieByName(`currency`),g.IsBrowser&&x.setCookieValue(`currency`,t.code,`month`),window.axios.defaults.headers.common[`X-Currency`]=t.code,B.value=x.getCurrencySymbol(t.code),W.currency=t.code;let n=g.IsBrowser?x.getCookieValue(`cart-`+e().props.creator_data.data.project_id):``;if(n){let t={cart_id:n.cart_id,totalAmount:0,rewardIds:[],rewardsCount:0,details:[]};g.IsBrowser&&x.setCookieValue(`cart-`+e().props.creator_data.data.project_id,JSON.stringify(t))}let r=e().props.cart_id;r&&await w.recalculateCartAmounts(r).catch(()=>{}),window.location.reload()},K=e=>{H.value=e};return(e,t)=>(u(),s(d,null,[n(S,{class:`flex-shrink-0 xs:hidden`,align:R.fromPage==`donation-single`?`right`:`left`,onIsOpen:K,getDropdownCheck:!0,contentClasses:[R.fromPage==`footer`?`bottom-12 `:`top-10 `,` bg-white rounded shadow-dropdown-lg rounded-2xl xs:-translate-x-1/2 h-[420px] overflow-auto `],widthClass:`w-[280px]`},{trigger:f(()=>[n(v,{btnType:`white`,onClick:K,"aria-label":e.$t(`lang.a11y.choose_currency`,{currency:i(x).userCurrencyConvertedName()}),"aria-haspopup":`true`,"aria-expanded":H.value,class:a([[R.fromPage==`footer`?`mr-3`:`pl-4 !pr-1`],`flex items-center cursor-pointer font-cr-regular hover:bg-dark/5 px-3 py-1 rounded-full`])},{default:f(()=>[o(`span`,T,p(i(B)),1),r(p(i(z))+` `,1),n(C,{fillClass:`fill-dark`,width:30,height:30,class:a([`flex-shrink-0 transform duration-200 mt-0.5`,R.fromPage==`footer`?H.value?`rotate-90`:`-rotate-90`:H.value?`-rotate-90`:`rotate-90`])},null,8,[`class`])]),_:1},8,[`aria-label`,`aria-expanded`,`class`])]),content:f(()=>[o(`ul`,E,[(u(!0),s(d,null,c(i(V),(e,t)=>(u(),s(`li`,{key:t,onClick:t=>G(e),role:`button`},[o(`div`,O,[o(`span`,null,p(e.name),1),o(`span`,k,p(e.symbol),1)]),t===2?(u(),s(`div`,A)):h(``,!0)],8,D))),128))])]),_:1},8,[`align`,`contentClasses`]),n(v,{btnType:`white`,onClick:t[0]||=e=>U.value=!0,class:`hidden xs:flex items-center cursor-pointer font-cr-regular hover:bg-dark/5 px-3 py-1 rounded-full`},{default:f(()=>[o(`span`,j,p(i(B)),1),r(p(i(z))+` `,1),n(C,{fillClass:`fill-dark`,width:30,height:30,class:a([`transform duration-200 mt-0.5`,R.fromPage==`footer`?U.value?`rotate-90`:`-rotate-90`:U.value?`-rotate-90`:`rotate-90`])},null,8,[`class`])]),_:1}),U.value?(u(),s(`div`,M,[n(_,{"modal-class":`bg-white rounded-t-2xl top-blur-shadow`,onClose:t[1]||=e=>U.value=!1},{default:f(()=>[o(`ul`,N,[(u(!0),s(d,null,c(i(V),(e,t)=>(u(),s(`li`,{key:t,role:`button`,onClick:t=>G(e)},[o(`div`,F,[o(`span`,null,p(e.name),1),o(`span`,I,p(e.symbol),1)]),t===2?(u(),s(`div`,L)):h(``,!0)],8,P))),128))])]),_:1})])):h(``,!0)],64))}};export{R as t};

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.