var A=Object.defineProperty,L=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var M=(l,o,e)=>o in l?A(l,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[o]=e,c=(l,o)=>{for(var e in o||(o={}))D.call(o,e)&&M(l,e,o[e]);if(b)for(var e of b(o))I.call(o,e)&&M(l,e,o[e]);return l},p=(l,o)=>L(l,E(o));import{d as C,q as u,c as Z,w as T,r as S,o as F,a as q,b as P,e as $,f as z,m as O,g as _,E as R,h as U,s as N,i as s,j,k as K}from"./vendor.a31584f5.js";function n1(){import("data:text/javascript,")}const G=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)}};G();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 W=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=S("router-view");return F(),Z(r,null,{default:T(({Component:f})=>[(F(),Z(q(f)))]),_:1})}}}),J="modulepreload",H={},Q="./",g=function(o,e){return!e||e.length===0?o():Promise.all(e.map(t=>{if(t=`${Q}${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":J,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 X(l){switch(l){case"../src/pages/404/index.tsx":return g(()=>import("./index.d162c875.js"),["assets/index.d162c875.js","assets/index.49150f4c.css","assets/vendor.a31584f5.js"]);case"../src/pages/home/index.tsx":return g(()=>import("./index.5d2c257c.js"),["assets/index.5d2c257c.js","assets/index.4c4c6387.css","assets/vendor.a31584f5.js"]);case"../src/pages/login/index.tsx":return g(()=>import("./index.f3090768.js"),["assets/index.f3090768.js","assets/index.526ec19c.css","assets/vendor.a31584f5.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 X(`../src/pages/${l}/index.tsx`)}catch{o=Promise.reject()}return o};var Y=[{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=P({history:$(),routes:Y}),e1=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",O(this.$attrs,{"aria-hidden":"true",style:{color:e}}),[z("use",{href:t,fill:e},null)])}}),l1={install(l){l.component("SvgIcon",e1)}};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 B(){return _.remove(V),localStorage.removeItem(v)}let d=0,k;const o1=l=>{if(d===0){const o=Object.assign({lock:!0,text:"\u52A0\u8F7D\u4E2D...",background:"rgba(0, 0, 0, 0.7)"},l);k=R.service(c({},o))}d++},a1=()=>{d<=0||(d--,d===0&&k.close())},y=U({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:N(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"),B(),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=j({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),B(),e(`/login?${u.stringify(l.query)}`)}else t1.indexOf(l.path)!==-1?e():e(`/login?${u.stringify(l.query)}`)});h.afterEach(()=>{});K(W).use(l1).use(h).mount("#app");export{n1 as __vite_legacy_guard,B as a,r1 as b,y as r,w as s};