var L=Object.defineProperty,k=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var Z=(l,o,e)=>o in l?L(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)&&Z(l,e,o[e]);if(M)for(var e of M(o))I.call(o,e)&&Z(l,e,o[e]);return l},f=(l,o)=>k(l,E(o));import{d as V,q as u,c as F,w as z,u as H,E as S,r as T,o as C,a as g,b as q,z as P,e as $,f as O,m as R,g as U,h as N,s as j,i as s,j as G,k as K}from"./vendor.3c30bec5.js";function c1(){import("data:text/javascript,")}const W=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)}};W();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 J=V({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 C(),F(H(S),{locale:H(P),message:{max:1}},{default:z(()=>[g(r,null,{default:z(({Component:v})=>[(C(),F(q(v)))]),_:1})]),_:1},8,["locale"])}}}),Q="modulepreload",w={},X="./",p=function(o,e){return!e||e.length===0?o():Promise.all(e.map(t=>{if(t=`${X}${t}`,t in w)return;w[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":Q,a||(i.as="script",i.crossOrigin=""),i.href=t,document.head.appendChild(i),a)return new Promise((r,v)=>{i.addEventListener("load",r),i.addEventListener("error",v)})})).then(()=>o())};function Y(l){switch(l){case"../src/pages/404/index.tsx":return p(()=>import("./index.d262b432.js"),["assets/index.d262b432.js","assets/index.49150f4c.css","assets/vendor.3c30bec5.js"]);case"../src/pages/home/index.tsx":return p(()=>import("./index.4f61eeca.js"),["assets/index.4f61eeca.js","assets/index.ed5e518a.css","assets/vendor.3c30bec5.js"]);case"../src/pages/login/index.tsx":return p(()=>import("./index.97d2a4b0.js"),["assets/index.97d2a4b0.js","assets/index.526ec19c.css","assets/vendor.3c30bec5.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 Y(`../src/pages/${l}/index.tsx`)}catch{o=Promise.reject()}return o};var e1=[{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=$({history:O(),routes:e1}),l1=V({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 g("svg",R(this.$attrs,{"aria-hidden":"true",style:{color:e}}),[g("use",{href:t,fill:e},null)])}}),o1={install(l){l.component("SvgIcon",l1)}};const y="live_admin_token",x=()=>sessionStorage.getItem(y);function s1(l){return sessionStorage.setItem(y,l)}function B(){return sessionStorage.removeItem(y)}let d=0,A;const a1=l=>{if(d===0){const o=Object.assign({lock:!0,text:"\u52A0\u8F7D\u4E2D...",background:"rgba(0, 0, 0, 0.7)"},l);A=U.service(c({},o))}d++},t1=()=>{d<=0||(d--,d===0&&A.close())},b=N({requestType:"form",timeout:1e4});b.interceptors.request.use((l,o)=>{o.hideLoading||!1||a1();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:f(c({},o),{params:j(o.params),headers:c(c({},o.headers),i)})}});b.interceptors.response.use(async(l,o)=>{setTimeout(()=>{t1()},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 _=G({user:null}),i1=["/login"];h.beforeEach(async(l,o,e)=>{var a;if(x())if(l.path==="/login")e({path:"/"});else if((a=_.user)==null?void 0:a.speakerId)e();else try{const i=sessionStorage.getItem("roomUid"),r=await b.get("/api-web/imLiveBroadcastRoom/speakerJoinRoom",{params:{roomUid:i}});_.user=r.data,e(f(c({},l),{replace:!0}))}catch(i){i.msg&&s.error(i.msg),B(),e(`/login?${u.stringify(l.query)}`)}else i1.indexOf(l.path)!==-1?e():e(`/login?${u.stringify(l.query)}`)});h.afterEach(()=>{});K(J).use(o1).use(h).mount("#app");export{c1 as __vite_legacy_guard,B as a,s1 as b,b as r,_ as s};