PageSourceSearch

https://cdn.buymeacoffee.com/static/prod/1070/build/assets/OneTimePaymentWidget-BGm6KVru.js

js buymeacoffee.com collected 2026-10-01 06:30:57 UTC 7,437 bytes, 1 lines download raw bytes

1import{E as e}from"./dist-DiEP1Qns.js";import{D as t,E as n,Ht as r,On as i,Yt as a,Zn as o,_ as s,b as c,er as l,mt as u,o as d,tr as f,un as p,v as m,vn as h,y as g}from"./runtime-core.esm-bundler-BKdLzFmX.js";import{t as _}from"./helper-D5ziWoUd.js";import{t as v}from"./Tooltip-CJuxS1sj.js";import{n as y,r as b,t as x}from"./OnetimeWidgetTitle-BJu7pkoW.js";var S=[`aria-label`],C={class:`text-grey71`},w={key:0,class:`animate-pulse w-full`},T=[`aria-label`],E={class:`z-10 goalWrapper`},D=[`max`,`step`],O={class:`-mt-[7px] relative`},k=[`aria-label`],A={"aria-hidden":`true`,class:`mt-2 w-full h-[7px] bg-[#E6F5EF] goalShadow overflow-x-auto relative rounded-lg shadow-lg`},j={class:`-mt-[7px] relative`},M={class:`mt-4 leading-6 tw-break-word`},N=[`innerHTML`],P={__name:`GoalV2Section`,props:[`creatorData`,`currentUser`,`goal`,`showDemoForAmt`,`isV3WidgetEnabled`,`widgetLoader`],emits:[`setAmtAccToGoal`],setup(m,{emit:g}){let y=m,x=g;_.getExchangeRate();let P=_.widgetType()==b.SUGGESTED_AMOUNT&&!y.isV3WidgetEnabled?`suggested`:`coffee`,F=y.goal.goal_counter_converted,I=y.goal.goal_amount_converted,L=Math.round(Math.round(F)/Math.round(I)*100),R=0,z=L+R;h(!0);let B=h(!1),V=h(``),H=h(Math.round(F)),U=Math.round(H.value/Math.round(I)*100),W=h(0),G=h(0),K=h(0);V.value=`linear-gradient(to right, #038748 0%, #038748 ${Math.round(L)>100?100:Math.round(L)}%, #E6F5EF ${Math.round(L)>100?100:Math.round(L)}%, #E6F5EF 100%)`;let q=e=>{U=Math.round(H.value/Math.round(I)*100),U<L&&(U=L,H.value=Math.round(U*Math.round(I)/100)),W.value=H.value-Math.round(F),x(`setAmtAccToGoal`,W.value),G.value=W.value,K.value=L+(U-L)/2};r(()=>y.showDemoForAmt,e=>{e==0?B.value=!1:B.value=!0,z=Math.round(F+e)/I*100,R=e>0?z-L:0,H.value=Math.round(F)+e,U=Math.round(H.value/Math.round(I)*100),G.value=e,K.value=L+R/2}),r(()=>y.isV3WidgetEnabled,e=>{P=_.widgetType()==b.SUGGESTED_AMOUNT&&!e?`suggested`:`coffee`});let J=e=>{let t=e==`slider`?`16`:`24`;return{left:L>=100||L>40?`auto`:z<100?K.value<1?`-13px`:`calc(`+K.value+`% - `+t+`px)`:`calc(`+((100-L)/2+L)+`% - `+t+`px)`,right:L>=100?`-8px`:z>100?`calc(`+(100-L)/2+`% - `+t+`px)`:L>40?`calc(`+(100-K.value)+`% - `+t+`px)`:`auto`}};return(r,h)=>(u(),c(d,null,[s(`p`,{class:`text-xl text-dark font-cr-book mt-4`,role:`text`,"aria-label":i(_).numberFormat(i(F))+i(_).userCurrencyConvertedName()+r.$t(`lang.payment.onetime.raised_of`)+` `+i(_).numberFormat(i(I))+i(_).userCurrencyConvertedName()},[n(f(i(_).userCurrencyConverted()+i(_).numberFormat(i(F)))+` `,1),s(`span`,C,f(r.$t(`lang.payment.onetime.raised_of`)),1),n(` `+f(i(_).userCurrencyConverted()+i(_).numberFormat(i(I))),1)],8,S),m.widgetLoader?(u(),c(`div`,w,[...h[1]||=[s(`div`,{class:`mt-2 -mb-1.5`},[s(`div`,{class:`h-[7px] bg-greyF0 rounded-xl w-full`})],-1)]])):(u(),c(d,{key:1},[i(P)==`suggested`?(u(),c(d,{key:0},[s(`div`,{role:`progressbar`,"aria-label":r.$t(`lang.a11y.fund_progress`,{percentage:i(U)>100?100:i(U)}),class:`relative mt-2`},[s(`div`,E,[a(s(`input`,{type:`range`,max:Math.round(i(I)),step:i(P)==`suggested`?1:i(_).roundToMultipleOfFive(m.creatorData.coffee_price_converted),min:`0`,"onUpdate:modelValue":h[0]||=e=>p(H)?H.value=e:H=e,onInput:q,style:l({background:i(V)}),class:`slider w-full h-[7px] bg-[#E6F5EF] goalShadow shadow-lg transition-all`},null,44,D),[[e,i(H)]])]),s(`div`,{class:`h-[7px] absolute left-0 top-[11px]`,style:l([{"background-image":`linear-gradient(135deg, rgba(255, 255, 255, .5) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .5) 50%, rgba(255, 255, 255, .5) 75%, transparent 75%, transparent)`,"-webkit-background-size":`10px 10px`,"background-size":`10px 10px`,"background-color":`rgba(3, 135, 72, 0.8)`,"z-index":`1`},{width:i(U)>100?100-Math.round(i(L))+`%`:i(U)-i(L)<0?0:i(U)-i(L)+`%`,left:Math.round(i(L))+`%`}])},null,4)],8,T),s(`div`,O,[t(v,{class:o([[i(B)?`!visible !translate-y-0 !opacity-100`:``,i(L)<=40?`before:right-auto before-left-4`:i(L)>=100?`before:right-2 before-left-auto`:`before:right-4 before:left-auto`],`!text-[14px] !rounded py-2 !px-2 top-3 bottom-auto right-auto transition-all duration-200 ease-in min-w-[155px]`]),style:l(J(`slider`)),tooltipText:`<b>`+i(_).userCurrencyConverted()+m.showDemoForAmt+`</b> <span class=text-white/70>(`+i(_).numberFormatWithdecimals(i(z),`max`,2)+`% of the goal)</span>`,position:`bottom`},null,8,[`class`,`style`,`tooltipText`])])],64)):(u(),c(d,{key:1},[s(`div`,{class:`relative`,role:`progressbar`,"aria-label":r.$t(`lang.a11y.fund_progress`,{percentage:i(z)>100?100:i(z)})},[s(`div`,A,[s(`div`,{style:l({width:i(L)>100?100:i(L)+`%`}),class:`absolute left-0 inset-0 bg-[#038748] animate-scroll roun
1ded-tl-lg rounded-bl-lg`},null,4),s(`div`,{class:`absolute inset-0 bg-[#0387484d] transition-all`,style:l({width:i(z)>100?`100%`:i(z)+`%`})},null,4)])],8,k),s(`div`,j,[t(v,{class:o([[i(B)?`!visible !translate-y-0 !opacity-100`:``,i(L)<=40?`before:right-auto before-left-4`:i(L)>=100?`before:right-2 before-left-auto`:`before:right-4 before:left-auto`],`!text-[14px] py-2 !px-2 top-3 bottom-auto right-auto transition-all duration-200 ease-in min-w-[155px]`]),style:l(J(`progressBar`)),tooltipText:`<b>`+i(_).userCurrencyConverted()+m.showDemoForAmt+`</b> <span class=text-white/70>(`+i(_).numberFormatWithdecimals(i(z),`max`,2)+`% of the goal)</span>`,position:`bottom`},null,8,[`class`,`style`,`tooltipText`])])],64))],64)),s(`p`,M,[s(`span`,{class:`goalDesc text-md text-dark font-cr-book`,innerHTML:i(_).linkify(i(_).sanitizeHtml(m.goal.goal_description))},null,8,N)])],64))}},F=[`aria-label`],I={__name:`OneTimePaymentWidget`,props:[`creatorData`,`currentUser`,`fromPage`,`goal`,`recordedVideoData`],emits:[`openOnetimePaymentModal`,`toggleVideoRecorderModal`,`removeVideo`,`openVideoPlayModal`,`chosenMonthlySupport`],setup(e,{emit:n}){let r=e,a=n,o=h(`first`),s=h({}),l=h(0),d=h(0),f=h(!1),p=h(!!(r.creatorData.data.feature_flags.hasOwnProperty(`ab_testing_v3_widget`)&&_.widgetType()===b.COFFEE_COUNT)),v=e=>{s.value=e,s.value.payment_source=r.fromPage==`embed_widget`?`widget`:`native`,a(`openOnetimePaymentModal`,s.value)},S=e=>{a(`toggleVideoRecorderModal`,e)},C=()=>{a(`removeVideo`,``)},w=e=>{a(`chosenMonthlySupport`,e)},T=e=>{let t={thumbnail:e?_.getUrlWithCdnPath(e.thumbnail_path):URL.createObjectURL(r.recordedVideoData.thumbnail_data)},n=e?_.getUrlWithCdnPath(e.video_path):URL.createObjectURL(r.recordedVideoData.video_data);a(`openVideoPlayModal`,n,t,!0)},E=e=>{l.value=Number(e)},D=e=>{d.value=e},O=(e,t)=>{f.value=e,p.value=t};return(n,r)=>(u(),c(`div`,{tabindex:`0`,role:`region`,"aria-label":`${n.$t(`lang.common.support_action`)} ${e.creatorData.data.name}`},[t(x,{creatorData:e.creatorData.data,fromPage:e.fromPage,isV3WidgetEnabled:i(f)},null,8,[`creatorData`,`fromPage`,`isV3WidgetEnabled`]),e.goal&&e.goal.data.goal_type==`onetime_v2`?(u(),m(P,{key:0,goal:e.goal.data,creatorData:e.creatorData.data,showDemoForAmt:i(l),isV3WidgetEnabled:i(f),widgetLoader:i(p),onSetAmtAccToGoal:D},null,8,[`goal`,`creatorData`,`showDemoForAmt`,`isV3WidgetEnabled`,`widgetLoader`])):g(``,!0),i(o)===`first`?(u(),m(y,{key:1,creatorData:e.creatorData.data,fromPage:e.fromPage,amountAccToGoal:i(d),recordedVideoData:e.recordedVideoData,onMonthlySupport:w,onRemoveVideo:C,onOpenVideoPlayModal:T,onToggleVideoRecorderModal:S,onTriggerPaymentSecondStep:v,onSetPayingAmount:E,onV3WidgetEnabledBool:O},null,8,[`creatorData`,`fromPage`,`amountAccToGoal`,`recordedVideoData`])):g(``,!0)],8,F))}};export{I 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.