instrument-03bfb888.js 5.3 KB

1
  1. import{d as L,g as E,o as A,s as T,b1 as b,bw as I,f as w,a as K,c as k,ae as D,e as U,h as g,T as O,R,F as M,x as C,q as X,i as H,aH as N,j as S,bx as P,aJ as V,aK as Y,by as x,bz as y,aL as B,aM as F,aN as q}from"./index-1ae0581a.js";function j(){import.meta.url,import("_").catch(()=>1);async function*o(){}}(function(){if(typeof window>"u")return;var o,m="ontouchstart"in window;document.createTouch||(document.createTouch=function(r,t,i,s,d,l,v){return new u(t,i,{pageX:s,pageY:d,screenX:l,screenY:v,clientX:s-window.pageXOffset,clientY:d-window.pageYOffset},0,0)}),document.createTouchList||(document.createTouchList=function(){for(var r=c(),t=0;t<arguments.length;t++)r[t]=arguments[t];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 t=this;do{if(t.matches(r))return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1);return null});var u=function(t,i,s,d,l){d=d||0,l=l||0,this.identifier=i,this.target=t,this.clientX=s.clientX+d,this.clientY=s.clientY+l,this.screenX=s.screenX+d,this.screenY=s.screenY+l,this.pageX=s.pageX+d,this.pageY=s.pageY+l};function c(){var r=[];return r.item=function(t){return this[t]||null},r.identifiedTouch=function(t){return this[t+1]||null},r}var p=!1;function e(r){return function(t){t.type==="mousedown"&&(p=!0),t.type==="mouseup"&&(p=!1),!(t.type==="mousemove"&&!p)&&((t.type==="mousedown"||!o||o&&!o.dispatchEvent)&&(o=t.target),o.closest("[data-no-touch-simulate]")==null&&n(r,t),t.type==="mouseup"&&(o=null))}}function n(r,t){var i=document.createEvent("Event");i.initEvent(r,!0,!0),i.altKey=t.altKey,i.ctrlKey=t.ctrlKey,i.metaKey=t.metaKey,i.shiftKey=t.shiftKey,i.touches=f(t),i.targetTouches=f(t),i.changedTouches=a(t),o.dispatchEvent(i)}function a(r){var t=c();return t.push(new u(o,1,r,0,0)),t}function f(r){return r.type==="mouseup"?c():a(r)}function h(){window.addEventListener("mousedown",e("touchstart"),!0),window.addEventListener("mousemove",e("touchmove"),!0),window.addEventListener("mouseup",e("touchend"),!0)}h.multiTouchOffset=75,m||new h})();const z=L({name:"App",setup(){const o=E(),m=async()=>await P(),u=async()=>{try{const e=o.isCbs?{code:200,data:{}}:await m();if((e==null?void 0:e.code)===5e3){const a=C();if(X(e.message),a.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=(e==null?void 0:e.data)||{};H(n),w.platformType=n.clientType==="STUDENT"?"STUDENT":""}catch(e){w.status="error",N(),console.log("🚀 ~ error:",e)}};A(async()=>{if(o.Authorization&&T(o.Authorization),!b()){const e=await I();if(e!=null&&e.content){const n=e.content,a=n.tokenType+" "+n.accessToken;T(a)}}if(o.productXmlImg){w.status="login";return}u(),K(S())});const c=e=>{e.code==="ArrowUp"?window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowUp"},"*"):e.code==="ArrowDown"&&window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowDown"},"*")};k(()=>{const e=document.getElementById("loading");e&&document.body.removeChild(e),o.platform=="pc"&&document.body.addEventListener("keyup",n=>c(n)),document.addEventListener("contextmenu",function(n){}),document.addEventListener("keydown",function(n){(n.key==="F12"||n.ctrlKey&&n.shiftKey&&n.key==="I"||n.metaKey&&n.altKey&&n.key==="I")&&n.preventDefault()})}),D(()=>{o.platform=="pc"&&document.body.removeEventListener("keyup",c)});const p=U(()=>w.status==="login");return()=>g(M,null,[w.status==="error"?g(O,null,null):p.value?g(R,null,null):null])}}),Q=[{path:"/",component:x},{path:"/product-img",component:()=>y(()=>import("./index-aa1bb37a.js"),["./index-aa1bb37a.js","./index-1ae0581a.js","../css/index-153364c5.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/evaluat-report",component:()=>y(()=>import("./index-3658a715.js"),["./index-3658a715.js","./index-1ae0581a.js","../css/index-153364c5.css","./plyr.min-c8c2777b.js","../css/plyr-ad8ef5ae.css","../css/index-fcf1c51c.css"],import.meta.url)},{path:"/preview",component:()=>y(()=>import("./index-59007d32.js"),["./index-59007d32.js","./index-1ae0581a.js","../css/index-153364c5.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/view-figner",component:()=>y(()=>import("./index-1ae0581a.js").then(o=>o.bP),["./index-1ae0581a.js","../css/index-153364c5.css"],import.meta.url)},{path:"/simple-detail",component:()=>y(()=>import("./index-8ca4f39f.js"),["./index-8ca4f39f.js","./index-1ae0581a.js","../css/index-153364c5.css","../css/index-3b65ea06.css"],import.meta.url)},{path:"/:pathMatch(.*)*",component:B,meta:{title:"404 Not Fund"}}],_=V({history:Y(),routes:Q});_.beforeEach((o,m,u)=>{o.meta.title&&(document.title=o.meta.title),u()});(function(){var p,e,n,a,f,h;const o=E(),m=navigator.userAgent,u=window.DAYA||((e=(p=window.webkit)==null?void 0:p.messageHandlers)==null?void 0:e.DAYA)||window.COLEXIU||((a=(n=window.webkit)==null?void 0:n.messageHandlers)==null?void 0:a.COLEXIU)||window.ORCHESTRA||((h=(f=window.webkit)==null?void 0:f.messageHandlers)==null?void 0:h.ORCHESTRA),c=o.isCbs?"/cbs-app":(m.includes("COLEXIUSTUDENT"),"/edu-app");F({isApp:!!u,platformApi:c,platformType:(m.includes("COLEXIUSTUDENT"),""),proxy:""})})();q(z).use(_).mount("#app");export{j as __vite_legacy_guard};