import{r as P,a as f,R as w,b as Q}from"./lib.41388907.js";import{i as O}from"./model.3f9a418f.js";const M=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const d of i.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}};M();if(!{}.VITE_EXT){{window._hmt=window._hmt||[];const e=document.createElement("script");e.src="proxy.php?url=https%3A%2F%2Fhm.baidu.com%2Fhm.js%3F7bd2456d52ffdb252b118e885584a4b1",document.head.appendChild(e)}{const e=document.createElement("script");e.src="proxy.php?url=https%3A%2F%2Fwww.googletagmanager.com%2Fgtag%2Fjs%3Fid%3DG-0TLNF59BDT",e.async=!0,document.head.appendChild(e),window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)},gtag("js",new Date),gtag("config","G-0TLNF59BDT")}}var C={},R=P.exports;C.createRoot=R.createRoot,C.hydrateRoot=R.hydrateRoot;const G=/[\s-_\.]/g;function V(e){!Array.isArray(e.keywords)||!e.keywords.length?e.keywords=[e.name]:e.keywords=e.keywords.concat(e.name).map(t=>t.toLowerCase().replace(G,""))}var _={exports:{}},E={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var B=f.exports,z=Symbol.for("react.element"),K=Symbol.for("react.fragment"),U=Object.prototype.hasOwnProperty,$=B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0};function H(e,t,r){var n,o={},i=null,d=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(d=t.ref);for(n in t)U.call(t,n)&&!J.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:z,type:e,key:i,ref:d,props:o,_owner:$.current}}E.Fragment=K;E.jsx=H;E.jsxs=H;_.exports=E;const s=_.exports.jsx,m=_.exports.jsxs,Y=_.exports.Fragment,S=f.exports.createContext({favoriteApps:[],favoriteAppNames:[],setFavoriteApps:e=>{},toggleFavorite:e=>{},moveLeft:e=>{},moveRight:e=>{},hiddenApps:[],hiddenAppNames:[],setHiddenApps:e=>{},toggleVisible:e=>{},filterKey:"",setFilterKey:e=>{}}),X=({children:e})=>{const[t,r]=f.exports.useState(()=>{let c=[];try{c=JSON.parse(localStorage.getItem("HELLO_NAV_FAVORITE"))||[],c.forEach((a,h)=>{a.favorite=!0,h||(a.first=!0),h===c.length-1&&(a.final=!0)})}catch{}return c}),n=Array.from(t).map(c=>c.name);f.exports.useEffect(()=>{localStorage.setItem("HELLO_NAV_FAVORITE",JSON.stringify(Array.from(t)))},[t]);const o=f.exports.useCallback(c=>{const a=Array.from(t),h=a.findIndex(l=>l.name===c.name);h>=0?a.splice(h,1):a.push({...c,favorite:!0}),a.forEach((l,N)=>{delete l.first,delete l.final,N||(l.first=!0),N===a.length-1&&(l.final=!0)}),r(a)},[t]),i=f.exports.useCallback(c=>{const a=Array.from(t),h=a.findIndex(l=>l.name===c.name);h>0&&(a.splice(h,1),a.splice(h-1,0,{...c}),a.forEach((l,N)=>{delete l.first,delete l.final,N||(l.first=!0),N===a.length-1&&(l.final=!0)}),r(a))},[t]),d=f.exports.useCallback(c=>{const a=Array.from(t),h=a.findIndex(l=>l.name===c.name);h{delete l.first,delete l.final,N||(l.first=!0),N===a.length-1&&(l.final=!0)}),r(a))},[t]),[g,y]=f.exports.useState(()=>{let c=[];try{c=JSON.parse(localStorage.getItem("HELLO_NAV_HIDDEN"))||[],c.forEach(a=>a.hidden=!0)}catch{}return c}),u=Array.from(g).map(c=>c.name);f.exports.useEffect(()=>{localStorage.setItem("HELLO_NAV_HIDDEN",JSON.stringify(Array.from(g)))},[g]);const p=f.exports.useCallback(c=>{const a=Array.from(g),h=a.findIndex(l=>l.name===c.name);h>=0?a.splice(h,1):a.push({...c,hidden:!0}),y(a)},[g]),[v,b]=f.exports.useState(""),A={favoriteApps:t,favoriteAppNames:n,setFavoriteApps:r,toggleFavorite:o,moveLeft:i,moveRight:d,hiddenApps:g,hiddenAppNames:u,setHiddenApps:y,toggleVisible:p,filterKey:v,setFilterKey:b};return s(S.Provider,{value:A,children:e})};function W(){const[e,t]=f.exports.useState(()=>document.documentElement.classList.contains("theme--dark"));return f.exports.useEffect(()=>{const r=new MutationObserver(()=>{t(document.documentElement.classList.contains("theme--dark"))});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e}const x="theme--dark";function Z(e){const t=document.documentElement.classList;e?(t.remove(x),window.localStorage.__THEME__=""):(t.add(x),window.localStorage.__THEME__=x);const r=document.querySelector('meta[name="theme-color"]');r&&r.setAttribute("content",e?"#f6f7f9":"rgba(45, 46, 48, 0.9)")}function ee({onClick:e}){const[t,r]=f.exports.useState(!!window.localStorage.__THEME__),n=["panda-btn",t?"active":""].join(" ");return s("span",{className:n,onClick:i=>{Z(t),r(!t),e&&e(i)},onKeyDown:()=>{}})}var te="/assets/icon-list.88ef5f23.svg",se="/assets/icon-category.5770b82d.svg",ne="/assets/icon-setting.fb9dbf12.svg",re="/assets/icon-setting-active.e4947465.svg",oe="/assets/icon-search.7585b50e.svg",ie="/assets/icon-clear.58ecb29c.svg";function ae({filterKey:e,type:t,toggleType:r,toggleSetting:n,onInput:o,onClear:i,isSettingMode:d}){return m("div",{className:"filter-bar",children:[m("span",{className:"filter-bar__btn",children:[s(ee,{}),s("span",{className:"filter-bar__toggle-btn",onClick:r,onKeyDown:()=>{},children:s(w,{className:"icon",src:t==="list"?te:se})}),s("span",{className:"filter-bar__toggle-btn",onClick:n,onKeyDown:()=>{},children:s(w,{className:"icon setting-icon",src:d?re:ne})})]}),m("span",{className:"filter-bar__input-warp",children:[s("input",{"aria-label":"filterIpt",className:"search-input",type:"text",value:e,onChange:()=>{},onInput:o}),m("div",{className:"input-icon-wrap",children:[s(w,{className:"icon search-icon",src:oe}),s(w,{className:"icon clear-icon",src:ie,onClick:i})]})]})]})}var ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAADcElEQVRYR9WYT04UQRSHf+8EwgGMcAIhcQ/EA8jErYlwAr2BuHYBnEDcmzicQDiBcALxBGLi/pmvUzXpqenqqp6ZhviSySTTPVVfvf+vTCuKu29Ieh6W2QnfN+H71szuV9nClvmzu7+SdChpX9JWYY07SVeSpmZ2OXS/asCgqXeS3ktCa8sI2jyTdF6r2SpAdwfsZAWw9DCAnpjZeemUvYDujvm+SYq+VVpv6HN8dWJmuEGnZAHdHajva9RajgFtHphZDKy59zoBHxAuwmQhFwAfAa4Xcg4wROqPjtTxSxKnjPluqK+l798G13mWPMAXd9sRngISEOS3VHDkaTgAaYbPk4GUf0KKOQPA3dmH/VIhX07ijzNAdyfpEhQLYmZdmibtEEg4N580EskAPI/vkFbmqoq7e+aQBA3JXW3An7mqkAIO1Fz29R7AOzPbngG6+5Gkz9lclGjwAQDZ4tjMLhoNuvtUEvU1J9t9yXQZ4FAEsFpOLs3s0ILj/+55Eefeqq2dtbBhX3w3jeT2EpsA9po3ZPnGYdctfYEZ9joGkO6CZqBL6OfGqsPNfu6OFnP59RxAtLOXAfxoZqST0cTdyamnmQ2uAcT/cv3dLB+NRVgw8z2AuWQJ02MD6r8HfGwfbDTYFyRfzIw0NJoUskgTJH2As5o4FqG7Z3sASQ1gXx4cNVAqEnWTB3N9WVTajZntjqFBd6e9o83LyaSmFvPnCzM7Xieku9M9lfx7M3YzF5LeFgDwVVqg7IhYc4DQxQDXpzmWagI0AqbdNAM1QG8kvU425jC0Z9e1HU7oXCinuFNJa3G7pki0O+p20aY1j3PBC0mfMtpZGHLa7wUwDjp02OLwjYZLMwnBQZ3m5F0dD3csFPusuDvNxoca87feWZxJeNiRctDQQfgjG6V+yojYeSMQNwtzNqNsrcwdumtaS01C9GJyQJ5Keinpr6SvtQFTaEja4MzL+9m5OGiRBhXIOPc21xKtsRJzX9XChTX7OqYIyGixk67bdzeTQlJxGGQak7r7npld19itQoPAobkFdyndbpFOskNN7bxcAORa5XDQ7VbLwYlgIDtHgjUAYgHgsvfYtTesJFdMPHcfswIgJj3ivqfkIlWAwefQJqDkvcbsSwBiTg5Kba+6/a8GTCoEkXwfL3hKWght1UaNxtK1/gE+7pItQxlIvQAAAABJRU5ErkJggg==";function le(e){try{gtag("event",`click-link_${e.name.replace(/ /g,"-")}`,{value:e.name.replace(/ /g,"-")})}catch{}}function de(e,t){e.preventDefault(),e.stopPropagation();try{gtag("event",`click-repo-link_${t.name.replace(/ /g,"-")}`,{value:t.name.replace(/ /g,"-")})}catch{}return window.open(t.repository),!1}const fe=/^[\u4e00-\u9fff]+$/,me={normal:[0,4],small:[5,5],tiny:[6,6],mini:[7,7],micro:[8,1/0]},ue={normal:[0,10],small:[11,11],tiny:[12,12],mini:[13,13],micro:[14,1/0]},pe=e=>{const t=e.length,r=fe.test(e)?me:ue;for(const[n,[o,i]]of Object.entries(r))if(t>=o&&t<=i)return n;return"normal"},he=e=>{const{name:t,icon:r,iconDark:n,homepage:o,repository:i,darkInvert:d,lessRadius:g,title:y}=e,{favoriteAppNames:u,hiddenAppNames:p,filterKey:v,moveLeft:b,moveRight:A,toggleFavorite:c,toggleVisible:a}=f.exports.useContext(S),h=[d?"dark-invert":"",g?"less-radius":""].join(" "),l=pe(t),T=W()&&n?n:r,I=(!y||y!=="favorites")&&!e.favorite&&u.includes(e.name),L=p.includes(e.name);return L&&e.isSettingMode,I?null:m("li",{className:`cell ${L?"hide":""} ${e.favorite?"favorite":""}`,children:[m("a",{className:"app",href:o,title:t,onClick:()=>le(e),children:[s("div",{className:"img-box",children:s("img",{src:T,className:h,alt:t})}),s("p",{className:"title","data-size":l,children:t}),i&&s("div",{onKeyDown:()=>{},onClick:q=>de(q,e),className:"corner",children:s("div",{className:"corner-icon-wrap",children:s("img",{className:"corner-icon",draggable:!1,src:ce,alt:""})})})]}),m("div",{className:"app-back",children:[m("div",{className:"app-setting-head",children:[s("img",{src:T,className:h,alt:t}),s("p",{className:"title","data-size":l,title:t,children:t})]}),m("div",{className:"app-setting-content",children:[e.favorite&&!v&&s("div",{className:`icon icon-left ${e.first?"disabled":""}`,onClick:()=>b(e)}),s("div",{className:`icon ${e.favorite?"icon-favorite-active":"icon-favorite"}`,onClick:()=>c(e)}),e.favorite&&!v&&s("div",{className:`icon icon-right ${e.final?"disabled":""}`,onClick:()=>A(e)})]})]})]})};const F=(e,t,r)=>s("ul",{className:"app-list",children:e.map(n=>f.exports.createElement(he,{...n,title:t==null?void 0:t.title,isSettingMode:r,key:n.name+(n.favorite?"_fav":"")+(n.hidden?"_hid":"")}))});function ge({list:e,type:t,isSettingMode:r}){let n;t==="list"?n=F(e,null,r):n=e.reduce((i,d)=>{const{children:g}=d;if(g.length){const y=d.title.replace(/\//g,"");i.push(m("div",{className:"category-item",children:[s("h2",{className:"category-item__title",id:y,children:s("a",{href:"#"+y,className:"category-item__title-link",children:d.title.toUpperCase()})}),F(g,d,r)]},d.title))}return i},[]);const o=["contain-wrap",t,r?"reverse":""].join(" ");return s("div",{className:o,children:n})}function ve(e,t){return({isError:r,filterKey:n,resultAppCount:o,...i})=>r?s("div",{className:"err-message",children:s(t,{filterKey:n})}):m(Y,{children:[s(e,{...i}),n&&m("div",{className:"result-tips",children:["Total ",o," found"]})]})}var Ae="/assets/github.63e682fb.svg";const ye=({filterKey:e})=>m(Y,{children:["Oops! Couldn't find it here...",m("div",{className:"error-tips",children:["Try searching on"," ",m("a",{href:`https://github.com/search?q=${encodeURIComponent(e)}`,target:"_blank",children:[s(w,{className:"icon",width:18,height:18,src:Ae})," GitHub"]})," ","or"," ",s("a",{href:`https://github.com/hello-nav/hello-nav/issues/new?assignees=Heroor&labels=request&projects=&template=request-app.md&title=Request ${encodeURIComponent(e)}`,target:"_blank",children:"Request App"}),"."]})]});var be="/assets/icon-favorite-active.ced99610.svg",Ne="/assets/icon-framework.acd1cb73.svg",we="/assets/icon-library.5fe28b57.svg",_e="/assets/icon-html-css.78469209.svg",Ee="/assets/icon-design.e1566b2a.svg",xe="/assets/icon-server.ed5679c8.svg",ke="/assets/icon-other.e71751c8.svg",Ce="/assets/icon-website.4fd0d9a5.svg",Se="/assets/icon-ai.145b8f44.svg",Te="/assets/icon-top.dcacb24f.svg";const Le={favorites:be,framework:Ne,library:we,"html/css":_e,"ui/design":Ee,"runtime/server":xe,other:ke,website:Ce,"ai/agent":Se},Oe=({list:e,type:t,hasFavorite:r})=>{const[n,o]=f.exports.useState(null),[i,d]=f.exports.useState(null);f.exports.useEffect(()=>{const u=document.querySelectorAll("h2[id]"),p=()=>{const v=window.scrollY+240;d(v>=1e3);let b=null;for(let A=0;A=c.offsetTop&&(b=c.id)}o(b)};return p(),window.addEventListener("scroll",p),()=>window.removeEventListener("scroll",p)},[r,t,e]),r||(e=e.filter(u=>u.title!=="favorites"));function g(u,p){u.preventDefault();const v=document.getElementById(p);return v&&window.scrollTo({top:v.offsetTop-180,behavior:"smooth"}),!1}function y(u){return u.preventDefault(),window.scrollTo({top:0,behavior:"smooth"}),!1}return t==="category"?m("div",{className:"sidebar",children:[s("div",{className:"navbar",children:e.filter(u=>u.children.length).map(u=>{const{title:p}=u,v=p.replace(/\//g,"");return m("a",{href:"#"+v,title:p.toUpperCase(),className:n===v?"active":"",draggable:!1,onClick:b=>g(b,v),children:[s("div",{children:s(w,{className:"icon",src:Le[p]})}),s("div",{className:"sidebar__title",children:p.toUpperCase()})]},p)})}),s("a",{href:"#root",title:"Go Top",draggable:!1,className:`go-top ${i?"show":""}`,onClick:u=>y(u),children:s(w,{className:"icon",src:Te})})]}):null};const Re=()=>m("div",{className:"footer__wrap",children:[s("a",{href:"https://github.com/hello-nav/hello-nav",className:"logo vertical-center",children:"hello-nav github"}),m("div",{className:"footer__copyright",children:[m("span",{className:"vertical-center",children:["Made by",s("a",{className:"bener-link",href:"https://github.com/Heroor",children:s("b",{children:" Bener "})}),"with",s("span",{className:"heart",children:" \u2764"})]}),m("p",{children:["\xA92018-",new Date().getFullYear()," Hello Nav."]})]})]}),k=["category","list"],Fe=ve(ge,ye),D={category:O,list:O.reduce((e,t)=>(t.children.forEach(V),e.push(...t.children),e),[])},j=(e,t)=>e.filter(r=>r.keywords.some(n=>n.includes(t))),De=(e,t,r)=>t==="list"?j(e,r):e.map(n=>({title:n.title,children:j(n.children,r)}));function je(){const{__CATEGORY_TYPE__:e}=window.localStorage,[t,r]=f.exports.useState(e||k[0]);e||(window.localStorage.__CATEGORY_TYPE__=t);const[n,o]=f.exports.useState(!1),{favoriteApps:i,filterKey:d,setFilterKey:g}=f.exports.useContext(S),y=d.trim().toLowerCase().replace(G,""),u=t==="category"?[{title:"favorites",children:i},...D[t]]:[...i,...D[t]];let p=De(u,t,y);f.exports.useEffect(()=>{window.localStorage.__CATEGORY_TYPE__=t},[t]);function v(){const A=k.indexOf(t);r(k[(A+1)%2])}const b=t==="list"?p.length:p.reduce((A,c)=>A+c.children.length,0);return m("div",{className:"body",children:[s(ae,{filterKey:d,onInput:A=>g(A.target.value),onClear:()=>g(""),type:t,isSettingMode:n,toggleType:v,toggleSetting:()=>o(!n)}),s("div",{className:"main",children:s(Fe,{list:p,type:t,filterKey:d,isSettingMode:n,resultAppCount:b,isError:!b})}),b?s(Oe,{list:p,type:t,hasFavorite:!!i.length}):null,s(Re,{})]})}C.createRoot(document.getElementById("root")).render(s(Q.StrictMode,{children:s(X,{children:s(je,{})})}));