/*! For license information please see 4531.1ad12340bc61e694.js.LICENSE.txt */
export const __webpack_ids__=["4531"];export const __webpack_modules__={54681:function(r,o,t){t.d(o,{Z:()=>n});var e=t(8081),a=t.n(e),i=t(23645),s=t.n(i)()(a());s.push([r.id,"*,:after,:before{box-sizing:border-box}button,input,select,textarea{font:inherit}button{color:inherit;cursor:pointer}img{height:auto;max-width:100%}a{color:var(--color-link-normal)}[hidden]{display:none!important}",""]);let n=s.toString()},62249:function(r,o,t){t.d(o,{Z:()=>n});var e=t(8081),a=t.n(e),i=t(23645),s=t.n(i)()(a());s.push([r.id,".visually-hidden{border:0!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}",""]);let n=s.toString()},14793:function(r,o,t){t.r(o),t.d(o,{MDNObservatoryForm:()=>MDNObservatoryForm});var e=t(14703),a=t(51968),i=t(8900);t(42678),t(50272);var s=t(81008);let n={TypeError:"Observatory is currently down."};let MDNObservatoryForm=class MDNObservatoryForm extends e.oi{static styles=s.Z;static properties={_queryRunning:{type:Boolean,state:!0},_hostname:{type:String,state:!0},_errorMessage:{type:String,state:!0}};constructor(){super(),this._queryRunning=!1,this._hostname="",this._errorMessage=""}inputRef=(0,a.V)();firstUpdated(){this.inputRef.value?.focus()}async _handleSubmit(r){r.preventDefault(),this._errorMessage="";let o=this.inputRef.value;if(!o?.value.trim()){this._errorMessage="Please enter a valid hostname";return}let t=o.value.trim();try{let r=new URL(t);this._hostname=r.hostname.trim()||t}catch{this._hostname=t}this._queryRunning=!0;try{let r=new URL(i._v+`/api/v2/analyze?host=${encodeURIComponent(this._hostname)}`),o=await fetch(r,{method:"POST"});if(!o.ok){let r=await o.json();throw Error(`Request failed: ${r.message}`)}globalThis.location.href=`/en-US/observatory/analyze?host=${encodeURIComponent(this._hostname)}`}catch(r){this._errorMessage=`${n[r.name]||"message"in r?r.message:r}`}finally{this._queryRunning=!1}}render(){return this._queryRunning?(0,e.dy)`
          <label class="visually-hidden" for="progress-bar">
            Scanning ${this._hostname} </label
          ><mdn-progress-bar id="progress-bar"></mdn-progress-bar>
        `:(0,e.dy)`
          <form @submit=${this._handleSubmit} class="observatory-form">
            <div class="observatory-form__input-group">
              <label htmlFor="host" class="visually-hidden">
                Domain name or URL
              </label>
              <input
                class="input observatory-form__input"
                placeholder="Scan a website for free (e.g. mdn.dev)"
                type="text"
                name="host"
                id="host"
                .value=${this._hostname}
                autofocus
                ${(0,a.i)(this.inputRef)}
              />
              <button
                class="button observatory-form__submit"
                type="submit"
                ?disabled=${this._queryRunning}
                data-variant="primary"
              >
                Scan
              </button>
            </div>
          </form>
          ${this._errorMessage?(0,e.dy)`<div class="error">${this._errorMessage}</div>`:e.Ld}
        `}};customElements.define("mdn-observatory-form",MDNObservatoryForm)},13566:function(r,o,t){t.d(o,{o:()=>a});var e=t(32529);let a=r=>r??e.Ld},81008:function(r,o,t){t.d(o,{Z:()=>p});var e=t(14703),a=t(8081),i=t.n(a),s=t(23645),n=t.n(s),l=t(54681),d=t(56718),m=t(62249),u=n()(i());u.i(l.Z),u.i(d.Z),u.i(m.Z),u.push([r.id,':host{font:400 var(--base-font-size) var(--font-body);--border-radius:0.3rem}.observatory-form__input-group{display:flex;height:3rem}.observatory-form__input-group :focus-visible{outline:1px solid var(--observatory-accent);outline-offset:-1px;outline-width:1px}.observatory-form__input-group ::placeholder{color:var(--color-text-secondary);opacity:.8}.observatory-form__input-group .observatory-form__input{flex-grow:1;font:inherit;padding:0 .75rem;width:100%;--csstools-light-dark-toggle--0:var(--csstools-color-scheme--light) var(--color-gray-05);background-color:var(--csstools-light-dark-toggle--0,var(--color-gray-90));border:1px solid var(--color-border-primary);border-bottom-left-radius:var(--border-radius);border-top-left-radius:var(--border-radius)}@supports (color:light-dark(red,red)){.observatory-form__input-group .observatory-form__input{background-color:light-dark(var(--color-gray-90),var(--color-gray-05))}}:is(.observatory-form__input-group .observatory-form__input)::placeholder{overflow-x:hidden;text-overflow:ellipsis}.observatory-form__input-group .observatory-form__submit{border:none;border-radius:0 var(--border-radius) var(--border-radius) 0;border-bottom-right-radius:var(--border-radius);border-top-right-radius:var(--border-radius);font-size:var(--font-size-normal);font-weight:var(--font-weight-bold);height:unset;padding:0 2rem}.error{color:var(--form-invalid-color);margin-top:.5rem}.error:before{background-color:var(--form-invalid-color);content:"";display:inline-block;height:1.15rem;margin-bottom:.25rem;margin-right:.5rem;-webkit-mask-image:var(--alert-circle-img);mask-image:var(--alert-circle-img);-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:middle;width:1.5em}',""]);let p=(0,e.iv)([u.toString()])}};
//# sourceMappingURL=4531.1ad12340bc61e694.js.map