var k=Object.defineProperty,A=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var M=(l,o,e)=>o in l?k(l,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[o]=e,c=(l,o)=>{for(var e in o||(o={}))E.call(o,e)&&M(l,e,o[e]);if(b)for(var e of b(o))D.call(o,e)&&M(l,e,o[e]);return l},p=(l,o)=>A(l,L(o));import{d as C,q as u,c as Z,w as I,r as T,o as F,a as S,b as q,e as P,f as z,m as $,g as _,E as O,h as R,s as U,i as s,j as N,k as j}from"./vendor.3d4ad280.js";function n1(){import("data:text/javascript,")}const K=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))t(a);new MutationObserver(a=>{for(const n of a)if(n.type==="childList")for(const i of n.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&t(i)}).observe(document,{childList:!0,subtree:!0});function e(a){const n={};return a.integrity&&(n.integrity=a.integrity),a.referrerpolicy&&(n.referrerPolicy=a.referrerpolicy),a.crossorigin==="use-credentials"?n.credentials="include":a.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function t(a){if(a.ep)return;a.ep=!0;const n=e(a);fetch(a.href,n)}};K();if(typeof window!="undefined"){let l=function(){var o=document.body,e=document.getElementById("__svg__icons__dom__");e||(e=document.createElementNS("http://www.w3.org/2000/svg","svg"),e.style.position="absolute",e.style.width="0",e.style.height="0",e.id="__svg__icons__dom__",e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:link","http://www.w3.org/1999/xlink")),e.innerHTML='',o.insertBefore(e,o.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",l):l()}const G=C({setup(l){const o=u.parse(location.search),e=location.href.split("#/")[1],t=u.parse(e.split("?")[1]),a=o.roomUid||t.roomUid||"";return a&&sessionStorage.setItem("roomUid",a),(n,i)=>{const r=T("router-view");return F(),Z(r,null,{default:I(({Component:f})=>[(F(),Z(S(f)))]),_:1})}}}),W="modulepreload",H={},J="./",g=function(o,e){return!e||e.length===0?o():Promise.all(e.map(t=>{if(t=`${J}${t}`,t in H)return;H[t]=!0;const a=t.endsWith(".css"),n=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${n}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":W,a||(i.as="script",i.crossOrigin=""),i.href=t,document.head.appendChild(i),a)return new Promise((r,f)=>{i.addEventListener("load",r),i.addEventListener("error",f)})})).then(()=>o())};function Q(l){switch(l){case"../src/pages/404/index.tsx":return g(()=>import("./index.74fefb88.js"),["assets/index.74fefb88.js","assets/index.49150f4c.css","assets/vendor.3d4ad280.js"]);case"../src/pages/home/index.tsx":return g(()=>import("./index.b7bcfd90.js"),["assets/index.b7bcfd90.js","assets/index.d7657bba.css","assets/vendor.3d4ad280.js"]);case"../src/pages/login/index.tsx":return g(()=>import("./index.d1e18e28.js"),["assets/index.d1e18e28.js","assets/index.526ec19c.css","assets/vendor.3d4ad280.js"]);default:return new Promise(function(o,e){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(e.bind(null,new Error("Unknown variable dynamic import: "+l)))})}}const m=l=>async()=>{let o=Promise.resolve(null);try{o=await Q(`../src/pages/${l}/index.tsx`)}catch{o=Promise.reject()}return o};var X=[{path:"/",component:m("home")},{path:"/home",component:m("home")},{path:"/login",component:m("login")},{path:"/:pathMatch(.*)*",component:m("404"),meta:{title:"404 Not Fund"}}],h=q({history:P(),routes:X}),Y=C({name:"SvgIcon",props:{prefix:{type:String,default:"icon"},name:{type:String,required:!0},color:{type:String,default:"#333"}},render(){const{name:l,prefix:o,color:e}=this,t=`#${o}-${l}`;return z("svg",$(this.$attrs,{"aria-hidden":"true",style:{color:e}}),[z("use",{href:t,fill:e},null)])}}),e1={install(l){l.component("SvgIcon",Y)}};const V="dy_admin_token",v="live_admin_token",x=()=>{const l=_.get(V),o=localStorage.getItem(v);let e=null;return o?e=o:l&&(localStorage.setItem(v,l),e=l),e};function r1(l){return localStorage.setItem(v,l)}function l1(){return _.remove(V),localStorage.removeItem(v)}let d=0,B;const o1=l=>{if(d===0){const o=Object.assign({lock:!0,text:"\u52A0\u8F7D\u4E2D...",background:"rgba(0, 0, 0, 0.7)"},l);B=O.service(c({},o))}d++},a1=()=>{d<=0||(d--,d===0&&B.close())},y=R({requestType:"form",timeout:1e4});y.interceptors.request.use((l,o)=>{o.hideLoading||!1||o1();const t=x(),a=localStorage.getItem("tenantId")||"",n=localStorage.getItem("organId")||"",i={};return t&&!["/api-auth/usernameLogin","/api-auth/smsLogin","/api-auth/code/sendSms"].includes(l)&&(i.Authorization=t),a&&(i.tenantId=a),n&&(i.organId=n),{url:l,options:p(c({},o),{params:U(o.params),headers:c(c({},o.headers),i)})}});y.interceptors.response.use(async(l,o)=>{setTimeout(()=>{a1()},200);let e=o.hideMessage||!1;if(new URL(l.url),l.status>299||l.status<200){const a="\u670D\u52A1\u5668\u9519\u8BEF\uFF0C\u72B6\u6001\u7801"+l.status;throw e||s.error(a),new Error(a)}const t=await l.clone().json();if(t.code!==200&&t.errCode!==0){const a=t.msg||"\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5";throw(t.code===401||t.code===403)&&(e||s.error("\u767B\u5F55\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\uFF01"),h.push("/login")),t.code===404&&(e||s.error("\u8BF7\u6C42\u8D44\u6E90\u4E0D\u5B58\u5728\uFF01"),h.push("/404")),t.code===403||t.code===401||e||s.error(a),new Error(a)}return l});const w=N({user:null}),t1=["/login"];h.beforeEach(async(l,o,e)=>{var a;if(x())if(l.path==="/login")e({path:"/"});else if((a=w.user)==null?void 0:a.speakerId)e();else try{const i=sessionStorage.getItem("roomUid"),r=await y.get("/api-web/imLiveBroadcastRoom/queryRoom",{params:{roomUid:i}});w.user=r.data,e(p(c({},l),{replace:!0}))}catch(i){i.msg&&s.error(i.msg),l1(),e(`/login?${u.stringify(l.query)}`)}else t1.indexOf(l.path)!==-1?e():e(`/login?${u.stringify(l.query)}`)});h.afterEach(()=>{});j(G).use(e1).use(h).mount("#app");export{n1 as __vite_legacy_guard,l1 as a,r1 as b,y as r,w as s};