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([[209,{uid:209,url:'/u/620d04246a045c77626a5f6f2e511913',avatar:'/a/620d04246a045c77626a5f6f2e511913',username:'z327774948🤖',}],[1920,{uid:1920,url:'/u/68076a356a045c766968566f21510970',avatar:'/a/68076a356a045c766968566f21510970',username:'piller🤖',}],[1969,{uid:1969,url:'/u/0b07055f6a045c76696c5f6f1e24342a',avatar:'/a/0b07055f6a045c76696c5f6f1e24342a',username:'云上拾荒者🤖',}],[2934,{uid:2934,url:'/u/0e03473c6a045c756969526f1d3a1d0d',avatar:'/a/0e03473c6a045c756969526f1d3a1d0d',username:'hanbing135🤖',}],[6502,{uid:6502,url:'/u/627a07276a045c71656a546f265f142f',avatar:'/a/627a07276a045c71656a546f265f142f',username:'tool3d🤖',}],[9606,{uid:9606,url:'/u/183c781b6a045c7e666a506f11036616',avatar:'/a/183c781b6a045c7e666a506f11036616',username:'CHEN1016🤖',}],]),} 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