;(function(){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e2){throw _e2;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e3){didErr=true;err=_e3;},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return();}finally{if(didErr)throw err;}}};}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i-1,presto:u.indexOf("Presto")>-1,webKit:u.indexOf("AppleWebKit")>-1,gecko:u.indexOf("Gecko")>-1&&u.indexOf("KHTML")==-1,mobile:!!u.match(/AppleWebKit.*Mobile.*/),ios:!!u.match(/Mac OS X/),android:u.indexOf("DAYAAPPA")>-1||u.indexOf("Adr")>-1,iPhone:u.indexOf("DAYAAPPI")>-1,isApp:u.indexOf("DAYAAPPI")>-1||u.indexOf("DAYAAPPA")>-1||u.indexOf("Adr")>-1,iPad:u.indexOf("iPad")>-1,webApp:u.indexOf("Safari")==-1,weixin:u.indexOf("MicroMessenger")>-1,huawei:!!u.match(/huawei/i)||!!u.match(/honor/i),xiaomi:!!u.match(/mi\s/i)||!!u.match(/redmi/i)||!!u.match(/mix/i)};});var getRandomKey=function getRandomKey(){var key=""+new Date().getTime()+Math.floor(Math.random()*1e6);return key;};var removeAuth=exports('a',function(){sessionStorage.removeItem("Authorization");});var _setAuth=exports('b',function(token){sessionStorage.setItem("Authorization",token);});var getWeekCh=exports('g',function(week){var type=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var template=["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"];var template2=["\u661F\u671F\u5929","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"];return type?template2[week]:template[week];});var formatterDate=exports('f',function(type,val){if(type==="year"){return"".concat(val,"\u5E74");}if(type==="month"){return"".concat(val,"\u6708");}if(type==="day"){return"".concat(val,"\u65E5");}return val;});var originalPostMessage=window.postMessage;window.postMessage=function(message){originalPostMessage(message,"*");};var loop=function loop(){};var calls={};var browserInfo=browser();if(browserInfo.isApp){window.addEventListener("message",function(evt){try{var _data$content,_data$content2,_data$content3;var data=evt.data?_typeof(evt.data)==="object"?evt.data:JSON.parse(evt.data):{};var uuid=((_data$content=data.content)===null||_data$content===void 0?void 0:_data$content.uuid)||data.uuid;try{if(data.content){data.content=JSON.parse(data.content);}}catch(error){}if(data!==null&&data!==void 0&&(_data$content2=data.content)!==null&&_data$content2!==void 0&&_data$content2.uuid){console.log("data",data);}if(!uuid){var keys=Object.keys(calls).filter(function(key){return key.indexOf(data.api)===0;});var _iterator5=_createForOfIteratorHelper(keys),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var key=_step5.value;var callback2=calls[key]||loop;typeof callback2==="function"&&callback2(data);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}return;}var callId=((_data$content3=data.content)===null||_data$content3===void 0?void 0:_data$content3.uuid)||data.uuid||data.api+data.uuid;var callback=calls[callId]||loop;typeof callback==="function"&&callback(data);}catch(error){console.error("\u901A\u4FE1\u6D88\u606F\u89E3\u6790\u9519\u8BEF",error);}});}var instance=window.DAYA||((_window$webkit=window.webkit)===null||_window$webkit===void 0?void 0:(_window$webkit$messag=_window$webkit.messageHandlers)===null||_window$webkit$messag===void 0?void 0:_window$webkit$messag.DAYA);var postMessage=exports('p',function(data,callback){if(browserInfo.isApp){var uuid=getRandomKey();calls[uuid]=callback||loop;data.content=data.content?_objectSpread(_objectSpread({},data.content),{},{uuid:uuid}):{uuid:uuid};instance.postMessage(JSON.stringify(data));console.log("send:",JSON.stringify(data));}});var request=exports('r',extend({timeout:2e4,timeoutMessage:"\u8BF7\u6C42\u8D85\u65F6"}));var initRequest=false;request.interceptors.request.use(function(url,options){Toast.loading({message:"\u52A0\u8F7D\u4E2D...",forbidClick:true,loadingType:"spinner",duration:0});initRequest=options.initRequest||false;var Authorization=sessionStorage.getItem("Authorization")||"";var authHeaders={};if(Authorization&&!["/api-auth/usernameLogin","/api-auth/smsLogin","/api-auth/code/sendSms"].includes(url)){authHeaders.Authorization=Authorization;}return{url:url,options:_objectSpread(_objectSpread({},options),{},{params:src(options.params),headers:_objectSpread(_objectSpread({},options.headers),authHeaders)})};},{global:false});request.interceptors.response.use(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(res){var msg,data,_msg,_browserInfo;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:Toast.clear();if(!(res.status>299||res.status<200)){_context.next=5;break;}msg="\u670D\u52A1\u5668\u9519\u8BEF\uFF0C\u72B6\u6001\u7801"+res.status;Toast(msg);throw new Error(msg);case 5:_context.next=7;return res.clone().json();case 7:data=_context.sent;if(!(data.code!==200&&data.errCode!==0)){_context.next=15;break;}_msg=data.msg||"\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5";if(initRequest){if(data.code===403||data.code===401){setLogout();}else{setLoginError();}}if(!(data.code===403||data.code===401)){Toast(_msg);}_browserInfo=browser();if(data.code===403){if(_browserInfo.isApp){postMessage({api:"login"});}else{setLogout();}}throw new Error(_msg);case 15:return _context.abrupt("return",res);case 16:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}(),{global:false});var Auth=defineComponent({name:'Auth',data:function data(){return{loading:false};},computed:{isNeedView:function isNeedView(){return state.user.status==='login'||this.$route.path==='/login';}},mounted:function mounted(){this.setAuth();// state.user.status = 'error' },methods:{setAuth:function setAuth(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var query,token,res,route,_query;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:query=_this.$route.query;token=query.userInfo||query.Authorization;if(token){_setAuth(token);}if(!_this.loading){_context2.next=5;break;}return _context2.abrupt("return");case 5:if(!(state.user.status==='init'||state.user.status==='error')){_context2.next=17;break;}_this.loading=true;_context2.prev=7;_context2.next=10;return request.get('/api-teacher/teacher/queryUserInfo',{requestType:'form',initRequest:true// 初始化接口 });case 10:res=_context2.sent;// console.log(res) setLogin(res.data);_context2.next=16;break;case 14:_context2.prev=14;_context2.t0=_context2["catch"](7);case 16:_this.loading=false;case 17:if(state.user.status==='logout'){if(browser().isApp){postMessage({api:'login'});}else{try{route=_this.$route;_query=_objectSpread({returnUrl:_this.$route.path},_this.$route.query);if(route.meta.isRegister){_query.isRegister=route.meta.isRegister;}_this.$router.replace({path:'/login',query:_query});}catch(error){}}}case 18:case"end":return _context2.stop();}}},_callee2,null,[[7,14]]);}))();}},render:function render(){return createVNode(Fragment,null,[state.user.status==='error'?createVNode("div",{"class":styles.error},[createVNode("div",{"class":styles.info},[createVNode(Icon,{"name":"clear","size":"36","color":"#ee0a24"},null),createVNode("span",null,[createTextVNode("\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5")])]),createVNode(Button,{"type":"primary","round":true,"onClick":this.setAuth},{default:function _default(){return[createTextVNode("\u91CD\u65B0\u52A0\u8F7D")];}})]):this.isNeedView?createVNode(RouterView,null,null):null]);}});var router$1=[{path:"/orderDetail",name:"orderDetail",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.091009e6.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u8BA2\u5355\u8BE6\u60C5"}},{path:"/tradeDetail",name:"tradeDetail",component:function component(){return __vitePreload(function(){return module.import('./trade-detail-legacy.708cc8b1.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u4EA4\u6613\u8BE6\u60C5"}}];var rootRouter=[{path:"/registerProtocol",name:"registerProtocol",component:function component(){return __vitePreload(function(){return module.import('./register-legacy.a97212c1.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u6CE8\u518C\u534F\u8BAE"}},{path:"/privacyProtocol",name:"privacyProtocol",component:function component(){return __vitePreload(function(){return module.import('./privacy-legacy.43f0f89d.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u9177\u4E50\u79C0\u9690\u79C1\u653F\u7B56"}}];var routes=[{path:"/",component:Auth,children:[].concat(router$1,[{path:"/login",name:"login",component:function component(){return __vitePreload(function(){return module.import('./login-legacy.3237a5d4.js');},false?"__VITE_PRELOAD__":void 0);},meta:{isRegister:false}},{path:"/home",name:"home",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.dffaccb5.js');},false?"__VITE_PRELOAD__":void 0);}},{path:"/teacherCert",name:"teacherCert",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.1ae3dcea.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u8001\u5E08\u8BA4\u8BC1"}},{path:"/music-upload",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.3e271b45.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u4E0A\u4F20\u66F2\u8C31"}},{path:"/music-list",component:function component(){return __vitePreload(function(){return module.import('./switch-legacy.e014e3a6.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u66F2\u8C31\u5217\u8868"}},{path:"/openLive",name:"openLive",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.10e2bb61.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u5F00\u901A\u76F4\u64AD"}},{path:"/liveDetail",name:"liveDetail",component:function component(){return __vitePreload(function(){return module.import('./live-detail-legacy.e0418330.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u76F4\u64AD\u8BFE\u8BE6\u60C5"}},{path:"/musicCert",name:"musicCert",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.e1d33adc.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u97F3\u4E50\u4EBA\u8BA4\u8BC1"}},{path:"/videoCreate",name:"videoCreate",component:function component(){return __vitePreload(function(){return module.import('./create-legacy.287c4eb9.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u521B\u5EFA\u89C6\u9891\u8BFE"}},{path:"/videoDetail",name:"videoDetail",component:function component(){return __vitePreload(function(){return module.import('./video-detail-legacy.2f943221.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u89C6\u9891\u8BFE\u8BE6\u60C5"}},{path:"/videoClassDetail",name:"videoClassDetail",component:function component(){return __vitePreload(function(){return module.import('./video-class-detail-legacy.cbb9a3d9.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u89C6\u9891\u8BFE\u8BE6\u60C5"}},{path:"/liveCreate",name:"liveCreate",component:function component(){return __vitePreload(function(){return module.import('./create-legacy.ee61a1d6.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u521B\u5EFA\u76F4\u64AD\u8BFE"}},{path:"/practiceSetting",name:"practiceSetting",component:function component(){return __vitePreload(function(){return module.import('./practice-setting-legacy.688c3a19.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"\u966A\u7EC3\u8BFE\u8BBE\u7F6E"}}])}].concat(rootRouter,[{path:"/:pathMatch(.*)*",component:function component(){return __vitePreload(function(){return module.import('./index-legacy.293de392.js');},false?"__VITE_PRELOAD__":void 0);},meta:{title:"404 Not Fund",platform:"TEACHER"}}]);var router=createRouter({history:createWebHashHistory(),routes:routes});router.beforeEach(function(to,from,next){document.title=to.meta.title||"\u9177\u4E50\u79C0";next();});var vueFilter={moneyFormat:function moneyFormat(value){return numeral(value).format("0,0.00");},dateFormat:function dateFormat(value){var format=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"YYYY-MM-DD HH:mm:ss";return dayjs(value).format(format);}};var normalize='';var index='';var app=createApp(App);dayjs.locale("zh-ch");app.config.globalProperties.$dayjs=dayjs;app.config.globalProperties.$filters=vueFilter;app.use(router);app.mount("#app");}};});})();