12 |
- import{d as v,F as L,G as A,I as E,bo as I,bI as k,N as w,J as D,M as K,aD as U,v as O,j as y,O as R,R as M,P as C,a3 as N,_ as S,Q as X,b2 as P,S as $,bJ as H,b4 as V,b5 as Y,bK as B,bL as g,b6 as x,bM as F,b7 as j,b8 as Q}from"./index-ec725f89.js";function W(){import.meta.url,import("_").catch(()=>1);async function*o(){}}(function(){if(typeof window>"u")return;var o,d="ontouchstart"in window;document.createTouch||(document.createTouch=function(r,e,s,p,l,m,b){return new c(e,s,{pageX:p,pageY:l,screenX:m,screenY:b,clientX:p-window.pageXOffset,clientY:l-window.pageYOffset},0,0)}),document.createTouchList||(document.createTouchList=function(){for(var r=i(),e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length=arguments.length,r}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(r){var e=this;do{if(e.matches(r))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1);return null});var c=function(e,s,p,l,m){l=l||0,m=m||0,this.identifier=s,this.target=e,this.clientX=p.clientX+l,this.clientY=p.clientY+m,this.screenX=p.screenX+l,this.screenY=p.screenY+m,this.pageX=p.pageX+l,this.pageY=p.pageY+m};function i(){var r=[];return r.item=function(e){return this[e]||null},r.identifiedTouch=function(e){return this[e+1]||null},r}var a=!1;function t(r){return function(e){e.type==="mousedown"&&(a=!0),e.type==="mouseup"&&(a=!1),!(e.type==="mousemove"&&!a)&&((e.type==="mousedown"||!o||o&&!o.dispatchEvent)&&(o=e.target),o.closest("[data-no-touch-simulate]")==null&&n(r,e),e.type==="mouseup"&&(o=null))}}function n(r,e){var s=document.createEvent("Event");s.initEvent(r,!0,!0),s.altKey=e.altKey,s.ctrlKey=e.ctrlKey,s.metaKey=e.metaKey,s.shiftKey=e.shiftKey,s.touches=f(e),s.targetTouches=f(e),s.changedTouches=u(e),o.dispatchEvent(s)}function u(r){var e=i();return e.push(new c(o,1,r,0,0)),e}function f(r){return r.type==="mouseup"?i():u(r)}function h(){window.addEventListener("mousedown",t("touchstart"),!0),window.addEventListener("mousemove",t("touchmove"),!0),window.addEventListener("mouseup",t("touchend"),!0)}h.multiTouchOffset=75,d||new h})();const q=v({name:"App",setup(){const o=L(),d=async()=>await H(),c=async()=>{try{const t=o.isCbs||window.location.href.includes("simple-detail")?{code:200,data:{}}:await d();if((t==null?void 0:t.code)===5e3){const u=N();if(S(t.message),u.isApp)postMessage({api:"login"});else{if(/(192|localhost)/.test(location.origin))return;window.parent.postMessage({api:"onLogin"},"*"),setTimeout(()=>{window.location.href=`${location.origin}/classroom`},500)}return}const n=(t==null?void 0:t.data)||{};X(n),w.platformType=n.clientType==="STUDENT"?"STUDENT":""}catch(t){w.status="error",P(),console.log("🚀 ~ error:",t)}};A(async()=>{if(o.Authorization&&E(o.Authorization),!window.location.href.includes("simple-detail")){if(!I()){const t=await k();if(t!=null&&t.content){const n=t.content,u=n.tokenType+" "+n.accessToken;E(u)}}if(o.productXmlImg){w.status="login";return}}c(),D($())});const i=t=>{t.code==="ArrowUp"?window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowUp"},"*"):t.code==="ArrowDown"&&window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowDown"},"*")};K(()=>{const t=document.getElementById("loading");t&&document.body.removeChild(t),(o.platform=="pc"||o.isPreView)&&(document.body.addEventListener("keyup",n=>i(n)),document.addEventListener("contextmenu",function(n){n.preventDefault()}),document.addEventListener("keydown",function(n){(n.key==="F12"||n.ctrlKey&&n.shiftKey&&n.key==="I"||n.metaKey&&n.altKey&&n.key==="I")&&n.preventDefault()}))}),U(()=>{o.platform=="pc"&&document.body.removeEventListener("keyup",i)});const a=O(()=>w.status==="login");return()=>y(C,null,[w.status==="error"?y(R,null,null):a.value?y(M,null,null):null])}}),z=[{path:"/",component:B},{path:"/product-img",component:()=>g(()=>import("./index-4cd0e224.js"),["./index-4cd0e224.js","./index-ec725f89.js","../css/index-1ec513a0.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/evaluat-report",component:()=>g(()=>import("./index-a7ca5df1.js"),["./index-a7ca5df1.js","./index-ec725f89.js","../css/index-1ec513a0.css","./plyr.min-c8c2777b.js","../css/plyr-ad8ef5ae.css","./index-88dcc5a4.js","../css/index-775a7918.css"],import.meta.url)},{path:"/preview",component:()=>g(()=>import("./index-8c87f695.js"),["./index-8c87f695.js","./index-ec725f89.js","../css/index-1ec513a0.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/view-figner",component:()=>g(()=>import("./index-ec725f89.js").then(o=>o.cb),["./index-ec725f89.js","../css/index-1ec513a0.css"],import.meta.url)},{path:"/simple-detail",component:()=>g(()=>import("./index-23bb7bf8.js"),["./index-23bb7bf8.js","./index-ec725f89.js","../css/index-1ec513a0.css","../css/index-2cf15a52.css"],import.meta.url)},{path:"/:pathMatch(.*)*",component:x,meta:{title:"404 Not Fund"}}],T=V({history:Y(),routes:z});T.beforeEach((o,d,c)=>{o.meta.title&&(document.title=o.meta.title),c()});function J(){const o=async i=>{var t,n;const a=`Error message: ${i.target.tagName||""};${i.target.src||i.target.href||""};lineno: ${i.lineno||""};message: ${i.message||""};filename: ${i.filename||""};fileUrl: ${window.location.href};reason: ${((t=i.reason)==null?void 0:t.message)||""};
- stack: ${((n=i.reason)==null?void 0:n.stack)||""};`;F(a)};return{startListenErrorLog:()=>{console.log("mount useErrorLog"),window.addEventListener("error",o),window.addEventListener("unhandledrejection",o)},stopListenErrorLog:()=>{window.removeEventListener("error",o),window.removeEventListener("unhandledrejection",o)}}}(function(){var a,t,n,u,f,h;const o=L(),d=navigator.userAgent,c=window.DAYA||((t=(a=window.webkit)==null?void 0:a.messageHandlers)==null?void 0:t.DAYA)||window.COLEXIU||((u=(n=window.webkit)==null?void 0:n.messageHandlers)==null?void 0:u.COLEXIU)||window.ORCHESTRA||((h=(f=window.webkit)==null?void 0:f.messageHandlers)==null?void 0:h.ORCHESTRA),i=o.isCbs?"/cbs-app":(d.includes("COLEXIUSTUDENT"),"/edu-app");j({isApp:!!c,platformApi:i,platformType:(d.includes("COLEXIUSTUDENT"),""),proxy:""})})();const _=Q(q);_.use(T);const G=J();G.startListenErrorLog();_.mount("#app");export{W as __vite_legacy_guard};
|