1"use strict";(self.webpackChunkinsight_timer=self.webpackChunkinsight_timer||[]).push([[3823,8491],{4565:(e,t,i)=>{i.d(t,{A:()=>n});const n=(e,t)=>{var i;const n=new CustomEvent(e,null!==t&&void 0!==t?t:{});null!==(i=window)&&void 0!==i&&i.dispatchEvent&&window.dispatchEvent(n)}},9683:(e,t,i)=>{i.d(t,{B6:()=>y,HS:()=>m,If:()=>L,K4:()=>_,M9:()=>x,OC:()=>S,Py:()=>A,To:()=>g,V4:()=>w,Z3:()=>k,_x:()=>j,ds:()=>O,f_:()=>b,k1:()=>C,l9:()=>p,ou:()=>E,pE:()=>$,pi:()=>h,qF:()=>v,qT:()=>c,sS:()=>R,vM:()=>f,yk:()=>I});var n=i(38491),r=i(91557),a=i(50923),s=i.n(a),o=i(19919);const l="https://filtering.insighttimer-api.net",d="https://search.insighttimer-api.net",u=e=>{let t=null===e||void 0===e?void 0:e.query;if("ai_discovery_mode"===(null===e||void 0===e?void 0:e.sort_option)&&!e.query&&(null!==e&&void 0!==e&&e.ai_tags||null!==e&&void 0!==e&&e.tags||null!==e&&void 0!==e&&e.topics)){const i=e.ai_tags||e.tags||e.topics;t=null===i||void 0===i?void 0:i.join(" ").replaceAll("_"," ")}return t},c=async e=>{const t=e?o.stringify({...e,query:u(e)},{arrayFormat:"comma"}):"",i=await n.default.get(`${l}/api/v1/courses/filter?${t}`),{data:r}=i;return{result:r.map((e=>{var t,i,n,r,a,s,o;let l=null!==(t=null===(i=e.item_summary)||void 0===i||null===(n=i.library_item_summary)||void 0===n?void 0:n.publisher)&&void 0!==t?t:null===(r=e.item_summary)||void 0===r||null===(a=r.course_summary)||void 0===a?void 0:a.publisher;return l={...null!==(s=null===e||void 0===e?void 0:e.metadata.publisher)&&void 0!==s?s:{},...null!==(o=l)&&void 0!==o?o:{}},null!=e.item_summary.library_item_summary?{...e.item_summary.library_item_summary,...e.metadata,publisher:l}:null!=e.item_summary.course_summary?{...e.item_summary.course_summary,...e.metadata,publisher:l}:null})),totalCount:i.headers["x-total-count"]}},p=async e=>{const t=e?o.stringify(e,{arrayFormat:"comma"}):"",i=await n.default.get(`${d}/api/v1/courses/search?${t}`),{data:r}=i;return{result:r.map((e=>{var t,i,n,r,a,s,o;let l=null!==(t=null===(i=e.item_summary)||void 0===i||null===(n=i.library_item_summary)||void 0===n?void 0:n.publisher)&&void 0!==t?t:null===(r=e.item_summary)||void 0===r||null===(a=r.course_summary)||void 0===a?void 0:a.publisher;return l={...null!==(s=null===e||void 0===e?void 0:e.metadata.publisher)&&void 0!==s?s:{},...null!==(o=l)&&void 0!==o?o:{}},e.item_summary.library_item_summary?{...e.item_summary.library_item_summary,...e.metadata,publisher:l}:e.item_summary.course_summary?{...e.item_summary.course_summary,...e.metadata,publisher:l}:null})),totalCount:i.headers["x-total-count"]}},h=async e=>{const t=e?o.stringify({...e,query:u(e)},{arrayFormat:"comma"}):"",i=await n.default.get(`${l}/api/v1/single-tracks/filter?${t}`),{data:r}=i;return{result:r.map((e=>e.item_summary.library_item_summary)),totalCount:i.headers["x-total-count"]}},x=async e=>{var t,i;const r=e?o.stringify(e,{arrayFormat:"comma"}):"",a=await n.default.head(`${l}/api/v1/single-tracks/filter?${r}`);return{totalCount:null!==(t=null===a||void 0===a||null===(i=a.headers)||void 0===i?void 0:i["x-total-count"])&&void 0!==t?t:0}},m=async e=>{const t=e?o.stringify(e,{arrayFormat:"comma"}):"",i=await n.default.get(`${d}/api/v1/single-tracks/search?${t}`),{data:r}=i;return{result:r.map((e=>e.item_summary.library_item_summary)),totalCount:i.headers["x-total-count"]}};let g=function(e){return e.APPROVED="APPROVED",e.PENDING="PENDING",e.CANCELLED="CANCELLED",e.DELETED="DELETED",e}({});const f=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${l}/api/v1/shop-products/filter?${i}`),{data:a}=r;return{result:a.map((e=>e.item_summary.shop_product_summary)),totalCount:null!==(t=Number(r.headers["x-total-count"]))&&void 0!==t?t:0}},v=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${l}/api/v1/shop-products/recommendations?${i}`),{data:a}=r;return{data:a.map((e=>e.item_summary.shop_product_summary)),total_count:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},b=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${l}/api/v1/groups/filter?${i}`),{data:a}=r;return{result:null!==a&&void 0!==a?a:[],totalCount:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},j=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${d}/api/v1/groups/search?${i}`),{data:a}=r;return{result:null!==a&&void 0!==a?a:[],totalCount:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},y=async e=>{var t;const i=e?o.stringify(s()(e,["offset","limit"]),{arrayFormat:"comma"}):"",r=await n.default.head(`${d}/api/v1/groups/search?${i}`);return Number(null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0)},_=async e=>{var t;let{userId:i,filter:r}=e,a=r?o.stringify(r,{arrayFormat:"comma"}):"";a=a?`?${a}`:"";const s=await n.default.get(`${l}/api/v1/users/${i}/groups${a}`),{data:d}=null!==s&&void 0!==s?s:{};return{result:null!==d&&void 0!==d?d:[],totalCount:Number.parseInt(`${null!==(t=s.headers["x-total-count"])&&void 0!==t?t:0}`,10)}},w=async e=>{var t,i;let{teacherId:r,filter:a}=e,s=a?o.stringify(a,{arrayFormat:"comma"}):"";s=s?`?${s}`:"";const d=await n.default.get(`${l}/api/v1/publishers/${r}/live-events${s}`),{data:u}=d,c=null!==(t=null===u||void 0===u?void 0:u.map((e=>e.item_summary.event_summary)))&&void 0!==t?t:[];return{result:null!==c&&void 0!==c?c:[],totalCount:Number.parseInt(`${null!==(i=d.headers["x-total-count"])&&void 0!==i?i:0}`,10)}},k=async e=>{var t;let{publisherId:i,filter:a}=e,s=a?o.stringify(a,{arrayFormat:"comma"}):"";s=s?`?${s}`:"";const l=await n.default.get(`${r.bk}/api/v1/publishers/${i}/courses${s}`),{data:d}=null!==l&&void 0!==l?l:{};return{result:d.map((e=>e.item_summary.library_item_summary)),totalCount:null!==(t=l.headers["x-total-count"])&&void 0!==t?t:0}},S=async e=>{var t;let{publisherId:i,filter:a}=e,s=a?o.stringify(a,{arrayFormat:"comma"}):"";s=s?`?${s}`:"";const l=await n.default.get(`${r.bk}/api/v1/publishers/${i}/guided-meditations${s}`),{data:d}=null!==l&&void 0!==l?l:{};return{result:d.map((e=>e.item_summary.library_item_summary)),totalCount:null!==(t=l.headers["x-total-count"])&&void 0!==t?t:0}},A=async e=>{let{publisherId:t,filter:i}=e,a=i?o.stringify(i,{arrayFormat:"comma"}):"";a=a?`?${a}`:"";const s=await n.default.get(`${r.bk}/api/v1/publishers/${t}/updates${a}`);return{result:s.data,totalCount:parseInt(s.headers["x-total-count"],10)}},E=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${d}/api/v1/events/search?${i}`),{data:a}=r,s=a.map((e=>e.item_summary.event_summary));return{result:null!==s&&void 0!==s?s:[],totalCount:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},$=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${d}/api/v1/playlists/search?${i}`),{data:a}=r,s=a.map((e=>e.item_summary.playlist_summary));return{result:null!==s&&void 0!==s?s:[],totalCount:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},C=async e=>{var t;const i=e?o.stringify(s()(e,["offset","limit"]),{arrayFormat:"comma"}):"",r=await n.default.head(`${d}/api/v1/playlists/search?${i}`);return Number(null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0)},L=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${d}/api/v1/top?${i}`),{data:a}=r,s=a.map((e=>e.item_summary));return{result:null!==s&&void 0!==s?s:[],totalCount:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},R=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${d}/api/v1/publishers/search?${i}`),{data:a}=r;return{result:a.map((e=>e.item_summary.user_summary)),totalCount:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},I=async e=>{var t;const i=e?o.stringify(e,{arrayFormat:"comma"}):"",r=await n.default.get(`${d}/api/v1/therapists/search?${i}`),{data:a}=r;return{result:a.map((e=>e.item_summary.user_summary)),totalCount:null!==(t=r.headers["x-total-count"])&&void 0!==t?t:0}},O=async e=>{let{tags:t,lang:i,limit:r,offset:a=0}=e;const s=i||"en",o=await n.default.get(`${l}/api/v1/tags/${t}/featured?offset=${a}&limit=${r}&content_langs=${s}&device_lang=${s}`),{data:d}=o;return{result:d.map((e=>e.item_summary.library_item_summary)).filter((e=>"SINGLE_TRACKS"===(null===e||void 0===e?void 0:e.item_type))),totalCount:o.headers["x-total-count"]}}},11130:(e,t,i)=>{i.d(t,{j:()=>n});const n=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){return Math.abs(Number(e))>=1e9?`${(Math.abs(Number(e))/1e9).toFixed(t)} billion`:Math.abs(Number(e))>=1e6?`${(Math.abs(Number(e))/1e6).toFixed(t)} million`:Math.abs(Number(e))>=1e5?`${(Math.abs(Number(e))/1e3).toFixed(t)}k`:Math.abs(Number(e))}return Math.abs(Number(e))>=1e9?`${(Math.abs(Number(e))/1e9).toFixed(t)}b`:Math.abs(Number(e))>=1e6?`${(Math.abs(Number(e))/1e6).toFixed(t)}m`:Math.abs(Number(e))>=1e3?`${(Math.abs(Number(e))/1e3).toFixed(t)}k`:Math.abs(Number(e))}},12256:(e,t,i)=>{i.d(t,{A:()=>d});var n=i(4021),r=i(41157),a=i(93662),s=i(68168),o=i(15263),l=(i(95254),i(64582));const d=e=>{let{tabs:t}=e;return(0,l.jsx)(n.a,{width:"100%",overflow:"scroll",css:{"&::-webkit-scrollbar":{display:"none"}},children:(0,l.jsxs)(r.w,{position:"relative",width:"fit-content",minWidth:"100%",border:"none",children:[(0,l.jsx)(n.a,{position:"absolute",width:"100%",height:"2px",bottom:0,left:0,background:"neutral.200"}),(0,l.jsx)(a.z,{spacing:5,children:t.map((e=>(0,l.jsx)(s.o,{position:"relative",mb:"unset",paddingX:"0",color:"neutral.400",borderBottomWidth:"2px",_hover:{color:"neutral.700"},_selected:{color:"neutral.700",borderColor:"neutral.700"},_focus:{background:"none",outline:0},_active:{background:"none"},children:(0,l.jsx)(o.E,{variant:"p1.medium",whiteSpace:"nowrap",children:e})},e)))})]})})}},15235:(e,t,i)=>{i.d(t,{EB:()=>s,RF:()=>o,f:()=>l});var n=i(94309),r=i.n(n),a=i(32094);function s(e,t){return`${a.NX}/${encodeURIComponent(`${e}/pictures/${t}.jpeg`)}`}function o(e,t){return r()(e,{id:t})}function l(e,t){return r()(e,{day:t})}},16750:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(3630);const r=(e,t,i,r)=>{const{data:a,size:s,setSize:o,error:l,isValidating:d,mutate:u}=(0,n.y_)(e,t,{revalidateAll:!1,...r}),c=!a&&!l;return{data:a,size:s,setSize:o,mutate:u,error:l,isLoadingInitialData:c,isLoadingMore:c||s>0&&a&&"undefined"===typeof a[s-1],isReachingEnd:null!=a&&a[s-1]&&a[s-1].length<i||!1,isValidating:d}}},25745:(e,t,i)=>{i.d(t,{$q:()=>c,ER:()=>s,K2:()=>o,MV:()=>d,N8:()=>u,Sy:()=>p,_f:()=>h,hD:()=>l,q5:()=>a});var n=i(57409),r=i.n(n);const a=(e,t,i)=>`https://users.insighttimer.com/${e}/pictures/${t}_${i}.jpeg`,s=(e,t,i)=>`https://users.insighttimer.com/${e}/pictures/${t}_${i}.jpeg`,o=function(e){return`https://groups.insighttimer.com/${e}/pictures/${arguments.length>1&&void 0!==arguments[1]?arguments[1]:"square"}_${arguments.length>2&&void 0!==arguments[2]?arguments[2]:"medium"}.jpeg`},l=(e,t,i)=>`https://libraryitems.insighttimer.com/${e}/pictures/tiny_${t}_${i}.jpeg`,d=(e,t,i)=>`https://libraryitems.insighttimer.com/slugs/${encodeURIComponent(e)}/pictures/tiny_${t}_${i}.webp`,u=(e,t,i)=>`https://libraryitems.insighttimer.com/${e}/pictures/${t}_${i}.jpeg`,c=(e,t,i)=>`https://playlists.insighttimer.com/${e}/pictures/montage_${null!==i&&void 0!==i?i:"white"}_${t}.jpeg`,p=(e,t,i,n)=>{let s=`https://users.insighttimer.com/${t}/marketplace/shop/products/${e}/images/${i}_${n}.jpeg`;return r()(s,(e=>
1{e||(s=a(t,"portrait"===i?"square":i,n))})),s},h=e=>{let{id:t,shape:i,size:n}=e;return`https://events.insighttimer.com/${t}/pictures/${i}_${n}.jpeg`}},28665:(e,t,i)=>{i.d(t,{h:()=>l});var n,r,a=i(95254);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},s.apply(null,arguments)}function o(e,t){let{title:i,titleId:o,...l}=e;return a.createElement("svg",s({width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":o},l),i?a.createElement("title",{id:o},i):null,n||(n=a.createElement("ellipse",{cx:8.70141,cy:8.79984,rx:7.70141,ry:7.79984,stroke:"#191919",strokeWidth:2})),r||(r=a.createElement("path",{d:"M15.0212 14.7656L18.1071 17.8915",stroke:"#191919",strokeWidth:3.5,strokeLinecap:"round",strokeLinejoin:"round"})))}const l=a.forwardRef(o);i.p},30202:(e,t,i)=>{i.r(t),i.d(t,{ITEMS_PER_PAGE:()=>Bt,default:()=>Ht});var n=i(4021),r=i(57082),a=i(65561),s=i(92751),o=i(95254),l=i(56087),d=i(15263),u=i(47463),c=i(97244),p=i(4565),h=i(64582);const x=(0,o.createContext)({totalCount:{},setTotalCount:()=>null,activeTab:"featured",setActiveTab:()=>null}),m=e=>{let{children:t}=e;const[i,n]=(0,o.useState)({top:null,tracks:null,videos:null,courses:null,teachers:null,therapists:null,events:null,groups:null,playlists:null,workshops:null}),[r,a]=(0,o.useState)("featured");return(0,h.jsx)(x.Provider,{value:{totalCount:i,setTotalCount:n,activeTab:r,setActiveTab:a},children:t})},g=e=>{const t=(0,o.useContext)(x);return e&&t.setActiveTab(e),t},f="GLOBAL_SEARCH_PAGE_RESULT_LOADING",v=e=>{(0,p.A)(f,{detail:{isLoading:e}})},b=()=>{const e=(0,c.A)().get("query"),[t,i]=(0,o.useState)(!1),{totalCount:r,activeTab:s}=g(),p=r[s],x=null!==p&&void 0!==p,m=x?`${p>1e4?"10.000+":p} results`:"";return(0,o.useEffect)((()=>{const e=e=>{var t;i(null===e||void 0===e||null===(t=e.detail)||void 0===t?void 0:t.isLoading)};return window.addEventListener(f,e),()=>{window.removeEventListener(f,e)}}),[]),(0,h.jsxs)(a.A,{variant:"small",children:[e&&(0,h.jsx)(u.A,{textStyle:"displayBold",children:e}),(0,h.jsx)(n.a,{height:"8px"}),t&&!x?(0,h.jsx)(l.E,{width:"200px",borderRadius:"6px",height:"23px"}):(0,h.jsx)(d.E,{fontSize:"16px",fontWeight:"500",color:"var(--neutral-600)",minHeight:"23px",children:m})]})};var j=i(5391),y=i(72160),_=i(21297),w=i(12256),k=i(38341),S=i(85833),A=i(4259),E=i(60597),$=i(90102),C=i(50055),L=i(42046),R=i(15235);const I=e=>{let{course:t}=e;const i=(0,R.EB)(t.id,"square_small"),r=(0,C.A)(t.rating_score)&&t.rating_score>0;return(0,h.jsxs)(k.s,{align:"center",as:L.Link,to:`/meditation-courses/${t.slug}`,children:[(0,h.jsxs)(n.a,{width:"100px",height:"100px",borderRadius:"10px",mr:"16px",position:"relative",flexShrink:0,children:[(0,h.jsx)(A.A,{blurhash:t.blurhash,src:i,alt:t.title,width:"100%",height:"100%",borderRadius:"10px"}),(0,h.jsxs)(k.s,{position:"absolute",bottom:"4px",left:"4px",align:"center",background:"secondary.courses",paddingX:"5px",paddingY:"2px",borderRadius:"5px",children:[(0,h.jsx)(S._,{src:$.A.CourseBookWhiteIcon,height:"9px",width:"9px"}),(0,h.jsx)(d.E,{fontSize:"10px",lineHeight:"14px",color:"white",textTransform:"uppercase",fontWeight:"bold",ml:"4px",children:"COURSE"})]})]}),(0,h.jsxs)(n.a,{children:[(0,h.jsxs)(k.s,{align:"center",mb:"6px",fontWeight:"bold",color:"neutral.600",children:[r&&(0,h.jsx)(E.A,{color:t.rating_score>4.8?"#E1B033":"#636D6D",ratingScore:t.rating_score}),(0,h.jsxs)(d.E,{fontSize:"11px",children:[r&&"\xb7 ",`${t.days} DAYS`]})]}),(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:2,mb:"6px",children:t.title}),(0,h.jsxs)(d.E,{fontSize:"14px",fontWeight:"500",color:"neutral.600",children:["by ",t.publisher.name]})]})]})};var O=i(16750),D=i(43886),z=i(73492),T=i(9683);const P=e=>{let{children:t}=e;const{isMobile:i}=(0,s.A)();return(0,h.jsx)(n.a,{padding:i?"4px 6px 4px 6px":"13px 13px 13px 14px",_hover:{background:"neutral.50"},borderRadius:"10px",children:t})};var W=i(29989);const F=e=>{let{borderRadius:t}=e;const{isMobile:i}=(0,s.A)();return(0,h.jsxs)(k.s,{align:"center",padding:i?"0 13px 26px 0":"13px",children:[(0,h.jsx)(l.E,{width:"100px",height:"100px",mr:"16
1px",borderRadius:`${t}px`,startColor:"neutral.50",endColor:"neutral.100"}),(0,h.jsxs)(n.a,{flex:1,children:[(0,h.jsx)(l.E,{height:"11px",width:"60px",mb:"11px",borderRadius:"4px",startColor:"neutral.50",endColor:"neutral.100"}),(0,h.jsx)(l.E,{height:"16px",width:"200px",mb:"11px",borderRadius:"4px",startColor:"neutral.50",endColor:"neutral.100"}),(0,h.jsx)(l.E,{height:"11px",width:"150px",borderRadius:"10px",startColor:"neutral.50",endColor:"neutral.100"})]})]})},M=e=>{let{borderRadius:t=10,noOfLoadingItems:i=3}=e;return(0,h.jsx)(n.a,{children:[...Array(i).keys()].map((e=>(0,h.jsx)(F,{borderRadius:t},e)))})};var q=i(89728);const N=()=>{const{isMobile:e}=(0,s.A)();return(0,h.jsx)(k.s,{height:"40px",align:"center",children:e?(0,h.jsx)(q.D,{fontSize:"12px",lineHeight:"17px",fontWeight:"400",textTransform:"uppercase",letterSpacing:"0.02em",color:"#969D9D",children:"Top results"}):(0,h.jsx)(q.D,{fontSize:"18px",children:"Top results"})})};var B=i(97207);const H=i.p+"static/media/phone-frame.1365804f9ef494077315.png",G=i.p+"static/media/starry-night.435dcbe77ecb0f91f8bc.jpg";var U=i(33870);const X=()=>{const e=(0,U.A)();return(0,h.jsxs)(n.a,{borderRadius:"10px",width:"346px",height:"474px",backgroundImage:G,backgroundSize:"cover",backgroundPosition:"center",padding:"24px",display:"flex",flexDirection:"column",justifyContent:"flex-end",position:"sticky",top:"110px",ml:"60px",mt:"70px",children:[(0,h.jsx)(n.a,{position:"absolute",top:"0px",left:"0px",height:"250px",backgroundImage:H,backgroundSize:"cover",backgroundPosition:"center",width:"100%"}),(0,h.jsx)(u.A,{width:"250px",textStyle:"h2Bold",color:"white",children:"Get the full browsing experience with our free app"}),(0,h.jsx)(n.a,{height:"22px"}),(0,h.jsx)(B.$,{backgroundColor:"var(--brandTeal-500)",color:"white",borderRadius:"8px",width:"146px",height:"40px",onClick:e,children:(0,h.jsx)(u.A,{textStyle:"p1Medium",color:"white",children:"Download Now"})})]})};var K=i(7869);const V=()=>(0,h.jsx)(k.s,{position:"sticky",top:"110px",borderRadius:"10px",width:"346px",height:"474px",background:"neutral.100",backgroundSize:"cover",backgroundPosition:"center",ml:"60px",overflow:"hidden",align:"center",justify:"center",mt:"70px",children:(0,h.jsx)(K.y,{})}),Y=e=>{let{isLoading:t,course:i}=e;if(t)return(0,h.jsx)(V,{});if(!i)return(0,h.jsx)(X,{});const r=(0,R.EB)(i.id,"square_medium");return(0,h.jsx)(n.a,{children:(0,h.jsxs)(n.a,{as:L.Link,to:`/meditation-courses/${i.slug}`,display:"block",position:"sticky",top:"110px",borderRadius:"10px",width:"346px",height:"474px",backgroundImage:r,backgroundSize:"cover",backgroundPosition:"center",ml:"60px",overflow:"hidden",mt:"70px",children:[(0,h.jsx)(n.a,{position:"absolute",left:"0px",right:"0px",bottom:"0px",top:"0px",backgroundImage:"linear-gradient(17.01deg, rgba(0, 0, 0, 0.3) 17.87%, rgba(0, 0, 0, 0.04) 53.38%)"}),(0,h.jsxs)(n.a,{position:"absolute",left:"19px",bottom:"19px",children:[(0,h.jsxs)(k.s,{align:"center",background:"secondary.courses",paddingX:"5px",paddingY:"2px",borderRadius:"5px",display:"inline-flex",mb:"6px",children:[(0,h.jsx)(S._,{src:$.A.CourseBookWhiteIcon,height:"9px",width:"9px"}),(0,h.jsxs)(d.E,{fontSize:"10px",lineHeight:"14px",color:"white",textTransform:"uppercase",fontWeight:"bold",ml:"4px",children:[i.days," DAY COURSE"]})]}),(0,h.jsx)(q.D,{variant:"h3",color:"white",mb:"6px",children:i.title}),(0,h.jsxs)(d.E,{variant:"p1.regular",fontWeight:"500",color:"white",children:["by ",i.publisher.name]})]})]})})},J=()=>{const e=(0,c.A)().get("query"),t=(0,o.useRef)(null),i=(0,D.A)(t),[r,a]=(0,o.useState)(),{setTotalCount:l}=g("courses"),d=(0,z.D)(),{isMobile:u}=(0,s.A)(),{data:p,setSize:x,isLoadingInitialData:m,isReachingEnd:f}=(0,O.A)((t=>[e,t*Bt,Bt,"search-courses",d.config.deviceLang]),(async(e,t,i)=>{v(!0);const n=await(0,T.l9)({query:e,limit:i,offset:t,device_lang:d.config.deviceLang,include_semantic_search:!0}).finally((()=>{v(!1)}));return l((e=>({...e,courses:n.totalCount}))),n.result?n.result:[]}),Bt,{revalidateAll:!1,revalidateOnFocus:!1});return(0,o.useEffect)((()=>{var e;!m&&p&&(null===p||void 0===p||null===(e=p.flat())||void 0===e?void 0:e.length)>1&&a(p.flat()[0])}),[p,m]),(0,o.useEffect)((()=>{i&&!f&&x((e=>e+1))}),[i,f,x]),(0,h.jsxs)(k.s,{mt:"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[null!==p&&void 0!==p&&p.flat().length||m?(0,h.jsx)(n.a,{mb:"15px",children:(0,h.jsx)(N,{})}):(0,h.jsx)(W.A,{}),m?(0,h.jsx)(M,{noOfLoadingItems:10}):null===p||void 0===p?void 0:p.flat().map((e=>p?(0,h.jsx)(P,{children:(0,h.jsx)(I,{course:e})},e.id):null)),(0,h.jsx)(n.a,{ref:t,display:m?"none":"auto",children:!f&&(0,h.jsx)(M,{})})]}),!u&&(0,h.jsx)(Y,{isLoading:m,course:r})]})};var Z=i(42381),Q=i(23101),ee=i(25745),te=i(66129);const ie=e=>{var t,i,r,a,s,o;let{event:l}=e;const u=null===(t=l._next_occurrences[0])||void 0===t||null===(i=t.start_date)||void 0===i?void 0:i.epoch,c=!(null===(r=l._next_occurrences[0])||void 0===r||null===(a=r.end_date)||void 0===a||!a.epoch)&&(null===(s=l._next_occurrences[0])||void 0===s||null===(o=s.end_date)||void 0===o?void 0:o.epoch)-Date.now()<=0,{isLoading:p,eventDetails:x}=(0,Z.A)(c?l.id:void 0),m=c&&x?!!x.is_finished:c,g=u>0||p?(0,Q.OB)(u,m):"",f=(0,Q.xg)(u,m),v=(0,ee.q5)(l.owner.id,"square","small");return(0,h.jsxs)(k.s,{align:"center",as:L.Link,to:`/live/${l.id}`,children:[(0,h.jsx)(n.a,{width:"100px",height:"100px",backgroundImage:v,backgroundSize:"cover",backgroundPosition:"center",borderRadius:"10px",mr:"16
1px",position:"relative",flexShrink:0,children:(0,h.jsxs)(k.s,{position:"absolute",bottom:"4px",left:"4px",align:"center",background:f?"secondary.live":"white",paddingX:"5px",borderRadius:"5px",children:[(0,h.jsx)(te.h,{fill:f?"white":"#BD3E6F"}),(0,h.jsx)(d.E,{fontSize:"11px",color:f?"white":"secondary.live",textTransform:"uppercase",fontWeight:"bold",ml:"4px",children:f?"LIVE":"EVENT"})]})}),(0,h.jsxs)(n.a,{children:[(0,h.jsx)(k.s,{align:"center",children:(0,h.jsx)(d.E,{fontSize:"11px",fontWeight:"bold",color:"secondary.live",textTransform:"uppercase",children:f?"IN PROGRESS":g})}),(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:1,children:l.title}),(0,h.jsxs)(d.E,{fontSize:"14px",fontWeight:"500",color:"neutral.600",children:[l.owner.name,l.number_of_attendees&&` \u2022 ${l.number_of_attendees} attending`]})]})]})},ne=()=>{var e,t;const i=(0,c.A)().get("query"),r=(0,o.useRef)(null),a=(0,D.A)(r),{setTotalCount:l,totalCount:d}=g("events"),u=null!==(e=null===d||void 0===d?void 0:d.events)&&void 0!==e?e:0,{isMobile:p}=(0,s.A)(),{data:x,setSize:m,isLoadingInitialData:f,isReachingEnd:b}=(0,O.A)((e=>[i,e*Bt,Bt,"search-events"]),(async(e,t,i)=>{v(!0);const n=await(0,T.ou)({query:e,limit:i,offset:t}).finally((()=>{v(!1)}));return l((e=>({...e,events:null===n||void 0===n?void 0:n.totalCount}))),null!==n&&void 0!==n&&n.result?n.result:[]}),Bt,{revalidateAll:!1,revalidateOnFocus:!1}),j=null!==(t=null===x||void 0===x?void 0:x.flat())&&void 0!==t?t:[],y=b||((null===j||void 0===j?void 0:j.length)||0)>=u;return(0,o.useEffect)((()=>{a&&!y&&m((e=>e+1))}),[a,y,m]),(0,h.jsxs)(k.s,{mt:"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[j.length||f?(0,h.jsx)(n.a,{mb:"15px",children:(0,h.jsx)(N,{})}):(0,h.jsx)(W.A,{}),f?(0,h.jsx)(M,{noOfLoadingItems:10}):j.map((e=>e?(0,h.jsx)(P,{children:(0,h.jsx)(ie,{event:e})},e.id):null)),(0,h.jsx)(n.a,{ref:r,display:f?"none":"auto",children:!y&&(0,h.jsx)(M,{})})]}),!p&&(0,h.jsx)(X,{})]})};var re=i(3119),ae=i(22708),se=i(88472);const oe=e=>{let{group:t}=e;return(0,h.jsx)(re.N,{as:"a",href:`https://insighttimer.com/groups/${t.id}`,_focus:{outline:"none"},style:{textDecoration:"none"},children:(0,h.jsxs)(k.s,{align:"center",children:[(0,h.jsxs)(n.a,{width:"100px",height:"100px",borderRadius:"10px",overflow:"hidden",mr:"16px",position:"relative",children:[(0,h.jsx)(se.A,{group:t}),(0,h.jsx)(k.s,{position:"absolute",bottom:"4px",left:"4px",align:"center",background:"teal.500",borderRadius:"5px",children:(0,h.jsx)(ae.h,{})})]}),(0,h.jsxs)(n.a,{children:[(0,h.jsx)(k.s,{align:"center",children:(0,h.jsxs)(d.E,{fontSize:"11px",fontWeight:"bold",color:"neutral.600",textTransform:"uppercase",children:[t.privacy_type," GROUP"]})}),(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:2,children:t.name}),(0,h.jsxs)(d.E,{fontSize:"14px",fontWeight:"500",color:"neutral.500",children:[t.member_count," members"]})]})]})})},le=()=>{var e;const t=(0,c.A)().get("query"),i=(0,o.useRef)(null),r=(0,D.A)(i),{setTotalCount:a,totalCount:l}=g("groups"),d=null===l||void 0===l?void 0:l.groups,[u,p]=(0,o.useState)(!1),{isMobile:x}=(0,s.A)(),m=(0,z.D)(),{data:f,setSize:b,isLoadingInitialData:j,isReachingEnd:y}=(0,O.A)((e=>{if(null===d||void 0===d||0===d)return null;return[t,e*Bt,Bt,"search-groups",m.config.deviceLang]}),(async(e,t,i)=>{v(!0);return(await(0,T._x)({query:e,limit:i,offset:t,device_lang:m.config.deviceLang}).finally((()=>{v(!1)}))).result.map((e=>e.item_summary.group_summary))}),Bt,{revalidateAll:!1,revalidateOnFocus:!1}),_=null!==(e=null===f||void 0===f?void 0:f.flat())&&void 0!==e?e:[],w=y||"number"===typeof d&&_.length>=d,S=(null===d||void 0===d)&&!u,A=!S&&(0===(null!==d&&void 0!==d?d:0)||!_.length);return(0,o.useEffect)((()=>{let e=!0;return(async()=>{try{v(!0);const i=await(0,T.B6)({query:null!==t&&void 0!==t?t:"",device_lang:m.config.deviceLang}).finally((()=>{v(!1)}));if(!e)return;p(!1),a((e=>({...e,groups:i})))}catch{if(!e)return;p(!0),a((e=>({...e,groups:0})))}})(),()=>{e=!1}}),[t,a,m.config.deviceLang]),(0,o.useEffect)((()=>{r&&!w&&b((e=>e+1))}),[r,w,b]),(0,h.jsxs)(k.s,{mt:"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[A?(0,h.jsx)(W.A,{}):(0,h.jsx)(n.a,{mb:"15px",children:(0,h.jsx)(N,{})}),S||j?(0,h.jsx)(M,{noOfLoadingItems:10}):_.map((e=>e?(0,h.jsx)(P,{children:(0,h.jsx)(oe,{group:e})},e.id):null)),(0,h.jsx)(n.a,{ref:i,display:j||S?"none":"auto",children:!A&&!w&&(0,h.jsx)(M,{})})]}),!x&&(0,h.jsx)(X,{})]})};var de=i(82272);const ue=e=>{let{playlist:t}=e;return(0,h.jsxs)(k.s,{align:"center",as:L.Link,to:`/playlists/${t.id}`,children:[(0,h.jsxs)(n.a,{width:"100px",height:"100px",borderRadius:"10px",mr:"16
1px",position:"relative",overflow:"hidden",flexShrink:0,children:[(0,h.jsx)(de.A,{playlistId:t.id,size:"small",blurhash:t.cover_image_blurhash}),(0,h.jsxs)(k.s,{position:"absolute",bottom:"4px",left:"4px",align:"center",background:"rgba(30,33,33,0.6)",paddingX:"5px",borderRadius:"5px",children:[(0,h.jsx)(S._,{src:$.A.PlaylistIcon,height:"10px",width:"10px"}),(0,h.jsx)(d.E,{fontSize:"11px",color:"white",textTransform:"uppercase",fontWeight:"bold",ml:"4px",children:t.number_of_library_items})]})]}),(0,h.jsxs)(n.a,{children:[(0,h.jsx)(k.s,{align:"center",children:(0,h.jsx)(d.E,{fontSize:"11px",fontWeight:"bold",color:"neutral.600",textTransform:"uppercase",children:"PLAYLIST"})}),(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:2,children:t.title}),(0,h.jsxs)(d.E,{fontSize:"14px",noOfLines:1,fontWeight:"500",color:"neutral.500",children:["by ",t.owner.name]})]})]})},ce=()=>{var e;const t=(0,c.A)().get("query"),i=(0,o.useRef)(null),r=(0,D.A)(i),{setTotalCount:a,totalCount:l}=g("playlists"),d=null===l||void 0===l?void 0:l.playlists,[u,p]=(0,o.useState)(!1),{isMobile:x}=(0,s.A)(),m=(0,z.D)(),{data:f,setSize:b,isLoadingInitialData:j,isReachingEnd:y}=(0,O.A)((e=>{if(null===d||void 0===d||0===d)return null;return[t,e*Bt,Bt,"search-playlist",m.config.deviceLang]}),(async(e,t,i)=>{v(!0);const n=await(0,T.pE)({query:e,device_lang:m.config.deviceLang,limit:i,offset:t}).finally((()=>{v(!1)}));return null===n||void 0===n?void 0:n.result}),Bt,{revalidateAll:!1,revalidateOnFocus:!1}),_=null!==(e=null===f||void 0===f?void 0:f.flat())&&void 0!==e?e:[],w=y||"number"===typeof d&&_.length>=d,S=(null===d||void 0===d)&&!u,A=!S&&(0===(null!==d&&void 0!==d?d:0)||!_.length);return(0,o.useEffect)((()=>{let e=!0;return(async()=>{try{v(!0);const i=await(0,T.k1)({query:null!==t&&void 0!==t?t:"",device_lang:m.config.deviceLang}).finally((()=>{v(!1)}));if(!e)return;p(!1),a((e=>({...e,playlists:i})))}catch{if(!e)return;p(!0),a((e=>({...e,playlists:0})))}})(),()=>{e=!1}}),[t,a,m.config.deviceLang]),(0,o.useEffect)((()=>{r&&!w&&b((e=>e+1))}),[r,w,b]),(0,h.jsxs)(k.s,{mt:"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[A?(0,h.jsx)(W.A,{}):(0,h.jsx)(n.a,{mb:"15px",children:(0,h.jsx)(N,{})}),S||j?(0,h.jsx)(M,{noOfLoadingItems:10}):_.map((e=>e?(0,h.jsx)(P,{children:(0,h.jsx)(ue,{playlist:e})},e.id):null)),(0,h.jsx)(n.a,{ref:i,display:j||S?"none":"auto",children:!A&&!w&&(0,h.jsx)(M,{})})]}),!x&&(0,h.jsx)(X,{})]})};var pe=i(26120),he=i(8483);const xe=e=>{var t,i;let{publisher:r}=e;const a=(0,ee.q5)(r.id,"square","small"),s=null!==(t=null===r||void 0===r?void 0:r.number_of_followers)&&void 0!==t?t:0;return(0,h.jsxs)(k.s,{align:"center",as:L.Link,to:`/${r.username}`,children:[(0,h.jsx)(pe.e,{boxSize:"100px",src:a,mr:"16px",flexShrink:0}),(0,h.jsxs)(n.a,{children:[(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:2,mb:"6px",children:r.name}),(0,h.jsx)(d.E,{fontSize:"14px",fontWeight:"500",color:"neutral.500",textTransform:"uppercase",children:null===(i=r.region)||void 0===i?void 0:i.name}),s>100&&(0,h.jsx)(d.E,{color:"neutral.500",fontSize:"12px",fontWeight:"500",children:`${(0,he.A)(s)} followers`})]})]})},me=()=>{const e=(0,c.A)().get("query"),t=(0,o.useRef)(null),i=(0,D.A)(t),{setTotalCount:r}=g("teachers"),{isMobile:a}=(0,s.A)(),{data:l,setSize:d,isLoadingInitialData:u,isReachingEnd:p}=(0,O.A)((t=>[e,t*Bt,Bt,"search-publisher"]),(async(e,t,i)=>{v(!0);const n=await(0,T.sS)({query:e,limit:i,offset:t}).finally((()=>{v(!1)}));return r((e=>({...e,teachers:n.totalCount}))),n.result}),Bt,{revalidateAll:!1,revalidateOnFocus:!1});return(0,o.useEffect)((()=>{i&&!p&&d((e=>e+1))}),[i,p,d]),(0,h.jsxs)(k.s,{mt:"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[null!==l&&void 0!==l&&l.flat().length||u?(0,h.jsx)(n.a,{mb:"15px",children:(0,h.jsx)(N,{})}):(0,h.jsx)(W.A,{}),u?(0,h.jsx)(M,{noOfLoadingItems:10,borderRadius:100}):null===l||void 0===l?void 0:l.flat().map((e=>(0,h.jsx)(P,{children:(0,h.jsx)(xe,{publisher:e})},e.id))),(0,h.jsx)(n.a,{ref:t,display:u?"none":"auto",children:!p&&(0,h.jsx)(M,{borderRadius:100})})]}),!a&&(0,h.jsx)(X,{})]})};var ge=i(81649);const fe=e=>{let{hashtag:t}=e;return(0,h.jsxs)(k.s,{align:"center",as:L.Link,to:`/meditation-topics/${t.topic}`,children:[(0,h.jsx)(k.s,{width:"100px",height:"100px",borderRadius:"10px",overflow:"hidden",mr:"16
1px",position:"relative",background:"rgb(215, 238, 237)",align:"center",justify:"center",children:(0,h.jsx)(ge.h,{})}),(0,h.jsxs)(n.a,{children:[(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:2,children:t.name}),(0,h.jsx)(d.E,{fontSize:"14px",fontWeight:"500",color:"neutral.500",children:"Topic page"})]})]})};var ve=i(80330),be=i(16686),je=i(74756),ye=i(12573),_e=i(44760),we=i(60917),ke=i(76681);const Se=e=>{let{libraryItem:t}=e;const i=(0,ee.hD)(t.id,"square","small"),{pathname:r}=(0,_e.fr)(t);return(0,h.jsxs)(k.s,{align:"center",as:L.Link,to:r,children:[(0,h.jsxs)(n.a,{width:"100px",height:"100px",borderRadius:"10px",mr:"16px",position:"relative",flexShrink:0,children:[(0,h.jsx)(A.A,{width:"100%",height:"100%",alt:t.title,src:i,blurhash:t.blurhash,borderRadius:"10px"}),(0,h.jsxs)(k.s,{position:"absolute",bottom:"4px",left:"4px",align:"center",background:"RGBA(30,33,33,0.6)",paddingX:"5px",borderRadius:"5px",children:["MUSIC"===t.content_type&&(0,h.jsx)(we.h,{fill:"white"}),"TALKS"===t.content_type&&(0,h.jsx)(ke.h,{fill:"white"}),(0,h.jsx)(d.E,{fontSize:"11px",color:"white",textTransform:"uppercase",fontWeight:"bold",ml:"4px",children:(0,je.Jq)(t.media_length)})]})]}),(0,h.jsxs)(n.a,{flex:1,children:[(0,h.jsxs)(k.s,{alignItems:"center",fontWeight:"bold",color:"neutral.600",mb:"6px",children:[(0,h.jsx)(E.A,{color:t.rating_score>4.8?"#E1B033":"#636D6D",ratingScore:t.rating_score,textProps:{lineHeight:"23px"}}),(0,h.jsxs)(d.E,{fontSize:"11px",children:[" \xb7 ",t.content_type]}),(null===t||void 0===t?void 0:t.is_premium)&&(0,h.jsxs)(k.s,{as:"span",alignItems:"center",children:[(null===t||void 0===t?void 0:t.is_premium)&&(0,h.jsx)(d.E,{alignSelf:"center",color:"neutral.600",fontSize:"11px",marginInline:"2px",marginTop:"-4px",children:"."}),(0,h.jsx)(ve.I,{as:be.h,width:"28px",height:"15px"})]})]}),(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:2,mb:"6px",children:t.title}),(0,h.jsx)(d.E,{fontSize:"14px",fontWeight:"500",color:"neutral.500",children:t.publisher.name})]}),(0,h.jsx)(n.a,{width:"50px",position:"relative",children:(0,h.jsx)(ye.A,{libraryItemId:t.id})})]})};var Ae=i(46368);const Ee=e=>{let{shopProduct:t}=e;const i=(0,Ae.qm)({productId:t.id,ownerId:t.owner.id,orientation:"square",size:"medium"}),r=(0,Ae.oS)(t);return(0,h.jsxs)(k.s,{align:"center",as:L.Link,to:`/retreat/${t.slug}`,children:[(0,h.jsx)(n.a,{width:"100px",height:"100px",borderRadius:"10px",mr:"16px",position:"relative",backgroundImage:i,backgroundSize:"cover",backgroundPosition:"center",flexShrink:0,children:(0,h.jsx)(k.s,{position:"absolute",bottom:"4px",left:"4px",align:"center",background:"RGBA(30,33,33,0.6)",paddingX:"5px",borderRadius:"5px",children:(0,h.jsx)(d.E,{fontSize:"11px",color:"white",textTransform:"uppercase",fontWeight:"bold",ml:"4px",children:(0,Ae.kw)(t.start_date.epoch,t.end_date.epoch)})})}),(0,h.jsxs)(n.a,{children:[(0,h.jsx)(k.s,{align:"center",mb:"6px",children:(0,h.jsx)(d.E,{fontSize:"11px",fontWeight:"bold",color:"neutral.600",textTransform:"uppercase",children:t.type})}),(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",noOfLines:2,mb:"6px",children:t.title}),(0,h.jsx)(d.E,{fontSize:"14px",noOfLines:2,fontWeight:"500",color:"neutral.500",children:r})]})]})};var $e=i(73999),Ce=i.n($e),Le=i(18110);const Re=e=>{let{isLoading:t,shopProduct:i}=e;if(t)return(0,h.jsx)(V,{});if(!i)return(0,h.jsx)(X,{});const r="B2B_WORKSHOP_PROMO"===i.type,a=`/${i.owner.username}/workshops/${i.id}`;return(0,h.jsx)(n.a,{children:(0,h.jsxs)(n.a,{as:L.Link,to:a,display:"block",position:"sticky",top:"110px",borderRadius:"10px",width:"346px",height:"474px",backgroundImage:(0,ee.Sy)(i.id,i.owner.id,"portrait","medium"),backgroundSize:"cover",backgroundPosition:"center",ml:"60px",overflow:"hidden",mt:"70px",children:[(0,h.jsx)(n.a,{position:"absolute",left:"0px",right:"0px",bottom:"0px",top:"0px",backgroundImage:"linear-gradient(17.01deg, rgba(0, 0, 0, 0.3) 17.87%, rgba(0, 0, 0, 0.04) 53.38%)"}),(0,h.jsxs)(n.a,{position:"absolute",padding:"20px",bottom:"0",children:[(0,h.jsxs)(k.s,{align:"center",background:r?"workplaceBlue.400":"secondary.workshop",paddingX:"5px",paddingY:"2px",borderRadius:"5px",display:"inline-flex",mb:"6px",children:[!r&&(0,h.jsx)(S._,{src:$.A.WorkshopCapIcon,height:"9px",width:"9px"}),(0,h.jsx)(d.E,{fontSize:"10px",lineHeight:"14px",color:"white",textTransform:"uppercase",fontWeight:"bold",ml:"4px",children:r?i.content_type:"WORKSHOP"})]}),(0,h.jsx)(q.D,{variant:"h3",color:"white",mb:"6px",children:i.title}),(0,h.jsxs)(d.E,{variant:"p1.regular",fontWeight:"500",color:"white",children:["by ",i.owner.name]})]})]})})},Ie=()=>{const e=(0,c.A)().get("query"),t=(0,o.useRef)(null),i=(0,z.D)(),[r,a]=(0,o.useState)(),[l,d]=(0,o.useState)(),{setTotalCount:u}=g("top"),{isMobile:p}=(0,s.A)(),{data:x,setSize:m,isLoadingInitialData:f,isReachingEnd:b,isValidating:j,error:y}=(0,O.A)((t=>[e,t*Bt,Bt,"search-top"]),(async(e,t,n)=>{v(!0);const r=await(0,T.If)({query:e,offset:t,limit:n,include_workshops:!0,include_video:!0,search_friends:!1,search_friends_of_friends:!1,search_nearby:!1,personalised_search:!0,device_lang:i.config.deviceLang,content_langs:[i.config.contentLangs],publishers_only_users:!0,include_semantic_search:!0}).finally((()=>{v(!1)}));if(0===t){const t=await(0,Le.XP)({query:null!==e&&void 0!==e?e:"",limit:3,offset:0});var a;if(t)r.result.splice(2,0,...null===(a=t.data)||void 0===a?void 0:a.map((e=>({type:"SHOP_PRODUCTS",shop_product_summary:e}))))}return u((e=>({...e,top:r.totalCount}))),r.result}),Bt),_=(0,D.A)(t,f);return(0,o.useEffect)((()=>
1{if(x){const e=x.flat().filter((e=>{var t;return"SHOP_PRODUCTS"!==e.type||"APPROVED"===(null===(t=e.shop_product_summary)||void 0===t?void 0:t.status)&&!Ce()(e.shop_product_summary.start_date.epoch).isBefore(Ce()().valueOf())}));d(e)}}),[x]),(0,o.useEffect)((()=>{if(!f&&x){const e=x.flat().find((e=>{var t;return"LIBRARY_ITEMS"===e.type&&"COURSES"===(null===(t=e.library_item_summary)||void 0===t?void 0:t.item_type)}));a(e)}}),[f,x]),(0,o.useEffect)((()=>{!_||b||j||y||m((e=>e+1))}),[y,_,b,j,m]),(0,h.jsxs)(k.s,{mt:"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[null!==l&&void 0!==l&&l.length||f?(0,h.jsx)(n.a,{mb:"15px",children:(0,h.jsx)(N,{})}):(0,h.jsx)(W.A,{}),l&&l.map((e=>{switch(e.type){case"USERS":return e.user_summary&&e.user_summary.is_publisher&&(0,h.jsx)(P,{children:(0,h.jsx)(xe,{publisher:e.user_summary})},e.user_summary.id);case"LIBRARY_ITEMS":return e.library_item_summary&&"SINGLE_TRACKS"===e.library_item_summary.item_type?(0,h.jsx)(P,{children:(0,h.jsx)(Se,{libraryItem:e.library_item_summary})},e.library_item_summary.id):e.library_item_summary&&"COURSES"===e.library_item_summary.item_type?e.library_item_summary&&"COURSES"===e.library_item_summary.item_type&&(0,h.jsx)(P,{children:(0,h.jsx)(I,{course:e.library_item_summary})},e.library_item_summary.id):null;case"EVENTS":return e.event_summary&&(0,h.jsx)(P,{children:(0,h.jsx)(ie,{event:e.event_summary})},e.event_summary.id);case"GROUPS":return e.group_summary&&(0,h.jsx)(P,{children:(0,h.jsx)(oe,{group:e.group_summary})},e.group_summary.id);case"HASHTAGS":return e.hashtag_summary&&(0,h.jsx)(P,{children:(0,h.jsx)(fe,{hashtag:e.hashtag_summary})},e.hashtag_summary.id);case"PLAYLISTS":return e.playlist_summary&&(0,h.jsx)(P,{children:(0,h.jsx)(ue,{playlist:e.playlist_summary})},e.playlist_summary.id);case"SHOP_PRODUCTS":return e.shop_product_summary?(0,h.jsx)(P,{children:(0,h.jsx)(Ee,{shopProduct:e.shop_product_summary})},e.shop_product_summary.id):null;default:return null}})),(0,h.jsx)(n.a,{ref:t,display:f?"none":"auto",children:!b&&!y&&(0,h.jsx)(M,{})})]}),!p&&"LIBRARY_ITEMS"===(null===r||void 0===r?void 0:r.type)&&(0,h.jsx)(Y,{isLoading:f,course:r.library_item_summary}),!p&&"SHOP_PRODUCTS"===(null===r||void 0===r?void 0:r.type)&&(0,h.jsx)(Re,{isLoading:f,shopProduct:r.shop_product_summary}),!p&&!r&&(0,h.jsx)(X,{})]})};var Oe=i(78675),De=i(48860),ze=i(22409),Te=i.n(ze);const Pe=(0,o.forwardRef)(((e,t)=>{let{isActive:i,children:n,...r}=e;return(0,h.jsx)(B.$,{ref:t,padding:"4px 14px",background:i?"teal.500":"neutral.100",color:i?"white":"neutral.700",...r,children:n})}));Pe.displayName="SearchButton";const We=Pe;var Fe,Me,qe,Ne;function Be(){return Be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},Be.apply(null,arguments)}function He(e,t){let{title:i,titleId:n,...r}=e;return o.createElement("svg",Be({width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":n},r),i?o.createElement("title",{id:n},i):null,Fe||(Fe=o.createElement("circle",{cx:13.4815,cy:6.59969,r:2.49949,stroke:"#272B2B",strokeWidth:1.8})),Me||(Me=o.createElement("line",{x1:10.3158,y1:6.3668,x2:3.05051,y2:6.3668,stroke:"#272B2B",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})),qe||(qe=o.createElement("circle",{r:2.715,transform:"matrix(-1 0 0 1 5.76488 14.0452)",stroke:"#272B2B",strokeWidth:1.8})),Ne||(Ne=o.createElement("line",{x1:.9,y1:-.9,x2:8.74,y2:-.9,transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 8.17578 12.8403)",stroke:"#272B2B",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})))}const Ge=o.forwardRef(He);i.p;var Ue=i(27596),Xe=i(39654),Ke=i(20704),Ve=i(9242),Ye=i(5951),Je=i(42522);const Ze=[{id:"0_5",name:"0-5 min"},{id:"5_10",name:"6-10 min"},{id:"10_15",name:"11-15 min"},{id:"15_20",name:"16-20 min"},{id:"20_30",name:"21-30 min"},{id:"30_",name:"30+ min"}],Qe=[{id:"all",name:"All Types"},{id:"guided",name:"Meditations"},{id:"music",name:"Music"},{id:"talks",name:"Talks"}],et=[{id:"female",name:"Female voices only"},{id:"male",name:"Male voices only"}],tt=[{id:!0,name:"With background music"},{id:!1,name:"Without background music"}],it=e=>{let{children:t}=e;return(0,h.jsx)(d.E,{fontSize:"11px",color:"#969D9D",textTransform:"uppercase",fontWeight:"600",mb:"15px",lineHeight:"15px",children:t})};var nt;function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},rt.apply(null,arguments)}function at(e,t){let{title:i,titleId:n,...r}=e;
1return o.createElement("svg",rt({width:8,height:7,viewBox:"0 0 8 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":n},r),i?o.createElement("title",{id:n},i):null,nt||(nt=o.createElement("path",{d:"M1 3.5L3.63736 5.74725L7 1",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))}const st=o.forwardRef(at),ot=(i.p,e=>{let{isSelected:t,children:i,...n}=e;return(0,h.jsxs)(k.s,{bg:t?"neutral.000":"neutral.100",padding:"12px",borderRadius:"10px",justify:"space-between",align:"center",outline:"2px solid",outlineColor:t?"neutral.200":"transparent",cursor:"pointer",...n,children:[(0,h.jsx)(d.E,{fontWeight:"500",fontSize:"16px",children:i}),t&&(0,h.jsx)(k.s,{width:"20px",height:"20px",borderRadius:"20px",background:"teal.500",justify:"center",align:"center",children:(0,h.jsx)(st,{})})]})});var lt=i(32355);const dt=(0,i(97141).A)(lt.d)` 2 .chakra-switch__track { 3 background-color: #d5d8d8; 4 } 5 6 .chakra-switch__track[data-checked] { 7 background-color: var(--chakra-colors-teal-500); 8 } 9 10 .chakra-switch__thumb { 11 background-color: var(--chakra-colors-neutral-0); 12 } 13`,ut=e=>{let{isChecked:t,onChange:i,isDisabled:n,children:r}=e;return(0,h.jsxs)(k.s,{justify:"space-between",paddingY:"12px",children:[(0,h.jsx)(u.A,{textStyle:"p1Medium",children:r}),(0,h.jsx)(dt,{colorScheme:"teal",isChecked:t,isDisabled:n,onChange:e=>{i(e.target.checked)}})]})},ct=e=>{let{isOpen:t,onClose:i,appliedFilters:r,onApplyFilter:a}=e;const l=(0,z.D)(),u=(0,c.A)().get("query"),[p,x]=(0,o.useState)(!1),[m,g]=(0,o.useState)(0),[f,v]=(0,o.useState)(null),[b,j]=(0,o.useState)([]),[y,_]=(0,o.useState)(null),[w,S]=(0,o.useState)(null);(0,o.useEffect)((()=>{0===b.length&&j([Qe[0]])}),[b]);const A=(0,o.useCallback)((()=>({...null!==f&&{length_option:null===f||void 0===f?void 0:f.id},...b.length&&"all"!==b[0].id&&{content_types:b.map((e=>e.id))},...null!==y&&{voice_gender:y.id},...null!==w&&{has_background_music:w.id}})),[y,w,f,b]);(0,o.useEffect)((()=>{if(t){const e=Ze.find((e=>e.id===(null===r||void 0===r?void 0:r.length_option)));v(null!==e&&void 0!==e?e:null);const t=null===r||void 0===r?void 0:r.content_types,i=Qe.filter((e=>null===t||void 0===t?void 0:t.includes(e.id)));j(i);const n=et.find((e=>e.id===(null===r||void 0===r?void 0:r.voice_gender)));_(null!==n&&void 0!==n?n:null);const a=tt.find((e=>e.id===(null===r||void 0===r?void 0:r.has_background_music)));S(null!==a&&void 0!==a?a:null)}}),[r,t]),(0,o.useEffect)((()=>{var e;x(!0);const t=A(),i=(null===(e=Object.keys(t))||void 0===e?void 0:e.length)>0;u&&(i?(0,T.pi)({query:u,limit:1,offset:0,device_lang:l.config.deviceLang,content_langs:[l.config.contentLangs],...t}).then((e=>{e.totalCount&&g(e.totalCount)})).finally((()=>{x(!1)})):(0,T.HS)({query:u,limit:1,offset:0,device_lang:l.config.deviceLang}).then((e=>{e.totalCount&&g(null===e||void 0===e?void 0:e.totalCount)})).finally((()=>{x(!1)})))}),[A,u,l.config.contentLangs,l.config.deviceLang]);const{isMobile:E}=(0,s.A)(),$=E?{mt:0,mb:0,borderRadius:0,paddingBottom:0,paddingTop:0}:{};return(0,h.jsxs)(Ue.aF,{isOpen:t,onClose:i,size:E?"full":"xl",autoFocus:!1,children:[(0,h.jsx)(Xe.m,{background:"rgba(0, 0, 0, 0.5)"}),(0,h.jsxs)(Ke.$,{paddingTop:"20px",borderRadius:"18px",boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.06)",...$,children:[(0,h.jsx)(Je.A,{onClick:i}),(0,h.jsxs)(Ve.c,{paddingX:E?"24px":"50px",children:[(0,h.jsx)(d.E,{fontWeight:"600",textAlign:"center",mb:"30px",children:"Filters"}),(0,h.jsx)(it,{children:"Length"}),(0,h.jsx)(k.s,{flexWrap:"wrap",justify:"space-between",mb:"30px",children:Ze.map((e=>(0,h.jsx)(ot,{width:"32%",mb:"11px",isSelected:(null===f||void 0===f?void 0:f.id)===e.id,onClick:()=>(e=>{v(f===e?null:e)})(e),children:e.name},e.id)))}),(0,h.jsx)(it,{children:"Type"}),(0,h.jsx)(n.a,{mb:"30px",children:Qe.map(((e,t)=>{var i,r;return(0,h.jsxs)(n.a,{children:[(0,h.jsx)(ut,{isChecked:b.includes(e),isDisabled:1===(null===b||void 0===b?void 0:b.length)&&"all"===(null===(i=b[0])||void 0===i?void 0:i.id)&&(null===(r=b[0])||void 0===r?void 0:r.id)===e.id,onChange:t=>((e,t)=>{t?"all"===e.id?j([Qe[0]]):b.includes(e)||j([...b.filter((e=>"all"!==e.id)),e]):t||"all"===e.id||j(b.filter((t=>
13t.id!==e.id)))})(e,t),children:e.name}),t+1!==Qe.length&&(0,h.jsx)(n.a,{height:"1px",background:"neutral.100"})]},e.name)}))}),(0,h.jsx)(it,{children:"Audio"}),(0,h.jsxs)(n.a,{mb:"30px",children:[et.map((e=>(0,h.jsxs)(n.a,{children:[(0,h.jsx)(ut,{isChecked:(null===y||void 0===y?void 0:y.id)===e.id,onChange:t=>((e,t)=>{_(t?e:null)})(e,t),children:e.name}),(0,h.jsx)(n.a,{height:"1px",background:"neutral.100"})]},e.name))),tt.map((e=>(0,h.jsxs)(n.a,{background:e.name,children:[(0,h.jsx)(ut,{isChecked:(null===w||void 0===w?void 0:w.id)===e.id,onChange:t=>((e,t)=>{S(t?e:null)})(e,t),children:e.name}),(0,h.jsx)(n.a,{height:"1px",background:"neutral.100"})]},e.name)))]})]}),(0,h.jsx)(Ye.j,{position:E?"sticky":"relative",bottom:"0",padding:E?"24px":"34px 50px",bgColor:"var(--neutral-0)",display:"flex",justifyContent:"space-between",backgroundColor:"white",alignItems:"center",cursor:"pointer",borderBottomLeftRadius:"18px",borderBottomRightRadius:"18px",boxShadow:E?"0px 0px 16px rgba(0, 0, 0, 0.06);":"unset",children:(0,h.jsxs)(k.s,{justify:"space-between",width:"100%",children:[(0,h.jsx)(B.$,{variant:"unstyled",onClick:()=>{v(null),j([]),_(null),S(null)},fontSize:"18px",fontWeight:"500",color:"#636D6D",children:"Clear all"}),(0,h.jsxs)(B.$,{onClick:()=>{a(A()),i()},backgroundColor:De.A.colors.teal[500],borderRadius:"12px",padding:"24px 32px",height:"50px",color:"white",cursor:"pointer",isLoading:p,fontWeight:"400",fontSize:"18px",lineHeight:"25px",alignItems:"center",_hover:{background:De.A.colors.teal[500]},children:["Show ",m&&m>=1e4?"10.000+":m," ","results"]})]})})]})]})};var pt,ht=i(56113),xt=i(17097),mt=i(38491),gt=i(56708),ft=i(11130),vt=i(19919),bt=i(32913),jt=i(18303),yt=i(69814),_t=i(93727),wt=i(57063),kt=i(73262),St=i(89787);function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},At.apply(null,arguments)}function Et(e,t){let{title:i,titleId:n,...r}=e;return o.createElement("svg",At({width:7,height:5,viewBox:"0 0 7 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":n},r),i?o.createElement("title",{id:n},i):null,pt||(pt=o.createElement("path",{d:"M6 3.5L3.5 1L1 3.5",stroke:"white",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"})))}const $t=o.forwardRef(Et);i.p;var Ct=i(80476);const Lt=e=>{let{children:t,...i}=e;return(0,h.jsx)(Ct.s,{colorScheme:"teal",...i,children:t})},Rt=[{id:"popular",name:"Popular"},{id:"highest_rated",name:"Highest Rated"},{id:"newest",name:"New"},{id:"shortest",name:"Shortest"},{id:"longest",name:"Longest"}],It=e=>{let{sort:t,onSort:i}=e;const n=()=>{var e;return null===(e=Rt.find((e=>e.id===t)))||void 0===e?void 0:e.name},r=!t||"Default"===t;return(0,h.jsx)(jt.A,{placement:"bottom-end",children:e=>{let{isOpen:t,onClose:a}=e;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(yt.W,{children:(0,h.jsx)(We,{rightIcon:(0,h.jsx)(k.s,{alignItems:"center",transform:t?"rotate(0deg)":"rotate(180deg)",transition:"0.3s",marginTop:"2px",children:(0,h.jsx)(ht.In,{as:$t,width:"7px",height:"5px",css:`\n path {\n stroke: ${r?"var(--chakra-colors-neutral-700)":"var(--chakra-colors-neutral-0)"};\n }\n `,stroke:r?"neutral.700":"neutral.0"})}),height:"32px",isActive:!r,border:`2px solid ${_t.w4.colors.teal[500]}`,_hover:{background:"neutral.100",color:"neutral.700",svg:{path:{stroke:"black"}}},children:(0,h.jsx)(u.A,{textStyle:"p1Medium",children:r?"Sort":n()})})}),(0,h.jsx)(wt.h,{marginTop:"8px",width:"300px",_focus:{outline:"none"},border:"none",backgroundColor:"#FFFFFF",boxShadow:"0px 6px 20px rgba(0, 0, 0, 0.1)",borderRadius:"12px",children:(0,h.jsx)(kt.e,{children:(0,h.jsx)(St.z,{onChange:e=>{a(),i(e)},children:(0,h.jsx)(k.s,{direction:"column",children:Rt.map((e=>(0,h.jsx)(Lt,{paddingY:"10px",value:e.id,children:e.name},e.id)))})})})})]})}})},Ot=e=>{let{sort:t,onSort:i}=e;const{isOpen:r,onOpen:a,onClose:s}=(0,Oe.j)(),[l,c]=(0,o.useState)(0),[p,x]=(0,o.useState)(!1),[m,g]=(0,o.useState)(),f=!t||"Default"===t;(0,o.useEffect)((()=>{let e={};x(!0),t&&(e={...e,sort_option:t});const i=e?vt.stringify(e,{arrayFormat:"comma"}):"";mt.default.head(`https://filtering.insighttimer-api.net/api/v1/single-tracks/filter?${i}`).then((e=>{c(e.headers["x-total-count"])})).finally((()=>{x(!1)}))}),[t]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(We,{w:"100%",rightIcon:(0,h.jsx)(n.a,{transform:r?"rotate(180deg)":"rotate(0deg)",filter:f?"invert(0%)":"invert(100%)",transition:"0.3s",children:(0,h.jsx)(ht.In,{as:bt.h,width:"8px",height:"5
13px",css:`\n path {\n stroke: ${f?"var(--chakra-colors-neutral-700)":"var(--chakra-colors-neutral-0)"};\n }\n `,stroke:f?"neutral.700":"neutral.0"})}),height:"32px",isActive:!f,border:r?`2px solid ${De.A.colors.teal[500]}`:"2px solid var(--neutral-100)",_hover:{background:"neutral.100",color:"neutral.700",border:`2px solid ${De.A.colors.teal[500]}`},onClick:a,children:(0,h.jsx)(u.A,{textStyle:"p1Medium",children:f?"Sort":(()=>{var e;return null===(e=Rt.find((e=>e.id===t)))||void 0===e?void 0:e.name})()})}),(0,h.jsxs)(Ue.aF,{onClose:s,size:"full",isOpen:r,autoFocus:!1,children:[(0,h.jsx)(Xe.m,{}),(0,h.jsxs)(Ke.$,{mb:"0",mt:"0",borderRadius:"0px",children:[(0,h.jsx)(xt.r,{fontSize:"18px",fontWeight:"700",lineHeight:"25px",color:"var(--neutral-700)",textAlign:"center",paddingTop:"14px",paddingBottom:"17px",borderBottom:"1px solid var(--neutral-100)",children:"Sort by"}),(0,h.jsx)(Je.A,{onClick:s}),(0,h.jsx)(Ve.c,{mt:"26px",children:Rt.map((e=>{let{id:t,name:i}=e;return(0,h.jsxs)(k.s,{height:"58px",cursor:"pointer",onClick:()=>{g(t)},alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid var(--neutral-100)",children:[(0,h.jsx)(d.E,{fontSize:"18px",fontWeight:"500",lineHeight:"23px",color:gt.A.neutral[700],children:i}),m===t?(0,h.jsx)(n.a,{width:"18px",height:"18px",bgColor:"white",borderRadius:"50%",border:"5px solid teal.500"}):(0,h.jsx)(n.a,{width:"18px",height:"18px",bgColor:"white",border:"1px solid gray",borderRadius:"50%"})]},t)}))}),(0,h.jsxs)(Ye.j,{position:"sticky",bottom:"0",padding:"24px 24px 24px 24px",bgColor:"var(--neutral-0)",display:"flex",justifyContent:"space-between",backgroundColor:"white",alignItems:"center",cursor:"pointer",boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.06);",children:[(0,h.jsx)(n.a,{color:"var(--neutral-600)",fontWeight:"500",fontSize:"18px",lineHeight:"23px",bgColor:"transparent",p:"0",onClick:()=>{i(void 0),g(void 0),s()},children:"Clear all"}),(0,h.jsxs)(B.$,{backgroundColor:De.A.colors.teal[500],borderRadius:"12px",padding:"24px 32px",height:"50px",color:"white",cursor:"pointer",isLoading:p,fontWeight:"400",fontSize:"18px",lineHeight:"25px",alignItems:"center",_hover:{background:De.A.colors.teal[500]},onClick:()=>{i(m),s()},children:["Show ",(0,ft.j)(l)," results"]})]})]})]})]})},Dt=()=>{const e=(0,c.A)().get("query"),t=(0,o.useRef)(null),i=(0,D.A)(t),r=(0,z.D)(),[a,l]=(0,o.useState)(),{setTotalCount:d}=g("tracks"),{isMobile:p}=(0,s.A)(),{isOpen:x,onOpen:m,onClose:f}=(0,Oe.j)(),[b,j]=(0,o.useState)({}),{data:y,setSize:_,isLoadingInitialData:w,isReachingEnd:S}=(0,O.A)((t=>[e,t*Bt,Bt,a,JSON.stringify(b),"search-tracks"]),(async(e,t,i,n,a)=>{var s;const o=JSON.parse(null!==a&&void 0!==a?a:"{}"),l=Object.keys(o).length>0||n;let u;return v(!0),u=l?await(0,T.pi)({query:e,limit:i,offset:t,sort_option:n,device_lang:r.config.deviceLang,content_langs:[r.config.contentLangs],include_semantic_search:!0,...o}).finally((()=>{v(!1)})):await(0,T.HS)({query:e,limit:i,offset:t,device_lang:r.config.deviceLang,include_semantic_search:!0}).finally((()=>{v(!1)})),d((e=>{var t;return{...e,tracks:null===(t=u)||void 0===t?void 0:t.totalCount}})),null!==(s=u)&&void 0!==s&&s.result?u.result:[]}),Bt,{revalidateAll:!1,revalidateOnFocus:!1});(0,o.useEffect)((()=>{i&&!S&&_((e=>e+1))}),[i,S,_]);const A=e=>{l(e)};return(0,h.jsxs)(k.s,{mt:p?"22px":"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[null!==y&&void 0!==y&&y.flat().length||w?(0,h.jsxs)(k.s,{justify:"space-between",align:""+(p?"flex-start":"center"),mb:"15px",flexDirection:""+(p?"column-reverse":"row"),children:[(0,h.jsx)(N,{}),(0,h.jsxs)(k.s,{w:p?"100%":"auto",justifyContent:"space-around",mb:p?"32px":"0px",children:[(0,h.jsx)(We,{mr:"8px",height:"32px",w:p?"100%":"auto",leftIcon:Te()(b)?(0,h.jsx)(Ge,{}):void 0,onClick:m,isActive:!Te()(b),border:b.length?`2px solid ${De.A.colors.teal[500]}`:"2px solid var(--neutral-100)",_hover:{background:"neutral.100",color:"neutral.700",border:`2px solid ${De.A.colors.teal[500]}`},children:(0,h.jsxs)(u.A,{textStyle:"p1Medium",children:["Filter"," ",Te()(b)?"":` \xb7 ${Te()(b)?0:Object.values(b).join(",").split(",").length}`]})}),p?(0,h.jsx)(Ot,{sort:a,onSort:A}):(0,h.jsx)(It,{sort:a,onSort:A})]})]}):(0,h.jsx)(W.A,{}),w?(0,h.jsx)(M,{noOfLoadingItems:10}):null===y||void 0===y?void 0:y.flat().map((e=>
13e?(0,h.jsx)(P,{children:(0,h.jsx)(Se,{libraryItem:e})},e.id):null)),(0,h.jsx)(n.a,{ref:t,display:w?"none":"auto",children:!S&&(0,h.jsx)(M,{})})]}),!p&&(0,h.jsx)(X,{}),(0,h.jsx)(ct,{isOpen:x,onClose:f,appliedFilters:b,onApplyFilter:e=>{j(e)}})]})},zt=()=>{const e=(0,c.A)().get("query"),t=(0,o.useRef)(null),i=(0,D.A)(t),r=(0,z.D)(),[a,l]=(0,o.useState)(),{setTotalCount:d}=g("videos"),{isMobile:p}=(0,s.A)(),{isOpen:x,onOpen:m,onClose:f}=(0,Oe.j)(),[b,j]=(0,o.useState)({}),{data:y,setSize:_,isLoadingInitialData:w,isReachingEnd:S}=(0,O.A)((t=>[e,t*Bt,Bt,a,JSON.stringify(b),"search-videos"]),(async(e,t,i,n,a)=>{const s=JSON.parse(null!==a&&void 0!==a?a:"{}");v(!0);const o=await(0,T.pi)({query:e,limit:i,offset:t,sort_option:n,device_lang:r.config.deviceLang,content_langs:[r.config.contentLangs],include_semantic_search:!0,content_formats:["VIDEO"],...s});return v(!1),d((e=>({...e,videos:null===o||void 0===o?void 0:o.totalCount}))),null!==o&&void 0!==o&&o.result?o.result:[]}),Bt,{revalidateAll:!1,revalidateOnFocus:!1});(0,o.useEffect)((()=>{i&&!S&&_((e=>e+1))}),[i,S,_]);const A=e=>{l(e)};return(0,h.jsxs)(k.s,{mt:p?"22px":"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[null!==y&&void 0!==y&&y.flat().length||w?(0,h.jsxs)(k.s,{justify:"space-between",align:""+(p?"flex-start":"center"),mb:"15px",flexDirection:""+(p?"column-reverse":"row"),children:[(0,h.jsx)(N,{}),(0,h.jsxs)(k.s,{w:p?"100%":"auto",justifyContent:"space-around",mb:p?"32px":"0px",children:[(0,h.jsx)(We,{mr:"8px",height:"32px",w:p?"100%":"auto",leftIcon:Te()(b)?(0,h.jsx)(Ge,{}):void 0,onClick:m,isActive:!Te()(b),border:b.length?`2px solid ${De.A.colors.teal[500]}`:"2px solid var(--neutral-100)",_hover:{background:"neutral.100",color:"neutral.700",border:`2px solid ${De.A.colors.teal[500]}`},children:(0,h.jsxs)(u.A,{textStyle:"p1Medium",children:["Filter"," ",Te()(b)?"":` \xb7 ${Te()(b)?0:Object.values(b).join(",").split(",").length}`]})}),p?(0,h.jsx)(Ot,{sort:a,onSort:A}):(0,h.jsx)(It,{sort:a,onSort:A})]})]}):(0,h.jsx)(W.A,{}),w?(0,h.jsx)(M,{noOfLoadingItems:10}):null===y||void 0===y?void 0:y.flat().map((e=>e?(0,h.jsx)(P,{children:(0,h.jsx)(Se,{libraryItem:e})},e.id):null)),(0,h.jsx)(n.a,{ref:t,display:w?"none":"auto",children:!S&&(0,h.jsx)(M,{})})]}),!p&&(0,h.jsx)(X,{}),(0,h.jsx)(ct,{isOpen:x,onClose:f,appliedFilters:b,onApplyFilter:e=>{j(e)}})]})},Tt=()=>{const e=(0,c.A)().get("query"),t=(0,o.useRef)(null),i=(0,D.A)(t),{setTotalCount:r}=g("therapists"),{isMobile:a}=(0,s.A)(),{data:l,setSize:d,isLoadingInitialData:u,isReachingEnd:p}=(0,O.A)((t=>[e,t*Bt,Bt,"search-therapists"]),(async(e,t,i)=>{v(!0);const n=await(0,T.yk)({query:e,limit:i,offset:t}).finally((()=>{v(!1)}));return r((e=>({...e,therapists:n.totalCount}))),n.result}),Bt,{revalidateAll:!1,revalidateOnFocus:!1});return(0,o.useEffect)((()=>{i&&!p&&d((e=>e+1))}),[i,p,d]),(0,h.jsxs)(k.s,{mt:"40px",children:[(0,h.jsxs)(n.a,{flex:1,children:[null!==l&&void 0!==l&&l.flat().length||u?(0,h.jsx)(n.a,{mb:"15px",children:(0,h.jsx)(N,{})}):(0,h.jsx)(W.A,{}),u?(0,h.jsx)(M,{noOfLoadingItems:10,borderRadius:100}):null===l||void 0===l?void 0:l.flat().map((e=>(0,h.jsx)(P,{children:(0,h.jsx)(xe,{publisher:e})},e.id))),(0,h.jsx)(n.a,{ref:t,display:u?"none":"auto",children:!p&&(0,h.jsx)(M,{borderRadius:100})})]}),!a&&(0,h.jsx)(X,{})]})},Pt=["Top","Tracks","Videos","Courses","Teachers","Therapists","Events","Groups","Playlists"],Wt=()=>(0,h.jsxs)(j.t,{isLazy:!0,children:[(0,h.jsx)(w.A,{tabs:Pt}),(0,h.jsxs)(y.T,{children:[(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(Ie,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(Dt,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(zt,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(J,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(me,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(Tt,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(ne,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(le,{})}),(0,h.jsx)(_.K,{paddingX:"0",children:(0,h.jsx)(ce,{})})]})]});var Ft=i(62364),Mt=i(49295),qt=i(51093),Nt=i(38090);const Bt=15,Ht=()=>{const[e,t]=(0,o.useState)(),{isMobile:i}=(0,s.A)(),{previousAndCurrentRoute:l}=(0,qt.s)();return(0,o.useEffect)((()=>{const e=setTimeout((()=>
13{if(l.previousRoute&&l.currentRoute){const e=new URLSearchParams(window.location.search).get("query");(0,Nt.Pl)({page_name:l.currentRoute,previous_page_name:l.previousRoute,page_title:document.title,search_term:e})}}),500);return()=>{clearTimeout(e)}}),[l.previousRoute,l.currentRoute]),(0,h.jsxs)(Ft.QY,{clickedPlayerId:e,setClickedPlayerId:t,children:[(0,h.jsx)(Mt.Ay,{children:(0,h.jsx)("title",{children:"Search | Insight Timer"})}),(0,h.jsx)(m,{children:(0,h.jsxs)(n.a,{as:"main",mt:{base:"5px",sm:"3rem"},_fullScreen:{marginTop:"50px"},children:[i?(0,h.jsx)(n.a,{padding:"0px 24px",children:(0,h.jsx)(r.i,{additionalBranchData:{page_name:"search_page"}})}):(0,h.jsx)(b,{}),(0,h.jsx)(n.a,{height:"32px"}),(0,h.jsx)(a.A,{variant:"small",children:(0,h.jsx)(Wt,{})})]})})]})}},32094:(e,t,i)=>{i.d(t,{NX:()=>n,S1:()=>a,sL:()=>r});const n="https://libraryaudio.insighttimer.com",r=59.99,a="0D6pPYxUy7"},32480:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(78067);const r=()=>({isSmScreen:(0,n.A)({base:!0,sm:!0,md:!1,lg:!1},{ssr:!1}),isMdScreen:(0,n.A)({base:!0,sm:!0,md:!0,lg:!1},{ssr:!1}),isLgScreen:(0,n.A)({base:!1,sm:!1,md:!1,lg:!0},{ssr:!1}),isXLScreen:(0,n.A)({base:!1,xl:!0},{ssr:!1})})},32913:(e,t,i)=>{i.d(t,{h:()=>o});var n,r=i(95254);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},a.apply(null,arguments)}function s(e,t){let{title:i,titleId:s,...o}=e;return r.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:8,height:5,fill:"none",viewBox:"0 0 8 5",ref:t,"aria-labelledby":s},o),i?r.createElement("title",{id:s},i):null,n||(n=r.createElement("path",{stroke:"#222",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M1 1l3 3 3-3"})))}const o=r.forwardRef(s);i.p},33232:(e,t,i)=>{i.d(t,{C2:()=>d,L3:()=>s,Z8:()=>l,cs:()=>u,gL:()=>c,pz:()=>o});var n=i(38491),r=i(19919);const a="https://filtering.insighttimer-api.net",s=async(e,t,i)=>{let{hashtags:s,tags:o,...l}=e;s&&(o=s);const d=r.stringify({type:"LIVE_STREAM",offset:t,limit:i,occurrence_types:"future,live",device_lang:"en",content_langs:"en",...l,tags:o}),u=await n.default.get(`${a}/api/v1/events/filter?${d}`),{data:c}=u;return c},o=async e=>{const{query_type:t,...i}=e;if("EVENTS"!==t)return[];const s=r.stringify(i),o=await n.default.get(`${a}/api/v1/events/filter?${s}`),{data:l}=o;return l},l=async e=>{const t=await n.default.get(`${a}/api/v1/events/${e}`),{data:i}=t;return i},d=async(e,t,i)=>{const r=await n.default.get(`https://search.insighttimer-api.net/api/v1/events/search?query=${e}&offset=${t}&limit=${i}`),{data:a}=r;return a},u=async e=>{let{limit:t,offset:i}=e;const r=await n.default.get("https://events-api.insighttimer-api.net/api/v1/live-streams/filter",{params:{limit:t,offset:i}}),{data:a}=r;return{result:null!==a&&void 0!==a?a:[],totalCount:r.headers["x-total-count"]}},c=async e=>{const t=await n.default.get(`https://filtering.insighttimer-api.net/api/v1/events/${e}?is_cache_disabled=true`);return null===t||void 0===t?void 0:t.data}},33390:(e,t,i)=>{i.d(t,{A:()=>n});const n=e=>{var t,i,n,r;return"string"===typeof e?e:null!==(t=null!==(i=null===e||void 0===e||null===(n=e.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.message)&&void 0!==i?i:null===e||void 0===e?void 0:e.message)&&void 0!==t?t:null}},33870:(e,t,i)=>{i.d(t,{A:()=>d});var n=i(23868),r=i(2023),a=i(84781),s=i(37783),o=i(51093),l=i(19919);const d=e=>{const{isClickTrackable:t=!0}=e||{},{pageType:i,deepLink:d}=(0,r.i)(),{trackGAClickEvent:u}=(0,o.s)();return(e,r)=>{t&&u({click_event_name:s.Fr?s.un?a.ef.DOWNLOAD_APP_IOS_CLICKED:a.ef.DOWNLOAD_APP_ANDROID_CLICKED:a.ef.DOWNLOAD_APP_CLICKED});const o=((e,t,i)=>{const r=l.parse((0,n.fP)(e));let a={};null!==i&&void 0!==i&&i.queryString&&(a=l.parse(i.queryString));const s={...r,...a,...t&&{$deeplink_v2:t,$deeplink:t}};return l.stringify(s)})(i,d,r);window.open("https://insig.ht/appDownload"+(o?`?${o}`:""),"_blank")}}},38491:(e,t,i)=>{i.r(t),i.d(t,{default:()=>s});var n=i(70705),r=i.n(n),a={};for(const o in n)"default"!==o&&(a[o]=()=>n[o]);i.d(t,a);const s=r().create({timeout:3e3})},42381:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(33232),r=i(33390),a=i(3630);const s=e=>{const{data:t,error:i,isValidating:s}=(0,a.Ay)(e?`/events/${e}?is_cache_disabled=true`:null,(()=>e?(0,n.gL)(e):null));return{isLoading:s&&!t&&!i,eventDetails:t,error:(0,r.A)(i)}}},42522:(e,t,i)=>{i.d(t,{A:()=>c});var n,r,a=i(31265),s=i(95254);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},o.apply(null,arguments)}function l(e,t){let{title:i,titleId:a,...l}=e;return s.createElement("svg",o({viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":a},l),i?s.createElement("title",{id:a},i):null,n||(n=s.createElement("line",{x1:5.38638,y1:5.22919,x2:12.7717,y2:12.6145,stroke:"#636D6D",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),r||(r=s.createElement("line",{x1:5.22949,y1:12.6142,x2:12.6148,y2:5.22889,stroke:"#636D6D",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))}const d=s.forwardRef(l);i.p;var u=i(64582);const c=function(e){let{buttonTheme:t="light",...i}=e;const n="light"===t,r=n?"modal.light.300":"neutral.700";return(0,u.jsx)(a.K,{icon:(0,u.jsx)(d,{}),padding:"0",minWidth:"30px",width:"30px",height:"30px",outline:"none",border:"none",borderRadius:"10px","aria-label":"Close modal",position:"absolute",right:"20px",top:"20px",bg:r,transition:"background 0.3s",css:`\n svg {\n width: 18px;\n height: 18px;\n }\n\n svg line {\n stroke: ${n?"var(--chakra-colors-neutral-600)":"var(--chakra-colors-neutral-0)"};\n }\n `,_hover:{bg:n?"modal.light.500":"neutral.700"},_focus:{outline:"none"},...i,onClick:e=>{if(!i.onClick)return;i.onClick(e);const t=document.documentElement;t&&t.classList.remove("overflow-hidden","preserve-scroll-width")}})}},43886:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(95254);const r=(e,t)=>
13{const[i,r]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{if(null===e||void 0===e||!e.current)return;const t=new IntersectionObserver((e=>{let[t]=e;r(t.isIntersecting)}));return t.observe(e.current),()=>{t.disconnect()}}),[e,t]),i}},60597:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(4021),r=i(15263),a=(i(95254),i(24111)),s=i(64582);const o=e=>{let{color:t,ratingScore:i,textColor:o,textProps:l={}}=e;return(0,s.jsxs)(n.a,{display:"flex",alignItems:"baseline",children:[(0,s.jsx)(a.h,{fill:t}),(0,s.jsx)(r.E,{mx:"2px",fontSize:"11px",fontWeight:"700",textTransform:"uppercase",lineHeight:"15px",color:null!==o&&void 0!==o?o:"var(--neutral-600)",...l,children:i&&Math.round(10*i)/10})]})}},65561:(e,t,i)=>{i.d(t,{A:()=>n});const n=i(97141).A.section` 14 max-width: ${e=>"small"===e.variant?"1600px":"1800px"}; 15 margin: auto; 16 width: 100%; 17 padding-left: 64px; 18 padding-right: 64px; 19 @media (max-width: 1681px) { 20 max-width: ${e=>"small"===e.variant?"1396px":"1600px"}; 21 padding-left: 40px; 22 padding-right: 40px; 23 } 24 @media (max-width: 600px) { 25 padding-left: 13px; 26 padding-right: 13px; 27 } 28`},74756:(e,t,i)=>{i.d(t,{Ds:()=>u,Jq:()=>o,PI:()=>c,QZ:()=>d,uj:()=>l});var n=i(73999),r=i.n(n),a=i(34969),s=i.n(a);r().extend(s());const o=(e,t)=>{if(e){const i=Math.floor(e/60);return e>59?`${i} min${i>1&&t?"s":""}`:`${e} sec`}return""},l=()=>{const e=r()();return{epoch:e.valueOf(),iso_8601_datetime_tz:e.toISOString()}},d=e=>r()().year()===r()(e).year(),u=e=>{if(0===e)return"00:00";const t=e=>`0${e}`.slice(-2),i=new Date(1e3*e),n=i.getUTCHours(),r=t(i.getUTCMinutes().toString()),a=t(i.getUTCSeconds().toString());return n?`${n}:${r}:${a}`:`${r}:${a}`},c=e=>r()(e).fromNow()},76681:(e,t,i)=>{i.d(t,{h:()=>o});var n,r=i(95254);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},a.apply(null,arguments)}function s(e,t){let{title:i,titleId:s,...o}=e;return r.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:10,height:14,viewBox:"0 0 10 14",ref:t,"aria-labelledby":s},o),i?r.createElement("title",{id:s},i):null,n||(n=r.createElement("path",{d:"M9.593 6v1a4.34 4.34 0 0 1-1.152 3.004c-.769.851-1.718 1.34-2.848 1.465V12.5h2a.48.48 0 0 1 .352.148.48.48 0 0 1 .148.352.48.48 0 0 1-.148.352.48.48 0 0 1-.352.148h-5a.48.48 0 0 1-.352-.148.48.48 0 0 1-.148-.352.48.48 0 0 1 .148-.352.48.48 0 0 1 .352-.148h2v-1.031c-1.13-.125-2.08-.614-2.848-1.465A4.34 4.34 0 0 1 .593 7V6a.48.48 0 0 1 .148-.352.48.48 0 0 1 .352-.148.48.48 0 0 1 .352.148.48.48 0 0 1 .148.352v1A3.37 3.37 0 0 0 2.62 9.473 3.37 3.37 0 0 0 5.093 10.5a3.37 3.37 0 0 0 2.473-1.027A3.37 3.37 0 0 0 8.593 7V6a.48.48 0 0 1 .148-.352.48.48 0 0 1 .352-.148.48.48 0 0 1 .352.148.48.48 0 0 1 .148.352zm-2-3v4c0 .688-.245 1.276-.734 1.766-.49.49-1.078.734-1.766.734a2.407 2.407 0 0 1-1.766-.734A2.407 2.407 0 0 1 2.593 7V3c0-.688.245-1.276.734-1.766A2.407 2.407 0 0 1 5.093.5c.688 0 1.276.245 1.766.734.49.49.734 1.079.734 1.766z"})))}const o=r.forwardRef(s);i.p},82272:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(4021),r=i(95254),a=i(43672),s=i(64582);const o=e=>{let{playlistId:t,size:i,blurhash:o,gapSize:l}=e;const d=`https://playlists.insighttimer.com/${t}/pictures/montage_${i}.jpeg`,[u,c]=(0,r.useState)(),[p,h]=(0,r.useState)();if((0,r.useEffect)((()=>{h("INPROGRESS");const e=new Image,t=()=>{const{width:t,height:i}=e,n=Math.floor(i/t);c(n),h("DONE")};return e.addEventListener("load",t),e.src=d,()=>{e.removeEventListener("load",t)}}),[d]),o&&"INPROGRESS"===p)return(0,s.jsx)(n.a,{position:"absolute",zIndex:5,width:"100%",height:"100%",borderRadius:"inherit",children:(0,s.jsx)(a.Q,{hash:o,width:"100%",height:"100%"})});if(null==u&&"INPROGRESS"!==p)return null;switch(u){case 3:return(0,s.jsxs)(n.a,{position:"absolute",display:"flex",gridColumnGap:null!==l&&void 0!==l?l:0,top:0,right:0,left:0,bottom:0,children:[(0,s.jsx)(n.a,{backgroundSize:`calc(200% + ${l?`${l} + 5px`:0})`,flex:2,backgroundPosition:"top center",backgroundImage:`url(${d})`}),(0,s.jsxs)(n.a,{flex:2,display:"flex",flexDirection:"column",gridRowGap:null!==l&&void 0!==l?l:0,children:[(0,s.jsx)(n.a,{backgroundSize:l?"100%":"cover",flex:1,backgroundPosition:"center",backgroundImage:`url(${d})`}),(0,s.jsx)(n.a,{backgroundSize:l?"100%":"cover",flex:1,backgroundPosition:"bottom",backgroundImage:`url(${d})`})]})]});case 2:return(0,s.jsxs)(n.a,{position:"absolute",display:"flex",top:0,right:0,left:0,bottom:0,gridColumnGap:null!==l&&void 0!==l?l:0,children:[(0,s.jsx)(n.a,{backgroundSize:`calc(165% + ${l||0})`,flex:1,backgroundPosition:"top center",backgroundImage:`url(${d})`}),(0,s.jsx)(n.a,{backgroundSize:`calc(165% + ${l||0})`,flex:1,backgroundPosition:"bottom center",backgroundImage:`url(${d})`})]});case 1:return(0,s.jsx)(n.a,{width:"100%",height:"100%",position:"absolute",top:0,left:0,backgroundImage:`url(${d})`});default:return null}}},91557:(e,t,i)=>{i.d(t,{Fi:()=>o,OE:()=>u,RF:()=>n,Zt:()=>r,_J:()=>l,bk:()=>s,bw:()=>c,u2:()=>d,uP:()=>a});const n="https://insighttimer.com",r="157891377582896",a="insighttimer.com",s="https://filtering.insighttimer-api.net",o="https://search.insighttimer-api.net",l="https://web.insighttimer.com",d="https://widgets.insighttimer.com",u="https://teacher.insighttimer.com",c=["https://web-retreats--insight-timer-a1ac7.us-east4.hosted.app/retreats","https://funnel-staging.insighttimer.com/retreats",`${n}/retreats`]}
28,92751:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(83619),r=i(93727);const a=()=>{const[e]=(0,n.U)(`(max-width: ${r.w4.breakpoints.lg})`);return{isMobile:e}}}}]); 29//# sourceMappingURL=3823.c2c46d85.chunk.js.map
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.