"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[766],{87200:function(e,l,n){n.d(l,{Z:function(){return v}});var a=n(94521),i=n(5443),t=n(49217),s=n(93223),r=n(35226),o=n(91530),d=n.n(o),c=n(92379),u=n(26123),m=n(72256),g=n(25940),p=n(651);function f(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);l&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function y(e){for(var l=1;l{n(!1)},loading:f,children:(0,p.jsx)(m.Z,y({},h.cancelButtonText))}),(0,p.jsx)(i.z,{color:"danger",loading:f,onClick:()=>{v(!0),s.Z.removeThirdPartyGPTFromWorkspace(a.id,o.gizmo.id).finally(()=>{x.invalidateQueries({queryKey:["gizmo"]}),n(!0),v(!1)})},children:(0,p.jsx)(m.Z,y({},h.removeButtonText))})]})]})}let h=(0,g.vU)({removeModalTitle:{id:"removeThirdPartyGPTModal.accessModalTitle",defaultMessage:"Remove GPT from workspace"},removeModalPrompt:{id:"removeThirdPartyGPTModal.accessModalPrompt",defaultMessage:"Are you sure you want to revoke approval of {gptName} for your workspace? Members won't be able to chat with this GPT anymore."},cancelButtonText:{id:"removeThirdPartyGPTModal.cancelButtonText",defaultMessage:"Cancel"},removeButtonText:{id:"removeThirdPartyGPTModal.removeButtonText",defaultMessage:"Remove GPT"}})},40766:function(e,l,n){n.d(l,{Bo:function(){return en},Eu:function(){return ee},j4:function(){return X}});var a,i,t,s,r=n(94521),o=n(41141),d=n(21904),c=n(62164),u=n(55371),m=n(14816),g=n(93747),p=n(15236),f=n(48580),y=n(19841),v=n(556),h=n(61888),x=n(40319),k=n.n(x),j=n(92379),b=n(72256),z=n(25940),S=n(74091),w=n(5443),G=n(50684),C=n(67165),F=n(14975),N=n(92426),P=n(49217),L=n(82823),D=n(17903),T=n(46868),M=n(56029),O=n(651);function K(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);l&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function R(e){for(var l=1;l(0,m.a)({queryFn:async()=>M.U.getAbout(e),queryKey:["gizmo","about",{gizmoId:e}]}),E=e=>(0,m.a)({queryFn:async()=>M.U.getCreatorSlice({creatorId:e}),queryKey:["gizmo","creator",{creatorId:e}],enabled:null!=e}),A=e=>{switch(e.type){case d.qK.BROWSER:return{title:ea.browsing};case d.qK.PYTHON:return{title:ea.dataAnalysis};case d.qK.DALLE:return{title:ea.dalle};case d.qK.MEMORY:return{title:ea.memory,description:ea.memoryDescription};case d.qK.JIT_PLUGIN:return{title:ea.actions,description:ea.actionsDescription};default:return null}},_=e=>{var l;let{tools:n}=e,a=(0,h.uniqBy)(null!=n?n:[],e=>e.type),i=(0,h.compact)(null!==(l=a.map(A).filter(e=>null!=e))&&void 0!==l?l:[]);return 0===i.length?null:(0,O.jsxs)("div",{className:"flex flex-col",children:[(0,O.jsx)(I,{className:"mb-2",children:(0,O.jsx)(b.Z,{id:"gizmo.about.capabilitiesHeader",defaultMessage:"Capabilities"})}),i.map(e=>(0,O.jsxs)("div",{className:"flex flex-row items-start gap-2 py-1 text-sm",children:[(0,O.jsx)(N.$As,{className:"icon-sm mt-0.5 text-green-600"}),(0,O.jsxs)("div",{children:[(0,O.jsx)(b.Z,R({},e.title)),null!=e.description&&(0,O.jsx)("div",{className:"text-xs text-token-text-tertiary",children:(0,O.jsx)(b.Z,R({},e.description))})]})]},e.title.id))]})},U=S.Z.div(i||(i=(0,o.Z)(["flex flex-col justify-center items-center gap-2 border-l border-token-border-heavy first:border-0 w-48 mt-4 px-2"]))),q=S.Z.div(t||(t=(0,o.Z)(["flex flex-row items-center gap-1.5 pt-1 text-xl font-semibold text-center leading-none"]))),B=S.Z.div(s||(s=(0,o.Z)(["text-xs text-token-text-tertiary"]))),V=e=>{let{gizmoResource:l}=e;return(0,O.jsxs)(C.d,{contentAlign:"end",sideOffset:4,triggerButton:(0,O.jsx)(w.z,{color:"ghost",icon:N.nWS}),children:[(0,O.jsx)(D.GizmoKeepInSidebarMenuItem,{gizmoResource:l}),(0,O.jsx)(D.GizmoShareMenuItem,{gizmoResource:l})]})},W=e=>{let{aboutBlock:l}=e;switch(l.type){case"generic_title_subtitle":return(0,O.jsxs)(U,{children:[(0,O.jsx)(q,{children:l.title}),(0,O.jsx)(B,{children:l.subtitle})]});case"rating":return(0,O.jsxs)(U,{children:[(0,O.jsxs)(q,{children:[(0,O.jsx)(N.e0l,{className:"icon-sm"}),l.avg]}),(0,O.jsx)(B,{children:l.count_str})]});case"category":var n;if(null==l.category_ranking)return(0,O.jsxs)(U,{children:[(0,O.jsx)(q,{children:l.category_str}),(0,O.jsx)(B,{children:(0,O.jsx)(b.Z,{id:"gizmo.about.category",defaultMessage:"Category"})})]});return(0,O.jsxs)(U,{children:[(0,O.jsx)(q,{children:(0,O.jsx)(b.Z,{id:"gizmo.about.trendingRank",defaultMessage:"#{rank}",values:{rank:l.category_ranking}})}),(0,O.jsx)(B,{children:(0,O.jsx)(b.Z,{id:"gizmo.about.inCategory",defaultMessage:"in {category} {locale}",values:{category:l.category_str,locale:null!==(n=l.category_locale_str)&&void 0!==n?n:""}})})]})}},Q=e=>{let{blocks:l}=e;return(0,O.jsx)("div",{className:"flex justify-center",children:l.map(e=>(0,O.jsx)(W,{aboutBlock:e},e.type))})},$=e=>{let{href:l,onClick:n,children:a}=e;return(0,O.jsx)(v.E.div,{whileTap:{scale:.98},className:"flex",children:(0,O.jsxs)(k(),{href:l,onClick:n,className:(0,y.default)("group relative ml-2 h-14 flex-grow rounded-xl border border-token-border-medium bg-token-main-surface-primary px-4 hover:bg-token-main-surface-secondary focus:outline-none"),children:[(0,O.jsx)("div",{className:"flex h-full items-center",children:(0,O.jsx)("div",{className:"line-clamp-2 text-sm",children:a})}),(0,O.jsx)("div",{className:"absolute -bottom-px -left-2 h-3 w-4 border-b border-token-border-medium bg-token-main-surface-primary group-hover:bg-token-main-surface-secondary",children:(0,O.jsx)("div",{className:"h-3 w-2 rounded-br-full border-b border-r border-token-border-medium bg-token-main-surface-primary"})}),(0,O.jsx)("div",{className:"absolute bottom-0 right-2 top-0 hidden items-center group-hover:flex",children:(0,O.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-token-main-surface-primary",children:(0,O.jsx)(N.kBi,{className:"icon-md text-token-text-primary"})})})]})})},H=e=>{var l;let{gizmo:n,onClose:a}=e,i=(0,f.sB)("chatgpt-gizmo-reviews").value,t=null===(l=n.gizmo.display.prompt_starters)||void 0===l?void 0:l.slice(0,4);return null!=t&&0!==t.length&&i?(0,O.jsxs)("div",{className:"flex flex-col",children:[(0,O.jsx)(I,{children:(0,O.jsx)(b.Z,{id:"gizmo.about.conversationStartersHeader",defaultMessage:"Conversation Starters"})}),(0,O.jsx)("div",{className:"mt-4 grid grid-cols-2 gap-x-1.5 gap-y-2",children:t.map((e,l)=>(0,O.jsx)(J,{gizmo:n,prompt:e,onClick:a},l))})]}):null};function J(e){var l;let{gizmo:n,prompt:a,onClick:i}=e,t=(0,L.EF)(n,a);return(0,O.jsx)($,{href:null!==(l=null==t?void 0:t.toString())&&void 0!==l?l:"#",onClick:i,children:a})}let Y=e=>{let{reviewStats:l}=e;return(0,f.sB)("chatgpt-gizmo-reviews").value?(0,O.jsxs)("div",{className:"flex flex-col",children:[(0,O.jsx)("div",{className:"mb-2",children:(0,O.jsx)(I,{children:(0,O.jsx)(b.Z,{id:"gizmo.about.ratingsHeader",defaultMessage:"Ratings"})})}),null!=l?[5,4,3,2,1].map(e=>{var n;return(0,O.jsxs)("div",{className:"flex flex-row items-center gap-2 py-1 text-xl font-semibold",children:[(0,O.jsxs)("div",{className:"icon-lg relative",children:[(0,O.jsx)(N.e0l,{className:"icon-lg text-green-500"}),(0,O.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-[11px] text-white",children:e})]}),(0,O.jsx)("div",{className:"h-2.5 flex-grow overflow-hidden rounded-full bg-gray-100 dark:bg-gray-700",children:(0,O.jsx)("div",{className:"h-full bg-green-500",style:{width:"".concat((null!==(n=null==l?void 0:l.by_rating[e-1])&&void 0!==n?n:0)*100,"%")}})})]},e)}):(0,O.jsx)("div",{className:"text-sm text-token-text-tertiary",children:(0,O.jsx)(b.Z,{id:"gizmo.about.ratings.notEnoughRatings",defaultMessage:"Not enough ratings yet"})})]}):null},X=e=>{let{gizmoId:l,creatorId:n}=e;return(0,u.EV)(u.B.GPTDetails)?(0,O.jsx)(ee,{gizmoId:l,creatorId:n,onClose:()=>u.vm.closeModal(u.B.GPTDetails)}):null},ee=e=>{var l;let{gizmoId:n,creatorId:a,onClose:i,children:t}=e,s=Z(n),{data:r}=E(a),o=null===(l=s.data)||void 0===l?void 0:l.gizmo,d=(0,L.b9)(n),c=null==d?void 0:d.data;return(0,j.useEffect)(()=>{g.A.logEvent(p.M.showDetailModal,{gizmo_id:n})},[n]),(0,O.jsx)(P.Z,{isOpen:!0,onClose:i,type:"success",hideSeparator:!0,showCloseButton:!0,noPadding:!0,className:"flex h-[calc(100vh-25rem)] min-h-[80vh] max-w-xl flex-col",children:(0,O.jsx)("div",{className:"relative flex h-full flex-col gap-2 overflow-hidden px-2 py-4",children:s.isLoading||d.isLoading?(0,O.jsx)("div",{className:"flex h-40 items-center justify-center pb-10",children:(0,O.jsx)(G.Z,{})}):null==o||null==c||null==s.data?(0,O.jsx)("div",{className:"flex flex-col gap-4 pb-10",children:(0,O.jsx)(b.Z,{id:"gizmo.about.notFound",defaultMessage:"GPT not found"})}):(0,O.jsx)(O.Fragment,{children:(0,O.jsxs)("div",{className:"relative flex flex-grow flex-col gap-4 overflow-y-auto px-6 pb-20 pt-16",children:[(0,O.jsx)("div",{className:"absolute top-0",children:(0,O.jsxs)("div",{className:"fixed left-4 right-4 z-10 flex items-center justify-end bg-gradient-to-b from-token-main-surface-primary to-transparent pb-2",children:[c&&(0,O.jsx)(V,{gizmoResource:c}),(0,O.jsx)(F.P,{onClick:i})]})}),(0,O.jsx)("div",{className:"absolute bottom-[64px]",children:(0,O.jsx)("div",{className:"fixed left-4 right-4 z-10 flex min-h-[64px] items-end bg-gradient-to-t from-token-main-surface-primary to-transparent px-2",children:t})}),(0,O.jsx)(T.r,{gizmo:c,className:"!h-fit",avatarClassName:"!h-20 !w-20"}),(0,O.jsx)(Q,{blocks:s.data.about_blocks}),(0,O.jsx)(H,{gizmo:c,onClose:i}),(0,O.jsx)(_,{tools:c.tools}),(0,O.jsx)(Y,{reviewStats:s.data.review_stats}),r&&(0,O.jsx)(el,{gizmos:r.items})]})})})})};function el(e){let{gizmos:l}=e;return l.length>0?(0,O.jsxs)("div",{className:"flex flex-col",children:[(0,O.jsx)("div",{className:"mb-2",children:(0,O.jsx)(I,{children:(0,O.jsx)(b.Z,{id:"gizmo.about.moreByHeader",defaultMessage:"More by {creatorName}",values:{creatorName:l[0].gizmo.author.display_name}})})}),(0,O.jsx)("div",{className:(0,y.default)("no-scrollbar group flex min-h-[104px] items-center space-x-2 overflow-x-auto overflow-y-hidden"),children:l&&l.map(e=>(0,O.jsx)("a",{onClick:()=>{g.A.logEvent(p.M.detailClickGizmo,{gizmo_id:e.gizmo.id})},href:(0,L.m_)(e),className:"h-fit min-w-fit rounded-xl bg-token-main-surface-secondary px-1 py-4 md:px-3 md:py-4 lg:px-3",children:(0,O.jsx)(c.Xq,{resource:e})},e.gizmo.id))})]}):null}let en=e=>(0,O.jsx)("div",{className:"flex flex-grow flex-col items-center",children:(0,O.jsxs)(w.z,R(R({color:"primary",className:"h-12 w-full",icon:N.kBi},e),{},{children:[(0,O.jsx)(b.Z,{id:"gizmo.about.startChat",defaultMessage:"Start Chat"}),e.children]}))}),ea=(0,z.vU)({browsing:{id:"gizmo.about.tools.browsing",defaultMessage:"Browsing"},dataAnalysis:{id:"gizmo.about.tools.dataAnalysis",defaultMessage:"Code Interpreter & Data Analysis"},dalle:{id:"gizmo.about.tools.dalle",defaultMessage:"DALL\xb7E Images"},memory:{id:"gizmo.about.tools.memory",defaultMessage:"Memory"},actions:{id:"gizmo.about.tools.actions",defaultMessage:"Actions"},actionsDescription:{id:"gizmo.about.tools.actionsDescription",defaultMessage:"Retrieves or takes actions outside of ChatGPT"},memoryDescription:{id:"gizmo.about.tools.memoryDescription",defaultMessage:"Learns from previous chats to improve future conversations"}})},40876:function(e,l,n){n.d(l,{S:function(){return x},X:function(){return h}});var a=n(55257),i=n(82823),t=n(2915),s=n(18454),r=n(48580),o=n(19841),d=n(40319),c=n.n(d),u=n(92379),m=n(72256),g=n(5443),p=n(46868),f=n(69817),y=n(80006),v=n(651);function h(e){var l;let{gizmo:n}=e,a=(0,i.i6)(n),{0:o,1:d}=(0,u.useState)(!1),c=null===(l=(0,r.sB)("chatgpt-dsa-reporting"))||void 0===l?void 0:l.value,g=(0,s.b)();return(0,v.jsxs)("div",{className:"flex h-full flex-col",children:[(0,v.jsx)(t.N,{gizmo:n}),(0,v.jsx)(x,{redirectUrl:a}),(0,v.jsxs)("div",{className:"flex grow flex-col items-center justify-center p-2",children:[(0,v.jsx)(p.r,{gizmo:n,isAnon:!0,children:(0,v.jsxs)("div",{className:"mt-7 flex flex-col items-center gap-4",children:[(0,v.jsx)(y.p,{onClick:()=>g({callbackUrl:a}),children:(0,v.jsx)(m.Z,{id:"gizmo.anonLandingPage.login",defaultMessage:"Sign up to chat"})}),(0,v.jsxs)("div",{className:"flex gap-2 whitespace-nowrap text-sm text-token-text-tertiary",children:[(0,v.jsx)("div",{children:(0,v.jsx)(m.Z,{id:"gizmo.anonLandingPage.loginSubtext",defaultMessage:"Sign up or Log in to chat"})}),c&&(0,v.jsxs)(v.Fragment,{children:["|",(0,v.jsx)("div",{onClick:()=>d(!0),className:"cursor-pointer",children:(0,v.jsx)(m.Z,{id:"gizmo.anonLandingPage.report",defaultMessage:"Report illegal content"})})]})]})]})}),o&&(0,v.jsx)(f.W,{onClose:()=>d(!1),gizmoId:n.gizmo.id})]})]})}function x(e){let{redirectUrl:l,className:n}=e,a=(0,s.b)();return(0,v.jsxs)("div",{className:(0,o.default)("flex items-center justify-between px-7 py-4",n),children:[(0,v.jsx)(k,{}),(0,v.jsx)(g.z,{color:"primary",onClick:()=>a({callbackUrl:l}),children:(0,v.jsx)(m.Z,{id:"gizmo.anonLandingPage.signup",defaultMessage:"Sign up"})})]})}function k(){return(0,v.jsx)(c(),{href:"/",children:(0,v.jsx)(a.nI,{className:"h-8 w-8"})})}},62164:function(e,l,n){n.d(l,{Xq:function(){return eR},fN:function(){return ef},n_:function(){return eI}});var a,i,t,s,r,o,d,c,u,m,g=n(94521),p=n(41141),f=n(21904),y=n(5443),v=n(50684),h=n(82823),x=n(2933),k=n(16645),j=n(33112),b=n(4702),z=n(55371),S=n(98506),w=n(27860),G=n(79688),C=n(20876),F=n(93747),N=n(15236),P=n(17927),L=n(48580),D=n(19841),T=n(71988),M=n(61888),O=n(40319),K=n.n(O),R=n(43128),I=n(92379),Z=n(72256),E=n(26123),A=n(25940),_=n(6522),U=n(74091),q=n(8844),B=n(12715),V=n(55775),W=n(23041),Q=n(31439),$=n(62484),H=n(92426),J=n(85057),Y=n(73746),X=n(40766),ee=n(40876),el=n(61885),en=n(83252),ea=n(28862),ei=n(651);function et(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);l&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function es(e){for(var l=1;l{e.preventDefault(),null==a||a(e)},children:n}):o?(0,ei.jsxs)(ei.Fragment,{children:[d&&(0,ei.jsx)(X.Eu,{gizmoId:l.gizmo.id,creatorId:l.gizmo.author.user_id,onClose:()=>{c(!1),null==t||t()},children:(0,ei.jsx)(X.Bo,{as:"link",to:(0,h.m_)(l)})}),(0,ei.jsx)("a",{className:(0,D.default)("gizmo-link cursor-pointer",r),href:"#",onClick:e=>{e.preventDefault(),null==a||a(e),c(!0),null==i||i()},children:n})]}):(0,ei.jsx)(K(),{href:(0,h.m_)(l),className:(0,D.default)("gizmo-link",r),target:"_blank",onClick:a,children:n})}let ec=void 0!==a?a:a=n(51642),eu=void 0!==i?i:i=n(70734),em=void 0!==t?t:t=n(55568),eg=void 0!==s?s:s=n(54474),ep=void 0!==r?r:r=n(26603);function ef(e){var l,n;let{anon:a}=e,{0:i,1:t}=(0,I.useState)(()=>P.m.getItem(P.F.GizmoDiscoveryLocale)),s=e=>{t(e),P.m.setItem(P.F.GizmoDiscoveryLocale,e)},r=(0,b.t)(),{0:o,1:d}=(0,I.useState)(!1),c=null!=r&&r.isOwnerOfAccount()&&!o?f.r3.OWNER:f.r3.STANDARD,u=null===(l=(0,L.sB)("gizmos-use-graphql-web"))||void 0===l?void 0:l.value,m=null===(n=(0,b.t)())||void 0===n?void 0:n.isWorkspaceAccount(),g=u&&!m,p=u&&m,[y,v]=(0,_.useQueryLoader)(ec),[h,x]=(0,_.useQueryLoader)(eu);return(0,I.useEffect)(()=>{v({skip:!g}),x({skip:!p})},[v,x,p,g]),(0,ei.jsxs)(ei.Fragment,{children:[u&&(0,ei.jsxs)(I.Suspense,{fallback:(0,ei.jsx)(eZ,{}),children:[y&&g&&(0,ei.jsx)(eh,{anon:a,queryReference:y,effectiveRole:c,requestedLocale:i,setPretendStandardUser:d,setLocale:s}),h&&p&&(0,ei.jsx)(ex,{anon:a,queryReference:h,effectiveRole:c,requestedLocale:i,setPretendStandardUser:d,setLocale:s})]}),!u&&(0,ei.jsx)(ej,{anon:a,currAccount:r,requestedLocale:i,effectiveRole:c,setPretendStandardUser:d,setLocale:s})]})}function ey(e){let{cutId:l,locale:n,limit:a,cursor:i,enabled:t}=e,s=e=>{switch(e){case k.AR.ENGLISH:return"EN";case k.AR.GLOBAL:return"GLOBAL";default:return}},{0:r,1:o}=(0,I.useState)([]),{0:d,1:c}=(0,I.useState)(i),{0:u,1:m}=(0,I.useState)(null!=t&&t),{0:g,1:p}=(0,I.useState)(!1),{0:f}=(0,I.useState)(!1),y=(0,_.useRelayEnvironment)();return{data:r,hasNextPage:u,fetchNextPage:(0,I.useCallback)(async()=>{p(!0);let e=await (0,_.fetchQuery_DEPRECATED)(y,ep,{id:l,locale:s(n),first:a,after:d});if(p(!1),e){var i,t,r,u;m(null!==(i=null===(t=e.gizmoDiscoveryCut)||void 0===t||null===(t=t.items)||void 0===t?void 0:t.pageInfo.hasNextPage)&&void 0!==i&&i);let l=(0,M.compact)(null===(r=e.gizmoDiscoveryCut)||void 0===r||null===(r=r.items)||void 0===r||null===(r=r.edges)||void 0===r?void 0:r.map(e=>{var l;return ev(null!==(l=null==e?void 0:e.node)&&void 0!==l?l:null)}));o(e=>[...e,...l]),c(null===(u=e.gizmoDiscoveryCut)||void 0===u||null===(u=u.items)||void 0===u?void 0:u.pageInfo.endCursor)}},[d,l,n,y,a,c]),isFetchingNextPage:g,isError:f}}function ev(e){var l,n,a,i,t,s,r,o,d,c,u;if(!e)return null;let m=(0,_.readInlineData)(eg,e);return{gizmo:{id:m.legacyId,author:{display_name:null!==(l=null===(n=m.author)||void 0===n?void 0:n.displayName)&&void 0!==l?l:null,link_to:null!==(a=null===(i=m.author)||void 0===i?void 0:i.linkTo)&&void 0!==a?a:null,user_id:null===(t=m.author)||void 0===t?void 0:t.userId},display:{name:m.display.name,description:null!==(s=m.display.description)&&void 0!==s?s:null,profile_picture_url:null!==(r=m.display.profilePictureUrl)&&void 0!==r?r:null},vanity_metrics:{num_conversations_str:null!==(o=null===(d=m.vanityMetrics)||void 0===d?void 0:d.numConversationsStr)&&void 0!==o?o:void 0},tags:null!==(c=null===(u=m.tags)||void 0===u?void 0:u.map(eQ))&&void 0!==c?c:null,short_url:m.shortUrl}}}function eh(e){let{anon:l,queryReference:n,requestedLocale:a,effectiveRole:i,setPretendStandardUser:t,setLocale:s}=e,r=(0,_.usePreloadedQuery)(ec,n);return(0,ei.jsx)(ek,{anon:l,data:r.gizmoDiscovery,requestedLocale:a,effectiveRole:i,setPretendStandardUser:t,setLocale:s})}function ex(e){let{anon:l,queryReference:n,requestedLocale:a,effectiveRole:i,setPretendStandardUser:t,setLocale:s}=e,r=(0,_.usePreloadedQuery)(eu,n);return(0,ei.jsx)(ek,{anon:l,data:r.gizmoDiscoveryForViewer,requestedLocale:a,effectiveRole:i,setPretendStandardUser:t,setLocale:s})}function ek(e){let{anon:l,data:n,requestedLocale:a,effectiveRole:i,setPretendStandardUser:t,setLocale:s}=e,{0:r,1:o}=(0,I.useState)(!0),{0:d}=(0,I.useState)(!1),{0:c,1:u}=(0,I.useState)(void 0),m=e=>{switch(e){case"EN":default:return k.AR.ENGLISH;case"GLOBAL":return k.AR.GLOBAL}},g=e=>{switch(e){case"FEATURED":return"featured";case"RANKED":return"ranked";default:return"none"}};return(0,I.useEffect)(()=>{if(n){var e,l;o(!1),u({locale:m(null==n?void 0:n.locale),workspace_filtered:null!==(e=null==n?void 0:n.workspaceFiltered)&&void 0!==e&&e,cuts:(null!==(l=null==n?void 0:n.cuts)&&void 0!==l?l:[]).map(e=>{var l,n,a,i,t;let s=(0,_.readInlineData)(em,e);return{info:{id:s.info.id,title:null!==(l=s.info.title)&&void 0!==l?l:void 0,description:null!==(n=s.info.description)&&void 0!==n?n:void 0,display_type:g(s.info.displayType),display_group:null!==(a=s.info.displayGroup)&&void 0!==a?a:void 0,locale:m(s.info.locale)},list:{items:(0,M.compact)(null===(i=s.items)||void 0===i||null===(i=i.edges)||void 0===i?void 0:i.map(e=>{var l;return ev(null!==(l=null==e?void 0:e.node)&&void 0!==l?l:null)})),cursor:null===(t=s.items)||void 0===t?void 0:t.pageInfo.endCursor}}})})}},[n]),(0,ei.jsx)(eb,{anon:l,discoveryLanding:c,isLoading:r,isError:d,effectiveRole:i,setPretendStandardUser:t,requestedLocale:a,setLocale:s,useFetchMoreQuery:ey})}function ej(e){let{anon:l,currAccount:n,requestedLocale:a,effectiveRole:i,setPretendStandardUser:t,setLocale:s}=e,{0:r,1:o}=(0,I.useState)(void 0),d=!!l||(null==n?void 0:n.isPersonalAccount())&&!0,{data:c,isLoading:u,isError:m}=(0,h.z5)(a,d);return(0,I.useEffect)(()=>{c&&o({locale:c.locale,workspace_filtered:c.workspace_filtered,cuts:c.cuts.map(e=>({info:e.info,list:{items:e.list.items.map(e=>e.resource),cursor:e.list.cursor}}))})},[c]),(0,ei.jsx)(eb,{anon:l,discoveryLanding:r,isLoading:u,isError:m,effectiveRole:i,setPretendStandardUser:t,requestedLocale:a,setLocale:s,useFetchMoreQuery:function(){var e,l;let n=(0,h.Fi)(...arguments);return es(es({},n),{},{data:null!==(e=null===(l=n.data)||void 0===l?void 0:l.pages.flatMap(e=>e.list.items.map(e=>e.resource)))&&void 0!==e?e:[]})}})}function eb(e){var l,n,a;let{anon:i,discoveryLanding:t,isLoading:s,isError:r,effectiveRole:o,setPretendStandardUser:d,requestedLocale:c,setLocale:u,useFetchMoreQuery:m}=e,g=(0,b.t)(),p=null!==(l=null==t?void 0:t.locale)&&void 0!==l?l:c,f=(0,I.useRef)({}),{0:y,1:h}=(0,I.useState)({}),x=(0,I.useMemo)(()=>(0,M.uniqBy)((0,M.compact)(null==t?void 0:t.cuts.map(e=>({id:e.info.id,name:e.info.display_group}))),"name"),[t]),k=(0,I.useRef)(null),j=null!==(n=x.find(e=>y[e.id]))&&void 0!==n?n:x[0];(0,I.useEffect)(()=>{let e=f.current,l=new IntersectionObserver(l=>{l.forEach(l=>{for(let n of x){let a=e[n.id];null!=a&&l.target===a&&h(e=>es(es({},e),{},{[n.id]:l.isIntersecting}))}})},{root:null,rootMargin:"-96px",threshold:.1});return Object.values(e).forEach(e=>{null!=e&&l.observe(e)}),()=>{Object.values(e).forEach(e=>{null!=e&&l.unobserve(e)})}},[f,x]);let z=(0,I.useRef)(null),S=(0,I.useRef)(null),{0:G,1:C}=(0,I.useState)(0);return((0,I.useEffect)(()=>{let e=S.current,l=()=>{null!=e&&C(e.scrollTop)};return null==e||e.addEventListener("scroll",l),window.addEventListener("resize",l),l(),()=>{null==e||e.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[S,C]),s||r)?(0,ei.jsxs)(ei.Fragment,{children:[i?(0,ei.jsx)(ee.S,{redirectUrl:(0,w.cy)(),className:"sticky top-0 z-30 h-14 bg-token-main-surface-primary"}):(0,ei.jsx)(eC,{locale:p,setLocale:u,currAccount:g}),(0,ei.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:r?(0,ei.jsx)(W.Z,{type:"danger",children:(0,ei.jsx)(Z.Z,es({},e$.discoveryError))}):(0,ei.jsx)(v.Z,{})})]}):(0,ei.jsxs)("div",{ref:S,className:"h-full overflow-y-auto",children:[i?(0,ei.jsx)(ee.S,{redirectUrl:(0,w.cy)(),className:"sticky top-0 z-30 h-14 bg-token-main-surface-primary"}):(0,ei.jsxs)(ei.Fragment,{children:[(null==g?void 0:g.isWorkspaceAccount())&&(0,ei.jsx)(eG,{role:o,onPretendStandardUser:e=>{d(e)}}),(0,ei.jsx)(eC,{pageSearchRef:z,locale:p,setLocale:u,currAccount:g})]}),(0,ei.jsxs)("div",{className:"mx-auto max-w-3xl overflow-x-clip px-4",children:[(0,ei.jsx)(ez,{}),!i&&(0,ei.jsx)(eI,{ref:z,className:"z-20 mb-6 mt-2 flex-grow shadow-[0px_10px_10px_-6px_rgba(0,0,0,0.04)]",inputClassName:"md:h-14 h-12 text-base pl-12",iconClassName:"left-5",resultsSizeOffset:Math.min(G-260,-110)}),x.length>1&&(0,ei.jsx)(eS,{displayGroups:x,currentDisplayGroup:j,scrollToDisplayGroup:e=>{var l;(null!==(l=f.current[e.id])&&void 0!==l?l:k.current).scrollIntoView({behavior:"smooth",block:"start"})}}),(0,ei.jsx)("div",{ref:k,className:"scroll-mt-28"}),null!==(a=null==t?void 0:t.cuts.map(e=>{var l;return"featured"===e.info.display_type?(0,ei.jsx)(eN,{info:e.info,items:e.list.items,ref:l=>{null!=l&&(f.current[e.info.id]=l)},effectiveRole:o},e.info.id):(0,ei.jsx)(eL,{info:e.info,items:e.list.items,cursor:null!==(l=e.list.cursor)&&void 0!==l?l:void 0,ref:l=>{null!=l&&(f.current[e.info.id]=l)},anon:i,effectiveRole:o,useFetchMoreQuery:m},e.info.id)}))&&void 0!==a?a:[]]}),(null==t?void 0:t.workspace_filtered)&&!(null!=g&&g.isOwnerOfAccount())&&(0,ei.jsx)(ew,{})]})}function ez(){return(0,ei.jsxs)("div",{className:"mb-6",children:[(0,ei.jsx)("div",{className:"my-2 text-center text-3xl font-bold md:my-4 md:text-5xl",children:(0,ei.jsx)(Z.Z,es({},e$.discoverySplashHeader))}),(0,ei.jsx)("div",{className:"mx-auto w-full text-center text-sm text-token-text-secondary md:text-lg md:leading-tight",children:(0,ei.jsx)(Z.Z,es({},e$.discoverySplashDescription))})]})}function eS(e){let{displayGroups:l,currentDisplayGroup:n,scrollToDisplayGroup:a}=e,i=(0,I.useRef)(null),t=(0,E.Z)(),s=(0,I.useRef)({}),{0:r,1:o}=(0,I.useState)(!1);(0,I.useEffect)(()=>{if(r||null==n)return;let e=s.current[n.id];if(null==e)return;let l=i.current;null!=l&&(l.scrollLeft>e.offsetLeft?l.scrollBy({left:e.offsetLeft-l.scrollLeft-20,behavior:"smooth"}):l.scrollLeft+l.clientWidth{let e=i.current,l=()=>{null!=e&&(c(e.scrollLeft>0),m(e.scrollLeft+e.clientWidth{null==e||e.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[i]),(0,ei.jsxs)("div",{className:"sticky top-14 z-10 -ml-4 mb-12 w-screen bg-token-main-surface-primary py-2 text-sm md:ml-0 md:w-full md:pb-0",children:[d&&(0,ei.jsx)("div",{className:"absolute left-0 top-2 hidden h-full items-end bg-gradient-to-r from-white from-50% to-transparent pr-8 dark:from-gray-800 md:block",children:(0,ei.jsx)("button",{className:"mt-2 rounded-full bg-gray-100 p-1 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-white/20",onClick:()=>{null!=i.current&&i.current.scrollBy({left:-400,behavior:"smooth"})},children:(0,ei.jsx)(H.Y4O,{className:"icon-sm"})})}),(0,ei.jsx)("div",{className:"no-scrollbar flex scroll-m-5 gap-1.5 overflow-x-auto md:overflow-hidden",ref:i,children:l.map(e=>(0,ei.jsx)("div",{className:(0,D.default)("cursor-pointer scroll-mx-5 whitespace-nowrap rounded-3xl px-3 py-2 first:ml-4 last:mr-4 md:px-2 md:first:ml-0 md:last:mr-0",e.id===(null==n?void 0:n.id)?"border-token-text-primary bg-black text-token-main-surface-primary dark:bg-gray-100 md:rounded-none md:border-b-2 md:bg-transparent md:text-token-text-primary dark:md:bg-transparent":"bg-token-main-surface-secondary hover:bg-gray-100 hover:text-token-text-primary dark:hover:bg-white/20 md:rounded-lg md:bg-transparent md:text-token-text-tertiary md:hover:bg-gray-50 dark:md:bg-transparent dark:md:hover:bg-gray-700"),onClick:()=>{o(!0),a(e),setTimeout(()=>{o(!1)},1e3),F.A.logEvent(N.M.storeClickCategory,{category:e.id})},ref:l=>{null!=l&&(s.current[e.id]=l)},children:function(){return t.formatMessage(...arguments)}({id:"gizmo.categoryName.".concat(e.name),defaultMessage:e.name,description:"store category"})},e.id))}),u&&(0,ei.jsx)("div",{className:"absolute right-0 top-2 hidden h-full bg-gradient-to-l from-white from-50% to-transparent pl-8 dark:from-gray-800 md:block",children:(0,ei.jsx)("button",{className:"mt-2 rounded-full bg-gray-100 p-1 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-white/10",onClick:()=>{null!=i.current&&i.current.scrollBy({left:400,behavior:"smooth"})},children:(0,ei.jsx)(H.LZ3,{className:"icon-sm"})})})]})}function ew(){let e=(0,E.Z)(),l=(0,V.$3)(),n=(0,z.xH)();return(0,ei.jsxs)("div",{className:(0,D.default)("fixed bottom-0 flex w-full items-center justify-center gap-2 bg-token-main-surface-secondary p-3 text-sm text-token-text-secondary",!n&&"md:w-[calc(100%-16rem)]"),children:[(0,ei.jsx)(H.ZyU,{className:"icon-sm"}),e.formatMessage(e$.discoveryThirdPartyGPTsDisabled,{workspaceName:l})]})}function eG(e){let{role:l,onPretendStandardUser:n}=e,a=(0,E.Z)();return(0,b.S0)()?(0,ei.jsxs)("div",{className:"h-52px flex w-full items-center justify-center gap-2 bg-gray-100 p-3 text-sm dark:bg-gray-700",children:[(0,ei.jsx)(H.ZyU,{className:"icon-sm"}),(0,ei.jsx)(Z.Z,{id:"gizmo.discovery.browsingAsOwner",defaultMessage:"You're viewing as a workspace member",values:{b:e=>(0,ei.jsxs)(Q.Z.Root,{defaultValue:l,onValueChange:e=>{n(e===f.r3.STANDARD)},children:[(0,ei.jsxs)(Q.Z.Trigger,{className:"-mx-2 -my-2 bg-transparent px-1 font-semibold",children:[(0,ei.jsx)($.E,{disabled:l!==f.r3.OWNER,label:a.formatMessage({id:"gizmo.discovery.browsingAsOwnerTooltip",defaultMessage:"Owners can access all third-party GPTs, even if they haven’t been approved."}),side:"bottom",children:(0,ei.jsx)(Q.Z.Value,{})}),(0,ei.jsx)(Q.Z.Icon,{})]}),(0,ei.jsx)(Q.Z.Portal,{children:(0,ei.jsxs)(Q.Z.Content,{children:[(0,ei.jsx)(Q.Z.Item,{value:f.r3.OWNER,children:(0,ei.jsx)(Z.Z,{id:"gizmo.discovery.browsingOwnerRole",defaultMessage:"workspace owner"})}),(0,ei.jsx)(Q.Z.Item,{value:f.r3.STANDARD,children:(0,ei.jsx)(Z.Z,{id:"gizmo.discovery.browsingMemberRole",defaultMessage:"workspace member"})})]})})]})}})]}):null}function eC(e){let{pageSearchRef:l,locale:n,setLocale:a,currAccount:i}=e,t=(0,w.AA)(),s=(0,R.useRouter)(),r=(0,E.Z)(),o=(0,S.w$)(),d=(0,Y.Q)(),{0:c,1:u}=(0,I.useState)(!1),{0:m,1:g}=(0,I.useState)(!1);(0,I.useEffect)(()=>{if(null==l||"function"==typeof l){u(!1);return}let e=null==l?void 0:l.current,n=new IntersectionObserver(l=>{l.forEach(l=>{l.target===e&&u(!l.isIntersecting)})},{root:null,rootMargin:"20px",threshold:.5});return null!=e&&n.observe(e),()=>{null!=e&&n.unobserve(e)}},[l]);let p=null==i?void 0:i.canCreateGizmos();return(0,ei.jsx)(ei.Fragment,{children:(0,ei.jsxs)(x.QT,{className:"z-30 mx-auto flex w-full justify-center gap-2 whitespace-nowrap pt-[1.125rem]",children:[(0,ei.jsxs)("div",{className:(0,D.default)("w-[calc((100%-768px)/2)] min-w-fit items-center",m?"hidden lg:flex":"flex"),children:[(0,ei.jsx)(J.M3,{}),(0,ei.jsx)($.u,{side:"right",label:n===k.AR.GLOBAL?r.formatMessage(e$.discoveryGlobalViewOn):r.formatMessage(e$.discoveryGlobalViewOff),children:(0,ei.jsx)(y.z,{color:"ghost",onClick:()=>{n===k.AR.GLOBAL?a(k.AR.ENGLISH):a(k.AR.GLOBAL)},children:(0,ei.jsx)(H.n9J,{className:(0,D.default)("icon-sm",n===k.AR.GLOBAL?"text-token-text-primary":"text-token-text-tertiary")})})})]}),(0,ei.jsx)(eI,{className:"max-w-3xl flex-grow",inputClassName:(0,D.default)("h-10 text-sm pl-9",!c&&"hidden"),iconClassName:"left-4",open:m,setOpen:g,resultsSizeOffset:-90,placeholder:o?r.formatMessage(e$.discoverySearch):r.formatMessage(e$.discoverySearchSmall)}),(0,ei.jsxs)("div",{className:(0,D.default)("w-[calc((100%-768px)/2)] min-w-fit justify-end gap-2",m?"hidden lg:flex":"flex"),children:[p&&(0,ei.jsx)(y.z,{color:"ghost",onClick:()=>{s.push("/gpts/mine",void 0,{shallow:!0}),F.A.logEvent(N.M.storeMyGizmos)},children:(0,ei.jsx)(Z.Z,es({},e$.discoveryMyGPTs))}),(0,ei.jsx)(eF,{canCreateGizmos:p,createUrl:t})]}),d&&(0,ei.jsx)(J.CT,{})]})})}let eF=e=>{var l;let{canCreateGizmos:n,createUrl:a}=e,{0:i,1:t}=(0,I.useState)(!1),s=(0,I.useRef)(),r=(0,G.Z)(),o=(0,b.t)(),d=null!==(l=null==o?void 0:o.planType)&&void 0!==l?l:"unknown",c="create_gpt";return(0,ei.jsxs)("div",{onMouseEnter:()=>{n||(F.A.logPopoverHover({location:eo,type:c,plan_type:d}),clearTimeout(s.current),t(!0))},onMouseLeave:()=>{n||(s.current=r(function(){t(!1)},300))},className:"relative",children:[(0,ei.jsx)(y.z,{color:"primary",disabled:!n,visuallyDisabled:!n,onClick:n?()=>F.A.logEvent(N.M.storeCreateGizmo):e=>e.preventDefault(),as:"link",to:a,icon:H.Vz5,children:(0,ei.jsx)(Z.Z,es({},e$.discoveryCreateGPT))}),!n&&i&&(0,ei.jsxs)("div",{className:"absolute right-0 z-10 mt-2 w-64 rounded-lg border border-token-border-light bg-token-main-surface-primary p-3 text-sm shadow-lg",children:[(0,ei.jsx)("p",{className:"mb-2 whitespace-normal break-words from-token-text-tertiary text-left font-normal",children:(0,ei.jsx)(Z.Z,es({},e$.createGPTUpsell))}),(0,ei.jsx)(y.z,{color:"secondary",onClick:()=>{F.A.logUpsellGetPlusButtonClicked({location:eo,type:c,plan_type:d}),(0,j.MG)("Gizmo Discovery page upsell")},size:"small",children:(0,ei.jsx)(Z.Z,es({},e$.createGPTUpsellButtonLabel))})]})]})},eN=(0,I.forwardRef)(function(e,l){let{info:n,items:a,effectiveRole:i}=e;return(0,ei.jsx)(eW,{title:n.title,description:n.description,ref:l,children:(0,ei.jsx)(er,{children:a.map((e,l)=>(0,ei.jsx)(eP,{resource:e,effectiveRole:i},"".concat(l,"-").concat(e.gizmo.id)))})})});function eP(e){var l,n,a,i;let{resource:t,effectiveRole:s}=e,r=null===(l=t.gizmo.vanity_metrics)||void 0===l?void 0:l.num_conversations_str,o=(null===(n=t.gizmo.tags)||void 0===n?void 0:n.includes(k.U9.WorkspaceDisabled))&&s!==f.r3.OWNER;return(0,ei.jsx)(ea.h9,{children:(0,ei.jsxs)(ed,{gizmo:t,className:(0,D.default)("group flex h-24 items-center gap-5 overflow-hidden rounded-xl bg-gray-50 px-7 py-8 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-white/10 md:h-32 lg:h-36",o&&"opacity-50 hover:opacity-100"),onClick:()=>{F.A.logEvent(N.M.storeClickGizmo,{gizmo_id:t.gizmo.id,section:"featured"})},children:[(0,ei.jsx)(en.Z,{isFirstParty:!!(null!==(a=t.gizmo.tags)&&void 0!==a&&a.includes(k.U9.FirstParty)),src:null!==(i=t.gizmo.display.profile_picture_url)&&void 0!==i?i:void 0,className:(0,D.default)("h-16 w-16 flex-shrink-0 md:h-24 md:w-24",o&&"grayscale group-hover:grayscale-0")}),(0,ei.jsxs)("div",{className:"flex flex-col",children:[(0,ei.jsx)("div",{className:"line-clamp-2 font-semibold md:text-lg",children:t.gizmo.display.name}),(0,ei.jsx)("span",{className:"line-clamp-2 text-xs md:line-clamp-3",children:t.gizmo.display.description}),(0,ei.jsxs)("div",{className:"mt-1 line-clamp-1 flex justify-start gap-1 text-xs text-token-text-tertiary",children:[(0,ei.jsx)(el.Z,{gizmo:t,className:"text-xs",hideLink:!0}),r&&(0,ei.jsxs)(ei.Fragment,{children:[(0,ei.jsx)("span",{className:"text-[10px]",children:"•"}),(0,ei.jsx)(H.qZr,{className:"mt-0.5 h-3 w-3"}),r]})]})]})]})})}let eL=(0,I.forwardRef)(function(e,l){let{info:n,items:a,cursor:i,anon:t,effectiveRole:s,useFetchMoreQuery:r}=e,{0:o,1:d}=(0,I.useState)(0===a.length),{data:c,hasNextPage:u,fetchNextPage:m,isFetchingNextPage:g,isError:p}=r({cutId:n.id,locale:n.locale,limit:6,cursor:i,enabled:o});(0,I.useEffect)(()=>{0===a.length&&m()},[m,a.length]);let{0:f,1:v}=(0,I.useState)(c.length),h=(0,I.useRef)(null),x=function(e=.1,{startDelay:l=0,from:n=0,ease:a}={}){return(i,t)=>{let s=e*Math.abs(("number"==typeof n?n:function(e,l){if("first"===e)return 0;{let n=l-1;return"last"===e?n:n/2}}(n,t))-i);if(a){let l=t*e;s=(0,T.R)(a)(s/l)*l}return l+s}}(.1);return(0,I.useEffect)(()=>{if(c.length>f){var e;v(c.length),null===(e=h.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"})}},[c.length,f]),(0,ei.jsxs)(eW,{title:n.title,description:n.description,ref:l,children:[(0,ei.jsxs)(er,{children:[a.map((e,l)=>(0,ei.jsx)(eD,{resource:e,rank:l+1,cutId:n.id,effectiveRole:s},l)),c.map((e,l)=>(0,ei.jsx)(eD,{resource:e,rank:a.length+l+1,cutId:n.id,delay:x(l-f,c.length-f),effectiveRole:s},l))]}),(!o||u||g||p)&&!t&&null!=i&&(0,ei.jsx)(y.z,{color:p?"danger-outline":"secondary",onClick:()=>{d(!0),F.A.logEvent(N.M.storeLoadMore,{section:n.id}),m()},fullWidth:!0,className:"mt-2 md:mt-3",loading:g,children:p?(0,ei.jsx)(Z.Z,es({},e$.discoveryLoadMoreError)):(0,ei.jsx)(Z.Z,es({},e$.discoveryLoadMore))}),(0,ei.jsx)("div",{ref:h})]})});function eD(e){var l,n;let{resource:a,rank:i,cutId:t,delay:s,effectiveRole:r}=e,o=(null===(l=a.gizmo.tags)||void 0===l?void 0:l.includes(k.U9.WorkspaceDisabled))&&r!==f.r3.OWNER,d=null===(n=a.gizmo.tags)||void 0===n?void 0:n.includes(k.U9.FirstParty);return(0,ei.jsx)(ea.h9,{delay:s,children:(0,ei.jsxs)(ed,{gizmo:a,className:(0,D.default)("group flex h-[104px] items-center gap-2.5 overflow-hidden rounded-xl px-1 py-4 hover:bg-token-main-surface-secondary md:px-3 md:py-4 lg:px-3",o&&"opacity-50 hover:opacity-100"),onClick:()=>{F.A.logEvent(N.M.storeClickGizmo,{gizmo_id:a.gizmo.id,position:i,section:d?"first_party":t})},children:[(0,ei.jsx)("div",{className:"text-md flex w-8 shrink-0 items-center justify-center font-semibold",children:i}),(0,ei.jsx)(eR,{resource:a,grayedOut:o})]},a.gizmo.id)})}let eT=void 0!==o?o:o=n(97448),eM=void 0!==d?d:d=n(25173),eO=void 0!==c?c:c=n(71330),eK=void 0!==u?u:u=n(19798);function eR(e){var l,n,a;let{resource:i,grayedOut:t,className:s}=e,r=null===(l=i.gizmo.vanity_metrics)||void 0===l?void 0:l.num_conversations_str;return(0,ei.jsxs)("div",{className:(0,D.default)("flex w-full flex-grow items-center gap-4 overflow-hidden",s),children:[(0,ei.jsx)(en.Z,{isFirstParty:!!(null!==(n=i.gizmo.tags)&&void 0!==n&&n.includes(k.U9.FirstParty)),src:null!==(a=i.gizmo.display.profile_picture_url)&&void 0!==a?a:void 0,className:(0,D.default)("h-12 w-12 flex-shrink-0",t&&"grayscale group-hover:grayscale-0")}),(0,ei.jsxs)("div",{className:"overflow-hidden text-ellipsis break-words",children:[(0,ei.jsx)("span",{className:"line-clamp-2 text-sm font-semibold leading-tight",children:i.gizmo.display.name}),(0,ei.jsx)("span",{className:"line-clamp-3 text-xs",children:i.gizmo.display.description}),(0,ei.jsxs)("div",{className:"mt-1 flex items-center gap-1 text-ellipsis whitespace-nowrap pr-1 text-xs text-token-text-tertiary",children:[(0,ei.jsx)(el.Z,{gizmo:i,className:"text-xs",hideLink:!0}),r&&(0,ei.jsxs)(ei.Fragment,{children:[(0,ei.jsx)("span",{className:"text-[8px]",children:"•"}),(0,ei.jsx)(H.qZr,{className:"h-3 w-3"}),r]})]})]})]})}let eI=(0,I.forwardRef)(function(e,l){var n,a;let{className:i,inputClassName:t,iconClassName:s,open:r,setOpen:o,resultsSizeOffset:d,placeholder:c,effectiveRole:u,onSelect:m}=e,g=(0,E.Z)(),{0:p,1:f}=(0,I.useState)(""),{0:y,1:v}=(0,I.useState)(""),{0:h,1:x}=(0,I.useState)(!1),k=null!=r?r:h,j=null!=o?o:x,z=(0,I.useRef)(null),S=null===(n=(0,L.sB)("gizmos-use-graphql-web"))||void 0===n?void 0:n.value,w=null===(a=(0,b.t)())||void 0===a?void 0:a.isWorkspaceAccount(),G=(0,L.sB)("chatgpt-gizmo-workspace-search-results").value,P=void 0!==w&&w&&G;(0,I.useEffect)(()=>{if(!k)return;let e=e=>{if("Escape"===e.key){var l;j(!1),null===(l=z.current)||void 0===l||l.blur()}},n=e=>{var n;e.target instanceof Node&&"function"!=typeof l&&!(null!=l&&null!==(n=l.current)&&void 0!==n&&n.contains(e.target))&&j(!1)};return document.addEventListener("keydown",e,!1),document.addEventListener("mousedown",n,!1),()=>{document.removeEventListener("keydown",e,!1),document.removeEventListener("mousedown",n,!1)}},[k,j,z,l]);let{0:T,1:M}=(0,I.useState)();(0,I.useEffect)(()=>{var e;let l=()=>{var e;M(null===(e=window.visualViewport)||void 0===e?void 0:e.height)};return null===(e=window.visualViewport)||void 0===e||e.addEventListener("resize",l),l(),()=>{var e;null===(e=window.visualViewport)||void 0===e||e.removeEventListener("resize",l)}},[M]);let{0:O,1:K}=(0,I.useState)(!1);(0,I.useEffect)(()=>{O&&!k&&j(!0)},[O,j,k]);let[R,Z]=(0,_.useQueryLoader)(eT),[A,U]=(0,_.useQueryLoader)(eO),[q,V]=(0,_.useQueryLoader)(eM);return(0,I.useEffect)(()=>{S&&U({skip:!S})},[U,S]),(0,I.useEffect)(()=>{let e=setTimeout(()=>{v(p),S&&(Z({q:p,skip:0===p.length}),V({q:p,skip:0===p.length||!P}))},250);return()=>{clearTimeout(e)}},[p,S,Z,V,P]),(0,ei.jsxs)(C.J,{as:"div",className:(0,D.default)("group relative rounded-xl",i),ref:l,children:[(0,ei.jsx)(H.W1M,{className:(0,D.default)("pointer-none icon-md absolute top-0 h-full text-token-text-tertiary",s)}),(0,ei.jsx)("input",{className:(0,D.default)("z-10 w-full rounded-xl border border-token-border-light bg-token-main-surface-primary py-2 pr-3 font-normal outline-0 delay-100","",t),placeholder:null!=c?c:g.formatMessage(e$.discoverySearch),value:p,onChange:e=>f(e.target.value),onFocus:()=>{j(!0),F.A.logEvent(N.M.searchOpened)},ref:z}),(0,ei.jsx)(B.m,{show:k,children:(0,ei.jsxs)(C.J.Panel,{static:!0,className:"absolute top-[calc(100%-10px)] w-full overflow-y-auto rounded-lg rounded-t-none border border-t-0 border-token-border-light bg-token-main-surface-primary px-3 py-2",style:{maxHeight:null!=T?T+(null!=d?d:0):"100vh"},children:[S&&(0,ei.jsx)(I.Suspense,{fallback:(0,ei.jsx)(eZ,{}),children:R&&A&&q&&(0,ei.jsx)(eE,{debouncedQuery:y,searchQueryReference:R,recentQueryReference:A,workspaceQueryReference:q,effectiveRole:u,setPopoverForceOpen:K,onSelect:m,showWorkspaceResults:P})}),!S&&(0,ei.jsx)(eA,{query:y,effectiveRole:u,setPopoverForceOpen:K,onSelect:m,showWorkspaceResults:P})]})})]})});function eZ(){return(0,ei.jsx)("div",{className:"flex items-center justify-center py-1",children:(0,ei.jsx)(v.Z,{})})}function eE(e){let{searchQueryReference:l,recentQueryReference:n,workspaceQueryReference:a,effectiveRole:i,debouncedQuery:t,setPopoverForceOpen:s,onSelect:r,showWorkspaceResults:o}=e,{0:d,1:c}=(0,I.useState)("ALL"),{0:u,1:m}=(0,I.useState)(!0),{0:g,1:p}=(0,I.useState)(o),{0:f,1:y}=(0,I.useState)(null),{0:v,1:h}=(0,I.useState)(null),{0:x,1:k}=(0,I.useState)(null),{0:j,1:b}=(0,I.useState)(null),{0:z,1:S}=(0,I.useState)(null),{0:w,1:G}=(0,I.useState)(!0);(0,I.useEffect)(()=>{F.A.logEvent(N.M.searchStart)},[]),(0,I.useEffect)(()=>{h(null),b(null)},[t]);let C=(0,_.usePreloadedQuery)(eT,l),P=(0,_.usePreloadedQuery)(eO,n),L=(0,_.usePreloadedQuery)(eM,a);(0,I.useEffect)(()=>{m(!0)},[t]);let D=(0,I.useCallback)(e=>{var l,n,a,i,t,s,r,o,d,c,u,m;let g=(0,_.readInlineData)(eK,e);return g?{gizmo:{id:g.legacyId,author:{display_name:null!==(l=null===(n=g.author)||void 0===n?void 0:n.displayName)&&void 0!==l?l:null,link_to:null!==(a=null===(i=g.author)||void 0===i?void 0:i.linkTo)&&void 0!==a?a:null,user_id:null!==(t=null===(s=g.author)||void 0===s?void 0:s.userId)&&void 0!==t?t:null},display:{name:g.display.name,description:null!==(r=g.display.description)&&void 0!==r?r:null,profile_picture_url:null!==(o=g.display.profilePictureUrl)&&void 0!==o?o:null},vanity_metrics:{num_conversations_str:null!==(d=null===(c=g.vanityMetrics)||void 0===c?void 0:c.numConversationsStr)&&void 0!==d?d:void 0},tags:null!==(u=null===(m=g.tags)||void 0===m?void 0:m.map(eQ))&&void 0!==u?u:null,short_url:g.shortUrl}}:null},[]);return(0,I.useEffect)(()=>{if(C){var e,l;m(!1),y((0,M.compact)(null===(e=C.gizmoSearch)||void 0===e||null===(e=e.edges)||void 0===e?void 0:e.map(e=>{var l;return D(null!==(l=null==e?void 0:e.node)&&void 0!==l?l:null)}))),null!==(l=C.gizmoSearch)&&void 0!==l&&null!==(l=l.pageInfo)&&void 0!==l&&l.endCursor&&h(C.gizmoSearch.pageInfo.endCursor)}},[C,D,h]),(0,I.useEffect)(()=>{if(L){var e,l;p(!1),k((0,M.compact)(null===(e=L.gizmoSearch)||void 0===e||null===(e=e.edges)||void 0===e?void 0:e.map(e=>{var l;return D(null!==(l=null==e?void 0:e.node)&&void 0!==l?l:null)}))),null!==(l=L.gizmoSearch)&&void 0!==l&&null!==(l=l.pageInfo)&&void 0!==l&&l.endCursor&&b(L.gizmoSearch.pageInfo.endCursor)}},[L,D,b]),(0,I.useEffect)(()=>{if(P){var e;G(!1),S((0,M.compact)(null===(e=P.gizmoDiscoveryCut)||void 0===e||null===(e=e.items)||void 0===e||null===(e=e.edges)||void 0===e?void 0:e.map(e=>{var l;return D(null!==(l=null==e?void 0:e.node)&&void 0!==l?l:null)})))}},[P,n,D]),(0,I.useEffect)(()=>{F.A.logEvent(N.M.searchStart)},[]),(0,ei.jsx)(e_,{debouncedQuery:t,searchResults:f,isLoadingSearch:u,searchResultsCursor:v,showWorkspaceResults:o,workspaceSearchResults:x,workspaceSearchResultsCursor:j,isLoadingWorkspaceSearch:g,isLoadingRecent:w,recent:z,effectiveRole:i,setPopoverForceOpen:s,onSelect:r,activeTab:d,setActiveTab:c})}function eA(e){var l;let{query:n,effectiveRole:a,setPopoverForceOpen:i,showWorkspaceResults:t,onSelect:s}=e,{0:r,1:o}=(0,I.useState)("ALL");(0,I.useEffect)(()=>{F.A.logEvent(N.M.searchStart)},[]);let{data:d,isLoading:c}=(0,h.K9)(n),{data:u,isLoading:m}=(0,h.M0)(n,t),{data:g,isLoading:p}=(0,h.Fi)({cutId:"recent",limit:3});return(0,ei.jsx)(e_,{debouncedQuery:n,searchResults:null==d?void 0:d.items,isLoadingSearch:c,searchResultsCursor:null==d?void 0:d.cursor,showWorkspaceResults:t,workspaceSearchResults:null==u?void 0:u.items,workspaceSearchResultsCursor:null==u?void 0:u.cursor,isLoadingWorkspaceSearch:m,isLoadingRecent:p,recent:null!==(l=null==g?void 0:g.pages.flatMap(e=>e.list.items.map(e=>e.resource)))&&void 0!==l?l:[],effectiveRole:a,setPopoverForceOpen:i,onSelect:s,activeTab:r,setActiveTab:o})}function e_(e){let{debouncedQuery:l,searchResults:n,isLoadingSearch:a,searchResultsCursor:i,showWorkspaceResults:t,workspaceSearchResults:s,workspaceSearchResultsCursor:r,isLoadingWorkspaceSearch:o,recent:d,isLoadingRecent:c,effectiveRole:u,setPopoverForceOpen:m,onSelect:g,activeTab:p,setActiveTab:f}=e,y=(0,I.useRef)((0,q.Z)());if((0,I.useEffect)(()=>{F.A.logEvent(N.M.searchStart)},[]),(0,I.useEffect)(()=>{!a&&n&&(y.current=(0,q.Z)(),n.length>0?Promise.all(n.map((e,n)=>{F.A.logEvent(N.M.searchDisplayResult,{search_id:y.current,gizmo_id:e.gizmo.id,position:n,query:l})})):F.A.logEvent(N.M.searchNoResults,{query:l}))},[n,a,l]),""===l&&c)return(0,ei.jsx)(eZ,{});if(t){if("ALL"===p&&a||"WORKSPACE"===p&&o)return(0,ei.jsx)(eZ,{});if(""!=l&&!a&&!o&&(!n||0===n.length)&&(!s||0===s.length))return(0,ei.jsx)("div",{className:"mx-2",children:(0,ei.jsx)(eU,{onClick:void 0,isSelected:void 0,isClickable:!1,children:(0,ei.jsx)(Z.Z,es({},e$.discoveryNoResultsSearch))})})}else{if(a)return(0,ei.jsx)(eZ,{});if(""!=l&&!a&&(!n||0===n.length))return(0,ei.jsx)("div",{className:"mx-2",children:(0,ei.jsx)(eU,{onClick:void 0,isSelected:void 0,isClickable:!1,children:(0,ei.jsx)(Z.Z,es({},e$.discoveryNoResultsSearch))})})}return(0,ei.jsxs)(ei.Fragment,{children:[(0,ei.jsx)(eq,{query:l,activeTab:p,setActiveTab:f,showWorkspaceResults:t,recentSearchResults:null!=d?d:[]}),(0,ei.jsx)(eB,{query:l,searchIdRef:y.current,searchResults:n,searchResultsCursor:i,isLoadingSearch:a,workspaceSearchResults:s,workspaceSearchResultsCursor:r,isLoadingWorkspaceSearch:o,recentSearchResults:null!=d?d:[],activeTab:p,setPopoverForceOpen:m,effectiveRole:u,onSelect:g})]})}function eU(e){let{children:l,onClick:n,isSelected:a,isClickable:i}=e;return(0,ei.jsx)("div",{className:"px-3 pb-2 text-xs text-token-text-tertiary ".concat(a?"border-b-2 font-bold":"font-semibold"," ").concat(i?"cursor-pointer":""),onClick:()=>{null==n||n()},children:l})}function eq(e){let{query:l,activeTab:n,setActiveTab:a,showWorkspaceResults:i,recentSearchResults:t}=e,s=(0,V.$3)();return""===l?t&&t.length>0?(0,ei.jsx)(eU,{onClick:void 0,isSelected:!1,isClickable:!1,children:(0,ei.jsx)(Z.Z,es({},e$.discoverySearchRecentlyUsed))}):(0,ei.jsx)(eU,{onClick:void 0,isSelected:void 0,isClickable:!1,children:(0,ei.jsx)(Z.Z,es({},e$.discoverySearchRecentlyUsedEmpty))}):(0,ei.jsxs)("div",{className:"flex",children:[(0,ei.jsx)(eU,{onClick:()=>a("ALL"),isSelected:"ALL"===n&&i,isClickable:i,children:(0,ei.jsx)(Z.Z,es({},e$.discoveryAllResultsHeader))}),i&&(0,ei.jsx)(eU,{onClick:()=>a("WORKSPACE"),isSelected:"WORKSPACE"===n,isClickable:!0,children:(0,ei.jsx)(Z.Z,es(es({},e$.discoveryWorkspaceResultsHeader),{},{values:{workspaceName:s}}))})]})}function eB(e){var l,n;let{query:a,searchIdRef:i,searchResults:t,searchResultsCursor:s,isLoadingSearch:r,workspaceSearchResults:o,workspaceSearchResultsCursor:d,isLoadingWorkspaceSearch:c,recentSearchResults:u,setPopoverForceOpen:m,activeTab:g,effectiveRole:p,onSelect:f}=e,{0:v,1:x}=(0,I.useState)(!1),k=(0,h.DS)(a,v,"WORKSPACE"===g,"WORKSPACE"===g?d:s),{data:j,hasNextPage:b,fetchNextPage:z,isFetchingNextPage:S,isError:w}=es(es({},k),{},{data:null!==(l=null===(n=k.data)||void 0===n?void 0:n.pages.flatMap(e=>e.items.map(e=>e)))&&void 0!==l?l:[]}),{0:G,1:C}=(0,I.useState)(j.length),F=(0,I.useRef)(null);return((0,I.useEffect)(()=>{if(j.length>G){var e;C(j.length),null===(e=F.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"nearest"})}},[j.length,G]),""===a&&u&&u.length>0)?(0,ei.jsx)(ei.Fragment,{children:u.map((e,l)=>(0,ei.jsx)(eV,{searchId:i,position:l,query:a,resource:e,effectiveRole:p,setPopoverForceOpen:m,onSelect:f},e.gizmo.id))}):(""===a||r||"ALL"!==g||null!=t&&0!==t.length)&&(""===a||c||"WORKSPACE"!==g||null!=o&&0!==o.length)?(0,ei.jsx)("div",{children:"ALL"===g?(0,ei.jsxs)("div",{children:[t&&t.map((e,l)=>(0,ei.jsx)(eV,{searchId:i,position:l,query:a,resource:e,effectiveRole:p,setPopoverForceOpen:m,onSelect:f},e.gizmo.id)),t&&j&&j.map((e,l)=>(0,ei.jsx)(eV,{searchId:i,position:l+(null==t?void 0:t.length),query:a,resource:e,effectiveRole:p,setPopoverForceOpen:m,onSelect:f},e.gizmo.id)),(!v&&0===j.length||b||S||w)&&null!=s&&(0,ei.jsx)(y.z,{color:w?"danger-outline":"secondary",onClick:()=>{x(!0),z(),null==m||m(!0)},loading:S,fullWidth:!0,className:"mt-2 md:mt-3",children:w?(0,ei.jsx)(Z.Z,es({},e$.discoveryLoadMoreError)):(0,ei.jsx)(Z.Z,es({},e$.discoveryLoadMore))})]}):(0,ei.jsxs)("div",{children:[o&&o.map((e,l)=>(0,ei.jsx)(eV,{searchId:i,position:l,resource:e,query:a,setPopoverForceOpen:m},e.gizmo.id)),o&&j&&j.map((e,l)=>(0,ei.jsx)(eV,{searchId:i,position:l+(null==o?void 0:o.length),query:a,resource:e,effectiveRole:p,setPopoverForceOpen:m,onSelect:f},e.gizmo.id)),(!v&&0===j.length||b||S||w)&&null!=d&&(0,ei.jsx)(y.z,{color:w?"danger-outline":"secondary",onClick:()=>{x(!0),z(),null==m||m(!0)},fullWidth:!0,className:"mt-2 md:mt-3",loading:S,children:w?(0,ei.jsx)(Z.Z,es({},e$.discoveryLoadMoreError)):(0,ei.jsx)(Z.Z,es({},e$.discoveryLoadMore))})]})}):(0,ei.jsx)("div",{className:"mt-4 px-3 pb-2 text-xs font-semibold text-token-text-tertiary",children:(0,ei.jsx)(Z.Z,es({},e$.discoveryNoResultsSearch))})}function eV(e){var l,n,a,i;let{searchId:t,resource:s,position:r,query:o,effectiveRole:d,setPopoverForceOpen:c,onSelect:u}=e,m=null===(l=s.gizmo.vanity_metrics)||void 0===l?void 0:l.num_conversations_str,g=(0,S.oc)(),p=(null===(n=s.gizmo.tags)||void 0===n?void 0:n.includes(k.U9.WorkspaceDisabled))&&d!==f.r3.OWNER;return(0,ei.jsxs)(ed,{gizmo:s,className:(0,D.default)("group mx-2 flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-gray-50 dark:hover:bg-white/10",p&&"opacity-50 hover:opacity-100"),onClick:()=>{u?u(s):F.A.logEvent(N.M.storeClickGizmo,{search_id:t,gizmo_id:s.gizmo.id,position:r,query:o,section:"search"})},onModalOpen:()=>{null==c||c(!0)},onModalClose:()=>{null==c||c(!1)},selectOnly:!!u,children:[(0,ei.jsx)(en.Z,{isFirstParty:!!(null!==(a=s.gizmo.tags)&&void 0!==a&&a.includes(k.U9.FirstParty)),src:null!==(i=s.gizmo.display.profile_picture_url)&&void 0!==i?i:void 0,className:(0,D.default)("h-8 w-8 shrink-0",p&&"grayscale group-hover:grayscale-0")}),(0,ei.jsxs)("div",{className:"flex flex-col space-y-1 truncate",children:[(0,ei.jsx)("div",{className:"flex flex-row items-end space-x-2",children:(0,ei.jsx)("span",{className:"shrink-0 truncate text-sm font-semibold",children:s.gizmo.display.name})}),g&&(0,ei.jsx)("span",{className:"max-w-md truncate text-xs text-token-text-tertiary",children:s.gizmo.display.description}),(0,ei.jsxs)("div",{className:"flex gap-2",children:[(0,ei.jsx)("div",{className:"-mt-1",children:(0,ei.jsx)(el.Z,{gizmo:s,className:"truncate text-xs text-token-text-tertiary",hideLink:!0})}),m&&(0,ei.jsx)(ei.Fragment,{children:(0,ei.jsxs)("div",{className:"flex items-center gap-1 font-semibold text-token-text-tertiary",children:[(0,ei.jsx)(H.qZr,{className:"icon-xs"}),(0,ei.jsx)("span",{className:"line-clamp-1 text-xs",children:m})]})})]})]})]})}let eW=(0,I.forwardRef)(function(e,l){let{title:n,description:a,className:i,children:t}=e;return(0,ei.jsxs)("div",{ref:l,className:"h-fit scroll-mt-28 last:min-h-[calc(100vh-8rem)]",children:[(0,ei.jsxs)(ea.h9,{animateTap:!1,children:[(0,ei.jsx)("div",{className:"text-xl font-semibold md:text-2xl",children:n}),a&&(0,ei.jsx)("div",{className:"text-sm text-token-text-tertiary md:text-base",children:a})]}),(0,ei.jsx)("div",{className:(0,D.default)("mb-10 mt-4",i),children:t})]})});function eQ(e){switch(e){case"FIRST_PARTY":return k.U9.FirstParty;case"WORKSPACE_DISABLED":return k.U9.WorkspaceDisabled;case"USES_FUNCTION_CALLS":return k.U9.UsesFunctionCalls;case"BETA":return k.U9.Beta;case"PINNED":return k.U9.Pinned;case"PRIVATE":return k.U9.Private;case"PUBLIC":return k.U9.Public;case"REPORTABLE":return k.U9.Reportable;case"WORKSPACE":return k.U9.Workspace;default:return e}}(0,A.vU)({Writing:{id:"gizmo.categoryName.Writing",defaultMessage:"Writing"},Productivity:{id:"gizmo.categoryName.Productivity",defaultMessage:"Productivity"},"Research & Analysis":{id:"gizmo.categoryName.Research & Analysis",defaultMessage:"Research & Analysis"},Programming:{id:"gizmo.categoryName.Programming",defaultMessage:"Programming"},Education:{id:"gizmo.categoryName.Education",defaultMessage:"Education"},Lifestyle:{id:"gizmo.categoryName.Lifestyle",defaultMessage:"Lifestyle"}});let e$=(0,A.vU)({discoveryAllResultsHeader:{id:"gizmo.discovery.AllResultsHeader",defaultMessage:"All"},discoveryWorkspaceResultsHeader:{id:"gizmo.discovery.workspaceResultsHeaderName",defaultMessage:"{workspaceName} workspace"},discoveryEmpty:{id:"gizmo.discovery.empty",defaultMessage:"Nothing to discover"},discoveryNoResultsSearch:{id:"gizmo.discovery.search.empty",defaultMessage:"No results found"},discoveryError:{id:"gizmo.discovery.error",defaultMessage:"Error loading GPTs"},discoverySearch:{id:"gizmo.discovery.search",defaultMessage:"Search GPTs"},discoverySearchSmall:{id:"gizmo.discovery.searchSmall",defaultMessage:"Search"},discoverySearchRecentlyUsed:{id:"gizmo.discovery.search.recentlyUsed",defaultMessage:"Recently Used"},discoverySearchRecentlyUsedEmpty:{id:"gizmo.discovery.search.recentlyUsedEmpty",defaultMessage:"No recently used GPTs"},discoverySearchResults:{id:"gizmo.discovery.search.results",defaultMessage:"Search Results"},discoveryLoadMore:{id:"gizmo.discovery.loadMore",defaultMessage:"See more"},discoveryLoadMoreError:{id:"gizmo.discovery.loadMoreError",defaultMessage:"Error loading more"},discoveryMyGPTs:{id:"gizmo.discovery.myGPTs",defaultMessage:"My GPTs"},discoveryCreateGPT:{id:"gizmo.discovery.createGPT",defaultMessage:"Create"},discoveryThirdPartyGPTsDisabled:{id:"gizmo.discovery.thirdPartyGPTsDisabled",defaultMessage:"Your admin has blocked GPTs created outside {workspaceName}."},discoverySplashHeader:{id:"gizmo.discovery.splashHeader",defaultMessage:"GPTs"},discoverySplashDescription:{id:"gizmo.discovery.splashDescription",defaultMessage:"Discover and create custom versions of ChatGPT that combine instructions, extra knowledge, and any combination of skills."},discoveryGlobalViewOn:{id:"gizmo.discovery.globalViewOn",defaultMessage:"Global View On"},discoveryGlobalViewOff:{id:"gizmo.discovery.globalViewOff",defaultMessage:"Global View Off"},createdAgoLabel:{id:"gizmo.discovery.createdAgoLabel",defaultMessage:"Created {createdAgo}"},createGPTUpsell:{id:"gizmo.discovery.createGPTUpsell",defaultMessage:"Get ChatGPT Plus to create and share your own GPTs"},createGPTUpsellButtonLabel:{id:"gizmo.discovery.createGPTUpsellButtonLabel",defaultMessage:"Get Plus"}})},52899:function(e,l,n){n.d(l,{b:function(){return c}});var a=n(8649),i=n(49217),t=n(82823),s=n(94982),r=n(26123),o=n(72256),d=n(651);function c(e){let{gizmoId:l,onSuccess:n,onClose:c}=e,u=(0,r.Z)(),m=(0,t.kb)(),g=async()=>{try{await m.mutateAsync({gizmoId:l}),n()}catch{s.m.danger("Failed to delete gizmo. Please try again.")}};return(0,d.jsx)(i.Z,{isOpen:!0,onClose:c,type:"danger",title:(0,d.jsx)(o.Z,{id:"shLmv5",defaultMessage:"Delete GPT"}),primaryButton:(0,d.jsx)(a.Z.Button,{title:u.formatMessage({id:"nlWRPu",defaultMessage:"Delete GPT"}),color:"danger",loading:m.isPending,onClick:()=>{g()}}),secondaryButton:(0,d.jsx)(a.Z.Button,{title:u.formatMessage({id:"D4IuIb",defaultMessage:"Cancel"}),color:"secondary",onClick:c}),children:(0,d.jsx)("div",{className:"text-sm",children:(0,d.jsx)(o.Z,{id:"zIR+cK",defaultMessage:"Are you sure you want to delete this GPT? This cannot be undone."})})})}},17903:function(e,l,n){n.r(l),n.d(l,{GizmoConversationOptionsDropdown:function(){return ey},GizmoInformationDropdown:function(){return em},GizmoInformationDropdownItems:function(){return ep},GizmoKeepInSidebarMenuItem:function(){return ec},GizmoShareMenuItem:function(){return eu}});var a,i,t=n(94521),s=n(21904),r=n(81816),o=n(82823),d=n(5443),c=n(41854),u=n(49217),m=n(56029),g=n(94982),p=n(55371),f=n(24040),y=n(96053),v=n(92379),h=n(26123),x=n(72256),k=n(25940),j=n(651);function b(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);l&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function z(e){for(var l=1;l{var l;let{gizmo:n}=e,a=(0,f.aF)(),i=(0,p.EV)(p.B.GPTFeedbackEmail),t=()=>p.vm.closeModal(p.B.GPTFeedbackEmail),s=(0,h.Z)(),{0:r,1:o}=(0,v.useState)(""),{0:k,1:b}=(0,v.useState)(!0),w=(l=n.gizmo.id,(0,y.D)({mutationFn:async e=>{let{message:n,includeFrom:a}=e;await m.U.sendFeedbackEmail(l,n,a)}})),G=0===r.length;return(0,j.jsx)(u.Z,{type:"success",title:s.formatMessage(S.title,{name:n.gizmo.display.name}),isOpen:i,onClose:t,size:"custom",showCloseButton:!0,className:"max-w-xl overflow-y-auto",hideSeparator:!0,children:(0,j.jsx)("div",{className:"flex flex-row",children:(0,j.jsxs)("div",{className:"-mt-4 flex flex-grow flex-col space-y-4",children:[(0,j.jsx)(c.Z,{className:"mb-1 w-full resize-none overflow-y-auto rounded-md bg-transparent focus:border-gray-200 focus:ring-gray-200 dark:focus:border-white dark:focus:ring-white",placeholder:"Write feedback about ".concat(n.gizmo.display.name,"..."),value:r,rows:4,onChange:e=>o(e.target.value)}),(0,j.jsxs)("div",{className:"flex flex-row items-center space-x-2 self-start",children:[(0,j.jsx)("input",{type:"checkbox",checked:k,onChange:e=>b(e.target.checked)}),a&&(0,j.jsx)("span",{className:"text-sm",children:(0,j.jsx)(x.Z,z(z({},S.includeFrom),{},{values:{email:(0,j.jsx)("strong",{children:a.email})}}))})]}),(0,j.jsx)(d.z,{color:"primary",disabled:G,onClick:async()=>{await w.mutateAsync({message:r,includeFrom:k}),g.m.success(s.formatMessage(S.successToast),{duration:3}),t()},children:(0,j.jsx)(x.Z,z(z({},S.send),{},{values:{name:n.gizmo.author.display_name}}))})]})})})},G=n(41141),C=n(35226),F=n(50684),N=n(93223),P=n(16054),L=n(19841),D=n(74091),T=n(92426);function M(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);l&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function O(e){for(var l=1;l{let{actionId:l,domain:n,settings:a}=e;return m.U.upsertUserActionSettings(l,n,a)},onSuccess:()=>{l.invalidateQueries({queryKey:["gizmo","userActionSettings",{gizmoId:e}]})}})}(i),o=null===(l=t.action_settings)||void 0===l?void 0:l.all,d=e=>{var l,n;null!==(l=s.metadata)&&void 0!==l&&l.action_id&&null!==(n=s.metadata)&&void 0!==n&&n.domain&&r.mutateAsync({actionId:s.metadata.action_id,domain:s.metadata.domain,settings:{all:e}})};return(0,j.jsx)("div",{children:(0,j.jsxs)(E,{className:"border-b border-black/10 dark:border-white/10",children:[(0,j.jsxs)("div",{className:"flex flex-row space-x-4",children:[(0,j.jsx)("div",{className:"font-semibold",children:null===(n=s.metadata)||void 0===n?void 0:n.domain}),(0,j.jsxs)("a",{href:null===(a=s.metadata)||void 0===a?void 0:a.privacy_policy_url,target:"_blank",rel:"noreferrer",className:"flex items-center gap-1 text-token-text-tertiary hover:cursor-pointer hover:text-token-text-secondary",children:[(0,j.jsx)(x.Z,O({},A.privacyPolicyLink)),(0,j.jsx)(T.Pfi,{className:"icon-md"})]})]}),(0,j.jsxs)("select",{value:o?"always_allow":"unset",onChange:e=>d(e.target.value),className:"rounded border-none bg-token-main-surface-primary text-sm",children:[(0,j.jsx)("option",{value:"always_allow",children:(0,j.jsx)(x.Z,O({},A.alwaysAllowDropdown))}),(0,j.jsx)("option",{value:"unset",children:(0,j.jsx)(x.Z,O({},A.askDropdown))})]})]})})}function I(e){var l;let{gizmoId:n,actionSettings:a,actionTool:i}=e,t=function(e){let l=(0,C.NL)();return(0,y.D)({mutationFn:async e=>{let{pluginId:l}=e;await N.Z.deletePluginUserSettings({pluginId:l})},onSuccess:()=>{l.invalidateQueries({queryKey:["gizmo","userActionSettings",{gizmoId:e}]})}})}(n),s="valid"===a.oauth_status;return(0,j.jsxs)(E,{children:[(0,j.jsx)("div",{className:"font-semibold",children:null==i||null===(l=i.metadata)||void 0===l?void 0:l.domain}),(0,j.jsx)(d.z,{color:"secondary",size:"small",onClick:()=>{var e,l,a,r,o;null!==(e=i.metadata)&&void 0!==e&&e.action_id&&null!==(l=i.metadata)&&void 0!==l&&l.domain&&(s?t.mutateAsync({pluginId:null===(a=i.metadata)||void 0===a?void 0:a.action_id}):m.U.doOAuthRedirect(n,null===(r=i.metadata)||void 0===r?void 0:r.action_id,null===(o=i.metadata)||void 0===o?void 0:o.domain,window.location.href))},children:(0,j.jsx)(x.Z,O({},s?A.logout:A.login))})]})}let Z=D.Z.div(a||(a=(0,G.Z)(["flex flex-col gap-6"]))),E=D.Z.div(i||(i=(0,G.Z)(["flex flex-row justify-between py-3 items-center"]))),A=(0,k.vU)({title:{defaultMessage:"GPT's privacy settings",id:"GizmoPrivacySettings.title"},actions:{defaultMessage:"Actions",id:"GizmoPrivacySettings.actions"},connectedAccounts:{defaultMessage:"Connected accounts",id:"GizmoPrivacySettings.connectedAccounts"},connectedAccountsDesc:{defaultMessage:"Manage which 3rd party accounts can be accessed by {gizmoName}.",id:"GizmoPrivacySettings.connectedAccountsDesc"},allowedActionsTitle:{defaultMessage:"GPT's privacy settings",id:"GizmoPrivacySettings.allowedActionsTitle"},allowedActionsDesc:{defaultMessage:"Select which 3rd party actions are allowed in conversations with {gizmoName}.",id:"GizmoPrivacySettings.allowedActionsDesc"},privacyPolicyLink:{defaultMessage:"Privacy policy",id:"GizmoPrivacySettings.privacyPolicyLink"},alwaysAllowDropdown:{defaultMessage:"Always allow",id:"GizmoPrivacySettings.alwaysAllowDropdown"},askDropdown:{defaultMessage:"Ask",id:"GizmoPrivacySettings.askDropdown"},login:{defaultMessage:"Log in",id:"GizmoPrivacySettings.login"},logout:{defaultMessage:"Log out",id:"GizmoPrivacySettings.logout"}});var _=e=>{let{gizmo:l}=e,{data:n,isLoading:a}=(0,o.Wd)(l.gizmo.id,!0),i=(0,p.EV)(p.B.GPTPrivacySettings),t=(0,h.Z)(),{0:r,1:d}=(0,v.useState)("actions"),c=null!=n&&n.settings.some(e=>null!=e.oauth_status&&l.tools.some(l=>{var n;return l.type===s.qK.JIT_PLUGIN&&(null===(n=l.metadata)||void 0===n?void 0:n.action_id)===e.action_id}));return"connected_accounts"!==r||c||d("actions"),(0,j.jsx)(u.Z,{title:t.formatMessage(A.title),isOpen:i,onClose:()=>p.vm.closeModal(p.B.GPTPrivacySettings),type:"success",size:"custom",className:"min-h-[50vh] max-w-3xl overflow-y-auto scroll-smooth",noPadding:!0,showCloseButton:!0,children:a?(0,j.jsx)(F.Z,{}):(0,j.jsxs)(P.fC,{className:"flex flex-row gap-6 p-4",orientation:"vertical",defaultValue:r,onValueChange:e=>{d(e)},children:[c&&(0,j.jsxs)(P.aV,{className:(0,L.default)("flex min-w-[180px] max-w-[200px] flex-shrink-0 flex-col gap-2"),children:[(0,j.jsx)(K,{value:"actions",message:A.actions}),c&&(0,j.jsx)(K,{value:"connected_accounts",message:A.connectedAccounts})]}),(0,j.jsxs)("div",{className:"flex-1 text-sm",children:["actions"===r&&(0,j.jsxs)(Z,{children:[(0,j.jsx)(x.Z,O(O({},A.allowedActionsDesc),{},{values:{gizmoName:l.gizmo.display.name}})),null==n?void 0:n.settings.map((e,n)=>{var a;let i=null===(a=l.tools)||void 0===a?void 0:a.find(l=>{var n;return l.type===s.qK.JIT_PLUGIN&&(null===(n=l.metadata)||void 0===n?void 0:n.action_id)===e.action_id});return i&&(0,j.jsx)(R,{gizmoId:l.gizmo.id,actionSettings:e,actionTool:i},n)})]}),"connected_accounts"===r&&(0,j.jsxs)(Z,{children:[(0,j.jsx)(x.Z,O(O({},A.connectedAccountsDesc),{},{values:{gizmoName:l.gizmo.display.name}})),(0,j.jsx)("div",{children:null==n?void 0:n.settings.map((e,n)=>{var a;let i=null===(a=l.tools)||void 0===a?void 0:a.find(l=>{var n;return l.type===s.qK.JIT_PLUGIN&&(null===(n=l.metadata)||void 0===n?void 0:n.action_id)===e.action_id});return i&&e.oauth_status&&(0,j.jsx)(I,{gizmoId:l.gizmo.id,actionSettings:e,actionTool:i},n)})})]})]})]})})},U=n(9085),q=n(16645),B=n(4702),V=n(27603),W=n(86021),Q=n(54538),$=n(32512),H=n(27860),J=n(93747),Y=n(48538),X=n(59031),ee=n(48580),el=n(43128),en=n(87200),ea=n(67165),ei=n(73746),et=n(40766),es=n(70410),er=n(75438);function eo(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);l&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function ed(e){for(var l=1;l{m.U.updateGizmoSidebar(t,l.gizmo.id,n?"hide":"keep")},icon:n?T.Xl7:T.qQX,children:i})}function eu(e){let{gizmoResource:l}=e,{0:n,1:a}=(0,v.useState)(!1);return l.gizmo.share_recipient===q.Zz.Private?null:(0,j.jsx)(ea.Z.Item,{onClick:async e=>{e.stopPropagation(),e.preventDefault();try{let e=l.gizmo.short_url?(0,o.AG)(l.gizmo.short_url):"".concat("https://chatgpt.com").concat((0,o.m_)(l));await (0,Y.v)(e),a(!0),setTimeout(()=>{a(!1)},2e3)}catch(e){X.U.addError(e);return}},icon:T.xPt,children:n?(0,j.jsx)(x.Z,ed({},ev.copiedURL)):(0,j.jsx)(x.Z,ed({},ev.copyLink))})}function em(e){let{children:l,clientThreadId:n,gizmoResource:a,showReportModal:i,inMobileHeader:t}=e;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ea.d,{contentAlign:t?"center":"start",size:"small",triggerButton:l,children:(0,j.jsx)(ep,{clientThreadId:n,gizmoResource:a,showReportModal:i})}),(0,j.jsx)(eg,{gizmoResource:a})]})}function eg(e){let{gizmoResource:l}=e,n=(0,p.EV)(p.B.GPTRemoveThirdParty),a=(0,B.t)(),i=(0,q.q0)(l);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(et.j4,{gizmoId:l.gizmo.id,creatorId:l.gizmo.author.user_id}),(0,j.jsx)(_,{gizmo:l}),i&&(0,j.jsx)(w,{gizmo:l}),i&&(0,j.jsx)(es.Z,{gizmo:l}),(0,j.jsx)(en.Z,{gpt:l,isOpen:n,onClose:()=>p.vm.closeModal(p.B.GPTRemoveThirdParty),account:a})]})}function ep(e){var l;let{clientThreadId:n,gizmoResource:a,showReportModal:i}=e,t=(0,el.useRouter)(),d=(0,er.k1)(a),c=(0,er.R2)(a),u=(0,H.xj)(a.gizmo.id),g=(0,B.hz)(),f=(0,q.yS)(a),y=a.gizmo.share_recipient===q.Zz.Marketplace||a.gizmo.share_recipient===q.Zz.Link,v=(0,ee.sB)("chatgpt-gizmo-reviews").value,h=(0,ee.sB)("chatgpt-gizmo-version-history").value,k=v&&!f&&(0,q.q0)(a),b=(null==g?void 0:g.includes(V.L0.GizmoSupportEmails))&&!f&&a.gizmo.author.will_receive_support_emails&&k,z=(0,B.S0)(),S=(0,W.XK)(n),w=(0,r.C)(V.L0.WorkspaceShareLinks),{isUnauthenticated:G}=(0,Q.u)(),C=S&&w&&!G;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ea.Z.Item,{onClick:()=>{J.A.logNewChatButtonClicked({location:"Gizmo information dropdown",gizmo_id:a.gizmo.id}),t.push("/g/".concat(a.gizmo.short_url))},icon:T.bl$,children:(0,j.jsx)(x.Z,ed({},ev.newChat))}),(0,j.jsx)(ea.Z.Item,{onClick:()=>p.vm.openModal(p.B.GPTDetails),icon:T.szr,children:(0,j.jsx)(x.Z,ed({},ev.about))}),(null===(l=a.tools)||void 0===l?void 0:l.find(e=>e.type===s.qK.JIT_PLUGIN))&&(0,j.jsx)(ea.Z.Item,{onClick:()=>p.vm.openModal(p.B.GPTPrivacySettings),icon:T.oVl,children:(0,j.jsx)(x.Z,ed({},ev.privacySettings))}),d&&(0,j.jsx)(ea.Z.Item,{onClick:()=>{t.push(u,void 0,{shallow:!0})},icon:T.SWE,children:(0,j.jsx)(x.Z,ed({},ev.customize))}),!d&&c&&h&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ea.Z.Item,{onClick:async()=>{t.push("/g/".concat(a.gizmo.id,"/view"))},icon:T.tEF,children:(0,j.jsx)(x.Z,{id:"GizmoInformation.viewGizmoLabel",defaultMessage:"View configuration"})}),(0,j.jsx)(ea.Z.Item,{onClick:async()=>{let e=await m.U.copyGizmo({gizmoId:a.gizmo.id});e.gizmo.id&&t.push("/gpts/editor/".concat(e.gizmo.id))},icon:T.TIy,children:(0,j.jsx)(x.Z,{id:"GizmoInformation.copyGizmoLabel",defaultMessage:"Duplicate GPT"})})]}),(0,j.jsx)(ec,{gizmoResource:a}),(0,j.jsx)(eu,{gizmoResource:a}),b&&(0,j.jsx)(ea.Z.Item,{onClick:()=>p.vm.openModal(p.B.GPTFeedbackEmail),icon:T.kBi,children:(0,j.jsx)(x.Z,ed({},ev.feedbackEmail))}),k&&(0,j.jsx)(ea.Z.Item,{onClick:()=>p.vm.openModal(p.B.GPTReview),icon:T.qtd,children:(0,j.jsx)(x.Z,ed({},ev.reviewGPT))}),!f&&y&&(0,j.jsx)(ea.Z.Item,{onClick:i,icon:T.U65,children:(0,j.jsx)(x.Z,ed({},ev.report))}),C&&(0,j.jsx)(ea.Z.Item,{onClick:()=>p.vm.openSharingModal(S),icon:T.aAc,children:(0,j.jsx)(x.Z,ed({},ev.shareChat))}),z&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ea.Z.Separator,{}),(0,j.jsx)(ea.Z.Item,{color:"danger",onClick:()=>p.vm.openModal(p.B.GPTRemoveThirdParty),icon:T.tPq,children:(0,j.jsx)(x.Z,{defaultMessage:"Remove GPT from workspace",id:"GizmoInformation.removeGPT"})})]}),(null==g?void 0:g.includes("debug"))&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ea.Z.Separator,{}),(0,j.jsx)(ea.Z.Item,{onClick:()=>{t.push((0,o.i6)(a),void 0)},children:"(Internal) See share page"})]})]})}let ef=e=>{let{clientThreadId:l}=e,n=(0,B.hz)(),a=null==n?void 0:n.includes("debug"),i=W.tQ.getServerThreadId(l),t=(0,r.C)(V.L0.WorkspaceShareLinks),{isUnauthenticated:s}=(0,Q.u)(),o=t&&i&&!s,d=(0,ei.Q)(),c=(0,ee.it)("chatgpt_web_archive_chat").config.get("ui_placement","sidebar");return d&&(c="dropdown"),(0,j.jsxs)(j.Fragment,{children:[o&&(0,j.jsx)(ea.Z.Item,{onClick:()=>p.vm.openSharingModal(i,"History Item Menu"),icon:T.aAc,children:(0,j.jsx)(x.Z,ed({},ev.shareChat))}),(0,j.jsx)(ea.Z.Item,{disabled:!i,onClick:()=>{setTimeout(()=>{i&&$.n.publish({kind:"editTitle",serverThreadId:i})},100)},icon:T.vdY,children:(0,j.jsx)(x.Z,ed({},ev.renameChat))}),"dropdown"===c&&(0,j.jsx)(ea.Z.Item,{disabled:!i,onClick:()=>{i&&$.n.publish({kind:"archiveChat",serverThreadId:i})},icon:T.rKT,children:(0,j.jsx)(x.Z,ed({},ev.archiveChat))}),(0,j.jsx)(ea.Z.Item,{color:"danger",disabled:!i,onClick:()=>{i&&$.n.publish({kind:"deleteChat",serverThreadId:i})},icon:T.XHJ,children:(0,j.jsx)(x.Z,ed({},ev.deleteChat))}),a&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ea.Z.Separator,{}),(0,j.jsx)(ea.Z.Item,{onClick:()=>p.vm.toggleActiveSidebar("debug"),icon:T.reV,children:(0,j.jsx)(x.Z,ed({},ev.debugChat))})]})]})},ey=e=>{let{clientThreadId:l,children:n,onOpenChange:a}=e;return(0,j.jsx)(ea.d,{onOpenChange:a,side:"bottom",contentAlign:"start",triggerButton:n,size:"auto",children:(0,j.jsx)(ef,{clientThreadId:l})})},ev=(0,k.vU)({newChat:{defaultMessage:"New chat",id:"GizmoInformation.newChat"},about:{defaultMessage:"About",id:"GizmoInformation.about"},privacySettings:{defaultMessage:"Privacy settings",id:"GizmoInformation.privacySettings"},viewDetails:{defaultMessage:"View details",id:"GizmoInformation.viewDetails"},share:{defaultMessage:"Share",id:"GizmoInformation.share"},favorite:{defaultMessage:"Favorite",id:"GizmoInformation.favorite"},customize:{defaultMessage:"Edit GPT",id:"GizmoInformation.customize"},feedbackEmail:{defaultMessage:"Send feedback",id:"GizmoInformation.feedbackEmail"},reviewGPT:{defaultMessage:"Review GPT",id:"GizmoInformation.reviewGPT"},report:{defaultMessage:"Report",id:"GizmoInformation.report"},privacy:{defaultMessage:"Privacy",id:"GizmoInformation.privacy"},deleteChat:{defaultMessage:"Delete",id:"GizmoInformation.deleteChat.0"},debugChat:{defaultMessage:"(Internal) Debug",id:"GizmoInformation.debugChat"},renameChat:{defaultMessage:"Rename",id:"GizmoInformation.renameChat"},archiveChat:{defaultMessage:"Archive",id:"GizmoInformation.archiveChat.0"},copyLink:{defaultMessage:"Copy link",id:"GizmoInformation.copyLink"},shareChat:{defaultMessage:"Share",id:"GizmoInformation.shareChat"},shareChatLong:{defaultMessage:"Share chat",id:"GizmoInformation.shareChatLong"},copiedURL:{defaultMessage:"Copied URL",id:"GizmoInformation.copiedURL"}})},69817:function(e,l,n){n.d(l,{W:function(){return f},i:function(){return y}});var a=n(21904),i=n(82823),t=n(86021),s=n(23653),r=n(48580),o=n(92379),d=n(26123),c=n(72256),u=n(49217),m=n(7050),g=n(70604),p=n(651);function f(e){let{gizmoId:l,onClose:n}=e,{data:t}=(0,i.b9)(l),{data:r}=(0,s.sQ)(a.CD.Gizmo),o=(0,d.Z)(),c=(0,s.gm)(o,l,a.CD.Gizmo);if(null==r)return null;let u=null!=t?"Report ".concat(t.gizmo.display.name):"Report";return(0,p.jsx)(g.UM,{reasons:r.reasons,submitReport:c,title:u,onClose:n,header:r.header,subHeader:r.header_explanation})}function y(e){var l,n,a;let{gizmoId:i,clientThreadId:s,onClose:y}=e,v=(0,d.Z)(),h=null===(l=(0,r.sB)("chatgpt-dsa-reporting"))||void 0===l?void 0:l.value,x=null===(n=(0,r.sB)("conversations_are_reportable"))||void 0===n?void 0:n.value,k=(0,t.XK)(s),j=null===(a=(0,r.sB)("chatgpt-conversation-report-flow"))||void 0===a?void 0:a.value,{0:b,1:z}=(0,o.useState)();return h&&x&&"gpt"!==b&&j&&null!=k?"conversation"===b?(0,p.jsx)(m.E,{serverThreadId:k,onClose:y}):(0,p.jsxs)(u.Z,{title:v.formatMessage({id:"gizmo.report.selectorModal.title",defaultMessage:"Report"}),onClose:y,isOpen:!0,showCloseButton:!0,type:"success",children:[(0,p.jsx)(g.Rh,{header:v.formatMessage({id:"gizmo.report.selectorModal.header",defaultMessage:"What would you like to report?"})}),(0,p.jsxs)(g._4,{children:[(0,p.jsx)(g.Ag,{onClick:e=>{e.preventDefault(),z("conversation")},children:(0,p.jsx)(c.Z,{id:"gizmo.report.selectorModal.conversation",defaultMessage:"The conversation"})}),(0,p.jsx)(g.Ag,{onClick:e=>{e.preventDefault(),z("gpt")},children:(0,p.jsx)(c.Z,{id:"gizmo.report.selectorModal.gpt",defaultMessage:"The GPT"})})]})]}):(0,p.jsx)(f,{gizmoId:i,onClose:y})}},55568:function(e,l,n){n.r(l);let a={kind:"InlineDataFragment",name:"GizmoDiscoveryCutFragment"};a.hash="fdc786e0e8d5e95c726dada0fa923ec5",l.default=a},26603:function(e,l,n){var a,i,t,s,r,o,d;n.r(l);let c={fragment:{argumentDefinitions:[a={defaultValue:null,kind:"LocalArgument",name:"after"},i={defaultValue:null,kind:"LocalArgument",name:"first"},t={defaultValue:null,kind:"LocalArgument",name:"id"},s={defaultValue:null,kind:"LocalArgument",name:"locale"}],kind:"Fragment",metadata:null,name:"GizmoDiscoveryCutLoadMoreQuery",selections:[{alias:null,args:r=[{kind:"Variable",name:"after",variableName:"after"},{kind:"Variable",name:"first",variableName:"first"},{kind:"Variable",name:"id",variableName:"id"},{kind:"Variable",name:"locale",variableName:"locale"}],concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"gizmoDiscoveryCut",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"GizmoDiscoveryLandingFragment",selections:o=[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"legacyId",storageKey:null},{alias:null,args:null,concreteType:"GizmoDisplay",kind:"LinkedField",name:"display",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GizmoVanityMetrics",kind:"LinkedField",name:"vanityMetrics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"numConversationsStr",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tags",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shortUrl",storageKey:null},{alias:null,args:null,concreteType:"GizmoAuthor",kind:"LinkedField",name:"author",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"displayName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"linkTo",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"userId",storageKey:null}],storageKey:null}],args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null},d={alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[t,s,i,a],kind:"Operation",name:"GizmoDiscoveryCutLoadMoreQuery",selections:[{alias:null,args:r,concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"gizmoDiscoveryCut",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:o,storageKey:null}],storageKey:null},d],storageKey:null}],storageKey:null}]},params:{cacheID:"36d68b449a76cd91a0c163ca704bfe71",id:"183f687bb51f2ee7e120e663d4b489dd6ac9eb62a73368352ff4022be136f08b",metadata:{},name:"GizmoDiscoveryCutLoadMoreQuery",operationKind:"query",text:"query GizmoDiscoveryCutLoadMoreQuery(\n $id: String!\n $locale: GizmoCategoryLocale\n $first: Int!\n $after: Cursor\n) {\n gizmoDiscoveryCut(id: $id, first: $first, after: $after, locale: $locale) {\n items {\n edges {\n node {\n ...GizmoDiscoveryLandingFragment\n id\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n}\n\nfragment GizmoDiscoveryLandingFragment on Gizmo {\n id\n legacyId\n display {\n name\n description\n profilePictureUrl\n }\n vanityMetrics {\n numConversationsStr\n }\n tags\n shortUrl\n author {\n displayName\n linkTo\n userId\n }\n}\n"}};c.hash="5a6cf482526687b7abccf6a708796da5",l.default=c},70734:function(e,l,n){var a,i,t,s,r,o,d,c,u;n.r(l);let m=(a=[{defaultValue:null,kind:"LocalArgument",name:"skip"}],r={alias:null,args:null,concreteType:"GizmoDiscoveryCutInfo",kind:"LinkedField",name:"info",plural:!1,selections:[t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"displayGroup",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"displayType",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"locale",storageKey:null}],storageKey:null},o={alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"startCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasPreviousPage",storageKey:null}],storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},c=[t,{alias:null,args:null,kind:"ScalarField",name:"legacyId",storageKey:null},{alias:null,args:null,concreteType:"GizmoDisplay",kind:"LinkedField",name:"display",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},s,{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GizmoVanityMetrics",kind:"LinkedField",name:"vanityMetrics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"numConversationsStr",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tags",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shortUrl",storageKey:null},{alias:null,args:null,concreteType:"GizmoAuthor",kind:"LinkedField",name:"author",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"displayName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"linkTo",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"userId",storageKey:null}],storageKey:null}],{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"GizmoDiscoveryLandingForViewerQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryLandingForViewer",kind:"LinkedField",name:"gizmoDiscoveryForViewer",plural:!1,selections:[i,{alias:null,args:null,concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"cuts",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"GizmoDiscoveryCutFragment",selections:[r,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[o,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[d,{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineDataFragmentSpread",name:"GizmoDiscoveryLandingFragment",selections:c,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],args:null,argumentDefinitions:[]}],storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"workspaceFiltered",storageKey:null}],storageKey:null}]}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"GizmoDiscoveryLandingForViewerQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryLandingForViewer",kind:"LinkedField",name:"gizmoDiscoveryForViewer",plural:!1,selections:[i,{alias:null,args:null,concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"cuts",plural:!0,selections:[r,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[o,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[d,{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:c,storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},u],storageKey:null}]}]},params:{cacheID:"23015c9c007ae8898b1d1c7505dbf071",id:"ea61cceff43f62cd3e43106f5ddc9037d6ee4784fd66a9df29312554db87bbc2",metadata:{},name:"GizmoDiscoveryLandingForViewerQuery",operationKind:"query",text:"query GizmoDiscoveryLandingForViewerQuery(\n $skip: Boolean!\n) {\n gizmoDiscoveryForViewer @skip(if: $skip) {\n locale\n cuts {\n ...GizmoDiscoveryCutFragment\n }\n workspaceFiltered\n }\n}\n\nfragment GizmoDiscoveryCutFragment on GizmoDiscoveryCut {\n info {\n id\n displayGroup\n title\n description\n displayType\n locale\n }\n items {\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n edges {\n cursor\n node {\n id\n ...GizmoDiscoveryLandingFragment\n }\n }\n }\n}\n\nfragment GizmoDiscoveryLandingFragment on Gizmo {\n id\n legacyId\n display {\n name\n description\n profilePictureUrl\n }\n vanityMetrics {\n numConversationsStr\n }\n tags\n shortUrl\n author {\n displayName\n linkTo\n userId\n }\n}\n"}});m.hash="17404783875f8625eac8cdae0fafb9b7",l.default=m},54474:function(e,l,n){n.r(l);let a={kind:"InlineDataFragment",name:"GizmoDiscoveryLandingFragment"};a.hash="481cc035f04fcf6c9178d83416b7fbf9",l.default=a},51642:function(e,l,n){var a,i,t,s,r,o,d,c,u;n.r(l);let m=(a=[{defaultValue:null,kind:"LocalArgument",name:"skip"}],r={alias:null,args:null,concreteType:"GizmoDiscoveryCutInfo",kind:"LinkedField",name:"info",plural:!1,selections:[t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"displayGroup",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"displayType",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"locale",storageKey:null}],storageKey:null},o={alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"startCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasPreviousPage",storageKey:null}],storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},c=[t,{alias:null,args:null,kind:"ScalarField",name:"legacyId",storageKey:null},{alias:null,args:null,concreteType:"GizmoDisplay",kind:"LinkedField",name:"display",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},s,{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GizmoVanityMetrics",kind:"LinkedField",name:"vanityMetrics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"numConversationsStr",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tags",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shortUrl",storageKey:null},{alias:null,args:null,concreteType:"GizmoAuthor",kind:"LinkedField",name:"author",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"displayName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"linkTo",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"userId",storageKey:null}],storageKey:null}],{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"GizmoDiscoveryLandingQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryLanding",kind:"LinkedField",name:"gizmoDiscovery",plural:!1,selections:[i,{alias:null,args:null,concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"cuts",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"GizmoDiscoveryCutFragment",selections:[r,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[o,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[d,{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:[t,{kind:"InlineDataFragmentSpread",name:"GizmoDiscoveryLandingFragment",selections:c,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],args:null,argumentDefinitions:[]}],storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"workspaceFiltered",storageKey:null}],storageKey:null}]}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"GizmoDiscoveryLandingQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryLanding",kind:"LinkedField",name:"gizmoDiscovery",plural:!1,selections:[i,{alias:null,args:null,concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"cuts",plural:!0,selections:[r,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[o,{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[d,{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:c,storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},u],storageKey:null}]}]},params:{cacheID:"eb70cae73c61fdf9b0e22e628281cb01",id:"61717afe8e2e87eb8384313c6aeb667029db6128bb66c1ac25c832375709e25e",metadata:{},name:"GizmoDiscoveryLandingQuery",operationKind:"query",text:"query GizmoDiscoveryLandingQuery(\n $skip: Boolean!\n) {\n gizmoDiscovery @skip(if: $skip) {\n locale\n cuts {\n ...GizmoDiscoveryCutFragment\n }\n workspaceFiltered\n }\n}\n\nfragment GizmoDiscoveryCutFragment on GizmoDiscoveryCut {\n info {\n id\n displayGroup\n title\n description\n displayType\n locale\n }\n items {\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n edges {\n cursor\n node {\n id\n ...GizmoDiscoveryLandingFragment\n }\n }\n }\n}\n\nfragment GizmoDiscoveryLandingFragment on Gizmo {\n id\n legacyId\n display {\n name\n description\n profilePictureUrl\n }\n vanityMetrics {\n numConversationsStr\n }\n tags\n shortUrl\n author {\n displayName\n linkTo\n userId\n }\n}\n"}});m.hash="3cadd0873e6a4e54be7e78d26a0fea45",l.default=m},97448:function(e,l,n){var a,i,t,s;n.r(l);let r={fragment:{argumentDefinitions:a=[{defaultValue:null,kind:"LocalArgument",name:"q"},{defaultValue:null,kind:"LocalArgument",name:"skip"}],kind:"Fragment",metadata:null,name:"GizmoDiscoverySearchQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:i=[{kind:"Variable",name:"q",variableName:"q"}],concreteType:"GizmoSearchResultConnection",kind:"LinkedField",name:"gizmoSearch",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoSearchResultEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"GizmoDiscoverySearchResultFragment",selections:t=[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"legacyId",storageKey:null},{alias:null,args:null,concreteType:"GizmoDisplay",kind:"LinkedField",name:"display",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GizmoVanityMetrics",kind:"LinkedField",name:"vanityMetrics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"numConversationsStr",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tags",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shortUrl",storageKey:null},{alias:null,args:null,concreteType:"GizmoAuthor",kind:"LinkedField",name:"author",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"displayName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"linkTo",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"userId",storageKey:null}],storageKey:null}],args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null},s={alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null}],storageKey:null}],storageKey:null}]}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"GizmoDiscoverySearchQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:i,concreteType:"GizmoSearchResultConnection",kind:"LinkedField",name:"gizmoSearch",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoSearchResultEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:t,storageKey:null}],storageKey:null},s],storageKey:null}]}]},params:{cacheID:"4072e50358c9a36b0520aa8f19d109ea",id:"a729daad0c7f7a7f438e19b21729a3cb6a6ab244a5e6faef10a995aa960f828a",metadata:{},name:"GizmoDiscoverySearchQuery",operationKind:"query",text:"query GizmoDiscoverySearchQuery(\n $q: String!\n $skip: Boolean!\n) {\n gizmoSearch(q: $q) @skip(if: $skip) {\n edges {\n node {\n ...GizmoDiscoverySearchResultFragment\n id\n }\n }\n pageInfo {\n endCursor\n }\n }\n}\n\nfragment GizmoDiscoverySearchResultFragment on Gizmo {\n id\n legacyId\n display {\n name\n description\n profilePictureUrl\n }\n vanityMetrics {\n numConversationsStr\n }\n tags\n shortUrl\n author {\n displayName\n linkTo\n userId\n }\n}\n"}};r.hash="ecc53fe4da40d180a6679828a01fbe62",l.default=r},71330:function(e,l,n){var a,i,t;n.r(l);let s={fragment:{argumentDefinitions:a=[{defaultValue:null,kind:"LocalArgument",name:"skip"}],kind:"Fragment",metadata:null,name:"GizmoDiscoverySearchRecentQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:i=[{kind:"Literal",name:"first",value:3},{kind:"Literal",name:"id",value:"recent"}],concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"gizmoDiscoveryCut",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"GizmoDiscoverySearchResultFragment",selections:t=[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"legacyId",storageKey:null},{alias:null,args:null,concreteType:"GizmoDisplay",kind:"LinkedField",name:"display",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GizmoVanityMetrics",kind:"LinkedField",name:"vanityMetrics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"numConversationsStr",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tags",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shortUrl",storageKey:null},{alias:null,args:null,concreteType:"GizmoAuthor",kind:"LinkedField",name:"author",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"displayName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"linkTo",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"userId",storageKey:null}],storageKey:null}],args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'gizmoDiscoveryCut(first:3,id:"recent")'}]}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"GizmoDiscoverySearchRecentQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:i,concreteType:"GizmoDiscoveryCut",kind:"LinkedField",name:"gizmoDiscoveryCut",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoConnection",kind:"LinkedField",name:"items",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoDiscoveryCutToGizmoEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:t,storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'gizmoDiscoveryCut(first:3,id:"recent")'}]}]},params:{cacheID:"e95b9a90b6a2230bc87b54ad9906e916",id:"8ec50d7747182d2845113037aaca7d8b90c8984df1967edc46b78be1cc194c79",metadata:{},name:"GizmoDiscoverySearchRecentQuery",operationKind:"query",text:'query GizmoDiscoverySearchRecentQuery(\n $skip: Boolean!\n) {\n gizmoDiscoveryCut(id: "recent", first: 3) @skip(if: $skip) {\n items {\n edges {\n node {\n ...GizmoDiscoverySearchResultFragment\n id\n }\n }\n }\n }\n}\n\nfragment GizmoDiscoverySearchResultFragment on Gizmo {\n id\n legacyId\n display {\n name\n description\n profilePictureUrl\n }\n vanityMetrics {\n numConversationsStr\n }\n tags\n shortUrl\n author {\n displayName\n linkTo\n userId\n }\n}\n'}};s.hash="cd8dfafd3765a6c177f962cbd0a3032d",l.default=s},19798:function(e,l,n){n.r(l);let a={kind:"InlineDataFragment",name:"GizmoDiscoverySearchResultFragment"};a.hash="f1079dddf3cead4b3a74620fbbbd6d9d",l.default=a},25173:function(e,l,n){var a,i,t,s;n.r(l);let r={fragment:{argumentDefinitions:a=[{defaultValue:null,kind:"LocalArgument",name:"q"},{defaultValue:null,kind:"LocalArgument",name:"skip"}],kind:"Fragment",metadata:null,name:"GizmoDiscoverySearchWorkspaceOnlyQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:i=[{kind:"Variable",name:"q",variableName:"q"},{kind:"Literal",name:"workspaceOnly",value:!0}],concreteType:"GizmoSearchResultConnection",kind:"LinkedField",name:"gizmoSearch",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoSearchResultEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"GizmoDiscoverySearchResultFragment",selections:t=[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"legacyId",storageKey:null},{alias:null,args:null,concreteType:"GizmoDisplay",kind:"LinkedField",name:"display",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GizmoVanityMetrics",kind:"LinkedField",name:"vanityMetrics",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"numConversationsStr",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tags",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"shortUrl",storageKey:null},{alias:null,args:null,concreteType:"GizmoAuthor",kind:"LinkedField",name:"author",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"displayName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"linkTo",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"userId",storageKey:null}],storageKey:null}],args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null},s={alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null}],storageKey:null}],storageKey:null}]}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"GizmoDiscoverySearchWorkspaceOnlyQuery",selections:[{condition:"skip",kind:"Condition",passingValue:!1,selections:[{alias:null,args:i,concreteType:"GizmoSearchResultConnection",kind:"LinkedField",name:"gizmoSearch",plural:!1,selections:[{alias:null,args:null,concreteType:"GizmoSearchResultEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Gizmo",kind:"LinkedField",name:"node",plural:!1,selections:t,storageKey:null}],storageKey:null},s],storageKey:null}]}]},params:{cacheID:"83e5dcb21aa71a0b6f7cac4afa2c868e",id:"3a5e9c35db88b5a1f36dfd30317fb3d4bc7ab1fea18fc2ccfcf8488e3b8fdf0c",metadata:{},name:"GizmoDiscoverySearchWorkspaceOnlyQuery",operationKind:"query",text:"query GizmoDiscoverySearchWorkspaceOnlyQuery(\n $q: String!\n $skip: Boolean!\n) {\n gizmoSearch(q: $q, workspaceOnly: true) @skip(if: $skip) {\n edges {\n node {\n ...GizmoDiscoverySearchResultFragment\n id\n }\n }\n pageInfo {\n endCursor\n }\n }\n}\n\nfragment GizmoDiscoverySearchResultFragment on Gizmo {\n id\n legacyId\n display {\n name\n description\n profilePictureUrl\n }\n vanityMetrics {\n numConversationsStr\n }\n tags\n shortUrl\n author {\n displayName\n linkTo\n userId\n }\n}\n"}};r.hash="9b0252d2089c7325c26e7cba0ac166b8",l.default=r},28862:function(e,l,n){n.d(l,{a7:function(){return M},at:function(){return I},h9:function(){return T},r1:function(){return K}});var a,i,t=n(41141),s=n(94521);n(11823);var r=n(46193),o=n(67165),d=n(62484),c=n(92426),u=n(83252),m=n(5994),g=n(82823),p=n(56029),f=n(16645),y=n(75438),v=n(27860),h=n(35226),x=n(19841),k=n(556),j=n(40319),b=n.n(j),z=n(43128),S=n(92379),w=n(72256),G=n(25940),C=n(74091),F=n(61885),N=n(52899),P=n(651);function L(e,l){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);l&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,a)}return n}function D(e){for(var l=1;l{s.push((0,v.AA)(i.gizmo.id),void 0,{shallow:!0})},children:(0,P.jsx)(c.vdY,{className:"icon-sm"})})}),(0,P.jsx)(E,{gizmoResource:i,isOwner:r,canRemoveRecent:t})]})})}let R=C.Z.div(i||(i=(0,t.Z)(["flex h-[42px] w-[42px] flex-shrink-0 items-center justify-center rounded-full border border-dashed\n",""])),e=>{let{$disabled:l}=e;return l?"":"border-token-border-light bg-token-main-surface-secondary"});function I(e){let{type:l}=e,n=(0,v.J8)(),a=l===M.ComingSoon;return(0,P.jsxs)(d.E,{disabled:!a,label:(0,P.jsx)(w.Z,{id:"gizmo.gpt.grid.CreateGPTComingSoon",defaultMessage:"GPT creation will be available in the coming weeks"}),children:[(0,P.jsx)(Z,{href:n,disabled:a,icon:(0,P.jsx)(R,{$disabled:a,children:(0,P.jsx)(c.Vz5,{className:(0,x.default)("icon-sm",a&&"opacity-30")})}),title:(0,P.jsx)("div",{className:"flex items-center gap-1",children:(0,P.jsx)(w.Z,{id:"gizmo.gpt.grid.CreateGPT",defaultMessage:"Create a GPT"})}),description:"Customize a version of ChatGPT for a specific purpose",byline:a?(0,P.jsx)("div",{className:"flex items-center justify-end",children:(0,P.jsx)("div",{className:"flex items-center",children:(0,P.jsx)(w.Z,{id:"gizmo.gpt.grid.ComingSoon",defaultMessage:"Coming soon"})})}):void 0}),(0,P.jsx)("div",{className:"h-px bg-gray-100 dark:bg-gray-700"})]})}function Z(e){let{href:l,icon:n,title:a,isDraft:i=!1,description:t,byline:s,buttons:r,disabled:o,className:c}=e,u=(0,x.default)("flex items-center px-2 py-4 rounded-xl",o?"":"hover:bg-token-main-surface-secondary",c),m=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:"flex grow items-center overflow-hidden md:w-3/5 md:grow-0",children:[n,(0,P.jsxs)("div",{className:(0,x.default)("grow overflow-hidden pl-4 pr-9 leading-tight",o?"opacity-50":"hover:cursor-pointer"),children:[(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)("span",{className:"font-semibold",children:a}),i&&(0,P.jsx)(d.u,{label:(0,P.jsx)(w.Z,{id:"gizmo.gpt.grid.Draft",defaultMessage:"Draft"}),className:"flex justify-center",side:"top",children:(0,P.jsx)("div",{className:"m-1.5 inline-block h-1.5 w-1.5 rounded-full bg-gray-200 dark:bg-gray-600"})})]}),(0,P.jsx)("div",{className:"line-clamp-2 overflow-hidden text-ellipsis break-words text-sm",children:t}),null!=s&&(0,P.jsx)("div",{className:"text-ellipsis text-sm text-token-text-tertiary md:hidden",children:s})]})]}),null!=s&&(0,P.jsx)("div",{className:"hidden flex-1 text-ellipsis text-sm text-token-text-tertiary md:block",children:s}),null!=r&&(0,P.jsx)("div",{onClick:e=>{e.preventDefault()},onPointerDownCapture:e=>{e.stopPropagation()},className:"flex h-9 shrink-0 justify-end gap-2 font-semibold md:w-[100px]",children:r})]});return o?(0,P.jsx)(T,{children:(0,P.jsx)("span",{className:u,children:m})}):(0,P.jsx)(T,{children:(0,P.jsx)(b(),{className:u,href:l,shallow:!0,children:m})})}function E(e){let{gizmoResource:l,isOwner:n,canRemoveRecent:a}=e,{0:i,1:t}=(0,S.useState)(!1),{0:s,1:d}=(0,S.useState)(!1),u=(0,h.NL)();return n||a?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(o.d,{side:"top",contentAlign:"end",sideOffset:8,open:s,onOpenChange:e=>d(e),triggerButton:(0,P.jsx)("button",{color:"secondary",className:"rounded-lg bg-transparent px-3 py-2 text-token-text-primary duration-100 ease-in hover:bg-white active:scale-[0.9] dark:bg-transparent dark:hover:bg-gray-700",onClick:()=>{d(e=>!e)},children:(0,P.jsx)(c.nWS,{className:"icon-md"})}),children:[n&&(0,P.jsx)(o.Z.Item,{color:"danger",onClick:()=>{t(!0)},icon:c.XHJ,children:(0,P.jsx)(w.Z,{id:"gizmo.gpt.grid.DeleteGPT",defaultMessage:"Delete GPT"})}),a&&(0,P.jsx)(o.Z.Item,{onClick:()=>{p.U.removeFromRecent(u,l.gizmo.id)},children:(0,P.jsx)(w.Z,{id:"gizmo.gpt.grid.RemoveFromRecent",defaultMessage:"Remove from Recent"})})]}),i&&(0,P.jsx)(r.h,{children:(0,P.jsx)(N.b,{gizmoId:l.gizmo.id,onSuccess:()=>{t(!1)},onClose:()=>{t(!1)}})})]}):null}let A=(0,G.vU)({conversationCountStrLabel:{id:"gizmo.gpt.grid.conversationCountStrLabel",defaultMessage:"{numConvos} Chats"}})}}]); //# sourceMappingURL=766-b42cd74a9f1dd4d5.js.map