(self.webpackJsonp=self.webpackJsonp||[]).push([[55],{192:function(t,e,r){"use strict";var n=r(203);r.d(e,"a",function(){return a});const a=Object(n.a)({types:{"entity-id":function(t){return"string"!=typeof t?"entity id should be a string":!!t.includes(".")||"entity id should be in the format 'domain.entity'"},icon:function(t){return"string"!=typeof t?"icon should be a string":!!t.includes(":")||"icon should be in the format 'mdi:icon'"}}})},200:function(t,e,r){"use strict";r.d(e,"a",function(){return n});const n=r(0).f`
  <style>
    ha-switch {
      padding: 16px 0;
    }
    .side-by-side {
      display: flex;
    }
    .side-by-side > * {
      flex: 1;
      padding-right: 4px;
    }
    .suffix {
      margin: 0 8px;
    }
  </style>
`},203:function(t,e,r){"use strict";r.d(e,"a",function(){return I});class n extends TypeError{static format(t){const{type:e,path:r,value:n}=t;return`Expected a value of type \`${e}\`${r.length?` for \`${r.join(".")}\``:""} but received \`${JSON.stringify(n)}\`.`}constructor(t){super(n.format(t));const{data:e,path:r,value:a,reason:i,type:o,errors:c=[]}=t;this.data=e,this.path=r,this.value=a,this.reason=i,this.type=o,this.errors=c,c.length||c.push(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack}}var a=Object.prototype.toString,i=function(t){if(void 0===t)return"undefined";if(null===t)return"null";var e=typeof t;if("boolean"===e)return"boolean";if("string"===e)return"string";if("number"===e)return"number";if("symbol"===e)return"symbol";if("function"===e)return"GeneratorFunction"===o(t)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(t))return"array";if(function(t){if(t.constructor&&"function"==typeof t.constructor.isBuffer)return t.constructor.isBuffer(t);return!1}(t))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(t))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(t))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(t))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(t))return"regexp";switch(o(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(t))return"generator";switch(e=a.call(t)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")};function o(t){return t.constructor?t.constructor.name:null}const c="@@__STRUCT__@@",s="@@__KIND__@@";function u(t){return!(!t||!t[c])}function l(t,e){return"function"==typeof t?t(e):t}var f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};class d{constructor(t,e,r){this.name=t,this.type=e,this.validate=r}}function p(t,e,r){if(u(t))return t[s];if(t instanceof d)return t;switch(i(t)){case"array":return t.length>1?w(t,e,r):v(t,e,r);case"function":return y(t,e,r);case"object":return g(t,e,r);case"string":{let n,a=!0;if(t.endsWith("?")&&(a=!1,t=t.slice(0,-1)),t.includes("|")){n=$(t.split(/\s*\|\s*/g),e,r)}else if(t.includes("&")){n=j(t.split(/\s*&\s*/g),e,r)}else n=m(t,e,r);return a||(n=b(n,void 0,r)),n}}throw new Error(`Invalid schema: ${t}`)}function h(t,e,r){if("array"!==i(t))throw new Error(`Invalid schema: ${t}`);const n=t.map(t=>{try{return JSON.stringify(t)}catch(e){return String(t)}}).join(" | ");return new d("enum",n,(r=l(e))=>t.includes(r)?[void 0,r]:[{data:r,path:[],value:r,type:n}])}function y(t,e,r){if("function"!==i(t))throw new Error(`Invalid schema: ${t}`);return new d("function","<function>",(r=l(e),n)=>{const a=t(r,n);let o,c={path:[],reason:null};switch(i(a)){case"boolean":o=a;break;case"string":o=!1,c.reason=a;break;case"object":o=!1,c=f({},c,a);break;default:throw new Error(`Invalid result: ${a}`)}return o?[void 0,r]:[f({type:"<function>",value:r,data:r},c)]})}function v(t,e,r){if("array"!==i(t)||1!==t.length)throw new Error(`Invalid schema: ${t}`);const n=m("array",void 0,r),a=p(t[0],void 0,r),o=`[${a.type}]`;return new d("list",o,(t=l(e))=>{const[r,i]=n.validate(t);if(r)return r.type=o,[r];t=i;const c=[],s=[];for(let e=0;e<t.length;e++){const r=t[e],[n,i]=a.validate(r);n?(n.errors||[n]).forEach(r=>{r.path=[e].concat(r.path),r.data=t,c.push(r)}):s[e]=i}if(c.length){const t=c[0];return t.errors=c,[t]}return[void 0,s]})}function g(t,e,r){if("object"!==i(t))throw new Error(`Invalid schema: ${t}`);const n=m("object",void 0,r),a=[],o={};for(const i in t){a.push(i);const e=p(t[i],void 0,r);o[i]=e}const c=`{${a.join()}}`;return new d("object",c,(t=l(e))=>{const[r]=n.validate(t);if(r)return r.type=c,[r];const a=[],i={},s=Object.keys(t),u=Object.keys(o);if(new Set(s.concat(u)).forEach(r=>{let n=t[r];const c=o[r];if(void 0===n&&(n=l(e&&e[r],t)),!c){const e={data:t,path:[r],value:n};return void a.push(e)}const[s,u]=c.validate(n,t);s?(s.errors||[s]).forEach(e=>{e.path=[r].concat(e.path),e.data=t,a.push(e)}):(r in t||void 0!==u)&&(i[r]=u)}),a.length){const t=a[0];return t.errors=a,[t]}return[void 0,i]})}function b(t,e,r){return $([t,"undefined"],e,r)}function m(t,e,r){if("string"!==i(t))throw new Error(`Invalid schema: ${t}`);const{types:n}=r,a=n[t];if("function"!==i(a))throw new Error(`Invalid type: ${t}`);const o=y(a,e),c=t;return new d("scalar",c,t=>{const[e,r]=o.validate(t);return e?(e.type=c,[e]):[void 0,r]})}function w(t,e,r){if("array"!==i(t))throw new Error(`Invalid schema: ${t}`);const n=t.map(t=>p(t,void 0,r)),a=m("array",void 0,r),o=`[${n.map(t=>t.type).join()}]`;return new d("tuple",o,(t=l(e))=>{const[r]=a.validate(t);if(r)return r.type=o,[r];const i=[],c=[],s=Math.max(t.length,n.length);for(let e=0;e<s;e++){const r=n[e],a=t[e];if(!r){const r={data:t,path:[e],value:a};c.push(r);continue}const[o,s]=r.validate(a);o?(o.errors||[o]).forEach(r=>{r.path=[e].concat(r.path),r.data=t,c.push(r)}):i[e]=s}if(c.length){const t=c[0];return t.errors=c,[t]}return[void 0,i]})}function $(t,e,r){if("array"!==i(t))throw new Error(`Invalid schema: ${t}`);const n=t.map(t=>p(t,void 0,r)),a=n.map(t=>t.type).join(" | ");return new d("union",a,(t=l(e))=>{const r=[];for(const e of n){const[n,a]=e.validate(t);if(!n)return[void 0,a];r.push(n)}return r[0].type=a,r})}function j(t,e,r){if("array"!==i(t))throw new Error(`Invalid schema: ${t}`);const n=t.map(t=>p(t,void 0,r)),a=n.map(t=>t.type).join(" & ");return new d("intersection",a,(t=l(e))=>{let r=t;for(const e of n){const[t,n]=e.validate(r);if(t)return t.type=a,[t];r=n}return[void 0,r]})}const E={any:p,dict:function(t,e,r){if("array"!==i(t)||2!==t.length)throw new Error(`Invalid schema: ${t}`);const n=m("object",void 0,r),a=p(t[0],void 0,r),o=p(t[1],void 0,r),c=`dict<${a.type},${o.type}>`;return new d("dict",c,t=>{const r=l(e);t=r?f({},r,t):t;const[i]=n.validate(t);if(i)return i.type=c,[i];const s={},u=[];for(let e in t){const r=t[e],[n,i]=a.validate(e);if(n){(n.errors||[n]).forEach(r=>{r.path=[e].concat(r.path),r.data=t,u.push(r)});continue}e=i;const[c,l]=o.validate(r);c?(c.errors||[c]).forEach(r=>{r.path=[e].concat(r.path),r.data=t,u.push(r)}):s[e]=l}if(u.length){const t=u[0];return t.errors=u,[t]}return[void 0,s]})},enum:h,enums:function(t,e,r){return v([h(t,void 0)],e,r)},function:y,instance:function(t,e,r){const n=`instance<${t.name}>`;return new d("instance",n,(r=l(e))=>r instanceof t?[void 0,r]:[{data:r,path:[],value:r,type:n}])},interface:function(t,e,r){if("object"!==i(t))throw new Error(`Invalid schema: ${t}`);const n=[],a={};for(const i in t){n.push(i);const e=p(t[i],void 0,r);a[i]=e}const o=`{${n.join()}}`;return new d("interface",o,t=>{const r=l(e);t=r?f({},r,t):t;const n=[],i=t;for(const o in a){let r=t[o];const c=a[o];void 0===r&&(r=l(e&&e[o],t));const[s,u]=c.validate(r,t);s?(s.errors||[s]).forEach(e=>{e.path=[o].concat(e.path),e.data=t,n.push(e)}):(o in t||void 0!==u)&&(i[o]=u)}if(n.length){const t=n[0];return t.errors=n,[t]}return[void 0,i]})},lazy:function(t,e,r){if("function"!==i(t))throw new Error(`Invalid schema: ${t}`);let n,a;return n=new d("lazy","lazy...",e=>(a=t(),n.name=a.kind,n.type=a.type,n.validate=a.validate,n.validate(e)))},list:v,literal:function(t,e,r){const n=`literal: ${JSON.stringify(t)}`;return new d("literal",n,(r=l(e))=>r===t?[void 0,r]:[{data:r,path:[],value:r,type:n}])},object:g,optional:b,partial:function(t,e,r){if("object"!==i(t))throw new Error(`Invalid schema: ${t}`);const n=m("object",void 0,r),a=[],o={};for(const i in t){a.push(i);const e=p(t[i],void 0,r);o[i]=e}const c=`{${a.join()},...}`;return new d("partial",c,(t=l(e))=>{const[r]=n.validate(t);if(r)return r.type=c,[r];const a=[],i={};for(const n in o){let r=t[n];const c=o[n];void 0===r&&(r=l(e&&e[n],t));const[s,u]=c.validate(r,t);s?(s.errors||[s]).forEach(e=>{e.path=[n].concat(e.path),e.data=t,a.push(e)}):(n in t||void 0!==u)&&(i[n]=u)}if(a.length){const t=a[0];return t.errors=a,[t]}return[void 0,i]})},scalar:m,tuple:w,union:$,intersection:j,dynamic:function(t,e,r){if("function"!==i(t))throw new Error(`Invalid schema: ${t}`);return new d("dynamic","dynamic...",(r=l(e),n)=>{const a=t(r,n);if("function"!==i(a))throw new Error(`Invalid schema: ${a}`);const[o,c]=a.validate(r);return o?[o]:[void 0,c]})}},_={any:t=>void 0!==t};function I(t={}){const e=f({},_,t.types||{});function r(t,r,a={}){u(t)&&(t=t.schema);const i=E.any(t,r,f({},a,{types:e}));function o(t){if(this instanceof o)throw new Error("Invalid `new` keyword!");return o.assert(t)}return Object.defineProperty(o,c,{value:!0}),Object.defineProperty(o,s,{value:i}),o.kind=i.name,o.type=i.type,o.schema=t,o.defaults=r,o.options=a,o.assert=(t=>{const[e,r]=i.validate(t);if(e)throw new n(e);return r}),o.test=(t=>{const[e]=i.validate(t);return!e}),o.validate=(t=>{const[e,r]=i.validate(t);return e?[new n(e)]:[void 0,r]}),o}return Object.keys(E).forEach(t=>{const n=E[t];r[t]=((t,a,i)=>{return r(n(t,a,f({},i,{types:e})),a,i)})}),r}["arguments","array","boolean","buffer","error","float32array","float64array","function","generatorfunction","int16array","int32array","int8array","map","null","number","object","promise","regexp","set","string","symbol","uint16array","uint32array","uint8array","uint8clampedarray","undefined","weakmap","weakset"].forEach(t=>{_[t]=(e=>i(e)===t)}),_.date=(t=>"date"===i(t)&&!isNaN(t));I()},699:function(t,e,r){"use strict";r.r(e),r.d(e,"HuiIframeCardEditor",function(){return u});var n=r(3),a=r(0),i=(r(93),r(192)),o=r(18),c=r(200);const s=Object(i.a)({type:"string",title:"string?",url:"string?",aspect_ratio:"string?"});let u=class extends a.a{setConfig(t){t=s(t),this._config=t}get _title(){return this._config.title||""}get _url(){return this._config.url||""}get _aspect_ratio(){return this._config.aspect_ratio||""}render(){return this.hass?a.f`
      ${c.a}
      <div class="card-config">
        <paper-input
          .label="${this.hass.localize("ui.panel.lovelace.editor.card.generic.url")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.required")})"
          .value="${this._url}"
          .configValue="${"url"}"
          @value-changed="${this._valueChanged}"
        ></paper-input>
        <div class="side-by-side">
          <paper-input
            .label="${this.hass.localize("ui.panel.lovelace.editor.card.generic.title")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})"
            .value="${this._title}"
            .configValue="${"title"}"
            @value-changed="${this._valueChanged}"
          ></paper-input>
          <paper-input
            .label="${this.hass.localize("ui.panel.lovelace.editor.card.generic.aspect_ratio")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})"
            type="number"
            .value="${Number(this._aspect_ratio.replace("%",""))}"
            .configValue="${"aspect_ratio"}"
            @value-changed="${this._valueChanged}"
          ></paper-input>
        </div>
      </div>
    `:a.f``}_valueChanged(t){if(!this._config||!this.hass)return;const e=t.target;let r=e.value;"aspect_ratio"===e.configValue&&e.value&&(r+="%"),this[`_${e.configValue}`]!==r&&(e.configValue&&(""===e.value?delete this._config[e.configValue]:this._config=Object.assign(Object.assign({},this._config),{[e.configValue]:r})),Object(o.a)(this,"config-changed",{config:this._config}))}};Object(n.c)([Object(a.g)()],u.prototype,"hass",void 0),Object(n.c)([Object(a.g)()],u.prototype,"_config",void 0),u=Object(n.c)([Object(a.d)("hui-iframe-card-editor")],u)}}]);
//# sourceMappingURL=chunk.0068c12887b712987b85.js.map