1import{D as T,b as r,z as D,p as R,d as V,E as b,Q as n,a7 as t,U as E,u as F,G as H,W as M,am as N,al as z,Z as A,a0 as G,aw as K,aE as O,P as i}from"./VbZ-GkDV.js";import{l as P}from"./DeYXqQ7x.js";import{S as m}from"./C1PTRZ8A.js";/* empty css */import{u as Q,a as W}from"./B-AVQtdE.js";import{f as v,j as p}from"./BgKgRPvN.js";import{T as Z}from"./m8l60_y0.js";import{_ as J}from"./DlAUqK2U.js";import"./D0CJEszp.js";import"./DZ9z05-8.js";const X={class:"slidepage-header-box"},Y={class:"slidepage-header slidepage-layout-container"},$={class:"slidepage-header__avatar"},ee={key:0,class:"slidepage-header__avatar-placeholder","aria-hidden":"true"},ae=["src"],se=T({__name:"index",emits:["search"],setup(te,{emit:_}){const{redirectToLogin:g}=Q({}),o=K(),{fetchUserInfo:y}=W(),s=r(""),c=r(!1),k=D(()=>o.query.keyword&&o.query.keyword.length>0),u=_;R(()=>{const a=o.query.keyword;a&&(s.value=String(a),u("search",a))}),V(()=>o.query.keyword,a=>{a&&(s.value=String(a),u("search",a))});const w=()=>{s.value=""},U=()=>{window.location.href=v(p({domain:"",jumpTo:"/"})+"&scid=slide")},I=()=>{c.value=!0},x=()=>{c.value=!1},B=O(),C=()=>{u("search",s.value),o.path==="/slide/list"?B.replace({path:"/slide/list",query:{keyword:s.value}}):window.location.href=p({domain:"",jumpTo:"/slide/list"})+"?keyword="+s.value},l=r(!1),h=r(null),d=r(!1),L=async()=>{var a;if(typeof window>"u")return l.value=!1,!1;try{const e=await y();return e&&Object.keys(e).length>0?(l.value=!0,h.value=e.data.user_info,!0):(l.value=!1,!1)}catch(e){return(e==null?void 0:e.status)===401||(a=e==null?void 0:e.message)!=null&&a.includes("401"),l.value=!1,!1}};b(async()=>{d.value=!1,await L(),d.value=!0}),Z();const S=()=>{g("100","",o.path,"slide")},j=()=>{window.location.href=v(p({domain:"",jumpTo:"/"})+"&scid=slide")};return(a,e)=>{var f;return i(),n("div",X,[t("div",Y,[t("div",{class:"slidepage-header__logo"},[t("img",{class:"logo",src:P,alt:"logo",width:"127",height:"48",onClick:U})]),t("div",{class:E(["slidepage-header__input-group",{"is-focus":c.value||F(k)}])},[H(m,{class:"inputIcon ic_search",name:"ic_search"}),M(t("input",{class:"search-input","onUpdate:modelValue":e[0]||(e[0]=q=>s.value=q),type:"text",placeholder:"Search",onFocus:I,onBlur:x,onKeyup:z(C,["enter"])},null,544),[[N,s.value]]),s.value?(i(),A(m,{key:0,class:"ic_clear inputIcon",name:"ic_clear",onClick:w})):G("",!0)],2),t("div",$,[d.value?l.value?(i(),n("div",{key:2,class:"slidepage-header__avatar",onClick:j},[t("img",{src:(f=h.value)==null?void 0:f.avatar_url,alt:"avatar",width:"36",height:"36"},null,8,ae)])):(i(),n("div",{key:1,class:"slidepage-header__avatar-login",onClick:S},"Log in")):(i(),n("div",ee))])])])}}}),fe=J(se,[["__scopeId","data-v-cc93b799"]]);export{fe as default};
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.