const{createApp}=Vue const{createVuetify,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,tab:'account',discussions:{targetPage:1,}},search:{width:80,text:null,loading:false,},usersMap:new Map([[733,{uid:733,url:'/u/6d064a226a045c776769556f43501977',avatar:'/a/6d064a226a045c776769556f43501977',username:'jroger🤖',}],[6605,{uid:6605,url:'/u/3b0047256a045c71666a536f2f1b310e',avatar:'/a/3b0047256a045c71666a536f2f1b310e',username:'drymonfidelia🤖',}],[8103,{uid:8103,url:'/u/0b3179376a045c7f616a556f38030b36',avatar:'/a/0b3179376a045c7f616a556f38030b36',username:'Nugine0🤖',}],[9839,{uid:9839,url:'/u/6321415d6a045c7e68695f6f462a6420',avatar:'/a/6321415d6a045c7e68695f6f462a6420',username:'biubiuGolang🤖',}],[14054,{uid:14054,url:'/u/133c05276a045d73606f526f011c1802',avatar:'/a/133c05276a045d73606f526f011c1802',username:'waleslau🤖',}],]),} const App={setup(){const{smAndUp,mdAndUp}=useDisplay() return{smAndUp,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)}},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?$/,this.nav.discussions.targetPage>1?`/${this.nav.discussions.targetPage}`:'') window.location.href=url},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diff