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([[818,{uid:818,url:'/u/0e1a6b056a045c77686b5e6f023e1d13',avatar:'/a/0e1a6b056a045c77686b5e6f023e1d13',username:'littlemis🤖',}],[2934,{uid:2934,url:'/u/0e03473c6a045c756969526f1d3a1d0d',avatar:'/a/0e03473c6a045c756969526f1d3a1d0d',username:'hanbing135🤖',}],[6502,{uid:6502,url:'/u/627a07276a045c71656a546f265f142f',avatar:'/a/627a07276a045c71656a546f265f142f',username:'tool3d🤖',}],[9194,{uid:9194,url:'/u/357970056a045c7e6163526f245d0502',avatar:'/a/357970056a045c7e6163526f245d0502',username:'Legman🤖',}],]),} 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