PageSourceSearch

https://www.woabc.com/assets/MainSearch-91971898.js

js woabc.com collected 2026-10-08 17:37:33 UTC 11,748 bytes, 1 lines download raw bytes

1import{aD as j,aE as oe,aF as B,aG as Y,b as $,w as K,aH as Le,aI as M,aJ as ve,aK as Ee,a as Ie,aL as Re,d as Oe,j as qe,k as Me,an as je,o as p,c as h,X as N,s as x,g as _,x as z,aM as se,F as P,B as T,Z as le,aN as We,az as U,a6 as V,ab as ae,v as E,aO as re,t as O,h as Ae,ae as ce,_ as De}from"./index-a66496de.js";import{g as ue}from"./favicon-0f3d6c48.js";import{u as Ne}from"./icon_style-aa70d698.js";function W(t){return Object.keys(t).map(o=>`${encodeURIComponent(o)}=${encodeURIComponent(t[o])}`).join("&")}function ze(t){return`https://www.baidu.com/s?wd=${encodeURIComponent(t)}`}function Ue(t,n){const o=W({prod:"wise",wd:t});j(`https://www.baidu.com/sugrec?${o}`).then(e=>e.json()).then(e=>{n({eng:"baidu",wd:e.q,list:e.g?e.g.map(l=>l.q):[]})}).catch(e=>console.error(e))}const Be={target:ze,complete:Ue};function Fe(t){return`https://www.google.com/search?q=${encodeURIComponent(t)}`}function Ke(t,n){const o=W({client:"psy-ab",hl:"zh-CN",q:t});j(`https://suggestqueries.google.com/complete/search?${o}`).then(e=>e.json()).then(e=>{n({eng:"google",wd:e[0],list:e[1].map(l=>l[0])})}).catch(e=>console.error(e))}const Pe={target:Fe,complete:Ke};function Te(t){return`https://www.bing.com/search?mkt=zh-cn&q=${encodeURIComponent(t)}`}function Ve(t,n){const o=W({type:"cb",q:t});j(`https://api.bing.com/qsonhs.aspx?${o}`,{jsonpCallback:"cb"}).then(e=>e.json()).then(e=>{const l=e.AS.Results;let c;l?c=l.map(d=>d.Suggests).reduce((d,a)=>d.concat(a),[]).sort((d,a)=>d.Sk>a.Sk?1:-1).map(d=>d.Txt):c=[],n({eng:"bing",wd:e.AS.Query,list:c})}).catch(e=>console.error(e))}const He={target:Te,complete:Ve};function Ge(t){return`https://zh.wikipedia.org/w/index.php?search=${encodeURIComponent(t)}`}function Xe(t,n){const o=W({action:"opensearch",format:"json",formatversion:2,limit:10,search:t});j(`https://zh.wikipedia.org/w/api.php?${o}`).then(e=>e.json()).then(e=>{n({eng:"wikipedia",wd:e[0],list:e[1]})}).catch(e=>console.error(e))}const Ye={target:Ge,complete:Xe};function Je(t){return`https://www.sogou.com/web?query=${encodeURIComponent(t)}`}function Qe(t,n){const o=`https://wap.sogou.com/web/sugg/${encodeURIComponent(t)}`,e=W({vr:1,s:1,source:"wapsearch",encrypt:0,cb:"sug"});window.sug=l=>{n({eng:"sogou",wd:l.q,list:l.s?l.s.map(c=>c.q):[]})},j(`${o}?${e}`,{jsonpCallback:"sug"}).catch(l=>l)}const Ze={target:Je,complete:Qe},pe={Baidu:Be,Google:Pe,Bing:He,Wikipedia:Ye,Sogou:Ze};function et(t,n){return pe[t].target(n)}function tt(t,n,o){return pe[t].complete(n,o)}const H={target:et,complete:tt};function q(t){var n;const o=M(t);return(n=o==null?void 0:o.$el)!=null?n:o}const he=Re?window:void 0;function F(...t){let n,o,e,l;if(typeof t[0]=="string"||Array.isArray(t[0])?([o,e,l]=t,n=he):[n,o,e,l]=t,!n)return B;Array.isArray(o)||(o=[o]),Array.isArray(e)||(e=[e]);const c=[],d=()=>{c.forEach(b=>b()),c.length=0},a=(b,L,u,v)=>(b.addEventListener(L,u,v),()=>b.removeEventListener(L,u,v)),y=K(()=>[q(n),M(l)],([b,L])=>{if(d(),!b)return;const u=Le(L)?{...L}:L;c.push(...o.flatMap(v=>e.map(g=>a(b,v,g,u))))},{immediate:!0,flush:"post"}),k=()=>{y(),d()};return ve(k),k}let ie=!1;function fe(t,n,o={}){const{window:e=he,ignore:l=[],capture:c=!0,detectIframe:d=!1}=o;if(!e)return B;Y&&!ie&&(ie=!0,Array.from(e.document.body.children).forEach(u=>u.addEventListener("click",B)),e.document.documentElement.addEventListener("click",B));let a=!0;const y=u=>l.some(v=>{if(typeof v=="string")return Array.from(e.document.querySelectorAll(v)).some(g=>g===u.target||u.composedPath().includes(g));{const g=q(v);return g&&(u.target===g||u.composedPath().includes(g))}}),b=[F(e,"click",u=>{const v=q(t);if(!(!v||v===u.target||u.composedPath().includes(v))){if(u.detail===0&&(a=!y(u)),!a){a=!0;return}n(u)}},{passive:!0,capture:c}),F(e,"pointerdown",u=>{const v=q(t);a=!y(u)&&!!(v&&!u.composedPath().includes(v))},{passive:!0}),d&&F(e,"blur",u=>{setTimeout(()=>{var v;const g=q(t);((v=e.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(g!=null&&g.contains(e.document.activeElement))&&n(u)},0)})].filter(Boolean);return()=>b.forEach(u=>u())}const de={[oe.mounted](t,n){const o=!n.modifiers.bubble;if(typeof n.value=="function")t.__onClickOutside_stop=fe(t,n.value,{capture:o});else{const[e,l]=n.value;t.__onClickOutside_stop=fe(t,e,Object.assign({capture:o},l))}},[oe.unmounted](t){t.__onClickOutside_stop()}};function G(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function me(t){const n=window.getComputedStyle(t);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&t.clientWidth<t.scrollWidth||n.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const o=t.parentNode;return!o||o.tagName==="BODY"?!1:me(o)}}function nt(t){const n=t||window.event,o=n.target;return me(o)?!1:n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}const X=new WeakMap;function ot(t,n=!1){const o=$(n);let e=null,l="";K(Ee(t),a=>{const y=G(M(a));if(y){const k=y;if(X.get(k)||X.set(k,k.style.overflow),k.style.overflow!=="hidden"&&(l=k.style.overflow),k.style.overflow==="hidden")return o.value=!0;if(o.value)return k.style.overflow="hidden"}},{immediate:!0});const c=()=>{const a=G(M(t));!a||o.value||(Y&&(e=F(a,"touchmove",y=>{nt(y)},{passive:!1})),a.style.overflow="hidden",o.value=!0)},d=()=>{const a=G(M(t));!a||!o.value||(Y&&(e==null||e()),a.style.overflow=l,X.delete(a),o.value=!1)};return ve(d),Ie({get(){return o.value},set(a){a?c():d()}})}function st(){let t=!1;const n=$(!1);return(o,e)=>{if(n.value=e.value,t)return;t=!0;const l=ot(o,e.value);K(n,c=>l.value=c)}}st();const lt={class:"search-bar-container relative mx-auto w-full flex h-44 sm:w-[700px]"},at={class:"search-engine-logo-container relative flex-center shrink-0 w-44"},rt=["src"],ct={bg:"$main-bg-c",class:"search-dropdown absolute z-9 border-2 l-0 t-0 t-100p w-200"},ut=["onClick"],it={class:"$text-c-1 flex-center gap-x-8 text-15"},ft=["src"],dt={key:0,class:"i-carbon:checkmark text-18"},vt={class:"w-full flex items-center"},pt=["placeholder","onKeydown"],ht={bg:"$main-bg-c",class:"search-dropdown z-9 py-6 border-2 l-0 t-0 t-100p"},mt=["onMouseover","onClick"],gt={class:"flex-left gap-x-8",style:{margin:"0.75rem","margin-left":"2rem"}},wt=["onMouseover","onClick"],yt={class:"flex-left flex-col gap-y-2",style:{margin:"0.75rem","margin-left":"2rem"}},kt={class:"flex items-center"},_t=["src"],xt={class:"text-15 font-medium"},bt={key:0,class:"text-13 text-gray-500 dark:text-gray-400"},St={key:0,class:"line-clamp-2 text-13 text-gray-500 dark:text-gray-400"},$t=Oe({__name:"MainSearch",setup(t){const n=qe(),o=Me(),e=je.children,l=$(""),c=$(0),d=$();K(()=>n.settings.search,s=>{const r=e.findIndex(m=>m.key===s);r!==-1&&(c.value=r)},{immediate:!0});const a=$([]),y=$(!1),k=re(s=>{b(s)},100);function b(s){if(!s.trim()){R();return}const r=[];for(const m of o.data)if(m.groupList){for(const i of m.groupList)if(i.siteList)for(const f of i.siteList){const C=f.name||"",ne=f.desc||"",Ce=f.url||"";(C.includes(s)||ne.includes(s)||Ce.includes(s))&&f.name&&r.push({name:f.name,desc:f.desc,url:f.url||"#",favicon:f.favicon,
1category:`${U(m.name)}-${U(i.name)}`})}}r.sort((m,i)=>m.name.localeCompare(i.name,"zh-CN")),a.value=r.slice(0,10),y.value=r.length>0,r.length===0&&$message.info(ce("messages.noResultsPre")+s+ce("messages.noResultsPost"))}function L(s){const r=s.target;r.src="/default-favicon.png"}function u(s){var m;const r=a.value[s];r!=null&&r.url&&r.url!=="#"&&(window.open(r.url,"_blank"),R(),(m=d.value)==null||m.blur())}function v(){var m;if(!l.value.trim())return;const s=e[c.value].value,r=`${s.url}?${s.wd}=${encodeURIComponent(l.value)}`;window.open(r,"_blank"),I(),(m=d.value)==null||m.blur()}function g(){e[c.value].key==="Local"?k(l.value):v()}function J(s){var r;return(r=s.favicon)!=null&&r.startsWith("i-")?null:s.favicon||ue(s.url)}const A=$(!1);function Q(){A.value=!A.value}function ge(s){c.value=s,n.setSettings({search:e[s].key}),Q()}const D=$(!1),S=$([]),w=$(-1),we=re(()=>{const s=e[c.value];H.complete&&typeof H.complete=="function"&&H.complete(s.key,l.value,r=>{D.value=!0,S.value=r.list})},10);function Z(){if(!l.value.trim()){I(),R();return}if(e[c.value].key==="Local"){I(),k(l.value);return}w.value=-1,we()}function ye(s){l.value=S.value[s],g()}function I(){D.value=!1,S.value=[],w.value=-1}function R(){y.value=!1,a.value=[],w.value=-1}function ke(s){s.preventDefault(),e[c.value].key==="Local"&&a.value.length>0?w.value=(w.value+1)%a.value.length:S.value.length>0&&(w.value=(w.value+1)%S.value.length)}function _e(s){s.preventDefault(),e[c.value].key==="Local"&&a.value.length>0?w.value=(w.value-1+a.value.length)%a.value.length:S.value.length>0&&(w.value=(w.value-1+S.value.length)%S.value.length)}function xe(){var s;l.value="",R(),I(),(s=d.value)==null||s.focus()}function be(s){s.target!==d.value&&(R(),I())}function ee(s){w.value=s}function Se(){w.value=-1}function $e(){l.value.trim()&&Z()}const{iconStyle:te}=Ne();return(s,r)=>{var m;return p(),h("div",lt,[N((p(),h("div",at,[_("div",{hover:"op-100",class:"h-full w-full flex-center cursor-pointer op-80 transition-300",onClick:Q},[(m=x(e)[c.value].value.favicon)!=null&&m.startsWith("i-")?(p(),h("div",{key:0,class:z([x(e)[c.value].value.favicon,"text-24"])},null,2)):(p(),h("img",{key:1,src:J(x(e)[c.value].value),style:se(x(te)),class:"h-32 w-32"},null,12,rt))]),N(_("div",ct,[(p(!0),h(P,null,T(x(e),(i,f)=>{var C;return p(),h("div",{key:f,hover:"bg-$site-hover-c",class:"flex cursor-pointer items-center justify-between px-12 py-7",onClick:ne=>ge(f)},[_("div",it,[(C=i.value.favicon)!=null&&C.startsWith("i-")?(p(),h("div",{key:0,class:z([i.value.favicon,"text-20"])},null,2)):(p(),h("img",{key:1,src:J(i.value),style:se(x(te)),class:"circle h-20 w-20"},null,12,ft)),_("div",null,O(x(U)(i.name)),1)]),c.value===f?(p(),h("div",dt)):E("",!0)],8,ut)}),128))],512),[[le,A.value]])])),[[x(de),()=>A.value=!1]]),_("div",vt,[N(_("input",{ref_key:"searchInputRef",ref:d,"onUpdate:modelValue":r[0]||(r[0]=i=>l.value=i),autofocus:"",class:"$text-c-1 search-input h-full w-full bg-inherit px-2 op-80",placeholder:x(U)(x(e)[c.value].name),onKeydown:[V(g,["enter"]),V(ae(ke,["exact"]),["down"]),V(ae(_e,["exact"]),["up"])],onInput:Z,onFocus:$e},null,40,pt),[[We,l.value]]),l.value.length>0?(p(),h("div",{key:0,hover:"op-80",class:"i-carbon:close mr-8 cursor-pointer text-20 op-40 transition duration-300",onClick:xe})):E("",!0)]),_("button",{class:"search-button flex-center shrink-0 gap-x-4 px-16 btn",onClick:g},[...r[2]||(r[2]=[_("span",{class:"i-carbon:search inline-block text-16"},null,-1)])]),N((p(),h("div",{class:"absolute z-9 h-auto max-h-[600px] w-full t-100p overflow-y-auto",onMouseleave:Se},[_("div",ht,[D.value&&S.value.length>0?(p(!0),h(P,{key:0},T(S.value,(i,f)=>(p(),h("div",{key:f,class:z(["cursor-pointer text-15 p-5",{"bg-$site-hover-c":f===w.value}]),onMouseover:C=>ee(f),onClick:C=>ye(f)},[_("div",gt,[_("div",null,O(i),1)])],42,mt))),128)):E("",!0),y.value&&a.value.length>0?(p(!0),h(P,{key:1},T(a.value,(i,f)=>(p(),h("div",{key:`${i.url}-${i.name}-${f}`,class:z(["search-result-card cursor-pointer p-5",{"bg-$site-hover-c":f===w.value}]),onMouseover:C=>ee(f),onClick:C=>u(f)},[_("div",yt,[_("div",kt,[i.url&&i.url!=="#"?(p(),h("img",{key:0,src:i.favicon||x(ue)(i.url),style:{width:"24px",height:"24px","margin-right":"12px","border-radius":"2px"},loading:"lazy",onError:r[1]||(r[1]=C=>L(C))},null,40,_t)):E("",!0),_("div",xt,[Ae(O(i.name),1),i.category?(p(),h("span",bt," ["+O(i.category)+"]",1)):E("",!0)])]),i.desc?(p(),h("div",St,O(i.desc),1)):E("",!0)])],42,wt))),128)):E("",!0)])],32)),[[le,D.value&&S.value.length>0||y.value&&a.value.length>0],[x(de),be]])])}}});const It=De($t,[["__scopeId","data-v-fc552d0a"]]);export{It 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.