PageSourceSearch

https://babylonbee.com/build/assets/CustomAmountPicker-DfpVO9ZH.js

js babylonbee.com collected 2026-09-24 08:29:16 UTC 5,778 bytes, 1 lines download raw bytes

1import{_ as c,e as a}from"./_plugin-vue_export-helper-CZPp-EVN.js";import{j as s,q as l,C as b,D as r,x as n,J as i,y as d,H as y}from"./vendor-vue-n3skSn-P.js";const p={props:{current_term:String,is_subscription_page:{type:Boolean,default:!1}},created(){a.on("termChanged",m=>{this.term=m.term})},data(){return{term:this.current_term,amount:0,showInput:!1,custSetAmount:this.amount,amountError:""}},methods:{buttonUpdate(m){this.amount=m,this.is_subscription_page?a.emit("updatedAmount",m):(document.getElementById("cust_amount").value=m,this.$nextTick(()=>{var t=document.getElementById("upgradeSubmitButton");t&&t.removeAttribute("disabled")}))},toggleInput(){this.showInput=!this.showInput},clearCustomError(){this.amountError=""},customSet(){if(this.custSetAmount=this.custSetAmount.replace("$","").replace(/[,]/g,""),isNaN(this.custSetAmount))this.amountError="The amount you have entered is invalid.";else if(this.term=="Monthly"&&this.custSetAmount<20)this.amountError="The amount you have entered is too low for custom pledge. Please enter at least $20.",this.custSetAmount="";else if(this.term=="one-time"&&this.custSetAmount<10)this.amountError="The amount you have entered is too low for a contribution. Please enter at least $10.",this.custSetAmount="";else if(this.term!="Monthly"&&this.term!="one-time"&&this.custSetAmount<240)this.amountError="The amount you have entered is too low for annual custom pledge. Please enter at least $240.",this.custSetAmount="";else{const m=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2});this.custSetAmount=m.format(this.custSetAmount).replace("$","").replace(/[,]/g,""),this.amount=this.custSetAmount,this.is_subscription_page?a.emit("updatedAmount",this.amount):document.getElementById("cust_amount").value=this.custSetAmount}}}},h={key:0,class:"mb-3"},f={key:1,class:"grid grid-cols-2 sm:grid-cols-3 gap-x-2",id:"default-values"},g={key:0,class:"monthly-option mb-4 w-full"},v={key:1,class:"annual-option mb-4 w-full"},w={key:2,class:"monthly-option mb-4 w-full"},_={key:3,class:"monthly-option mb-4 w-full"},k={key:4,class:"monthly-option mb-4 w-full"},S={class:"mb-4 w-full"},A={class:"mb-4 w-full"},C={key:5,class:"annual-option mb-4 w-full"},E={key:6,class:"annual-option mb-4 w-full"},U={key:7,class:"annual-option mb-4 w-full"},x={class:"col-span-2 sm:col-span-3 mb-4"},I={key:2,id:"custom-values"},M={class:"mb-4"},B={key:0,id:"amountError",class:"text-red-600"},T={class:"mb-4"};function D(m,t,N,P,e,u){return s(),l("div",null,[e.term!="one-time"?(s(),l("h4",h,"Select "+b(e.term)+" Amount",1)):r("",!0),e.showInput?(s(),l("div",I,[n("div",M,[d(n("input",{type:"text",placeholder:"Enter your own amount",id:"cust_set_amount",class:"appearance-none flex-1 block w-full px-3 py-2 border border-gray-300 placeholder-gray-400 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out sm:text-sm sm:leading-5 rounded-md",onFocus:t[11]||(t[11]=o=>u.clearCustomError()),onBlur:t[12]||(t[12]=o=>u.customSet()),onChange:t[13]||(t[13]=o=>u.customSet()),"onUpdate:modelValue":t[14]||(t[14]=o=>e.custSetAmount=o)},null,544),[[y,e.custSetAmount]]),e.amountError?(s(),l("small",B,b(e.amountError),1)):r("",!0)]),n("div",T,[n("button",{type:"button",id:"default-button",class:"w-full btn-outline-gray",onClick:t[15]||(t[15]=o=>u.toggleInput())},"Cancel")])])):(s(),l("div",f,[e.term=="Monthly"||e.term=="one-time"?(s(),l("div",g,[n("button",{id:"cust_20",type:"button",class:i([[e.amount==20?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[0]||(t[0]=o=>u.buttonUpdate(20))},"$20",2)])):r("",!0),e.term!="Monthly"&&e.term!="one-time"?(s(),l("div",v,[n("button",{id:"cust_240",type:"button",class:i([[e.amount==240?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[1]||(t[1]=o=>u.buttonUpdate(240))},"$240",2)])):r("",!0),e.term=="Monthly"||e.term=="one-time"?(s(),l("div",w,[n("button",{id:"cust_25",type:"button",class:i([[e.amount==25?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[2]||(t[2]=o=>u.buttonUpdate(25))},"$25",2)])):r("",!0),e.term=="Monthly"||e.term=="one-time"?(s(),l("div",_,[n("button",{id:"cust_50",type:"button",class:i([[e.amount==50?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[3]||(t[3]=o=>u.buttonUpdate(50))},"$50",2)])):r("",!0),e.term=="Monthly"||e.term=="one-time"?(s(),l("div",k,[n("button",{id:"cust_100",type:"button",class:i([[e.amount==100?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[4]||(t[4]=o=>u.buttonUpdate(100))},"$100",2)])):r("",!0),n("div",S,[n("button",{id:"cust_250",type:"button",class:i([[e.amount==250?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[5]||(t[5]=o=>u.buttonUpdate(250))},"$250",2)]),n("div",A,[n("button",{id:"cust_500",type:"button",class:i([[e.amount==500?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[6]||(t[6]=o=>u.buttonUpdate(500))},"$500",2)]),e.term!="Monthly"&&e.term!="one-time"?(s(),l("div",C,[n("button",{id:"cust_1000",type:"button",class:i([[e.amount==1e3?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[7]||(t[7]=o=>u.buttonUpdate(1e3))},"$1000",2)])):r("",!0),e.term!="Monthly"&&e.term!="one-time"?(s(),l("div",E,[n("button",{id:"cust_2500",type:"button",class:i([[e.amount==2500?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[8]||(t[8]=o=>u.buttonUpdate(2500))},"$2500",2)])):r("",!0),e.term!="Monthly"&&e.term!="one-time"?(s(),l("div",U,[n("button",{id:"cust_5000",type:"button",class:i([[e.amount==5e3?"btn-gray":"btn-outline-gray"],"w-full"]),onClick:t[9]||(t[9]=o=>u.buttonUpdate(5e3))},"$5000",2)])):r("",!0),n("div",x,[n("button",{type:"button",id:"custom-button",class:"btn-outline-gray w-full",onClick:t[10
1]||(t[10]=o=>u.toggleInput())},"Enter Custom Amount")])]))])}const j=c(p,[["render",D]]);export{j as default};

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.