1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[55145],{15070:(e,t,i)=>{i.d(t,{E2:()=>p,HR:()=>g,J2:()=>h,J4:()=>u,bu:()=>l,jp:()=>c});var n=i(77993),a=i(25993),s=i(86638),o=i(4400),r=i(13042);(0,s.xI)(n.x);let d=(0,o.Uz)(),l=e=>(0,o.Qg)(d,"updateUserInfo")(e),c=()=>(0,o.Qg)(d,"getUserInfo")(),u=()=>a.Ay.request({url:"/oms/folia/getUserProfile",method:"get"}),p=()=>a.Ay.request({url:"/oms/folia/login-ticket",method:"post"}),h=e=>a.Ay.request({url:"/oms/login/sendCode",data:{payload:(0,r.lF)(JSON.stringify({email:e}))},method:"post"}),g=e=>{let{email:t,code:i}=e;return a.Ay.request({url:"/oms/login/verify",data:{payload:(0,r.lF)(JSON.stringify({email:t,code:i}))},method:"post"})}},18316:(e,t,i)=>{i.d(t,{BX:()=>s,vp:()=>n,wA:()=>a});let n="UTC";function a(e){if("string"!=typeof e)return;let t=e.trim().replace("_","-").toLowerCase();return"es-mx"===t?"es-MX":"en-us"===t?"en-US":void 0}function s(e){return{language:e.locale,region:e.region}}},25993:(e,t,i)=>{i.d(t,{pc:()=>g,Ay:()=>_,O_:()=>m});var n=i(39934),a=i(49666),s=i(34705),o=i(86638),r=i(40573),d=i.n(r),l=i(27216),c=i.n(l),u=i(63283),p=i.n(u);class h{async getInsideConfig(){try{var e;let t=(0,o.xI)(),i=await (null==(e=t.currentUser)?void 0:e.getIdToken())||"";return{baseURL:this.baseUrl,timeout:5e3,headers:{Authorization:i?"Bearer ".concat(i):null,"app-platform":"web","app-version":"0.0.0","x-web-request":!0},withCredentials:!1}}catch(e){return{baseURL:this.baseUrl,timeout:5e3,headers:{Authorization:null,"app-platform":"web","app-version":"0.0.0","x-web-request":!0},withCredentials:!1}}}destroy(e){delete this.queue[e]}interceptors(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.interceptors.request.use(e=>(this.queue[t]=!0,e),e=>Promise.reject(e)),e.interceptors.response.use(e=>{var n;return(this.destroy(t),(null==e||null==(n=e.data)?void 0:n.status)==="fail")?Promise.reject(i?new a.pe("API request failed",void 0,e.config,e.request,e):e.data):e},e=>{var n;return this.destroy(t),Promise.reject(i?e:null==e||null==(n=e.response)?void 0:n.data)})}async request(e){let{preserveErrorResponse:t,...i}=e,n=s.A.create(),a=c()({},await this.getInsideConfig(),i);return p()(e.omit)||(a=d()(a,(null==e?void 0:e.omit)||[]),delete e.omit),this.interceptors(n,a.url||"__None__",t),n(a)}constructor(e){this.baseUrl=e,this.queue={}}}let g="local"===i(97567).env.APP_ENV?n.A.baseUrl.local:n.A.baseUrl.prod,v=new h(g),m=!0,_=v},39934:(e,t,i)=>{i.d(t,{A:()=>n});let n={baseUrl:{prod:"https://api.plantstory.app",dev:"https://dev-api.plantstory.app",local:"http://localhost:8087"},sellerHubUrl:{prod:"https://seller.palmstreet.app/seller/",dev:"https://dev-seller.palmstreet.app/seller/",local:"http://localhost:4000/seller/"},sellerApplyLink:"https://szur132wxww.typeform.com/to/GgVsyzaQ",defaultAvatar:"/images/no-avatar.jpeg",helpCenterLink:"https://help.palmstreet.app"}},50987:(e,t,i)=>{i.d(t,{A:()=>d});var n=i(25993),a=i(87430),s=i(18316);class o{isClientSide(){return"undefined"!=typeof localStorage}generateUUID(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}getOrCreateDistinctId(){if(!this.isClientSide())return null;let e=localStorage.getItem("ps_distinct_id");return!e&&(e=this.generateUUID(),localStorage.setItem("ps_distinct_id",e),localStorage.getItem("ps_device_id")||localStorage.setItem("ps_device_id",e)),e}getOrCreateDeviceId(){if(!this.isClientSide())return null;let e=localStorage.getItem("ps_device_id");return e||(e=this.generateUUID(),localStorage.setItem("ps_device_id",e)),e}collectBaseProperties(){if(!this.isClientSide())return{};let e=navigator.userAgent,t=new URL(window.location.href);return{os:this.detectOS(e),browser:this.detectBrowser(e),browser_version:this.detectBrowserVersion(e),device:/Mobile|Android|iP(ad|hone)/i.test(e)?"Mobile":"Desktop",device_model:navigator.platform,current_url:t.href,referrer:document.referrer||null,app_name:this.appName,app_version:this.appVersion||null,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,distinct_id:this.distinct_id,device_id:this.device_id,user_id:this.userId,...this.getPersistentUTM()}}detectOS(e){return/Windows/i.test(e)?"Windows":/Mac OS X/i.test(e)?"macOS":/Android/i.test(e)?"Android":/iPhone|iPad|iPod/i.test(e)?"iOS":/Linux/i.test(e)?"Linux":"Unknown"}detectBrowser(e){return/Chrome/i.test(e)?"Chrome":/Safari/i.test(e)&&!/Chrome/i.test(e)?"Safari":/Firefox/i.test(e)?"Firefox":/Edge/i.test(e)?"Edge":/MSIE|Trident/i.test(e)?"IE":"Unknown"}detectBrowserVersion(e){let t=e.match(/(Chrome|Firefox|Safari|Edge)\/([\d.]+)/i);return t?t[2]:"Unknown"}getPersistentUTM(){if(!this.isClientSide())return{};let e=JSON.parse(localStorage.getItem("ps_utm")||"{}"),t=new URLSearchParams(window.location.search),i={...e},n=!1;for(let e of["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id","fbclid","utm_source_platform","utm_creative_format","utm_marketing_tactic"]){let a=t.get(e);a&&(i[e]=a,n=!0)}return n&&Object.keys(i).length&&localStorage.setItem("ps_utm",JSON.stringify(i)),i}identify(e){this.userId=e||null,this.identified=!0,this.distinct_id=this.getOrCreateDistinctId(),this.device_id=this.getOrCreateDeviceId(),this.baseProps={...this.collectBaseProperties(),user_id:this.userId};let t=this.queue.map(e=>({...e,user_id:this.userId,metadata:{...e.metadata,user_id:this.userId}}));this.queue=[],t.length>0&&this.sendEvent(t)}reset(){this.identified=!1,this.queue=[],this.userId=null,this.baseProps=null,this.distinct_id=null,this.device_id=null,localStorage.removeItem("ps_utm"),localStorage.removeItem("ps_distinct_id")}track(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={event:e,user_id:this.userId,time:new Date().toISOString(),metadata:this.baseProps,event_property:t};this.sendEvent([i])}sendEvent(e){if(!this.isClientSide())return;let t=JSON.stringify(e);try{fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:t,keepalive:!0,credentials:"omit"}).catch(console.error)}catch(t){this.queue.push(...e)}}constructor(e){this.queue=[],this.identified=!1,this.endpoint="".concat(n.pc).concat(e.endpoint),this.appName=e.appName||"UnknownApp",this.appVersion=e.appVersion,this.userId=e.userId||null,this.distinct_id=this.getOrCreateDistinctId(),this.device_id=this.getOrCreateDeviceId(),this.baseProps=this.isClientSide()?this.collectBaseProperties():{}}}class r{static getInstance(){return r.instance||(r.instance=new r),r.trackerInstance||(r.trackerInstance=new o({endpoint:"/growth/webevents",a
1ppName:"Web"})),r.instance}init(e){r.trackerInstance&&r.trackerInstance.identify(e)}setProfile(e){}reset(){r.trackerInstance&&r.trackerInstance.reset()}send(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.sendEvent(e,t)}sendEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=document.querySelector("[data-palm-locale]"),o={...function(e,t,i,n){if("/mx"!==e&&!e.startsWith("/mx/"))return{};let a=new URLSearchParams(i),o=a.get("scode")||a.get("pr")||"",r=e.startsWith("/mx/guidelines/")?"guidelines":e.startsWith("/mx/product/")?"product":e.startsWith("/mx/live_show/")?"live":e.startsWith("/mx/u/")||e.startsWith("/mx/user/")?"profile":"home";return{...o&&{scode:o},locale:t,region:"MX",locale_source:null!=n?n:o?"scode":(0,s.wA)(a.get("language"))?"query":"default",share_type:r,market_region:"MX",market_locale:t,market_namespace:"mx",resource_type:r}}(globalThis.location.pathname,(null==i?void 0:i.dataset.palmLocale)||document.documentElement.lang||"en-US",globalThis.location.search,null==i?void 0:i.dataset.palmLocaleSource),...t,platform:"web",source:globalThis.localStorage.getItem("reference_source")};try{if(r.trackerInstance&&r.trackerInstance.track(e,o),!n.O_)return;(0,a.sendGAEvent)({event:e,value:t});return}catch(e){}}loadLivePage(e){e.scode?this.sendEvent("share_live_detail_show",e):this.sendEvent("Live:DidLoadLiveDetail",e)}loadRecapPage(e){this.sendEvent("Recap:DidLoadRecapPage",e)}loadBlogPage(e){this.sendEvent("Blog:DidLoadBlogPage",e)}loadBlogListPage(e){this.sendEvent("Blog:BlogListPageShow",e)}loadBlogDetailsPage(e){this.sendEvent("Blog:BlogDetailShow",e)}loadHomePage(e){this.sendEvent("Home:DidLoadHomePage",e)}loadMxHomePage(e){this.sendEvent("WebMx:DidLoadHomePage",e)}clickMxHomeButton(e){this.sendEvent("WebMx:DidClickHomeButton",e)}clickMxNavigation(e){this.sendEvent("WebMx:DidClickNavigation",e)}loadEarningDetailPage(){this.sendEvent("Balance:DidLoadEarningDetail")}loadBalanceDetailPage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"settings";this.sendEvent("Balance:DidLoadBalanceDetail",{source:e})}loadPayoutDetailPage(e){this.sendEvent("Balance:DidLoadTransferDetail",{source:e})}loadProductDetailPage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.sendEvent("Buying:DidLoadBuyingPage",{source:e,...t})}loadCampaignDetailPage(e,t){this.sendEvent("CampaignDetail:DidLoadCampaignDetailsPage",{source:e,campaignName:t})}loadCheckoutPage(e){this.sendEvent("Checkout:DidLoadCheckOutPage",e)}loadRFYItems(e){this.sendEvent("Checkout:DidLoadRFYItems",e)}loadCouponDetails(e){this.sendEvent("CouponDetail:DidLoadDetails",e)}loadFlashSaleDetailsPage(e){this.sendEvent("FlashSale:DidLoadDetailPage",{...e})}loadLoginPage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sendEvent("LogIn:DidLoadPage",e)}loadProfileDetailPage(e){this.sendEvent("ProfileDetails:DidLoadProfileDetailsPage",{...e})}loadPurgeDetailPage(e){this.sendEvent("PurgeDetails:DidLoadPurgeDetailsPage",{...e})}reportPaypalPaymentError(e){this.sendEvent("Paypal:PaymentError",e)}clickMakerSignUpButton(){this.sendEvent("Maker:DidTapSignUpButton")}clickMakerLearnMoreButton(){this.sendEvent("Maker:DidTapLearnMoreButton")}clickDonwloadAppButton(e){this.sendEvent("DownloadApp:DidTapDownloadAppButton",{location:e.location,pagename:e.pagename,scode:e.scode,...e.scodeBody||{},...e.other||{},source_strategy:e.source_strategy,downloadLink:e.downloadLink})}clickPayoutButton(){this.sendEvent("Balance:DidTapTransaction")}clickConfirmPayoutButton(){this.sendEvent("Balance:DidTapTransferButton")}clickBuyNowButton(e){this.sendEvent("Buying:DidTapBuyingTab",e)}clickProductCardSellerAvatar(e){this.sendEvent("ItemDetail:DidTapSellerAvatar",e)}clickCampaignProductCard(e){this.sendEvent("CampaignDetail:DidTapItems",e)}clickCampaignProductCardAvatar(e){this.sendEvent("CampaignDetail:DidTapItems",e)}didFailToPay(e){this.sendEvent("Checkout:DidFailToPay",e)}didPaySuccessfully(e){this.sendEvent("Checkout:DidPaySuccessfully",e)}selectPayment(e){this.sendEvent("Checkout:DidSelectPayment",e),this.sendEvent("Checkout:DidSwitchPayment",e)}clickAddNewAddress(){this.sendEvent("Checkout:DidTapAddNewAddress")}clickAddNewCard(){this.sendEvent("Checkout:DidTapAddNewCard")}clickAddRFYItems(e){this.sendEvent("Checkout:DidTapAddRFYItems",e),this.sendEvent("Checkout:DidTapBundleItems")}clickPayNow(e){this.sendEvent("Checkout:DidTapPayNow",e)}enterPromoCode(e){this.sendEvent("CouponDetail:DidEnterPromoCode",e)}succeedToRedeemCode(e){this.sendEvent("CouponDetail:DidRedeemCodeSucessfully",e)}failedToRedeemCode(e){this.sendEvent("CouponDetail:DidFailedToRedeemCode",e)}clickCoupon(e){this.sendEvent("CouponDetail:DidTapCoupon",e)}failToUpdateAddress(e){this.sendEvent("EditAddress:DidFailToSave",e)}succeedToUpdateAddress(){this.sendEvent("EditAddress:DidSaveSuccessfully")}clickSaveAddress(){this.sendEvent("EditAddress:DidTapSave")}
1clickFlashSaleProductBuyNow(e){this.sendEvent("FlashSale:DidTapBuyNowButtton",e)}clickFlashSaleItem(e){this.sendEvent("FlashSale:DidTapItem",e)}loginSuccessfully(e){this.sendEvent("LogIn:DidLoginSuccessfully",{...e,user_id:e.userId})}loginFailed(e){this.sendEvent("LogIn:DidFailToLogin",e)}clickProductItemFromProfile(){this.sendEvent("ProfileDetails:DidTapItem")}clickProductItem(e){this.sendEvent("Selling:DidTapListing",e)}clickMyBuying(){this.sendEvent("settings:DidTapBuying")}clickBalance(){this.sendEvent("settings:DidTapBalance")}clickPolicyContinue(){this.sendEvent("SellerAgreement:DidTapContinue",{AgreementContent:"CommunityGuidelines, PrivacyPolicy, TermsAndCondition, SellingFee"})}clickPolicyCheckBox(e){this.sendEvent("SellerAgreement:DidCheckbox",e)}clickBuyerPolicyCheckBox(e){this.sendEvent("BuyerAgreement:DidCheckbox",e)}updateFeedControlSetting(e){this.sendEvent("FeedControl:UpdateSetting",{Category:"snake_v2",Visible:e})}loadMySubscrioption(e){this.sendEvent("MySubscription:DidLoadDetailPage",e)}clickUpgrade(){this.sendEvent("MySubscription:DidTapUpgrade")}clickSubContactSupport(){this.sendEvent("MySubscription:DidTapContactSupport")}loadSubscrioptionHomePage(){this.sendEvent("SubscriptionHomepage:DidLoadHomePage")}clickSubscribePlan(e){this.sendEvent("SubscriptionHomepage:DidTapSubscribePlan",e)}clickSubscriptionCheckout(){this.sendEvent("SubscriptionCheckout:DidLoadCheckOutPage")}clickSubPaidSucceed(e){this.sendEvent("SubscriptionCheckout:DidCheckOutSuccessfully",e)}clickAddNewCardSucceedInCheckout(){this.sendEvent("SubscriptionCheckout:DidAddNewCardSuccessfully")}clickAddNewCardFailedInCheckout(e){this.sendEvent("SubscriptionCheckout:DidFailAddNewCard",e)}loadSubPaymentList(){this.sendEvent("SubscriptionPayment:DidLoadPaymentList")}clickAddNewCardSucceedInPayment(){this.sendEvent("SubscriptionPayment:DidAddNewCardSuccessfully")}clickAddNewCardFailedInPayment(e){this.sendEvent("SubscriptionPayment:DidFailAddNewCard",e)}clickLiveShowButtons(e){this.sendEvent("share_live_detail_click",e)}clickContinueInApp(e){this.sendEvent("Webpage:DidTapContinueInApp",e)}clickSubmitPhoneNumberButton(e){this.sendEvent("ReferralLandingPageSubmit",e)}clickSubmitPhoneNumberButtonAndThenShowMiddlePage(e){this.sendEvent("ReferralMiddlePageShow",e)}didLoadWebpage(e){this.sendEvent("Webpage:DidLoad",e)}didLoadNewInvitePage(e){this.sendEvent("ReferralLandingPageShow",e)}invoiceDidLoadWebpage(e){this.sendEvent("InvoiceWebpage:DidLoadWebpage",e)}invoiceDidEnterContactInfo(){this.sendEvent("InvoiceWebpage:DidEnterContactInfo")}invoiceDidEnterShippingInfo(){this.sendEvent("InvoiceWebpage:DidEnterShippingInfo")}invoiceSuccessToUpdateAddress(){this.sendEvent("InvoiceWebpage:SuccessToUpdateAddress")}invoiceFailToUpdateAddress(e){this.sendEvent("InvoiceWebpage:FailToUpdateAddress",e)}invoiceDidTapSaveAddress(){this.sendEvent("InvoiceWebpage:DidTapSaveAddress")}invoiceDidAddPaymentMethod(){this.sendEvent("InvoiceWebpage:DidAddPaymentMethod")}invoiceDidTapPayNow(e){this.sendEvent("InvoiceWebpage:DidTapPayNow",e)}invoiceDidFailToPay(e){this.sendEvent("InvoiceWebpage:DidFailToPay",e)}invoiceDidLoadPaymentCompletePage(e){this.sendEvent("InvoiceWebpage:DidLoadPaymentCompletePage",e)}invoiceDidTapDownloadAppButton(e){this.sendEvent("InvoiceWebpage:DidTapDownloadAppButton",e)}invoiceDidSelectPayment(e){this.sendEvent("InvoiceWebpage:DidSelectPayment",e)}invoiceDidPaySuccessfully(e){this.sendEvent("Checkout:DidPaySuccessfully",e)}webScoreDetailShow(e){this.sendEvent("Score:WebScoreDetailShow",e)}webScoreDetailClick(e){this.sendEvent("Score:WebScoreDetailClick",e)}loadPayoutsPage(e,t){this.sendEvent("Withdraw_PageShow",{source:e,...t})}SellerVerificationButtonShowInPayoutsPage(e){this.sendEvent("Withdraw_SellerVerification_ButtonShow",{...e})}SellerVerificationPopupShowInPayoutsPage(e){this.sendEvent("Withdraw_SellerVerification_PopUpShow",{...e})}VerifyPhoneNumberInPayoutsPage(e){let{result:t,error_message:i,phone_number:n,appInjectHeaders:a}=e;this.sendEvent("Withdraw_Verify_PhoneNumber",{result:t,error_message:i,phone_number:n,...a})}GetPhoneCodeInPayoutsPage(e){let{result:t,error_message:i,appInjectHeaders:n}=e;this.sendEvent("Withdraw_Get_PhoneCode",{result:t,error_message:i,...n})}VerifyStripeIDrInPayoutsPage(e){let{result:t,error_message:i,error_type:n,appInjectHeaders:a}=e;this.sendEvent("Withdraw_Verify_StripeID",{result:t,error_message:i,error_type:n,...a})}EditPayoutMethodsInPayoutsPage(e,t,i){this.sendEvent("Withdraw_EditPayoutMethods",{action:e,type:t,...i})}SubmitPayoutInPayoutsPage(e,t){this.sendEvent("Withdraw_SubmitPayout",{type:e,...t})}loadAuctionDetailPage(e){this.sendEvent("LFAuction_ListingDetail_Web_Show",{...e})}clickAuctionDetailButton(e){this.sendEvent("LFAuction_ListingDetail_Web_Click",{...e})}loadSellerReferralPage(e){this.sendEvent("SellerReferralWeb_PageShow",{...e})}clickSellerReferralDownloadButton(e){this.sendEvent("SellerReferralWeb_CickDownload",{...e})}clickSellerReferralLandingPageDownloadButton(e){this.sendEvent("ReferralLandingPage:ClickDownload",{location:e.location,pagename:e.pagename,scode:e.scode,...e.scodeBody||{},...e.other||{},source_strategy:e.source_strategy})}loadTriviaPage(){this.sendEvent("web_trivialandingpage")}clickTriviaHowToPlayButton(){this.sendEvent("web_trivialandingpage_howtoplay")}clickTriviaShareButton(){this.sendEvent("web_trivialandingpage_share")}loadMarketplacePage(e){this.sendEvent("WebMarketplace:DidLoadProductListPage",{...e})}clickMarketplaceProductCard(e){this.sendEvent("WebMarketplace:DidClickProductCard",{...e})}clickMarketplaceSearchQuerySubmitted(e){this.sendEvent("WebMarketplace:DidSearchQuerySubmitted",{...e})}applyMarketplaceFilterOrSort(e){this.sendEvent("WebMarketplace:DidApplyFilterOrSort",{...e})}loadMarketplaceProductDetailPage(e){this.sendEvent("WebPDP:DidLoadProductPage",{...e})}clickPDPBuyNowButton(e){this.sendEvent("WebPDP:DidClickBuyNowButton",{...e})}clickPDPUserAvatar(e){this.sendEvent("WebPDP:DidClickUserAvatar",{...e})}clickPDPFollowButton(e){this.sendEvent("WebPDP:DidClickFollowButton",{...e})}clickPDPMessageButton(e){this.sendEvent("WebPDP:DidClickMessageButton",{...e})}clickPDPDownloadAppButton(e){this.sendEvent("WebPDP:DidClickDownloadIAppButton",{...e})}checkPointPopupShow(e){this.sendEvent("CheckPoint_PopUp_Show",{...e,...e.appInjectHeaders||{}})}clickCheckPointPopup(e){this.sendEvent("CheckPoint_PopUp_Click",{...e,...e.appInjectHeaders||{}})}checkPointVerificationResult(e){this.sendEvent("CheckPoint_verification_result",{...e,...e.appInjectHeaders||{}})}completeCheckPointVerification(e){this.sendEvent("CheckPoint_verification_complete",{...e,...e.appInjectHeaders||{}})}DidClickProfileDetailTab(e){this.sendEvent("ProfileDetails_TabClick",{...e,platform:"web"})}loginWithAnonymous(e){this.sendEvent("Login_With_Anonymous",{...e,platform:"web"})}constructor(){}}let d=r.getInstance()},55145:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(66521),a=i(7896);let s=()=>(0,a.useContext)(n.cy)},66521:(e,t,i)=>{i.d(t,{cy:()=>_,OJ:()=>y});
1var n=i(32436),a=i(67582),s=i(15070),o=i(50987),r=i(86638);let d={url:window.location.origin,handleCodeInApp:!0,iOS:{bundleId:"4R2Z9WUYWQ.com.touchberry.plantstoryapp"},android:{packageName:"com.example.android",installApp:!0,minimumVersion:"12"}};var l=i(69594),c=i(11118),u=i(7896),p=i(77993);let h=(0,r.xI)(p.x);var g=function(e){return e.AUTH_STATE_CHANGED="AUTH_STATE_CHANGED",e}(g||{});let v={isAuthenticated:!1,isInitialized:!1,user:null},m=(e,t)=>{if("AUTH_STATE_CHANGED"===t.type){let{isAuthenticated:i,user:n}=t.payload;return{...e,isAuthenticated:i,isInitialized:!0,user:n}}return e},_=(0,u.createContext)({...v,platform:"Firebase",createUserWithEmailAndPassword:()=>Promise.resolve(),signInWithEmailAndPassword:()=>Promise.resolve(),sendSignInLinkToEmail:()=>Promise.resolve(),signInWithGoogle:()=>Promise.resolve(),singInWithCustomToken:()=>Promise.resolve(),logout:()=>Promise.resolve(),updateAuthState:()=>{}}),P=e=>{let{children:t}=e,[i,p]=(0,u.useReducer)(m,v),g=(0,l.useQueryClient)(),{mutate:P}=(0,a.y0)();(0,u.useEffect)(()=>{let e,t,i=!1,n=()=>{if(!globalThis.location.pathname.startsWith("/payouts"))return{};let e=globalThis.document.getElementById("__PS_PAYOUT_APP_HEADERS__");if(!(null==e?void 0:e.textContent))return{};try{let t=JSON.parse(e.textContent);return t&&"object"==typeof t?t:{}}catch(e){return{}}},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.A.send("Withdraw_AppTokenAuth",{stage:e,...{hasCustomTokenCookie:!!c.A.get("PS_JS_BRIDGE_CUSTOM_TOKEN"),hasUserTokenCookie:!!c.A.get("PS_JS_BRIDGE_USER_TOKEN"),hasInAppCookie:!!c.A.get("PS_IN_APP")},inAppHeaderPresent:!!n().in_app,...t})},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!globalThis.location.pathname.startsWith("/payouts"))return;let i=new URLSearchParams(globalThis.location.search),a=c.A.get("PS_JS_BRIDGE_CUSTOM_TOKEN"),s=c.A.get("PS_IN_APP"),r=n();o.A.sendEvent("InAppPayout:AuthBootstrap",{stage:e,in_app_cookie_present:!!s,in_app_query_present:!!i.get("in_app"),in_app_header_present:!!r.in_app,custom_token_present:!!a,pathname:globalThis.location.pathname,in_app:r.in_app||i.get("in_app")||"",device_id:r.device_id||i.get("device_id")||"",app_platform:r.app_platform||i.get("app_platform")||"",app_version:r.app_version||i.get("app_version")||"",device_model:r.device_model||"",device_name:r.device_name||"",device_version:r.device_version||"",tz_offset:r.tz_offset||i.get("tz_offset")||"",timestamp:r.timestamp||i.get("timestamp")||"",...t})},l=()=>{e=(0,r.hg)(h,e=>{let t=e?{...e}:null;if(d("auth_state_changed",{has_auth_user:!!e,auth_user_id:(null==e?void 0:e.uid)||"",is_anonymous:!!(null==e?void 0:e.isAnonymous)}),t){let e=globalThis.localStorage.getItem("PS_LOGIN_METHOD")||"web_unknown";o.A.init(null==t?void 0:t.uid),o.A.loginSuccessfully({loginMethod:e,userId:null==t?void 0:t.uid}),t.isAnonymous?(0,s.jp)().then(e=>{var i,n;(null==e||null==(i=e.data)?void 0:i.email)&&(t.email=null==e||null==(n=e.data)?void 0:n.email),p({type:"AUTH_STATE_CHANGED",payload:{isAuthenticated:!0,user:t}})}):p({type:"AUTH_STATE_CHANGED",payload:{isAuthenticated:!0,user:t}})}else p({type:"AUTH_STATE_CHANGED",payload:{isAuthenticated:!1,user:null}}),o.A.init()})},u=(e,t)=>{globalThis.localStorage.setItem("PS_LOGIN_METHOD","InheritFromApp");let n=[0,500,1500];(async()=>{let s;for(let o=0;o<n.length;o++){if(i)return;let u=o+1,p=n[o];if(p>0&&await new Promise(e=>setTimeout(e,p)),i)return;d("sign_in_start",{token_source:t,attempt:u}),a("signInWithCustomToken:start",{tokenSource:t,attempt:u});try{var l,c;let n=await (0,r.p)(h,e);if(i)return;d("sign_in_success",{token_source:t,attempt:u,signed_user_id:(null==(l=n.user)?void 0:l.uid)||""}),a("signInWithCustomToken:success",{tokenSource:t,attempt:u,userId:null==(c=n.user)?void 0:c.uid});return}catch(e){if(s=e,d("sign_in_failed",{token_source:t,attempt:u,error_code:(null==e?void 0:e.code)||"unknown_error",error_message:(null==e?void 0:e.message)||""}),a("signInWithCustomToken:failure",{tokenSource:t,attempt:u,errorCode:null==e?void 0:e.code,errorMessage:null==e?void 0:e.message}),(null==e?void 0:e.code)!=="auth/network-request-failed")break}}o.A.loginFailed({loginMethod:"InheritFromApp",errorCode:null==s?void 0:s.code,errorMessage:null==s?void 0:s.message})})().finally(()=>{i||(d("subscribe_auth_state",{token_source:t}),l())})},g=n(),v=c.A.get("PS_IN_APP")||new URLSearchParams(globalThis.location.search).get("in_app")||g.in_app,m=c.A.get("PS_JS_BRIDGE_CUSTOM_TOKEN");if(m)u(m,"initial");else if(v){let e=Date.now()+1e4,n=()=>
1{if(i)return;let s=c.A.get("PS_JS_BRIDGE_CUSTOM_TOKEN");if(s)return void u(s,"delayed");if(Date.now()<e){t=setTimeout(n,250);return}a("signInWithCustomToken:timeout",{waitMs:1e4}),d("sign_in_timeout",{wait_ms:1e4}),o.A.loginFailed({loginMethod:"InheritFromApp",errorCode:"missing_custom_token_after_wait"}),d("subscribe_auth_state",{token_source:"missing_after_wait"}),l()};t=setTimeout(n,250)}else d("subscribe_auth_state"),l();return()=>{i=!0,t&&clearTimeout(t),null==e||e()}},[p,P]);let y=e=>{e?p({type:"AUTH_STATE_CHANGED",payload:{isAuthenticated:!0,user:e}}):p({type:"AUTH_STATE_CHANGED",payload:{isAuthenticated:!1,user:null}})},S=async(e,t)=>{try{await (0,r.MN)(h,e,{...d,url:"".concat(d.url).concat(t).trim()}),globalThis.localStorage.setItem("emailForSignIn",e),globalThis.localStorage.setItem("PS_LOGIN_METHOD","Link")}catch(e){}},E=async(e,t)=>{globalThis.localStorage.setItem("PS_LOGIN_METHOD","EmailPwd"),await (0,r.x9)(h,e,t)},D=async()=>{try{let e=new r.HF;globalThis.localStorage.setItem("PS_LOGIN_METHOD","Google"),await (0,r.df)(h,e)}catch(e){}},C=async e=>{try{globalThis.localStorage.setItem("PS_LOGIN_METHOD","EmailCode"),await (0,r.p)(h,e)}catch(e){}},k=async(e,t)=>{await (0,r.eJ)(h,e,t)},f=async()=>{g.clear(),await (0,r.CI)(h),y(),o.A.reset()};return(0,n.jsx)(_.Provider,{value:{...i,platform:"Firebase",createUserWithEmailAndPassword:k,signInWithEmailAndPassword:E,sendSignInLinkToEmail:S,signInWithGoogle:D,singInWithCustomToken:C,logout:f,updateAuthState:y},children:t})},y=e=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(P,{...e})});_.Consumer},67582:(e,t,i)=>{i.d(t,{ss:()=>g,Jt:()=>_,fc:()=>y,y0:()=>P,Jb:()=>m,oU:()=>v});var n=i(75881),a=i(9310),s=i(69594),o=i(88324),r=i(95136),d=i.n(r),l=i(32072),c=i(25993);let u=e=>c.Ay.request({url:"/oms/coupon/redemptions",params:e,method:"get"}),p=e=>c.Ay.request({url:"/oms/coupon/redeem",data:{coupon_code:e},method:"post"}),h=()=>c.Ay.request({url:"/oms/coupon/redeemOnEvent",data:{event_type:"signup"},method:"post"});var g=function(e){return e.queryCoupons="getCoupons",e.queryCouponsInfinite="getCouponsInfinite",e.getCouponDetailByCode="getCouponDetailByCode",e}({});let v=(e,t)=>(0,n.useQuery)({queryKey:["getCoupons",e],queryFn:async()=>{let{data:e}=await u({page_size:100});if(e&&d()(e,"data_list"))return e.data_list},enabled:!!e&&!!t}),m=(e,t,i)=>(0,a.useInfiniteQuery)({queryKey:["getCouponsInfinite",e,t],queryFn:async t=>{let{pageParam:i=""}=t,{data:n}=await u({...e,next_page_token:i});if(n&&d()(n,"data_list")&&d()(n,"next_page_token")){let e=n.next_page_token;return{data:n.data_list,next:e}}},initialPageParam:"",enabled:!!t&&!!i,getNextPageParam:e=>null==e?void 0:e.next}),_=()=>{let e=(0,s.useQueryClient)();return(0,o.useMutation)({mutationFn:p,onSuccess:t=>{let{data:i}=t;"fail"===i.status?l.default.error(i.reason):l.default.success("Redeem coupon successful"),e.invalidateQueries({queryKey:["getCoupons"]}),e.invalidateQueries({queryKey:["getCouponsInfinite"]})},onError:e=>{var t,i;(null==e||null==(t=e.data)?void 0:t.status)==="fail"&&l.default.error(null==e||null==(i=e.data)?void 0:i.reason)}})},P=()=>{let e=(0,s.useQueryClient)();return(0,o.useMutation)({mutationFn:h,onSettled:()=>{e.invalidateQueries({queryKey:["getCoupons"]}),e.invalidateQueries({queryKey:["getCouponsInfinite"]})}})},y=e=>(0,n.useQuery)({queryKey:["getCouponDetailByCode",e],queryFn:async()=>{if(!e)return null;let{data:t}=await c.Ay.request({url:"/oms/coupon/coupons/code/".concat(e),method:"get"});return t&&t.data?t.data:null},enabled:!!e})},77993:(e,t,i)=>{i.d(t,{j:()=>r,x:()=>o});var n=i(10874),a=i(86638),s=i(97567);let o=(0,n.Wp)({apiKey:"AIzaSyCbPNl5Yi81vB5gUe5cL-SgGUP7PM3puG4",authDomain:"plantstory-70795.firebaseapp.com",databaseURL:s.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL,projectId:"plantstory-70795",appId:"1:671518116516:web:6365ed8580c5e221ef3431",measurementId:"G-1579Y6GWMJ",storageBucket:s.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET}),r=(0,a.xI)(o)}}]);
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.