Build 545032stable
Module 371794
1,748 characters · in no known chunkDependencies
Required by (35)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{QB:()=>p,YE:()=>E,aP:()=>m}),n(321073);var i=n(975975),r=n.n(i),s=n(607399),a=n(636537),o=n(753390),l=n(776231),u=n(495544),c=n(615405),d=n(295405),_=n(166403),f=n(676279);n(723702);var h=n(652215);n(375708),r().shim();let p=!s.Fr&&!s.v1&&-1!==(0,f.Z5)();function E(e,t,n,i){let r,s=window.GLOBAL_ENV.CDN_HOST;if(null==i)switch(t.mimeType||t.mime_type){case"video/quicktime":case"video/mp4":i="mp4";break;case"image/gif":i="gif";break;default:i="webp"}"webp"!==i||p||(i="png");let a="string"==typeof t?t:t.id,o="https:";return r=null!=s?`${o}//${s}/app-assets/${e}/store/${a}.${i}`:`${o}${window.GLOBAL_ENV.API_ENDPOINT}${h.Rsh.STORE_ASSET(e,a,i)}`,null!=n&&(r+=`?size=${(0,l.kr)(n*(0,l.mZ)())}`),r}async function m(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=u.default.isAuthenticated();if(t&&n){let e=[];d.A.hasFetchedPaymentSources||e.push(c.A.paymentSourcesFetchRequest??(0,o.$o)()),c.A.ipCountryCodeLoaded||e.push((0,o.xe)()),e.push(new Promise(async e=>{if(_.A.hasFetchedSubscriptions())e();else if(c.A.isSubscriptionFetching){let t=()=>{c.A.isSubscriptionFetching?setTimeout(t,50):e()};t()}else await (0,o.hP)(),e()})),await Promise.race([Promise.allSettled(e),new Promise(e=>setTimeout(e,1e4))])}let i=d.A.getDefaultBillingCountryCode(),r=d.A.defaultPaymentSource?.id??null,s=_.A.getPremiumTypeSubscription();null!=s&&null!=s.paymentSourceId&&(r=s.paymentSourceId),null===i&&(i=c.A.ipCountryCode??null);let l={};if(null!=i&&(l.country_code=i),null!=r&&(l.payment_source_id=r),null!=i||null!=r){if("string"==typeof e&&(e={url:e,oldFormErrors:!0,rejectWithError:!1}),"string"==typeof e.query)throw Error("string query not supported");e.query={...l,...e.query}}return a.Bo.get(e)}}