1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[371],{1e3:(e,t,a)=>{a.d(t,{b:()=>r,u:()=>n});let r={productsTopPicks:"products-top-picks",productsRecentlyViewed:"products-recently-viewed",productsYouMayAlsoLike:"products-you-may-like",productsTrending:"products-trending",showsRecentlyViewed:"shows-recently-viewed",showsTrending:"shows-trending",channelsTrending:"channels-trending"},n=Number("128")||256},1798:(e,t,a)=>{a.d(t,{$r:()=>c,ZH:()=>l,_8:()=>o,uk:()=>n,xt:()=>i});var r=a(7451);let n=e=>Object.keys(e).reduce((t,a)=>{let r=e[a];return null!=r&&(t[a]=Array.isArray(r)?r:[r]),t},{}),s=e=>{let{key:t,start:a,end:r,inclusive:n=!1}=e,s=o(a),i=o(r);return s||i?{[t]:[{...s&&{start:s},...i&&{end:i},inclusive:n}]}:{}},i=e=>{let{price:t,availableStock:a,comparesAtPrice:n,airDateTimestamp:i,duration:o,views:l}=e,c=s({key:"price",start:t.start,end:t.end,inclusive:!0}),u=s({key:"comparesAtPrice",start:n.start,end:n.end}),d=(e=>{let{key:t="availableStock",start:a}=e;return a?{[t]:[{start:a?0:void 0,end:void 0}]}:{}})({key:"availableStock",start:a.start,end:a.end}),h=s({key:"airDateTimestamp",start:i.start,end:i.end}),p=s({key:"duration",start:o.start?String(6e4*parseInt(o.start)):void 0,end:o.end?String(6e4*parseInt(o.end)):void 0,inclusive:!0}),v=s({key:"views",start:l.start,end:l.end,inclusive:!0});return{...(0,r.G)(c)&&{...c},...(0,r.G)(d)&&{...d},...(0,r.G)(u)&&{...u},...(0,r.G)(h)&&{...h},...(0,r.G)(p)&&{...p},...(0,r.G)(v)&&{...v}}};function o(e){if(null==e||""===e)return;let t=Number(e);return Number.isInteger(t)&&t>0?t:void 0}let l=e=>e&&""!==e.trim()?e[0].toUpperCase()+e.slice(1):"",c=e=>{if(e)return Array.isArray(e)?e:e.split(";")}},2376:(e,t,a)=>{a.d(t,{z:()=>r});var r=function(e){return e.RELEVANCE="relevance",e.AIR_DATE_ASC="airDate",e.BEST_SELLERS="bestsellers",e.AIR_DATE_DESC="-airDate",e.CREATED_AT_ASC="createdAt",e.CREATED_AT_DESC="-createdAt",e.NAME_ASC="name",e.NAME_DESC="-name",e.PRICE_ASC="price",e.PRICE_DESC="-price",e.RECOMMENDED="recommended",e}({})},2874:(e,t,a)=>{a.d(t,{Z:()=>l,x:()=>o});var r=a(5183),n=a(6829),s=a(5247),i=a(4765);class o extends r.G{getDefaultHeaders(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t={"Content-Type":"application/json",Accept:"application/json"},a=(0,n.gf)();if(a)t.Authorization=a;else if(e){let e=(0,n.oQ)();e&&(t["x-spree-order-token"]=e)}return t}async fetchUserByToken(){if(!(0,n.gf)())return null;let e=this.getDefaultHeaders(),t=await this.get({path:"auth/me",headers:e});return(null==t?void 0:t.success)&&t.data&&t.data.user||null}async getSignedUploadUrl(e){var t;let{objectName:a,contentType:r,storeId:n,type:s}=e,i=this.getDefaultHeaders(),o=await this.post({path:"api/v1/upload",headers:i,body:{objectName:a,contentType:r,type:s,store_id:n}});return(null==o||null==(t=o.data)?void 0:t.data)?{signedUrl:o.data.data.signed_url,upload:{id:o.data.data.id}}:null}async fetchCurrentOrder(){if(!(0,n.gf)())return null;let e=this.getDefaultHeaders();return this.get({path:"api/orders/current",headers:e})}async fetchGuestOrder(){let e=(0,n.oQ)(),t=(0,n.sN)();return e&&t?await this.get({path:"api/orders/".concat(t),headers:{"Content-Type":"application/json","x-spree-order-token":e}}):null}async updateQuantity(e){let{id:t,quantity:a,affiliate_store_id:r,productId:n,currentOrder:s}=e,i=s;if(!i){var o;let e=await this.fetchCurrentOrder();i=null==e||null==(o=e.data)?void 0:o.order}let l=null==i?void 0:i.number,c=this.getDefaultHeaders(!0),u=await this.post({path:"api/orders/".concat(l,"/line_items/").concat(t),headers:c,body:{line_item:{quantity:a,affiliate_store_id:r}}});if(!(null==u?void 0:u.success))return null;if(0===a&&n&&await this.discoveryService.removeFromCartInteraction({productId:n}),!l)throw Error("Order number is undefined");return await this.calculateCost({id:t,quantity:a,affiliate_store_id:r,orderNumber:l})}async calculateCost(e){let{id:t,quantity:a,affiliate_store_id:r,lineItem:n,orderNumber:s}=e;if(!s)throw Error("Order number is required for calculating costs");let i=this.getDefaultHeaders(!0);return this.post({path:"api/orders/".concat(s,"/calculate_costs"),headers:i,body:n?{checkout:!1,line_item:n}:{quantity:a,affiliate_store_id:r,id:t}})}async deleteItemFromCart(e){let{id:t,productId:a,currentOrder:r}=e,n=r;if(!r){var s;let e=await this.fetchCurrentOrder();n=null==e||null==(s=e.data)?void 0:s.order}let i=null==n?void 0:n.number,o=this.getDefaultHeaders(!0),l=await this.delete({path:"api/orders/".concat(i,"/line_items/").concat(t),headers:o});if(!(null==l?void 0:l.success))return l;if(await this.discoveryService.removeFromCartInteraction({productId:a}),!i)throw Error("Order number is undefined");return await this.calculateCost({id:t,orderNumber:i})||null}async addItemToCart(e){var t,a,r,s,i;let{productId:o,lineItem:l,price:c,recommId:u,currentOrder:d,isLoggedIn:h,isDonation:p}=e,v=(0,n.gf)(),f=(0,n.oQ)(),g=(0,n.sN)(),y=d;if((v&&!h||v&&f)&&((0,n.HI)(),(0,n.Pu)(),g=void 0),!v&&f&&g&&!y){let e=await this.fetchGuestOrder();y=null==e||null==(t=e.data)?void 0:t.order}if(!y&&h){let e=await this.fetchCurrentOrder();y=null==e||null==(a=e.data)?void 0:a.order}if((null==y?void 0:y.state)==="complete"&&(y=void 0,(0,n.HI)()),!g&&y&&(g=y.number,(0,n.CU)(y.number)),!v&&!f&&!g&&!y){let e=await this.createGuestCheckout();(y=null==e||null==(r=e.data)?void 0:r.order)&&(g=y.number,(0,n.CU)(y.number),(0,n.ir)(y.guest_token))}if(!y&&h){let e=await this.createOrder();y=null==e||null==(s=e.data)?void 0:s.order}if(!y)throw Error("Order number is undefined");let m=await this.addLineItem({lineItem:l,currentOrder:y});if(!(null==m?void 0:m.success)||p)return m;let w=null!=(i=await this.calculateCost({lineItem:l,orderNumber:null==y?void 0:y.number}))?i:null;return await this.discoveryService.addToCartInteraction({productId:o,price:c,recommId:u}),w}
1async addLineItem(e){let{lineItem:t,currentOrder:a}=e,r=(0,n.gf)(),s=(0,n.oQ)(),i=(0,n.sN)(),o=null==a?void 0:a.number;s||!a||r||(s=a.guest_token,(0,n.ir)(a.guest_token)),!i&&a&&(0,n.CU)(a.number);let l=this.getDefaultHeaders(!0);return this.post({path:"api/orders/".concat(o,"/line_items"),headers:l,body:{checkout:!1,line_item:t}})}async createGuestCheckout(){let e=this.getDefaultHeaders();return this.post({path:"api/guest_order?domain=talkshop.live",headers:e,body:{}})}async createOrder(){let e=this.getDefaultHeaders();return await this.post({path:"api/orders?domain=talkshop.live",headers:e,body:{}})}createExpressCheckout(e){let{variantId:t,quantity:a}=e,r=this.getDefaultHeaders(!0),n={...(0,s.I_)(),...(0,s.E5)()},i=Object.keys(n).length>0;return this.post({path:"api/v1/checkouts",headers:r,body:{checkout:{items:[{variant_id:t,quantity:a}],...i?{attribution:n}:{}}}})}async completeOrder(e){let{orderNumber:t}=e,a=this.getDefaultHeaders(!0),r={...(0,s.I_)(),...(0,s.E5)()},n=Object.keys(r).length>0;return await this.put({path:"api/checkouts/".concat(encodeURIComponent(t),"/complete?domain=talkshop.live"),headers:a,body:n?{attribution:r}:{}})}async fetchUserById(e){let t=this.getDefaultHeaders();return await this.get({path:"api/users?page=1&per_page=25&ids[]=".concat(e),headers:t})}async fetchShowStatus(e){var t;let{showKey:a}=e,r=this.getDefaultHeaders(),n=await this.get({path:"api/v1/shows/".concat(a,"/status"),headers:r});if(!(null==n?void 0:n.success))return null;let s=null==n||null==(t=n.data)?void 0:t.data;if(!(null==s?void 0:s.state))return null;let{state:i,...o}=s;return{state:i,live:o.url?o:void 0}}async fetchShowProductEntries(e){var t,a,r;let{showKey:n}=e,s=this.getDefaultHeaders(),i=await this.get({path:"api/v1/shows/".concat(n,"?expand=show_products"),headers:s});return(null==i?void 0:i.success)&&null!=(r=null==i||null==(a=i.data)||null==(t=a.data)?void 0:t.show_products)?r:null}async fetchShowByKey(e){var t;let{showKey:a,originalForwardedForHeader:r}=e,n=this.getDefaultHeaders();r&&(n["X-Forwarded-For"]=r);let s=await this.get({path:"api/v1/shows/".concat(a,"?expand=channel,fundraiser"),headers:n});return(null==s?void 0:s.success)&&(null==s||null==(t=s.data)?void 0:t.data)||null}async fetchShowForWatch(e){var t;let{showKey:a,originalForwardedForHeader:r,authToken:n}=e,s=this.getDefaultHeaders();n&&(s.Authorization=n),r&&(s["X-Forwarded-For"]=r);let i=await this.get({path:"api/v1/shows/".concat(a,"?expand=channel,fundraiser,assets,show_products,partners"),headers:s});if(!(null==i?void 0:i.success))return null;let o=null==i||null==(t=i.data)?void 0:t.data;if(!o)return null;if(o.assets){o.assets.forEach(e=>{"vod"===e.type&&e.file_extension?o["vod_".concat(e.file_extension)]=e:o[e.type]=e});let e=o.vod_mp4;e&&!e.transcription_url&&e.url&&(e.transcription_url=e.url.replace("/vod/processed/mp4/","/vod/processed/transcription/").replace(/\.mp4$/,".transcript.vtt"),o.vod_m3u8&&!o.vod_m3u8.transcription_url&&(o.vod_m3u8.transcription_url=e.transcription_url)),delete o.assets}return o}async fetchTestShowStatus(e){var t;let{showKey:a}=e,r=this.getDefaultHeaders(),n=await this.get({path:"api/v1/shows/".concat(a,"/test?expand=assets"),headers:r});if(!(null==n?void 0:n.success))return null;let s=null==n||null==(t=n.data)?void 0:t.data;if(!s)return null;s.assets&&(s.assets.forEach(e=>{s[e.type]=e}),delete s.assets);let i=s.test;if(null==i?void 0:i.state){let e=i.state;return{state:e,live:"live"===e||"transcoding"===e?i:void 0}}return{state:s.state}}async fetchTestShowForWatch(e){var t;let{showKey:a,originalForwardedForHeader:r,authToken:n,testAccessToken:s}=e,i=this.getDefaultHeaders();n&&(i.Authorization=n),r&&(i["X-Forwarded-For"]=r);let o=s?"&token=".concat(encodeURIComponent(s)):"",l=await this.get({path:"api/v1/shows/".concat(a,"/test?expand=channel,fundraiser,assets,show_products,partners").concat(o),headers:i});if(!(null==l?void 0:l.success))return null;let c=null==l||null==(t=l.data)?void 0:t.data;if(!c)return null;if(c.assets){c.assets.forEach(e=>{"vod"===e.type&&e.file_extension?c["vod_".concat(e.file_extension)]=e:c[e.type]=e});let e=c.vod_mp4;e&&!e.transcription_url&&e.url&&(e.transcription_url=e.url.replace("/vod/processed/mp4/","/vod/processed/transcription/").replace(/\.mp4$/,".transcript.vtt"),c.vod_m3u8&&!c.vod_m3u8.transcription_url&&(c.vod_m3u8.transcription_url=e.transcription_url)),delete c.assets}let u=c.test;if(null==u?void 0:u.state){let e=u.state;c.state=e,"live"===e||"transcoding"===e?c.live=u:"vod"===e&&(c.live=u,c.vod_mp4=u)}return c}async getMultipleProducts(e){var t;let{ids:a,limit:r=50,include:n,useCache:s=!1}=e,i="/api/".concat(s?"fetch_multiple_products":"products","?per_page=").concat(r,"&ids[]=").concat([...new Set(a
1)].join("&ids[]="),"&exclude_deleted=true&order_by=array_order");n&&(i+="&include=".concat(n));let o=this.getDefaultHeaders(),l=await this.get({path:i,headers:o});return(null==l?void 0:l.success)&&(null==l||null==(t=l.data)?void 0:t.products)||null}async getUserSubscriptions(e){var t;let{userId:a,channelIds:r}=e,n=this.getDefaultHeaders(),s=(null==r?void 0:r.length)||0;if(!s)return null;let i="api/v1/users/".concat(a,"/subscriptions?");r.forEach((e,t)=>{i+="channel_ids[]=".concat(e).concat(t<s-1?"&":"")});let o=await this.get({path:i,headers:n});return(null==o?void 0:o.success)&&(null==o||null==(t=o.data)?void 0:t.data)||null}async userSubscribeToChannel(e){var t;let{userId:a,channelId:r}=e,n=this.getDefaultHeaders();if(!r||!a)return null;let s=await this.post({path:"api/v1/users/".concat(a,"/subscriptions"),headers:n,body:{channel_id:r}});return(null==s?void 0:s.success)&&(null==s||null==(t=s.data)?void 0:t.data)||null}async guestSubscribeToChannel(e){var t;let{channelId:a,notificationType:r,guestInput:n,recaptchaResponse:s}=e,i=this.getDefaultHeaders();if(!a||!r||!n||!s)return null;let o=await this.post({path:"api/v1/guest/subscriptions",headers:i,body:{subscription:{channel_id:a,notification_type:r,guest_input:n},recaptcha_response:s}});return(null==o?void 0:o.success)&&(null==o||null==(t=o.data)?void 0:t.data)||null}async unsubscribeFromChannel(e){let{userId:t,subscriptionId:a}=e,r=this.getDefaultHeaders();if(!a||!t)return null;let n=await this.delete({path:"api/v1/users/".concat(t,"/subscriptions/").concat(a),headers:r});return!!(null==n?void 0:n.success)||null}async getProductByKey(e){var t;let{productKey:a,originalForwardedForHeader:r}=e;if(!a)return null;let n=this.getDefaultHeaders();r&&(n["X-Forwarded-For"]=r);let s=await this.get({path:"api/v1/products/".concat(a,"?expand=channel,master,variants,by_line_channel,shipping_method"),headers:n});return(null==s?void 0:s.success)&&(null==s||null==(t=s.data)?void 0:t.data)||null}async fetchChannelByStub(e){var t;let{channelStub:a,originalForwardedForHeader:r}=e,n=this.getDefaultHeaders();r&&(n["X-Forwarded-For"]=r);let s=await this.get({path:"api/stores/stub-".concat(a),headers:n});return(null==s||null==(t=s.data)?void 0:t.store)||null}async fetchChannelLiveShows(e){let{storeId:t,page:a=1,limit:r=6}=e,n=this.getDefaultHeaders(),s=await this.get({path:"api/v1/shows/channels/".concat(t,"/live?per_page=").concat(r,"&page=").concat(a,"&expand=channel"),headers:n});return(null==s?void 0:s.success)&&(null==s?void 0:s.data)||null}async fetchChannelUpcomingShows(e){let{storeId:t,page:a=1,limit:r=6}=e,n=this.getDefaultHeaders(),s=await this.get({path:"api/v1/shows/channels/".concat(t,"/upcoming?per_page=").concat(r,"&page=").concat(a,"&expand=channel"),headers:n});return(null==s?void 0:s.success)&&(null==s?void 0:s.data)||null}async fetchChannelPreviousShows(e){let{storeId:t,page:a=1,limit:r=6}=e,n=this.getDefaultHeaders(),s=await this.get({path:"api/v1/shows/channels/".concat(t,"/vod?per_page=").concat(r,"&page=").concat(a,"&expand=channel"),headers:n});return(null==s?void 0:s.success)&&(null==s?void 0:s.data)||null}async fetchChannelProducts(e){let{storeId:t,page:a=1,limit:r=12}=e,n=this.getDefaultHeaders(),s=await this.get({path:"api/products?store_ids[]=".concat(t,"&eventless=true&is_published=1&per_page=").concat(r,"&page=").concat(a,"&order_by=updated_at&order=desc&exclude_deleted=true&exclude=streaming_content"),headers:n});return(null==s?void 0:s.success)&&(null==s?void 0:s.data)||null}async markUploadComplete(e){let t=this.getDefaultHeaders(),a=await this.put({path:"api/uploads/".concat(e),headers:t,body:{upload:{state:"uploaded"}}});return(null==a?void 0:a.success)===!0}async addCollaboratorPartnership(e){var t;let{userStoreId:a,channelId:r}=e,n=this.getDefaultHeaders(),s=await this.post({path:"api/stores/".concat(a,"/syndications/partnerships"),headers:n,body:{syndication_relationship:{authorized_store_id:r}}});return(null==s?void 0:s.success)&&(null==s||null==(t=s.data)?void 0:t.syndication_relationship)?{id:s.data.syndication_relationship.id,authorized_store_id:r,partner_store_id:a}:null}async deleteCollaboratorPartnership(e){let{userStoreId:t,partnershipId:a}=e,r=this.getDefaultHeaders(),n=await this.delete({path:"api/stores/".concat(t,"/syndications/partnerships/").concat(a),headers:r});return(null==n?void 0:n.success)===!0}async sendEmailConfirmation(e){let{email:t}=e;if(!t)return null;let a=this.getDefaultHeaders(),r=await this.post({path:"auth/v1/resend_confirmation_instructions",headers:a,body:{user:{email:t}}});return!!(null==r?void 0:r.success)||null}async suspendUser(e,t){let a=this.getDefaultHeaders(),r=await this.put({path:"api/users/".concat(e),headers:a,body:{user:{is_suspended:t}}});return(null==r?void 0:r.success)===!0}async trackAffiliateLinkClick(e){let{variant_id:t,event_id:a,product_id:r,price:n}=e,s=this.getDefaultHeaders();await Promise.all([this.post({path:"api/affiliate_links/events",headers:s,body:{event:{variant_id:t,event_id:a,type:"click",host:window.location.href}}}),this.discoveryService.addToCartInteraction({productId:"product-".concat(r),price:n})])}constructor(){super("https://cms.talkshop.live"),this.discoveryService=i.C}}let l=new o},4076:(e,t,a)=>{a.d(t,{h:()=>d,Z:()=>h});var r=a(5155),n=a(2115),s=a(2692),i=a(2874),o=a(9342),l=a(926);let c=(0,l.createServerReference)("005804e3bf032e834eaf6ead7f6e54598606b74796",l.callServer,void 0,l.findSourceMapURL,"getChannelIdsFromDataStore"),u=(0,n.createContext)({user:null,setUser:()=>{},logout:()=>{},isCurrentUserLoading:!1,isAdmin:!1,isImpersonationActive:!1,impersonatedUser:null,originalAdminUser:null,isLoggedIn:!1,isSubscriptionLoading:!1,isChannelSubscriptionLoading:()=>!1,onFetchUserSubscriptions:async()=>Promise.resolve(),isSeller:!1});function d(e){var t;let{children:a}
1=e,[l,d]=(0,n.useState)(null),[h,p]=(0,n.useState)(null),[v,f]=(0,n.useState)(null),[g,y]=(0,n.useState)(!0),[m,w]=(0,n.useState)([]),[_,b]=(0,n.useState)({}),[k,C]=(0,n.useState)([]),S=async()=>{d(null),w([]),(0,s.deleteCookie)("token"),(0,s.deleteCookie)("order_number"),(0,s.deleteCookie)("guestId")},E=async()=>{var e,t,a;let r=await new i.x().fetchUserByToken();if((0,o.jZ)()){let e=(0,o.jV)();if(e){y(!1),f(e.originalAdminUser);let t=e.impersonatedUser.id,{data:r}=await new i.x().fetchUserById(t);(null==r?void 0:r.users)&&(null==r||null==(a=r.users)?void 0:a.length)>0?(d(null==r?void 0:r.users[0]),p(null==r?void 0:r.users[0])):console.warn("No user found for impersonation ID:",t);return}}d(r),C((null==r||null==(t=r.managing_stores)||null==(e=t[0])?void 0:e.syndication_relationships)||[]),(null==r?void 0:r.id)&&await I(r.id),y(!1)},I=async(e,t)=>{let a=t?[t]:await c(),r=await i.Z.getUserSubscriptions({userId:e,channelIds:a})||[];w(e=>[...e,...r])},D=e=>{w(t=>[...t,e])},A=(e,t)=>{b(a=>({...a,[e]:t}))},H=async e=>{if(!l||_[e])return;A(e,!0);let t=await i.Z.userSubscribeToChannel({userId:l.id,channelId:e});if(!t)return void A(e,!1);D(t),A(e,!1)},O=async e=>{if(!l)return;let t=m.find(t=>t.id===e),a=null==t?void 0:t.channel_id;if(a&&!_[a]){if(A(a,!0),!await i.Z.unsubscribeFromChannel({userId:l.id,subscriptionId:e}))return void A(a,!1);w(t=>t.filter(t=>t.id!==e)),A(a,!1)}};(0,n.useEffect)(()=>{E()},[]);let T=!!(null==l?void 0:l.has_app_manage_permissions)||(0,o.jZ)(),F=!!l,N=!!(l&&(null==l?void 0:l.confirmed_at)),R=null==l?void 0:l.email,U=!!(null==l||null==(t=l.managing_stores)?void 0:t.length);return(0,r.jsx)(u.Provider,{value:{user:l,setUser:d,logout:S,isCurrentUserLoading:g,impersonatedUser:h,originalAdminUser:v,isAdmin:T,isLoggedIn:F,userSubscriptions:m,onSubscribeToChannel:H,isSubscriptionLoading:Object.values(_).some(Boolean),isChannelSubscriptionLoading:e=>!!_[e],onUnsubscribeFromChannel:O,onAddSubscriptionToState:D,syndicationRelationships:k,onCreateSyndicationRelationship:e=>{C(t=>[...t,e])},onDeleteSyndicationRelationship:e=>{l&&C(t=>t.filter(t=>t.id!==e))},isUserEmailConfirmed:N,userEmail:R,onFetchUserSubscriptions:I,isSeller:U},children:a})}function h(){let e=(0,n.useContext)(u);if(void 0===e)throw Error("useAuthContext should be used within the AuthContext provider!");return e}},4765:(e,t,a)=>{a.d(t,{C:()=>u});var r=a(5183),n=a(1798),s=a(7451),i=a(2376),o=a(6829),l=a(1e3);class c extends r.G{async generateDiscoveryHeaders(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t={"Content-Type":"application/json",Accept:"application/json"};if(!e)return t;let a=await (0,o.vW)();if(a)return{...t,Authorization:a};let r=await (0,o.lH)();return r?{...t,"Guest-Id":r}:t}isInvalidRequest(e){let{token:t,guestId:a,scenario:r}=e,n=[l.b.productsTopPicks,l.b.showsRecentlyViewed],s=[l.b.productsRecentlyViewed,l.b.productsYouMayAlsoLike];return n.includes(r)?!t:!!s.includes(r)&&!t&&!a}async addGuestId(e){let t=await (0,o.lH)();await (0,o.vW)()||t||!e||(0,o.Gu)(e)}async search(e){var t;let{query:a,category:r,channelName:o,type:c,page:u,perPage:d,sort:h,tags:p,startPrice:v,endPrice:f,availableStock:g,isPreSale:y,streamingStatus:m,comparesAtPrice:w,matureContent:_,isVerified:b,originalForwardedForHeader:k,startDuration:C,endDuration:S,minViews:E,maxViews:I,bypassQueryCheck:D=!1,categoryPath:A,flags:H,channelIds:O}=e;if(!D&&(!a||(null==a?void 0:a.length)>l.u))return null;let T={"Content-Type":"application/json"};k&&(T["X-Forwarded-For"]=k);let F=!c||"all"===c,N="product"===c,R="show"===c,U="channel"===c,P="true"===_,x=(0,n.$r)(r),G=(0,n.$r)(A),j=(0,n.$r)(p),L=(0,n.$r)(g),M=(0,n.$r)(o),W=(0,n.$r)(H),X=(0,n.$r)(O),$=null==(t=(0,n.$r)(m))?void 0:t.map(e=>"live"===e?"live":"upcoming"===e?"upcoming":"vod"),V=null==L?void 0:L.includes("Include out of stock"),B={query:a,...!(!h||!Object.values(i.z).includes(h))&&{sort:h}},q=(0,n.uk)({category:x,categoryPath:G,channelName:M,tags:j,channelId:X,flags:W,streamingStatus:$,...c&&"all"!==c&&{type:c}});F&&P&&(q.matureContent="all"),y&&(q.isPreSale=!0),N&&(q.isFundraiser=!1),R&&P&&(q.matureContent="all"),U&&(q.isVerified="true"===b||void 0);let J=(0,n.xt)({price:{start:v,end:f},comparesAtPrice:{start:"true"===w?"1":void 0,end:void 0},availableStock:{start:V?"0":void 0,end:void 0},airDateTimestamp:{start:void 0,end:void 0},duration:{start:C,end:S},views:{start:E,end:I}}),Y={page:(0,n._8)(u)||1,perPage:(0,n._8)(d)||12};(0,s.G)(q)&&(B.filters=q),(0,s.G)(J)&&(B.numericFilters=J),(0,s.G)(Y)&&(B.pagination=Y);let Z=await this.post({body:B,path:"search",headers:T});return(null==Z?void 0:Z.success)&&(null==Z?void 0:Z.data)||null}async getRecommendations(e){let{scenario:t,count:a,category:r,categoryPath:i,tags:c,booster:u,shouldIncludeAuth:d=!0,isVerified:h,flags:p,originalForwardedForHeader:v}=e,f=await (0,o.vW)(),g=await (0,o.lH)();if(this.isInvalidRequest({token:f,guestId:g,scenario:t}))return null;let y=await this.generateDiscoveryHeaders(d);v&&(y["X-Forwarded-For"]=v);let m="true"===h||void 0,w=(0,n.$r)(r),_=(0,n.$r)(i),b=(0,n.$r)(c),k=(0,n.$r)(p),C=a||(t===l.b.productsRecentlyViewed||t===l.b.productsTrending?7:3),S=(0,n.uk)({category:w,categoryPath:_,tags:b,flags:k}),E={scenario:t,count:C,booster:u};m&&(S.isVerified=m),(0,s.G)(S)&&(E.filters=S);let I=await this.post({path:"recommendations/user",body:E,headers:y});return(null==I?void 0:I.success)&&(null==I?void 0:I.data)||null}async getTopSearches(){let{originalForwardedForHeader:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={"Content-Type":"application/json"};e&&(t["X-Forwarded-For"]=e);let a=await this.get({headers:t,path:"top-searches?limit=20"});return(null==a?void 0:a.success)&&(null==a?void 0:a.data)||null}async addViewInteraction(e){var t;let{entity:a,objectId:r}=e,n=await (0,o.lH)();if(!r||!n&&"product"!==a)return null;let s=await this.generateDiscoveryHeaders(),i=null==r?void 0:r.split("-")[1],l=await this.post({path:"interactions/".concat(a,"/").concat(i),body:{},headers:s});if(!(null==l?void 0:l.success))return null;
1let c=null==l||null==(t=l.data)?void 0:t.guest;return await this.addGuestId(c),(null==l?void 0:l.data)||null}async addToCartInteraction(e){var t;let{productId:a,price:r,recommId:n}=e;if(!a)return null;let s=await this.generateDiscoveryHeaders(),i=await this.post({path:"interactions/cart/add",body:{itemId:a,amount:1,price:Number(Number(r).toFixed(2)),recommId:n},headers:s});if(!(null==i?void 0:i.success))return null;let o=null==i||null==(t=i.data)?void 0:t.guest;return await this.addGuestId(o),(null==i?void 0:i.data)||null}async removeFromCartInteraction(e){let{productId:t}=e;if(!t)return null;let a=await this.generateDiscoveryHeaders(),r=await this.post({path:"interactions/cart/delete",body:{itemId:"product-".concat(t)},headers:a});return(null==r?void 0:r.success)&&(null==r?void 0:r.data)||null}async getCategoryPage(e){let{category:t,originalForwardedForHeader:a,shouldPreload:r=!0}=e;if(!t)return null;let n=await this.generateDiscoveryHeaders();a&&(n["X-Forwarded-For"]=a);let s=await this.get({path:"categories/".concat(t).concat(r?"?preload=product,channel,show":""),headers:n});return(null==s?void 0:s.success)&&(null==s?void 0:s.data)||null}async getSubCategoryData(e){let{category:t,originalForwardedForHeader:a,subCategory:r}=e;if(!t)return null;let n=await this.generateDiscoveryHeaders();a&&(n["X-Forwarded-For"]=a);let s=await this.get({path:"categories/".concat(t,"/").concat(r,"?preload=product,channel,show"),headers:n});return(null==s?void 0:s.success)&&(null==s?void 0:s.data)||null}async getRecentlyAddedProducts(e){let{subcategory:t,originalForwardedForHeader:a}=e,r=await this.generateDiscoveryHeaders(!1);a&&(r["X-Forwarded-For"]=a);let n=await this.post({path:"products/recently-added",headers:r,body:{numericFilters:{createdAt:[{start:1748736e3}]},...t&&{filters:{categoryPath:t}}}});return(null==n?void 0:n.success)&&(null==n?void 0:n.data)||null}async getPinnedItems(e){let{type:t,originalForwardedForHeader:a}=e,r=await this.generateDiscoveryHeaders(!1);a&&(r["X-Forwarded-For"]=a);let n=await this.post({path:"pinned-items",headers:r,body:{filters:{type:t,count:15}}});return(null==n?void 0:n.success)&&(null==n?void 0:n.data)||null}async getProductsByShowKey(e){let{showKey:t}=e,a=await this.generateDiscoveryHeaders(!1),r=await this.get({headers:a,path:"shows/".concat(t,"/products")});return(null==r?void 0:r.success)&&(null==r?void 0:r.data)||null}async getHomePageCarouselData(e){let{originalForwardedForHeader:t}=e,a=await this.generateDiscoveryHeaders();t&&(a["X-Forwarded-For"]=t);let r=await this.post({path:"shows/upcoming-and-live",body:{},headers:a});return(null==r?void 0:r.success)&&(null==r?void 0:r.data)||null}constructor(){super("https://discovery.talkshop.live/v1")}}let u=new c},5183:(e,t,a)=>{a.d(t,{G:()=>r});class r{async request(e){let{path:t,method:a,body:r,headers:n,baseUrlIncluded:s=!1,keepalive:i}=e;try{let e=await fetch(s?t:"".concat(this.baseUrl,"/").concat(t),{method:a,headers:n||this.headers,body:r?JSON.stringify(r):void 0,keepalive:i}),o=await e.text(),l=o?JSON.parse(o):null;if(!e.ok)return{success:!1,status:e.status,error:(null==l?void 0:l.message)||(null==l?void 0:l.title)||"An error occurred"};return{success:!0,status:e.status,data:l}}catch(e){return{success:!1,error:e.message||"An error occurred"}}}async get(e){let{path:t,headers:a,baseUrlIncluded:r}=e;return this.request({path:t,method:"GET",headers:a,baseUrlIncluded:r})}async post(e){let{path:t,body:a,headers:r,baseUrlIncluded:n,keepalive:s}=e;return this.request({path:t,method:"POST",body:a,headers:r,baseUrlIncluded:n,keepalive:s})}async patch(e){let{path:t,body:a,headers:r,baseUrlIncluded:n}=e;return this.request({path:t,method:"PATCH",body:a,headers:r,baseUrlIncluded:n})}async delete(e){let{path:t,headers:a,baseUrlIncluded:r}=e;return this.request({path:t,method:"DELETE",headers:a,baseUrlIncluded:r})}async deleteWithBody(e){let{path:t,body:a,headers:r,baseUrlIncluded:n}=e;return this.request({path:t,method:"DELETE",body:a,headers:r,baseUrlIncluded:n})}async put(e){let{path:t,body:a,headers:r,baseUrlIncluded:n}=e;return this.request({path:t,method:"PUT",body:a,headers:r,baseUrlIncluded:n})}constructor(e,t){this.baseUrl=e,this.headers=t}}},5247:(e,t,a)=>{let r,n;a.d(t,{E5:()=>m,I_:()=>w,YA:()=>y});var s=a(9998),i=a(6512);let o={google:["gclid","wbraid","gbraid"],meta:["fbclid"],tiktok:["ttclid"],microsoft:["msclkid"]};Object.values(o).flat();let l=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],
1c={fbc:"_fbc",fbp:"_fbp"},u="tsl_attribution",d=()=>({v:1,clickIds:{},utm:{}});function h(){try{let e=window.localStorage.getItem(u);if(!e)return d();let t=JSON.parse(e);if(!t||1!==t.v)return d();return{v:1,clickIds:p(t.clickIds),utm:p(t.utm)}}catch(e){return d()}}function p(e){if(!e)return{};let t=Date.now(),a={};for(let[r,n]of Object.entries(e))n&&"string"==typeof n.value&&"number"==typeof n.ts&&(t-n.ts>7776e6||(a[r]=n));return a}function v(e){let t=h();for(let a of Object.keys(e.clickIds)){let r=e.clickIds[a];if(r){for(let e of o[a])delete t.clickIds[e];for(let[e,a]of Object.entries(r.values))t.clickIds[e]={value:a,ts:r.ts}}}if(e.utm)for(let[a,r]of(t.utm={},Object.entries(e.utm.values)))t.utm[a]={value:r,ts:e.utm.ts};try{window.localStorage.setItem(u,JSON.stringify(t))}catch(e){}}let f=!1;function g(){if(!(0,i.XW)("marketing"))return;let e=r;r=void 0,f=!1,null==n||n(),n=void 0,e&&v(e)}function y(e){let t=function(e,t){let a=new URLSearchParams(e),r=e=>{let t=a.get(e);if("string"!=typeof t)return;let r=t.trim();return""===r?void 0:r},n={clickIds:{}},s=!1;for(let e of Object.keys(o)){let a={};for(let t of o[e]){let e=r(t);void 0!==e&&(a[t]=e)}0!==Object.keys(a).length&&(n.clickIds[e]={ts:t,values:a},s=!0)}let i={};for(let e of l){let t=r(e);void 0!==t&&(i[e]=t)}return Object.keys(i).length>0&&(n.utm={ts:t,values:i},s=!0),s?n:void 0}(null!=e?e:window.location.search,Date.now());if(t){if((0,i.XW)("marketing"))return void v(t);!function(e){var t,a;if(r=(t=r)?{clickIds:{...t.clickIds,...e.clickIds},utm:null!=(a=e.utm)?a:t.utm}:e,f)return;f=!0;let s=(0,i.Ym)(g);f?n=s:s()}(t)}}function m(){if(!(0,i.XW)("statistics"))return{};let e=(0,s.u)();return e?{screen_resolution:e.screen_resolution,browser_resolution:e.browser_resolution}:{}}function w(){if(!(0,i.XW)("marketing"))return;let e=h(),t={};for(let[a,r]of Object.entries(e.clickIds))t[a]=r.value;for(let[a,r]of Object.entries(e.utm))t[a]=r.value;for(let[e,a]of Object.entries(c)){let r=function(e){if("undefined"==typeof document)return;let t=document.cookie.match(new RegExp("(?:^|;\\s*)".concat(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"=([^;]*)")));return t?decodeURIComponent(t[1]):void 0}(a);r&&(t[e]=r)}if(!t.fbc){let a=e.clickIds.fbclid;a&&(t.fbc="fb.1.".concat(a.ts,".").concat(a.value))}return Object.keys(t).length>0?t:void 0}},6512:(e,t,a)=>{a.d(t,{Gk:()=>n,O0:()=>l,XW:()=>s,Ym:()=>i,wh:()=>o});let r=["CookiebotOnConsentReady","CookiebotOnAccept","CookiebotOnDecline"],n=()=>{var e;return(null==(e=window.Cookiebot)?void 0:e.hasResponse)===!0},s=e=>{var t,a;return"necessary"===e||(null==(a=window.Cookiebot)||null==(t=a.consent)?void 0:t[e])===!0},i=e=>(n()&&e(),r.forEach(t=>window.addEventListener(t,e)),()=>r.forEach(t=>window.removeEventListener(t,e))),o=e=>{if(n())return e(),()=>{};let t=()=>{};return t=i(()=>{n()&&(t(),e())})},l=()=>{var e;return"function"==typeof(null==(e=window.Cookiebot)?void 0:e.renew)&&(window.Cookiebot.renew(),!0)}},6829:(e,t,a)=>{a.d(t,{CU:()=>v,Gu:()=>f,HI:()=>d,MV:()=>g,Pu:()=>p,gf:()=>l,ir:()=>h,lH:()=>o,oQ:()=>c,sN:()=>u,vW:()=>i});var r=a(2692),n=a(9342);let s=async e=>{{let t=(0,r.getCookie)(e);return"string"==typeof t?t:void 0}},i=async()=>await s("token"),o=async()=>await s("guestId"),l=()=>{let e=(0,r.getCookie)("token");return"string"==typeof e?e:void 0},c=()=>{let e=(0,r.getCookie)("guest_token");return"string"==typeof e?e:void 0},u=()=>{let e=(0,r.getCookie)("order_number");return"string"==typeof e?e:void 0},d=()=>{(0,r.deleteCookie)("order_number")},h=e=>{(0,r.setCookie)("guest_token",e)},p=()=>{(0,r.deleteCookie)("guest_token")},v=e=>{(0,r.setCookie)("order_number",e)},f=e=>{(0,r.setCookie)("guestId",e)},g=()=>{(0,n.LK)()}},7451:(e,t,a)=>{a.d(t,{G:()=>r});let r=e=>e&&"object"==typeof e&&Object.keys(e).length>0},9012:(e,t,a)=>{a.d(t,{BV:()=>c,M2:()=>r,b8:()=>n});let r="https://stg.admin-dashboard.tslstg.com/",n="https://admin-dashboard.talkshop.live/",s="/settings",i="".concat(s,"/account"),o="".concat(s,"/sell-live"),l="/manage",c={HOME:"/",FEATURES:"/features",LOGOUT:"/logout",PRODUCT:"/product",SHOW:"/watch",MANAGE_SHOWS:"".concat(l,"/shows"),MANAGE_SHOWS_LEGACY:"".concat(o,"/products/digital/create"),APP_STORE:"".concat(o,"/apps"),API:"".concat(i,"/api"),PROFILE:"".concat(i,"/profile"),PURCHASES:"".concat(l,"/shopper/purchases"),PAYMENTS:"".concat(s,"/shopper/payment-methods"),SHIPPING:"".concat(i,"/shipping"),CHANNELS:"/channels",SELL_LIVE:"".concat(o),SHOWS:"".concat(l,"/shows"),INVENTORY:"".concat(o,"/products/inventory"),SHOPPETTES:"/shoppettes",ORDERS:"".concat(o,"/orders"),PAYOUT_METHOD:"".concat(o,"/payouts"),FUNDRAISERS:"".concat(o,"/fundraisers"),LOGIN:"/login",USERS:"".concat(s,"/admin/users"),CATEGORIES:"".concat(s,"/admin/categories"),AFFILIATE_MANAGER:"".concat(s,"/admin/affiliates"),CREATE_STORE:"".concat(s,"/create-store"),SETTINGS_USERS:"".concat(s,"/admin/users"),REGISTER:"/register",CHECKOUT:"/checkout",SETTINGS_CHANNEL_GENERAL:"".concat(l,"/seller/settings/general"),ADMIN_CHANNELS_SETTINGS:"".concat(s,"/admin/channels")}},9342:(e,t,a)=>{a.d(t,{LK:()=>u,M2:()=>v,Tj:()=>l,jV:()=>h,jZ:()=>d,q0:()=>p});var r=a(2692);let n="tsl_impersonation_state",s={path:"/",sameSite:"strict",secure:!0,maxAge:86400},i=e=>0===e?n:"".concat(n,"_").concat(e),o=()=>{let e=(0,r.getCookie)(n),t=0;if(e)try{let a="string"==typeof e?JSON.parse(e):e;a._chunks&&void 0!==a._part&&(t=a._chunks)}catch(e){console.error("Failed to parse chunk metadata cookie:",e)}if((0,r.deleteCookie)(n,{path:"/"}),t>0)for(let e=1;e<t;e++){let t=i(e);(0,r.deleteCookie)(t,{path:"/"})}else for(let e=1;e<=10;e++){let t=i(e);if((0,r.getCookie)(t))(0,r.deleteCookie)(t,{path:"/"});else break}},l=e=>{try{let t={...e,timestamp:Date.now(),expiresAt:Date.now()+864e5},a=JSON.stringify(t);if(o(),a.length<=1800)(0,r.setCookie)(n,a,s);else{let e=((e,t)=>{let a=[];for(let r=0;r<e.length;r+=t)a.push(e.slice(r,r+t));return a})(a,1800),t={_chunks:e.length,_part:e[0]};(0,r.setCookie)(n,JSON.stringify(t),s);for(let t=1;t<e.length;t++)(0,r.setCookie)(i(t),e[t],s)}console.log("Impersonation state saved to cookie:",t)}catch(e){console.error("Failed to save impersonation state:",e)}},c=()=>{try{let e,t=(0,r.getCookie)(n);if(!t)return null;if(!(0,r.getCookie)("token"))return u(),console.error("User is not logged in"),null;let a="string"==typeof t?JSON.parse(t):t;if((e=>"object"==typeof e&&null!==e&&"_chunks"in e&&"_part"in e)(a)){let t=[a._part];for(let e=1;e<a._chunks;e++){let a=(0,r.getCookie)(i(e));if(!a)return console.error("Missing cookie chunk ".concat(e)),u(),null;t.push("string"==typeof a?a:String(a))}e=t.join("")}else e="string"==typeof t?t:JSON.stringify(t);let s=JSON.parse(e);if(s.expiresAt&&Date.now()>s.expiresAt)return u(),console.log("Impersonation state expired, cleared"),null;return s}catch(e){return console.error("Failed to load impersonation state:",e),null}},u=()=>{try{o(),console.log("Impersonation state cleared")}catch(e){console.error("Failed to clear impersonation state:",e)}},d=()=>{let e=c();return(null==e?void 0:e.isImpersonating)===!0},h=()=>c(),p="126px",v="44px"},9998:(e,t,a)=>{a.d(t,{u:()=>r});function r(){var e,t;return{browser_resolution:"".concat(window.innerWidth,"x").concat(window.innerHeight),screen_resolution:"".concat(null==(e=window.screen)?void 0:e.availWidth,"x").concat(null==(t=window.screen)?void 0:t.availHeight)}}}}]);
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.