1"use strict";(self.webpackChunkflosports_webapp=self.webpackChunkflosports_webapp||[]).push([[7818],{42753:(B,b,n)=>{n.d(b,{Q5:()=>I,S4:()=>E});var _=n(49770),s=n(88996),w=n(50571);const U="https://js.stripe.com/basil/stripe.js";class E extends Error{constructor(A){super(A),this.name="StripeVersionConflictError",Object.setPrototypeOf(this,E.prototype)}}let m;function I(C){return(0,_.P)(()=>(0,s.D)(function K(C){if(typeof document>"u")return Promise.resolve(null);const A=(0,w.D)();if("v3"===A)throw new E("v3 Stripe.js is already loaded; cannot load Basil over it");return("basil"===(0,w.D)()?Promise.resolve():m||(m=new Promise((L,y)=>{const $=()=>{m=void 0,y(new Error("Stripe.js Basil failed to load"))},O=document.querySelector(`script[src="${U}"]`);if(O)return O.getAttribute("data-error")?void $():(O.addEventListener("load",()=>L()),void O.addEventListener("error",$));const M=document.createElement("script");M.src=U,M.async=!0,M.onload=()=>L(),M.onerror=()=>{M.setAttribute("data-error","true"),$()},document.head.appendChild(M)}),m)).then(()=>{if(!window.Stripe)throw new Error("Stripe.js Basil failed to load");const L=(0,w.D)();if("v3"===L||void 0!==A&&"basil"!==L)throw new E("Another Stripe.js flavor holds window.Stripe, so Basil could not take it");return window.Stripe(C)})}(C)))}},18449:(B,b,n)=>{n.d(b,{d:()=>m});var _=n(59454),s=n(49770),w=n(88996),U=n(42753),E=n(50571);function m(K){return(0,s.P)(()=>{if("basil"===(0,E.D)())throw new U.S4("Basil Stripe.js is already loaded; cannot load v3 over it");return(0,w.D)((0,_.J)(K))})}},50571:(B,b,n)=>{function _(){try{const s=window.Stripe;return s?3===s.version?"v3":"basil"===s.version?"basil":"unknown":void 0}catch{return}}n.d(b,{D:()=>_})},60872:(B,b,n)=>{n.d(b,{Y:()=>u,c:()=>d});var _=n(80529),s=n(39646),w=n(39300),U=n(39841),E=n(63900),m=n(54004),K=n(34782),c=n(70262),I=n(18505),C=n(91954),A=n(7069),j=n(98878),L=n(1390),y=n(94650),$=n(50245),O=n(5201),M=n(57042),R=n(37038),S=n(14814),r=n(42338),a=n(46435),u=(()=>{return(h=u||(u={})).GooglePay="google_pay",h.ApplePay="apple_pay",h.Default="card",u;var h})();let d=(()=>{class h{constructor(t,e,o,i,l,g,f,p,v){this.http=t,this.environmentService=e,this.authService=o,this.cookieService=i,this.couponService=l,this.verticalService=g,this.impactService=f,this.locationService=p,this.logger=v,this.activeOffering$=this.authService.userIdentity$.pipe((0,E.w)(D=>D?this.getUserSubscriptions(!1,D.id).pipe((0,w.h)(A.bb),(0,m.U)(P=>{if(P&&P[0]){if(P[0].status===j.ux.Active&&P[0].offers)return P[0].offers[0];if(P[0].status===j.ux.Cancelled&&(0,L.Z)(new Date(P[0].accessEndDate),Date.now()))return P[0].offers[0]}}),(0,K.d)(1)):(0,s.of)(null))),this.activeSubscription$=this.authService.userIdentity$.pipe((0,E.w)(D=>D?this.getUserSubscriptions(!0,D.id).pipe((0,w.h)(A.bb),(0,m.U)(P=>P[0]),(0,K.d)(1)):(0,s.of)(null)))}getImpactClickId(){return this.impactService.getClickId()}previewSubscription(t,e,o){return this.http.post(`${this.environmentService.config.endpoints.payments}/subscriptions/${t.id}/preview`,{offeringIds:[e.id],coupon:o}).pipe((0,c.K)(l=>(this.logger.error("Error accessing Payments Service",{error:l}),(0,s.of)(void 0))))}createPaymentIntent(t,e,o,i){return this.http.post(`${this.environmentService.config.endpoints.payments}/payment-intents`,{offer:t?.id,captcha:e,coupon:o,email:i}).pipe((0,c.K)(g=>{throw 403!==g.status&&401!==g.status&&this.logger.error("Error creating payment intent",{error:g}),new Error(g.message)}))}claimGiftSubscription(t,e){return this.http.post(`${this.environmentService.config.endpoints.payments}/pending-subscriptions/${t}/claim`,{captcha:e}).pipe((0,c.K)(l=>(this.logger.error("An error occurred when claiming a gifted subscription",{error:l}),(0,s.of)(void 0))))}createGiftSubscription(t,e,o,i){return this.http.post(`${this.environmentService.config.endpoints.payments}/pending-subscriptions`,{type:"stripe",offering:t.id,email:o,currency:t?.offerMetadata?.currency,paymentIntent:e,captcha:i}).pipe((0,c.K)(f=>{if(f&&f.message&&this.logger.error("Payment failure",{error:f}),f instanceof _.UA&&400===f.status)return(0,s.of)(f.error.errors.message?f.error.errors.message:{message:"An error occurred while processing your payment. You were not charged. Please try again or c
1ontact support."});if(f instanceof _.UA&&500===f.status)throw{...f,message:"An error occurred while processing your payment. You were not charged. Please try again or contact support."};return(0,s.of)(void 0)}))}createSubscription(t,e,o,i=!1,l){const g=this.authService.getUserFromStoredToken(),f=this.impactService.getClickId();return(0,U.a)([this.couponService.coupon$,this.verticalService.siteId$]).pipe((0,E.w)(([p,v])=>{const D=`${this.environmentService.config.endpoints.payments}/subscriptions`,P={type:"stripe",offering:t?.id,user:Number(g?.id),coupon:p?p.id:"",currency:t?.offerMetadata?.currency,extraMetadata:{isInstallment:t?.offerMetadata?.isInstallment,installmentPlanDuration:t?.offerMetadata?.isInstallment?12:void 0,siteId:v,impact_click_id:f},captcha:o,paymentIntent:e,isOmalley:!!i||void 0,freeTrialDays:i?30:void 0,promoGift:l};return this.http.post(D,P)}),(0,I.b)(p=>{this.impactService.setCustomerInfo(p.customerId,g?.email??""),this.cookieService.set("subscription_start_date",p.createdAt),this.authService.userIdentitySource.next(g),this.couponService.clearCoupon()}),(0,c.K)(p=>{if(p&&p.message&&this.logger.error(p.message,p.error),p instanceof _.UA&&400===p.status)return(0,s.of)(p.error.errors.message);if(p instanceof _.UA){if(500===p.status)throw{...p,message:"An error occurred while processing your payment. You were not charged. Please try again or contact support."};let v=p.error.message;if(!v.includes("contact your bank")&&!v.includes("insufficient funds")){const D="If you are certain you have entered the correct information for an unexpired card with sufficient funds, please reach out to your bank or contact support.";v=v.includes(".")?v.concat(` ${D}`):v.concat(`. ${D}`)}throw{...p,message:v}}return(0,s.of)(void 0)}))}createStripeTaxSubscription(t,e,o,i,l,g){const f=this.authService.getUserFromStoredToken(),p=this.impactService.getClickId();return this.verticalService.siteId$.pipe((0,E.w)(v=>{const D=`${this.environmentService.config.endpoints.payments}/subscriptions`,P={type:"stripe-tax",offering:t?.id,user:Number(f?.id),coupon:i,currency:t?.offerMetadata?.currency,extraMetadata:{siteId:v,impact_click_id:p},captcha:o??"",paymentMethodId:e,email:l,promoGift:g};return this.http.post(D,P)}),(0,I.b)(()=>{f&&this.impactService.setCustomerInfo(f.id,f.email??""),this.authService.userIdentitySource.next(f)}),(0,c.K)(v=>{throw 403!==v.status&&401!==v.status&&this.logger.error("Error creating subscription",{error:v}),v}))}createCheckoutSession(t,e,o){return this.verticalService.siteId$.pipe((0,E.w)(i=>this.http.post(`${this.environmentService.config.endpoints.payments}/checkout-sessions`,{offering:t?.id,coupon:o,captcha:e,siteId:i,uiMode:"custom",returnUrl:`${this.locationService.location}/pay`})),(0,c.K)(i=>{throw 403!==i.status&&401!==i.status&&this.logger.error("Error creating checkout session",{error:i}),i}))}verifyCheckoutSession(t){const e=`${this.environmentService.config.endpoints.payments}/checkout-sessions/${encodeURIComponent(t)}/verify`,o=this.authService.getUserFromStoredToken();return this.http.post(e,{}).pipe((0,I.b)(i=>{"complete"===i.status&&(o&&this.impactService.setCustomerInfo(o.id,o.email??""),this.authService.userIdentitySource.next(o),this.couponService.clearCoupon())}),(0,c.K)(i=>{throw 403!==i.status&&401!==i.status&&this.logger.error("Error verifying checkout session",{error:i}),i}))}getUserSubscriptions(t,e){return this.http.get(`${this.environmentService.config.endpoints.payments}/users/${e}/subscriptions`,{params:{onlyActive:t}}).pipe((0,c.K)(i=>(this.logger.error("Error fetching user active subscriptions",{error:i}),(0,s.of)(void 0))))}upgradeSubscription(t,e,o){const i=`${this.environmentService.config.endpoints.payments}/subscriptions/${t.id}`,l=this.authService.getUserFromStoredToken();return this.http.post(i,{offeringIds:[e.id],coupon:o}).pipe((0,I.b)(()=>{this.authService.userIdentitySource.next(l)}),(0,c.K)(g=>(this.logger.error("Error accessing Payments Service",{error:g}),(0,s.of)(void 0))))}cancelSubscription(t){return this.http.delete(`${this.environmentService.config.endpoints.payments}/subscriptions/${t}`).pipe((0,c.K)(e=>(404!==e.status&&this.logger.error(`Error cancelling subscriptionId: ${t}`,{error:e}),(0,s.of)([]))))}pauseSubscription(t,e){return this.http.patch(`${this.environmentService.config.endpoints.payments}/subscriptions/${t}/pause`,e).pipe((0,c.K)(o=>{throw 404!==o.status&&this.logger.error(`Error pausing subscriptionId: ${t}`,{error:o}),o}))}applyCoupon(t,e,o,i){return this.http.post(`${this.environmentService.config.endpoints.payments}/subscriptions/${t}`,{offeringIds:[e],coupon:i},{params:{spac:o}}).pipe((0,c.K)(l=>(404!==l.status&&this.logger.error(`Error applying coupon for churn prevention. subscriptionId: ${t}`,{error:l}),(0,s.of)("There was an error with the server"))))}reactivateSubscription(t){return this.http.patch(`${this.environmentService.config.endpoints.payments}/subscriptions/${t}/revert-cancellation`,{}).pipe((0,c.K)(o=>{const i=o.error;return(0,s.of)({error:i,message:i&&i.message||"There was an error with the server."})}))}updateCard(t){return this.http.patch(`${this.environmentService.config.endpoints.payments}/stripe/card`,{token:t}).pipe((0,m.U)(()=>{}),(0,c.K)(e=>{throw this.logger.error("Error updating credit card",{error:e}),e}))}
1createCardUpdateIntent(){return this.http.post(`${this.environmentService.config.endpoints.payments}/stripe/card/intent`,{}).pipe((0,c.K)(e=>{throw 403!==e.status&&401!==e.status&&this.logger.error("Error creating card update intent",{error:e}),e}))}updateCardPaymentMethod(t){return this.http.patch(`${this.environmentService.config.endpoints.payments}/stripe/card`,{paymentMethod:t}).pipe((0,m.U)(()=>{}),(0,c.K)(e=>{throw this.logger.error("Error updating card payment method",{error:e}),e}))}checkOMalleyEligibility(t){return this.http.get(`${this.environmentService.config.endpoints.payments}/users/omalley-beneficiary/${encodeURIComponent(t)}`).pipe((0,m.U)(e=>e),(0,c.K)(e=>e.status<500&&404===e.status&&404===e.error.statusCode?(0,s.of)(e.error):(this.logger.info("Error checking OMalley eligibility",{error:e}),(0,s.of)({message:"An error occurred while checking OMalley eligibility",eligible:!1,statusCode:500}))))}}return h.\u0275fac=function(t){return new(t||h)(y.\u0275\u0275inject(_.eN),y.\u0275\u0275inject($.L),y.\u0275\u0275inject(O.e),y.\u0275\u0275inject(M.N),y.\u0275\u0275inject(R.jb),y.\u0275\u0275inject(S.A),y.\u0275\u0275inject(r.E),y.\u0275\u0275inject(a.a),y.\u0275\u0275inject(C.te))},h.\u0275prov=y.\u0275\u0275defineInjectable({token:h,factory:h.\u0275fac,providedIn:"root"}),h})()},59454:(B,b,n)=>{function _(S){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(S)}n.d(b,{J:()=>R});var O,s="https://js.stripe.com/v3",w=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,U="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",m=function(r){var a=r&&!r.advancedFraudSignals?"?advancedFraudSignals=false":"",u=document.createElement("script");u.src="".concat(s).concat(a);var d=document.head||document.body;if(!d)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return d.appendChild(u),u},c=null,I=null,C=null,L=function(r){return null!==c?c:(c=new Promise(function(a,u){if(typeof window>"u"||typeof document>"u")a(null);else if(window.Stripe&&r&&console.warn(U),window.Stripe)a(window.Stripe);else try{var d=function(){for(var r=document.querySelectorAll('script[src^="'.concat(s,'"]')),a=0;a<r.length;a++){var u=r[a];if(w.test(u.src))return u}return null}();if(d&&r)console.warn(U);else if(d){if(d&&null!==C&&null!==I){var h;d.removeEventListener("load",C),d.removeEventListener("error",I),null===(h=d.parentNode)||void 0===h||h.removeChild(d),d=m(r)}}else d=m(r);C=function(r,a){return function(){window.Stripe?r(window.Stripe):a(new Error("Stripe.js not available"))}}(a,u),I=function(r){return function(){r(new Error("Failed to load Stripe.js"))}}(u),d.addEventListener("load",C),d.addEventListener("error",I)}catch(T){return void u(T)}}),c.catch(function(a){return c=null,Promise.reject(a)}))},y=function(r,a,u){if(null===r)return null;var d=r.apply(void 0,a);return function(r,a){!r||!r._registerWrapper||r._registerWrapper({name:"stripe-js",version:"5.4.0",startTime:a})}(d,u),d},$=function(r){var a="invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(r),"\n");if(null===r||"object"!==_(r))throw new Error(a);if(1===Object.keys(r).length&&"boolean"==typeof r.advancedFraudSignals)return r;throw new Error(a)},M=!1,R=function(){for(var r=arguments.length,a=new Array(r),u=0;u<r;u++)a[u]=arguments[u];M=!0;var d=Date.now();return L(O).then(function(h){return y(h,a,d)})};R.setLoadParameters=function(S){if(M&&O){var r=$(S);if(Object.keys(r).reduce(function(d,h){var T;return d&&S[h]===(null===(T=O)||void 0===T?void 0:T[h])},!0))return}if(M)throw new Error("You cannot change load parameters after calling loadStripe");O=$(S)}}}]);
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.