instrument-648873cf.js 5.5 KB

1
  1. import{d as L,g as E,o as A,s as T,b0 as b,bv as I,f as w,a as D,c as K,ae as k,e as U,h as g,T as O,R,F as M,x as C,q as X,i as S,aG as H,j as N,bw as P,aI as V,aJ as x,bx as Y,by as y,aK as B,aL as F,aM as q}from"./index-efe400a0.js";function j(){import.meta.url,import("_").catch(()=>1);async function*o(){}}(function(){if(typeof window>"u")return;var o,l="ontouchstart"in window;document.createTouch||(document.createTouch=function(r,e,i,s,d,m,v){return new c(e,i,{pageX:s,pageY:d,screenX:m,screenY:v,clientX:s-window.pageXOffset,clientY:d-window.pageYOffset},0,0)}),document.createTouchList||(document.createTouchList=function(){for(var r=u(),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,i,s,d,m){d=d||0,m=m||0,this.identifier=i,this.target=e,this.clientX=s.clientX+d,this.clientY=s.clientY+m,this.screenX=s.screenX+d,this.screenY=s.screenY+m,this.pageX=s.pageX+d,this.pageY=s.pageY+m};function u(){var r=[];return r.item=function(e){return this[e]||null},r.identifiedTouch=function(e){return this[e+1]||null},r}var p=!1;function t(r){return function(e){e.type==="mousedown"&&(p=!0),e.type==="mouseup"&&(p=!1),!(e.type==="mousemove"&&!p)&&((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 i=document.createEvent("Event");i.initEvent(r,!0,!0),i.altKey=e.altKey,i.ctrlKey=e.ctrlKey,i.metaKey=e.metaKey,i.shiftKey=e.shiftKey,i.touches=f(e),i.targetTouches=f(e),i.changedTouches=a(e),o.dispatchEvent(i)}function a(r){var e=u();return e.push(new c(o,1,r,0,0)),e}function f(r){return r.type==="mouseup"?u():a(r)}function h(){window.addEventListener("mousedown",t("touchstart"),!0),window.addEventListener("mousemove",t("touchmove"),!0),window.addEventListener("mouseup",t("touchend"),!0)}h.multiTouchOffset=75,l||new h})();const z=L({name:"App",setup(){const o=E(),l=async()=>await P(),c=async()=>{try{const t=o.isCbs||window.location.href.includes("simple-detail")?{code:200,data:{}}:await l();if((t==null?void 0:t.code)===5e3){const a=C();if(X(t.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=(t==null?void 0:t.data)||{};S(n),w.platformType=n.clientType==="STUDENT"?"STUDENT":""}catch(t){w.status="error",H(),console.log("🚀 ~ error:",t)}};A(async()=>{if(o.Authorization&&T(o.Authorization),!window.location.href.includes("simple-detail")){if(!b()){const t=await I();if(t!=null&&t.content){const n=t.content,a=n.tokenType+" "+n.accessToken;T(a)}}if(o.productXmlImg){w.status="login";return}}c(),D(N())});const u=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=>u(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()}))}),k(()=>{o.platform=="pc"&&document.body.removeEventListener("keyup",u)});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:Y},{path:"/product-img",component:()=>y(()=>import("./index-f2fc1683.js"),["./index-f2fc1683.js","./index-efe400a0.js","../css/index-52f81eaa.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/evaluat-report",component:()=>y(()=>import("./index-6e08df93.js"),["./index-6e08df93.js","./index-efe400a0.js","../css/index-52f81eaa.css","./plyr.min-c8c2777b.js","../css/plyr-ad8ef5ae.css","./index-32bb1767.js","./index-5c47aa74.js","../css/index-55dea78a.css"],import.meta.url)},{path:"/preview",component:()=>y(()=>import("./index-722c7eb7.js"),["./index-722c7eb7.js","./index-efe400a0.js","../css/index-52f81eaa.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/view-figner",component:()=>y(()=>import("./index-efe400a0.js").then(o=>o.c2),["./index-efe400a0.js","../css/index-52f81eaa.css"],import.meta.url)},{path:"/simple-detail",component:()=>y(()=>import("./index-7530bafe.js"),["./index-7530bafe.js","./index-efe400a0.js","../css/index-52f81eaa.css","../css/index-2cf15a52.css"],import.meta.url)},{path:"/:pathMatch(.*)*",component:B,meta:{title:"404 Not Fund"}}],_=V({history:x(),routes:Q});_.beforeEach((o,l,c)=>{o.meta.title&&(document.title=o.meta.title),c()});(function(){var p,t,n,a,f,h;const o=E(),l=navigator.userAgent,c=window.DAYA||((t=(p=window.webkit)==null?void 0:p.messageHandlers)==null?void 0:t.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),u=o.isCbs?"/cbs-app":(l.includes("COLEXIUSTUDENT"),"/edu-app");F({isApp:!!c,platformApi:u,platformType:(l.includes("COLEXIUSTUDENT"),""),proxy:""})})();q(z).use(_).mount("#app");export{j as __vite_legacy_guard};