PageSourceSearch

https://order.flockandfresh.com/_nuxt/payment-methods.5272fccd.js

js flockandfresh.com collected 2026-09-24 11:04:42 UTC 15,390 bytes, 1 lines download raw bytes

1import{B as k,D as G,E as B,F as U,H as K,K as F,L as H,bQ as V,aO as Q,aw as O,M as j,cj as q,f1 as y,f3 as J,a$ as o,fd as c,ad as E,fa as W,fe as z,e as Z,C as X,Y as x,al as ee,b8 as te,m as oe,a_ as ae,Z as se,_ as ne,g as u,o as h,p as _,c as g,w as A,q as $,t as D,a4 as b,s as R,k as v,b0 as re,ao as ie,n as de,h as P}from"./entry.9960d543.js";import{C as le}from"./ConfirmationDialog.c35e4eb8.js";import{A as me}from"./AppPageLayout.73bf2e03.js";import{a as he,d as ce,e as pe}from"./accessibility.48ca87a0.js";import{P as ue}from"./PaymentsModal.1f488dc4.js";import{C as ye}from"./CancelIcon.26b37601.js";import"./Confirmation.9b59037e.js";import"./facebook-login.5506e481.js";import"./useGenericModal.23c24c5d.js";import"./useGlobals.35e7b76d.js";var ge=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,d=(e,t,a,s)=>{for(var r=s>1?void 0:s?Pe(t,a):t,m=e.length-1,n;m>=0;m--)(n=e[m])&&(r=(s?n(t,a,r):n(r))||r);return s&&r&&ge(t,a,r),r};const N=k(G),p=k(B),Me=k(U),_e=k(K);let i=class extends F(H){constructor(){super(...arguments),this.backUrl=null,this.paymentsModal=!1,this.isLoading=!1,this.removeModal=!1,this.currentMethodIndex=null,this.elOpenedInModal=null,this.paymentMethodStatusMessage="",this.getCreditCardName=V,this.deleteConfirmationOptions={},this.returnFocusToElementViaDomQuery=he,this.assignStatusRoleToEl=ce,this.assignStatusMessageToStateProperty=pe,this.getRouteName=Q,this.isMobile=O.isMobile,this.headBar=j()}get hasApplicationKey(){var e;return!!((e=this.applicationKey)!=null&&e.length)}get customerPaymentMethods(){return this.storedPaymentMethods}get availablePaymentMethods(){return this.getRouteName(this.$route.name)===q.venueVenueIdCheckout&&this.venue&&this.venue.available_payment_methods.length>0?this.venue.available_payment_methods:this.brandPaymentMethods}get isTransbankPaymentProcessor(){var e;return(e=this.paymentProcessorTokens)==null?void 0:e.some(t=>t.payment_processor_type_id===y.TRANSBANK_ID)}get isCybersourceProcessor(){var e;return(e=this.paymentProcessorTokens)==null?void 0:e.some(t=>t.payment_processor_type_id===y.CYBERSOURCE_ID)}get isAurusParPayProcessorForCardsOrGiftCards(){var e;return(e=this.brandPaymentProcessors)==null?void 0:e.some(t=>t.type_id===y.AURUS_PAR_PAY_ID||t.type_id===y.GIFT_CARDS)}get isMenuPayPaymentProcessor(){var e;return(e=this.brandPaymentProcessors)==null?void 0:e.some(t=>t.type_id===y.MENU_PAY)}get isMenuPayIntegrationCardStoringSupported(){var a;const e=this.brandPaymentProcessors.find(s=>s.type_id===y.MENU_PAY),t=((a=e==null?void 0:e.properties)==null?void 0:a.supports_card_tokenization)||!1;return e&&t}get isParWalletPaymentProcessor(){var e;return(e=this.brandPaymentProcessors)==null?void 0:e.some(t=>t.type_id===y.PAR_WALLET_ID)}get alternativePaymentMethods(){return J(this.brandPaymentMethods)}get showSectionForAddingPaymentMethod(){return this.isMenuPayPaymentProcessor?this.isMenuPayIntegrationCardStoringSupported||this.alternativePaymentMethods.length!==0:!0}get pageTitle(){return this.getBrandName?`${this.$i18n.t("payment_methods_title")} - ${this.getBrandName}`:this.$i18n.t("payment_methods_title")}watchCustomerPaymentMethods(e,t){e!==t&&this.assignStatusMessageToStateProperty({statePropName:"paymentMethodStatusMessage",message:`${this.$i18n.t("number_of_payment_methods")} : ${this.customerPaymentMethods.length}`})}handleConfirmationActions(e){e==="cancel"?(this.cancelRemoveModal(),this.returnFocusToElement()):e==="delete"&&this.deletePaymentMethod()}async openPaymentsModal(){if(!Array.from(document.querySelectorAll("script")).find(t=>t.src.includes("spreedly"))){const t=document.createElement("script");t.src="https://core.spreedly.com/iframe/iframe-v1.min.js",document.head.append(t)}this.sendScreenViewEvent("Payment Method Types"),this.paymentsModal=!0}showRemoveModal(e){this.elOpenedInModal=document.activeElement,this.currentMethodIndex=e,this.removeModal=!0,this.sendCustomEvent("Dialog","Other",{sourcePage:"Payment Methods",details:{"Dialog Name":"Remove Payment Method","Error Code":""}}),this.currentMethod=this.customerPaymentMethods[e]}cancelRemoveModal(){this.removeModal=!1,this.currentMethod=null}async deletePaymentMethod(){var a;this.handleReturnFocusOnItemRemoval(!!this.customerPaymentMethods.length,this.currentMethodIndex,"#payment-modal-opener");const{payment_method_id:e,id:t}=this.currentMethod;switch(this.cancelRemoveModal(),this.sendCustomEvent("Delete Payment Method","Other",{linkLocation:"Delete Button",sourcePage:"Payment Methods",details:{"Payment Method Type":this.getCredit
1CardName(e).toUpperCase()}}),this.isLoading=!0,e){case o.PAYPAL_ID:{c("paypalMethod","remove");break}case o.MERCADO_PAGO_ID:{c("mercadopagoMethod","remove");break}case o.APPLEPAY:{c("applepayMethod","remove");break}case o.GOOGLEPAY:{c("googlepayMethod","remove");break}case o.CASH_ID:{c("cashMethod","remove");break}case o.IDEAL_ID:{c("idealMethod","remove");break}case o.GCASH:{c("gcashMethod","remove");break}case o.PAYSTACK_BANK_ID:case o.PAYSTACK_TRANSFER_ID:case o.PAYSTACK_USSD_ID:case o.PAYSTACK_VISA_QR_ID:{const r=c("paystack","get").find(m=>m.payment_method_id===e);c(r.methodName,"remove");break}case o.PAYMAYA_ID:{c("paymayaMethod","remove");break}}try{e!==o.MERCADO_PAGO_ID&&e!==o.PAYPAL_ID&&e!==o.APPLEPAY&&e!==o.GCASH&&e!==o.CASH_ID&&e!==o.PAYSTACK_BANK_ID&&e!==o.PAYSTACK_TRANSFER_ID&&e!==o.PAYSTACK_USSD_ID&&e!==o.PAYSTACK_VISA_QR_ID&&e!==o.PAYMAYA_ID&&e!==o.IDEAL_ID&&e!==o.GOOGLEPAY&&await this.deleteCustomerPaymentMethod({storedMethodId:t}),this.sendCustomEvent("Delete Payment Method Success","Other",{sourcePage:"Payment Methods",details:{"Payment Method Type":this.getCreditCardName(e).toUpperCase()}});const s=await this.fetchCustomerPaymentMethods();s.length&&this.selectNextPaymentMethodAfterDeletion(s),(!this.isMenuPayPaymentProcessor||this.isMenuPayIntegrationCardStoringSupported||this.isParWalletPaymentProcessor)&&await this.callGenerateTokens(),await this.fetchCustomerPaymentMethods()}catch(s){console.log("deletePaymentMethod error",s),this.setGenericModalData({...E({title:this.$i18n.t("generic_error"),text:this.$i18n.t("generic_message")},s),errorMessage:(a=s==null?void 0:s.data)==null?void 0:a.error_id}),await this.callGenerateTokens()}finally{this.isLoading=!1}}async callGenerateTokens(){var t;let e=null;if(this.isTransbankPaymentProcessor){const a=this.$route.fullPath;localStorage.setItem("tbk_redirect_url",a),e={key:"return_url",url:`${window.origin}/payment-method-success/?pp-id=${y.TRANSBANK_ID}`}}try{await this.generateTokens(e)}catch(a){if(console.log(" generateTokens error",a),this.isAurusParPayProcessorForCardsOrGiftCards||this.isParWalletPaymentProcessor){const s=W({error:a,title:this.$i18n.t("generic_error"),fallbackMessage:this.$i18n.t("generic_message")});this.setGenericModalData({...E(s,a),errorMessage:s.errorMessage});return}this.setGenericModalData({...E({title:this.$i18n.t("generic_error"),text:this.$i18n.t("generic_message")},a),errorMessage:(t=a==null?void 0:a.data)==null?void 0:t.error_id})}}getPlatformInfo(e){var t;return(t=this.brandPaymentMethods)==null?void 0:t.find(({payment_method_id:a})=>a===e)}selectNextPaymentMethodAfterDeletion(e){var r,m;const t=(r=e[0])==null?void 0:r.payment_method_id;let a=null,s=null;switch(t){case o.PAYPAL_ID:{s="paypalMethod",a=this.getPlatformInfo(o.PAYPAL_ID);break}case o.APPLEPAY:{s="applepayMethod",a=this.getPlatformInfo(o.APPLEPAY);break}case o.GOOGLEPAY:{s="googlepayMethod",a=this.getPlatformInfo(o.GOOGLEPAY);break}case o.GCASH:{s="gcashMethod",a=this.getPlatformInfo(o.GCASH);break}case o.MERCADO_PAGO_ID:{s="mercadopagoMethod",a=this.getPlatformInfo(o.MERCADO_PAGO_ID);break}case o.CASH_ID:{s="cashMethod",a=this.getPlatformInfo(o.CASH_ID);break}case[o.PAYSTACK_BANK_ID,o.PAYSTACK_TRANSFER_ID,o.PAYSTACK_USSD_ID,o.PAYSTACK_VISA_QR_ID].find(n=>n===t):{s=`${(m=e[0])==null?void 0:m.payment_method_brand.toLowerCase().replace(" ","")}Method`,a=this.getPlatformInfo(t);break}case o.PAYMAYA_ID:{s="paymayaMethod",a=this.getPlatformInfo(o.PAYMAYA_ID);break}}a&&s&&z(s,a,this.customer.customer_id)}closePaymentsModal(){this.paymentsModal=!1,this.returnFocusToElementViaDomQuery("#payment-modal-opener")}returnFocusToElement(e=this.elOpenedInModal){this.$nextTick(()=>setTimeout(()=>e.focus(),500))}handleReturnFocusOnItemRemoval(e,t,a){e?this.returnFocusToElement(this.getPreviousSiblingOfRemovedItem(".payment-methods-content","button",t)):this.returnFocusToElementViaDomQuery(a)}getPreviousSiblingOfRemovedItem(e,t,a){const s=document.querySelector(e);return Array.from(s.querySelectorAll(t))[a===0?0:a-1]}checkIfCorrectCustomerId(){var f,M,C,I,S,w;const e=window.localStorage.getItem("paypalMethod")?JSON.parse(window.localStorage.getItem("paypalMethod")):null,t=window.localStorage.getItem("applepayMethod")?JSON.parse(window.localStorage.getItem("applepayMethod")):null,a=window.localStorage.getItem("googlepayMethod")?JSON.parse(window.localStorage.getItem("googlepayMethod")):null,s=window.localStorage.getItem("gcashMethod")?JSON.parse(window.localStorage.getItem("gcashMethod")):null,r=window.localStorage.getItem("mercadopagoMethod")?JSON.parse(window.localStorage.getItem("mercadopagoMethod")):null,m=window.localStorage.getItem("cashMethod")?JSON.parse(window.localStorage.getItem("cashMethod")):null,n=window.localStorage.getItem("customerDetails")?JSON.parse(window.localStorage.getItem("customerDetails")):null;(e==null?void 0:e.customerId)!==((f=n==null?void 0:n.data)==null?void 0:f.customer_id)&&window.localStorage.removeItem("paypalMethod"),(r==null?void 0:r.customerId)!==((M=n==null?void 0:n.data)==null?void 0:M.customer_id)&&window.localStorage.removeItem("mercadoPagoMethod"),(m==null?void 0:m.customerId)!==((C=n==null?void 0:n.data)==null?void 0:C.customer_id)&&window.localStorage.removeItem("cashMethod"),(t==null?void 0:t.customerId)!==((I=n==null?void 0:n.data)==null?void 0:I.customer_id)&&window.localStorage.removeItem("applepayMethod"),(a==null?void 0:a.customerId)!==((S=n==null?void 0:n.data)==null?void 0:S.customer_id)&&window.localStorage.removeItem("googlepayMethod"),(s==null?void 0:s.customerId)!==((w=n==null?void 0:n.data)==null?void 0:w.customer_id)&&window.localStorage.removeItem("gcashMethod")}getPaymentMethodMode(e){switch(e){case o.HOUSE_ACCOUNT:return"change";default:return"remove"}}getPaymentMethodButtonText(e){switch(e){case o.HOUSE_ACCOUNT:return"";default:return this.$i18n.t("remove_item")}}async handleDestroyed(){O.isMobile&&(this.backUrl=null,this.headBar.hideHeaderBar())}async created(){O.isMobile&&this.headBar.showBackBtn(this.$i18n.t("payment_methods"),()=>{this.$router.back()}),this.checkIfCorrectCustomerId(),!(this.$router.currentRoute.query&&Object.keys(this.$router.currentRoute.query).length===0&&Object.getPrototypeOf(this.$router.currentRoute.query)===Object.prototype)&&this.$router.replace({...this.$router.currentRoute,query:Object.assign({})})}async mounted(){this.isMobile&&(this.backUrl=window.history.state.back),this.deleteConfirmationOptions={title:this.$i18n.t("delete_payment_method"),focusAction:"delete",dialogContentClass:"remove-payment-dialog",hasTransitions:!1,isPersistent:!0,buttons:[{action:"delete",label:this.$i18n.t("delete"),classes:"--primary --confirmation"},{action:"cancel",label:this.$i18n.t("cancel"),classes:"--secondary --confirmation"}]},this.sendScreenViewEvent("Payment Methods"),this.setScrollBlock(!1),await this.fetchCustomerPaymentMethods()}};d([N.Getter],i.prototype,"customer",2);d([N.Getter],i.prototype,"isLoggedIn",2);d([p.Getter],i.prototype,"storedPaymentMethods",2);d([p.Getter],i.prototype,"brandPaymentMethods",2);d([p.Getter],i.prototype,"paymentProcessorTokens",2);d([p.Getter],i.prototype,"brandPaymentProcessors",2);d([p.Action],i.prototype,"fetchCustomerPaymentMethods",2);d([p.Action],i.prototype,"generateTokens",2);d([p.Action],i.prototype,"setScrollBlock",2);d([p.Action],i.prototype,"deleteCustomerPaymentMethod",2);d([p.Action],i.prototype,"setGenericModalData",2);d([_e.Getter],i.prototype,"venue",2);d([Me.Getter],i.prototype,"getBrandName",2);d([p.Getter],i.prototype,"applicationKey",2);d([Z("customerPaymentMethods.length")],i.prototype,"watchCustomerPaymentMethods",1);i=d([X({components:{AppMetadata:x,PaymentsModal:ue,CloseIcon:ye,AppLoader:ee,AppImage:te,AppButton:oe,ConfirmationDialog:le,PaymentMethodItem:ae,AppPageLayout:me,UnmountCompat:se}})],i);const Ae=["role"],fe={class:"payment-methods-text"},Ce=["alt"],Ie={class:"payment-methods-link"};function Se(e,t,a,s,r,m){const n=u("v-layout-compat"),f=u("PaymentMethodItem"),M=u("AppLoader"),C=u("Ap
1pButton"),I=u("PaymentsModal"),S=u("ConfirmationDialog"),w=u("AppPageLayout"),L=u("AppMetadata"),Y=u("UnmountCompat");return h(),_(b,null,[e.isLoggedIn&&e.storedPaymentMethods?(h(),g(w,{key:0,title:e.$i18n.t("payment_methods"),titleClasses:e.isMobile?"--hiddenOnMobile":""},{default:A(()=>[$("span",{class:"hidden-for-sr",role:e.assignStatusRoleToEl(e.paymentMethodStatusMessage)},D(e.paymentMethodStatusMessage),9,Ae),e.customerPaymentMethods.length===0?(h(),g(n,{key:0,class:"payment-methods-content cards"},{default:A(()=>[$("p",fe,[e.showSectionForAddingPaymentMethod?(h(),_(b,{key:0},[R(D(e.$i18n.t("payment_methods_show_up_here")),1)],64)):(h(),_(b,{key:1},[R(D(e.$i18n.t("please_pay_directly_at_checkout")),1)],64))])],void 0,!0),_:1})):v("",!0),e.customerPaymentMethods.length>0?(h(),g(re,{key:1,column:"",class:"payment-methods-content cards"},{default:A(()=>[(h(!0),_(b,null,ie(e.customerPaymentMethods,(l,T)=>(h(),_("div",{key:l.id,role:"listitem",alt:e.getCreditCardName(l.payment_method_id),class:de("payment-methods-item-container"+T)},[P(f,{mode:e.getPaymentMethodMode(l.payment_method_id),paymentMethodId:l.payment_method_id,paymentMethodCustomLabel:l.properties&&l.properties.card_label,expired:l.expired,expirationDate:l.properties&&l.properties.expiration_date,lastDigits:l.properties&&l.properties.last_four_digits,expirationText:`• ${e.$i18n.t("expired")}`,buttonText:e.getPaymentMethodButtonText(l.payment_method_id),large:!0,separator:T!==e.customerPaymentMethods.length-1,labels:{cash:e.$i18n.t("cash")},onHandleClick:we=>e.showRemoveModal(T)},null,8,["mode","paymentMethodId","paymentMethodCustomLabel","expired","expirationDate","lastDigits","expirationText","buttonText","separator","labels","onHandleClick"])],10,Ce))),128)),e.isLoading?(h(),g(M,{key:0})):v("",!0)],void 0,!0),_:1})):v("",!0),e.showSectionForAddingPaymentMethod?(h(),g(n,{key:2,class:"payment-methods-content"},{default:A(()=>[$("p",Ie,[P(C,{id:"payment-modal-opener","btn-class":"--link",class:"pa-3",alt:`${e.$i18n.t("add_payment_method")}`,onClick:e.openPaymentsModal},{default:A(()=>[R(D(e.$i18n.t("add_payment_method")),1)],void 0,!0),_:1},8,["alt","onClick"])])],void 0,!0),_:1})):v("",!0),P(I,{origin:"paymentMethodsPage",class:"paymentsModal",showModal:e.paymentsModal,isHouseAccountAllowed:!0,onClose:e.closePaymentsModal},null,8,["showModal","onClose"]),P(S,{"show-dialog":e.removeModal,options:e.deleteConfirmationOptions,"onUpdate:showDialog":t[0]||(t[0]=l=>e.removeModal=l),onAction:e.handleConfirmationActions},null,8,["show-dialog","options","onAction"])],void 0),_:1},8,["title","titleClasses"])):(h(),g(M,{key:1,"loader-wrap-class":"__fixed"})),P(L,{title:e.pageTitle},null,8,["title"]),P(Y,{onOnDestroyed:e.handleDestroyed},null,8,["onOnDestroyed"])],64)}const Le=ne(i,[["render",Se]]);export{Le 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.