1import{b as I,r,I as C,l as se,b0 as fe,f as pe,j as e,c as B,T as j,as as M,bl as he,p as ne,b7 as ae,at as z,g as _e,h as ge,ah as xe}from"./automationAxios-cNeOZexa.js";import{a as ye}from"./context-Dgq7ANKE.js";import{c as be}from"./wikitPropsUtils-DUWFS9gw.js";import{E as $}from"./MessageCard-DbOEP_Xj.js";import"./QuotaMessage-C2ktLZ5U.js";import{a as Q,B as re,e as ve}from"./KeyboardShortcut-Br_3T-FO.js";import{u as F,a as Se,p as je,S as Ee,m as ke,e as we}from"./SearchFilter-DbAchIFf.js";import{R as Ce}from"./constants-CcoiftZV.js";import{F as oe}from"./FormattedDate-BJj4k6l3.js";import"./Picto-B1iwdGfk.js";/* empty css */import{u as U,M as V,a as H,F as q,f as Te,q as Ne}from"./usePrevious-BvPEkga4.js";import{m as ie,M as X}from"./mixpanelTrackEvent-CBihJ8IF.js";import{s as Ie}from"./screeb-DLlCmLWQ.js";import{D as Re}from"./explore-BT391B0x.js";import{A as O,m as Ae}from"./mixpanelTrackEventWithDebug-DuS4Afca.js";import{u as Me,T as D}from"./types-ChM8g_bA.js";import{A as Fe}from"./AssetCategoryChip-CfcIujYg.js";import{U as Pe}from"./UserAvatar-DMPEWqld.js";import{L as Le}from"./index-B6tDycoz.js";import{h as $e}from"./portal-D9d77_kn.js";import{P as qe}from"./PrefilledLogin-DehBMOGM.js";import{P as Be}from"./PrefilledSignup-C3bJIU8e.js";const Oe="/api/account/v1.0/mcp/tokens/",De="https://semantics-chat.wikit.ai/chat-embed.js";function Ke(s){const t=document.createElement("script");t.src=De,t.onload=s,document.body.appendChild(t)}async function Ue(s){const t=await fetch(Oe,{...s?{headers:{"X-Agent-Mode":"anonymous"}}:{}});if(t.status!==200)throw new Error(`Agent token fetching failed: ${t.status} ${t.statusText}`);const{token:a}=await t.json();return a}function We(s,t){const a=new MutationObserver(n=>{n.forEach(c=>{Array.from(c.addedNodes).some(o=>o.nodeType===Node.ELEMENT_NODE&&o.id==="sce-iframe")&&(t(),a.disconnect())})});a.observe(s,{childList:!0})}function ze(){const s=I(o=>o.entities.domain?.agent),{customParameters:t,visible:a}=ye(),n=r.useRef(null),c=r.useRef(t);return c.current=t,r.useEffect(()=>{if(!s?.enabled)return;const{llm_app_slug:o,agent_color:d,anonymous_mode:l,chat_button_icon:{border_radius:y,...b},chat_window:{iframe_title:f,...p},chat_button_tooltip:v,position:u}=s,g={organizationSlug:"huwise",llmAppSlug:o,color:d,position:u,chatButtonIcon:{...b,borderRadius:y},chatButtonTooltip:v,chatWindow:{...p,iframeTitle:f}};Ke(()=>{n.current=window.wrapSemanticsChat(be(g));const E=document.getElementById("sce-container");if(!E)throw new Error("Agent container not found");const w=async()=>{const S=await Ue(l);n.current?.setCustomParams({...c.current,huwiseUserToken:S})};E.querySelector("iframe")?w():We(E,w)})},[]),r.useEffect(()=>{n.current&&t&&n.current.setCustomParams(t)},[t]),r.useEffect(()=>{document.body.classList.toggle("ods-agent-hidden",!a)},[a]),null}const Qe=s=>{const{query:t,isFirstQuery:a,searchContext:n}=s;ie(X.VECTOR_SEARCH_QUERIED,{query:t,isFirstQuery:a,searchContext:n}),Ie("vector-search-queried")},J=s=>{const{query:t,clickedElement:a,uid:n,rank:c}=s;ie(X.VECTOR_SEARCH_RESPONSE_CLICKED,{query:t,clickedElement:a,rank:c,uid:n},{transport:"sendBeacon"})},Ve=s=>{const{i18n:t}=r.useContext(C),{track:a}=Me(),[n,c]=r.useState(""),[o,d]=r.useState(""),[l,,y,b]=U(!1),f=r.useRef(null),{license:{enable_multi_assets:p},properties:{"ui#enable_marketplace_experience":v=!1}}=I(h=>h.entities.domain),u=p&&v,{data:{results:g,total_count:E}={},isLoading:w,error:S,isFallback:R}=Re(u,o,f.current||void 0),x=r.useRef({searchTerm:"",results:void 0,totalCount:void 0});x.current={searchTerm:n,results:g,totalCount:E};const i=r.useCallback(()=>{x.current.searchTerm&&a({eventType:D.AssetFunnelAnalytics,eventName:O.CatalogPageView,properties:{catalog_search_term:x.current.searchTerm,catalog_order_by:null,search_origin:`quickfind-${s}`,catalog_dates:null,catalog_refines:null}},{immediate:!0}),x.current.results?.length&&(Ae(`Impression: ${x.current.results.map(h=>h.uid).join(", ")} â Search: ${x.current.searchTerm}`,X.ASSET_CATALOG_RESULT_IMPRESSION,{asset_id_list:x.current.results.map(h=>h.uid),catalog_search_term:x.current.searchTerm,search_origin:`quickfind-${s}`},{transport:"sendBeacon"}),a({eventType:D.AssetFunnelAnalytics,eventName:O.CatalogResultImpression,properties:{asset_uid_list:x.current.results.map(h=>h.uid),total_results:x.current.totalCount,catalog_search_term:x.current.searchTerm,catalog_order_by:null,catalog_dates:null,catalog_refines:null,
1search_origin:`quickfind-${s}`}},{immediate:!0}))},[s,a]),m=r.useCallback((h,de,me)=>{i(),a({eventType:D.AssetFunnelAnalytics,eventName:O.CardClick,properties:{asset_uid:h,asset_type:de,asset_rank:me,catalog_search_term:x.current.searchTerm,search_origin:`quickfind-${s}`,catalog_order_by:null,catalog_dates:null,catalog_refines:null}})},[s,i,a]),T=r.useCallback(h=>{f.current?.abort(),f.current=new AbortController,d(h)},[]),Z=r.useMemo(()=>se.debounce(T,500),[T]);r.useEffect(()=>{o&&Qe({query:o,isFirstQuery:!w&&!l,searchContext:s})},[o,l,w,s]);const le=r.useCallback(h=>{c(h),h?h.length>=3&&Z(h):(T(""),b())},[T,b,Z]);r.useEffect(()=>{g&&!l&&y()},[g,y,l]),r.useEffect(()=>()=>{i()},[]),r.useEffect(()=>{R&&new fe().errorProbe({message:"Quick Find: Vector search fallback used",stack:"react"},null)},[R]);const ue=r.useMemo(()=>{if(pe.isAxiosError(S)&&!(S.message&&S.message==="canceled")){if(S.response?.status===500)return t.translate("The service returned an unexpected error. Please contact the support.");console.error(S)}return null},[t,S]);return{onSearch:le,currentSearch:n,firstResults:l,results:g||[],isLoading:w,error:ue,isMultiAssetEnabledAndVisible:u,isSearchLexicalFallback:R,onResultClick:m,onSearchReset:i,onSearchClose:i}};var ce=(s=>(s.Widget="widget",s.Navbar="navbar",s))(ce||{});const He="_container_1at66_208",Xe="_isEmpty_1at66_217",Ge="_list_1at66_233",Ze="_listIsInlined_1at66_253",Je="_item_1at66_261",Ye="_title_1at66_280",et="_itemTextContent_1at66_290",tt="_assetTitle_1at66_296",st="_assetSubtitle_1at66_303",nt="_dataIcon_1at66_314",at="_footer_1at66_347",rt="_noMatch_1at66_354",ot="_preview_1at66_359",it="_previewTitle_1at66_374",ct="_previewSubtitle_1at66_385",lt="_previewDescription_1at66_393",_={container:He,isEmpty:Xe,list:Ge,listIsInlined:Ze,item:Je,title:Ye,itemTextContent:et,assetTitle:tt,assetSubtitle:st,dataIcon:nt,footer:at,noMatch:rt,preview:ot,previewTitle:it,previewSubtitle:ct,previewDescription:lt};function Y(s,t){return s?Ce.ASSET.INDEX.buildRoute(t.slug):`/explore/dataset/${t.uid}/`}function ut(s,t,a){return s||!t.creator?"":e.jsxs(e.Fragment,{children:[" ⢠",a.translate("Published by")," ",e.jsx("b",{children:t.creator})]})}function dt({asset:s,isMultiAssetEnabledAndVisible:t}){return e.jsxs(e.Fragment,{children:[t?e.jsx(Fe,{category:s.category,compact:!0}):e.jsx(he,{className:_.dataIcon,"aria-hidden":!0}),e.jsxs("span",{className:_.itemTextContent,children:[e.jsx("span",{className:_.assetTitle,children:s.title}),e.jsxs("span",{className:_.assetSubtitle,children:[t&&`${s.category} ⢠`,e.jsx(j,{comment:"e.g.: Updated Feb 13, 2024",translationKey:"Updated <0/>",components:[e.jsx(oe,{fromNow:!0,date:ne(s.updated_at)})]})]})]})]})}function mt({asset:s,isMultiAssetEnabledAndVisible:t}){const{i18n:a}=r.useContext(C),{category:n}=s;return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:Se.screenReaderOnly,children:t?e.jsx(j,{translationKey:"Asset summary"}):e.jsx(j,{translationKey:"Dataset summary"})}),e.jsx("span",{className:_.previewTitle,children:s.title}),e.jsxs("span",{className:_.previewSubtitle,children:[t&&`${n} ⢠`,e.jsx(j,{comment:"e.g.: Updated Feb 13, 2024",translationKey:"Updated <0/>",components:[e.jsx(oe,{fromNow:!0,date:ne(s.updated_at)})]}),ut(t,s,a)]}),s.description&&e.jsx("p",{className:_.previewDescription,children:je(s.description)})]})}function ee(){return e.jsx($,{variant:"warning",children:e.jsx($.Header,{children:e.jsx(j,{translationKey:"Due to a temporary issue with one of our providers, searching for assets may return less results."})})})}function ft(s){const{i18n:t}=r.useContext(C),a=F(null,"search-results"),{results:n,className:c,query:o,isMultiAssetEnabledAndVisible:d,searchQueryInput:l,isInlined:y,showFallbackWarning:b,onResultClick:f}=s,p=n&&n.length>0,v=r.useRef(null),[u,g]=r.useState(0),[E,w]=r.useState(!1),S=r.useCallback(i=>{if(n){if(i.key==="ArrowDown")i.preventDefault(),l?.querySelector("input")?.focus(),g(m=>(m+1)%n.length);else if(i.key==="ArrowUp")i.preventDefault(),l?.querySelector("input")?.focus(),g(m=>(m-1+n.length)%n.length);else if(i.key==="Enter"&&n[u]){const m=Y(d,n[u]);m&&(f(n[u].uid,n[u].asset_type,u+1),window.location.href=m)}}},[n,u,d,l,f]),R=r.useCallback(i=>{E&&g(i)},[E]);r.useEffect(()=>(window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)),[S]),r.useEffect(()=>{if(v&&v.current){const i=v.current,m=()=>w(!0);return i.addEventListener("mousemove",m),()=>i.removeEventListener("mousemove",m)}},[]),r.useEffect(()=>{g(0)},[n]);const x=r.useMemo(()=>{const i="/explore/",m=new URLSearchParams;if(o!==""){const T=d?"search":"q";m.set(T,o)}return m.toString()!==""?`${i}?${m.toString()}`:i},[o,d]);return p?e.jsxs("div",{className:B(_.container,c),ref:v,children:[e.jsxs("div",{className:B(_.list,{[_.listIsInlined]:y}),role:"listbox","aria-activedescendant":`${a}-${n[u].uid}
1`,tabIndex:-1,children:[b?e.jsx(ee,{}):null,p&&e.jsx("span",{className:_.title,children:e.jsx(j,{translationKey:"Best matches"})}),n?.map((i,m)=>e.jsx("a",{id:`${a}-${i.uid}`,role:"option",tabIndex:-1,"aria-selected":m===u,"aria-describedby":`${a}-${i.uid}-summary`,onMouseEnter:()=>R(m),onFocus:()=>g(m),href:Y(d,i),onClick:()=>{f(i.uid,i.asset_type,m+1),J({query:o,clickedElement:i.asset_type.startsWith("ods_")?i.asset_type.slice(4):i.asset_type,rank:m+1,uid:i.uid})},className:_.item,children:e.jsx(M,{errorMessage:t.translate("Unable to display asset {uid} (issue with metadata)",{uid:i.uid}),children:e.jsx(dt,{isMultiAssetEnabledAndVisible:d,asset:i})})},i.uid)),p&&e.jsxs("span",{className:_.footer,children:[e.jsx(j,{translationKey:"Try another search or"})," ",e.jsx("a",{className:"rods-hyperlink",href:x,onClick:()=>J({query:o,clickedElement:"go_to_catalog"}),children:t.translate("Explore the catalog")})]})]}),e.jsx("aside",{className:_.preview,id:`${a}-${n[u].uid}-summary`,children:e.jsx(M,{errorMessage:t.translate("Unable to display a preview for asset {uid} (issue with metadata)",{uid:n[u].uid}),children:n[u]&&e.jsx(mt,{asset:n[u],isMultiAssetEnabledAndVisible:d})},n[u].uid)})]}):e.jsxs("div",{className:B(_.container,_.isEmpty,c),children:[b?e.jsx(ee,{}):null,e.jsx("span",{className:_.noMatch,children:t.translate("We didn't find any resources linked to your search")}),e.jsx(Q,{tag:"a",variant:"secondary",href:x,children:t.translate("Go to our catalog")})]})}const pt="_component_1glr3_208",ht="_searchBoxContainer_1glr3_212",_t="_searchBox_1glr3_212",gt="_cancel_1glr3_247",xt="_cancelButton_1glr3_258",yt="_results_1glr3_289",bt="_firstSearch_1glr3_293",vt="_firstSearchIcon_1glr3_305",St="_firstSearchText_1glr3_310",k={component:pt,searchBoxContainer:ht,searchBox:_t,cancel:gt,cancelButton:xt,results:yt,firstSearch:bt,firstSearchIcon:vt,firstSearchText:St};function jt({closeModal:s,placeholder:t,autoFocus:a=!1}){const{i18n:n}=r.useContext(C),{onSearch:c,onResultClick:o,currentSearch:d,firstResults:l,results:y,isLoading:b,error:f,isMultiAssetEnabledAndVisible:p,isSearchLexicalFallback:v,onSearchReset:u}=Ve(ce.Navbar),g=r.useRef(null),E=r.useMemo(()=>t||(p?n.translate("Search for an asset, or ask a question"):n.translate("Search for a dataset, or ask a question")),[t,p,n]);return e.jsxs("div",{className:k.component,children:[e.jsxs("div",{className:k.searchBoxContainer,children:[e.jsx(Ee,{ref:g,onChange:c,onClear:u,value:d,label:E,isLoading:b,autoFocus:a,className:k.searchBox}),e.jsx("div",{className:k.cancel,children:e.jsx("button",{type:"button",onClick:s,className:k.cancelButton,children:e.jsx(j,{translationKey:"Close"})})})]}),l&&d&&e.jsx(ft,{results:y,className:k.results,query:d,isMultiAssetEnabledAndVisible:p,searchQueryInput:g.current,isInlined:!0,showFallbackWarning:!!(d&&v),onResultClick:o}),!l&&e.jsxs("div",{className:k.firstSearch,children:[e.jsx(ae,{className:k.firstSearchIcon}),e.jsx("div",{className:k.firstSearchText,children:e.jsx(j,{translationKey:"Start typing to search..."})})]}),f&&e.jsx($,{initialOpen:!0,variant:"critical",children:e.jsx($.Header,{children:f})})]})}function Et({onClose:s}){const{i18n:t}=r.useContext(C);return e.jsx(V,{className:"rods-quick-find",isOpen:!0,closeButton:!1,onRequestClose:s,children:e.jsx(H,{children:e.jsx(q,{children:e.jsx(jt,{placeholder:t.translate("What are you looking for?"),autoFocus:!0,closeModal:s})})})})}const kt="_button_rx0xb_208",wt="_text_rx0xb_249",Ct="_shortcut_rx0xb_256",Tt="_icon_rx0xb_260",P={button:kt,text:wt,shortcut:Ct,icon:Tt},Nt=ke().short;function It({onClick:s}){return e.jsxs(re,{onClick:s,className:P.button,children:[e.jsx(ae,{className:P.icon}),e.jsxs("div",{className:P.text,children:[e.jsx(j,{translationKey:"Search"}),e.jsxs("span",{className:P.shortcut,children:[Nt,"+K"]})]})]})}function G(s){const[t]=r.useState(()=>[...document.querySelectorAll(s)]);return t}const Rt=navigator?.userAgentData?.platform||navigator?.platform||"unknown",te=Rt.toLowerCase().startsWith("mac");function At(){const s=G("[data-quickfind-placeholder]"),[t,a]=r.useState(!1);return r.useEffect(()=>{const n=c=>{(te&&c.metaKey||!te&&c.ctrlKey)&&c.key==="k"&&(a(o=>!o),c.preventDefault())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),e.jsxs(e.Fragment,{children:[t&&e.jsx(Et,{onClose:()=>a(!1)}),s.map((n,c)=>z.createPortal(e.jsx(M,{children:e.jsx(q,{children:e.jsx(It,{onClick:()=>a(!0)})})}),n,`quickfind-btn-${c}`))]})}const Mt={skipConcatenation:{selectors:["ods-catalog-card","ods-catalog-card *"]},Dom:{word_filters:{ssen:"s s e n"}}};function A(){document.querySelectorAll(".fas, .fa-classic, .fa-solid, .far, .fa-regular, .fal, .fa-light, .fat, .fa-thin, .fa").forEach(a=>{a.style="font-family: 'FontAwesome' !important;"});const s="a.tbp-li-overlay::after{ content: none !important; }",t=document.createElement("style");
1t.styleSheet?t.styleSheet.cssText=s:t.appendChild(document.createTextNode(s)),document.getElementsByTagName("head")[0].appendChild(t)}function L(){window.Recite.Util.each(window.Recite.Sizzle(".listing__link, .list__link.link-external, .link-external--icon, .list__link, option"),(t,a,n)=>{(t=a.getAttribute("data-basesize"))||(t=window.getComputedStyle(a).getPropertyValue("font-size")),a.setAttribute("data-basesize",t),n=window.Recite.Preferences.get("style.font.size")/100,n===0&&(n=1),a.style.fontSize=`${parseInt(t,10)*n}px`})}function Ft(s,t){s.classList.add(...t),s.querySelectorAll("*").forEach(a=>a.classList.add(...t))}function W(s=3,t=300){const a=document.querySelectorAll(".feature-card-img");a.length?a.forEach(n=>{n.style.marginTop="55px"}):s>0&&setTimeout(()=>W(s-1,t),t)}function Pt(s){A(),s.Event.subscribe("Preferences:set",A),s.Event.subscribe("Preferences:load",A),s.Event.subscribe("Preferences:reset",A),s.Event.subscribe("Controls:loaded",A),s.Event.subscribe("Preferences:load",L),s.Event.subscribe("Controls:loaded",L),s.Event.subscribe("Preferences:set",L),s.Event.subscribe("Preferences:reset",L),s.Event.subscribe("TextMode:enabled",()=>{document.querySelectorAll(".ods-dataset-json-schema").forEach(t=>{t.style.display="none"})}),s.Event.subscribe("Controls:loaded",()=>{const t=` 2 .fas, 3 .fa-classic, 4 .fa-solid, 5 .far, 6 .fa-regular, 7 .fal, 8 .fa-light, 9 .fat, 10 .fa-thin, 11 #main i.fa, 12 i.fa { 13 font-family: FontAwesome !important ; 14 } 15 16 `,a=document.createElement("style");a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(a),setTimeout(()=>{document.querySelectorAll(".map-container, .map-container *").forEach(n=>{n.className!=="study-box"&&n.classList.add("recite-ignore-styles-background")})},300),setTimeout(()=>{W()},500),s.Event.subscribe("Preferences:set",()=>{setTimeout(W,500)})}),setTimeout(()=>{const t=document.querySelectorAll("#main ods-catalog-context section:nth-child(3) div.row, .themebox");t.length&&t.forEach(a=>Ft(a,["recite-ignore-styles-background","recite-ignore-styles-foreground"]))},1e3),s.Event.subscribe("Translate:complete",()=>{const t=document.querySelector('input.odswidget-text-search__search-box[ng-model="searchExpression"]');t&&t.style.setProperty("padding-right","10px","important")})}const Lt="_button_1b6ed_208",$t="_text_1b6ed_217",qt="_icon_1b6ed_223",K={button:Lt,text:$t,icon:qt},Bt="https://api.reciteme.com/asset/js?key=";function Ot(){const s=_e(ge),{i18n:t}=r.useContext(C),a=we("(max-width: 1000px)"),{properties:{"ui#reciteme_key":n}}=I(p=>p.entities.domain),[c,o]=r.useState(!1),[d,l]=r.useState(!0),y=t.translate("Accessibility toolbar"),b=t.translate("Activate the accessibility toolbar");r.useEffect(()=>{if(!ve()||!n)return;const p=/[^a-zA-Z0-9]/g,v=n.replace(p,"");v!==n&&s({type:"warning",message:t.translate("Invalid accessibility toolbar service key.")});const u=document.createElement("script");return u.src=`${Bt}${v}`,u.async=!0,u.onload=()=>{window.Recite&&(Pt(window.Recite),window.Recite.load(Mt),l(!1))},u.onerror=()=>{o(!0),l(!1)},document.body.appendChild(u),()=>{document.body.removeChild(u)}},[s,t,n]);const f=()=>{try{window.Recite?.enable()}catch{s({type:"warning",message:t.translate("Accessibility tool is not available")})}};return c||d?null:e.jsxs(re,{onClick:f,className:K.button,tooltip:b,"aria-label":y,children:[e.jsx(xe,{className:K.icon}),a&&e.jsx("div",{className:K.text,children:y})]})}function Dt(){const s=G("[data-reciteme-placeholder]");return e.jsx(e.Fragment,{children:s.map((t,a)=>z.createPortal(e.jsx(M,{children:e.jsx(q,{children:e.jsx(Ot,{})})}),t,`reciteme-${a}`))})}const Kt="_container_1vavx_431",Ut="_button_1vavx_438",Wt="_logout_1vavx_438",zt="_avatar_1vavx_481",N={container:Kt,button:Ut,logout:Wt,avatar:zt};function Qt({openLoginModal:s}){const{i18n:t}=r.useContext(C),{domain:{license:{enable_sso_signin:a}}}=I(l=>l.entities),{data:n,isLoading:c}=$e(t.shortLanguageCode,a),o=n?.results?.find(l=>l.is_default_login),d=r.useMemo(()=>{let l;return o&&(l=o.login_link),l?{href:l,tag:"a"}:{onClick:s}},[o,s]);return c?null:e.jsx(Q,{className:N.button,...d,children:e.jsx(j,{translationKey:"Login"})})}function Vt({isOpen:s,onRequestClose:t}){const a=F(),n=F();return e.jsx(V,{isOpen:s,onRequestClose:t,className:"rods-login-signup",aria:{labelledby:a,describedby:n},children:e.jsx(H,{children:e.jsx("div",{style:{"--base-font-size-multiplier":"calc(16 / 14)"},children:e.jsx(qe,{titleId:a,subtitleId:n})})})})}function Ht({isOpen:s,onRequestClose:t}){const a=F(),n=F();return e.jsx(V,{isOpen:s,onRequestClose:t,className:"rods-login-signup",aria:{labelledby:a,describedby:n},children:e.jsx(H,{children:e.jsx(Be,{titleId:a,subtitleId:n})})})}function Xt(){const{properties:{"ui#show_signup":s,"users#registration_allowed":t},is_frozen:a}=I(n=>n.entities.domain);return{showSignup:t&&s&&!a}}function Gt(){const t=Te()["--front-office__domain-style__accent-3"];return r.useMemo(()=>t?{"--front-office__domain-style__login-signup__text":Ne(t)}:void 0,[t])}function Zt(){const{currentUser:s,domain:{properties:{"ui#show_login":t}}}=I(p=>p.entities),a=Gt(),[n,,c,o]=U(!1),[d,,l,y]=U(!1),b=!se.isNil(s),{showSignup:f}=Xt();return e.jsxs("div",{style:a,children:[b?e.jsxs("div",{className:N.container,children:[e.jsx("a",{href:"/account",className:N.avatar,children:e.jsx(Pe,{user:s})}),e.jsx(Le,{className:N.logout})]}):e.jsxs("div",{className:N.container,children:[t&&e.jsx(Qt,{openLoginModal:c}),f&&e.jsx(Q,{onClick:l,className:N.button,children:e.jsx(j,{translationKey:"Signup"})})]}),t&&e.jsx(Vt,{isOpen:n,onRequestClose:o}),f&&e.jsx(Ht,{isOpen:d,onRequestClose:y})]})}function Jt(){const s=G("[data-login-signup-placeholder]");return e.jsx(e.Fragment,{children:s.map((t,a)=>z.createPortal(e.jsx(M,{children:e.jsx(q,{children:e.jsx(Zt,{})})}),t,`login-signup-${a}`))})}function Ss({domain:s,currentUser:t}){const[a,n]=r.useState(()=>document.querySelector("[data-ods-header-ready]")!==null);r.useEffect(()=>{if(document.querySelector("[data-ods-header-ready]")){n(!0);return}const o=()=>n(!0);return document.addEventListener("odsHeaderReady",o,{once:!0}),()=>document.removeEventListener("odsHeaderReady",o)},[]);const c=!t&&!s.properties["access.anonymous"];return a?e.jsxs(e.Fragment,{children:[!c&&s.license.enable_next_gen_search&&e.jsx(At,{}),!c&&s.license.enable_reciteme&&s.properties["ui#reciteme_key"]&&e.jsx(Dt,{}),!c&&e.jsx(Jt,{}),s.agent.enabled&&e.jsx(ze,{})]}):null}export{Ss as F,ce as S,ft as a,Ve as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.