import{a as m,b as r,n as f}from"./property-ChPqBGW_.js";import{r as p}from"./state-BnFRu-9h.js";import{B as g}from"./base-element-CNS0Iccv.js";import"./index-fe5hJ7Kl.js";const b=m`
  :host {
    display: block;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.5;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  .detect-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
  }

  .panel {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }

  .panel-header {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .panel-content {
    padding: 16px;
  }

  .detect-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 14px;
  }

  .detect-item:last-child {
    margin-bottom: 0;
  }

  .item-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
  }

  .item-index.success {
    background: #52c41a;
    color: #fff;
  }

  .item-index.failed {
    background: #ff4d4f;
    color: #fff;
  }

  .item-index.warning {
    background: #faad14;
    color: #fff;
  }

  .item-content {
    flex: 1;
  }

  .item-title {
    font-weight: 600;
    margin-bottom: 2px;
  }

  .item-value {
    color: #666;
    word-break: break-all;
  }

  .item-desc {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
  }

  .status-yes {
    color: #52c41a;
    font-weight: 600;
  }

  .status-no {
    color: #ff4d4f;
    font-weight: 600;
  }

  .status-partial {
    color: #faad14;
    font-weight: 600;
  }

  .loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
  }

  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  .loading-text {
    color: #666;
    font-size: 14px;
  }

  .summary-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .summary-item:last-child {
    border-bottom: none;
  }

  .summary-label {
    font-weight: 600;
    margin-right: 8px;
  }

  .device-list {
    margin-top: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
  }

  .device-list-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: #333;
  }

  .device-list-item {
    font-size: 13px;
    color: #666;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .device-list-item::before {
    content: '•';
    color: #1890ff;
  }
`,x=m`
  .device-test-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
  }

  .device-test-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
  }

  .device-test-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
  }

  .device-selector {
    width: 100%;
    max-width: 300px;
    margin-bottom: 16px;
  }

  .device-selector select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
  }

  .device-selector select:hover {
    border-color: #40a9ff;
  }

  .device-selector select:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  }

  .video-preview {
    width: 240px;
    height: 180px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
  }

  .video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .volume-meter {
    width: 100%;
    max-width: 300px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
  }

  .volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #52c41a 0%, #1890ff 100%);
    transition: width 0.1s ease-out;
    border-radius: 6px;
  }

  .audio-player {
    margin-bottom: 16px;
  }

  .audio-player audio {
    width: 100%;
    max-width: 300px;
  }

  .button-group {
    display: flex;
    gap: 12px;
  }

  .btn {
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-primary {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff;
  }

  .btn-primary:hover {
    background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
    transform: translateY(-1px);
  }

  .btn-secondary {
    background: #f0f0f0;
    color: #333;
  }

  .btn-secondary:hover {
    background: #e0e0e0;
  }

  .test-result {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 24px;
  }

  .result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .result-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
  }

  .result-icon.success {
    background: #f6ffed;
    color: #52c41a;
    border: 2px solid #52c41a;
  }

  .result-icon.failed {
    background: #fff2f0;
    color: #ff4d4f;
    border: 2px solid #ff4d4f;
  }

  .result-label {
    font-size: 14px;
    color: #666;
  }

  .test-complete-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
  }

  .start-test-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 16px;
  }
`;var w=Object.defineProperty,d=(u,e,t,s)=>{for(var i=void 0,o=u.length-1,a;o>=0;o--)(a=u[o])&&(i=a(e,t,i)||i);return i&&w(e,t,i),i};const h=class h extends g{constructor(){super("DetectElement"),this.autoStart=!0,this.showDeviceTest=!0,this.stage="loading",this.report=null,this.deviceTestResult={camera:!1,microphone:!1,speaker:!1},this.selectedDevices={camera:"",microphone:"",speaker:""},this.volumeLevel=0,this.currentStream=null,this.audioContext=null,this.analyser=null,this.volumeIntervalId=null}onInitialize(){this.autoStart&&this.startDetect()}onDisconnect(){this.cleanup()}async startDetect(){this.stage="loading";try{const e=await this.runDetect();this.report=e,this.stage="result",this.dispatchCustomEvent("detect-complete",{report:e}),this.logger.info("Detection complete",e)}catch(e){this.logger.error("Detection failed",e)}}async runDetect(){const e=this.getSystemInfo(),t=this.checkAPISupport(),s=await this.checkCodecSupport(),i=await this.getDeviceInfo();return{system:e,api:t,codec:s,devices:i}}getSystemInfo(){const e=navigator.userAgent;let t="Unknown";e.includes("Windows")?t="Windows":e.includes("Mac OS")?t="macOS":e.includes("Linux")?t="Linux":e.includes("Android")?t="Android":(e.includes("iOS")||e.includes("iPhone")||e.includes("iPad"))&&(t="iOS");let s="Unknown",i="";if(e.includes("Chrome")&&!e.includes("Edg")){s="Chrome";const a=e.match(/Chrome\/(\d+)/);i=a?a[1]:""}else if(e.includes("Safari")&&!e.includes("Chrome")){s="Safari";const a=e.match(/Version\/(\d+)/);i=a?a[1]:""}else if(e.includes("Firefox")){s="Firefox";const a=e.match(/Firefox\/(\d+)/);i=a?a[1]:""}else if(e.includes("Edg")){s="Edge";const a=e.match(/Edg\/(\d+)/);i=a?a[1]:""}let o="Unknown";try{const a=document.createElement("canvas"),n=a.getContext("webgl")||a.getContext("experimental-webgl");if(n){const l=n.getExtension("WEBGL_debug_renderer_info");l&&(o=n.getParameter(l.UNMASKED_RENDERER_WEBGL))}}catch{}return{os:t,browser:s,browserVersion:i,userAgent:e,screenResolution:`${screen.width} x ${screen.height}`,gpu:o,hardwareConcurrency:navigator.hardwareConcurrency||0}}checkAPISupport(){return{webrtc:!!window.RTCPeerConnection,websocket:!!window.WebSocket,mediaDevices:!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia),screenCapture:!!(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia),webAudio:!!(window.AudioContext||window.webkitAudioContext),webCodecs:!!(window.VideoEncoder&&window.VideoDecoder&&window.AudioEncoder&&window.AudioDecoder),mediaStreamTrackGenerator:!!window.MediaStreamTrackGenerator,mediaStreamTrackProcessor:!!window.MediaStreamTrackProcessor,canvasCapture:typeof HTMLCanvasElement.prototype.captureStream=="function",videoCapture:typeof HTMLVideoElement.prototype.captureStream=="function"}}async checkCodecSupport(){const e={h264Encode:!1,h264Decode:!1,vp8Encode:!1,vp8Decode:!1,h265Encode:!1,h265Decode:!1,av1Encode:!1,av1Decode:!1};if(window.RTCRtpSender&&RTCRtpSender.getCapabilities){const t=RTCRtpSender.getCapabilities("video");if(t){const s=t.codecs.map(i=>i.mimeType.toLowerCase());e.h264Encode=s.some(i=>i.includes("h264")),e.vp8Encode=s.some(i=>i.includes("vp8")),e.h265Encode=s.some(i=>i.includes("h265")||i.includes("hevc")),e.av1Encode=s.some(i=>i.includes("av1"))}}if(window.RTCRtpReceiver&&RTCRtpReceiver.getCapabilities){const t=RTCRtpReceiver.getCapabilities("video");if(t){const s=t.codecs.map(i=>i.mimeType.toLowerCase());e.h264Decode=s.some(i=>i.includes("h264")),e.vp8Decode=s.some(i=>i.includes("vp8")),e.h265Decode=s.some(i=>i.includes("h265")||i.includes("hevc")),e.av1Decode=s.some(i=>i.includes("av1"))}}if(window.VideoEncoder)try{const t=await window.VideoEncoder.isConfigSupported({codec:"avc1.42001E",width:640,height:480});e.h264Encode=e.h264Encode||t.supported}catch{}if(window.VideoDecoder)try{const t=await window.VideoDecoder.isConfigSupported({codec:"avc1.42001E"});e.h264Decode=e.h264Decode||t.supported}catch{}return e}async getDeviceInfo(){const e={cameras:[],microphones:[],speakers:[],hasCameraPermission:!1,hasMicrophonePermission:!1};try{try{const s=await navigator.mediaDevices.getUserMedia({video:!0,audio:!0});e.hasCameraPermission=!0,e.hasMicrophonePermission=!0,s.getTracks().forEach(i=>i.stop())}catch{try{const i=await navigator.mediaDevices.getUserMedia({video:!0});e.hasCameraPermission=!0,i.getTracks().forEach(o=>o.stop())}catch{}try{const i=await navigator.mediaDevices.getUserMedia({audio:!0});e.hasMicrophonePermission=!0,i.getTracks().forEach(o=>o.stop())}catch{}}const t=await navigator.mediaDevices.enumerateDevices();for(const s of t){const i={deviceId:s.deviceId,label:s.label||`${s.kind} (${s.deviceId.slice(0,8)}...)`,kind:s.kind};s.kind==="videoinput"?e.cameras.push(i):s.kind==="audioinput"?e.microphones.push(i):s.kind==="audiooutput"&&e.speakers.push(i)}}catch(t){this.logger.error("Failed to get device info",t)}return e}startDeviceTest(){this.report&&(this.report.devices.microphones.length>0&&(this.selectedDevices.microphone=this.report.devices.microphones[0].deviceId),this.report.devices.cameras.length>0&&(this.selectedDevices.camera=this.report.devices.cameras[0].deviceId),this.report.devices.speakers.length>0&&(this.selectedDevices.speaker=this.report.devices.speakers[0].deviceId),this.stage="device-test-mic",this.startMicrophoneTest())}async startMicrophoneTest(){this.cleanup();try{this.currentStream=await navigator.mediaDevices.getUserMedia({audio:{deviceId:this.selectedDevices.microphone||void 0}}),this.audioContext=new(window.AudioContext||window.webkitAudioContext);const e=this.audioContext.createMediaStreamSource(this.currentStream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=256,e.connect(this.analyser),this.volumeIntervalId=window.setInterval(()=>{if(!this.analyser)return;const t=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(t);const s=t.reduce((i,o)=>i+o,0)/t.length;this.volumeLevel=Math.min(100,s/128*100)},100)}catch(e){this.logger.error("Failed to start microphone test",e)}}async startCameraTest(){this.cleanup();try{this.currentStream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.selectedDevices.camera||void 0}}),await this.updateComplete;const e=this.shadowRoot?.querySelector(".video-preview video");e&&(e.srcObject=this.currentStream,e.play())}catch(e){this.logger.error("Failed to start camera test",e)}}handleMicResult(e){this.deviceTestResult.microphone=e,this.cleanup(),this.stage="device-test-camera",this.startCameraTest()}handleCameraResult(e){this.deviceTestResult.camera=e,this.cleanup(),this.stage="device-test-speaker"}handleSpeakerResult(e){this.deviceTestResult.speaker=e,this.cleanup(),this.stage="device-test-complete",this.report&&(this.report.deviceTest={...this.deviceTestResult}),this.dispatchCustomEvent("device-test-complete",{result:this.deviceTestResult})}async handleMicChange(e){const t=e.target;this.selectedDevices.microphone=t.value,await this.startMicrophoneTest()}async handleCameraChange(e){const t=e.target;this.selectedDevices.camera=t.value,await this.startCameraTest()}cleanup(){this.volumeIntervalId!==null&&(clearInterval(this.volumeIntervalId),this.volumeIntervalId=null),this.audioContext&&(this.audioContext.close(),this.audioContext=null,this.analyser=null),this.currentStream&&(this.currentStream.getTracks().forEach(e=>e.stop()),this.currentStream=null),this.volumeLevel=0}getReport(){return this.report}render(){return this.stage==="loading"?this.renderLoading():this.stage.startsWith("device-test")?this.renderDeviceTest():this.renderResult()}renderLoading(){return r`
      <div class="detect-container">
        <div class="panel">
          <div class="panel-header">环境检测</div>
          <div class="panel-content">
            <div class="loading-container">
              <div class="loading-spinner"></div>
              <div class="loading-text">正在检测环境...</div>
            </div>
          </div>
        </div>
      </div>
    `}renderResult(){if(!this.report)return r``;const{system:e,api:t,codec:s,devices:i}=this.report,o=t.webrtc&&t.websocket,a=o&&s.h264Encode&&(t.mediaDevices||t.canvasCapture||t.videoCapture),n=o&&s.h264Decode,l=o&&(a||n);return r`
      <div class="detect-container">
        <!-- 检测结果概览 -->
        <div class="panel">
          <div class="panel-header">
            <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
            </svg>
            检测结果概览
          </div>
          <div class="panel-content">
            <div class="summary-item">
              <span class="summary-label">是否支持 Monibuca：</span>
              <span class="${l?"status-yes":"status-no"}">
                ${l?"是":"否"}
              </span>
            </div>
            <div class="summary-item">
              <span class="summary-label">是否支持播放：</span>
              <span class="${n?"status-yes":"status-no"}">
                ${n?"是":"否"}
              </span>
            </div>
            <div class="summary-item">
              <span class="summary-label">是否支持推流：</span>
              <span class="${a?"status-yes":o?"status-partial":"status-no"}">
                ${a?"是":o?"部分支持":"否"}
              </span>
            </div>
          </div>
        </div>

        <!-- 基础环境 -->
        <div class="panel">
          <div class="panel-header">基础环境</div>
          <div class="panel-content">
            ${this.renderDetectItem("操作系统",e.os)}
            ${this.renderDetectItem("浏览器",`${e.browser} ${e.browserVersion}`)}
            ${this.renderDetectItem("屏幕分辨率",e.screenResolution)}
            ${this.renderDetectItem("GPU",e.gpu)}
            ${e.hardwareConcurrency?this.renderDetectItem("逻辑处理器数量",String(e.hardwareConcurrency)):""}
          </div>
        </div>

        <!-- API 支持 -->
        <div class="panel">
          <div class="panel-header">API 支持</div>
          <div class="panel-content">
            ${this.renderDetectItem("是否支持获取媒体设备",t.mediaDevices,1,"是否可以从摄像头和麦克风采集视频和音频")}
            ${this.renderDetectItem("是否支持屏幕分享",t.screenCapture,2)}
            ${this.renderDetectItem("是否支持 WebRTC",t.webrtc,3)}
            ${this.renderDetectItem("是否支持 WebAudio",t.webAudio,4)}
            ${this.renderDetectItem("是否支持 WebSocket",t.websocket,5)}
            ${this.renderDetectItem("是否支持 WebCodecs",t.webCodecs,6)}
            ${this.renderDetectItem("是否支持从 Canvas 获取数据流",t.canvasCapture,7)}
            ${this.renderDetectItem("是否支持从 Video 获取数据流",t.videoCapture,8)}
          </div>
        </div>

        <!-- 编码支持 -->
        <div class="panel">
          <div class="panel-header">编解码支持</div>
          <div class="panel-content">
            ${this.renderDetectItem("H264 编码",s.h264Encode,9,"浏览器支持 H264 编码，则可以支持推本地流")}
            ${this.renderDetectItem("H264 解码",s.h264Decode,10,"浏览器支持 H264 解码，则可以支持拉远端流")}
            ${this.renderDetectItem("VP8 编码",s.vp8Encode,11)}
            ${this.renderDetectItem("VP8 解码",s.vp8Decode,12)}
            ${this.renderDetectItem("H265 编码",s.h265Encode,13)}
            ${this.renderDetectItem("H265 解码",s.h265Decode,14)}
            ${this.renderDetectItem("AV1 编码",s.av1Encode,15)}
            ${this.renderDetectItem("AV1 解码",s.av1Decode,16)}
          </div>
        </div>

        <!-- 设备详情 -->
        <div class="panel">
          <div class="panel-header">设备详情</div>
          <div class="panel-content">
            ${this.renderDetectItem("是否允许使用摄像头",i.hasCameraPermission,17)}
            ${this.renderDetectItem("是否允许使用麦克风",i.hasMicrophonePermission,18)}
            
            ${i.cameras.length>0?r`
              <div class="device-list">
                <div class="device-list-title">摄像头设备列表</div>
                ${i.cameras.map(v=>r`
                  <div class="device-list-item">${v.label}</div>
                `)}
              </div>
            `:""}
            
            ${i.microphones.length>0?r`
              <div class="device-list">
                <div class="device-list-title">麦克风设备列表</div>
                ${i.microphones.map(v=>r`
                  <div class="device-list-item">${v.label}</div>
                `)}
              </div>
            `:""}
            
            ${i.speakers.length>0?r`
              <div class="device-list">
                <div class="device-list-title">扬声器设备列表</div>
                ${i.speakers.map(v=>r`
                  <div class="device-list-item">${v.label}</div>
                `)}
              </div>
            `:""}
          </div>
        </div>

        <!-- 设备支持度检测 -->
        ${this.showDeviceTest?r`
          <div class="panel">
            <div class="panel-header">设备支持度检测</div>
            <div class="panel-content">
              <div class="start-test-container">
                <button class="btn btn-primary" @click=${this.startDeviceTest}>
                  开始检测
                </button>
              </div>
            </div>
          </div>
        `:""}
      </div>
    `}renderDetectItem(e,t,s,i){const o=typeof t=="boolean";return r`
      <div class="detect-item">
        ${s!==void 0?r`
          <div class="item-index ${(o?t:!0)?"success":"failed"}">${s}</div>
        `:""}
        <div class="item-content">
          <div class="item-title">
            ${e}：
            ${o?r`
              <span class="${t?"status-yes":"status-no"}">${t?"是":"否"}</span>
            `:r`
              <span class="item-value">${t}</span>
            `}
          </div>
          ${i?r`<div class="item-desc">${i}</div>`:""}
        </div>
      </div>
    `}renderDeviceTest(){if(!this.report)return r``;switch(this.stage){case"device-test-mic":return this.renderMicTest();case"device-test-camera":return this.renderCameraTest();case"device-test-speaker":return this.renderSpeakerTest();case"device-test-complete":return this.renderTestComplete();default:return r``}}renderMicTest(){const e=this.report?.devices.microphones||[];return r`
      <div class="detect-container">
        <div class="panel">
          <div class="panel-header">麦克风检测</div>
          <div class="panel-content">
            <div class="device-test-container">
              <div class="device-test-title">麦克风检测</div>
              <div class="device-test-desc">是否看到音量条变化？</div>
              
              <div class="device-selector">
                <select @change=${this.handleMicChange}>
                  ${e.map(t=>r`
                    <option value=${t.deviceId} ?selected=${t.deviceId===this.selectedDevices.microphone}>
                      ${t.label}
                    </option>
                  `)}
                </select>
              </div>
              
              <div class="volume-meter">
                <div class="volume-bar" style="width: ${this.volumeLevel}%"></div>
              </div>
              
              <div class="button-group">
                <button class="btn btn-secondary" @click=${()=>this.handleMicResult(!1)}>否</button>
                <button class="btn btn-primary" @click=${()=>this.handleMicResult(!0)}>是</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    `}renderCameraTest(){const e=this.report?.devices.cameras||[];return r`
      <div class="detect-container">
        <div class="panel">
          <div class="panel-header">摄像头检测</div>
          <div class="panel-content">
            <div class="device-test-container">
              <div class="device-test-title">摄像头检测</div>
              <div class="device-test-desc">是否看到视频画面？</div>
              
              <div class="device-selector">
                <select @change=${this.handleCameraChange}>
                  ${e.map(t=>r`
                    <option value=${t.deviceId} ?selected=${t.deviceId===this.selectedDevices.camera}>
                      ${t.label}
                    </option>
                  `)}
                </select>
              </div>
              
              <div class="video-preview">
                <video autoplay muted playsinline></video>
              </div>
              
              <div class="button-group">
                <button class="btn btn-secondary" @click=${()=>this.handleCameraResult(!1)}>否</button>
                <button class="btn btn-primary" @click=${()=>this.handleCameraResult(!0)}>是</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    `}renderSpeakerTest(){return r`
      <div class="detect-container">
        <div class="panel">
          <div class="panel-header">扬声器检测</div>
          <div class="panel-content">
            <div class="device-test-container">
              <div class="device-test-title">扬声器检测</div>
              <div class="device-test-desc">是否能听到声音？</div>
              
              <div class="audio-player">
                <audio controls src="https://www.soundjay.com/misc/sounds/bell-ringing-05.mp3"></audio>
              </div>
              
              <div class="button-group">
                <button class="btn btn-secondary" @click=${()=>this.handleSpeakerResult(!1)}>否</button>
                <button class="btn btn-primary" @click=${()=>this.handleSpeakerResult(!0)}>是</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    `}renderTestComplete(){const{camera:e,microphone:t,speaker:s}=this.deviceTestResult;return r`
      <div class="detect-container">
        <div class="panel">
          <div class="panel-header">检测完成</div>
          <div class="panel-content">
            <div class="device-test-container">
              <div class="test-complete-title">检测完毕</div>
              
              <div class="test-result">
                <div class="result-item">
                  <div class="result-icon ${t?"success":"failed"}">
                    ${t?"✓":"✗"}
                  </div>
                  <div class="result-label">麦克风</div>
                </div>
                
                <div class="result-item">
                  <div class="result-icon ${e?"success":"failed"}">
                    ${e?"✓":"✗"}
                  </div>
                  <div class="result-label">摄像头</div>
                </div>
                
                <div class="result-item">
                  <div class="result-icon ${s?"success":"failed"}">
                    ${s?"✓":"✗"}
                  </div>
                  <div class="result-label">扬声器</div>
                </div>
              </div>
              
              <button class="btn btn-primary" @click=${()=>{this.stage="result"}}>
                返回检测结果
              </button>
            </div>
          </div>
        </div>
      </div>
    `}};h.styles=[b,x];let c=h;d([f({type:Boolean})],c.prototype,"autoStart");d([f({type:Boolean})],c.prototype,"showDeviceTest");d([p()],c.prototype,"stage");d([p()],c.prototype,"report");d([p()],c.prototype,"deviceTestResult");d([p()],c.prototype,"selectedDevices");d([p()],c.prototype,"volumeLevel");customElements.get("m-detect")||customElements.define("m-detect",c);export{c as DetectElement};
