PageSourceSearch

https://mobbin.com/_next/static/immutable/chunks/2y9h4jc40bmm8.js

js mobbin.com collected 2026-09-24 20:19:36 UTC 88,924 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="b705b495-60db-34ab-da51-949c206215d3")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,730086,478862,e=>{"use strict";var t=e.i(232122);e.s(["useWindowWidth",0,function(){let{isSsrRendered:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isSsrRendered:!1},[r,a]=(0,t.useState)(()=>!0===e?1880:window.innerWidth);return(0,t.useEffect)(()=>{let t=()=>{a(window.innerWidth)};return!0===e&&t(),window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}},[e]),r}],478862),e.s([],730086)},39588,e=>{"use strict";var t=e.i(964379);e.i(54125);var r=e.i(519877),a=e.i(216446);e.s(["usePageExperience",0,function(){let e=(0,t.usePathname)(),s=(0,r.useClientCookie)("last_browsed_experience"),n=function(e){if(e.startsWith("/screens")||e.startsWith("/flows"))return"apps";let t=e.split("/");return t.includes("apps")?"apps":t.includes("sites")?"sites":void 0}(e);return n||(s??a.DEFAULT_EXPERIENCE)}],39588)},121046,889764,438495,245384,587044,519895,e=>{"use strict";var t=e.i(899931),r=e.i(386824),a=e.i(796936),s=e.i(698328);e.i(735387);var n=e.i(189219),i=e.i(947823),c=e.i(207653),o=e.i(744363);function l(e){return"android"===e?"ios":e}let d=c.z.object({src:c.z.string(),srcSet:c.z.array(c.z.object({url:c.z.string(),descriptor:c.z.string()})),downloadableSrc:c.z.string().nullable()}).transform(e=>e);function u(e){let t="apps"===e.experience?`apps:${e.platform}`:"sites";return"app"in e?`${t}:app:${e.app.id}`:"site"in e?`${t}:site:${e.site.id}`:"filterTag"in e?`${t}:filterTag:${e.filterTag.id}`:`${t}:text:${e.textQueryMethod}:${e.textQuery}`}function p(e,t){let r=u(e);return[e,...(t??[]).filter(e=>u(e)!==r)]}function m(){let e=(0,r.useActiveWorkspaceContext)(),c=(0,a.useNavigateToConcurrentDeny)();return(0,t.useMutation)({mutationFn:async e=>{let t=await fetch("/api/search-bar/upsert-recent-search",{method:"POST",body:JSON.stringify(e)}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).catch(s.Result.capture("CglZxGTR").err("Unexpected fetch error"));if(t.error)switch(t.error.message){case"query error":case"unauthenticated":case"no workspaces":case"Unexpected fetch error":throw Error(t.error.message);case"concurrent deny":throw c(),Error(t.error.message)}},onMutate:async t=>{if(!e)throw Error("Developer Error: This query should not be called when the user is not authenticated.");let r=(0,n.buildKey)(["recent_searches"],e.user.id);await i.queryClient.cancelQueries({queryKey:r});let a=i.queryClient.getQueryData(r);return i.queryClient.setQueryData(r,e=>{let r;if(void 0===e)return;let a=crypto.randomUUID();switch(t.experience){case"apps":r="app"in t?{id:a,experience:t.experience,platform:t.platform,app:t.app}:"filterTag"in t?{id:a,experience:t.experience,platform:t.platform,filterTag:t.filterTag}:{id:a,experience:t.experience,platform:t.platform,textQuery:t.textQuery,textQueryMethod:t.textQueryMethod};break;case"sites":r="site"in t?{id:a,experience:t.experience,site:t.site}:"filterTag"in t?{id:a,experience:t.experience,filterTag:t.filterTag}:{id:a,experience:t.experience,textQuery:t.textQuery,textQueryMethod:t.textQueryMethod}}return"apps"===r.experience?{...e,apps:{...e.apps,[r.platform]:p(r,e.apps[r.platform])}}:{...e,sites:p(r,e.sites)}}),{recentSearchesSnapshot:a}},onError:(t,r,a)=>{i.queryClient.setQueryData((0,n.buildKey)(["recent_searches"],e?.user.id),a?.recentSearchesSnapshot)},onSettled:()=>{i.queryClient.invalidateQueries({queryKey:(0,n.buildKey)(["recent_searches"],e?.user.id)})}})}c.z.object({id:c.z.string(),platform:c.z.enum(o.PLATFORMS),appName:c.z.string(),appLogoCdnImgSources:d.optional()}),c.z.object({id:c.z.string(),name:c.z.string(),logoCdnImgSources:d.optional()}),e.s(["useSaveRecentSearch",0,m],889764);var h=e.i(161615),g=e.i(232122),x=e.i(615437),y=e.i(764344),f=e.i(669065);let S=(0,g.createContext)(null);var v=e.i(799414),b=e.i(346433);let C=e=>!e.isLayoutDirty&&e.willUpdate(!1),T=e=>{let{children:t,id:r,inherit:a=!0}=e,s=(0,g.useContext)(f.LayoutGroupContext),n=(0,g.useContext)(S),[i,c]=function(){let e,t=(e=(0,g.useRef)(!1),(0,b.useIsomorphicLayoutEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e),[r,a]=(0,g.useState)(0),s=(0,g.useCallback)(()=>{t.current&&a(r+1)},[r]);return[(0,g.useCallback)(()=>v.frame.postRender(s),[s]),r]}(),o=(0,g.useRef)(null),l=s.id||n;if(null===o.current){let e,t,n,i;
2(!0==(!0===(i=a))||"id"===i)&&l&&(r=r?l+"-"+r:l),o.current={id:r,group:!0===a&&s.group||(e=new Set,t=new WeakMap,{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);let a=t.get(r);a&&(a(),t.delete(r)),n()},dirty:n=()=>e.forEach(C)})}}let d=(0,g.useMemo)(()=>({...o.current,forceRender:i}),[c]);return(0,h.jsx)(f.LayoutGroupContext.Provider,{value:d,children:t})};var w=e.i(577296);e.i(734597);var j=e.i(317419),k=e.i(117022);e.i(373157);var N=e.i(780234);e.i(189480);var I=e.i(282437),B=e.i(225921),P=e.i(733688);e.i(544167);var _=e.i(293700),R=e.i(530486),E=e.i(265198),F=e.i(540683),A=e.i(841730),L=e.i(507243),M=e.i(195259);e.i(479413);var q=e.i(678542),D=e.i(39588),Q=e.i(581151);function z(e){return"web"===e?"web":"mobile"}e.s(["getDictionaryCategoryExperience",0,z],438495);var O=e.i(123196);e.i(349242);var G=e.i(34583),U=e.i(283927),W=e.i(649701),H=e.i(749479);e.i(870032);var K=e.i(513541),V=e.i(579174),$=e.i(938808),X=e.i(947118),Y=e.i(113329);function Z(e){return(0,h.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,"data-sentry-element":"svg","data-sentry-component":"SectionIcon","data-sentry-source-file":"SectionIcon.tsx",children:(0,h.jsx)("path",{d:"M3 8V17H10M3 8V3H17V8M3 8H10M17 8V17H10M17 8H10M10 8V17",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke","data-sentry-element":"path","data-sentry-source-file":"SectionIcon.tsx"})})}function J(e){return(0,h.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,"data-sentry-element":"svg","data-sentry-component":"SparklesIcon","data-sentry-source-file":"SparklesIcon.tsx",children:[(0,h.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 10C11 10 13 8 13 4C13 8 15 10 19 10C15 10 13 12 13 16C13 12 11 10 7 10Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke","data-sentry-element":"path","data-sentry-source-file":"SparklesIcon.tsx"}),(0,h.jsx)("path",{d:"M4 2V3M4 3C4 4.10457 3.10457 5 2 5M4 3C4 4.10457 4.89543 5 6 5M2 5H1M2 5C3.10457 5 4 5.89543 4 7M6 5H7M6 5C4.89543 5 4 5.89543 4 7M4 8V7",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke","data-sentry-element":"path","data-sentry-source-file":"SparklesIcon.tsx"}),(0,h.jsx)("path",{d:"M6 13V14M6 14C6 15.1046 5.10457 16 4 16M6 14C6 15.1046 6.89543 16 8 16M4 16H3M4 16C5.10457 16 6 16.8954 6 18M8 16H9M8 16C6.89543 16 6 16.8954 6 18M6 19V18",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke","data-sentry-element":"path","data-sentry-source-file":"SparklesIcon.tsx"})]})}var ee=e.i(558814);let et={appCategories:(0,h.jsx)($.CategoriesIcon,{}),screenPatterns:(0,h.jsx)(Y.ScreensIcon,{}),screenElements:(0,h.jsx)(ee.UIElementIcon,{}),flowActions:(0,h.jsx)(X.FlowIcon,{}),categories:(0,h.jsx)($.CategoriesIcon,{}),pageAndSectionPatterns:(0,h.jsx)(Z,{}),styles:(0,h.jsx)(J,{})},er={appCategories:"App Category",screenPatterns:"Screen",screenElements:"UI Element",flowActions:"Flow",categories:"Category",pageAndSectionPatterns:"Section",styles:"Style"},ea={ios:"web",android:"ios",web:"ios"};var es=e.i(769572);let en=(0,es.createServerReference)("404b7cc42cb12f6c3dee716724c4afc9ad39e74889",es.callServer,void 0,es.findSourceMapURL,"actionDeleteRecentSearch");var ei=e.i(964379),ec=e.i(478754);let eo={appCategories:"apps",screenElements:"ui-elements",screenPatterns:"screens",flowActions:"flows",categories:"sites",pageAndSectionPatterns:"sections",styles:"sites"};function el(e){return eo[e.categorySlug]}var ed=e.i(270838),eu=e.i(594133),ep=e.i(174766),em=e.i(421714),eh=e.i(23234),eg=e.i(85351);let ex=["apps","screens","ui-elements","flows"],ey=["sites","sections"];var ef=e.i(216446);let eS=(0,g.createContext)({experience:ef.DEFAULT_EXPERIENCE,platform:ef.DEFAULT_PLATFORM,activeItemValue:"",hoverCardBoundaryElement:null,isSearchBarAnimating:!1,inputRef:(0,g.createRef)()});var ev=e.i(428295);let eb=(0,ev.atom)(!1),eC=(0,ev.atom)("Trending"),eT=(0,ev.atom)(""),ew=(0,ev.atom)({listScrollPosition:0,activeItemValue:void 0});function ej(){let[e,t]=(0,ev.useAtom)(eb),[r,a]=(0,ev.useAtom)(eC),[s,n]=(0,ev.useAtom)(eT),[i,c]=(0,ev.useAtom)(ew);return{isOpen:e,activeTab:r,scrollState:i,initialInputValue:s,setIsOpen:t,setActiveTab:a,setScrollState:c,setInitialInputValue:n,resetScrollState:function(){c({listScrollPosition:0,activeItemValue:void 0})}}}function ek(){let e=(0,ei.useRouter)(),t=(0,ei.useSearchParams)(),a=(0,ed.usePageContentType)(),s=(0,g.useContext)(eS),{setIsOpen:n}=ej(),i=m(),c=(0,r.useActiveWorkspaceContext)(),o=(()=>{switch(c?.membershipPlan){case"enterprise":case"team":case"personal":switch(c.subscriptionState.status){case"active":case"will_cancel":case"will_pause":return!0;case"no_seat":case"canceled":case"not_started":case"paused":return!1}break;case"none":case void 0:return!1}})();return{handleAppSelected:function(t){let{app:r,source:c,shouldSaveSearch:o,query:l}=t;"search_result"===c?M.SegmentClient.track("Search Bar App Selected",{search_bar_experience:s.experience,search_bar_platform:"apps"===s.experience?s.platform:void 0,app_id:r.id,source:c,query:l??""}):M.SegmentClient.track("Search Bar App Selected",{search_bar_experience:s.experience,search_bar_platform:"apps"===s.experience?s.platform:void 0,app_id:r.id,source:c});let d=(0,ec.getAppDetailPagePathnameWithQueryString)({appSlug:{platform:r.platform,id:r.id,name:r.appName},contentType:(0,em.isAppsPageContentType)(a)?a:void 0});!0===o&&i.mutate({experience:"apps",platform:r.platform,app:r}),n(!1),e.push(d)},handleSiteSelected:function(t){let{site:r,source:a,shouldSaveSearch:c,query:o}=t;"search_result"===a?M.SegmentClient.track("Search Bar Site Selected",{search_bar_experience:s.experience,search_bar_platform:"apps"===s.experience?s.platform:void 0,site_id:r.id,source:a,query:o??""}):M.SegmentClient.track("Search Bar Site Selected",{search_bar_experience:s.experience,search_bar_platform:"apps"===s.experience?s.platform:void 0,site_id:r.id,source:a});let l=(0,eu.getSiteDetailPagePathnameWithQueryString)({siteSlug:{id:r.id,name:r.name}});!0===c&&i.mutate({experience:"sites",site:r}),n(!1),e.push(l)},handleFilterTagSelected:function(r){let{filterTag:a,source:c,shouldSaveSearch:l,query:d}=r,u=el(a);void 0!==u&&("search_result"===c?M.SegmentClient.track("Search Bar Filter Tag Selected",{..."apps"===s.experience?{experience:"apps",platform:s.platform}:{experience:"sites"},..."sites"!==a.categoryExperience?{filter_experience:"apps",filter_platform_type:a.categoryExperience}:{filter_experience:"sites"},filter_parameter:[a.categorySlug,a.displayName],source:c,query:d??""}):"landing_page_to_site_category_section"===c?M.SegmentClient.track("Search Bar Filter Tag Selected",{experience:"sites",filter_experience:"sites",filter_parameter:[a.categorySlug,a.displayName],source:"landing_page_to_site_category_section",query:d??""}):M.SegmentClient.track("Search Bar Filter Tag Selected",{..."apps"===s.experience?{experience:"apps",platform:s.platform}:{experience:"sites"},..."sites"!==a.categoryExperience?{filter_experience:"apps",filter_platform_type:a.categoryExperience}:{filter_experience:"sites"},filter_parameter:[a.categorySlug,a.displayName],source:c}),!0===l&&i.mutate("sites"!==a.categoryExperience?{experience:"apps",platform:"mobile"===a.categoryExperience?"ios":"web",filterTag:a}:{experience:"sites",filterTag:a}),n(!1),e.push((()=>{switch(a.categoryExperience){case"mobile":case"web":{if(!ex.includes(u))throw Error("Developer error: Filter tag category experience and content type are incompatible.");let e="mobile"===a.categoryExperience?"ios":"web",r=t.get("sort");
2switch(u){case"apps":return(0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"filters",activeFilterTags:[a],contentType:u,platform:e,categories:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:r,contentType:u,isSubscribed:o})}});case"screens":case"ui-elements":return(0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"filters",activeFilterTags:[a],contentType:u,platform:e,categories:null,screenElements:null,screenPatterns:null,textInScreenshotQuery:null,hasAnimation:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:r,contentType:u,isSubscribed:o})}});case"flows":return(0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"filters",activeFilterTags:[a],contentType:u,platform:e,categories:null,flowActions:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:r,contentType:u,isSubscribed:o})}})}throw Error("Developer error: Filter tag category experience and content type are incompatible.")}case"sites":if(!ey.includes(u))throw Error("Developer error: Filter tag category experience and content type are incompatible.");switch(u){case"sites":return(0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"filters",activeFilterTags:[a],contentType:u,categories:null,styles:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:t.get("sort"),contentType:u,isSubscribed:o})}});case"sections":return(0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"filters",activeFilterTags:[a],contentType:u,categories:null,styles:null,pageAndSectionPatterns:null,textInScreenshotQuery:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:t.get("sort"),contentType:u,isSubscribed:o})}})}}})()))},handleTextInScreenshotSearch:function(r){let{query:a,source:c,shouldSaveSearch:l}=r;"search_result"===c?M.SegmentClient.track("Search Bar Filter Tag Selected",{..."apps"===s.experience?{experience:"apps",platform:s.platform,filter_experience:"apps",filter_platform_type:(0,ep.getPlatformType)(s.platform),filter_parameter:["screenKeywords",a]}:{experience:"sites",filter_experience:"sites",filter_parameter:["sectionKeywords",a]},source:c,query:a}):"landing_page_to_site_category_section"!==c&&M.SegmentClient.track("Search Bar Filter Tag Selected",{..."apps"===s.experience?{experience:"apps",platform:s.platform,filter_experience:"apps",filter_platform_type:(0,ep.getPlatformType)(s.platform),filter_parameter:["screenKeywords",a]}:{experience:"sites",filter_experience:"sites",filter_parameter:["sectionKeywords",a]},source:c}),!0===l&&i.mutate("apps"===s.experience?{experience:"apps",platform:s.platform,textQuery:a,textQueryMethod:"Text in Screenshot"}:{experience:"sites",textQuery:a,textQueryMethod:"Text in Screenshot"}),n(!1);let d=(()=>{switch(s.experience){case"apps":return(0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"filters",activeFilterTags:[],textInScreenshotQuery:a,contentType:"screens",platform:s.platform,categories:null,screenElements:null,screenPatterns:null,hasAnimation:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:t.get("sort"),contentType:"screens",isSubscribed:o})}});case"sites":return(0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"filters",activeFilterTags:[],textInScreenshotQuery:a,contentType:"sections",categories:null,styles:null,pageAndSectionPatterns:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:t.get("sort"),contentType:"sections",isSubscribed:o})}})}})();e.push(d)},handleExperimentalFreeTextSearch:function(t){switch(n(!1),t.contentType){case"apps":e.push((0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{contentType:t.contentType,platform:s.platform??"ios",type:"free_text_search",mode:"standard",query:t.query}}));break;case"sites":e.push((0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{contentType:t.contentType,type:"free_text_search",mode:"standard",query:t.query}}))}},handleFreeTextSearch:function(t){switch(s.experience){case"apps":{M.SegmentClient.track("Search Bar Filter Tag Selected",{experience:s.experience,platform:s.platform,filter_experience:s.experience,filter_platform_type:(0,ep.getPlatformType)(s.platform),filter_parameter:["aiDescriptionSearch",t.query],is_ai_mode:"deep"===t.mode,source:t.source,query:t.query});let r=new URLSearchParams({q:t.query});"deep"===t.mode&&r.set("mode","deep"),("ios"===s.platform||"web"===s.platform)&&r.set("fallbackPlatform",s.platform),!0===t.shouldSaveSearch&&r.set("saveSearch","true"),n(!1),e.push(`/search/apps?${r.toString()}`);break}case"sites":M.SegmentClient.track("Search Bar Filter Tag Selected",{experience:s.experience,filter_experience:s.experience,filter_parameter:["aiDescriptionSearch",t.query],source:t.source,query:t.query}),!0===t.shouldSaveSearch&&i.mutate({experience:"sites",textQuery:t.query,textQueryMethod:"Free Text"}
2),n(!1),e.push((0,eh.getSearchPagePathnameWithQueryString)({searchQuery:{type:"free_text_search",query:t.query,mode:"standard",contentType:"sections",textInScreenshotQuery:null}}))}}}}function eN(e){let a,{handleAppSelected:c,handleSiteSelected:o,handleFilterTagSelected:l,handleTextInScreenshotSearch:d,handleFreeTextSearch:u}=ek(),p=(a=(0,r.useActiveWorkspaceContext)(),(0,t.useMutation)({mutationFn:en,onMutate:async e=>{if(!a)throw Error("Developer error: This query should not be called when the user is not authenticated.");let t=(0,n.buildKey)(["recent_searches"],a.user.id);await i.queryClient.cancelQueries({queryKey:t});let r=i.queryClient.getQueryData(t);return i.queryClient.setQueryData(t,t=>{if(void 0!==t)switch(e.experience){case"apps":return{...t,apps:{...t.apps,[e.platform]:t.apps[e.platform]?.filter(t=>t.id!==e.recentSearchId)}};case"sites":return{...t,sites:t.sites?.filter(t=>t.id!==e.recentSearchId)}}}),{recentSearchesSnapshot:r}},onError:(e,t,r)=>{i.queryClient.setQueryData((0,n.buildKey)(["recent_searches"],a?.user.id),r?.recentSearchesSnapshot)},onSettled:()=>{i.queryClient.invalidateQueries({queryKey:(0,n.buildKey)(["recent_searches"],a?.user.id)})}})),m=(0,V.useFilterTagCustomDisplayName)(),x="app"in e.recentSearch?e.recentSearch.app.appName:"site"in e.recentSearch?e.recentSearch.site.name:"filterTag"in e.recentSearch?m(e.recentSearch.filterTag.displayName,e.recentSearch.filterTag.categorySlug,e.recentSearch.filterTag.categoryExperience):"Text in Screenshot"===e.recentSearch.textQueryMethod?`“${e.recentSearch.textQuery}”`:e.recentSearch.textQuery,[y,f]=(0,g.useState)(null),S=null!==y&&y.scrollWidth<=y.clientWidth;return(0,h.jsx)(N.Tooltip,{text:x,hide:S,"data-sentry-element":"Tooltip","data-sentry-component":"SearchBarRecentItem","data-sentry-source-file":"SearchBarRecentItem.tsx",children:(0,h.jsxs)(w.motion.button,{layout:"position",initial:{opacity:0}
2,animate:{opacity:1,transition:{delay:.15}},exit:{opacity:0,transition:{duration:.15}},className:(0,L.classNames)("group relative","flex gap-x-8 rounded-full px-12 py-8","bg-background-secondary min-720:bg-glass-background-secondary","hover:bg-background-secondary-hover data-selected:bg-background-secondary-hover","min-720:hover:bg-glass-background-secondary-hover min-720:data-selected:bg-glass-background-secondary-hover","transition-colors ease-out","isolate z-10"),onClick:function(){if(M.SegmentClient.track("Recent Search Clicked",{recent_search_id:e.recentSearch.id}),"app"in e.recentSearch)c({app:e.recentSearch.app,source:"recent_searches",shouldSaveSearch:!0});else if("site"in e.recentSearch)o({site:e.recentSearch.site,source:"recent_searches",shouldSaveSearch:!0});else if("filterTag"in e.recentSearch)l({filterTag:e.recentSearch.filterTag,source:"recent_searches",shouldSaveSearch:!0});else if("Text in Screenshot"===e.recentSearch.textQueryMethod)d({query:e.recentSearch.textQuery,source:"recent_searches",shouldSaveSearch:!0});else{let t="Free Text AI Mode"===e.recentSearch.textQueryMethod?"deep":"standard";u({query:e.recentSearch.textQuery,source:"recent_searches",shouldSaveSearch:!0,mode:t})}},"data-sentry-element":"motion.button","data-sentry-source-file":"SearchBarRecentItem.tsx",children:[(0,h.jsx)("span",{className:"pointer-events-none absolute top-8 left-12 z-10 size-20 opacity-0 transition-opacity ease-out min-720:pointer-events-auto min-720:group-hover:opacity-100",onClick:async t=>{t.stopPropagation(),M.SegmentClient.track("Recent Search Cleared",void 0);let r=await p.mutateAsync("apps"===e.recentSearch.experience?{recentSearchId:e.recentSearch.id,experience:e.recentSearch.experience,platform:e.recentSearch.platform}:{recentSearchId:e.recentSearch.id,experience:e.recentSearch.experience}).catch(s.Result.capture("W8YnfGqa").err("mutation error"));if(r.error)switch(r.error.message){case"concurrent deny":case"no workspaces":case"query error":case"unauthenticated":case"mutation error":G.toaster.toastError("Oh no, something went wrong. Try again?")}},children:(0,h.jsx)(R.ClearIcon,{className:(0,L.classNames)("size-full text-text-secondary min-720:text-glass-text-secondary","min-720:hover:text-[hsl(var(--neutral-30))]","transition-colors ease-out"),"data-sentry-element":"ClearIcon","data-sentry-source-file":"SearchBarRecentItem.tsx"})}),(0,h.jsx)("div",{className:"size-20 shrink-0 text-text-primary transition-opacity ease-out min-720:text-glass-text-primary min-720:group-hover:opacity-0",children:(()=>{if("app"in e.recentSearch)return(0,h.jsx)(K.AppLogo,{size:"fill",cdnImgSources:e.recentSearch.app.appLogoCdnImgSources,appName:e.recentSearch.app.appName});if("site"in e.recentSearch)return(0,h.jsx)(K.AppLogo,{size:"fill",cdnImgSources:e.recentSearch.site.logoCdnImgSources,appName:e.recentSearch.site.name});if("filterTag"in e.recentSearch)return et[e.recentSearch.filterTag.categorySlug];if("Text in Screenshot"===e.recentSearch.textQueryMethod)return(0,h.jsx)(H.TextInScreenshotIcon,{});if("Free Text AI Mode"===e.recentSearch.textQueryMethod)return(0,h.jsx)(W.SearchIntelligenceIcon,{});else return(0,h.jsx)(U.SearchIcon,{})})()}),(0,h.jsx)("span",{ref:f,className:(0,L.classNames)("max-w-80 truncate text-compact-bold whitespace-nowrap text-text-primary min-720:text-glass-text-primary","pointer-events-none"),children:x})]})})}e.s(["useSearchBarGlobalState",0,ej],245384);var eI=e.i(731611);function eB(){let e,t=(0,g.useContext)(eS),a=(e=(0,r.useActiveWorkspaceContext)(),(0,eI.useQuery)({queryKey:(0,n.buildKey)(["recent_searches"],e?.user.id),queryFn:async()=>{let e=await fetch("/api/recent-searches",{method:"GET"}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).catch(s.Result.capture("Kq7rNp2x").err("Unexpected fetch error"));if(e.error)switch(e.error.message){case"Failed to fetch recent searches":case"Unexpected fetch error":throw Error(e.error.message)}return e.value},enabled:!!e})),i=("apps"===t.experience?a.data?.apps[t.platform]:a.data?.sites)?.slice(0,6)??[],c="apps"===t.experience?`apps:${t.platform}`:"sites";return(0,h.jsx)(w.motion.section,{layout:"position",className:(0,L.classNames)(i.length>0&&"flex h-60 w-full flex-nowrap gap-x-8 px-16 pt-8 pb-16 min-720:px-20","scrollbar-none overflow-x-auto"),"data-sentry-element":"motion.section","data-sentry-component":"SearchBarRecentSection","data-sentry-source-file":"SearchBarRecentSection.tsx",children:(0,h.jsx)(O.AnimatePresence,{initial:!1,"data-sentry-element":"AnimatePresence","data-sentry-source-file":"SearchBarRecentSection.tsx",children:i.map(e=>(0,h.jsx)(eN,{recentSearch:e},u(e)))})},c)}var eP=e.i(655539);e.i(520649);var e_=e.i(575723);e.i(313714);var eR=e.i(572071),eE=e.i(848317),eF=e.i(44979),eA=e.i(440159),eL=e.i(287837);e.i(915409);var eM=e.i(853703),eq=e.i(976864),eD=e.i(486599);e.i(611615);var eQ=e.i(78187),ez=e.i(241738),eO=e.i(13626),eG=e.i(687230),eU=e.i(460638),eW=e.i(986529),eH=e.i(41966),eK=e.i(620310),eV=e.i(986112),e$=e.i(831182),eX=e.i(192181),eY=e.i(683005),eZ=e.i(174637),eJ=e.i(857288);e.i(730086);var e0=e.i(478862);
2let e1=["iOS Liquid Glass in dark mode","Pricing page with 3D illustration","Paywall screen with lifetime option","Order page with progress bar"];function e2(e){let t=(0,g.useContext)(eS),r=(0,_.useTailwindBreakpoint)(),a=(0,e0.useWindowWidth)(),s=t.activeItemValue.toLowerCase()===e.value.toLowerCase()&&!t.isSearchBarAnimating&&a>=1440&&r>=720,[n,i]=(0,g.useState)(0);return(0,g.useEffect)(()=>{if(!s)return void i(0);let e=setInterval(()=>{i(e=>(e+1)%e1.length)},2e3);return()=>clearInterval(e)},[s]),(0,h.jsxs)(eJ.Root,{open:s,"data-sentry-element":"RadixHoverCard.Root","data-sentry-component":"SearchBarSearchResultsFreeTextSearchHoverCard","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearchHoverCard.tsx",children:[(0,h.jsx)(eJ.Trigger,{asChild:!0,"data-sentry-element":"RadixHoverCard.Trigger","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearchHoverCard.tsx",children:e.children}),(0,h.jsx)(eJ.Portal,{"data-sentry-element":"RadixHoverCard.Portal","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearchHoverCard.tsx",children:(0,h.jsx)(eJ.Content,{side:"right",align:"start",sideOffset:28,collisionBoundary:t.hoverCardBoundaryElement,collisionPadding:8,hideWhenDetached:!0,asChild:!0,"data-sentry-element":"RadixHoverCard.Content","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearchHoverCard.tsx",children:(0,h.jsxs)("aside",{className:(0,L.classNames)("flex flex-col gap-y-12 rounded-20 p-16","bg-glass-background-primary","glass shadow-glass backdrop-blur-glass","w-(--radix-hover-card-content-available-width) max-w-[400px] min-w-[296px]"),children:[(0,h.jsxs)("div",{className:(0,L.classNames)("@container","flex flex-col items-center justify-center gap-y-4 rounded-16 bg-glass-background-secondary","aspect-16/10 w-full"),children:[(0,h.jsxs)("div",{className:"flex items-center gap-x-4 text-body text-glass-text-secondary",children:[(0,h.jsx)(U.SearchIcon,{className:"size-20","data-sentry-element":"SearchIcon","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearchHoverCard.tsx"}),(0,h.jsx)("span",{children:"Search for..."})]}),(0,h.jsx)(O.AnimatePresence,{mode:"popLayout",initial:!1,"data-sentry-element":"AnimatePresence","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearchHoverCard.tsx",children:(0,h.jsx)(w.motion.p,{className:(0,L.classNames)("whitespace-nowrap","text-feature-bold text-[clamp(14px,5cqw,20px)]! text-glass-text-primary"),initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{type:"spring",stiffness:320,damping:24},"data-sentry-element":"motion.p","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearchHoverCard.tsx",children:e1[n]},n)})]}),(0,h.jsx)("p",{className:"text-compact text-glass-text-secondary",children:"Describe what you’re looking for in detail, and AI will find the most relevant screens for you."})]})})})]})}function e7(e){return(0,h.jsxs)(y.Command.Item,{ref:e.ref,value:e.value,className:(0,L.classNames)("flex h-56 cursor-pointer items-center gap-x-12 rounded-16 px-8","text-text-primary min-720:text-glass-text-primary","data-selected:bg-background-primary-hover","min-720:data-selected:bg-glass-background-primary-hover"),onSelect:e.onSelect,"data-sentry-element":"Command.Item","data-sentry-component":"SearchBarSearchResultsGenericItem","data-sentry-source-file":"SearchBarSearchResultsGenericItem.tsx",children:[(0,h.jsx)("div",{className:"shrink-0",children:e.icon}),(0,h.jsxs)("div",{className:"flex grow flex-col overflow-hidden",children:[(0,h.jsxs)("div",{className:"flex items-center gap-x-12 text-body-bold",children:[(0,h.jsx)("span",{className:"truncate",children:e.title}),e.titleBadge]}),"string"==typeof e.subtitle&&(0,h.jsx)("span",{className:"truncate text-compact text-text-secondary min-720:text-glass-text-secondary",children:e.subt
2itle})]}),e.customBadge]})}function e4(e){let t=720>(0,_.useTailwindBreakpoint)(),r=(0,g.useContext)(eS),a=ek(),s=(0,eA.useEntitlements)(),n=(0,eZ.usePricingTouchpoint)(),i=(0,eX.useUserAccountSetupMetadata)(),c=i.data?.is_search_bar_deep_mode_coachmark_complete??!0,[o,l]=(0,g.useState)(!1);async function d(){l(!1);let e=await i.update({is_search_bar_deep_mode_coachmark_complete:!0});e.error&&e.error.message}(0,g.useEffect)(()=>{if(c||t)return;let e=setTimeout(()=>l(!0),350);return()=>clearTimeout(e)},[c,t]);let[u,p]=(0,g.useState)(void 0);void 0!==u&&u.searchTerm!==e.searchTerm&&p(void 0);let m=u?.mode??(e.searchTerm.trim().split(/\s+/).length>=4&&s.ftsDeepSearch.isGranted?"deep":"standard");return(0,h.jsx)(e2,{value:"Free Text Search","data-sentry-element":"SearchBarSearchResultsFreeTextSearchHoverCard","data-sentry-component":"SearchBarSearchResultsFreeTextSearch","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearch.tsx",children:(0,h.jsx)(e7,{value:"Free Text Search",title:"deep"===m?"Deep Search":"Search",titleBadge:"deep"===m?(0,h.jsx)(eL.RoundedGlassBadge,{variant:"primary",children:"AI"}):null,icon:(0,h.jsx)(e8,{mode:m}),customBadge:(0,h.jsxs)(eM.CoachMark,{visible:o,onClose:d,children:[(0,h.jsx)(eq.CoachMarkAnchor,{children:(0,h.jsx)("div",{className:(0,L.classNames)("min-720:[--tw-enter-translate-y:0] min-720:[--tw-exit-translate-y:0]","min-720:[--tw-enter-translate-x:0] min-720:[--tw-exit-translate-x:0]"),onClick:e=>e.stopPropagation(),children:(0,h.jsxs)(eQ.DropdownMenu,{onOpenChange:e=>{e&&o&&d()},children:[(0,h.jsx)(eW.DropdownMenuTrigger,{children:(0,h.jsx)("button",{type:"button","aria-label":"Pick search mode",className:(0,L.classNames)("flex size-36 items-center justify-center","text-text-secondary min-720:text-glass-text-secondary","hover:text-text-primary min-720:hover:text-glass-text-primary"),children:(0,h.jsx)(eV.MoreIcon,{className:"size-20"})})}),(0,h.jsx)(ez.DropdownMenuContent,{width:280,align:"end",onCloseAutoFocus:e=>{e.preventDefault(),r.inputRef.current?.focus()},children:(0,h.jsxs)(eO.DropdownMenuGroup,{children:[(0,h.jsx)(eU.DropdownMenuLabel,{children:"Search mode"}),(0,h.jsx)(eG.DropdownMenuItem,{icon:J,auxilliaryIcon:"deep"===m?eK.CheckmarkIcon:void 0,onSelect:()=>{s.ftsDeepSearch.isGranted?p({mode:"deep",searchTerm:e.searchTerm}):n.trigger("search_deep_mode_picker")},children:(0,h.jsxs)("span",{className:"dark flex items-center gap-x-8",children:["Deep",s.ftsDeepSearch.isGranted?(0,h.jsx)(eL.RoundedGlassBadge,{variant:"primary",children:"5 AI credits"}):(0,h.jsx)(eY.ProBadge,{})]})}),(0,h.jsx)(eG.DropdownMenuItem,{icon:e$.SparkleIcon,auxilliaryIcon:"standard"===m?eK.CheckmarkIcon:void 0,onSelect:()=>p({mode:"standard",searchTerm:e.searchTerm}),children:"Standard"}),(0,h.jsx)("span",{className:"px-12 py-8 text-caption text-glass-text-secondary",children:"Deep Search will be automatically enabled for longer, more complex queries. May result in longer loading times."})]})})]})})}),(0,h.jsx)(eD.CoachMarkContent,{align:"end",alignOffset:-5,side:"bottom",sideOffset:8,children:"Toggle the search mode here"})]}),onSelect:()=>{a.handleFreeTextSearch({query:e.searchTerm,mode:m,source:"search_result",shouldSaveSearch:!0})},"data-sentry-element":"SearchBarSearchResultsGenericItem","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearch.tsx"})})}function e8(e){let t=(0,eE.useTheme)(),r=t.forcedTheme??t.resolvedTheme,a=(0,eH.usePrefersReducedMotion)(),s=(0,_.useTailwindBreakpoint)(),n=(0,g.useRef)(null),i=(0,g.useRef)(e.mode);return i.current=e.mode,(0,g.useEffect)(()=>{if(null===n.current||!n.current.isLoaded)return;let[t,r]="deep"===e.mode?[1,36]:[36,72];n.current.setSegment(t,r),n.current.setFrame(t),n.current.play()},[e.mode]),(0,h.jsx)("div",{className:(0,L.classNames)("flex size-40 items-center justify-center rounded-12","border border-divider","bg-background-modal","min-720:border-none min-720:bg-glass-background-secondary"),"data-sentry-component":"Icon","data-sentry-source-file":"SearchBarSearchResultsFreeTextSearch.tsx",children:a?"deep"===e.mode?(0,h.jsx)(W.SearchIntelligenceIcon,{}):(0,h.jsx)(U.SearchIcon,{}):(0,h.jsx)(eF.DotLottieReact,{className:"size-20",renderConfig:{devicePixelRatio:Math.max(window.devicePixelRatio,4)},src:`/assets/lottie/SearchModeToggle${s<720&&"light"===r?"-light":"-dark"}.lottie`,autoplay:!1,loop:!1,dotLottieRefCallback:e=>{n.current=e,null!==e&&e.addEventListener("load",()=>
2{e.setFrame("deep"===i.current?36:1)})}})})}var e6=e.i(44792);function e3(e){let t=(0,g.useContext)(eS),r=(0,_.useTailwindBreakpoint)(),a=(0,e0.useWindowWidth)(),s=t.activeItemValue.toLowerCase()===e.value.toLowerCase()&&!t.isSearchBarAnimating&&a>=1440&&r>=720,n=function(e,t){switch(e){case"apps":return{imageUrl:"web"===t?"/assets/images/text-query-hover-card/text-in-screenshot-search-apps-web.png":"/assets/images/text-query-hover-card/text-in-screenshot-search-apps-ios.png",definition:"Find screens that contain specific keywords."};case"sites":return{imageUrl:"/assets/images/text-query-hover-card/text-in-screenshot-search-sites.png",definition:"Find sections that contain specific keywords."}}}(e.experience,e.platform);return(0,h.jsxs)(eJ.Root,{open:s,"data-sentry-element":"RadixHoverCard.Root","data-sentry-component":"SearchBarSearchResultsTextInScreenshotQueryHoverCard","data-sentry-source-file":"SearchBarSearchResultsTextInScreenshotQueryHoverCard.tsx",children:[(0,h.jsx)(eJ.Trigger,{asChild:!0,"data-sentry-element":"RadixHoverCard.Trigger","data-sentry-source-file":"SearchBarSearchResultsTextInScreenshotQueryHoverCard.tsx",children:e.children}),(0,h.jsx)(eJ.Portal,{"data-sentry-element":"RadixHoverCard.Portal","data-sentry-source-file":"SearchBarSearchResultsTextInScreenshotQueryHoverCard.tsx",children:(0,h.jsx)(eJ.Content,{side:"right",align:"start",sideOffset:28,collisionBoundary:t.hoverCardBoundaryElement,collisionPadding:8,hideWhenDetached:!0,asChild:!0,"data-sentry-element":"RadixHoverCard.Content","data-sentry-source-file":"SearchBarSearchResultsTextInScreenshotQueryHoverCard.tsx",children:(0,h.jsxs)("aside",{className:(0,L.classNames)("flex flex-col gap-12 rounded-20 p-16","bg-glass-background-primary","glass shadow-glass backdrop-blur-glass","w-(--radix-hover-card-content-available-width) max-w-[400px] min-w-[296px]"),children:[(0,h.jsx)("div",{className:"relative flex aspect-16/10 w-full flex-col overflow-hidden rounded-16 bg-glass-background-secondary",children:(0,h.jsx)(e6.default,{src:n.imageUrl,fill:!0,alt:"Text in Screenshot search example",className:"h-auto w-full object-cover","data-sentry-element":"Image","data-sentry-source-file":"SearchBarSearchResultsTextInScreenshotQueryHoverCard.tsx"})}),(0,h.jsx)("p",{className:"text-compact text-glass-text-secondary",children:n.definition})]})})})]})}function e9(e){return(0,h.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",...e,"data-sentry-element":"svg","data-sentry-component":"AppleIcon","data-sentry-source-file":"AppleIcon.tsx",children:[(0,h.jsx)("path",{d:"M18.2949 13.7392C17.1799 13.3175 16.4341 12.305 16.3499 11.0975C16.2674 9.92082 16.8441 8.87582 17.8924 8.30166L18.7641 7.82416L18.1416 7.04916C17.0958 5.74666 15.5991 4.96832 14.1383 4.96832C13.1258 4.96832 12.4233 5.23332 11.8591 5.44666C11.4608 5.59749 11.1466 5.71582 10.8016 5.71582C10.4083 5.71582 10.0199 5.57749 9.56994 5.41749C8.97994 5.20749 8.31161 4.96916 7.45327 4.96916C5.79494 4.96916 4.12244 5.95916 3.08911 7.55082C1.54661 9.92499 1.96994 13.9958 4.09577 17.2308C4.93827 18.5125 6.11911 19.985 7.79161 20C7.80244 20 7.81327 20 7.82411 20C9.19327 20 9.49327 19.27 10.8224 19.2617C12.2741 19.33 12.4574 20.0058 13.8133 19.9967C15.4474 19.9817 16.6258 18.5208 17.5624 17.0933C18.1158 16.2542 18.3299 15.815 18.7608 14.8617L19.1258 14.0533L18.2949 13.7392Z",fill:"currentColor","data-sentry-element":"path","data-sentry-source-file":"AppleIcon.tsx"}),(0,h.jsx)("path",{d:"M13.0833 2.87499C13.625 2.17999 14.0358 1.19916 13.8866 0.196655C13.0016 0.257489 11.9683 0.819989 11.3641 1.55332C10.8158 2.21916 10.3633 3.20582 10.5391 4.16582C11.5041 4.19582 12.5033 3.61916 13.0833 2.87499Z",fill:"currentColor","data-sentry-element":"path","data-sentry-source-file":"AppleIcon.tsx"})]})}var e5=e.i(324742),te=e.i(483849);e.i(870746);var tt=e.i(933241);e.i(428507);var tr=e.i(877619);function ta(e){let t=(0,_.useTailwindBreakpoint)(),r=e.open&&t>=720,a=(0,g.useMemo)(()=>e.app.previewScreens?.slice(0,"web"===e.app.platform?1:3)??[],[e.app.platform,e.app.previewScreens]);return(0,h.jsxs)(eJ.Root,{open:r,"data-sentry-element":"RadixHoverCard.Root","data-sentry-component":"SearchBarSearchResultsAppHoverCard","data-sentry-source-file":"SearchBarSearchResultsAppHoverCard.tsx",children:[(0,h.jsx)(eJ.Trigger,{asChild:!0,"data-sentry-element":"RadixHoverCard.Trigger","data-sentry-source-file":"SearchBarSearchResultsAppHoverCard.tsx",children:e.children}),(0,h.jsx)(eJ.Portal,{"data-sentry-element":"RadixHoverCard.Portal","data-sentry-source-file":"SearchBarSearchResultsAppHoverCard.tsx",children:(0,h.jsx)(eJ.Content,{side:e.side,align:e.align,sideOffset:e.sideOffset,collisionBoundary:e.collisionBoundary,collisionPadding:8,hideWhenDetached:!0,asChild:!0,"data-sentry-element":"RadixHoverCard.Content","data-sentry-source-file":"SearchBarSearchResultsAppHoverCard.tsx",children:(0,h.jsxs)("aside",{className:(0,L.classNames)("flex flex-col gap-16 rounded-20 p-16","bg-glass-background-primary","glass shadow-glass backdrop-blur-glass","w-(--radix-hover-card-content-available-width) max-w-[400px] min-w-[296px]",!0!==e.animationDisabled&&(0,L.classNames)("data-state-open:animate-in data-state-closed:animate-out","[--tw-in-duration:150ms] [--tw-out-duration:150ms]","[--tw-enter-opacity:0] [--tw-exit-opacity:0]","min-720:[--tw-enter-scale:0.96] min-720:[--tw-exit-scale:0.96]")),children:[(0,h.jsx)("div",{className:"grid grid-flow-col gap-12 rounded-16 bg-glass-background-secondary p-16",children:a.map(t=>(0,h.jsx)(te.Root,{ratio:"web"===e.app.platform?tr.WEB_SCREEN_ASPECT_RATIO:tr.MOBILE_SCREEN_ASPECT_RATIO,asChild:!0,children:(0,h.jsx)("div",{className:(0,L.classNames)("relative overflow-hidden rounded-8 bg-glass-background-tertiary","after:absolute after:inset-0 after:rounded-8 after:shadow-image-inset"),children:(0,h.jsx)("img",{src:(0,tt.getOptimizedImageProps)(t.screenUrl).src,alt:`${e.app.appName} example`,className:"h-full w-full object-cover"})})},t.id))}),(0,h.jsx)("p",{className:"text-compact text-glass-text-secondary",children:e.app.appTagline}),e.arrow]})})})]})}function ts(e){let t=(0,g.useContext)(eS),r=e.app.id,a=t?.activeItemValue.toLowerCase()===r.toLowerCase(),s=(0,e0.useWindowWidth)(),n=a&&!t.isSearchBarAnimating&&s>=1440,i=e.app.is_finance_plus?(0,h.jsx)("div",{className:"shrink-0 pe-4",children:(0,h.jsx)(e_.GlassBadge,{children:"Finance+"})}):e5.APP_STORE_AWARDS_FINALISTS.includes(e.app.id)?(0,h.jsx)("div",{className:"shrink-0 pe-4",children:(0,h.jsx)(e_.GlassBadge,{icon:e9,children:"App Store Awards"})}):null;return(0,h.jsx)(ta,{app:e.app,open:n,side:"right",sideOffset:28,align:"start",collisionBoundary:t.hoverCardBoundaryElement,animationDisabled:!0,"data-sentry-element":"SearchBarSearchResultsAppHoverCard","data-sentry-component":"SearchBarSearchResultsApp","data-sentry-source-file":"SearchBarSearchResultsApp.tsx",children:(0,h.jsx)(e7,{value:r,title:e.app.appName,subtitle:e.app.appTagline,icon:(0,h.jsx)(K.AppLogo,{size:"medium",cdnImgSources:e.app.appLogoCdnImgSources,appName:e.app.appName}),customBadge:i,onSelect:e.onSelect,"data-sentry-element":"SearchBarSearchResultsGenericItem","data-sentry-source-file":"SearchBarSearchResultsApp.tsx"})})}e.i(837089);var tn=e.i(164149),ti=e.i(262199);function tc(e){let t=(0,g.useContext)(eS),r=(0,V.useFilterTagCustomDisplayName)(),a=`${e.valuePrefix??""}${e.filterTag.id}`,s=t?.activeItemValue.toLowerCase()===a.toLowerCase(),n=(0,e0.useWindowWidth)(),i=s&&!t.isSearchBarAnimating&&n>=1440;return(0,h.jsx)(tn.FilterTagHoverCard,{filterTag:e.filterTag,platform:void 0===e.platform?"web":e.platform,open:i,side:"right",sideOffset:28,align:"start",collisionBoundary:t.hoverCardBoundaryElement,animationDisabled:!0,narrowed:!0,"data-sentry-element":"FilterTagHoverCard","data-sentry-component":"SearchBarSearchResultsFilterTag","data-sentry-source-file":"SearchBarSearchResultsFilterTag.tsx",children:(0,h.jsx)(e7,{value:a,title:r(e.filterTag.displayName,e.filterTag.categorySlug,e.filterTag.categoryExperience),subtitle:"appCategories"===e.filterTag.categorySlug&&(0,ti.isFinancePlusDictionarySubCategory)({categorySlug:e.filterTag.categorySlug,subCategoryDisplayName:e.filterTag.subCategory})?"Subcategory":er[e.filterTag.categorySlug],icon:(0,h.jsx)("div",{className:(0,L.classNames)("flex size-40 items-center justify-center rounded-12","border border-divider","bg-background-modal","min-720:border-none min-720:bg-glass-background-secondary"),children:et[e.filterTag.categorySlug]}),onSelect:e.onSelect,"data-sentry-element":"SearchBarSearchResultsGenericItem","data-sentry-source-file":"SearchBarSearchResultsFilterTag.tsx"})})}function to(e){let{handleAppSelected:t,handleSiteSelected:r,handleFilterTagSelected:a}=ek();function s(s){switch(s.item.type){case"app":t({app:s.item,query:e.searchTerm,source:"search_result",shouldSaveSearch:!0});break;case"site":r({site:s.item,query:e.searchTerm,source:"search_result",shouldSaveSearch:!0});break;case"filter-tag":a({filterTag:s.item,query:e.searchTerm,source:s.source??"search_result",shouldSaveSearch:!0})}}switch(e.experience){case"apps":return(0,h.jsx)(h.Fragment,{children:e.items.map(t=>{switch(t.type){case"app":return(0,h.jsx)(ts,{app:t,onSelect:()=>s({item:t})},t.id);case"filter-tag":return(0,h.jsx)(tc,{platform:e.platform,filterTag:t,onSelect:()=>s({item:t})},t.id)}})});case"sites":return(0,h.jsx)(h.Fragment,{children:e.items.map(t=>{switch(t.type){case"site":return(0,h.jsx)(e7,{value:t.id,title:t.name,subtitle:t.tagline,icon:(0,h.jsx)(K.AppLogo,{size:"medium",appName:t.name,cdnImgSources:t.logoCdnImgSources}),onSelect:()=>s({item:t})},t.id);case"filter-tag":return(0,h.jsx)(tc,{filterTag:t,platform:void 0,valuePrefix:e.valuePrefix,onSelect:()=>s({item:t,source:e.source})},t.id)}})})}}e.i(24883);var tl=e.i(256714),td=e.i(612329);function tu(){let e=(0,eA.useEntitlements)(),t=(0,g.useContext)(eS),r=ej(),a=(0,td.useRequestContentModal)(),s=(0,tl.useFeedbackModal)();return(0,h.jsxs)(y.Command.Group,{className:(0,L.classNames)("px-8 pt-12 pb-4 text-caption","text-text-secondary min-720:text-glass-text-secondary"),"data-sentry-element":"Command.Group","data-sentry-component":"SearchResultsFooter","data-sentry-source-file":"SearchResultsFooter.tsx",children:["Looking for something else?"," ",(0,h.jsxs)(tp,{value:"requestContent",onSelect:()=>{r.setIsOpen(!1),a.showModal({location:"search_bar"})},"data-sentry-element":"FooterItem","data-sentry-source-file":"SearchResultsFooter.tsx",children:["Request ","apps"===t.experience?"app":"site"]}),e.giveFeedback.isGranted&&(0,h.jsxs)(h.Fragment,{children:[" or ",(0,h.jsx)(tp,{value:"giveFeedback",onSelect:()=>{r.setIsOpen(!1),s.showModal()},children:"Give feedback"})]})]})}function tp(e){return(0,h.jsx)(y.Command.Item,{...e,className:(0,L.classNames)("inline cursor-pointer underline","hover:text-text-primary min-720:hover:text-glass-text-primary","data-selected:text-text-primary min-720:data-selected:text-glass-text-primary","scroll-mb-24"),"data-sentry-element":"Command.Item","data-sentry-component":"FooterItem","data-sentry-source-file":"SearchResultsFooter.tsx"})}var tm=e.i(536571),th=e.i(800058);let tg=["ios","web"];function tx(){let e=(0,r.useActiveWorkspaceContext)(),t=(0,eA.useEntitlements)(),i=(0,a.useNavigateToConcurrentDeny)(),c=e?.user.contentCurator?.isCuratorView===!0,o="granted"===t.financePlus.state;return(0,eI.useQuery)({queryKey:(0,n.buildKey)(["apps_with_preview_screens"],c,o),queryFn:async()=>{let[e,t]=await Promise.all(tg.map(async e=>{let t=await fetch("/api/search-bar/fetch-searchable-apps",{method:"POST",body:JSON.stringify({platform:e})}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).catch(s.Result.capture("Lm4vWt9c").err("Unexpected fetch error"));if(t.error)switch(t.error.message){case"query error":case"unauthenticated":case"no workspaces":case"Unexpected fetch error":throw Error(t.error.message);case"concurrent deny":throw i(),Error(t.error.message)}return t.value}));return{ios:e??[],web:t??[]}},staleTime:1/0,cacheTime:1/0})}function ty(){let e=(0,a.useNavigateToConcurrentDeny)();return(0,eI.useQuery)({queryKey:(0,n.buildKey)(["sites_with_landing_page"]),queryFn:async()=>{let t=await fetch("/api/search-bar/fetch-searchable-sites",{method:"POST"}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).catch(s.Result.capture("HdrRRtSE").err("Unexpected fetch error"));if(t.error)switch(t.error.message){case"query error":case"unauthenticated":case"no workspaces":case"Unexpected fetch error":throw Error(t.error.message);case"concurrent deny":throw e(),Error(t.error.message)}return t.value},staleTime:1/0,cacheTime:1/0})}function tf(e,t,r){return e.map(e=>{switch(e.type){case"app":{let r=t.get(e.id);return r?{type:e.type,...r}:void 0}case"filter-tag":{let t=r.get(e.id);return t?{type:e.type,...t}:void 0}}}).filter(e=>void 0!==e)}function tS(e,t,r){return e.map(e=>{switch(e.type){case"site":{let r=t.get(e.id);return r?{type:e.type,...r}:void 0}case"filter-tag":{let t=r.get(e.id);return t?{type:e.type,...t}:void 0}}}).filter(e=>void 0!==e)}function tv(e){let t=(0,r.useActiveWorkspaceContext)(),i=(0,eA.useEntitlements)(),c=(0,a.useNavigateToConcurrentDeny)(),o=t?.user.contentCurator?.isCuratorView===!0,l="granted"===i.financePlus.state,[d,u]=(0,g.useState)(e.query),p=(0,tm.useDebouncedCallback)(u,200);(0,g.useEffect)(()=>{p(e.query)},[e.query,p]);let m=(0,eI.useQuery)({queryKey:(0,n.buildKey)(["search_bar_results"],e.experience,e.platform,d,o,l),queryFn:async()=>{let t=await fetch("/api/search-bar/search",{method:"POST",body:JSON.stringify({query:d,experience:e.experience,platform:e.platform})}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).catch(s.Result.capture("qLdwKRAv").err("Typesense search error"));if(t.error)switch(t.error.message){case"query error":case"unauthenticated":case"no workspaces":case"Search bar search error":case"Typesense search error":throw Error(t.error.message);case"concurrent deny":throw c(),Error(t.error.message)}return t.value},keepPreviousData:!0,enabled:d.trim().length>0,staleTime:1/0,cacheTime:1/0}),h=tx(),x=ty(),y=(0,th.useFilterTagCatalogs)(),f=(0,g.useMemo)(()=>{let e=new Map;
2return h.data&&Object.entries(h.data).forEach(t=>{let[,r]=t;r.forEach(t=>e.set(t.id,t))}),e},[h.data]),S=(0,g.useMemo)(()=>{let e=new Map;return x.data&&x.data.forEach(t=>e.set(t.id,t)),e},[x.data]),v=(0,g.useMemo)(()=>{let e=new Map;return y.data&&Object.values(y.data).forEach(t=>{Object.values(t).flat().flatMap(e=>e.tags).forEach(t=>e.set(t.id,t))}),e},[y.data]),b=(0,g.useMemo)(()=>{let e=m.data;if(e)if("apps"===e.experience)return{experience:"apps",primaryItems:tf(e.primary,f,v),otherItems:tf(e.other,f,v),secondaryPlatformItems:tf(e.secondaryPlatform,f,v),sitesItems:tS(e.sites,S,v)};else return{experience:"sites",primaryItems:tS(e.primary,S,v),otherItems:tS(e.other,S,v),webItems:tf(e.web,f,v),iosItems:tf(e.ios,f,v)}},[m.data,f,S,v]);return{isLoading:m.isLoading||m.isSuccess&&!b,isSuccess:m.isSuccess&&!!b,isError:m.isError,error:m.error,data:b}}function tb(e){let{handleTextInScreenshotSearch:t,handleExperimentalFreeTextSearch:r}=ek(),a=(0,g.useContext)(eS).platform??ef.DEFAULT_PLATFORM,s=!!(0,eP.useGrowthBook)().getAttributes().isInternal,n=tv({query:e.searchTerm,experience:"apps",platform:a}),i=ea[a];if((0,g.useEffect)(()=>{void 0!==n.data&&e.setActiveItemValue(n.data.primaryItems[0]?.id??"Free Text Search")},[n.data]),n.isLoading&&void 0===n.data)return(0,h.jsx)(y.Command.Loading,{children:(0,h.jsx)(eR.SpinnerLoader,{useCurrentColor:!0})});if(n.isError)return null;let c=(0,h.jsx)("div",{className:(0,L.classNames)("flex size-40 items-center justify-center rounded-12","border border-divider","bg-background-modal","min-720:border-none min-720:bg-glass-background-secondary"),children:(0,h.jsx)(U.SearchIcon,{})}),l=s&&(0,h.jsx)(e7,{value:"Free Text Apps",title:e.searchTerm,subtitle:"Apps",titleBadge:(0,h.jsx)(e_.GlassBadge,{children:"EXPERIMENTAL"}),icon:c,onSelect:()=>r({query:e.searchTerm,contentType:"apps"})});return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(y.Command.Group,{"data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarAppsSearchResults.tsx",children:[(0,h.jsx)(to,{experience:"apps",platform:a,searchTerm:e.searchTerm,items:n.data?.primaryItems??[],"data-sentry-element":"SearchResultList","data-sentry-source-file":"SearchBarAppsSearchResults.tsx"}),(0,h.jsx)(e4,{searchTerm:e.searchTerm,"data-sentry-element":"SearchBarSearchResultsFreeTextSearch","data-sentry-source-file":"SearchBarAppsSearchResults.tsx"}),l]}),(0,h.jsxs)(y.Command.Group,{heading:"Other",className:"**:[[cmdk-group-heading]]:px-8 **:[[cmdk-group-heading]]:pb-4","data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarAppsSearchResults.tsx",children:[(0,h.jsx)(to,{experience:"apps",platform:a,searchTerm:e.searchTerm,items:n.data?.otherItems??[],"data-sentry-element":"SearchResultList","data-sentry-source-file":"SearchBarAppsSearchResults.tsx"}),(0,h.jsx)(e3,{experience:"apps",platform:a,value:"Text in Screenshot","data-sentry-element":"SearchBarSearchResultsTextInScreenshotQueryHoverCard","data-sentry-source-file":"SearchBarAppsSearchResults.tsx",children:(0,h.jsx)(e7,{value:"Text in Screenshot",title:`“${e.searchTerm}”`,subtitle:"Text in Screenshot",icon:(0,h.jsx)("div",{className:(0,L.classNames)("flex size-40 items-center justify-center rounded-12","border border-divider","bg-background-modal","min-720:border-none min-720:bg-glass-background-secondary"),children:(0,h.jsx)(H.TextInScreenshotIcon,{})}),onSelect:()=>t({query:e.searchTerm,source:"search_result",shouldSaveSearch:!0}),"data-sentry-element":"SearchBarSearchResultsGenericItem","data-sentry-source-file":"SearchBarAppsSearchResults.tsx"})})]}),void 0!==n.data&&n.data.secondaryPlatformItems.length>0&&(0,h.jsx)(y.Command.Group,{heading:(0,o.getDisplayStringForPlatform)(i),className:"**:[[cmdk-group-heading]]:px-8 **:[[cmdk-group-heading]]:pb-4",children:(0,h.jsx)(to,{experience:"apps",platform:i,searchTerm:e.searchTerm,items:n.data.secondaryPlatformItems})}),void 0!==n.data&&n.data.sitesItems.length>0&&(0,h.jsx)(y.Command.Group,{heading:"Sites",className:"**:[[cmdk-group-heading]]:px-8 **:[[cmdk-group-heading]]:pb-4",children:(0,h.jsx)(to,{experience:"sites",searchTerm:e.searchTerm,items:n.data.sitesItems})}),(0,h.jsx)(tu,{"data-sentry-element":"SearchResultsFooter","data-sentry-source-file":"SearchBarAppsSearchResults.tsx"})]})}e.i(621739);var tC=e.i(936314);function tT(e){let t,{handleTextInScreenshotSearch:r,handleExperimentalFreeTextSearch:a,handleFreeTextSearch:s}=ek(),n=!!(0,eP.useGrowthBook)().getAttributes().isInternal,i=tv({query:e.searchTerm,experience:"sites"}),c=(0,th.useFilterTagCatalogs)(),l=(t=c.data?.sites)?(t.categories??[]).flatMap(e=>e.tags).map(e=>({type:"filter-tag",...e})):[],d=(0,tC.useSearchSortedResults)(e.searchTerm,l,[()=>"Landing Page"],.55);if((0,g.useEffect)(()=>{void 0===i.data||e.setActiveItemValue(i.data.primaryItems[0]?.id??"Free Text")},[i.data]),i.isLoading&&void 0===i.data)return(0,h.jsx)(y.Command.Loading,{children:(0,h.jsx)(eR.SpinnerLoader,{useCurrentColor:!0})});if(i.isError)return null;let u=(0,h.jsx)("div",{className:(0,L.classNames)("flex size-40 items-center justify-center rounded-12","border border-divider","bg-background-modal","min-720:border-none min-720:bg-glass-background-secondary"),children:(0,h.jsx)(U.SearchIcon,{})}),p=(0,h.jsx)(e7,{value:"Free Text",title:"Search",icon:u,onSelect:()=>s({query:e.searchTerm,mode:"standard",shouldSaveSearch:!0,source:"search_result"})}),m=(0,h.jsx)(e3,{experience:"sites",value:"Text in Screenshot",children:(0,h.jsx)(e7,{value:"Text in Screenshot",title:`“${e.searchTerm}”`,subtitle:"Text in Screenshot",icon:(0,h.jsx)("div",{className:(0,L.classNames)("flex size-40 items-center justify-center rounded-12","border border-divider","bg-background-modal","min-720:border-none min-720:bg-glass-background-secondary"),children:(0,h.jsx)(H.TextInScreenshotIcon,{})}),onSelect:()=>r({query:e.searchTerm,source:"search_result",shouldSaveSearch:!0})})}),x=n&&(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(e7,{value:"Free Text Sites",title:e.searchTerm,subtitle:"Sites",titleBadge:(0,h.jsx)(e_.GlassBadge,{children:"EXPERIMENTAL"}),icon:u,onSelect:()=>a({query:e.searchTerm,contentType:"sites"})})});return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(y.Command.Group,{"data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarSitesSearchResults.tsx",children:[(0,h.jsx)(to,{experience:"sites",searchTerm:e.searchTerm,items:i.data?.primaryItems??[],"data-sentry-element":"SearchResultList","data-sentry-source-file":"SearchBarSitesSearchResults.tsx"}),p]}),(0,h.jsxs)(y.Command.Group,{heading:"Other",className:"**:[[cmdk-group-heading]]:px-8 **:[[cmdk-group-heading]]:pb-4","data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarSitesSearchResults.tsx",children:[(0,h.jsx)(to,{experience:"sites",searchTerm:e.searchTerm,items:i.data?.otherItems??[],"data-sentry-element":"SearchResultList","data-sentry-source-file":"SearchBarSitesSearchResults.tsx"}),m,x]}),void 0!==i.data&&i.data.webItems.length>0&&(0,h.jsx)(y.Command.Group,{heading:(0,o.getDisplayStringForPlatform)("web"),className:"**:[[cmdk-group-heading]]:px-8 **:[[cmdk-group-heading]]:pb-4",children:(0,h.jsx)(to,{experience:"apps",platform:"web",searchTerm:e.searchTerm,items:i.data.webItems})}),void 0!==i.data&&i.data.iosItems.length>0&&(0,h.jsx)(y.Command.Group,{heading:(0,o.getDisplayStringForPlatform)("ios"),className:"**:[[cmdk-group-heading]]:px-8 **:[[cmdk-group-heading]]:pb-4",children:(0,h.jsx)(to,{experience:"apps",platform:"ios",searchTerm:e.searchTerm,items:i.data.iosItems})}),d.length>0&&(0,h.jsx)(y.Command.Group,{heading:"Browse landing pages by site category",className:"**:[[cmdk-group-heading]]:px-8 **:[[cmdk-group-heading]]:pb-4",children:(0,h.jsx)(to,{experience:"sites",searchTerm:e.searchTerm,items:d.map(e=>{let{option:t}=e;return t}),source:"landing_page_to_site_category_section",valuePrefix:"landing_page_to_site_category_section:"})}),(0,h.jsx)(tu,{"data-sentry-element":"SearchResultsFooter","data-sentry-source-file":"SearchBarSitesSearchResults.tsx"})]})}e.i(825533);var tw=e.i(987896),tj=e.i(254207),tk=e.i(56410);function tN(e){let{onClose:t}=e,r=(0,eA.useEntitlements)(),a=(0,g.useMemo)(()=>[...tk.FINANCE_PLUS_SHOWCASE_APPS].sort(()=>Math.random()-.5).slice(0,3),[]);if("granted"!==r.financePlus.state)return null;let[s,n,i]=a;return s&&n&&i?(0,h.jsxs)("aside",{className:"dark flex flex-col items-center rounded-16 border border-glass-divider px-16 pt-20 pb-16 text-glass-text-primary","data-sentry-component":"SearchBarFinancePlusAvailableCard","data-sentry-source-file":"SearchBarFinancePlusAvailableCard.tsx",children:[(0,h.jsxs)("div",{className:"flex items-center gap-8",children:[(0,h.jsx)("div",{className:"relative size-16 overflow-hidden rounded-[30%] after:absolute after:inset-0 after:rounded-[30%] after:shadow-logo-inset",children:(0,h.jsx)(e6.default,{src:s.logo,alt:s.name,width:16,height:16,className:"size-full object-cover","data-sentry-element":"Image","data-sentry-source-file":"SearchBarFinancePlusAvailableCard.tsx"})}),(0,h.jsx)("div",{className:"relative size-24 overflow-hidden rounded-[30%] after:absolute after:inset-0 after:rounded-[30%] after:shadow-logo-inset",children:(0,h.jsx)(e6.default,{src:n.logo,alt:n.name,width:24,height:24,className:"size-full object-cover","data-sentry-element":"Image","data-sentry-source-file":"SearchBarFinancePlusAvailableCard.tsx"})}),(0,h.jsx)("div",{className:"relative size-16 overflow-hidden rounded-[30%] after:absolute after:inset-0 after:rounded-[30%] after:shadow-logo-inset",children:(0,h.jsx)(e6.default,{src:i.logo,alt:i.name,width:16,height:16,className:"size-full object-cover","data-sentry-element":"Image","data-sentry-source-file":"SearchBarFinancePlusAvailableCard.tsx"})})]}),(0,h.jsx)("h1",{className:"pt-20 text-center text-body-bold",children:"Finance+ now available in your library"}),(0,h.jsx)("div",{className:"grid w-full pt-16",children:(0,h.jsx)(tw.NextLinkButton,{variant:"glass_secondary",href:(0,eh.get
2SearchPagePathnameWithQueryString)({searchQuery:{type:"filters",contentType:"apps",platform:tj.DEFAULT_FINANCE_PLUS_PLATFORM,activeFilterTags:[{categorySlug:"appCategories",displayName:"Finance"}],categories:null,sortBy:(0,eg.getSearchPageSortByOption)({sortParam:null,contentType:"apps",isSubscribed:!0})}}),onClick:t,"data-sentry-element":"NextLinkButton","data-sentry-source-file":"SearchBarFinancePlusAvailableCard.tsx",children:"Start browsing"})})]}):null}var tI=e.i(73950),tB=e.i(908363);function tP(e){let t=(0,r.useActiveWorkspaceContext)(),a=(0,tB.useLocalizedPrice)(),s=(0,eZ.usePricingTouchpoint)();return t&&"none"===t.membershipPlan&&"canceled"===t.subscriptionState.status&&"personal"===t.lastSubscribedMembershipPlan?(0,h.jsxs)("aside",{className:"dark grid place-items-center rounded-16 border border-glass-divider px-16 text-glass-text-primary","data-sentry-component":"SearchBarReactivateCard","data-sentry-source-file":"SearchBarReactivateCard.tsx",children:[(0,h.jsx)("div",{className:"pt-24",children:(0,h.jsx)(eY.ProBadge,{"data-sentry-element":"ProBadge","data-sentry-source-file":"SearchBarReactivateCard.tsx"})}),(0,h.jsx)("h1",{className:"pt-16 text-body-bold",children:"Unlock all content"}),(0,h.jsxs)("div",{className:"grid place-items-center text-compact",children:[(0,h.jsxs)("p",{children:["Starting from"," ",(0,tI.formatAsCurrency)(a.personal.yearly.amount/12,a.currency),"/mo."]}),(0,h.jsx)("p",{children:"Cancel anytime."})]}),(0,h.jsx)("div",{className:"grid w-full pt-24 pb-16",children:(0,h.jsx)(tw.Button,{variant:"glass_secondary",onClick:()=>{s.trigger("searchbar_reactivation_card"),e.onPricingModalOpen()},"data-sentry-element":"Button","data-sentry-source-file":"SearchBarReactivateCard.tsx",children:"Reactivate Pro"})})]}):null}function t_(e){let{icon:t,...r}=e;return(0,h.jsxs)("button",{className:(0,L.classNames)("flex items-center gap-x-8 rounded-12 px-12 py-8","text-glass-text-primary",!0===r.selected&&"bg-glass-background-primary-hover","hover:bg-glass-background-primary-hover","cursor-pointer"),onClick:r.onClick,tabIndex:-1,"data-sentry-component":"SearchBarSideBarTabItem","data-sentry-source-file":"SearchBarSideBarTabItem.tsx",children:[(0,h.jsx)(t,{className:"size-20 text-glass-text-secondary","data-sentry-element":"Icon","data-sentry-source-file":"SearchBarSideBarTabItem.tsx"}),(0,h.jsx)("span",{className:"text-body-bold",children:r.title})]})}let tR={Trending:function(e){return(0,h.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,"data-sentry-element":"svg","data-sentry-component":"TrendingIcon","data-sentry-source-file":"TrendingIcon.tsx",children:[(0,h.jsx)("path",{d:"M18.001 5L10.4852 12.7259L7.35364 9.50677L1.7168 15.3012",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke","data-sentry-element":"path","data-sentry-source-file":"TrendingIcon.tsx"}),(0,h.jsx)("path",{d:"M18.0008 12V5L11 5",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke","data-sentry-element":"path","data-sentry-source-file":"TrendingIcon.tsx"})]})},Categories:$.CategoriesIcon,Screens:Y.ScreensIcon,"UI Elements":ee.UIElementIcon,Flows:X.FlowIcon,Sections:Z,Styles:J};function tE(e){let{onActiveTabChange:t,onClose:r,...a}=e,s=(0,_.useTailwindBreakpoint)();return(0,g.useEffect)(()=>{s<720&&t("Trending")},[t,s]),(0,h.jsx)("aside",{className:"hidden w-[240px] shrink-0 flex-col justify-between pt-8 pb-20 min-720:flex","data-sentry-component":"SearchBarSideBar","data-sentry-source-file":"SearchBarSideBar.tsx",children:(0,h.jsxs)("div",{className:"flex flex-col items-stretch gap-y-px",children:[a.tabs.map(e=>(0,h.jsx)(t_,{icon:tR[e],title:e,selected:a.activeTab===e,onClick:()=>t(e)},e)),(0,h.jsxs)("div",{className:"pt-16",children:[(0,h.jsx)(tP,{onPricingModalOpen:r,"data-sentry-element":"SearchBarReactivateCard","data-sentry-source-file":"SearchBarSideBar.tsx"}),(0,h.jsx)(tN,{onClose:r,"data-sentry-element":"SearchBarFinancePlusAvailableCard","data-sentry-source-file":"SearchBarSideBar.tsx"})]})]})})}let tF={mobile:["Trending","Categories","Screens","UI Elements","Flows"],web:["Trending","Categories","Screens","UI Elements","Flows"],sites:["Trending","Categories","Sections","Styles"]};var tA=e.i(878379);function tL(e){return(0,h.jsx)(y.Command.Item,{value:`trending:${encodeURI(e.label)}`,className:(0,L.classNames)("cursor-pointer rounded-full px-16 py-8","text-compact-bold text-text-primary min-720:text-body-bold min-720:text-glass-text-primary","bg-background-secondary min-720:bg-glass-background-secondary","hover:bg-background-secondary-hover data-selected:bg-background-secondary-hover","min-720:hover:bg-glass-background-secondary-hover min-720:data-selected:bg-glass-background-secondary-hover","transition-colors ease-out","z-10"),onSelect:e.onSelect,"data-sentry-element":"Command.Item","data-sentry-component":"SearchBarTrendingChip","data-sentry-source-file":"SearchBarTrendingChip.tsx",children:e.label})}function tM(e){let{variant:t="default",...r}=e,a=(0,g.useContext)(eS),s=a.experience,n="apps"===s?(0,ep.getPlatformType)(a.platform):null;return"string"==typeof r.imageUrl?(0,h.jsx)("img",{...(0,tt.getOptimizedImageProps)(r.imageUrl),alt:r.displayName,fetchPriority:r.fetchPriority,className:"absolute inset-0 h-full w-full object-contain object-right dark:invert light:invert-0 light:min-72
20:invert"}):(0,h.jsxs)(h.Fragment,{children:["apps"===s&&"mobile"===n&&"string"==typeof r.exampleScreens[1]&&(0,h.jsx)("img",{...(0,tt.getOptimizedImageProps)(r.exampleScreens[1]),alt:r.displayName,fetchPriority:r.fetchPriority,className:(0,L.classNames)("absolute rounded-4","wide"===t?"right-[17%] bottom-[-22%] w-[16%]":"right-[35%] bottom-[-22%] w-1/3","group-hover:-translate-y-4 group-data-selected:-translate-y-4","group-hover:shadow-[0px_4px_12px_rgba(0,0,0,.08)] group-data-selected:shadow-[0px_4px_12px_rgba(0,0,0,.08)]","transition-[translate,box-shadow] ease-out")}),"string"==typeof r.exampleScreens[0]&&(0,h.jsx)("img",{...(0,tt.getOptimizedImageProps)(r.exampleScreens[0]),alt:r.displayName,fetchPriority:r.fetchPriority,className:(0,L.classNames)("absolute max-w-none rounded-4","apps"===s&&"mobile"===n?"wide"===t?"right-[5%] bottom-[-13%] w-[16%]":"right-[10%] bottom-[-13%] w-1/3":"wide"===t?"top-[40%] right-[-12%] w-[55%]":"top-[40%] -right-1/4 w-[115%]","group-hover:-translate-y-4 group-data-selected:-translate-y-4","group-hover:shadow-[0px_4px_12px_rgba(0,0,0,.08)] group-data-selected:shadow-[0px_4px_12px_rgba(0,0,0,.08)]","transition-[translate,box-shadow] ease-out")})]})}function tq(e){let t=(0,V.useFilterTagCustomDisplayName)();return(0,h.jsxs)(y.Command.Item,{value:`trending:${encodeURI(e.filterTag.displayName)}`,className:(0,L.classNames)("group relative cursor-pointer overflow-clip rounded-16 p-12","text-compact-bold text-text-primary min-720:text-body-bold min-720:text-glass-text-primary","bg-background-secondary min-720:bg-glass-background-secondary","wide"===e.variant?"col-span-2":"aspect-square","hover:bg-background-secondary-hover data-selected:bg-background-secondary-hover","min-720:hover:bg-glass-background-secondary-hover min-720:data-selected:bg-glass-background-secondary-hover","transition-colors ease-out","z-10"),onSelect:()=>e.onSelect(e.filterTag),"data-sentry-element":"Command.Item","data-sentry-component":"SearchBarTrendingFilterTagCard","data-sentry-source-file":"SearchBarTrendingFilterTagCard.tsx",children:[t(e.filterTag.displayName,e.filterTag.categorySlug,e.filterTag.categoryExperience),(0,h.jsx)(tM,{variant:e.variant,imageUrl:e.imageUrl,displayName:e.filterTag.displayName,exampleScreens:e.filterTag.exampleScreens,"data-sentry-element":"SearchBarTrendingFilterTagCardImages","data-sentry-source-file":"SearchBarTrendingFilterTagCard.tsx"})]})}function tD(e){let t=(0,V.useFilterTagCustomDisplayName)();return(0,h.jsx)(tL,{label:t(e.filterTag.displayName,e.filterTag.categorySlug,e.filterTag.categoryExperience),onSelect:()=>e.onSelect(e.filterTag),"data-sentry-element":"SearchBarTrendingChip","data-sentry-component":"SearchBarTrendingFilterTagChip","data-sentry-source-file":"SearchBarTrendingFilterTagChip.tsx"})}function tQ(e){let t=(0,_.useTailwindBreakpoint)();return(0,h.jsx)(y.Command.Group,{heading:t>=720?void 0:e.heading,className:(0,L.classNames)("flex w-full flex-col gap-y-12","**:[[cmdk-group-heading]]:text-compact","**:[[cmdk-group-items]]:-mx-20 **:[[cmdk-group-items]]:flex **:[[cmdk-group-items]]:gap-x-8 **:[[cmdk-group-items]]:px-20","**:[[cmdk-group-items]]:scrollbar-none **:[[cmdk-group-items]]:overflow-x-auto"),"data-sentry-element":"Command.Group","data-sentry-component":"SearchBarTrendingProducts","data-sentry-source-file":"SearchBarTrendingProducts.tsx",children:e.items.map(e=>(0,h.jsx)(y.Command.Item,{value:e.name,className:"group relative z-10 w-64 shrink-0 cursor-pointer overflow-hidden rounded-t-16 min-720:h-64",onSelect:e.onSelect,children:(0,h.jsxs)("div",{className:(0,L.classNames)("flex flex-col items-center gap-y-4 min-720:absolute min-720:inset-0","min-720:group-hover:-translate-y-20 min-720:group-data-selected:-translate-y-20","transition-transform duration-300 ease-out"),children:[e.logo,(0,h.jsx)("span",{className:(0,L.classNames)("w-full shrink-0 truncate text-center text-caption min-720:text-caption-bold","text-text-secondary min-720:text-glass-text-primary"),children:e.name})]})},e.id))})}var tz=e.i(949133);function tO(){let e=(0,a.useNavigateToConcurrentDeny)();return(0,eI.useQuery)({queryKey:(0,n.buildKey)(["search_bar_trending_content"]),queryFn:async()=>{let t=await fetch("/api/search-bar/fetch-trending-content",{method:"POST"}).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).catch(s.Result.capture("n8Qv4LmX").err("Unexpected fetch error"));if(t.error)switch(t.error.message){case"unauthenticated":case"no workspaces":case"query error":case"Unexpected fetch error":throw Error(t.error.message);case"concurrent deny":throw e(),Error("Concurrent deny")}return{ios:{...t.value.ios,apps:(0,tz.default)(t.value.ios.apps,7)},web:{...t.value.web,apps:(0,tz.default)(t.value.web.apps,7)},sites:{...t.value.sites,sites:(0,tz.default)(t.value.sites.sites,7)}}},staleTime:1/0,cacheTime:1/0})}function tG(){let e=(0,_.useTailwindBreakpoint)(),{handleAppSelected:t,handleFilterTagSelected:r,handleTextInScreenshotSearch:a}=ek(),s=(0,g.useContext)(eS).platform??ef.DEFAULT_PLATFORM,n=tO();if(n.isLoading)return(0,h.jsx)(y.Command.Loading,{children:(0,h.jsx)(eR.SpinnerLoader,{useCurrentColor:!0})});if(!n.isSuccess)return null;let i=(0,tA.default)(n.data[s].filterTags,e=>e.filterTag.categorySlug);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(y.Command.Item,{value:"Hidden item",className:"absolute inset-0 z-0","data-sentry-element":"Command.Item","data-sentry-source-file":"SearchBarAppsTrendingContent.tsx"}),(0,h.jsx)(tQ,{heading:"Trending Apps",items:n.data[s].apps.map(e=>({id:e.id,name:e.appName,logo:(0,h.jsx)(K.AppLogo,{size:"large",appName:e.appName,cdnImgSources:e.appLogoCdnImgSources}),onSelect:()=>{t({app:e,source:"trending_item"})}})),"data-sentry-element":"SearchBarTrendingProducts","data-sentry-source-file":"SearchBarAppsTrendingContent.tsx"}),(0,h.jsx)(y.Command.Group,{heading:"Screens",className:(0,L.classNames)("flex flex-col gap-y-12","**:[[cmdk-group-heading]]:text-compact","**:[[cmdk-group-items]]:grid **:[[cmdk-group-items]]:grid-cols-3 **:[[cmdk-group-items]]:gap-8","min-720:**:[[cmdk-group-items]]:grid-cols-4"),"data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarAppsTrendingContent.tsx",children:i.screenPatterns?.map((t,a)=>e>=720||e<720&&a<6?(0,h.jsx)(tq,{filterTag:t.filterTag,variant:"wide"===t.cardType&&e>=720?"wide":"default",imageUrl:t.imageUrl,onSelect:e=>r({filterTag:e,source:"trending_item"})},t.filterTag.displayName):null)}),(0,h.jsx)(y.Command.Group,{heading:"UI Elements",className:"flex flex-col gap-y-12 **:[[cmdk-group-heading]]:text-compact **:[[cmdk-group-items]]:flex **:[[cmdk-group-items]]:flex-wrap **:[[cmdk-group-items]]:gap-8","data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarAppsTrendingContent.tsx",children:i.screenElements?.map(e=>(0,h.jsx)(tD,{filterTag:e.filterTag,onSelect:e=>r({filterTag:e,source:"trending_item"})},e.filterTag.displayName))}),(0,h.jsx)(y.Command.Group,{heading:"Flows",className:(0,L.classNames)("flex flex-col gap-y-12","**:[[cmdk-group-heading]]:text-compact","**:[[cmdk-group-items]]:grid **:[[cmdk-group-items]]:grid-cols-3 **:[[cmdk-group-items]]:gap-8","min-720:**:[[cmdk-group-items]]:grid-cols-4"),"data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarAppsTrendingContent.tsx",children:i.flowActions?.map((t,a)=>e>=720||e<720&&a<3?(0,h.jsx)(tq,{filterTag:t.filterTag,variant:"wide"===t.cardType&&e>=720?"wide":"default",imageUrl:t.imageUrl,onSelect:e=>r({filterTag:e,source:"trending_item"})},t.filterTag.displayName):null)}),(0,h.jsx)(y.Command.Group,{heading:"Text in Screenshot",className:"flex flex-col gap-y-12 **:[[cmdk-group-heading]]:text-compact **:[[cmdk-group-items]]:flex **:[[cmdk-group-items]]:flex-wrap **:[[cmdk-group-items]]:gap-8","data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarAppsTrendingContent.tsx",children:n.data[s].textInScreenshotKeywords.map(e=>(0,h.jsx)(tL,{label:`“${e}”`,onSelect:()=>a({query:e,source:"trending_item"})},e))})]})}function tU(){let e=(0,_.useTailwindBreakpoint)(),{handleSiteSelected:t,handleFilterTagSelected:r}=ek(),a=tO();if(a.isLoading)return(0,h.jsx)(y.Command.Loading,{children:(0,h.jsx)(eR.SpinnerLoader,{useCurrentColor:!0})});if(!a.isSuccess)return null;let s=(0,tA.default)(a.data.sites.filterTags,e=>e.filterTag.categorySlug);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(y.Command.Item,{value:"Hidden item",className:"absolute inset-0 z-0","data-sentry-element":"Command.Item","data-sentry-source-file":"SearchBarSitesTrendingContent.tsx"}),(0,h.jsx)(tQ,{heading:"Trending Sites",items:a.data.sites.sites.map(e=>({id:e.id,name:e.name,logo:(0,h.jsx)(K.AppLogo,{size:"large",appName:e.n
2ame,cdnImgSources:e.logoCdnImgSources}),onSelect:()=>{t({site:e,source:"trending_item"})}})),"data-sentry-element":"SearchBarTrendingProducts","data-sentry-source-file":"SearchBarSitesTrendingContent.tsx"}),(0,h.jsx)(y.Command.Group,{heading:"Categories",className:(0,L.classNames)("flex flex-col gap-y-12","**:[[cmdk-group-heading]]:text-compact","**:[[cmdk-group-items]]:grid **:[[cmdk-group-items]]:grid-cols-3 **:[[cmdk-group-items]]:gap-8","min-720:**:[[cmdk-group-items]]:grid-cols-4"),"data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarSitesTrendingContent.tsx",children:s.categories?.map((t,a)=>e>=720||e<720&&a<3?(0,h.jsx)(tq,{filterTag:t.filterTag,variant:"wide"===t.cardType&&e>=720?"wide":"default",imageUrl:t.imageUrl,onSelect:e=>r({filterTag:e,source:"trending_item"})},t.filterTag.displayName):null)}),(0,h.jsx)(y.Command.Group,{heading:"Sections",className:"flex flex-col gap-y-12 **:[[cmdk-group-heading]]:text-compact **:[[cmdk-group-items]]:flex **:[[cmdk-group-items]]:flex-wrap **:[[cmdk-group-items]]:gap-8","data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarSitesTrendingContent.tsx",children:s.pageAndSectionPatterns?.map(e=>(0,h.jsx)(tD,{filterTag:e.filterTag,onSelect:e=>r({filterTag:e,source:"trending_item"})},e.filterTag.displayName))}),(0,h.jsx)(y.Command.Group,{heading:"Styles",className:"flex flex-col gap-y-12 **:[[cmdk-group-heading]]:text-compact **:[[cmdk-group-items]]:flex **:[[cmdk-group-items]]:flex-wrap **:[[cmdk-group-items]]:gap-8","data-sentry-element":"Command.Group","data-sentry-source-file":"SearchBarSitesTrendingContent.tsx",children:s.styles?.map(e=>(0,h.jsx)(tD,{filterTag:e.filterTag,onSelect:e=>r({filterTag:e,source:"trending_item"})},e.filterTag.displayName))})]})}var tW=e.i(213677);let tH=new Intl.NumberFormat("en");function tK(e){let{filterTag:t,onSelect:r}=e,a=(0,g.useContext)(eS),s=(0,V.useFilterTagCustomDisplayName)(),n=a?.activeItemValue.toLowerCase()===t.displayName.toLowerCase(),i="apps"===a.experience?a.platform:ef.DEFAULT_PLATFORM,c=function(e,t){let r=el(e);if(!r)return;let a="ui-elements"===r?"screens":r;return(0,tW.isSitesContentType)(a)?(e.contentCounts??{})[a]:(e.contentCounts??{})[a]?.[t]}(t,i),o=s(t.displayName,t.categorySlug,t.categoryExperience),l=(0,e0.useWindowWidth)(),d=n&&!a.isSearchBarAnimating&&l>=1440;return(0,h.jsx)(tn.FilterTagHoverCard,{filterTag:t,platform:i,open:d,side:"right",sideOffset:28,align:"start",collisionBoundary:a.hoverCardBoundaryElement,animationDisabled:!0,narrowed:!0,"data-sentry-element":"FilterTagHoverCard","data-sentry-component":"SearchBarCategoryItem","data-sentry-source-file":"SearchBarCategoryItem.tsx",children:(0,h.jsxs)(y.Command.Item,{value:t.displayName,className:(0,L.classNames)("flex flex-row items-center","cursor-pointer rounded-12 px-12 py-8","data-selected:bg-background-primary-hover","min-720:data-selected:bg-glass-background-primary-hover"),onSelect:r,"data-sentry-element":"Command.Item","data-sentry-source-file":"SearchBarCategoryItem.tsx",children:[(0,h.jsxs)("div",{className:"flex grow items-center gap-x-8 truncate",children:[(0,h.jsx)("span",{className:"truncate text-body-bold text-text-primary min-720:text-glass-text-primary",children:o}),"Finance+"===o&&(0,h.jsx)("div",{className:"shrink-0",children:(0,h.jsx)(e_.GlassBadge,{children:"New"})})]}),"number"==typeof c&&(0,h.jsx)("span",{className:"text-compact text-text-secondary min-720:text-glass-text-secondary",children:tH.format(c)})]})})}let tV={apps:{Categories:"appCategories",Screens:"screenPatterns","UI Elements":"screenElements",Flows:"flowActions"},sites:{Categories:"categories",Styles:"styles",Sections:"pageAndSectionPatterns"}};function t$(e){let t=(0,g.useContext)(eS),{handleFilterTagSelected:r}=ek(),a=(0,th.useFilterTagCatalogs)(),s=tV[t.experience][e.activeTab];if(void 0===s)return null;if(a.isLoading)return(0,h.jsx)(y.Command.Loading,{children:(0,h.jsx)(eR.SpinnerLoader,{useCurrentColor:!0})});if(!a.isSuccess)return null;let n=a.data["sites"===t.experience?"sites":z(t.platform)];return(0,h.jsx)(h.Fragment,{children:n[s]?.map(e=>(0,h.jsx)(y.Command.Group,{heading:"Page and Section Patterns"===e.displayName?"Sections":e.displayName,className:(0,L.classNames)("flex flex-col gap-y-8","**:[[cmdk-group-heading]]:px-12"),children:e.tags.map(e=>(0,h.jsx)(tK,{filterTag:e,onSelect:()=>r({filterTag:e,source:"category_item"})},e.displayName))},e.displayName))})}var tX=e.i(663301);e.i(318829);var tY=e.i(845375),tZ=e.i(315450);function tJ(){return!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3,[t,r]=(0,g.useState)(!1);return(0,g.useEffect)(()=>
2{if("function"==typeof window.requestIdleCallback){let t=window.requestIdleCallback(()=>r(!0),{timeout:e});return()=>{window.cancelIdleCallback(t)}}let t=window.setTimeout(()=>r(!0),e);return()=>{window.clearTimeout(t)}},[e]),t}()?null:(0,h.jsx)(t0,{"data-sentry-element":"SearchBarPrefetchContent","data-sentry-component":"SearchBarPrefetch","data-sentry-source-file":"SearchBarPrefetch.tsx"})}function t0(){let e=(0,g.useContext)(eS),t=tO();return tx(),ty(),(0,th.useFilterTagCatalogs)(),(0,tZ.usePopularAppsWithPreviewScreens)({platform:"apps"===e.experience?e.platform:ef.DEFAULT_PLATFORM,limitPerCategory:tY.TOP_APPS_PER_CATEGORY_LIMIT}),(0,h.jsxs)("div",{className:"pointer-events-none fixed top-0 left-0 opacity-0","aria-hidden":!0,"data-sentry-component":"SearchBarPrefetchContent","data-sentry-source-file":"SearchBarPrefetch.tsx",children:[t.data?.ios.apps.map(e=>void 0===e.appLogoCdnImgSources?null:(0,h.jsx)(tX.CdnImg,{cdnImgSources:e.appLogoCdnImgSources,loading:"eager",fetchPriority:"low",width:64,height:64,sizes:"64px",crossOrigin:"anonymous",alt:""},e.id)),t.data?.web.apps.map(e=>void 0===e.appLogoCdnImgSources?null:(0,h.jsx)(tX.CdnImg,{cdnImgSources:e.appLogoCdnImgSources,loading:"eager",fetchPriority:"low",width:64,height:64,sizes:"64px",crossOrigin:"anonymous",alt:""},e.id)),t.data?.sites.sites.map(e=>void 0===e.logoCdnImgSources?null:(0,h.jsx)(tX.CdnImg,{cdnImgSources:e.logoCdnImgSources,loading:"eager",fetchPriority:"low",width:64,height:64,sizes:"64px",crossOrigin:"anonymous",alt:""},e.id)),t.data?.ios.filterTags?.filter(e=>"screenPatterns"===e.filterTag.categorySlug).map(e=>(0,h.jsx)(tM,{imageUrl:e.imageUrl,displayName:e.filterTag.displayName,exampleScreens:e.filterTag.exampleScreens,fetchPriority:"low"},e.filterTag.displayName)),t.data?.web.filterTags?.filter(e=>"screenPatterns"===e.filterTag.categorySlug).map(e=>(0,h.jsx)(tM,{imageUrl:e.imageUrl,displayName:e.filterTag.displayName,exampleScreens:e.filterTag.exampleScreens,fetchPriority:"low"},e.filterTag.displayName)),t.data?.sites.filterTags?.filter(e=>"categories"===e.filterTag.categorySlug).map(e=>(0,h.jsx)(tM,{imageUrl:e.imageUrl,displayName:e.filterTag.displayName,exampleScreens:e.filterTag.exampleScreens,fetchPriority:"low"},e.filterTag.displayName))]})}let t1=I.IS_MAC_LIKE?P.MODIFIER_KEYS.Control:P.MODIFIER_KEYS.Alt;e.s(["SearchBar",0,function(){let e=(0,D.usePageExperience)(),t=(0,Q.usePagePlatform)(),r=720>(0,_.useTailwindBreakpoint)(),a=(0,g.useRef)(null),s=(0,g.useRef)(null),[n,i]=(0,g.useState)(""),c=(0,g.useDeferredValue)(n).trim(),[d,u]=(0,g.useState)(""),[p,m]=(0,g.useState)("apps"===e?{experience:"apps",platform:l(t)}:{experience:"sites"}),[f,S]=(0,g.useState)(!1),[v,b]=(0,g.useState)(null),{isOpen:C,setIsOpen:P,activeTab:O,setActiveTab:G,initialInputValue:U,setInitialInputValue:W}=ej(),H=p.experience,K="apps"===H?p.platform:void 0,V=tF["apps"===H?z(p.platform):"sites"];(0,g.useEffect)(()=>{C&&m("apps"===e?{experience:"apps",platform:l(t)}:{experience:"sites"})},[C,t,e]),(0,g.useEffect)(()=>G("Trending"),[p.experience,p.platform,G]),(0,g.useEffect)(()=>{a.current?.scrollTo({top:0})},[O]);let $=(0,g.useRef)(U);(0,g.useEffect)(()=>{$.current=U},[U]),(0,g.useEffect)(()=>{if(S(!0),!C)return;let e=$.current.trim();i(e),W(""),requestAnimationFrame(()=>{s.current?.setSelectionRange(e.length,e.length)})},[C,W]),function(e){let{listRef:t,activeItemValue:r,setActiveItemValue:a}=e,{isOpen:s,scrollState:n,setScrollState:i}=ej();(0,g.useEffect)(()=>{s?s&&setTimeout(()=>{void 0!==n.activeItemValue&&a(n.activeItemValue),t.current&&t.current.scrollTo({top:n.listScrollPosition})},0):i({listScrollPosition:t.current?.scrollTop??0,activeItemValue:r})},[s])}({listRef:a,activeItemValue:d,setActiveItemValue:u});let X=(0,g.useCallback)(e=>{if(null!==e)return e.addEventListener("animationend",t),()=>e.removeEventListener("animationend",t);function t(){S(!1)}},[]),Y=(()=>{if(r)return"Search Mobbin";switch(H){case"apps":return`${(0,o.getDisplayStringForPlatform)(p.platform)} Apps, Screens, UI Elements, Flows or Keywords...`;case"sites":return"Sites, Categories, Sections or Styles..."}})();function Z(e){(p.experience!==e.experience||"apps"===e.experience&&p.platform!==e.platform)&&(m(e),M.SegmentClient.track("Search Bar Toggle Switched",e))}return(0,h.jsxs)(eS.Provider,{value:{...p,activeItemValue:d,hoverCardBoundaryElement:v,isSearchBarAnimating:f,inputRef:s},"data-sentry-element":"SearchBarContext.Provider","data-sentry-component":"SearchBar","data-sentry-source-file":"SearchBar.tsx",children:[(0,h.jsx)(tJ,{"data-sentry-element":"SearchBarPrefetch","data-sentry-source-file":"SearchBar.tsx"}),(0,h.jsx)(x.Root,{open:C,onOpenChange:P,"data-sentry-element":"RadixDialog.Root","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsxs)(x.Portal,{"data-sentry-element":"RadixDialog.Portal","data-sentry-source-file":"SearchBar.tsx",children:[(0,h.jsx)(x.Overlay,{className:(0,L.classNames)("fixed inset-0","backdrop-blur-xs dark:bg-[hsl(var(--neutral-100)/80%)] light:bg-[hsl(var(--neutral-0)/1%)]","data-state-open:animate-in data-state-closed:animate-out","[--tw-in-duration:150ms] [--tw-out-duration:150ms]","[--tw-enter-opacity:0] [--tw-exit-opacity:0]"),"data-sentry-element":"RadixDialog.Overlay","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsx)("div",{ref:b,className:(0,L.classNames)("fixed top-(--searchbar-top) right-0 left-1/2","h-[min(calc(720px+8px),calc(100vh-var(--searchbar-top)-var(--searchbar-min-bottom)+8px))]")})}),(0,h.jsx)(x.Content,{ref:X,className:(0,L.classNames)("fixed inset-0 flex flex-col items-stretch","min-720:bottom-[unset] min-720:left-[50%] min-720:translate-x-[-50%]","min-720:top-(--searchbar-top)","min-720:max-h-[calc(100vh-var(--searchbar-top)-var(--searchbar-min-bottom))]","min-720:w-[816px] min-720:max-w-full","data-state-open:animate-in data-state-closed:animate-out","[--tw-in-duration:150ms] [--tw-out-duration:150ms]","[--tw-enter-opacity:0] [--tw-exit-opacity:0]","min-720:[--tw-enter-translate-y:4px] min-720:[--tw-exit-translate-y:4px]","min-720:[--tw-enter-translate-x:-50%] min-720:[--tw-exit-translate-x:-50%]"),"data-sentry-element":"RadixDialog.Content","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsx)(y.Command,{loop:!0,vimBindings:!1,shouldFilter:!1,className:(0,L.classNames)("grid h-full overflow-hidden min-720:max-h-[720px] min-720:rounded-24",""===c?"grid-rows-[auto_auto_1fr]":"grid-rows-[auto_1fr]","bg-background-modal shadow","min-720:bg-glass-background-primary",!r&&"glass","min-720:shadow-glass min-720:backdrop-blur-glass"),value:d,onValueChange:e=>{void 0!==e&&u(e)},onKeyDown:e=>{(function(e){var t;if(!(!(t=e.nativeEvent).metaKey&&!t.shiftKey&&(I.IS_MAC_LIKE?t.ctrlKey&&!t.altKey:t.altKey&&!t.ctrlKey)))return!1;switch(e.code){case"Digit1":Z({experience:"apps",platform:"ios"});break;case"Digit2":Z({experience:"apps",platform:"web"});break;case"Digit3":Z({experience:"sites"});break;default:return!1}return e.preventDefault(),!0})(e)||"Escape"===e.key||null!==s.current&&s.current!==document.activeElement&&s.current.focus()},"data-sentry-element":"Command","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsxs)(T,{"data-sentry-element":"LayoutGroup","data-sentry-source-file":"SearchBar.tsx",children:[(0,h.jsxs)("section",{className:"flex items-start gap-x-12 px-16 py-8 min-720:gap-x-0 min-720:p-0",children:[(0,h.jsxs)("div",{className:(0,L.classNames)("flex grow cursor-text items-start gap-x-8","rounded-[19px] py-8 pr-12 pl-16","bg-background-tertiary text-text-primary","min-720:rounded-none min-720:rounded-tl-24 min-720:bg-transparent min-720:py-20 min-720:pr-12 min-720:pl-24 min-720:text-glass-text-primary"),onClick:()=>{r||s.current?.focus()},children:[(0,h.jsx)(y.Command.Input,{asChild:!0,value:n,onValueChange:function(e){i(e.replace(/[\r\n]+/g," "))},"data-sentry-element":"Command.Input","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsx)("textarea",{ref:s,rows:1,placeholder:Y,onKeyDown:function(e){let t;if((0,B.isPrimaryModifier)(e.nativeEvent)&&"k"===e.key||"Escape"===e.key){P(!1),e.preventDefault();return}if("Tab"!==e.key)return;e.preventDefault(),e.stopPropagation();let r=V.indexOf(O);!1===e.shiftKey?t=(r+1)%V.length:(t=r-1)<0&&(t=V.length-1);let a=V[t];void 0!==a&&G(a)},className:(0,L.classNames)("grow bg-transparent text-body","field-sizing-content max-h-[5lh] resize-none overflow-y-auto","placeholder:text-text-tertiary min-720:placeholder:text-glass-text-tertiary")})}
2),""!==c&&(0,h.jsx)(R.ClearIcon,{className:"block shrink-0 cursor-pointer text-text-tertiary min-720:hidden",onClick:()=>i("")})]}),(0,h.jsx)("button",{className:"block cursor-pointer py-8 text-body-bold min-720:hidden",onClick:()=>P(!1),children:"Cancel"}),(0,h.jsxs)("div",{className:"hidden h-lh items-center text-glass-text-tertiary min-720:mt-20 min-720:flex min-720:pr-16",children:[(0,h.jsx)(N.Tooltip,{text:"iOS",keys:[t1,"1"],side:"bottom","data-sentry-element":"Tooltip","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsx)("button",{className:"flex size-36 items-center justify-center",onClick:()=>Z({experience:"apps",platform:"ios"}),children:(0,h.jsx)(E.IosIcon,{className:(0,L.classNames)("size-20","apps"===H&&"ios"===K&&"text-glass-text-primary"),"data-sentry-element":"IosIcon","data-sentry-source-file":"SearchBar.tsx"})})}),(0,h.jsx)(N.Tooltip,{text:"Web",keys:[t1,"2"],side:"bottom","data-sentry-element":"Tooltip","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsx)("button",{className:"flex size-36 items-center justify-center",onClick:()=>Z({experience:"apps",platform:"web"}),children:(0,h.jsx)(A.WebIcon,{className:(0,L.classNames)("size-20","apps"===H&&"web"===K&&"text-glass-text-primary"),"data-sentry-element":"WebIcon","data-sentry-source-file":"SearchBar.tsx"})})}),(0,h.jsx)(N.Tooltip,{text:"Sites",keys:[t1,"3"],side:"bottom","data-sentry-element":"Tooltip","data-sentry-source-file":"SearchBar.tsx",children:(0,h.jsx)("button",{className:"flex size-36 items-center justify-center",onClick:()=>Z({experience:"sites"}),children:(0,h.jsx)(F.SiteIcon,{className:(0,L.classNames)("size-20","sites"===H&&"text-glass-text-primary"),"data-sentry-element":"SiteIcon","data-sentry-source-file":"SearchBar.tsx"})})})]})]}),""===c?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(eB,{}),(0,h.jsxs)(w.motion.section,{layout:q.browser?.getBrowserName()!=="Safari"&&"position",className:"row-start-3 flex overflow-hidden min-720:pl-20",children:[(0,h.jsx)(tE,{tabs:V,activeTab:O,onActiveTabChange:G,onClose:()=>P(!1)}),(0,h.jsx)(j.ScrollArea,{type:"auto",children:(0,h.jsx)("div",{className:"h-full grow",children:(0,h.jsx)(k.ScrollAreaContent,{ref:a,scrollPadding:8,children:(0,h.jsx)(y.Command.List,{className:(0,L.classNames)("relative isolate px-16 pt-8 pb-40 min-720:pr-20","**:[[cmdk-list-sizer]]:flex **:[[cmdk-list-sizer]]:flex-col","**:[[cmdk-list-sizer]]:gap-y-20 min-720:**:[[cmdk-list-sizer]]:gap-y-24","**:[[cmdk-group-heading]]:text-compact-bold **:[[cmdk-group-heading]]:text-text-secondary min-720:**:[[cmdk-group-heading]]:text-glass-text-secondary","**:[[cmdk-loading]]:flex **:[[cmdk-loading]]:w-full **:[[cmdk-loading]]:justify-center **:[[cmdk-loading]]:py-80 **:[[cmdk-loading]]:text-text-secondary min-720:**:[[cmdk-loading]]:text-glass-text-secondary"),children:"Trending"===O?"apps"===p.experience?(0,h.jsx)(tG,{}):(0,h.jsx)(tU,{}):(0,h.jsx)(t$,{activeTab:O})})})})})]})]}):(0,h.jsx)("section",{className:"overflow-hidden",children:(0,h.jsx)(j.ScrollArea,{type:"auto",children:(0,h.jsx)("div",{className:"h-full grow",children:(0,h.jsx)(k.ScrollAreaContent,{scrollPadding:8,children:(0,h.jsx)(y.Command.List,{className:(0,L.classNames)("relative px-8 pt-8 pb-20 min-720:px-20","**:[[cmdk-list-sizer]]:flex **:[[cmdk-list-sizer]]:flex-col","**:[[cmdk-list-sizer]]:gap-y-12","**:[[cmdk-group-heading]]:text-compact-bold **:[[cmdk-group-heading]]:text-text-secondary min-720:**:[[cmdk-group-heading]]:text-glass-text-secondary","**:[[cmdk-loading]]:flex **:[[cmdk-loading]]:w-full **:[[cmdk-loading]]:justify-center **:[[cmdk-loading]]:py-80 **:[[cmdk-loading]]:text-text-secondary min-720:**:[[cmdk-loading]]:text-glass-text-secondary"),children:(()=>{switch(p.experience){case"apps":return(0,h.jsx)(tb,{searchTerm:c,setActiveItemValue:u});case"sites":return(0,h.jsx)(tT,{searchTerm:c,setActiveItemValue:u})}})()})})})})})]})})})]})})]})}],587044),e.s(["useActiveFreeTextSearchQuery",0,function(){let e=(0,ei.usePathname)(),t=(0,ei.useSearchParams)();if(!e.startsWith("/search/")||null!==t.get("image"))return null;let r=t.get("q")?.trim();return void 0===r||""===r?null:r}],519895),e.s([],121046)},611245,(e,t,r)=>{t.exports=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}},387290,(e,t,r)=>{var a=Math.floor,s=Math.random;
2t.exports=function(e,t){return e+a(s()*(t-e+1))}},942200,(e,t,r)=>{var a=e.r(387290);t.exports=function(e,t){var r=-1,s=e.length,n=s-1;for(t=void 0===t?s:t;++r<t;){var i=a(r,n),c=e[i];e[i]=e[r],e[r]=c}return e.length=t,e}},801467,(e,t,r)=>{var a=e.r(611245),s=e.r(370592),n=e.r(942200);t.exports=function(e,t){return n(s(e),a(t,0,e.length))}},45e3,(e,t,r)=>{var a=e.r(239145);t.exports=function(e,t){return a(t,function(t){return e[t]})}},949133,(e,t,r)=>{var a=e.r(801467),s=e.r(490650),n=e.r(778116),i=e.r(474287),c=e.r(16379);t.exports=function(e,t,r){return t=(r?i(e,t,r):void 0===t)?1:c(t),(n(e)?a:s)(e,t)}},376935,(e,t,r)=>{var a=e.r(45e3),s=e.r(953349);t.exports=function(e){return null==e?[]:a(e,s(e))}},490650,(e,t,r)=>{var a=e.r(611245),s=e.r(942200),n=e.r(376935);t.exports=function(e,t){var r=n(e);return s(r,a(t,0,r.length))}}]);
3
4//# debugId=b705b495-60db-34ab-da51-949c206215d3

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.