(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,330080,e=>{"use strict";e.s(["BannerContext",()=>c,"BannerProvider",()=>u],330080);var t=e.i(843476),r=e.i(271645);let n="bannerDismissed",a="data-banner-state";function s(e,t){return void 0!==e&&void 0!==t?`lang:${t}_subdomain:${e}_${n}`:n}var o=e.i(91557),i=e.i(590280),l=e.i(343590);let c=(0,r.createContext)({banner:void 0,dismissBanner:()=>{}}),u=({children:e,bannersByLocale:n,subdomain:u})=>{let{selectedLocale:d}=(0,r.useContext)(l.NavigationContext),{isLivePreview:h}=(0,r.useContext)(i.LivePreviewContext),{docsConfig:p}=(0,r.useContext)(o.DocsConfigContext),m=(0,r.useMemo)(()=>h&&p?function(e){let t={},r=[];return"languages"in e.navigation&&e.navigation.languages.forEach(e=>{r.push(e.language),e.banner&&(t[e.language]=e.banner)}),e.banner&&(t.global=e.banner),{bannersByLocale:t,validLangs:r}}(p).bannersByLocale:n,[h,p,n]),g=(0,r.useMemo)(()=>d&&m[d]?{...m[d],lang:d}:{...m.global,lang:"global"},[d,m]),x=(0,r.useMemo)(()=>(function(e,t){let r=t[e];return r?{...r,lang:e}:void 0})(g.lang,m),[g.lang,m]),[f,b]=(0,r.useState)(x);return(0,r.useLayoutEffect)(()=>{b(!function(e,t,r){let n=t[e];if(!n)return void document.documentElement.setAttribute(a,"hidden");let o={...n,lang:e};try{let t=s(r,e),i=localStorage.getItem(t),l=!i||i!==n.content;return document.documentElement.setAttribute(a,l?"visible":"hidden"),l&&i&&localStorage.removeItem(t),l?o:void 0}catch(e){return}}(g.lang,m,u)?void 0:x)},[g.lang,x,m,u]),(0,t.jsx)(c.Provider,{value:{banner:f,dismissBanner:f?.dismissible?()=>{if(f&&f.dismissible&&f.content){b(void 0);try{localStorage.setItem(s(u,f.lang),f.content)}catch(e){console.error(e)}document.documentElement.setAttribute(a,"hidden")}}:void 0},children:e})}},997588,452957,576003,e=>{"use strict";e.s(["useLogout",()=>i],997588);var t=e.i(206558),r=e.i(181750),n=e.i(307080),a=e.i(117595),s=e.i(271645),o=e.i(912710);function i(){return{logout:(0,s.useCallback)(({redirectOverride:e}={})=>{try{a.default.remove(o.ENCRYPTION_COOKIE_KEY),localStorage.removeItem(r.NAVIGATION_CACHE_KEY),localStorage.removeItem(n.CREDENTIALS_LOCALSTORAGE_KEY);let s=new URL(window.location.href);s.pathname=`${t.NEXT_PUBLIC.BASE_PATH}/logout`;let i=e??`${t.NEXT_PUBLIC.BASE_PATH}/`;s.search=`?redirect=${encodeURIComponent(i)}`,window.location.assign(s.toString())}catch(e){console.error("Error during logout:",e),window.location.assign(`${t.NEXT_PUBLIC.BASE_PATH}/logout`)}},[])}}e.s([],576003),e.s(["DEFAULT_ACTION_CLASSNAME",()=>u,"getActionClassname",()=>h],452957);var l=e.i(479721),c=e.i(296548);let u="flex items-center gap-1.5 whitespace-nowrap font-medium text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300",d=(0,l.themeVariants)({aspen:"gap-2 text-gray-800 dark:text-gray-50 hover:text-gray-800 dark:hover:text-gray-50 bg-gray-950/[0.03] dark:bg-white/[0.03] hover:bg-gray-950/10 dark:hover:bg-white/10 rounded-xl px-[14px] py-2",luma:"gap-2 h-9 text-sm dark:text-gray-300 dark:hover:text-gray-100 border border-gray-950/10 dark:border-white/10 hover:bg-gray-950/[0.03] dark:hover:bg-white/[0.03] rounded-full px-4",willow:"leading-4 tracking-[-0.14px] uppercase font-family-mono text-sm"},u),h=e=>(0,c.cn)(d({theme:e}))},604804,e=>{"use strict";e.s(["LoginButtonContext",()=>h,"LoginButtonProvider",()=>p]);var t=e.i(843476),r=e.i(803333),n=e.i(997588),a=e.i(166303),s=e.i(715274),o=e.i(476781);e.i(576003);var i=e.i(452957),l=e.i(296548),c=e.i(522016),u=e.i(271645),d=e.i(91557);let h=(0,u.createContext)({authLoginButton:null,userAuthLoginButton:null,authLogoutButton:null,userAuthLogoutButton:null});function p({children:e}){let{docsConfig:p}=(0,u.useContext)(d.DocsConfigContext),{userInfo:m,userAuth:g,auth:x,isFetchingUserInfo:f}=(0,u.useContext)(d.AuthContext),{logout:b}=(0,n.useLogout)(),y=(0,r.useCurrentPath)(),v=p?.theme,k=(0,i.getActionClassname)(v),w=!1!==f,C=(0,u.useMemo)(()=>(0,t.jsx)("span",{"aria-hidden":"true",className:(0,l.cn)(k,"pointer-events-none animate-pulse"),children:(0,t.jsx)("span",{className:"inline-flex h-[1lh] items-center",children:(0,t.jsx)("span",{className:"inline-block h-3 w-12 rounded-md bg-gray-200 dark:bg-white/10"})})}),[k]),j=(0,u.useMemo)(()=>{if(f||m||!g)return null;switch(g.type){case"jwt":return(0,t.jsx)(c.default,{href:g.loginUrl,className:(0,l.cn)(k,o.Classes.LoginLink),children:"Log In"});case"shared-session":if(!g.loginUrl)return null;return(0,t.jsx)(c.default,{href:g.loginUrl,className:(0,l.cn)(k,o.Classes.LoginLink),children:"Log In"});case"oauth":return(0,t.jsx)("button",{onClick:()=>(0,a.default)(g),className:(0,l.cn)(k,o.Classes.LoginLink),children:"Log In"})}},[k,f,g,m]),N=(0,u.useMemo)(()=>{if(m||!x||!1!==f)return null;let e=`/login?redirect=${y}`.replace(/\/{2,}/g,"/");return(0,t.jsx)(c.default,{href:e,className:(0,l.cn)(k,o.Classes.LoginLink),children:"Log In"})},[y,k,x,m,f]),S=(0,u.useMemo)(()=>w&&x?C:m&&x?(0,t.jsx)("button",{onClick:()=>b({redirectOverride:x.logoutUrl}),className:(0,l.cn)(k,o.Classes.LogoutLink),children:"Log Out"}):null,[w,C,m,x,b,k]),I=(0,u.useMemo)(()=>w&&g&&!x?C:m&&g?(0,t.jsx)("button",{onClick:()=>{try{localStorage.removeItem(s.USERINFO_LOCALSTORAGE_KEY)}catch{}window.location.reload()},className:(0,l.cn)(k,o.Classes.LogoutLink),children:"Log Out"}):null,[w,C,m,g,x,k]);return(0,t.jsx)(h.Provider,{value:{userAuthLoginButton:j,authLoginButton:N,authLogoutButton:S,userAuthLogoutButton:I},children:e})}},378114,15043,357550,149758,e=>{"use strict";e.s(["NavItem",()=>W],378114);var t=e.i(843476),r=e.i(91557),n=e.i(590280),a=e.i(343590),s=e.i(742977),o=e.i(865420),i=e.i(803333),l=e.i(111048),c=e.i(296548);let u=(e,t)=>`${1+e*("leading"===t?1.5:.75)}rem`,d=(e="container",t,r)=>{let n=(0,c.cn)("group flex items-start pr-3 py-1.5 cursor-pointer gap-x-3 text-left focus-visible:-outline-offset-2",r&&"break-words hyphens-auto"),a={container:(0,c.cn)("rounded-xl w-full outline-offset-[-1px]",t?"bg-primary/10 text-primary [text-shadow:-0.2px_0_0_currentColor,0.2px_0_0_currentColor] dark:text-primary-light dark:bg-primary-light/10":"hover:bg-gray-600/5 dark:hover:bg-gray-200/5 text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300"),card:(0,c.cn)("ml-4 border-l outline-offset-[-1px]",t?"border-primary dark:border-primary-light bg-primary/10 text-primary [text-shadow:-0.2px_0_0_currentColor,0.2px_0_0_currentColor] dark:text-primary-light dark:bg-primary-light/10":"border-gray-950/5 dark:border-white/10 hover:bg-gray-600/5 dark:hover:bg-gray-200/5 text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300"),border:(0,c.cn)("ml-4 border-l py-2 lg:py-1.5 w-[calc(100%-1rem)]",t?"border-primary dark:border-primary-light text-primary [text-shadow:-0.2px_0_0_currentColor,0.2px_0_0_currentColor] dark:text-primary-light":"border-gray-950/5 dark:border-white/10 hover:border-gray-950/20 dark:hover:border-white/20 text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300"),undecorated:(0,c.cn)(t?"border-primary dark:border-primary-light text-primary [text-shadow:-0.2px_0_0_currentColor,0.2px_0_0_currentColor] dark:text-primary-light":"border-gray-950/5 dark:border-white/10 hover:border-gray-950/20 dark:hover:border-white/20 text-gray-700 hover:text-gray-950 dark:text-gray-400 dark:hover:text-gray-300"),arrow:(0,c.cn)(t?"border-primary dark:border-primary-light text-primary [text-shadow:-0.2px_0_0_currentColor,0.2px_0_0_currentColor] dark:text-primary-light":"border-gray-950/5 dark:border-white/10 hover:border-gray-950/20 dark:hover:border-white/20 text-gray-700 hover:text-gray-950 dark:text-gray-400 dark:hover:text-gray-300"),plain:(0,c.cn)("w-full",t?"text-primary dark:text-primary-light [text-shadow:-0.2px_0_0_currentColor,0.2px_0_0_currentColor]":"text-gray-700 dark:text-gray-400 hover:text-primary hover:dark:text-primary-light")};return(0,c.cn)(n,a[e])};var h=e.i(479721),p=e.i(328463),m=e.i(674987),g=e.i(568258),x=e.i(16430);e.s(["getValidSpacingClasses",()=>f],15043);let f=e=>"willow"===e||"maple"===e?"":"space-y-px";var b=e.i(220758);e.i(914140);var y=e.i(773626),v=e.i(308419);e.s(["shouldPrefetchNavHref",()=>w],357550);var k=e.i(961508);function w(e){return!(0,k.isAbsoluteUrl)(e)&&!e.startsWith("//")&&(e.startsWith("/")||/^\w/.test(e))}var C=e.i(456084),j=e.i(517956),N=e.i(428681),S=e.i(618566),I=e.i(271645),P=e.i(395787);e.s(["NavTagPill",()=>E],149758);var A=e.i(476781);let E=({tag:e,isActive:r})=>(0,t.jsx)("span",{className:(0,c.cn)(A.Classes.NavTagPill,"flex items-center w-fit"),children:(0,t.jsx)("span",{className:(0,c.cn)(A.Classes.NavTagPillText,"px-1 py-0.5 rounded-md text-[0.65rem] leading-tight font-bold text-primary dark:text-primary-light bg-primary/10"),"data-nav-tag":e,"data-active":r,children:e})}),M=["w-20","w-24","w-16","w-28"],R=({group:e,level:a,shouldAutoNavigate:o,sidebarItemStyle:k,arrowPosition:A,parentId:R="",index:T=0})=>{let{getLivePreviewHref:L,navigateWithinLivePreview:D}=(0,I.useContext)(n.LivePreviewContext),_=(0,S.useRouter)(),z=(0,I.useId)(),H=(0,i.useCurrentPath)(),{docsConfig:$}=(0,I.useContext)(r.DocsConfigContext),{prefetch:O}=(0,s.usePrefetch)(),{isExpanded:F,setExpanded:B}=(0,p.useSidebarExpanded)(),U=function e(t,r){return!!(r.root&&"href"in r.root&&(0,y.isEqualIgnoringLeadingSlash)(r.root.href,(0,v.removeUrlParamsAndAnchors)(t)))||r.pages.some(r=>(0,b.isGroup)(r)?e(t,r):(0,y.isEqualIgnoringLeadingSlash)(r.href,(0,v.removeUrlParamsAndAnchors)(t)))}(H,e),{group:Y,pages:X}=e,V=(0,I.useMemo)(()=>{let t=(e.root&&(0,j.isPage)(e.root)?e.root.href:void 0)||`${T}-${Y}`;return`${R}::${t}`},[R,T,e.root,Y]),[q,K]=(0,I.useState)(()=>F(V)||!!U),G=(0,I.useCallback)(e=>{K(e),B(V,e)},[V,B]);if((0,I.useEffect)(()=>{if((U||e.expanded)&&(K(!0),B(V,!0)),a<=1&&e.root&&(0,j.isPage)(e.root)&&w(e.root.href)&&O(e.root.href,{source:"group-dropdown-root",level:a}),a<=1&&"pages"in e&&Array.isArray(e.pages)){let t=0;for(let r of e.pages){if(t>=3)break;(0,j.isPage)(r)&&w(r.href)&&(O(r.href,{source:"group-dropdown",level:a}),t++)}}},[e,U,a,O,V,B]),!Y)return null;let Z=X.find(e=>(0,j.isPage)(e)),Q=e.root&&(0,j.isPage)(e.root)?e.root.href:void 0,J=null!=Q&&(0,C.isSkeletonEntry)({href:Q})||null!=Z&&(0,C.isSkeletonEntry)({href:Z.href}),ee=1===Y.split(" ").length,et=e.root&&(0,j.isPage)(e.root)&&(0,y.isEqualIgnoringLeadingSlash)(e.root.href,(0,v.removeUrlParamsAndAnchors)(H));return(0,t.jsxs)("li",{"data-title":Y,"data-group-tag":e.tag||"","data-active":U||void 0,[l.ACTIVE_NAV_ITEM_ATTRIBUTE]:et||void 0,id:e.root&&(0,j.isPage)(e.root)?e.root.url||(0,N.replaceSlashIndex)(e.root.href)||"/":void 0,className:(0,c.cn)(f($?.theme)),children:[(0,t.jsxs)("button",{className:(0,c.cn)((0,h.themeSidebarItem)({theme:$?.theme}),d(k,!!et,ee),J&&"animate-pulse pointer-events-none"),style:{paddingLeft:u(a,A)},onClick:J?void 0:()=>{if(e.root&&(0,j.isPage)(e.root)){if(et)G(!q);else{let t=(0,m.navHref)(L(e.root.href));D?.(t)||_.push((0,m.navHref)(L(e.root.href))),G(!0)}return}let t=X[0],r=$?.interaction?.drilldown;if(!q&&t&&(0,j.isPage)(t)&&!U&&(!0===r||!1!==r&&!o)){let e=(0,m.navHref)(L(t.href));D?.(e)||_.push((0,m.navHref)(L(t.href)))}G(!q)},"aria-expanded":q,"aria-controls":q?z:void 0,"aria-hidden":J||void 0,tabIndex:J?-1:void 0,children:[!J&&"leading"===A&&(0,t.jsx)(x.LineCenter,{children:(0,t.jsx)(P.DropdownArrowIcon,{className:(0,c.cn)("w-2 h-[1lh] -mr-0.5",et&&"text-primary dark:text-primary-light",q&&"duration-75 rotate-90")})}),!J&&e.icon&&(0,t.jsx)(x.LineCenter,{children:(0,t.jsx)(g.ComponentIcon,{icon:"object"==typeof e.icon?e.icon.name:e.icon,iconType:"object"==typeof e.icon?e.icon.style:void 0,className:(0,c.cn)("size-4",et?"bg-primary dark:bg-primary-light":"bg-gray-400 dark:bg-gray-500"),overrideColor:!0})}),(0,t.jsxs)("div",{className:(0,c.cn)(!!e.tag&&"justify-between flex items-center gap-2",("end"===A||"leading"===A)&&"flex-1 flex items-center gap-2 justify-start"),children:[J?(0,t.jsx)("span",{"aria-hidden":"true",className:"inline-flex h-[1lh] items-center",children:(0,t.jsx)("span",{className:(0,c.cn)("inline-block h-3 rounded-md bg-gray-200 dark:bg-white/10 select-none",(0,C.pickSkeletonWidth)(Y,M))})}):(0,t.jsx)("span",{children:Y}),!J&&e.tag&&(0,t.jsx)(E,{tag:e.tag})]}),!J&&"leading"!==A&&(0,t.jsx)(x.LineCenter,{children:(0,t.jsx)(P.DropdownArrowIcon,{className:(0,c.cn)("w-2 h-[1lh] -mr-0.5",et&&"text-primary dark:text-primary-light",q&&"duration-75 rotate-90")})})]}),q&&(0,t.jsx)("ul",{id:z,className:(0,c.cn)(f($?.theme)),children:X.map((e,r)=>{let n=(0,b.isGroup)(e)?e.group:e.href;return(0,t.jsx)(W,{entry:e,level:a+1,shouldAutoNavigateOnGroupClick:o,sidebarItemStyle:k,arrowPosition:A,parentId:V,index:r},n)})})]})};var T=e.i(914423),L=e.i(292981),D=e.i(289264),_=e.i(588420),z=e.i(522016),H=e.i(410842),$=e.i(310589);let O=({isActive:e,method:r,deprecated:n})=>{let{activeNavPillBg:a,activeNavPillText:s,inactiveNavPillText:o,inactiveNavPillBg:i}=(0,H.getMethodColor)(n?"DEPRECATED":r);return(0,t.jsx)("span",{className:(0,c.cn)(A.Classes.MethodNavPill,"flex items-center w-8"),children:(0,t.jsx)("span",{className:(0,c.cn)("px-1 py-0.5 rounded-md text-[0.55rem] leading-tight font-bold",e?`${a} ${s}`:`${i} ${o}`),children:(0,$.getShortenedMethodName)(r)})})},F=["w-20","w-24","w-16","w-28","w-32"],W=(0,I.forwardRef)(function({entry:e,level:p=0,shouldAutoNavigateOnGroupClick:m=!1,sidebarItemStyle:f,arrowPosition:w="trailing",trailingIcon:j,trailingIconHug:S,className:A,parentId:M,index:H,analytics:$},W){let{getLivePreviewHref:B,isGenerationActive:U,isGeneratedPageReady:Y,requestContentEarly:X}=(0,I.useContext)(n.LivePreviewContext),{divisions:V}=(0,I.useContext)(a.NavigationContext),{prefetch:q}=(0,s.usePrefetch)(),K=(0,o.useAnalyticsContext)($?.event??"docs.navitem.click"),G=(0,i.useCurrentPath)(),Z=(0,I.useRef)(null),Q=(0,I.useRef)(!1),J=(0,I.useRef)(null),{docsConfig:ee}=(0,I.useContext)(r.DocsConfigContext),et=ee?.theme,er=(0,I.useRef)(e=>{Z.current=e,"function"==typeof W?W(e):W&&(W.current=e)}),en=(0,C.isSkeletonEntry)(e);if((0,I.useEffect)(()=>{let t=Z.current;if(!t||!e||(0,b.isGroup)(e)||Q.current||(0,C.isSkeletonEntry)(e))return;let r=e.href,n=(0,N.replaceSlashIndex)(r),a=e.url,s=a||n||"/";if(!a&&(!n||!(0,k.isAbsoluteUrl)(n)))return J.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&!Q.current&&(Q.current=!0,q(s,{source:"nav-item",level:p}),J.current?.disconnect())})},{rootMargin:"50%"}),J.current.observe(t),()=>{J.current?.disconnect(),J.current=null}},[e,p,q]),null==e)return null;if((0,b.isGroup)(e))return(0,t.jsx)(R,{group:e,level:p,shouldAutoNavigate:m,sidebarItemStyle:f,arrowPosition:w,parentId:M,index:H},e.group);let{href:ea,api:es,openapi:eo,url:ei,asyncapi:el,graphql:ec,deprecated:eu,mode:ed}=e,eh=(0,N.replaceSlashIndex)(ea),ep=(0,y.isEqualIgnoringLeadingSlash)(eh,(0,v.removeUrlParamsAndAnchors)(G)),em=es||eo||el,eg="object"==typeof ec&&null!==ec&&"kind"in ec&&("query"===ec.kind||"mutation"===ec.kind)?ec.kind:void 0,ex=(0,L.getSidebarTitle)(e),ef=eg;if("custom"===ed&&1===V.groupsOrPages.length)return null;if(el)ef="websocket";else if(em){let e=(0,D.potentiallyParseOpenApiString)(em);void 0!=e&&(ef=e.method)}if(!en&&!ex&&!e.icon&&!j&&!e.tag)return null;let eb=1===ex.split(" ").length,ey=U&&!ei&&!!eh&&!(0,k.isAbsoluteUrl)(eh)&&!Y?.(eh),ev=ei||B(eh||"/"),ek=d(f,ep,eb),ew={paddingLeft:u(p,w)},eC=(0,t.jsxs)(t.Fragment,{children:[!en&&"arrow"===f&&ep&&(0,t.jsx)(x.LineCenter,{className:"absolute left-0 top-1.5",children:(0,t.jsx)(P.DropdownArrowIcon,{className:"text-primary group-hover:text-primary dark:text-primary-light dark:group-hover:text-primary-light"})}),!en&&(em||eg)&&!0!==e.hideApiMarker&&ef&&(0,t.jsx)(x.LineCenter,{children:(0,t.jsx)(O,{isActive:ep,method:ef,deprecated:eu})}),!en&&e.icon&&(0,t.jsx)(x.LineCenter,{children:(0,t.jsx)(g.ComponentIcon,{icon:"string"==typeof e.icon?e.icon:e.icon.name,iconType:e.iconType||"regular",className:(0,c.cn)("size-4",ep?"bg-primary dark:bg-primary-light":"bg-gray-400 dark:bg-gray-500"),overrideColor:!0})}),(0,t.jsxs)("div",{className:(0,c.cn)("flex-1 flex min-w-0 items-start gap-x-2.5",S&&"flex-none"),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5 [word-break:break-word]",children:[en?(0,t.jsx)("span",{"aria-hidden":"true",className:"inline-flex h-[1lh] items-center",children:(0,t.jsx)("span",{className:(0,c.cn)("inline-block h-3 rounded-md bg-gray-200 dark:bg-white/10 select-none",(0,C.pickSkeletonWidth)(ex,F))})}):(0,t.jsx)("span",{className:"min-w-0 max-w-full break-words hyphens-auto",children:ex}),!en&&e.tag&&!eg&&(0,t.jsx)(x.LineCenter,{className:"leading-[inherit]",children:(0,t.jsx)(E,{tag:e.tag})}),!en&&eu&&(0,t.jsx)(x.LineCenter,{className:"leading-[inherit]",children:(0,t.jsx)(T.DeprecatedLabel,{})})]}),!en&&ei&&(0,t.jsx)(x.LineCenter,{className:(0,c.cn)("end"===w&&"flex-1 justify-end"),children:(0,t.jsx)(_.ArrowUpRight2Icon,{"aria-hidden":"true",strokeWidth:2,className:"size-2.5 text-gray-400 overflow-visible group-hover:text-gray-600 dark:text-gray-600 dark:group-hover:text-gray-400 shrink-0"})})]}),!en&&j&&(0,t.jsx)(x.LineCenter,{children:j})]});return(0,t.jsx)("li",{ref:er.current,id:ei||eh||"/",className:(0,c.cn)("relative scroll-m-4 first:scroll-m-20",(0,h.themeSidebarItem)({theme:et}),en&&"animate-pulse pointer-events-none",ey&&"animate-pulse opacity-60",A),"data-title":ex,"data-active":ep||void 0,[l.ACTIVE_NAV_ITEM_ATTRIBUTE]:ep||void 0,"aria-hidden":en||void 0,children:en?(0,t.jsx)("div",{className:ek,style:ew,children:eC}):(0,t.jsx)(z.default,{prefetch:!1,href:ev,className:ek,style:ew,target:ei||eh&&(0,k.isAbsoluteUrl)(eh)?"_blank":void 0,rel:ei||eh&&(0,k.isAbsoluteUrl)(eh)?"noopener noreferrer":void 0,"aria-current":ep?"page":void 0,"aria-busy":ey||void 0,onClick:()=>{ei||!eh||(0,k.isAbsoluteUrl)(eh)||X?.(eh),K({...$?.properties,name:ex,url:ei||eh||"/"})},children:eC})})})},141180,e=>{"use strict";e.s(["SidebarLoginButtonContext",()=>x,"SidebarLoginButtonProvider",()=>f]);var t=e.i(843476),r=e.i(206558),n=e.i(803333),a=e.i(997588),s=e.i(166303),o=e.i(715274),i=e.i(476781);e.i(576003);var l=e.i(452957),c=e.i(378114);e.i(456084);var u=e.i(941659),d=e.i(588420),h=e.i(296548),p=e.i(522016),m=e.i(271645),g=e.i(91557);let x=(0,m.createContext)({authLoginButton:null,userAuthLoginButton:null,authLogoutButton:null,userAuthLogoutButton:null});function f({children:e}){let{userInfo:f,userAuth:b,auth:y,isFetchingUserInfo:v}=(0,m.useContext)(g.AuthContext),{docsConfig:k}=(0,m.useContext)(g.DocsConfigContext),{logout:w}=(0,a.useLogout)(),C=(0,n.useCurrentPath)(),j=(0,l.getActionClassname)(k?.theme),N=!1!==v,S=(0,m.useCallback)((e,r,n,a)=>a?(0,t.jsx)("button",{onClick:a,className:"w-full text-left",children:(0,t.jsx)(c.NavItem,{entry:{href:"#",title:n},shouldAutoNavigateOnGroupClick:!0,sidebarItemStyle:"undecorated",trailingIcon:(0,t.jsx)(d.ArrowUpRight2Icon,{"aria-hidden":"true",strokeWidth:2,className:"size-3.5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500 dark:group-hover:text-gray-400 shrink-0"})})}):(0,t.jsx)(c.NavItem,{entry:{href:r,title:n},shouldAutoNavigateOnGroupClick:!0,sidebarItemStyle:"undecorated",trailingIcon:(0,t.jsx)(d.ArrowUpRight2Icon,{"aria-hidden":"true",strokeWidth:2,className:"size-3.5 text-gray-400 dark:text-gray-500 group-hover:text-gray-500 dark:group-hover:text-gray-400 shrink-0"})}),[]),I=(0,m.useMemo)(()=>(0,t.jsx)(c.NavItem,{entry:{href:`${u.SKELETON_HREF_MARKER}auth-button`,title:"Log Out"},shouldAutoNavigateOnGroupClick:!0,sidebarItemStyle:"undecorated"}),[]),P=(0,m.useMemo)(()=>{let e,r,n;if(v||f||!b)return null;switch(b.type){case"jwt":r=b.loginUrl,e=(0,t.jsx)(p.default,{href:r,className:(0,h.cn)(j,i.Classes.LoginLink),children:"Log In"});break;case"shared-session":if(!b.loginUrl)return null;r=b.loginUrl,e=(0,t.jsx)(p.default,{href:r,className:(0,h.cn)(j,i.Classes.LoginLink),children:"Log In"});break;case"oauth":r="#",n=()=>(0,s.default)(b),e=(0,t.jsx)("button",{onClick:()=>(0,s.default)(b),className:(0,h.cn)(j,i.Classes.LoginLink),children:"Log In"});break;default:return null}return S(e,r,"Log In",n)},[v,b,f,S,j]),A=(0,m.useMemo)(()=>{if(f||!y||!1!==v)return null;let e=`/${r.NEXT_PUBLIC.BASE_PATH}/login?redirect=${C}`.replace(/\/{2,}/g,"/");return S((0,t.jsx)(p.default,{href:e,className:(0,h.cn)(j,i.Classes.LoginLink),children:"Log In"}),e,"Log In")},[C,y,f,v,S,j]),E=(0,m.useMemo)(()=>N&&y?I:f&&y?S((0,t.jsx)("button",{onClick:()=>w({redirectOverride:y.logoutUrl}),className:(0,h.cn)(j,i.Classes.LogoutLink),children:"Log Out"}),"#","Log Out",()=>w({redirectOverride:y.logoutUrl})):null,[N,I,f,y,w,S,j]),M=(0,m.useMemo)(()=>{if(N&&b&&!y)return I;if(!f||!b)return null;let e=()=>{try{localStorage.removeItem(o.USERINFO_LOCALSTORAGE_KEY)}catch{}window.location.reload()};return S((0,t.jsx)("button",{onClick:e,className:(0,h.cn)(j,i.Classes.LogoutLink),children:"Log Out"}),"#","Log Out",e)},[N,I,f,b,y,S,j]);return(0,t.jsx)(x.Provider,{value:{userAuthLoginButton:P,authLoginButton:A,authLogoutButton:E,userAuthLogoutButton:M},children:e})}},710949,e=>{"use strict";e.s(["Drawer",()=>e8,"DrawerBackdrop",()=>e7,"DrawerClose",()=>tt,"DrawerHandle",()=>e9,"DrawerPopup",()=>e6,"DrawerPortal",()=>te,"DrawerViewport",()=>e3],710949);var t,r,n=e.i(843476);e.s(["Backdrop",()=>u,"Close",()=>d,"Content",()=>p,"Description",()=>m,"Handle",()=>eQ,"Indent",()=>y,"IndentBackground",()=>k,"Popup",()=>W,"Portal",()=>B,"Provider",()=>U,"Root",()=>J,"SwipeArea",()=>ev,"Title",()=>ek,"Trigger",()=>ew,"Viewport",()=>eR,"VirtualKeyboardProvider",()=>eX,"createHandle",()=>eJ],458954),e.s([],54383),e.i(54383),e.i(247167);var a=e.i(271645),s=e.i(108821),o=e.i(552245),i=e.i(405005);let l=function(e){return e.nestedDrawers="--nested-drawers",e.height="--drawer-height",e.frontmostHeight="--drawer-frontmost-height",e.swipeMovementX="--drawer-swipe-movement-x",e.swipeMovementY="--drawer-swipe-movement-y",e.snapPointOffset="--drawer-snap-point-offset",e.swipeStrength="--drawer-swipe-strength",e}({}),c=function(e){return e.swipeProgress="--drawer-swipe-progress",e}({}),u=a.forwardRef(function(e,t){let{render:r,className:n,style:a,forceRender:u=!1,...d}=e,h=(0,s.useDialogRootContext)(),p=h.useState("open"),m=h.useState("nested"),g=h.useState("mounted"),x=h.useState("transitionStatus");return(0,o.useRenderElement)("div",e,{state:{open:p,transitionStatus:x},ref:[h.context.backdropRef,t],stateAttributesMapping:i.popupTransitionStateMapping,props:[{role:"presentation",hidden:!g,style:{pointerEvents:p?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[c.swipeProgress]:"0",[l.swipeStrength]:"1"}},d],enabled:u||!m})}),d=e.i(156736).DialogClose,h="data-drawer-content",p=a.forwardRef(function(e,t){let{render:r,className:n,style:a,...i}=e;return(0,s.useDialogRootContext)(),(0,o.useRenderElement)("div",e,{ref:t,props:[{[h]:""},i]})}),m=e.i(209793).DialogDescription;var g=e.i(146376);let x=a.createContext(void 0);function f(){return a.useContext(x)}let b={active:e=>e?{"data-active":""}:{"data-inactive":""}},y=a.forwardRef(function(e,t){let{render:r,className:n,style:s,...i}=e,u=f(),d=u?.active??!1,h=u?.visualStateStore,p=a.useRef(null);return(0,g.useIsoLayoutEffect)(()=>{let e=p.current;if(!e||!h)return;let t=()=>{let{swipeProgress:t,frontmostHeight:r}=h.getSnapshot();t<=0?e.style.setProperty(c.swipeProgress,"0"):e.style.setProperty(c.swipeProgress,`${t}`),r<=0?e.style.removeProperty(l.height):e.style.setProperty(l.height,`${r}px`)};t();let r=h.subscribe(t);return()=>{r(),e.style.setProperty(c.swipeProgress,"0"),e.style.removeProperty(l.height)}},[h]),(0,o.useRenderElement)("div",e,{ref:[t,p],state:{active:d},props:[{style:{[c.swipeProgress]:"0"}},i],stateAttributesMapping:b})}),v={active:e=>e?{"data-active":""}:{"data-inactive":""}},k=a.forwardRef(function(e,t){let{render:r,className:n,style:a,...s}=e,i=f(),l=i?.active??!1;return(0,o.useRenderElement)("div",e,{ref:t,state:{active:l},props:s,stateAttributesMapping:v})});var w=e.i(667865),C=e.i(956789),j=e.i(61487);let N=function(e){return e[e.open=i.CommonPopupDataAttributes.open]="open",e[e.closed=i.CommonPopupDataAttributes.closed]="closed",e[e.startingStyle=i.CommonPopupDataAttributes.startingStyle]="startingStyle",e[e.endingStyle=i.CommonPopupDataAttributes.endingStyle]="endingStyle",e.expanded="data-expanded",e.nestedDrawerOpen="data-nested-drawer-open",e.nestedDrawerSwiping="data-nested-drawer-swiping",e.swipeDismiss="data-swipe-dismiss",e.swipeDirection="data-swipe-direction",e.swiping="data-swiping",e}({});var S=e.i(625834),I=e.i(137584),P=e.i(673327),A=e.i(733332);let E=a.createContext(void 0);function M(e){let t=a.useContext(E);if(!0!==e&&void 0===t)throw Error((0,A.default)(90));return t}var R=e.i(108868),T=e.i(201675);function L(e,t){let r=e+t;return r>=0?t:-Math.sqrt(-r)-e}function D(e,t,r){if(!Number.isFinite(t)||t<=0)return null;if("number"==typeof e)return Number.isFinite(e)?e<=1?(0,T.clamp)(e,0,1)*t:e:null;let n=e.trim();if(n.endsWith("px")){let e=Number.parseFloat(n);return Number.isFinite(e)?e:null}if(n.endsWith("rem")){let e=Number.parseFloat(n);return Number.isFinite(e)?e*r:null}return null}function _(e,t){let r=-1,n=1/0;for(let a=0;a{let e=(0,R.ownerDocument)(i).documentElement;c(i?i.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&d(t)});(0,g.useIsoLayoutEffect)(()=>{if(h(),!i||"function"!=typeof ResizeObserver)return;let e=new ResizeObserver(h);return e.observe(i),()=>{e.disconnect()}},[h,i]);let p=a.useMemo(()=>{if(!t||0===t.length||l<=0||o<=0)return[];let e=Math.min(o,l),r=t.map(t=>{let r=D(t,l,u);if(null===r)return null;let n=(0,T.clamp)(r,0,e);return{value:t,height:n,offset:Math.max(0,o-n)}}).filter(e=>!!e);if(r.length<=1)return r;let n=[],a=[];for(let e=r.length-1;e>=0;e-=1){let t=r[e];a.some(e=>1>=Math.abs(e-t.height))||(a.push(t.height),n.push(t))}return n.reverse(),n},[o,u,t,l]),m=a.useMemo(()=>{if(null===r)return;let e=p.find(e=>Object.is(e.value,r));if(e)return e;let t=Math.min(o,l),n=D(r,l,u);if(null===n)return;let a=(0,T.clamp)(n,0,t);return p[_(p.map(e=>e.height),a)]},[r,o,p,u,l]);return{snapPoints:t,activeSnapPoint:r,setActiveSnapPoint:n,popupHeight:o,viewportHeight:l,resolvedSnapPoints:p,activeSnapPointOffset:m?.offset??null}}let H=a.createContext(null);var $=e.i(264111);let O=!1,F={...i.popupTransitionStateMapping,expanded:e=>e?{[N.expanded]:""}:null,nestedDrawerOpen:e=>e?{[N.nestedDrawerOpen]:""}:null,nestedDrawerSwiping:e=>e?{[N.nestedDrawerSwiping]:""}:null,swipeDirection:e=>({[N.swipeDirection]:e}),swiping:e=>e?{[N.swiping]:""}:null},W=a.forwardRef(function(e,t){let r,{render:i,className:u,style:d,finalFocus:h,initialFocus:p,...m}=e,x=(0,s.useDialogRootContext)(),f=x.context.popupRef,{swipeDirection:b,frontmostHeight:y,hasNestedDrawer:v,nestedSwiping:k,nestedSwipeProgressStore:N,onPopupHeightChange:A,notifyParentFrontmostHeight:E,notifyParentHasNestedDrawer:R}=M(),T=x.useState("descriptionElementId"),D=x.useState("disablePointerDismissal"),_=x.useState("floatingRootContext"),W=x.useState("popupProps"),B=x.useState("modal"),U=x.useState("mounted"),Y=x.useState("nested"),X=x.useState("nestedOpenDrawerCount"),V=x.useState("transitionStatus"),q=x.useState("open"),K=x.useState("openMethod"),G=x.useState("titleElementId"),Z=x.useState("role"),Q=_.useState("floatingId"),J=m.id??Q,ee=a.useContext(H);(0,S.useDialogPortalContext)();let{snapPoints:et,activeSnapPoint:er,activeSnapPointOffset:en}=z(),ea=X>0,es=ee?.swiping??!1,eo=ee?.swipeStrength??null,[ei,el]=a.useState(0),ec=a.useRef(0),eu=(0,w.useStableCallback)(()=>{let e=f.current;if(!e)return;let t=e.offsetHeight;if(!(ec.current>0)||!(y>ec.current)||!(t>ec.current)){if(ec.current>0&&v){let e=ec.current;el(e),A(e);return}t!==ec.current&&(ec.current=t,el(t),A(t))}});(0,g.useIsoLayoutEffect)(()=>{if(!U){ec.current=0,el(0),A(0);return}let e=f.current;if(!e||(O||("undefined"!=typeof CSS&&"registerProperty"in CSS&&([l.swipeMovementX,l.swipeMovementY,l.snapPointOffset].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"",inherits:!1,initialValue:"0px"})}catch{}}),[{name:c.swipeProgress,initialValue:"0"},{name:l.swipeStrength,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"",inherits:!1,initialValue:t})}catch{}})),O=!0),eu(),"function"!=typeof ResizeObserver))return;let t=new ResizeObserver(eu);return t.observe(e),()=>{t.disconnect()}},[eu,U,ea,A,f]),(0,g.useIsoLayoutEffect)(()=>{let e=()=>{let e=f.current;if(!e)return;let t=N.getSnapshot();t>0?e.style.setProperty(c.swipeProgress,`${t}`):e.style.setProperty(c.swipeProgress,"0")};e();let t=N.subscribe(e),r=f.current;return()=>{t(),r&&r.style.setProperty(c.swipeProgress,"0")}},[N,f]),(0,g.useIsoLayoutEffect)(()=>{if(q)return E?.(y),()=>{E?.(0)}},[y,q,E]),(0,g.useIsoLayoutEffect)(()=>{if(R)return R(q||"ending"===V),()=>{R(!1)}},[R,q,V]),(0,I.useOpenChangeComplete)({open:q,ref:f,onComplete(){q&&x.context.onOpenChangeComplete?.(!0)}});let ed=void 0===p?f:p,eh=x.useStateSetter("popupElement"),ep=!v&&"ending"!==V;ei&&!ep&&(r=`${ei}px`);let em=et&&et.length>0&&("down"===b||"up"===b),eg=null;em&&null!==en&&(eg="up"===b?-en:en);let ex=ee?ee.getDragStyles():C.EMPTY_OBJECT;if(em&&"down"===b){let e=Number.parseFloat(String(ex[l.swipeMovementY]));ex=es&&Number.isFinite(e)?{...ex,transform:void 0,[l.swipeMovementY]:`${L(en??0,e)}px`}:{...ex,transform:void 0}}let ef=(0,o.useRenderElement)("div",e,{state:{open:q,nested:Y,transitionStatus:V,expanded:1===er,nestedDrawerOpen:ea,nestedDrawerSwiping:k,swipeDirection:b,swiping:es},props:[W,{id:J,"aria-labelledby":G,"aria-describedby":T,role:Z,...$.FOCUSABLE_POPUP_PROPS,hidden:!U,onKeyDown(e){P.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()},style:{...ex,[c.swipeProgress]:"0",[l.nestedDrawers]:X,[l.height]:r,[l.snapPointOffset]:"number"==typeof eg?`${eg}px`:"0px",[l.frontmostHeight]:y?`${y}px`:void 0,[l.swipeStrength]:"number"==typeof eo&&Number.isFinite(eo)&&eo>0?`${eo}`:"1"}},m],ref:[t,f,eh],stateAttributesMapping:F});return(0,n.jsx)(j.FloatingFocusManager,{context:_,openInteractionType:K,disabled:!U,closeOnFocusOut:!D,initialFocus:ed,returnFocus:h,modal:!1!==B,restoreFocus:"popup",children:ef})}),B=e.i(264951).DialogPortal;function U(e){let{children:t}=e,[r,s]=a.useState(()=>new Set),[o]=a.useState(Y),i=(0,w.useStableCallback)((e,t)=>{s(r=>{if(r.has(e)===t)return r;let n=new Set(r);return t?n.add(e):n.delete(e),n})}),l=(0,w.useStableCallback)(e=>{i(e,!1)}),c=r.size>0,u=a.useMemo(()=>({setDrawerOpen:i,removeDrawer:l,active:c,visualStateStore:o}),[c,l,i,o]);return(0,n.jsx)(x.Provider,{value:u,children:t})}function Y(){let e={swipeProgress:0,frontmostHeight:0},t=new Set;return{getSnapshot:()=>e,set(r){let n=e.swipeProgress;void 0!==r.swipeProgress&&(n=Number.isFinite(r.swipeProgress)?r.swipeProgress:0);let a=e.frontmostHeight;void 0!==r.frontmostHeight&&(a=Number.isFinite(r.frontmostHeight)?r.frontmostHeight:0),(n!==e.swipeProgress||a!==e.frontmostHeight)&&(e={swipeProgress:n,frontmostHeight:a},t.forEach(e=>{e()}))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}var X=e.i(574735),V=e.i(951437),q=e.i(333848),K=e.i(328744),G=e.i(675606),Z=e.i(56434),Q=e.i(366250);function J(e){let{children:s,open:o,defaultOpen:i=!1,onOpenChange:l,onOpenChangeComplete:c,disablePointerDismissal:u=!1,modal:d=!0,actionsRef:h,handle:p,triggerId:m,defaultTriggerId:g=null,swipeDirection:x="down",snapToSequentialPoints:f=!1,snapPoints:b,snapPoint:y,defaultSnapPoint:v,onSnapPointChange:k}=e,C=M(!0),j=C?.onNestedSwipeProgressChange,N=C?.onNestedFrontmostHeightChange,S=C?.onNestedSwipingChange,I=C?.onNestedDrawerPresenceChange,[P,A]=a.useState(0),[R,T]=a.useState(0),[L,D]=a.useState(!1),[_,z]=a.useState(!1),[H]=a.useState(ee),$=void 0!==v?v:b?.[0]??null,O=void 0!==y,[F,W]=(0,V.useControlled)({controlled:y,default:$,name:"Drawer",state:"snapPoint"}),B=a.useRef(!1),U=a.useRef(!1),Y=(0,w.useStableCallback)((e,t)=>{let r=t??(0,G.createChangeEventDetails)(Z.REASONS.none);k?.(e,r),r.isCanceled||W(e)}),X=a.useMemo(()=>O||!b||0===b.length||null!==F&&b.some(e=>Object.is(e,F))?F:$,[F,O,$,b]),q=(0,w.useStableCallback)(e=>{A(e),!B.current&&e>0&&T(e)}),K=(0,w.useStableCallback)(e=>{if(e>0){B.current=!0,T(e);return}B.current=!1,P>0&&T(P)}),J=(0,w.useStableCallback)(e=>{D(e)}),er=(0,w.useStableCallback)(e=>{H.set(e),j?.(e)}),en=(0,w.useStableCallback)(e=>{z(e),S?.(e)}),ea=(0,w.useStableCallback)((e,t)=>{l?.(e,t),!t.isCanceled&&!e&&b&&b.length>0&&Y($,(0,G.createChangeEventDetails)(t.reason,t.event,t.trigger))}),es=a.useMemo(()=>({swipeDirection:x,swipeAreaActiveRef:U,snapToSequentialPoints:f,snapPoints:b,activeSnapPoint:X,setActiveSnapPoint:Y,frontmostHeight:R,popupHeight:P,hasNestedDrawer:L,nestedSwiping:_,nestedSwipeProgressStore:H,onNestedDrawerPresenceChange:J,onPopupHeightChange:q,onNestedFrontmostHeightChange:K,onNestedSwipingChange:en,onNestedSwipeProgressChange:er,notifyParentFrontmostHeight:N,notifyParentSwipingChange:S,notifyParentSwipeProgressChange:j,notifyParentHasNestedDrawer:I}),[X,R,L,_,H,I,j,S,N,J,K,er,en,q,P,Y,b,f,U,x]),eo="function"==typeof s?e=>(0,n.jsxs)(a.Fragment,{children:[t||(t=(0,n.jsx)(et,{})),s(e)]}):(0,n.jsxs)(a.Fragment,{children:[r||(r=(0,n.jsx)(et,{})),s]}),ei=(0,Q.useRenderDialogRoot)("drawer",{open:o,defaultOpen:i,onOpenChange:ea,onOpenChangeComplete:c,disablePointerDismissal:u,modal:d,actionsRef:h,handle:p,triggerId:m,defaultTriggerId:g,children:eo});return(0,n.jsx)(E.Provider,{value:es,children:ei})}function ee(){let e=0,t=new Set;return{getSnapshot:()=>e,set(r){let n=Number.isFinite(r)?r:0;n!==e&&(e=n,t.forEach(e=>{e()}))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}function et(){let e=f(),t=(0,s.useDialogRootContext)(!1),r=e?.setDrawerOpen,n=e?.removeDrawer,o=t.useState("open"),i=t.useState("nestedOpenDialogCount"),l=t.useState("popupElement"),c=0===i;return(0,g.useIsoLayoutEffect)(()=>{if(n)return()=>{n(t)}},[n,t]),(0,g.useIsoLayoutEffect)(()=>{r?.(t,o)},[o,r,t]),a.useEffect(()=>{if(!o||!c||!K.platform.os.android)return;let e=(0,q.ownerWindow)(l).CloseWatcher;if(!e)return;let r=new e,n=(0,X.addEventListener)(r,"close",function(e){t.select("open")&&t.setOpen(!1,(0,G.createChangeEventDetails)(Z.REASONS.closeWatcher,e))});return()=>{n(),r.destroy()}},[t,c,o,l]),null}var er=e.i(647554),en=e.i(496545);function ea(e,t,r){return"function"==typeof e?.elementFromPoint?e.elementFromPoint(t,r):null}function es(e,t,r){switch(e){case"up":return-r;case"down":return r;case"left":return-t;case"right":return t;default:return 0}}function eo(e){let t=(0,q.ownerWindow)(e).getComputedStyle(e).transform,r=0,n=0,a=1;if(t&&"none"!==t){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(", ").map(parseFloat);6===t.length?(r=t[4],n=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):16===t.length&&(r=t[12],n=t[13],a=t[0])}}return{x:r,y:n,scale:a}}function ei(e){return Number.isFinite(e)&&e>0?e:null}function el(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function ec(e,t,r){let n=e[r];if("function"==typeof n)try{n.call(e,t)}catch(e){if(e&&"object"==typeof e&&"name"in e&&"NotFoundError"===e.name)return;throw e}}function eu(e){let{enabled:t,directions:r,elementRef:n,movementCssVars:s,canStart:o,ignoreSelectorWhenTouch:i=!0,ignoreScrollableAncestors:l=!1,swipeThreshold:c,onDismiss:u,onProgress:d,onCancel:h,onSwipeStart:p,onRelease:m,onSwipingChange:g,trackDrag:x=!0}=e,f=1===r.length?r[0]:void 0,b=Math.max(0,"number"==typeof c?c:40),y=r.includes("left"),v=r.includes("right"),k=r.includes("up"),C=r.includes("down"),j=y||v,N=k||C,S=a.useMemo(()=>{let e=[];return N&&e.push("vertical"),j&&e.push("horizontal"),e},[j,N]),[I,P]=a.useState(void 0),[A,E]=a.useState(!1),[M,L]=a.useState(!1),D=a.useRef({x:0,y:0}),_=a.useRef({x:0,y:0}),z=a.useRef(null),H=a.useRef({x:0,y:0,scale:1}),$=a.useRef(void 0),O=a.useRef(0),F=a.useRef(!1),W=a.useRef({x:0,y:0}),B=a.useRef(null),U=a.useRef(!1),Y=a.useRef(!1),X=a.useRef(null),V=a.useRef(!1),q=a.useRef(!1),K=a.useRef({width:0,height:0}),G=a.useRef(0),Z=a.useRef(b),Q=a.useRef(null),J=a.useRef(null),ee=a.useRef(null),et=a.useRef({x:0,y:0}),eu=a.useRef(null),ed=a.useRef(!1),eh=a.useRef(null),ep=(0,w.useStableCallback)(e=>{ed.current!==e&&(ed.current=e,E(e),g?.(e))});function em(e){if(!e)return;let t=n.current,r=Q.current;t&&r&&(Z.current=Math.max(0,r({element:t,direction:e})))}let eg=(0,w.useStableCallback)((e,t)=>{let r=Number.isFinite(e)?(0,T.clamp)(e,0,1):0,n=r!==G.current,a=!1;if(t){let e=eu.current;a=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}(n||a)&&(G.current=r,t?eu.current=t:n&&(eu.current=null),d?.(r,t))}),ex=(0,w.useStableCallback)(e=>{let t=n.current;if(!x||!t){e||(eh.current=null);return}let r=t.style,a=eh.current;e?(a||(eh.current=[r.transition,r.transform]),r.transition="none"):a&&([r.transition,r.transform]=a,eh.current=null);let o=_.current,i=H.current,l=o.x-i.x,c=o.y-i.y;e&&(r.transform=el(o,i.scale)),r.setProperty(s.x,`${l}px`),r.setProperty(s.y,`${c}px`)});function ef(e,t){if(null===t)return;let r=ee.current;if(r&&t>r.time){let n=Math.max(t-r.time,16);et.current={x:(e.x-r.x)/n,y:(e.y-r.y)/n}}ee.current={x:e.x,y:e.y,time:t}}let eb=a.useCallback(()=>{P(void 0),ep(!1),L(!1),eg(0),Z.current=b,Q.current=null,D.current={x:0,y:0},_.current={x:0,y:0},H.current={x:0,y:0,scale:1},$.current=void 0,O.current=0,F.current=!1,W.current={x:0,y:0},B.current=null,U.current=!1,z.current=null,Y.current=!1,X.current=null,V.current=!1,q.current=!1,K.current={width:0,height:0},J.current=null,ee.current=null,et.current={x:0,y:0},eu.current=null,ex(!1)},[ep,b,ex,eg]);function ey(e){if("touches"in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function ev(e){return"touches"in e||"touch"===e.pointerType}function ek(e,t){return ea(n.current?.getRootNode(),e.x,e.y)??(0,er.getTarget)(t)}function ew(e,t){return j&&!N?(0,en.findScrollableTouchTarget)(e,t,"horizontal"):N&&!j?(0,en.findScrollableTouchTarget)(e,t,"vertical"):(0,en.findScrollableTouchTarget)(e,t,"vertical")??(0,en.findScrollableTouchTarget)(e,t,"horizontal")}function eC(e,t,r){V.current=!1;let a=ev(e),s=ek(t,e.nativeEvent),o=(0,R.ownerDocument)(n.current).body,u=a&&o?ew(s,o):null,d=r?.ignoreScrollableTarget??!1;if(u&&!d||(V.current=!!(u&&d),s&&s.closest('button,a,input,select,textarea,label,[role="button"]')&&(!a||i)))return!1;let h=n.current;if(l&&h&&s&&S.length>0&&!r?.ignoreScrollableAncestors&&(0,en.hasScrollableAncestor)(s,h,S))return!1;if(F.current=!1,$.current=void 0,O.current=0,D.current=t,J.current=ei(e.timeStamp),W.current=t,z.current=t,Z.current=b,Q.current="function"==typeof c?c:null,h){K.current={width:h.offsetWidth,height:h.offsetHeight},em(f);let t=eo(h);H.current=t,_.current={x:t.x,y:t.y},ef({x:t.x,y:t.y},J.current),"touches"in e||ec(h,e.pointerId,"setPointerCapture")}return p?.(e.nativeEvent),ep(!0),B.current=null,U.current=!0,eg(0),ex(!0),!0}function ej(){eN(),V.current=!1,z.current=null}function eN(){Y.current=!1,X.current=null}let eS=(0,w.useStableCallback)(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!("touches"in e)&&0!==e.button)return;let r=ey(e);r&&(Y.current=!0,X.current=r,V.current=!1,q.current=!("touches"in e),(!o||o(r,{nativeEvent:e.nativeEvent,direction:f}))&&eC(e,r)&&eN())}),eI=(0,w.useStableCallback)(e=>{let a;if(!t)return;let s=_.current,o=H.current,i=s.x-o.x,l=s.y-o.y,c={deltaX:i,deltaY:l,direction:$.current};if(!ed.current){ej(),eg(0,c);return}ep(!1),B.current=null,ej(),q.current=!1;let d=n.current;!d||"touches"in e||ec(d,e.pointerId,"releasePointerCapture");let h=J.current,p=ei(e.timeStamp),g=null!==h&&null!==p&&p>h?p-h:0,x=g>0?Math.max(g,50):0,b=x>0?i/x:0,y=x>0?l/x:0,v=et.current.x,k=et.current.y,w=ee.current;if(w&&null!==p&&p>=w.time){let e=p-w.time;if(e<=80){let t=Math.max(e,16),r=s.x-w.x,n=s.y-w.y,a=r/t,o=n/t;0!==a&&(v=a),0!==o&&(k=o)}else v=0,k=0}let C=m?.({event:e.nativeEvent,direction:$.current,deltaX:i,deltaY:l,velocityX:b,velocityY:y,releaseVelocityX:v,releaseVelocityY:k}),j="boolean"==typeof C;if(F.current&&!j){_.current={x:o.x,y:o.y},P(void 0),ex(!1),eg(0,c);return}let N=!1;if(j)N=C,a=$.current??f;else for(let e of r)if(es(e,i,l)>Z.current){N=!0,a=e;break}N&&a?(P(a),L(!0),ex(!1),u?.(e.nativeEvent,{direction:a})):(_.current={x:o.x,y:o.y},P(void 0),ex(!1),eg(0,c))}),eP=(0,w.useStableCallback)(e=>{let r=ey(e);if(!r)return;let a=!1;if(!("touches"in e)){let t=e.buttons%2==1;if(t&&(q.current=!0),0!==e.buttons&&!t)return void function(e){if(ej(),!ed.current)return;ep(!1),B.current=null;let t=H.current;_.current={x:t.x,y:t.y},P(void 0),q.current=!1,ex(!1);let r=n.current;r&&ec(r,e.pointerId,"releasePointerCapture"),eg(0,{deltaX:0,deltaY:0,direction:void 0}),h?.(e.nativeEvent)}(e);if(0===e.buttons&&q.current){if(!ed.current)return void eI(e);a=!0}}if(!A&&Y.current){if(!ev(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented))return void ej();if(!o||o(r,{nativeEvent:e.nativeEvent,direction:f})){let t=X.current,a=!1;if(ev(e)){let s=n.current;if(t&&s){let n=ek(r,e.nativeEvent),o=(0,R.ownerDocument)(s).body,i=o?ew(n,o):null;if(i&&((0,er.contains)(s,i)||(0,er.contains)(i,s))){let e=function(e,t,r){let n=(e,t,r,n,a)=>e>0&&t<=0&&n||e<0&&t>=Math.max(0,r)&&a,a=Math.abs(t),s=Math.abs(r);return N&&0!==r&&(!j||s>=a)?n(r,e.scrollTop,e.scrollHeight-e.clientHeight,C,k):j&&0!==t&&(!N||a>s)?n(t,e.scrollLeft,e.scrollWidth-e.clientWidth,v,y):null}(i,r.x-t.x,r.y-t.y);if(!1===e)return;!0===e&&(a=!0)}}}eC(e,r,{ignoreScrollableTarget:a,ignoreScrollableAncestors:a})&&(t&&a?(eN(),D.current=t,W.current=t,z.current=t,U.current=!1):(eN(),V.current=!1))}}let s=z.current,i=null===s?{x:0,y:0}:{x:r.x-s.x,y:r.y-s.y};z.current=r,function(e,r,n){let a;if(!t||!ed.current)return;let s=(0,er.getTarget)(e.nativeEvent);if(ev(e)&&!V.current&&ew(s,e.currentTarget))return;if("touches"in e||e.preventDefault(),U.current&&(U.current=!1,x)){D.current=r;let t=ei(e.timeStamp);null!==t&&(J.current=t)}let o=r.x,i=r.y,l=n.x,c=n.y;(c<0&&i>W.current.y||c>0&&iW.current.x||l>0&&o=1&&(B.current=m=Math.abs(u)>Math.abs(d)?"horizontal":"vertical"),$.current){let e=$.current,t=es(e,p,h);t>Z.current?(F.current=!1,P(e)):y&&v||k&&C||!(O.current-t>=10)||(F.current=!0)}else"vertical"===m?d>0?a="down":d<0&&(a="up"):"horizontal"===m?u>0?a="right":u<0&&(a="left"):a=Math.abs(u)>=Math.abs(d)?u>0?"right":"left":d>0?"down":"up",a&&("left"===a&&y||"right"===a&&v||"up"===a&&k||"down"===a&&C)&&($.current=a,O.current=es(a,u,d),P(a),em(a));let g=function(e,t){let r=e=>Math.sign(e)*Math.abs(e)**.5,n=(e,t,n)=>!t&&e<0||!n&&e>0?r(e):e;return{x:j?n(e,y,v):r(e),y:N?n(t,k,C):r(t)}}(u,d),b=H.current.x,w=H.current.y;"horizontal"===m?j&&(b+=g.x):("vertical"===m||j&&(b+=g.x),N&&(w+=g.y));let S=_.current,I=b!==S.x||w!==S.y;_.current={x:b,y:w},I&&ex(!0),ef({x:b,y:w},ei(e.timeStamp));let A=b-H.current.x,E=w-H.current.y,M={deltaX:A,deltaY:E,direction:$.current},R=0,T=f??$.current;if(T){let e="left"===T||"right"===T?K.current.width:K.current.height,t=H.current.scale||1,r=es(T,A,E);e>0&&t>0&&r>0&&(R=r/(e*t))}eg(R,M)}(e,r,i),!a||"touches"in e||eI(e)}),eA=(0,w.useStableCallback)((e,t)=>{eP({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),eE=a.useCallback(()=>{let e=ed.current,t=_.current,r=H.current,n=t.x-r.x,a=t.y-r.y;return e||0!==n||0!==a||M?{transition:e?"none":void 0,transform:e?el(t,r.scale):void 0,[s.x]:`${n}px`,[s.y]:`${a}px`}:{[s.x]:"0px",[s.y]:"0px"}},[M,s]);return{swiping:A,swipeDirection:I,dragDismissed:M,getPointerProps:a.useCallback(()=>t?{onPointerDown:eS,onPointerMove:eP,onPointerUp:eI,onPointerCancel:eI}:{},[t,eI,eP,eS]),getTouchProps:a.useCallback(()=>t?{onTouchStart:eS,onTouchMove:eP,onTouchEnd:eI,onTouchCancel:eI}:{},[t,eI,eP,eS]),moveNative:eA,getDragStyles:eE,reset:eb}}var ed=e.i(788015),eh=e.i(157940);let ep=function(e){return e[e.open=i.CommonPopupDataAttributes.open]="open",e[e.closed=i.CommonPopupDataAttributes.closed]="closed",e.disabled="data-disabled",e.swipeDirection="data-swipe-direction",e.swiping="data-swiping",e}({}),em={[ep.open]:""},eg={[ep.closed]:""},ex={[ep.swiping]:""},ef={[ep.disabled]:""},eb={open:e=>e?em:eg,swiping:e=>e?ex:null,swipeDirection:e=>({[ep.swipeDirection]:e}),disabled:e=>e?ef:null},ey={up:"down",down:"up",left:"right",right:"left"},ev=a.forwardRef(function(e,t){let{render:r,className:n,style:i,disabled:u=!1,swipeDirection:d,...h}=e,p=(0,s.useDialogRootContext)(),{swipeDirection:m,frontmostHeight:x,swipeAreaActiveRef:b}=M(),y=f(),[v,k]=a.useState(!1),j=a.useRef(null),S=a.useRef(null),I=a.useRef(!1),P=a.useRef({x:0,y:0}),A=a.useRef(null),E=a.useRef(!1),T=a.useRef(null),L=a.useRef(null),D=a.useRef(null),_=a.useRef(C.NOOP),z=(0,ed.useBaseUiId)(e.id),H=(0,$.useTriggerRegistration)(z,p),O=p.useState("open"),F=(0,w.useStableCallback)(()=>{P.current.x=0,P.current.y=0}),W=d??ey[m],B=ey[W],U=!u&&(!O||v),Y=(0,w.useStableCallback)(()=>{_.current();let e=(0,R.ownerDocument)(j.current);function t(r){(r?.type!=="click"||0===r.detail||(0,eh.isVirtualClick)(r))&&(_.current=C.NOOP,e.removeEventListener("pointerdown",t,!0),e.removeEventListener("click",t,!0),p.context.outsidePressEnabledRef.current=!0)}_.current=t,e.addEventListener("pointerdown",t,!0),e.addEventListener("click",t,!0)});function X(e){let t="left"===B||"right"===B?e.offsetWidth:e.offsetHeight;return t<=0?null:t}function V(){let e=p.context.popupRef.current;if(!e||!p.select("open")||!p.select("mounted"))return;null==A.current&&(A.current=function(e){let t=X(e);if(null==t)return null;let r=eo(e),n="left"===B||"right"===B?r.x:r.y;return Number.isFinite(n)&&Math.abs(n)>.5?Math.min(t,Math.abs(n)):t}(e));let t=A.current;if(null===t)return;let{x:r,y:n}=P.current,a=Math.max(0,es(W,r,n)),s=a>t?t+Math.sqrt(a-t):a,o=(t-s)*("left"===B||"up"===B?-1:1),i="left"===B||"right"===B,u=Math.max(0,Math.min(1,a/t)),d=Math.max(0,Math.min(1,1-u));e.style.setProperty(l.swipeMovementX,`${i?o:0}px`),e.style.setProperty(l.swipeMovementY,`${i?0:o}px`),e.setAttribute(N.swiping,""),T.current=e,null===D.current&&(D.current=e.style.transition),e.style.transition="none";let h=p.context.backdropRef.current;h&&(h.setAttribute(N.swiping,""),L.current=h,h.style.setProperty(c.swipeProgress,`${d}`),u>0&&x>0?h.style.setProperty(l.height,`${x}px`):h.style.removeProperty(l.height)),y?.visualStateStore.set({swipeProgress:u,frontmostHeight:u>0?x:0}),E.current=!0,b.current=!0}let q=(0,w.useStableCallback)(()=>{let e=T.current;e&&(e.style.removeProperty(l.swipeMovementX),e.style.removeProperty(l.swipeMovementY),e.removeAttribute(N.swiping)),e&&null!==D.current&&(e.style.transition=D.current,D.current=null);let t=L.current;t&&(t.removeAttribute(N.swiping),t.style.setProperty(c.swipeProgress,"0"),t.style.removeProperty(l.height)),y?.visualStateStore.set({swipeProgress:0,frontmostHeight:0}),E.current=!1,T.current=null,L.current=null,b.current=!1});function K(e){I.current=!0,p.setOpen(!0,(0,G.createChangeEventDetails)(Z.REASONS.swipe,e,j.current))}function Q(){S.current=null,I.current=!1,A.current=null,k(!1)}function J(){Q(),Y(),F(),q()}let ee=eu({enabled:U,directions:[W],elementRef:j,trackDrag:!1,movementCssVars:{x:l.swipeMovementX,y:l.swipeMovementY},onSwipeStart(e){_.current(),p.context.outsidePressEnabledRef.current=!1,S.current=e,I.current=!1,k(!0),F()},onProgress(e,t){if(!t||!S.current||(P.current.x=t.deltaX,P.current.y=t.deltaY,t.direction!==W))return;let r=es(W,t.deltaX,t.deltaY);(I.current||!(r<1))&&(I.current||p.select("open")||K(S.current),V())},onRelease({event:e,direction:t,deltaX:r,deltaY:n,releaseVelocityX:a,releaseVelocityY:s}){let o=es(W,r,n),i=es(W,a,s),l=function(){let e=function(){let e=p.context.popupRef.current;return e?X(e):null}();return null==e?40:.5*e}();if(t===W&&(o>=l||i>=.1)&&!u)p.select("open")||K(e);else I.current&&p.select("open")&&p.setOpen(!1,(0,G.createChangeEventDetails)(Z.REASONS.swipe,e,j.current));return J(),!1},onCancel:J}),et=ee.getPointerProps(),er=ee.getTouchProps(),en=ee.reset;(0,g.useIsoLayoutEffect)(()=>{v&&E.current&&V()}),(0,g.useIsoLayoutEffect)(()=>{U||(v&&Y(),en(),F(),q(),Q())},[q,Y,U,F,en,v]),a.useEffect(()=>()=>{_.current(),p.context.outsidePressEnabledRef.current=!0},[p]);let ea={open:O,swiping:ee.swiping,swipeDirection:W,disabled:u};return(0,o.useRenderElement)("div",e,{state:ea,ref:[t,j,H],stateAttributesMapping:eb,props:[{role:"presentation","aria-hidden":!0,style:{pointerEvents:U?void 0:"none",touchAction:"left"===W||"right"===W?"pan-y":"pan-x"},onPointerDown(e){"touch"!==e.pointerType&&(et.onPointerDown?.(e),e.cancelable&&e.preventDefault())},onPointerMove(e){"touch"!==e.pointerType&&et.onPointerMove?.(e)},onPointerUp(e){"touch"!==e.pointerType&&et.onPointerUp?.(e)},onPointerCancel(e){"touch"!==e.pointerType&&et.onPointerCancel?.(e)}},er,z?{id:z}:void 0,h]})}),ek=e.i(77173).DialogTitle,ew=e.i(313488).DialogTrigger;var eC=e.i(174080),ej=e.i(229315),eN=e.i(708445),eS=e.i(974217),eI=e.i(176782),eP=e.i(209407),eA=e.i(638396);let eE=a.createContext(void 0),eM=`[${h}]`,eR=a.forwardRef(function(e,t){let{render:r,className:o,style:i,children:u,...d}=e,h=(0,s.useDialogRootContext)(),p=h.context.popupRef,m=h.context.backdropRef,{swipeDirection:x,notifyParentSwipingChange:b,notifyParentSwipeProgressChange:y,frontmostHeight:v,snapToSequentialPoints:k,swipeAreaActiveRef:C}=M(),j=f(),{snapPoints:S,resolvedSnapPoints:I,activeSnapPoint:P,activeSnapPointOffset:A,setActiveSnapPoint:E,popupHeight:D}=z(),$=h.useState("open"),O=h.useState("mounted"),F=h.useState("nested"),W=h.useState("nestedOpenDrawerCount"),B=h.useState("viewportElement"),U=h.useState("popupElement"),Y=j?.visualStateStore,V=W>0,K="left"===x||"right"===x?"horizontal":"vertical",Q="vertical"===K,J=Q?"horizontal":"vertical",[ee,et]=a.useState(null),eo=a.useRef(void 0),ei=a.useRef(null),el=(0,eN.useAnimationFrame)(),ec=a.useRef(!1),ed=a.useRef(!1),eh=a.useRef(""),ep=a.useRef(!1),em=a.useRef(!1),eg=a.useRef(null),ex=a.useContext(eE),ef=a.useMemo(()=>{if(!S||S.length<2||I.length<2||"down"!==x&&"up"!==x)return null;let e=I.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[I,S,x]),eb=a.useMemo(()=>ef&&null!==A?(0,T.clamp)((A-ef.minOffset)/ef.range,0,1):null,[A,ef]),ey=a.useMemo(()=>S&&S.length>0&&("down"===x||"up"===x)?"down"===x?["down","up"]:["up","down"]:[x],[S,x]),ev=(0,w.useStableCallback)(e=>{p.current?.toggleAttribute(N.swipeDismiss,e),m.current?.toggleAttribute(N.swipeDismiss,e)}),ek=(0,w.useStableCallback)(()=>{ev(!1),p.current?.removeAttribute(eP.TransitionStatusDataAttributes.endingStyle),et(null)}),ew=(0,w.useStableCallback)(()=>{ed.current&&(ed.current=!1,b?.(!1))}),eA=(0,w.useStableCallback)((e,t,r)=>{let n=$&&!F&&t,a=n?e:0,s=$&&t?e:0;r&&y&&(y(s),s<=0&&ew()),Y?.set({swipeProgress:a,frontmostHeight:a>0?v:0});let o=m.current;if(!o)return;let i=n&&a>0;o.style.setProperty(c.swipeProgress,i?`${a}`:"0"),i&&v>0?o.style.setProperty(l.height,`${v}px`):o.style.removeProperty(l.height)}),eR=eu({enabled:O&&!V,directions:ey,elementRef:h.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:l.swipeMovementX,y:l.swipeMovementY},onSwipeStart(e){if("touches"in e||"touch"===e.pointerType)return;let t=p.current,r=(0,R.ownerDocument)(t),n=r.getSelection?.();if(!n||n.isCollapsed)return;let a=(0,ej.isElement)(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,s=(0,ej.isElement)(n.focusNode)?n.focusNode:n.focusNode?.parentElement;((0,er.contains)(t,a)||(0,er.contains)(t,s))&&n.removeAllRanges()},onSwipingChange(e){ec.current=e,eT(h.context.backdropRef.current,e),e||y||ew()},swipeThreshold:({element:e,direction:t})=>e_(e,t),canStart(e,t){let r=h.context.popupRef.current;if(!r)return!1;let n=r.ownerDocument,a=ea(r.getRootNode(),e.x,e.y);if(!a||!(0,er.contains)(r,a))return!1;let s=t.nativeEvent;return!(("touches"in s||"touch"===s.pointerType)&&ez(n,r))},onProgress(e,t){var r;r=t,!ed.current&&r&&(10>Math.abs(es(r.direction??x,r.deltaX,r.deltaY))||(ed.current=!0,b?.(!0)));let n=!!(S&&S.length>0);if(ec.current&&"down"===x&&n&&t){let e=h.context.popupRef.current;e&&(e.style.removeProperty("transform"),e.style.setProperty(l.swipeMovementY,`${L(A??0,t.deltaY)}px`))}let a=e;if(ef&&D>0){let e=A??ef.minOffset;if(t&&Number.isFinite(t.deltaY)){let r;r=(0,T.clamp)(e+t.deltaY,0,D),a=(0,T.clamp)((r-ef.minOffset)/ef.range,0,1)}else null!==eb&&(a=eb)}eA(a,!0,!0)},onRelease({event:e,deltaX:t,deltaY:r,direction:n,velocityX:a,velocityY:s,releaseVelocityX:o,releaseVelocityY:i}){let l=h.context.popupRef.current;if(!l)return void ek();function c(e){ew(),ev(!0),l.style.removeProperty("transition"),l.setAttribute(eP.TransitionStatusDataAttributes.endingStyle,""),eC.flushSync(()=>{et(function(e,t,r,n,a,s,o,i){let l=eD(e,t);if(l<=0)return null;let c=Math.max(0,l-((("down"===t||"up"===t)&&S&&S.length>0?A??0:0)+es(t,r,n)));if(c<=0)return null;let u=es(t,o,i),d=Math.abs(u)>0?u:es(t,a,s);if(d<=.2)return null;let h=(0,T.clamp)(d,.2,4);return .1+((0,T.clamp)(c/h,80,360)-80)/280*.9}(l,e,t,r,a,s,o,i))})}if(!S||0===S.length){if(!n)return void ek();let e=es(n,t,r);if(e<=0)return ek(),!1;if(es(n,a,s)>=.5)return c(n),!0;let o=e>e_(l,n);return o?c(n):ek(),o}if("down"!==x&&"up"!==x)return void ek();if(!D)return ek(),!1;if(0===I.length)return void ek();let u="down"===x?r:-r,d=Math.sign(u),p="down"===x?i:-i,m="down"===x?s:-s,g=p;if(0!==d&&Math.abs(u)>=10){let e=Math.sign(g);0!==e&&e!==d&&(g=m)}let f=A??0,b=(0,T.clamp)(f+u,0,D),y=Math.abs(g)>=.5?300*(0,T.clamp)(g,-4,4):0,v=k?b:(0,T.clamp)(b+y,0,D),w=(0,G.createChangeEventDetails)(Z.REASONS.swipe,e),C=()=>(eo.current=P,E(null,w),c(x),!0);if(k){let e=[...I].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),r=_(t,f),n=e[_(t,v)],a=Math.sign(g),s=v;if(0!==d&&0!==a&&a===d&&Math.abs(g)>=.5){let t=(0,T.clamp)(r+d,0,e.length-1);if(t!==r){let r=e[t];(d>0?vr.offset)&&(n=r,s=r.offset)}else if(d>0)return C()}return Math.abs(s-D)=.5&&u>0)return C();let j=I[_(I.map(e=>e.offset),v)];return Math.abs(v-D){if(h.select("open")){let t=eo.current;void 0!==t&&E(t,(0,G.createChangeEventDetails)(Z.REASONS.swipe,e)),eo.current=void 0,ek(),ei.current?.()}else eo.current=void 0});eo.current=void 0,ev(!0)}}),eF=eR.getPointerProps(),eW=eR.getTouchProps(),{moveNative:eB,reset:eU}=eR;ei.current=eU,a.useEffect(()=>{let e=B??U;if(!e)return;let t=(0,R.ownerDocument)(e);return(0,X.addEventListener)(t,"touchmove",function(r){var n,a;if(ex?.onTouchMove(r),em.current)return;let s=eg.current,o=r.touches[0];o&&s&&(!function(r,n,a){let s=Q?a.clientY-n.lastY:a.clientX-n.lastX;if(2===r.touches.length||ez(t,e)||!$||!O||V||function(e,t,r,n){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||!0===e.allowSwipe||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let a=n?r.clientY-e.startY:r.clientX-e.startX,s=n?r.clientX-e.startX:r.clientY-e.startY,o=Math.abs(a),i=Math.abs(s);return i>=6&&i>o+2?(e.preserveNativeCrossAxisScroll=!0,!0):!(o>=6)||(e.drawerAxisAttributed=!0,!1)}(n,r,a,Q))return;let o=n.scrollTarget;if(!o||o===t.documentElement||o===t.body){r.cancelable&&r.preventDefault(),r.stopPropagation(),eB(r,e);return}if(!(eH(o,K).max>0)){r.cancelable&&r.preventDefault(),r.stopPropagation();return}if(0!==s){var i,l,c,u;let e=(i=o,l=K,c=x,u=s,!!(eO(c,l)?u>0:u<0)&&e$(i,l,c));n.allowSwipe?r.cancelable&&r.preventDefault():r.cancelable&&e?(n.allowSwipe=!0,r.preventDefault()):n.allowSwipe=!1}!0===n.allowSwipe&&(r.stopPropagation(),eB(r,e))}(r,s,o),(n=s).lastX=(a=o).clientX,n.lastY=a.clientY)},{passive:!1,capture:!0})},[O,V,$,U,Q,K,x,eB,B,ex]),(0,g.useIsoLayoutEffect)(()=>{ef&&!eR.swiping&&eA(!$||F?0:eb??0,!0,!1)},[eA,v,F,y,$,eb,ef,eR.swiping,h,Y]),(0,g.useIsoLayoutEffect)(()=>{if(y)return $||y(0),()=>{y(0)}},[y,$]),(0,g.useIsoLayoutEffect)(()=>{$&&(C.current||eU(),ek())},[ek,$,eU,C]),(0,g.useIsoLayoutEffect)(()=>{let e=m.current;return()=>{Y?.set({swipeProgress:0,frontmostHeight:0}),eT(e,!1);let t=m.current;t!==e&&eT(t,!1),ew()}},[m,ew,Y]);let eY=a.useMemo(()=>({swiping:eR.swiping,getDragStyles:eR.getDragStyles,swipeStrength:ee??null,setSwipeDismissed:ev}),[ev,eR.getDragStyles,eR.swiping,ee]);function eX(e){em.current=e,eg.current=null}function eV(){eX(!1),eh.current="",ep.current=!1}function eq(e){return eh.current="","touch"!==e.pointerType}return(0,n.jsx)(eS.DialogViewport,{ref:t,className:o,style:i,render:r,...(0,eI.mergeProps)(d,{onPointerDown(e){var t;if(eh.current=e.pointerType,ep.current="pen"===e.pointerType,!$||!O||V)return;let r=ea(e.currentTarget.getRootNode(),e.clientX,e.clientY);!(eL(r)||(t=r,t?.closest(eM)))&&"touch"!==e.pointerType&&eF.onPointerDown?.(e)},onPointerMove(e){"touch"!==e.pointerType&&eF.onPointerMove?.(e)},onPointerUp(e){eq(e)&&eF.onPointerUp?.(e)},onPointerCancel(e){eq(e)&&eF.onPointerCancel?.(e)},onTouchStart(e){var t,r,n;if("pen"===eh.current&&ep.current){ep.current=!1,eX(!1);return}if(!$||!O||V)return void eX(!1);let a=e.touches[0];if(!a)return;if(r=(t=e).nativeEvent,n=(0,q.ownerWindow)(t.currentTarget),r.composedPath().some(e=>e instanceof n.HTMLInputElement&&"range"===e.type))return void eX(!1);let s=e.currentTarget,o=ea(s.getRootNode(),a.clientX,a.clientY),i=(0,er.getTarget)(e.nativeEvent),l=(0,ej.isElement)(i)?i:s;if(!(0,er.contains)(s,l)||(ex?.onTouchStart(e),eL(o)))return void eX(!0);em.current=!1;let c=(0,en.findScrollableTouchTarget)(l,s,K),u=null!=(0,en.findScrollableTouchTarget)(l,s,J),d=null;c&&(d=!!e$(c,K,x)&&null),eg.current={startX:a.clientX,startY:a.clientY,lastX:a.clientX,lastY:a.clientY,scrollTarget:c,hasCrossAxisScrollableContent:u,allowSwipe:d,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},eW.onTouchStart?.(e)},onTouchEnd(e){ex?.onTouchEnd(e),eV(),eW.onTouchEnd?.(e)},onTouchCancel(e){ex?.onTouchCancel(),eV(),eW.onTouchCancel?.(e)},"data-nested-dialog-open":void 0}),children:(0,n.jsx)(H.Provider,{value:eY,children:u})})});function eT(e,t){e?.toggleAttribute(N.swiping,t)}function eL(e){return!!e?.closest(eA.BASE_UI_SWIPE_IGNORE_SELECTOR)}function eD(e,t){return"left"===t||"right"===t?e.offsetWidth:e.offsetHeight}function e_(e,t){return Math.max(.5*eD(e,t),10)}function ez(e,t){let r=(0,er.activeElement)(e);if(r&&(0,er.contains)(t,r)&&("INPUT"===r.tagName||"TEXTAREA"===r.tagName)){let{selectionStart:e,selectionEnd:t}=r;if(null!=e&&null!=t&&e=s}function eO(e,t){return"vertical"===t?"down"===e:"right"===e}var eF=e.i(439957),eW=e.i(596296);let eB=function(e){return e.keyboardInset="--drawer-keyboard-inset",e}({}),eU=new Set(["email","number","password","search","tel","text","url"]),eY=Symbol("KeyboardTapBlocked");function eX(e){let{children:t}=e,r=(0,s.useDialogRootContext)(),o=r.useState("open"),i=r.useState("mounted"),l=r.useState("modal"),c=r.useState("nestedOpenDialogCount"),u=r.useState("viewportElement"),d=c>0,h=a.useRef(!1),p=a.useRef(null),m=a.useRef(null),g=a.useRef(null),x=a.useRef(!1),f=(0,eN.useAnimationFrame)(),b=(0,eF.useTimeout)(),y=(0,w.useStableCallback)(()=>{let e=g.current;e&&(e.element.style.overflowAnchor=e.overflowAnchor,e.element.style.paddingBottom=e.paddingBottom,e.element.style.scrollPaddingBottom=e.scrollPaddingBottom,g.current=null)}),v=(0,w.useStableCallback)((e,t)=>{let r=Math.max(0,Math.ceil(t)),n=g.current;if(n&&!n.element.isConnected&&(y(),n=null),0===r)return void y();if(n&&n.element!==e&&(y(),n=null),!n){let t=(0,ej.getComputedStyle)(e);g.current=n={element:e,overflowAnchor:e.style.overflowAnchor,paddingBottom:e.style.paddingBottom,scrollPaddingBottom:e.style.scrollPaddingBottom,computedPaddingBottom:Number.parseFloat(t.paddingBottom)||0,computedScrollPaddingBottom:Number.parseFloat(t.scrollPaddingBottom)||0}}e.style.overflowAnchor="none",e.style.paddingBottom=`${n.computedPaddingBottom+r}px`,e.style.scrollPaddingBottom=`${n.computedScrollPaddingBottom+16}px`}),k=(0,w.useStableCallback)((e,t)=>{let r=(0,q.ownerWindow)(e),n=r.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches?"auto":"smooth";e.scrollTo({top:t,behavior:n})}),C=(0,w.useStableCallback)(()=>{h.current=!1,p.current=null});a.useEffect(()=>{if(!i||!o){m.current=null,y(),f.cancel();return}if(!u)return void y();let e=(0,R.ownerDocument)(u),t=(0,q.ownerWindow)(u),r=t.visualViewport,n=null,a=0,s=0,c=-1,h=e=>{u.style.setProperty(eB.keyboardInset,`${Math.max(0,Math.ceil(e))}px`)},p=()=>{m.current=null,n=null,h(0),y(),f.cancel(),b.clear()},g=t.scrollX,w=t.scrollY,C=()=>!0===l&&!d&&!!m.current&&null!=eG(t)&&(t.scrollX!==g||t.scrollY!==w)&&(t.scrollTo({left:g,top:w,behavior:"instant"}),!0),j=null,N=()=>{j?.(),j=null},S=()=>{N();let e=m.current;if(d||!e||!(0,er.contains)(u,e)){h(0),y();return}C();let r=eG(t);if(!r){h(0),y();return}h(Math.max(0,t.innerHeight-r.bottom));let o=function(e,t){let r=(0,ej.getParentNode)(e);return(0,en.findScrollableTouchTarget)(r,t,"vertical")??(0,en.findScrollableTouchTarget)(r,t,"vertical",!0)}(e,u);if(!o)return void y();let i=o.getBoundingClientRect(),l=Math.min(i.bottom,r.bottom),p=Math.max(0,i.bottom-r.bottom);v(o,p>0?p+48:0);let g=Math.max(0,o.scrollHeight-o.clientHeight);if(g<=0)return;let x=Math.max(i.top,r.top)+16,b=l-16;if(b<=x)return;let w=e.getBoundingClientRect(),j=o.scrollTop+(w.top+w.bottom-x-b)/2,I=Math.round((0,T.clamp)(j,0,g));if(n===o&&1>=Math.abs(a-I)){if(c>=0){let e=o.scrollTop;if(1>=Math.abs(e-I))return;if(e!==c){c=e;return}}}else{let e=n===o?s+1:1;if(n=o,a=I,s=e,c=-1,e<=60)return void f.request(S)}n=o,a=I,s=0,c=o.scrollTop,k(o,I)},I=()=>{f.request(S)},P=e=>{if(d)return!1;let t=eq(e);return!!t&&!!(0,er.contains)(u,t)&&(m.current!==t&&(n=null),m.current=t,!0)},A=()=>{(m.current||P((0,er.activeElement)(e)))&&I()},E=[];return r&&E.push((0,X.addEventListener)(r,"resize",A),(0,X.addEventListener)(r,"scroll",A)),E.push((0,X.addEventListener)(e,"focusin",e=>{if(x.current=!1,N(),!P((0,er.getTarget)(e)))return void p();null!=eG(t)&&(()=>{let e=4,t=()=>{S(),(e-=1)>0&&b.start(150,t)};b.start(150,t)})(),I()},!0),(0,X.addEventListener)(e,"focusout",e=>{if(!x.current){if(P(e.relatedTarget)){let e=m.current,r=eG(t);e&&r&&((e,t)=>{N();let r=e.getBoundingClientRect();j=eK(e,(t.top+t.bottom-r.top-r.bottom)/2)})(e,r),I();return}p()}},!0),(0,X.addEventListener)(t,"scroll",()=>{C()&&I()}),(0,X.addEventListener)(e,"pointerdown",()=>{f.cancel(),b.clear(),n=null},!0)),P((0,er.activeElement)(e))&&I(),()=>{E.forEach(e=>e()),N(),p(),u.style.removeProperty(eB.keyboardInset)}},[k,f,b,l,i,d,o,y,u,v]);let j=(0,w.useStableCallback)(e=>{let t=e.touches[0];h.current=!1,p.current={x:t.clientX,y:t.clientY}}),N=(0,w.useStableCallback)(e=>{let t=e.touches[0],r=p.current;t&&r&&!h.current&&(Math.abs(t.clientX-r.x)>10||Math.abs(t.clientY-r.y)>10)&&(h.current=!0)}),S=(0,w.useStableCallback)(e=>{if(!o||!i||d||!u||!p.current||h.current)return void C();let t=e.changedTouches[0]??e.touches[0],r=u.getRootNode(),n=(0,er.getTarget)(e.nativeEvent),a=t?function(e,t,r){let n=ea(e,t,r);if((0,ej.isHTMLElement)(n)){let e=eq(n);if(e)return{focusTarget:e,clickTarget:n}}if((0,eW.isInteractiveElement)(n)||n?.closest("label")!=null)return eY;for(let[n,a]of[[0,16],[0,-16],[16,0],[-16,0]]){let s=eq(ea(e,t+n,r+a));if(s)return{focusTarget:s,clickTarget:s}}return null}(r,t.clientX,t.clientY):null;if(a===eY)return void C();let s=t&&(a??function(e){if(!(0,ej.isHTMLElement)(e))return null;let t=eq(e);return t?{focusTarget:t,clickTarget:e}:null}(n));if(s&&(!(0,er.contains)(u,s.focusTarget)||!(0,er.contains)(u,s.clickTarget)))return void C();if(s){let{clickTarget:r,focusTarget:n}=s,a=(0,q.ownerWindow)(n);if(a.visualViewport&&1!==a.visualViewport.scale||(0,er.activeElement)((0,R.ownerDocument)(n))===n&&(!a.visualViewport||null!=eG(a)))return void C();e.preventDefault(),x.current=!0;try{var l=n;let e=(0,er.activeElement)((0,R.ownerDocument)(l))===l,t=eK(l,-2e3);try{e&&l.blur(),l.focus({preventScroll:!0})}finally{t()}}finally{x.current=!1}return function(e,t){let r=(0,q.ownerWindow)(e),n=r.PointerEvent??r.MouseEvent;e.dispatchEvent(new n("click",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY,detail:1,view:r}))}(r,t),void C()}C()}),I=a.useMemo(()=>({onTouchStart:j,onTouchMove:N,onTouchEnd:S,onTouchCancel:C}),[S,N,j,C]);return(0,n.jsx)(eE.Provider,{value:I,children:t})}function eV(e){if(e.isContentEditable)return!0;let t=(0,q.ownerWindow)(e);return!!(e instanceof t.HTMLTextAreaElement||e instanceof t.HTMLInputElement&&eU.has(e.type))&&!e.matches(":disabled")}function eq(e){if(!(0,ej.isHTMLElement)(e))return null;if(eV(e))return e.isContentEditable?function(e){let t=e;for(;t.parentElement?.isContentEditable;)t=t.parentElement;return t}(e):e;let t=e.closest("label"),r=t?.control??null;return(0,ej.isHTMLElement)(r)&&eV(r)?r:null}function eK(e,t){let r=e.style.opacity,n=e.style.transform,a=e.style.transition;return e.style.transition="none",e.style.opacity="0",e.style.transform=`translateY(${t}px)`,()=>{e.style.opacity=r,e.style.transform=n,e.style.transition=a}}function eG(e){let t=e.visualViewport;if(!t||1!==t.scale||e.innerHeight-t.height<=60)return null;let r=Math.max(0,t.offsetTop);return{top:r,bottom:Math.min(e.innerHeight,r+t.height)}}var eZ=e.i(325326);class eQ extends eZ.DialogHandle{}function eJ(){return new eQ}var e0=e.i(458954),e0=e0,e1=e.i(296548);let e5="ease-[cubic-bezier(0.32,0.72,0,1)]",e2={bottom:"items-end justify-center",left:"items-stretch justify-start"},e4={bottom:(0,e1.cn)("-mb-(--bleed) w-full","transform-[translateY(var(--drawer-swipe-movement-y))]","data-starting-style:transform-[translateY(calc(100%-var(--bleed)+2px))]","data-ending-style:transform-[translateY(calc(100%-var(--bleed)+2px))]"),left:(0,e1.cn)("-ml-(--bleed) h-full","transform-[translateX(var(--drawer-swipe-movement-x))]","data-starting-style:transform-[translateX(calc(-100%+var(--bleed)-2px))]","data-ending-style:transform-[translateX(calc(-100%+var(--bleed)-2px))]")},e7=({className:e,ref:t,...r})=>(0,n.jsx)(e0.Backdrop,{ref:t,className:(0,e1.cn)("[--backdrop-opacity:0.4] fixed inset-0 min-h-dvh bg-black supports-[-webkit-touch-callout:none]:absolute","opacity-[calc(var(--backdrop-opacity)*(1-var(--drawer-swipe-progress)))]","transition-opacity duration-450",e5,"data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)]","motion-reduce:transition-none",e),...r}),e3=({className:e,side:t="bottom",ref:r,...a})=>(0,n.jsx)(e0.Viewport,{ref:r,className:(0,e1.cn)("fixed inset-0 flex",e2[t],e),...a}),e6=({className:e,side:t="bottom",ref:r,...a})=>(0,n.jsx)(e0.Popup,{ref:r,className:(0,e1.cn)("[--bleed:3rem] relative outline-none","bg-background-light dark:bg-background-dark","overscroll-contain touch-auto will-change-transform","transition-transform duration-450",e5,"data-swiping:select-none","data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)]","motion-reduce:transition-none",e4[t],e),...a}),e9=({className:e,...t})=>(0,n.jsx)("div",{className:(0,e1.cn)("mx-auto mb-4 h-1 w-12 shrink-0 rounded-full bg-gray-300 dark:bg-gray-600",e),...t}),e8=e0.Root;e0.Trigger;let te=e0.Portal;e0.Content,e0.Title,e0.Description;let tt=e0.Close},471205,455053,e=>{"use strict";e.s(["ThumbsDownIcon",()=>r],471205);var t=e.i(930733);let r=(0,t.default)("ThumbsDownIcon",[["path",{d:"M5.25 10.506C5.25 10.986 5.423 11.45 5.736 11.813L10 16.75C10.854 16.323 11.25 15.322 10.92 14.426L9.75 11.25H14.152C15.465 11.25 16.421 10.007 16.085 8.738L14.894 4.238C14.662 3.361 13.868 2.75 12.961 2.75H7.25C6.145 2.75 5.25 3.645 5.25 4.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M4.25 2.75H2.75C2.19772 2.75 1.75 3.19772 1.75 3.75V10.25C1.75 10.8023 2.19772 11.25 2.75 11.25H4.25C4.80228 11.25 5.25 10.8023 5.25 10.25V3.75C5.25 3.19772 4.80228 2.75 4.25 2.75Z",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");e.s(["ThumbsUpIcon",()=>n],455053);let n=(0,t.default)("ThumbsUpIcon",[["path",{d:"M5.25 7.494C5.25 7.014 5.423 6.55 5.736 6.187L10 1.25C10.854 1.677 11.25 2.678 10.92 3.574L9.75 6.75H14.152C15.465 6.75 16.421 7.993 16.085 9.262L14.894 13.762C14.662 14.639 13.868 15.25 12.961 15.25H7.25C6.145 15.25 5.25 14.355 5.25 13.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M4.25 6.75H2.75C2.19772 6.75 1.75 7.19772 1.75 7.75V14.25C1.75 14.8023 2.19772 15.25 2.75 15.25H4.25C4.80228 15.25 5.25 14.8023 5.25 14.25V7.75C5.25 7.19772 4.80228 6.75 4.25 6.75Z",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined")},923822,e=>{"use strict";e.s(["assistantBarKeyboardHint",()=>s,"isPillInputTheme",()=>a,"pillInputStyles",()=>n]);let t=new Set(["aspen","luma"]),r=new Set(["mint","aspen","palm","sequoia"]),n="rounded-full shadow-none py-2 px-2";function a(e){return t.has(e)}function s(e){return"luma"===e?{show:!0,className:"min-[1500px]:hidden"}:{show:!r.has(e??"mint")}}},765427,e=>{"use strict";e.s(["ChatInput",()=>f],765427);var t=e.i(843476),r=e.i(91557),n=e.i(343590),a=e.i(5695),s=e.i(279183),o=e.i(111048),i=e.i(476781),l=e.i(930733);let c=(0,l.default)("MediaStopIcon",[["path",{d:"M13.25 2.75H4.75C3.64543 2.75 2.75 3.64543 2.75 4.75V13.25C2.75 14.3546 3.64543 15.25 4.75 15.25H13.25C14.3546 15.25 15.25 14.3546 15.25 13.25V4.75C15.25 3.64543 14.3546 2.75 13.25 2.75Z",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var u=e.i(296548),d=e.i(271645),h=e.i(411088);let p=(0,l.default)("ArrowUp2Icon",[["path",{d:"M9.0 1.5754L8.9999 16.4171",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M2.2563 8.319L8.9999 1.5754L15.7435 8.3191",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");function m({disabled:e,onClick:r,size:a="md",className:s}){let o=(0,n.useSelectedLocale)();return(0,t.jsx)("button",{className:(0,u.cn)(i.Classes.ChatAssistantSendButton,"flex justify-center items-center rounded-full","sm"===a?"p-1 size-6":"p-1 size-7",e?"bg-primary/30 dark:bg-primary-dark/30":"bg-primary dark:bg-primary-dark",s),"aria-label":o["aria.sendMessage"],disabled:e,onClick:r,children:(0,t.jsx)(p,{"aria-hidden":"true",strokeWidth:2,className:"size-2.5 shrink-0 text-white dark:text-white"})})}let g=(0,u.cn)("flex flex-col w-full rounded-2xl pointer-events-auto","bg-background-light dark:bg-background-dark","border border-gray-200 dark:border-white/10","focus-within:border-primary dark:focus-within:border-primary-light","transition-colors"),x=(0,u.cn)(i.Classes.ChatAssistantInput,"w-full bg-transparent border-0 peer/input","text-gray-900 dark:text-gray-100","placeholder-gray-600 dark:placeholder-gray-300","outline-hidden! focus:outline-hidden! focus:ring-0","py-2.5 pl-3.5 pr-10","font-bodyWeight"),f=(0,d.forwardRef)(function({variant:e,onBeforeSubmit:i,onSubmit:l,onDeleteEmpty:p,onPaste:f,showKeyboardHint:b,keyboardHintClassName:y,actionKey:v="⌘",readOnly:k=!1,isMobile:w=!1,floating:C=!1,minRows:j=2,autosize:N=!0,headerContent:S,footerLeftContent:I,trailingContent:P,className:A,inputClassName:E,inputId:M},R){let{input:T,setInput:L,handleSubmit:D,isInProgress:_,isFeatureUnavailable:z,ensureCaptchaScriptLoaded:H}=(0,a.useAssistant)(),{selectedLocale:$}=(0,d.useContext)(n.NavigationContext),{gitSource:O}=(0,d.useContext)(r.DeploymentMetadataContext),F=(0,n.useSelectedLocale)(),W=O?.owner==="mintlify-atlas"?"Ask Mintlify a question...":F.askAQuestion,B=(0,s.default)(e=>e.pendingAttachments.length>0),U=z.unavailable&&"captcha_required"!==z.type&&"stream_error"!==z.type,Y=""!==T.trim()||B,X=!Y||U,V=()=>{_||!Y||U||(i?.(T),D(),l?.(T))},q=t=>{"Enter"===t.key&&!t.nativeEvent.isComposing&&(("bar"!==e||"ja"===$||"jp"===$||"ja-jp"===$||"ja-JP"===$)&&("panel"!==e||t.shiftKey)||(t.preventDefault(),V())),"Backspace"===t.key&&""===T&&p&&p()},K={id:M??o.Ids.ChatAssistantTextArea,"aria-label":W,autoComplete:"off",placeholder:W,value:T,onChange:e=>{H(),L(e.target.value)},disabled:U,readOnly:k,className:(0,u.cn)(x,w?"text-base":"text-sm",I&&"pb-0!",P&&"pr-18",E),onKeyDown:q,onPaste:f,style:{resize:"none",fontSize:w?"16px":void 0}};return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{onClick:e=>{if(R&&"object"==typeof R&&"current"in R){let t=R.current;e.target===e.currentTarget&&document.activeElement!==t&&t?.focus()}},className:(0,u.cn)(g,C&&"sm:shadow-xl",U&&"opacity-50 cursor-not-allowed",k&&"cursor-pointer",A),children:[S,(0,t.jsxs)("div",{className:"relative flex items-end",children:["bar"===e?(0,t.jsx)("input",{ref:R,type:"text",id:M,placeholder:W,"aria-label":W,className:(0,u.cn)(x,w?"text-base":"text-sm",k&&"pointer-events-none",P&&"pr-18",E),value:T,onChange:e=>{H(),L(e.target.value)},onKeyDown:q,onPaste:f,disabled:U,readOnly:k}):N?(0,t.jsx)(h.default,{ref:R,...K,cacheMeasurements:!1,minRows:j,maxRows:10}):(0,t.jsx)("textarea",{ref:R,...K,rows:j}),b&&(0,t.jsxs)("span",{className:(0,u.cn)("absolute bottom-3 text-xs font-medium text-gray-400 dark:text-gray-500",P?"right-18":"right-11","select-none pointer-events-none peer-focus/input:hidden","hidden sm:inline",y),children:[v,"⌘"===v?"":"+","I"]}),P&&(0,t.jsx)("div",{className:(0,u.cn)("absolute bottom-2",w?"right-11":"right-10"),children:P}),!I&&(_?(0,t.jsx)("button",{type:"button",onClick:()=>s.default.getState().activeStop?.(),className:(0,u.cn)("absolute right-2.5 bottom-2 flex justify-center items-center rounded-full",w?"p-1 size-7":"p-1 size-6","bg-primary dark:bg-primary-dark"),"aria-label":"Stop generating",children:(0,t.jsx)(c,{"aria-hidden":"true",strokeWidth:2,className:(0,u.cn)("text-white dark:text-white fill-current shrink-0",w?"size-3":"size-2.5")})}):(0,t.jsx)(m,{disabled:X,onClick:V,size:w?"md":"sm",className:"absolute right-2.5 bottom-2"}))]}),I&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[I,_?(0,t.jsx)("button",{type:"button",onClick:()=>s.default.getState().activeStop?.(),className:(0,u.cn)("flex justify-center items-center rounded-full",w?"p-1 size-7":"p-1 size-6","bg-primary dark:bg-primary-dark"),"aria-label":"Stop generating",children:(0,t.jsx)(c,{"aria-hidden":"true",strokeWidth:2,className:(0,u.cn)("text-white dark:text-white fill-current shrink-0",w?"size-3":"size-2.5")})}):(0,t.jsx)(m,{disabled:X,onClick:V,size:w?"md":"sm"})]})]})})})},736118,e=>{"use strict";e.s(["ChatAssistantSheet",()=>e4],736118);var t=e.i(843476),r=e.i(859465),n=e.i(271645),a=e.i(477222),s=e.i(915476),o=e.i(721999),i=e.i(91557),l=e.i(343590),c=e.i(5695),u=e.i(279183),d=e.i(111048),h=e.i(476781),p=e.i(710949),m=e.i(978264),g=e.i(930733);let x=(0,g.default)("ArrowsReduceDiagonalIcon",[["path",{d:"M15.25 7.25H10.75V2.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M10.75 7.25L15.25 2.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M7.25 15.25V10.75H2.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M7.25 10.75L2.75 15.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined"),f=(0,g.default)("FilePlusIcon",[["path",{d:"M5.75 6.75H7.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M5.75 9.75H10.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M15.16 6.24999H11.75C11.198 6.24999 10.75 5.80199 10.75 5.24999V1.85199",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M14.75 10.75V15.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M15.25 8.3V6.664C15.25 6.399 15.145 6.144 14.957 5.957L11.043 2.043C10.855 1.855 10.601 1.75 10.336 1.75H4.75C3.645 1.75 2.75 2.646 2.75 3.75V14.25C2.75 15.354 3.645 16.25 4.75 16.25H12.3",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M17.25 13.25H12.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var b=e.i(346089),y=e.i(757808),v=e.i(137829),k=e.i(296548),w=e.i(203963),C=e.i(624412),j=e.i(785023),N=e.i(893222),S=e.i(910773),I=e.i(346944),P=e.i(53339),A=e.i(803333),E=e.i(674987),M=e.i(440681),R=e.i(727677),T=e.i(618566);let L=(0,g.default)("Code2Icon",[["path",{d:"M5.25 12.5L1.75 9L5.25 5.5",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M12.75 12.5L16.25 9L12.75 5.5",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M7.5 15.25L10.5 2.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var D=e.i(642425);let _=["shrink-0 size-3.5 text-gray-600 dark:text-gray-400"],z=({context:e,onClick:r,onRemove:n})=>{let a=(0,l.useSelectedLocale)(),s=e.value.replace(/^```[\w]*\n?/,"").replace(/\n?```$/,""),o=s.length>30?`${s.slice(0,30)}...`:s;return(0,t.jsxs)("div",{className:(0,k.cn)(h.Classes.ChatAssistantPayloadItem,"relative inline-flex items-center gap-1.5 px-2 py-1","border border-gray-200 dark:border-gray-800 rounded-lg text-xs group","hover:border-gray-300 dark:hover:border-gray-700 cursor-pointer"),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>r?.(e),"aria-label":a["aria.viewPayloadItem"].replace("{type}",e.type).replace("{value}",o),className:"flex items-center gap-1.5 flex-1 min-w-0",children:["code"===e.type?(0,t.jsx)(L,{"aria-hidden":"true",strokeWidth:2,className:(0,k.cn)("shrink-0",..._)}):(0,t.jsx)(D.FileIcon,{"aria-hidden":"true",strokeWidth:2,className:(0,k.cn)("shrink-0",..._)}),(0,t.jsx)("span",{className:(0,k.cn)("text-gray-900 dark:text-gray-100 max-w-[100px] truncate"),children:o})]}),n&&(0,t.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},"aria-label":a["aria.removePayloadItem"].replace("{type}",e.type).replace("{value}",o),className:(0,k.cn)("rounded-r-lg hidden absolute right-0 top-0 bottom-0 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 shrink-0","bg-linear-to-l from-background-light via-background-light to-transparent dark:from-background-dark dark:via-background-dark/50 dark:to-transparent","group-hover:flex items-center pl-4 pr-2"),children:(0,t.jsx)(v.XmarkIcon,{"aria-hidden":"true",strokeWidth:2,className:"size-3.5 shrink-0"})})]})};function H({attachment:e}){return(0,t.jsx)(P.ZoomImage,{zoomImg:{src:e.url,alt:e.name},children:(0,t.jsx)("img",{src:e.url,alt:e.name,className:"w-[148px] h-[148px] rounded-xl object-cover cursor-zoom-in"})})}function $({attachment:e}){return(0,t.jsxs)("div",{className:"flex flex-col justify-between w-[148px] h-[148px] rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/5 p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:e.name}),(0,t.jsx)("div",{className:"self-start px-1.5 py-0.5 rounded bg-red-50 dark:bg-red-500/10 text-[10px] font-medium text-red-600 dark:text-red-400",children:"PDF"})]})}function O({attachment:e}){let r=(0,M.getFileExtension)(e.name).toUpperCase(),a=n.useMemo(()=>{let t=(0,M.decodeDataUrlToText)(e.url);return(t.length>512e3?t.slice(0,512e3):t).split("\n").length},[e.url]);return(0,t.jsxs)("div",{className:"flex flex-col justify-between w-[148px] h-[148px] rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/5 p-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:e.name}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:[a," ",1===a?"line":"lines"]})]}),(0,t.jsx)("div",{className:"self-start px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/10 text-[10px] font-medium text-gray-600 dark:text-gray-300",children:r})]})}function F({attachment:e}){let r=(0,M.getFileExtension)(e.name).toUpperCase();return(0,t.jsxs)("div",{className:"flex flex-col justify-between w-[148px] h-[148px] rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/5 p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:e.name}),(0,t.jsx)("div",{className:"self-start px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/10 text-[10px] font-medium text-gray-600 dark:text-gray-300",children:r})]})}let W={code:0,text:0,json:0,generic:0,pdf:1,image:2};function B({attachments:e}){let r=n.useMemo(()=>[...e].sort((e,t)=>{let r=(0,M.getAttachmentKind)(e.type,e.name),n=(0,M.getAttachmentKind)(t.type,t.name);return(W[r]??0)-(W[n]??0)}),[e]);return(0,t.jsx)("div",{className:"flex flex-wrap gap-2 justify-end",children:r.map(e=>{let r=(0,M.getAttachmentKind)(e.type,e.name);return"image"===r?(0,t.jsx)(H,{attachment:e},e.id):"pdf"===r?(0,t.jsx)($,{attachment:e},e.id):(0,M.isTextPreviewable)(e)?(0,t.jsx)(O,{attachment:e},e.id):(0,t.jsx)(F,{attachment:e},e.id)})})}let U=n.forwardRef(({className:e,message:r,...n},a)=>{let s=(0,T.useRouter)(),o=(0,A.useCurrentPath)(),i=(0,u.default)(e=>e.getMessageContext(r.id)),l=(0,u.default)(e=>e.getMessageAttachments(r.id)),c=i&&i.length>0,d=l&&l.length>0,h=e=>{let t=e.path;if(t&&t!==o&&t){(0,R.schedulePayloadHighlight)(e),s.push((0,E.navHref)(t));return}(0,R.highlightPayloadContext)(e)};return(0,t.jsxs)("div",{className:"flex justify-end items-end w-full flex-col gap-2",children:[c&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 justify-end",children:i.map((e,r)=>(0,t.jsx)(z,{context:e,onClick:h},r))}),d&&(0,t.jsx)(B,{attachments:l}),""!==r.content.trim()&&(0,t.jsx)("div",{ref:a,className:(0,k.cn)("flex px-3 py-2 items-start gap-4 w-fit max-w-[min(100%,36rem)] rounded-2xl bg-gray-100 dark:bg-white/5",e),...n,children:(0,t.jsx)("div",{className:"flex items-start gap-4 w-full min-w-0",children:(0,t.jsx)("div",{className:"flex flex-col gap-1 w-full min-w-0",children:(0,t.jsx)("div",{className:"hyphens-auto whitespace-pre-wrap [overflow-wrap:anywhere] text-base lg:text-sm text-gray-800 dark:text-gray-200",children:r.content})})})})]})});U.displayName="ChatMessage";var Y=e.i(846726),X=e.i(865420),V=e.i(627430),q=e.i(395787),K=e.i(637054);let G=(0,g.default)("ArrowTurnRightIcon",[["path",{d:"M15.25 8.25H4.75C3.645 8.25 2.75 9.145 2.75 10.25V14.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M11 12.5L15.25 8.25L11 4",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined"),Z=(0,g.default)("BookOpenIcon",[["path",{d:"M9.00002 15.051C9.17002 15.051 9.33902 15.006 9.49402 14.917C10.137 14.546 11.226 14.07 12.635 14.072C13.534 14.073 14.302 14.269 14.905 14.507C15.553 14.762 16.249 14.267 16.249 13.57V4.48704C16.249 4.13304 16.068 3.80704 15.763 3.62704C15.126 3.25104 14.037 2.76404 12.623 2.76404C10.733 2.76404 9.42502 3.63604 8.99902 3.94604",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M8.99998 15.051C8.82998 15.051 8.66098 15.006 8.50598 14.917C7.86298 14.546 6.77398 14.07 5.36498 14.072C4.46598 14.073 3.69798 14.269 3.09498 14.507C2.44698 14.762 1.75098 14.27 1.75098 13.574C1.75098 10.981 1.75098 6.10201 1.75098 4.48401C1.75098 4.13001 1.93198 3.80801 2.23698 3.62801C2.87398 3.25201 3.96298 2.76501 5.37698 2.76501C7.26698 2.76501 8.57498 3.63701 9.00098 3.94701V15.051H8.99998Z",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var Q=e.i(628083),J=e.i(760391),ee=e.i(164097),et=e.i(471205),er=e.i(455053),en=e.i(522016);let ea=(0,g.default)("CheckIcon",[["path",{d:"M2.75 9.25L6.75 14.25L15.25 3.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var es=e.i(357332),eo=e.i(385658);let ei=({toolCallId:e,question:r,options:n,isActive:a,messageId:s})=>{let{append:o,stop:i,isInProgress:l}=(0,c.useAssistant)(),d=(0,X.useAnalyticsContext)("docs.assistant.question_option_click"),h=(0,u.default)(t=>t.toolCallIdToSelectedOption[e]),p=(0,u.default)(e=>e.setSelectedOption),m=(0,u.default)(e=>e.messages.at(-1)?.id===s&&"error"!==e.status),g=!(a??m)||!!h;return(0,t.jsxs)("div",{role:"group","aria-label":r,className:"not-prose flex flex-col gap-1 rounded-2xl border border-gray-100 bg-background-light p-1.5 dark:border-white/[0.07] dark:bg-background-dark",children:[(0,t.jsx)("div",{className:"p-2",children:(0,t.jsx)("p",{className:"break-words text-sm font-medium leading-5 tracking-[-0.1px] text-gray-950 dark:text-white",children:r})}),(0,t.jsx)("div",{className:"flex flex-col",children:n.map((n,a)=>{let s=h===n;return(0,t.jsxs)("button",{type:"button",disabled:g,"aria-pressed":s,onClick:()=>(t=>{g||(p(e,t),d({question:r,option:t}).catch(console.error),l&&i(),o({id:(0,eo.default)(),role:"user",content:t}))})(n),className:(0,k.cn)("group/option flex w-full items-center gap-2 rounded-xt px-2 py-1.5 text-left outline-hidden transition-colors",!g&&"cursor-pointer hover:bg-black/[0.03] focus-visible:bg-black/[0.03] dark:hover:bg-white/5 dark:focus-visible:bg-white/5",g&&!s&&"opacity-40"),children:[(0,t.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-sm font-medium leading-5 tabular-nums text-gray-500 dark:bg-white/10 dark:text-gray-400",children:a+1}),(0,t.jsx)("span",{className:"min-w-0 flex-1 break-words text-sm font-medium leading-5 tracking-[-0.1px] text-gray-950 dark:text-white",children:n}),s&&(0,t.jsx)(ea,{className:"size-[13px] shrink-0 text-gray-500 animate-in zoom-in-50 duration-200 dark:text-gray-400",strokeWidth:2.5}),!s&&!g&&(0,t.jsx)(es.ChevronRightIcon,{className:"size-[13px] shrink-0 text-gray-500 opacity-0 transition-opacity group-hover/option:opacity-100 dark:text-gray-400"})]},n)})})]})};var el=e.i(296540),ec=e.i(912522),eu=e.i(968592),ed=e.i(872866),eh=e.i(133922);let ep=({children:e})=>(0,t.jsx)("span",{className:"animate-shimmer bg-[length:200%_100%] bg-clip-text text-transparent font-medium",style:{backgroundImage:"linear-gradient(90deg, rgb(156 163 175) 0%, rgb(209 213 219) 50%, rgb(156 163 175) 100%)"},children:e}),em=new Set(["grep","rg","egrep","fgrep","find","ls","tree"]),eg=new Set(["cat","head","tail"]),ex=({tools:e,isLoading:r})=>{let[a,s]=(0,n.useState)(!1),o=(0,n.useMemo)(()=>(function(e,t){let r=0,n=0,a=0;for(let t of e){let e=function(e){let t=e.trim().split(/[\s|;&]/)[0]??"";return em.has(t)?"search":eg.has(t)?"read":"other"}(t.command);"search"===e?r++:"read"===e?n++:a++}let s=[];if(r>0){let e=1===r?"pattern":"patterns";s.push(t?`searching for ${r} ${e}`:`searched for ${r} ${e}`)}if(n>0){let e=1===n?"file":"files";s.push(t?`reading ${n} ${e}`:`read ${n} ${e}`)}if(a>0){let e=1===a?"command":"commands";s.push(t?`running ${a} ${e}`:`ran ${a} ${e}`)}if(0===s.length)return t?"Running…":"Done";let o=s[0]??"",i=1===s.length?o:`${o} and ${s.slice(1).join(" and ")}`;return i.charAt(0).toUpperCase()+i.slice(1)})(e,r),[e,r]);return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("button",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>s(e=>!e),children:[a?(0,t.jsx)(eu.ChevronUpIcon,{"aria-hidden":"true",className:"size-3 shrink-0 text-gray-500 dark:text-gray-400",absoluteStrokeWidth:!0,strokeWidth:1.5}):(0,t.jsx)(ed.MagnifierIcon,{"aria-hidden":"true",className:"size-3 shrink-0 text-gray-500 dark:text-gray-400",absoluteStrokeWidth:!0,strokeWidth:1.5}),r?(0,t.jsx)("span",{className:"text-xs text-left",children:(0,t.jsx)(ep,{children:a?"Show less":o})}):(0,t.jsx)("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 text-left",children:a?"Show less":o})]}),a&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(eh.SquareTerminalIcon,{"aria-hidden":"true",className:"mt-0.5 size-3 shrink-0 text-gray-500 dark:text-gray-400",absoluteStrokeWidth:!0,strokeWidth:1.5}),(0,t.jsx)("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:e.command})]},e.toolCallId))})]})},ef=({query:e,children:r})=>{let[a,s]=(0,n.useState)(!1),o=(0,l.useSelectedLocale)(),i=null!=r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{className:(0,k.cn)("group flex items-start text-left gap-2 text-gray-500 dark:text-gray-400 shrink-0 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",i?"cursor-pointer":"cursor-default"),onClick:()=>{i&&s(!a)},children:[(0,t.jsx)(ed.MagnifierIcon,{"aria-hidden":"true",className:(0,k.cn)("size-3 mt-1 shrink-0",i&&"block group-hover:hidden",a&&"hidden"),absoluteStrokeWidth:!0,strokeWidth:1.5}),(0,t.jsx)(es.ChevronRightIcon,{"aria-hidden":"true",className:(0,k.cn)("size-3 mt-1 hidden shrink-0",i&&"group-hover:block",a&&"block rotate-90"),absoluteStrokeWidth:!0,strokeWidth:1.5}),(0,t.jsx)("span",{className:"text-base sm:text-sm flex items-center gap-1.5",children:i?(0,t.jsx)("span",{className:"font-medium",children:`${o.foundResultsFor} ${e}`}):(0,t.jsx)(ep,{children:`${o.searchingFor} ${e}`})})]}),a&&(0,t.jsx)("div",{className:"pl-6 pt-0.5 not-prose",children:r})]})};var eb=e.i(411901);let ey={className:"prose prose-sm dark:prose-invert hyphens-auto [overflow-wrap:anywhere] pb-1 [&_ul]:list-none lg:[&_ul>li]:before:top-[0.98em] [&_ul>li]:before:top-[0.85em] [&_ol]:pl-0 max-lg:text-base max-lg:[&_p]:text-base max-lg:[&_li]:text-base max-lg:[&_ul]:text-base max-lg:[&_ol]:text-base",showCopyButton:!0,components:{h1:({children:e})=>(0,t.jsx)("h1",{className:"text-lg font-semibold text-gray-950 dark:text-gray-50",children:e}),h2:({children:e})=>(0,t.jsx)("h2",{className:"text-base font-semibold text-gray-950 dark:text-gray-50",children:e}),h3:({children:e})=>(0,t.jsx)("h3",{className:"text-base font-semibold text-gray-950 dark:text-gray-50",children:e}),h4:({children:e})=>(0,t.jsx)("h4",{className:"text-base font-semibold text-gray-950 dark:text-gray-50",children:e}),h5:({children:e})=>(0,t.jsx)("h5",{className:"text-base font-semibold text-gray-950 dark:text-gray-50",children:e}),h6:({children:e})=>(0,t.jsx)("h6",{className:"text-base font-semibold text-gray-950 dark:text-gray-50",children:e})}},ev=({response:e,isStreaming:r=!1,onInternalLinkClick:a})=>{let s=(0,n.useMemo)(()=>({...ey,onInternalLinkClick:a}),[a]),o=function(e,t){let[r,a]=(0,n.useState)(()=>t?0:e.length),s=(0,n.useRef)(r),o=(0,n.useRef)(e),i=(0,n.useRef)(null);return o.current=e,(0,n.useEffect)(()=>{if(o.current.length=o.current.length)return;let e=null,t=r=>{let l=o.current.length;if(s.current>=l){e=null,i.current=null;return}let c=i.current;if(null!==c&&r-c<33){e=requestAnimationFrame(t);return}let u=null===c?33:Math.min(r-c,100);i.current=r;let d=Math.max(1,Math.round(Math.max(160,1e3*(l-s.current)/300)*u/1e3));s.current=Math.min(l,s.current+d),(0,n.startTransition)(()=>a(s.current)),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>{null!==e&&cancelAnimationFrame(e)}},[e]),r>=e.length?e:e.slice(0,r)}(e.text,r);return(0,t.jsx)(eb.DynamicMarkdown,{...s,fallback:(0,t.jsx)("div",{className:s.className,children:(0,t.jsx)("p",{className:"whitespace-pre-line",children:o})}),children:o})},ek=({query:e,children:r})=>{let[a,s]=(0,n.useState)(!1),o=(0,l.useSelectedLocale)(),i=null!=r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{className:(0,k.cn)("group flex items-center text-left gap-2.5 text-gray-500 dark:text-gray-400 shrink-0 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",i?"cursor-pointer":"cursor-default"),onClick:()=>{i&&s(!a)},children:[(0,t.jsx)(ed.MagnifierIcon,{"aria-hidden":"true",className:(0,k.cn)("size-3 shrink-0",i&&"block group-hover:hidden",a&&"hidden"),absoluteStrokeWidth:!0,strokeWidth:1.5}),(0,t.jsx)(es.ChevronRightIcon,{"aria-hidden":"true",className:(0,k.cn)("size-3 hidden shrink-0",i&&"group-hover:block",a&&"block rotate-90"),absoluteStrokeWidth:!0,strokeWidth:1.5}),(0,t.jsx)("span",{className:"text-xs flex items-center gap-1.5",children:i?(0,t.jsx)("span",{className:"font-medium",children:`${o.foundResultsFor} ${e}`}):(0,t.jsx)(ep,{children:`${o.searchingFor} ${e}`})})]}),a&&(0,t.jsx)("div",{className:"pl-6 pt-0.5 not-prose",children:r})]})},ew=new Set;function eC({toolCallId:e,target:r,label:a,isComplete:s,onClick:o}){let i=(0,n.useRef)(!ew.has(e));return(0,n.useEffect)(()=>{ew.add(e)},[e]),(0,t.jsxs)(en.default,{href:r,onClick:o,className:(0,k.cn)("group flex items-center gap-2 text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",i.current&&"animate-in fade-in slide-in-from-bottom-1 duration-200"),children:[(0,t.jsx)(G,{"aria-hidden":"true",className:"size-3 shrink-0",absoluteStrokeWidth:!0,strokeWidth:1.5}),(0,t.jsxs)("span",{className:"text-xs",children:[s?"Took you to":"Taking you to"," ",(0,t.jsx)("span",{className:"font-semibold text-gray-700 dark:text-gray-200 group-hover:underline",children:a})]})]})}let ej=new Set;function eN({toolCallId:e,name:r,isComplete:a}){let s=(0,n.useRef)(!ej.has(e));return(0,n.useEffect)(()=>{ej.add(e)},[e]),(0,t.jsxs)("div",{className:(0,k.cn)("flex items-center gap-2 text-gray-500 dark:text-gray-400",s.current&&"animate-in fade-in slide-in-from-bottom-1 duration-200"),children:[(0,t.jsx)(Z,{"aria-hidden":"true",className:"size-3 shrink-0",absoluteStrokeWidth:!0,strokeWidth:1.5}),(0,t.jsxs)("span",{className:"text-xs",children:[a?"Consulted skill":"Consulting skill"," ",(0,t.jsx)("span",{className:"font-semibold text-gray-700 dark:text-gray-200",children:r})]})]})}let eS="rounded-lg p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 cursor-pointer text-gray-500",eI="rounded-lg p-1.5 bg-primary dark:bg-bg-primary-light text-white dark:text-gray-950",eP=()=>{let{onReload:e}=(0,c.useAssistant)(),r=(0,l.useSelectedLocale)();return(0,t.jsxs)("button",{className:"mt-6 group text-primary dark:text-primary-light hover:text-primary-light dark:hover:text-primary-light text-sm cursor-pointer flex items-center gap-0.5 whitespace-nowrap self-start",onClick:e,"aria-label":r["aria.reloadChat"],children:[(0,t.jsx)(q.AiStatusIcons.Retry,{}),(0,t.jsx)("span",{className:"px-1",children:"Retry"})]})},eA=()=>{let{onReload:e}=(0,c.useAssistant)(),r=(0,l.useSelectedLocale)();return(0,t.jsx)("button",{className:"rounded-lg p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 cursor-pointer text-gray-500",onClick:e,"aria-label":r["aria.reloadLastChat"],children:(0,t.jsx)(ee.RefreshIcon,{"aria-hidden":"true",focusable:"false",className:"size-4 sm:size-3.5 shrink-0"})})},eE=({message:e})=>{let r=(0,X.useAnalyticsContext)("docs.assistant.copy_response"),[a,s]=(0,n.useState)(!1),o=(0,l.useSelectedLocale)();return(0,n.useEffect)(()=>{a&&setTimeout(()=>s(!1),2e3)},[a]),(0,t.jsx)("button",{className:"rounded-lg p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 cursor-pointer text-gray-500",onClick:()=>{navigator.clipboard.writeText(e.content).then(()=>{r({message:e.content}).catch(console.error),s(!0)}).catch(console.error)},"aria-label":o["aria.copyChatResponse"],children:a?(0,t.jsx)(Q.Check2Icon,{"aria-hidden":"true",focusable:"false",className:"size-4 sm:size-3.5 text-primary dark:text-primary-light shrink-0"}):(0,t.jsx)(J.DuplicateIcon,{"aria-hidden":"true",focusable:"false",className:"size-4 sm:size-3.5 shrink-0"})})},eM=n.forwardRef(({className:e,message:r,isLast:a,hasError:s,handleClose:o,...c},d)=>{let[h,p]=(0,n.useState)(!1),[m,g]=(0,n.useState)(!1),{subdomain:x}=(0,n.useContext)(i.DeploymentMetadataContext),{userInfo:f}=(0,n.useContext)(i.AuthContext),b=(0,l.useSelectedLocale)(),y=(0,u.default)(e=>e.status),v=(0,u.default)(e=>e.getMessageUlid),w=(0,n.useMemo)(()=>{let e;return e=r.parts,e?.some(e=>"text"===e.type||"tool-invocation"===e.type&&("search"===e.toolInvocation.toolName||"searchDocsAndSiteRestrictedWeb"===e.toolInvocation.toolName||"bash"===e.toolInvocation.toolName||"navigateToPage"===e.toolInvocation.toolName||"showContactForm"===e.toolInvocation.toolName||"showSupportLink"===e.toolInvocation.toolName||"loadSkill"===e.toolInvocation.toolName||"askUser"===e.toolInvocation.toolName&&"result"===e.toolInvocation.state))??!1},[r.parts]),{bashTools:C,firstBashIndex:j,isBashLoading:N}=(0,n.useMemo)(()=>{let e=r.parts??[],t=[],n=-1,s=!1,o=-1;if(e.forEach((e,r)=>{"tool-invocation"===e.type&&"bash"===e.toolInvocation.toolName&&(-1===n&&(n=r),o=r,"call"===e.toolInvocation.state||"partial-call"===e.toolInvocation.state?(s=!0,t.push({toolCallId:e.toolInvocation.toolCallId,command:e.toolInvocation.args.command??"Running command…"})):"result"===e.toolInvocation.state&&t.push({toolCallId:e.toolInvocation.toolCallId,command:e.toolInvocation.args.command??"Ran command"}))}),!a)return{bashTools:t,firstBashIndex:n,isBashLoading:!1};let i=o>=0&&e.slice(o+1).some(e=>"text"===e.type&&e.text.length>0),l="streaming"===y||"submitted"===y,c=s||t.length>0&&l&&!i;return{bashTools:t,firstBashIndex:n,isBashLoading:c}},[r.parts,y,a]),S=(0,X.useAnalyticsContext)("docs.assistant.source_click"),I=(0,X.useAnalyticsContext)("docs.assistant.web_search_click"),P=async(e,t)=>{if(!(0,K.isCli)())try{let r=v(e);if(!r)return void console.error("Message ULID not found for message ID:",e);let n=(0,Y.getAiThumbsFeedbackUrl)({subdomain:x??"",isAuthenticated:!!f,messageId:r,feedback:t});await fetch(n,{method:"PUT"})}catch(e){console.error("Failed to send thumbs feedback:",e)}};return s?(0,t.jsxs)("div",{ref:d,className:(0,k.cn)("py-4 text-sm",e),...c,children:[(0,t.jsx)("span",{children:"Sorry, we could not generate a response to your question."}),(0,t.jsx)(eP,{})]}):w?(0,t.jsxs)("div",{ref:d,className:(0,k.cn)("flex flex-col py-4 gap-4 self-stretch min-w-0",e),...c,children:[r.parts?.map((e,n)=>{if("text"===e.type)return(0,t.jsx)(ev,{response:e,isStreaming:a&&n===(r.parts?.length??0)-1&&("streaming"===y||"submitted"===y),onInternalLinkClick:o},`text-${n}`);if("tool-invocation"===e.type&&"search"===e.toolInvocation.toolName&&("call"===e.toolInvocation.state||"partial-call"===e.toolInvocation.state))return(0,t.jsx)(ek,{query:e.toolInvocation.args.query},`${e.toolInvocation.toolCallId}-call`);if("tool-invocation"===e.type&&"search"===e.toolInvocation.toolName&&"result"===e.toolInvocation.state)return(0,t.jsx)("div",{className:(0,k.cn)("flex flex-col gap-2",e.toolInvocation.result.results?.length===0&&"hidden"),children:(0,t.jsx)(ek,{query:e.toolInvocation.args.query,children:(0,t.jsx)("div",{className:"flex gap-1 flex-col",children:e.toolInvocation.result.results?.map(e=>(0,t.jsx)(ec.AssistantPageLink,{href:`/${e.path}`,onInternalLinkClick:o,onClick:()=>{S({url:e.path}).catch(console.error)},title:e.metadata.title,titleContainerClassName:"gap-1 py-1"},e.path))})})},`${e.toolInvocation.toolCallId}-result`);if("tool-invocation"===e.type&&"searchDocsAndSiteRestrictedWeb"===e.toolInvocation.toolName&&("call"===e.toolInvocation.state||"partial-call"===e.toolInvocation.state))return(0,t.jsx)(ef,{query:e.toolInvocation.args.query},`${e.toolInvocation.toolCallId}-call`);if("tool-invocation"===e.type&&"searchDocsAndSiteRestrictedWeb"===e.toolInvocation.toolName&&"result"===e.toolInvocation.state){let r=e.toolInvocation.result,n=r.docs.length>0||r.web.length>0;return(0,t.jsx)("div",{className:(0,k.cn)("flex flex-col gap-2",!n&&"hidden"),children:(0,t.jsx)(ef,{query:e.toolInvocation.args.query,children:(0,t.jsxs)("div",{className:"flex gap-1 flex-col",children:[r.docs.map(e=>(0,t.jsx)(ec.AssistantPageLink,{href:`/${e.path}`,onInternalLinkClick:o,onClick:()=>{S({url:e.path}).catch(console.error)},title:e.metadata.title,titleContainerClassName:"gap-1 py-1"},e.path)),r.web.map(e=>(0,t.jsx)(el.AssistantExternalLink,{href:e.url,onClick:()=>{I({url:e.url}).catch(console.error)},title:e.metadata.title,publishedDate:e.metadata.publishedDate,className:"gap-1 py-1"},e.url))]})})},`${e.toolInvocation.toolCallId}-result`)}else if("tool-invocation"===e.type&&"bash"===e.toolInvocation.toolName)return n!==j?null:(0,t.jsx)(ex,{tools:C,isLoading:N},"bash-group");else if("tool-invocation"===e.type&&"navigateToPage"===e.toolInvocation.toolName&&("call"===e.toolInvocation.state||"result"===e.toolInvocation.state)){let r,n,a=e.toolInvocation;if("result"===a.state){let e=a.result;r=e.path,n=e.label}else r=a.args.path,n=a.args.label;if(!r||!n)return null;let s=`/${r.replace(/^[/\\]+/,"")}`,i=r;return(0,t.jsx)(eC,{toolCallId:a.toolCallId,target:s,label:n,isComplete:"result"===a.state,onClick:()=>{o?.(),S({url:i}).catch(console.error)}},`${a.toolCallId}-navigate`)}else if("tool-invocation"===e.type&&"showContactForm"===e.toolInvocation.toolName&&"result"===e.toolInvocation.state){let r=e.toolInvocation.result;if("object"!=typeof r||null===r||!("type"in r)||"contact-form"!==r.type)return null;let n="audience"in r&&"sales"===r.audience?"sales":"support";return(0,t.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"sales"===n?b["assistant.contactSalesHeader"]:b["assistant.contactSupportHeader"]},`${e.toolInvocation.toolCallId}-contact`)}else if("tool-invocation"===e.type&&"showSupportLink"===e.toolInvocation.toolName&&"result"===e.toolInvocation.state)return(0,V.isContactLinkResult)(e.toolInvocation.result)?(0,t.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:b["assistant.supportLinkHeader"]},`${e.toolInvocation.toolCallId}-support-link`):null;else if("tool-invocation"===e.type&&"askUser"===e.toolInvocation.toolName&&"result"===e.toolInvocation.state){let r=e.toolInvocation.result;return(0,V.isAskUserResult)(r)?(0,t.jsx)(ei,{toolCallId:e.toolInvocation.toolCallId,question:r.question,options:r.options.slice(0,4),isActive:!!a&&"error"!==y},`${e.toolInvocation.toolCallId}-ask-user`):null}else if("tool-invocation"===e.type&&"loadSkill"===e.toolInvocation.toolName){let r,n=e.toolInvocation;if("result"===n.state){if(!(0,V.isSkillResult)(n.result))return null;r=n.result.name}else r=n.args?.slug;return r?(0,t.jsx)(eN,{toolCallId:n.toolCallId,name:r,isComplete:"result"===n.state},`${n.toolCallId}-skill`):null}}),(!a||"ready"===y)&&r.parts&&r.parts.length>0&&(0,t.jsx)("div",{className:"flex items-start gap-2 w-full",children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{"aria-label":b["aria.voteGood"],className:h?eI:eS,onClick:()=>{h||(P(r.id,"positive").catch(console.error),p(!0),g(!1))},children:(0,t.jsx)(er.ThumbsUpIcon,{"aria-hidden":"true",className:"size-4 sm:size-3.5 shrink-0"})}),(0,t.jsx)("button",{"aria-label":b["aria.voteBad"],className:m?eI:eS,onClick:()=>{m||(P(r.id,"negative").catch(console.error),p(!1),g(!0))},children:(0,t.jsx)(et.ThumbsDownIcon,{"aria-hidden":"true",className:"size-4 sm:size-3.5 shrink-0"})}),(0,t.jsx)(eE,{message:r}),a&&(0,t.jsx)(eA,{})]})})]}):null});eM.displayName="ChatResponse";let eR=n.memo(({message:e,isLast:r,hasError:n,handleClose:a})=>"user"===e.role?(0,t.jsx)(U,{message:e}):"assistant"===e.role?(0,t.jsx)(eM,{message:e,isLast:r,hasError:n,handleClose:a}):void 0,(e,t)=>e.message===t.message&&e.handleClose===t.handleClose&&e.isLast===t.isLast&&e.hasError===t.hasError);eR.displayName="ChatItem";let eT=()=>(0,t.jsx)("div",{className:"flex justify-start",children:(0,t.jsxs)("div",{className:"flex gap-0.5 items-end h-3 py-2",children:[(0,t.jsx)("span",{className:"size-1 bg-zinc-400 dark:bg-zinc-500 rounded-full animate-[dotBounce_1.4s_ease-in-out_infinite]"}),(0,t.jsx)("span",{className:"size-1 bg-zinc-400 dark:bg-zinc-500 rounded-full animate-[dotBounce_1.4s_ease-in-out_0.2s_infinite]"}),(0,t.jsx)("span",{className:"size-1 bg-zinc-400 dark:bg-zinc-500 rounded-full animate-[dotBounce_1.4s_ease-in-out_0.4s_infinite]"})]})}),eL=()=>{let{status:e,messages:r}=(0,c.useAssistant)();if((0,n.useMemo)(()=>{if("submitted"===e)return!0;if("streaming"!==e)return!1;let t=r.at(-1)?.parts.at(-1);return t?.type==="step-start"||t?.type==="tool-invocation"},[e,r]))return(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(eT,{})})},eD=({className:e,handleClose:r})=>{let n=(0,u.default)((0,I.useShallow)(e=>e.messages)),a="error"===(0,u.default)(e=>e.status);return(0,t.jsxs)("div",{className:(0,k.cn)("flex flex-col gap-3 mb-2",e),children:[n.map((e,s)=>(0,t.jsx)(eR,{message:e,isLast:s===n.length-1,hasError:s===n.length-1&&a,handleClose:r},e.id)),(0,t.jsx)(eL,{})]})},e_=(0,g.default)("BracketsCurlyIcon",[["path",{d:"M6.25 15.25H5.25C4.145 15.25 3.25 14.355 3.25 13.25V10.625C3.25 9.728 2.522 9 1.625 9C2.522 9 3.25 8.272 3.25 7.375V4.75C3.25 3.645 4.145 2.75 5.25 2.75H6.25",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}],["path",{d:"M11.75 15.25H12.75C13.855 15.25 14.75 14.355 14.75 13.25V10.625C14.75 9.728 15.478 9 16.375 9C15.478 9 14.75 8.272 14.75 7.375V4.75C14.75 3.645 13.855 2.75 12.75 2.75H11.75",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var ez=e.i(767436);let eH=(0,g.default)("PaperclipIcon",[["path",{d:"M7.75 5V11.75C7.75 12.578 8.422 13.25 9.25 13.25C10.078 13.25 10.75 12.578 10.75 11.75V4.75C10.75 3.093 9.407 1.75 7.75 1.75C6.093 1.75 4.75 3.093 4.75 4.75V11.75C4.75 14.235 6.765 16.25 9.25 16.25C11.735 16.25 13.75 14.235 13.75 11.75V5",stroke:"currentColor",width:"1.5",linecap:"round",linejoin:"round"}]],"outlined");var e$=e.i(93814),eO=e.i(385346),eF=e.i(835963),eW=e.i(923822),eB=e.i(765427);function eU({isFeatureUnavailable:e}){let r=e.rayId,n="blocked"===e.type||"heuristic_blocked"===e.type,a=encodeURIComponent(`${"heuristic_blocked"===e.type?"Assistant request could not be verified":"Assistant blocked on my network"}${r?` - Request ID: ${r}`:""}`);return(0,t.jsx)(t.Fragment,{children:e.unavailable&&(0,t.jsx)("div",{className:(0,k.cn)("mb-3 p-3 rounded-xl border",n?"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800/50":"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800/50"),children:(0,t.jsxs)("p",{className:(0,k.cn)("text-sm",n?"text-red-800 dark:text-red-200":"text-amber-800 dark:text-amber-200"),children:[e.message,"blocked"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"If you believe this is a false positive, please email"," ",(0,t.jsx)("a",{href:`mailto:support@mintlify.com?subject=${a}`,target:"_blank",rel:"noopener noreferrer",className:"underline hover:opacity-80",children:"support@mintlify.com"})," ","with details from"," ",(0,t.jsx)("a",{href:"https://ipinfo.io/json",target:"_blank",rel:"noopener noreferrer",className:"underline hover:opacity-80",children:"ipinfo.io/json"}),r&&(0,t.jsxs)(t.Fragment,{children:[" ","and your request ID:"," ",(0,t.jsx)("span",{className:"font-mono select-all",children:r})]}),"."]}),"heuristic_blocked"===e.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"If this issue persists, please email"," ",(0,t.jsx)("a",{href:`mailto:support@mintlify.com?subject=${a}`,target:"_blank",rel:"noopener noreferrer",className:"underline hover:opacity-80",children:"support@mintlify.com"}),r&&(0,t.jsxs)(t.Fragment,{children:[" ","with your request ID:"," ",(0,t.jsx)("span",{className:"font-mono select-all",children:r})]}),"."]})]})})})}let eY={pdf:{icon:ez.FileContentIcon,className:"size-4 text-red-500 dark:text-red-400"},json:{icon:e_,className:"size-4 text-yellow-600 dark:text-yellow-400"},code:{icon:L,className:"size-4 text-blue-500 dark:text-blue-400"},text:{icon:ez.FileContentIcon,className:"size-4 text-gray-500 dark:text-gray-400"},generic:{icon:ez.FileContentIcon,className:"size-4 text-gray-500 dark:text-gray-400"}};function eX({kind:e,attachment:r}){if("image"===e)return(0,t.jsx)("img",{src:r.url,alt:r.name,className:"size-4 rounded object-cover"});let n=eY[e]??eY.generic,a=n?.icon;return a?(0,t.jsx)(a,{strokeWidth:2,className:n.className}):null}function eV({attachment:e,onRemove:r}){let a=(0,l.useSelectedLocale)(),[s]=(0,n.useState)(()=>eO.createHandle()),o=(0,n.useRef)(null),i=(0,M.getAttachmentKind)(e.type,e.name),c="image"===i,u=c?(0,t.jsx)(P.ZoomImage,{handle:s,expandButton:!1,onOpenChangeComplete:e=>{e||o.current?.focus({preventScroll:!0})},zoomImg:{src:e.url,alt:e.name},children:(0,t.jsx)("img",{src:e.url,alt:e.name,className:"size-4 rounded object-cover"})}):(0,t.jsx)(eX,{kind:i,attachment:e});return(0,t.jsxs)("div",{className:"relative flex items-center gap-1 rounded-lg border border-gray-200 dark:border-white/10 bg-white dark:bg-white/5 py-1 pl-1 pr-1.5",children:[u,(0,t.jsx)("span",{className:"text-xs font-medium text-gray-900 dark:text-gray-100 max-w-[120px] truncate",children:e.name}),c&&(0,t.jsx)("button",{ref:o,type:"button",onClick:()=>s.open(0),className:"absolute inset-0 rounded-lg cursor-zoom-in focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary dark:focus-visible:outline-primary-light","aria-label":a["aria.viewAttachment"].replace("{name}",e.name)}),(0,t.jsx)("button",{type:"button",onClick:r,className:"relative z-10 flex items-center justify-center size-2.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":a["aria.removeAttachment"].replace("{name}",e.name),children:(0,t.jsx)(v.XmarkIcon,{strokeWidth:2,"aria-hidden":"true",focusable:"false",className:"size-2.5 shrink-0"})})]})}let eq=(0,n.forwardRef)(({scrollRef:e,isMobile:r,onFilesRejected:s,attachmentsDisabled:o=!1,autosize:d},h)=>{let{subdomain:p}=(0,n.useContext)(i.DeploymentMetadataContext),{docsConfig:m}=(0,n.useContext)(i.DocsConfigContext),{isChatSheetOpen:g,shouldFocusChatSheet:x,entryPoint:f,setShouldFocusChatSheet:b}=(0,n.useContext)(a.ChatAssistantContext),y=(0,eF.useAssistantEnterAnalytics)(),v=(0,X.useAnalyticsContext)("docs.assistant.attachment_upload"),w=(0,X.useAnalyticsContext)("docs.assistant.attachment_rejected"),C=(0,X.useAnalyticsContext)("docs.assistant.attachment_limit_exceeded"),j=(0,T.useRouter)(),N=(0,A.useCurrentPath)(),S=(0,l.useSelectedLocale)(),P=(0,n.useRef)(null),L=(0,n.useRef)(null),{setInput:D,isFeatureUnavailable:_,payloadInput:H,setPayloadInput:$}=(0,c.useAssistant)(),O=(0,u.default)((0,I.useShallow)(e=>e.pendingAttachments)),F=(0,u.default)(e=>e.addPendingAttachment),W=(0,u.default)(e=>e.removePendingAttachment),B=(0,u.default)(e=>e.clearPendingAttachments),U=(0,u.default)(e=>e.setStagedAttachments),Y=(0,n.useCallback)(async(e,t)=>{let{attachments:r,rejectedFileNames:n}=await (0,M.processDroppedFiles)(e),a=e$.MAX_ATTACHMENTS_PER_MESSAGE-O.length,o=r.slice(0,Math.max(0,a));for(let e of o)F(e);o.length>0&&v({subdomain:p,method:t,count:o.length,kinds:o.map(e=>(0,M.getAttachmentKind)(e.type,e.name))});let i=r.length-o.length;i>0&&C({subdomain:p,method:t,skippedCount:i}),n.length>0&&(w({subdomain:p,method:t,count:n.length,extensions:n.map(e=>(0,M.getFileExtension)(e))}),s?.(n))},[F,s,O.length,p,v,w,C]);(0,n.useImperativeHandle)(h,()=>({handleFiles:(e,t)=>void Y(e,t)}));let V=(0,n.useCallback)(e=>{if(o)return;let t=Array.from(e.clipboardData.files);0!==t.length&&(e.preventDefault(),Y(t,"paste"))},[o,Y]),q=(0,n.useCallback)(()=>{L.current?.click()},[]),K=(0,n.useCallback)(e=>{let{files:t}=e.target;t&&t.length>0&&Y(t,"picker"),e.target.value=""},[Y]);(0,n.useEffect)(()=>{if(!g)return void P.current?.blur();if(r){x&&b(!1);return}if(!x)return;let e=P.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length)),b(!1)},[g,x,b,r]);let G=e=>{let t=e.path;if(t&&t!==N&&t){(0,R.schedulePayloadHighlight)(e),j.push((0,E.navHref)(t));return}(0,R.highlightPayloadContext)(e)},Z=!!H.context&&H.context.length>0,Q=O.length>0,J=(0,t.jsxs)(t.Fragment,{children:[Q&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 px-2 pt-2",children:O.map(e=>(0,t.jsx)(eV,{attachment:e,onRemove:()=>W(e.id)},e.id))}),Z&&H.context&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2 px-2 pt-2 max-h-[300px] overflow-y-auto",children:H.context.map((e,r)=>(0,t.jsx)(z,{context:e,onClick:G,onRemove:()=>{$({context:H.context?.filter((e,t)=>t!==r)||[]})}},r))})]}),ee=o?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:L,type:"file",accept:M.ACCEPTED_FILE_INPUT,multiple:!0,className:"hidden",onChange:K}),(0,t.jsx)("button",{type:"button",onClick:q,className:"p-1 rounded-lg text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-white/10","aria-label":S["aria.addAttachment"],children:(0,t.jsx)(eH,{"aria-hidden":"true",focusable:"false",className:"size-3.5 shrink-0"})})]});return(0,t.jsxs)("div",{className:(0,k.cn)(r&&"z-50 bg-background-light dark:bg-background-dark"),children:[(0,t.jsx)(eU,{isFeatureUnavailable:_}),(0,t.jsx)(eB.ChatInput,{ref:P,variant:"panel",autosize:d,isMobile:r,headerContent:Z||Q?J:null,footerLeftContent:ee,onBeforeSubmit:()=>{H.context&&H.context.length>0&&u.default.getState().setPendingContext(H.context),O.length>0&&U([...O])},onSubmit:t=>{D(""),$({context:void 0}),B(),requestAnimationFrame(()=>{e.current?.scrollTo({top:0,behavior:"instant"})}),y(t,f),r&&P.current&&P.current.blur()},onDeleteEmpty:()=>{H.context&&H.context.length>0&&$({context:H.context.slice(0,-1)})},onPaste:V,className:(0,eW.isPillInputTheme)(m?.theme)?"rounded-3xl":void 0})]})});eq.displayName="ChatTextArea";var eK=e.i(512733);let eG="w-full px-3.5 py-2.5 border border-gray-200 dark:border-gray-800 rounded-xl text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-600/70 dark:placeholder:text-gray-400/70 bg-black/0 focus:ring-0 focus:outline-0 focus:border-gray-300 dark:focus:border-gray-700";function eZ({label:e,error:r,children:n}){return(0,t.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:[e," ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),n,r&&(0,t.jsx)("span",{className:"text-xs text-red-500",children:r})]})}function eQ({audience:e,initialMessage:r,className:n}){let{locale:a,firstName:s,setFirstName:o,lastName:i,setLastName:l,company:c,setCompany:u,email:d,setEmail:h,message:p,setMessage:m,status:g,dismissed:x,setDismissed:f,header:b,buttonLabel:y,messagePlaceholder:w,hasInvalidEmail:C,canSubmit:j,submit:N}=(0,eK.useContactForm)({audience:e,initialMessage:r});return x?null:"sent"===g?(0,t.jsxs)("div",{"data-component-part":"assistant-contact-form",className:(0,k.cn)("flex items-center justify-between gap-2 p-4 border border-gray-200 dark:border-gray-800 rounded-2xl",n),children:[(0,t.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:a["assistant.contactSuccess"]}),(0,t.jsx)("button",{type:"button",onClick:()=>f(!0),"aria-label":a["assistant.contactDismiss"],className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors shrink-0",children:(0,t.jsx)(v.XmarkIcon,{"aria-hidden":"true",strokeWidth:2,className:"size-4 shrink-0"})})]}):(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),N()},"data-component-part":"assistant-contact-form",className:(0,k.cn)("flex flex-col gap-4 p-4 border border-gray-200 dark:border-gray-800 rounded-2xl",n),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:b}),(0,t.jsx)("button",{type:"button",onClick:()=>f(!0),"aria-label":a["assistant.contactDismiss"],className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:(0,t.jsx)(v.XmarkIcon,{"aria-hidden":"true",strokeWidth:2,className:"size-4 shrink-0"})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(eZ,{label:a["assistant.contactFirstName"],children:(0,t.jsx)("input",{value:s,onChange:e=>o(e.target.value),placeholder:"Jane",className:eG})}),(0,t.jsx)(eZ,{label:a["assistant.contactLastName"],children:(0,t.jsx)("input",{value:i,onChange:e=>l(e.target.value),placeholder:"Doe",className:eG})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(eZ,{label:a["assistant.contactCompany"],children:(0,t.jsx)("input",{value:c,onChange:e=>u(e.target.value),placeholder:"Acme",className:eG})}),(0,t.jsx)(eZ,{label:a["assistant.contactCompanyEmail"],error:C?a["feedback.invalidEmail"]:void 0,children:(0,t.jsx)("input",{type:"email",value:d,onChange:e=>h(e.target.value),placeholder:"jane@acme.com",className:(0,k.cn)(eG,C&&"border-red-500 dark:border-red-500")})})]}),(0,t.jsx)(eZ,{label:a["assistant.contactHowCanWeHelp"],children:(0,t.jsx)("textarea",{value:p,onChange:e=>m(e.target.value),placeholder:w,rows:3,className:(0,k.cn)(eG,"resize-none")})}),"error"===g&&(0,t.jsx)("p",{className:"text-xs text-red-500",children:a["assistant.contactError"]}),(0,t.jsx)("button",{type:"submit",disabled:!j,className:"w-full px-4 py-2.5 bg-black dark:bg-white text-white dark:text-black text-sm font-medium rounded-xl disabled:cursor-not-allowed disabled:opacity-50",children:y})]})}var eJ=e.i(28726);let e0=({starterQuestions:e,assistantConfig:r})=>{let n=(0,l.useSelectedLocale)(),{questions:a,selectQuestion:s}=(0,eJ.useStarterQuestions)({starterQuestions:e,assistantConfig:r});return(0,t.jsxs)("div",{className:"h-full flex flex-col justify-between",children:[(0,t.jsx)("div",{className:"mt-4 flex flex-col items-center text-sm",children:(0,t.jsx)("div",{className:(0,k.cn)("mx-8 text-center text-gray-400 dark:text-gray-600 text-xs",h.Classes.ChatAssistantDisclaimerText),children:n["assistant.disclaimer"]})}),a.length>0&&(0,t.jsx)("div",{className:"pb-6",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("p",{className:(0,k.cn)("text-sm text-gray-700 dark:text-gray-300",h.Classes.StarterQuestionText),children:n["assistant.suggestions"]}),a.slice(0,3).map(({text:e},r)=>(0,t.jsx)("button",{onClick:()=>s(r),className:"font-medium text-left text-sm text-primary hover:brightness-[0.75] dark:hover:brightness-[1.35] dark:text-primary-light dark:hover:text-primary transition-colors",children:e},r))]})})]})};function e1({className:e,minWidth:r=j.CHAT_SHEET_MIN_WIDTH,maxWidth:c=j.CHAT_SHEET_MAX_WIDTH,hidden:g=!1,variant:y="sheet"}){let I="page"===y,P=(0,N.useAssistantContact)(),A=(0,l.useSelectedLocale)(),{starterQuestions:E,assistantConfig:M}=(0,n.useContext)(a.SearchContext),{docsConfig:R}=(0,n.useContext)(i.DocsConfigContext),T=R?.theme==="almond",L=M?.attachments?.status==="DISABLED",D=(0,u.default)(e=>e.messages.length),{isChatSheetOpen:_,onChatSheetToggle:z,isAssistantOpen:H,isInProgress:$,sheetRef:O,width:F,isResizing:W,isMaximized:B,handleMouseDown:U,toggleMaximize:Y,isMobileQuery:X,isClient:V,isMobile:q,pageChatAssistantContext:K,rejectedFiles:G,setRejectedFiles:Z,handleFilesRejected:Q}=(0,S.useAssistantShell)({isPage:I,minWidth:r,maxWidth:c,mobileQuery:"(max-width: 1024px)"}),J=(0,n.useRef)(null),ee=(0,n.useRef)(null),[et,er]=(0,n.useState)(!1),en=(0,n.useRef)(0),ea=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),en.current+=1,Array.from(e.dataTransfer.items).some(e=>"file"===e.kind)&&er(!0)},[]),es=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),en.current-=1,en.current<=0&&(en.current=0,er(!1))},[]),eo=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),ei=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),en.current=0,er(!1);let{files:t}=e.dataTransfer;0!==t.length&&ee.current?.handleFiles(t,"drag")},[]),el=L?void 0:{onDragEnter:ea,onDragLeave:es,onDragOver:eo,onDrop:ei},ec=(0,t.jsx)(eq,{ref:ee,scrollRef:J,isMobile:q,autosize:H,onFilesRejected:Q,attachmentsDisabled:L}),eu=(0,t.jsx)(w.AssistantContactOptions,{ContactForm:eQ,contact:P,children:ec}),ed=(0,t.jsxs)(t.Fragment,{children:[et&&!L&&(0,t.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-gray-950/60 p-8",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsx)(f,{"aria-hidden":"true",className:"size-8 text-white shrink-0"}),(0,t.jsxs)("div",{className:"flex flex-col items-center text-center text-white",children:[(0,t.jsx)("p",{className:"text-base font-medium",children:A["assistant.uploadFile"]}),(0,t.jsx)("p",{className:"text-sm",children:A["assistant.dropFiles"]})]})]})}),(0,t.jsx)(C.AssistantRejectedFiles,{rejectedFiles:G,onDismiss:()=>Z([])})]}),eh=(0,t.jsxs)("div",{className:(0,k.cn)(h.Classes.ChatAssistantSheetHeader,"flex items-center justify-between pb-3 px-4"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.Sparkle3Icon,{className:"size-5 text-primary dark:text-primary-light shrink-0","aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:A.assistant})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[!q&&(0,t.jsx)("button",{onClick:Y,className:"group hover:bg-gray-100 dark:hover:bg-white/10 p-1.5 rounded-lg","aria-label":B?A["aria.minimizeAssistantPanel"]:A["aria.maximizeAssistantPanel"],children:B?(0,t.jsx)(x,{strokeWidth:2,"aria-hidden":"true",focusable:"false",className:"size-4 sm:size-3.5 text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-300 shrink-0"}):(0,t.jsx)(m.ArrowsExpandDiagonalIcon,{strokeWidth:2,"aria-hidden":"true",focusable:"false",className:"size-4 sm:size-3.5 text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-300 shrink-0"})}),D>0&&(0,t.jsx)(e5,{}),(0,t.jsx)("button",{onClick:()=>{u.default.getState().activeStop?.(),z()},className:"group hover:bg-gray-100 dark:hover:bg-white/10 p-1.5 rounded-lg","aria-label":A["aria.closeAssistantPanel"],children:(0,t.jsx)(v.XmarkIcon,{strokeWidth:2,"aria-hidden":"true",focusable:"false",className:"size-[20px] sm:size-4 text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-300 shrink-0"})})]})]}),ep=(0,t.jsxs)(t.Fragment,{children:[q&&(0,t.jsx)(p.DrawerHandle,{className:"mt-3 mb-0"}),(0,t.jsxs)("div",{className:(0,k.cn)("w-full flex flex-col flex-1 min-h-0",V&&q?"pt-0":"lg:pt-3"),children:[eh,(0,t.jsxs)("div",{ref:J,id:"chat-content","data-base-ui-swipe-ignore":D>0?"":void 0,className:(0,k.cn)(h.Classes.ChatAssistantSheetContent,"flex flex-col-reverse flex-1 overflow-y-auto relative px-5 min-h-0"),children:[(0,t.jsx)("div",{className:"grow"}),D>0?(0,t.jsx)(eD,{handleClose:X?()=>z():void 0}):(0,t.jsx)(e0,{starterQuestions:E,assistantConfig:M})]}),(0,t.jsx)("div",{className:"px-4 pb-4 shrink-0",children:eu})]})]});return I?(0,t.jsx)(a.ChatAssistantContext.Provider,{value:K,children:(0,t.jsxs)("main",{id:d.Ids.ContentArea,"aria-label":A.assistant,className:"flex h-full w-full justify-center overflow-hidden bg-background-light px-5 dark:bg-background-dark sm:px-8","data-assistant-page":"",children:[(0,t.jsx)("h1",{className:"sr-only",children:A.assistant}),(0,t.jsxs)("div",{className:"relative flex h-full w-full max-w-3xl flex-col",...el,children:[0===D?(0,t.jsx)("div",{className:"mx-auto flex h-full w-full max-w-2xl flex-col justify-center py-12",children:ec}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-between border-b border-gray-100 px-1 py-4 dark:border-white/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.Sparkle3Icon,{className:"size-5 shrink-0 text-primary dark:text-primary-light","aria-hidden":"true"}),(0,t.jsx)("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:A.assistant})]}),(0,t.jsx)(e5,{})]}),(0,t.jsxs)("div",{ref:J,id:"assistant-page-chat-content",className:"relative flex min-h-0 flex-1 flex-col-reverse overflow-y-auto px-1 py-5",children:[(0,t.jsx)("div",{className:"grow"}),(0,t.jsx)(eD,{})]}),(0,t.jsx)("div",{className:"shrink-0 border-t border-gray-100 px-1 pb-6 pt-4 dark:border-white/10",children:eu})]}),ed]})]})}):V&&q?(0,t.jsx)(p.Drawer,{open:_,onOpenChange:(e,t)=>{if(!e&&_){if("escape-key"===t.reason&&$)return void t.cancel();z()}},children:(0,t.jsxs)(p.DrawerPortal,{keepMounted:!0,children:[(0,t.jsx)(p.DrawerBackdrop,{className:o.zIndex.Popup}),(0,t.jsx)(p.DrawerViewport,{className:o.zIndex.Popup,children:(0,t.jsxs)(p.DrawerPopup,{id:d.Ids.ChatAssistantSheet,"aria-label":A.assistant,className:(0,k.cn)(h.Classes.ChatAssistantSheet,"flex h-[calc(85vh+var(--bleed))] flex-col overflow-hidden rounded-t-2xl","pb-[calc(env(safe-area-inset-bottom,0px)+var(--bleed))]",e,"print:hidden"),"data-assistant-sheet-container":"",...el,children:[ep,ed]})})]})}):(0,t.jsxs)("div",{suppressHydrationWarning:!0,"data-assistant-sheet-container":"",className:(0,k.cn)("sticky shrink-0 z-22",T?"pt-2 pb-2 pr-2":"bg-background-light dark:bg-background-dark","mt-(--banner-height,0px) top-(--banner-height,0px) h-[calc(100vh-var(--banner-height,0px))]",!V&&"max-lg:hidden",e,"print:hidden"),style:{width:V?g?0:`${F}px`:`var(${s.ASSISTANT_WIDTH_CSS_VAR}, 0px)`,minWidth:V&&!g?`${r}px`:void 0,maxWidth:V&&!g?`${c}px`:void 0,overflow:!V||g?"hidden":void 0,pointerEvents:g?"none":void 0,visibility:g?"hidden":void 0},children:[(0,t.jsx)("div",{className:(0,k.cn)("absolute left-0 top-0 bottom-0 w-px z-10 cursor-col-resize",'after:content-[""] after:absolute after:inset-y-0 after:-inset-x-2 after:select-none',!T&&(0,k.cn)("bg-gray-100 dark:bg-gray-800","hover:bg-gray-200 dark:hover:bg-gray-700",W&&"bg-gray-200 dark:bg-gray-700")),onMouseDown:U}),(0,t.jsxs)("div",{ref:O,id:d.Ids.ChatAssistantSheet,className:(0,k.cn)("flex flex-col overflow-hidden shrink-0 relative h-full bg-background-light dark:bg-background-dark",T&&"rounded-2xl border border-gray-200/70 dark:border-white/[0.07]",h.Classes.ChatAssistantSheet),"aria-hidden":!_,...el,children:[ep,ed]})]})}let e5=()=>{let{onClear:e}=(0,c.useAssistant)(),r=(0,l.useSelectedLocale)();return(0,t.jsx)("button",{onClick:e,className:"group hover:bg-gray-100 dark:hover:bg-white/10 p-1.5 rounded-lg","aria-label":r["aria.clearChatHistory"],children:(0,t.jsx)(y.TrashIcon,{strokeWidth:2,"aria-hidden":"true",focusable:"false",className:"size-4 sm:size-3.5 text-gray-500 group-hover:text-gray-700 dark:group-hover:text-gray-300 shrink-0"})})},e2=(0,n.lazy)(()=>e.A(591812));function e4(e){let s=(0,n.useContext)(r.AssistantUiContext),{isChatSheetOpen:o}=(0,n.useContext)(a.ChatAssistantContext),i="page"===e.variant||o,[l,c]=(0,n.useState)(i);return((0,n.useEffect)(()=>{i&&c(!0)},[i]),"assistant-ui-v2"!==s||i||l)?(0,t.jsx)(n.Suspense,{fallback:null,children:"assistant-ui-v2"===s?(0,t.jsx)(e2,{className:e.className,minWidth:e.minWidth,maxWidth:e.maxWidth,variant:e.variant}):(0,t.jsx)(e1,{...e})}):null}}]);