matterbridge 2.2.7 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README-DEV.md +24 -12
- package/dist/frontend.d.ts.map +1 -1
- package/dist/frontend.js +2 -1
- package/dist/frontend.js.map +1 -1
- package/dist/matterbridgeEndpoint.d.ts +17 -2
- package/dist/matterbridgeEndpoint.d.ts.map +1 -1
- package/dist/matterbridgeEndpoint.js +36 -5
- package/dist/matterbridgeEndpoint.js.map +1 -1
- package/dist/pluginManager.d.ts.map +1 -1
- package/dist/pluginManager.js +40 -44
- package/dist/pluginManager.js.map +1 -1
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.1fa50342.js → main.e11d6bb4.js} +3 -3
- package/frontend/build/static/js/{main.1fa50342.js.map → main.e11d6bb4.js.map} +1 -1
- package/npm-shrinkwrap.json +2 -9
- package/package.json +1 -2
- /package/frontend/build/static/js/{main.1fa50342.js.LICENSE.txt → main.e11d6bb4.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! For license information please see main.
|
|
1
|
+
/*! For license information please see main.e11d6bb4.js.LICENSE.txt */
|
|
2
2
|
(()=>{var e={3651:(e,t,r)=>{e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t){e.exports=r(5173)},function(e,t){e.exports=r(5043)},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r(0),a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=0,s=n.forwardRef((function(e,t){var r=e.title,o=void 0===r?null:r,s=e.description,l=void 0===s?null:s,c=e.size,u=void 0===c?null:c,d=e.color,p=void 0===d?"currentColor":d,f=e.horizontal,h=void 0===f?null:f,m=e.vertical,g=void 0===m?null:m,v=e.rotate,y=void 0===v?null:v,b=e.spin,x=void 0===b?null:b,w=e.style,S=void 0===w?{}:w,k=e.children,C=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["title","description","size","color","horizontal","vertical","rotate","spin","style","children"]);i++;var j,$=null!==x&&x,E=n.Children.map(k,(function(e){var t=e;!0!==$&&($=!0===(null===x?t.props.spin:x));var r=t.props.size;"number"==typeof u&&"number"==typeof t.props.size&&(r=t.props.size/u);var o={size:r,color:null===p?t.props.color:p,horizontal:null===h?t.props.horizontal:h,vertical:null===g?t.props.vertical:g,rotate:null===y?t.props.rotate:y,spin:null===x?t.props.spin:x,inStack:!0};return n.cloneElement(t,o)}));null!==u&&(S.width="string"==typeof u?u:1.5*u+"rem");var _,P="stack_labelledby_"+i,O="stack_describedby_"+i;if(o)j=l?P+" "+O:P;else if(_="presentation",l)throw new Error("title attribute required when description is set");return n.createElement("svg",a({ref:t,viewBox:"0 0 24 24",style:S,role:_,"aria-labelledby":j},C),o&&n.createElement("title",{id:P},o),l&&n.createElement("desc",{id:O},l),$&&n.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }","@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"),E)}));s.displayName="Stack",s.propTypes={size:o.oneOfType([o.number,o.string]),color:o.string,horizontal:o.bool,vertical:o.bool,rotate:o.number,spin:o.oneOfType([o.bool,o.number]),children:o.oneOfType([o.arrayOf(o.node),o.node]).isRequired,className:o.string,style:o.object},s.defaultProps={size:null,color:null,horizontal:null,vertical:null,rotate:null,spin:null};var l=s;r.d(t,"Icon",(function(){return d})),r.d(t,"Stack",(function(){return l}));var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=0,d=n.forwardRef((function(e,t){var r=e.path,o=e.id,a=void 0===o?++u:o,i=e.title,s=void 0===i?null:i,l=e.description,d=void 0===l?null:l,p=e.size,f=void 0===p?null:p,h=e.color,m=void 0===h?"currentColor":h,g=e.horizontal,v=void 0!==g&&g,y=e.vertical,b=void 0!==y&&y,x=e.rotate,w=void 0===x?0:x,S=e.spin,k=void 0!==S&&S,C=e.style,j=void 0===C?{}:C,$=e.inStack,E=void 0!==$&&$,_=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["path","id","title","description","size","color","horizontal","vertical","rotate","spin","style","inStack"]),P={},O=[];null!==f&&(E?O.push("scale("+f+")"):(j.width="string"==typeof f?f:1.5*f+"rem",j.height=j.width)),v&&O.push("scaleX(-1)"),b&&O.push("scaleY(-1)"),0!==w&&O.push("rotate("+w+"deg)"),null!==m&&(P.fill=m);var R=n.createElement("path",c({d:r,style:P},E?_:{})),M=R;O.length>0&&(j.transform=O.join(" "),j.transformOrigin="center",E&&(M=n.createElement("g",{style:j},R,n.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var N,I=M,T=!0===k||"number"!=typeof k?2:k,A=!E&&(v||b);if(T<0&&(A=!A),k&&(I=n.createElement("g",{style:{animation:"spin"+(A?"-inverse":"")+" linear "+Math.abs(T)+"s infinite",transformOrigin:"center"}},M,!(v||b||0!==w)&&n.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),E)return I;var D,F="icon_labelledby_"+a,z="icon_describedby_"+a;if(s)N=d?F+" "+z:F;else if(D="presentation",d)throw new Error("title attribute required when description is set");return n.createElement("svg",c({ref:t,viewBox:"0 0 24 24",style:j,role:D,"aria-labelledby":N},_),s&&n.createElement("title",{id:F},s),d&&n.createElement("desc",{id:z},d),!E&&k&&(A?n.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):n.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),I)}));d.displayName="Icon",d.propTypes={path:o.string.isRequired,size:o.oneOfType([o.number,o.string]),color:o.string,horizontal:o.bool,vertical:o.bool,rotate:o.number,spin:o.oneOfType([o.bool,o.number]),style:o.object,inStack:o.bool,className:o.string},d.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},t.default=d}])},191:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler");Symbol.for("react.provider");var s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=Symbol.for("react.client.reference");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case o:case i:case a:case u:case d:return e;default:switch(e=e&&e.$$typeof){case l:case c:case f:case p:case s:return e;default:return t}}case n:return t}}}t.Hy=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===i||e===a||e===u||e===d||e===h||"object"===typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===m||void 0!==e.getModuleId)}},3853:(e,t)=>{"use strict";var r,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");function v(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case s:case i:case p:case f:return e;default:switch(e=e&&e.$$typeof){case u:case c:case d:case m:case h:case l:return e;default:return t}}case o:return t}}}r=Symbol.for("react.module.reference"),t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=d,t.Fragment=a,t.Lazy=m,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.SuspenseList=f,t.isAsyncMode=function(){return!1},t.isConcurrentMode=function(){return!1},t.isContextConsumer=function(e){return v(e)===c},t.isContextProvider=function(e){return v(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return v(e)===d},t.isFragment=function(e){return v(e)===a},t.isLazy=function(e){return v(e)===m},t.isMemo=function(e){return v(e)===h},t.isPortal=function(e){return v(e)===o},t.isProfiler=function(e){return v(e)===s},t.isStrictMode=function(e){return v(e)===i},t.isSuspense=function(e){return v(e)===p},t.isSuspenseList=function(e){return v(e)===f},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===s||e===i||e===p||e===f||e===g||"object"===typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===r||void 0!==e.getModuleId)},t.typeOf=v},1697:(e,t,r)=>{"use strict";e.exports=r(3853)},3081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const n=r(1631),o=r(6423),a=r(8e3),i=r(7805),s=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(i,s):i;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=r(8647);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=r(8789);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=r(4639);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var f=r(1180);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},2037:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class o extends r{constructor(e){super(),this._items="string"===typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function a(e){const t=[e[0]];let r=0;for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];for(;r<a.length;)l(t,a[r]),t.push(e[++r]);return new o(t)}t._Code=o,t.nil=new o(""),t._=a;const i=new o("+");function s(e){const t=[u(e[0])];let r=0;for(var n=arguments.length,a=new Array(n>1?n-1:0),s=1;s<n;s++)a[s-1]=arguments[s];for(;r<a.length;)t.push(i),l(t,a[r]),t.push(i,u(e[++r]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(t),new o(t)}function l(e,t){var r;t instanceof o?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=s,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},t.stringify=function(e){return new o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):a`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},8789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(2037),o=r(6602);var a=r(2037);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return a.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return a.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return a.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return a.Name}});var i=r(6602);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class s{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends s{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render(e){let{es5:t,_n:r}=e;const n=t?o.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+r}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=R(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends s{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render(e){let{_n:t}=e;return`${this.lhs} = ${this.rhs};`+t}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=R(this.rhs,e,t),this}get names(){return O(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,r,n){super(e,r,n),this.op=t}render(e){let{_n:t}=e;return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class d extends s{constructor(e){super(),this.label=e,this.names={}}render(e){let{_n:t}=e;return`${this.label}:`+t}}class p extends s{constructor(e){super(),this.label=e,this.names={}}render(e){let{_n:t}=e;return`break${this.label?` ${this.label}`:""};`+t}}class f extends s{constructor(e){super(),this.error=e}render(e){let{_n:t}=e;return`throw ${this.error};`+t}get names(){return this.error.names}}class h extends s{constructor(e){super(),this.code=e}render(e){let{_n:t}=e;return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=R(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(M(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>P(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends m{}class y extends g{}y.kind="else";class b extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(N(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=R(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&P(e,this.else.names),e}}b.kind="if";class x extends g{}x.kind="for";class w extends x{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=R(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class S extends x{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:r,from:n,to:a}=this;return`for(${t} ${r}=${n}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class k extends x{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=R(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class C extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}C.kind="func";class j extends m{render(e){return"return "+super.render(e)}}j.kind="return";class $ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class E extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}E.kind="catch";class _ extends g{render(e){return"finally"+super.render(e)}}_.kind="finally";function P(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,t){return t instanceof n._CodeOrName?P(e,t.names):e}function R(e,t,r){return e instanceof n.Name?a(e):(o=e)instanceof n._Code&&o._items.some((e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str]))?new n._Code(e._items.reduce(((e,t)=>(t instanceof n.Name&&(t=a(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function a(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function M(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function N(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${D(e)}`}t.CodeGen=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new l(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new h(e)),this}object(){const e=["{"];for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];for(const[a,i]of r)e.length>1&&e.push(","),e.push(a),(a!==i||this.opts.es5)&&(e.push(":"),(0,n.addCodeArg)(e,i));return e.push("}"),new n._Code(e)}if(e,t,r){if(this._blockNode(new b(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(b,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.opts.es5?o.varKinds.var:o.varKinds.let;const i=this._scope.toName(e);return this._for(new S(a,i,t,r),(()=>n(i)))}forOf(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o.varKinds.const;const i=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,(t=>{this.var(i,n._`${e}[${t}]`),r(i)}))}return this._for(new k("of",a,i,t),(()=>r(i)))}forIn(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.opts.es5?o.varKinds.var:o.varKinds.const;if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const i=this._scope.toName(e);return this._for(new k("in",a,i,t),(()=>r(i)))}endFor(){return this._endBlockNode(x)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new p(e))}return(e){const t=new j;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(j)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new $;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new E(e),t(e)}return r&&(this._currNode=n.finally=new _,this.code(r)),this._endBlockNode(E,_)}throw(e){return this._leafNode(new f(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.nil,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;return this._blockNode(new C(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=N;const I=A(t.operators.AND);t.and=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(I)};const T=A(t.operators.OR);function A(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${D(t)} ${e} ${D(r)}`}function D(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(T)}},6602:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(2037);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var a;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(a=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class i{constructor(){let{prefixes:e,parent:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=i;class s extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,t){let{property:r,itemIndex:o}=t;this.value=e,this.scopePath=n._`.${new n.Name(r)}[${o}]`}}t.ValueScopeName=s;const l=n._`\n`;t.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:n.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,a=null!==(r=t.key)&&void 0!==r?r:t.ref;let i=this._values[o];if(i){const e=i.get(a);if(e)return e}else i=this._values[o]=new Map;i.set(a,n);const s=this._scope[o]||(this._scope[o]=[]),l=s.length;return s[l]=t.ref,n.setValue(t,{property:o,itemIndex:l}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._values;return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`}))}scopeCode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._values,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0,l=n.nil;for(const c in e){const u=e[c];if(!u)continue;const d=i[c]=i[c]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,a.Started);let i=r(e);if(i){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=n._`${l}${r} ${e} = ${i};${this.opts._n}`}else{if(!(i=null===s||void 0===s?void 0:s(e)))throw new o(e);l=n._`${l}${i}${this.opts._n}`}d.set(e,a.Completed)}))}return l}}},5705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(8789),o=r(1410),a=r(9188);function i(e,t){const r=e.const("err",t);e.if(n._`${a.default.vErrors} === null`,(()=>e.assign(a.default.vErrors,n._`[${r}]`)),n._`${a.default.vErrors}.push(${r})`),e.code(n._`${a.default.errors}++`)}function s(e,t){const{gen:r,validateName:o,schemaEnv:a}=e;a.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${o}.errors`,t),r.return(!1))}t.keywordError={message:e=>{let{keyword:t}=e;return n.str`must pass "${t}" keyword validation`}},t.keyword$DataError={message:e=>{let{keyword:t,schemaType:r}=e;return r?n.str`"${t}" keyword must be ${r} ($data)`:n.str`"${t}" keyword is invalid ($data)`}},t.reportError=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.keywordError,o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;const{it:l}=e,{gen:u,compositeRule:d,allErrors:p}=l,f=c(e,r,o);(null!==a&&void 0!==a?a:d||p)?i(u,f):s(l,n._`[${f}]`)},t.reportExtraError=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.keywordError,n=arguments.length>2?arguments[2]:void 0;const{it:o}=e,{gen:l,compositeRule:u,allErrors:d}=o;i(l,c(e,r,n)),u||d||s(o,a.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(a.default.errors,t),e.if(n._`${a.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(n._`${a.default.vErrors}.length`,t)),(()=>e.assign(a.default.vErrors,null)))))},t.extendErrors=function(e){let{gen:t,keyword:r,schemaValue:o,data:i,errsCount:s,it:l}=e;if(void 0===s)throw new Error("ajv implementation error");const c=t.name("err");t.forRange("i",s,a.default.errors,(e=>{t.const(c,n._`${a.default.vErrors}[${e}]`),t.if(n._`${c}.instancePath === undefined`,(()=>t.assign(n._`${c}.instancePath`,(0,n.strConcat)(a.default.instancePath,l.errorPath)))),t.assign(n._`${c}.schemaPath`,n.str`${l.errSchemaPath}/${r}`),l.opts.verbose&&(t.assign(n._`${c}.schema`,o),t.assign(n._`${c}.data`,i))}))};const l={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{gen:o,it:i}=e,s=[u(i,r),d(e,r)];return function(e,t,r){let{params:o,message:i}=t;const{keyword:s,data:c,schemaValue:u,it:d}=e,{opts:p,propertyName:f,topSchemaRef:h,schemaPath:m}=d;r.push([l.keyword,s],[l.params,"function"==typeof o?o(e):o||n._`{}`]),p.messages&&r.push([l.message,"function"==typeof i?i(e):i]);p.verbose&&r.push([l.schema,u],[l.parentSchema,n._`${h}${m}`],[a.default.data,c]);f&&r.push([l.propertyName,f])}(e,t,s),o.object(...s)}(e,t,r)}function u(e,t){let{errorPath:r}=e,{instancePath:i}=t;const s=i?n.str`${r}${(0,o.getErrorPath)(i,o.Type.Str)}`:r;return[a.default.instancePath,(0,n.strConcat)(a.default.instancePath,s)]}function d(e,t){let{keyword:r,it:{errSchemaPath:a}}=e,{schemaPath:i,parentSchema:s}=t,c=s?a:n.str`${a}/${r}`;return i&&(c=n.str`${c}${(0,o.getErrorPath)(i,o.Type.Str)}`),[l.schemaPath,c]}},8168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(8789),o=r(4639),a=r(9188),i=r(9936),s=r(1410),l=r(8647);class c{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,i.normalizeId)(null===r||void 0===r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null===r||void 0===r?void 0:r.$async,this.refs={}}}function u(e){const t=p.call(this,e);if(t)return t;const r=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:c}=this.opts.code,{ownProperties:u}=this.opts,d=new n.CodeGen(this.scope,{es5:s,lines:c,ownProperties:u});let f;e.$async&&(f=d.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const h=d.scopeName("validate");e.validateName=h;const m={gen:d,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:f,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(a.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${a.default.self}`,`${a.default.scope}`,g)(this,this.scope.get());if(this.scope.value(h,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:h,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(v){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),v}finally{this._compilations.delete(e)}}function d(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function p(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function f(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||h.call(this,e,t)}function h(e,t){const r=this.opts.uriResolver.parse(t),n=(0,i._getFullPath)(this.opts.uriResolver,r);let o=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return g.call(this,r,e);const a=(0,i.normalizeId)(n),s=this.refs[a]||this.schemas[a];if("string"==typeof s){const t=h.call(this,e,s);if("object"!==typeof(null===t||void 0===t?void 0:t.schema))return;return g.call(this,r,t)}if("object"===typeof(null===s||void 0===s?void 0:s.schema)){if(s.validate||u.call(this,s),a===(0,i.normalizeId)(t)){const{schema:t}=s,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,i.resolveUrl)(this.opts.uriResolver,o,n)),new c({schema:t,schemaId:r,root:e,baseId:o})}return g.call(this,r,s)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,r){var n;r=(0,i.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let a=f.call(this,e,r);if(void 0===a){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:i}=this.opts;o&&(a=new c({schema:o,schemaId:i,root:e,baseId:t}))}return void 0!==a?e.refs[r]=d.call(this,a):void 0},t.getCompilingSchema=p,t.resolveSchema=h;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,t){let{baseId:r,schema:n,root:o}=t;var a;if("/"!==(null===(a=e.fragment)||void 0===a?void 0:a[0]))return;for(const c of e.fragment.slice(1).split("/")){if("boolean"===typeof n)return;const e=n[(0,s.unescapeFragment)(c)];if(void 0===e)return;n=e;const t="object"===typeof n&&n[this.opts.schemaId];!m.has(c)&&t&&(r=(0,i.resolveUrl)(this.opts.uriResolver,r,t))}let l;if("boolean"!=typeof n&&n.$ref&&!(0,s.schemaHasRulesButRef)(n,this.RULES)){const e=(0,i.resolveUrl)(this.opts.uriResolver,r,n.$ref);l=h.call(this,o,e)}const{schemaId:u}=this.opts;return l=l||new c({schema:n,schemaId:u,root:o,baseId:r}),l.schema!==l.root.schema?l:void 0}},9188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8789),o={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=o},1180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9936);class o extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=o},9936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(1410),o=r(122),a=r(1125),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(s.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(l))return!0;if("object"==typeof r&&l(r))return!0}return!1}function c(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!i.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],(e=>t+=c(e))),t===1/0))return 1/0}return t}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";!1!==(arguments.length>2?arguments[2]:void 0)&&(t=f(t));const r=e.parse(t);return d(e,r)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const p=/#\/?$/;function f(e){return e?e.replace(p,""):""}t.normalizeId=f,t.resolveUrl=function(e,t,r){return r=f(r),e.resolve(t,r)};const h=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=f(e[r]||t),s={"":i},l=u(n,i,!1),c={},d=new Set;return a(e,{allKeys:!0},((e,t,n,o)=>{if(void 0===o)return;const a=l+t;let i=s[o];function u(t){const r=this.opts.uriResolver.resolve;if(t=f(i?r(i,t):t),d.has(t))throw m(t);d.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?p(e,n.schema,t):t!==f(a)&&("#"===t[0]?(p(e,c[t],t),c[t]=e):this.refs[t]=a),t}function g(e){if("string"==typeof e){if(!h.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(i=u.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=i})),c;function p(e,t,r){if(void 0!==t&&!o(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},9447:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},1410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(8789),o=r(2037);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.schema;const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"===typeof t)return;const o=n.RULES.keywords;for(const a in t)o[a]||h(e,`unknown keyword: "${a}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function s(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c(e){let{mergeNames:t,mergeToName:r,mergeValues:o,resultToName:a}=e;return(e,i,s,l)=>{const c=void 0===s?i:s instanceof n.Name?(i instanceof n.Name?t(e,i,s):r(e,i,s),s):i instanceof n.Name?(r(e,s,i),i):o(i,s);return l!==n.Name||c instanceof n.Name?c:a(e,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&d(e,r,t),r}function d(e,t,r){Object.keys(r).forEach((r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0)))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(a(e,t),!i(t,e.self.RULES.all))},t.checkUnknownRules=a,t.schemaHasRules=i,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function(e,t,r,o){let{topSchemaRef:a,schemaPath:i}=e;if(!o){if("number"==typeof t||"boolean"==typeof t)return t;if("string"==typeof t)return n._`${t}`}return n._`${a}${i}${(0,n.getProperty)(r)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(s(e))},t.escapeJsonPointer=s,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>{e.if(n._`${t} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`)))})),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),d(e,r,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,(()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`))),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,(()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const p={};var f;function h(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.opts.strictSchema;if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:p[t.code]||(p[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(f=t.Type||(t.Type={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===f.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+s(e)},t.checkStrictMode=h},5566:(e,t)=>{"use strict";function r(e,t){return t.rules.some((t=>n(e,t)))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function(e,t){let{schema:n,self:o}=e;const a=o.RULES.types[t];return a&&!0!==a&&r(n,a)},t.shouldUseGroup=r,t.shouldUseRule=n},6404:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(5705),o=r(8789),a=r(9188),i={message:"boolean schema is false"};function s(e,t){const{gen:r,data:o}=e,a={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(a,i,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?s(e,!1):"object"==typeof r&&!0===r.$async?t.return(a.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),s(e)):r.var(t,!0)}},9507:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(9447),o=r(5566),a=r(5705),i=r(8789),s=r(1410);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:n,opts:a}=e,s=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,a.coerceTypes),c=t.length>0&&!(0===s.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){const o=p(t,n,a.strictNumbers,l.Wrong);r.if(o,(()=>{s.length?function(e,t,r){const{gen:n,data:o,opts:a}=e,s=n.let("dataType",i._`typeof ${o}`),l=n.let("coerced",i._`undefined`);"array"===a.coerceTypes&&n.if(i._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,i._`${o}[0]`).assign(s,i._`typeof ${o}`).if(p(t,o,a.strictNumbers),(()=>n.assign(l,o)))));n.if(i._`${l} !== undefined`);for(const i of r)(u.has(i)||"array"===i&&"array"===a.coerceTypes)&&c(i);function c(e){switch(e){case"string":return void n.elseIf(i._`${s} == "number" || ${s} == "boolean"`).assign(l,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(l,i._`""`);case"number":return void n.elseIf(i._`${s} == "boolean" || ${o} === null
|
|
3
3
|
|| (${s} == "string" && ${o} && ${o} == +${o})`).assign(l,i._`+${o}`);case"integer":return void n.elseIf(i._`${s} === "boolean" || ${o} === null
|
|
4
4
|
|| (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,i._`+${o}`);case"boolean":return void n.elseIf(i._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf(i._`${o} === "true" || ${o} === 1`).assign(l,!0);case"null":return n.elseIf(i._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(l,null);case"array":n.elseIf(i._`${s} === "string" || ${s} === "number"
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
animation: ${vd} 1.4s linear infinite;
|
|
112
112
|
`:null,xd="string"!==typeof yd?fo`
|
|
113
113
|
animation: ${yd} 1.4s ease-in-out infinite;
|
|
114
|
-
`:null,wd=dl("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${yl(r.color)}`]]}})(gl((e=>{let{theme:t}=e;return{display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:bd||{animation:`${vd} 1.4s linear infinite`}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}}))]}}))),Sd=dl("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),kd=dl("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${yl(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(gl((e=>{let{theme:t}=e;return{stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink},style:xd||{animation:`${yd} 1.4s ease-in-out infinite`}}]}}))),Cd=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiCircularProgress"}),{className:n,color:o="primary",disableShrink:a=!1,size:i=40,style:s,thickness:l=3.6,value:c=0,variant:u="indeterminate",...d}=r,p={...r,color:o,disableShrink:a,size:i,thickness:l,value:c,variant:u},f=(e=>{const{classes:t,variant:r,color:n,disableShrink:o}=e;return zs({root:["root",r,`color${yl(n)}`],svg:["svg"],circle:["circle",`circle${yl(r)}`,o&&"circleDisableShrink"]},md,t)})(p),h={},m={},g={};if("determinate"===u){const e=2*Math.PI*((gd-l)/2);h.strokeDasharray=e.toFixed(3),g["aria-valuenow"]=Math.round(c),h.strokeDashoffset=`${((100-c)/100*e).toFixed(3)}px`,m.transform="rotate(-90deg)"}return(0,dt.jsx)(wd,{className:Ns(f.root,n),style:{width:i,height:i,...m,...s},ownerState:p,ref:t,role:"progressbar",...g,...d,children:(0,dt.jsx)(Sd,{className:f.svg,ownerState:p,viewBox:"22 22 44 44",children:(0,dt.jsx)(kd,{className:f.circle,style:h,ownerState:p,cx:gd,cy:gd,r:(gd-l)/2,fill:"none",strokeWidth:l})})})})),jd=Cd;function $d(e){return vu("MuiIconButton",e)}const Ed=yu("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),_d=dl(hd,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,"default"!==r.color&&t[`color${yl(r.color)}`],r.edge&&t[`edge${yl(r.edge)}`],t[`size${yl(r.size)}`]]}})(gl((e=>{let{theme:t}=e;return{textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]}})),gl((e=>{let{theme:t}=e;return{variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No((t.vars||t).palette[r].main,t.palette.action.hoverOpacity)}}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${Ed.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled},[`&.${Ed.loading}`]:{color:"transparent"}}}))),Pd=dl("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(t.vars||t).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]}})),Od=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiIconButton"}),{edge:n=!1,children:o,className:a,color:i="default",disabled:s=!1,disableFocusRipple:l=!1,size:c="medium",id:u,loading:d=null,loadingIndicator:p,...f}=r,h=Mu(u),m=p??(0,dt.jsx)(jd,{"aria-labelledby":h,color:"inherit",size:16}),g={...r,edge:n,color:i,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:m,size:c},v=(e=>{const{classes:t,disabled:r,color:n,edge:o,size:a,loading:i}=e;return zs({root:["root",i&&"loading",r&&"disabled","default"!==n&&`color${yl(n)}`,o&&`edge${yl(o)}`,`size${yl(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},$d,t)})(g);return(0,dt.jsxs)(_d,{id:d?h:u,className:Ns(v.root,a),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...f,ownerState:g,children:["boolean"===typeof d&&(0,dt.jsx)("span",{className:v.loadingWrapper,style:{display:"contents"},children:(0,dt.jsx)(Pd,{className:v.loadingIndicator,ownerState:g,children:d&&m})}),o]})})),Rd=Od,Md=Wl;const Nd=e.createContext({});function Id(e){return vu("MuiList",e)}yu("MuiList",["root","padding","dense","subheader"]);const Td=dl("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return!t.disablePadding},style:{paddingTop:8,paddingBottom:8}},{props:e=>{let{ownerState:t}=e;return t.subheader},style:{paddingTop:0}}]}),Ad=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiList"}),{children:o,className:a,component:i="ul",dense:s=!1,disablePadding:l=!1,subheader:c,...u}=n,d=e.useMemo((()=>({dense:s})),[s]),p={...n,component:i,dense:s,disablePadding:l},f=(e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return zs({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},Id,t)})(p);return(0,dt.jsx)(Nd.Provider,{value:d,children:(0,dt.jsxs)(Td,{as:i,className:Ns(f.root,a),ref:r,ownerState:p,...u,children:[c,o]})})})),Dd=Ad;function Fd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const zd=Fd,Ld=go;function Bd(e){return Wl(e).defaultView||window}const Wd=Bd;function Vd(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function Hd(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function Ud(e,t){if(void 0===t)return!0;let r=e.innerText;return void 0===r&&(r=e.textContent),r=r.trim().toLowerCase(),0!==r.length&&(t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join("")))}function qd(e,t,r,n,o,a){let i=!1,s=o(e,t,!!t&&r);for(;s;){if(s===e.firstChild){if(i)return!1;i=!0}const t=!n&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&Ud(s,a)&&!t)return s.focus(),!0;s=o(e,s,r)}return!1}const Gd=e.forwardRef((function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:a=!1,children:i,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu",...p}=t,f=e.useRef(null),h=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ld((()=>{o&&f.current.focus()}),[o]),e.useImperativeHandle(n,(()=>({adjustStyleForScrollbar:(e,t)=>{let{direction:r}=t;const n=!f.current.style.width;if(e.clientHeight<f.current.clientHeight&&n){const t=`${zd(Wd(e))}px`;f.current.style["rtl"===r?"paddingLeft":"paddingRight"]=t,f.current.style.width=`calc(100% + ${t})`}return f.current}})),[]);const m=Al(f,r);let g=-1;e.Children.forEach(i,((t,r)=>{e.isValidElement(t)?(t.props.disabled||("selectedMenu"===d&&t.props.selected||-1===g)&&(g=r),g===r&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(g+=1,g>=i.length&&(g=-1))):g===r&&(g+=1,g>=i.length&&(g=-1))}));const v=e.Children.map(i,((t,r)=>{if(r===g){const r={};return a&&(r.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===d&&(r.tabIndex=0),e.cloneElement(t,r)}return t}));return(0,dt.jsx)(Dd,{role:"menu",ref:m,className:s,onKeyDown:e=>{const t=f.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey)return void(u&&u(e));const n=Md(t).activeElement;if("ArrowDown"===r)e.preventDefault(),qd(t,n,c,l,Vd);else if("ArrowUp"===r)e.preventDefault(),qd(t,n,c,l,Hd);else if("Home"===r)e.preventDefault(),qd(t,null,c,l,Vd);else if("End"===r)e.preventDefault(),qd(t,null,c,l,Hd);else if(1===r.length){const o=h.current,a=r.toLowerCase(),i=performance.now();o.keys.length>0&&(i-o.lastTime>500?(o.keys=[],o.repeating=!0,o.previousKeyMatched=!0):o.repeating&&a!==o.keys[0]&&(o.repeating=!1)),o.lastTime=i,o.keys.push(a);const s=n&&!o.repeating&&Ud(n,o);o.previousKeyMatched&&(s||qd(t,n,!1,l,Vd,o))?e.preventDefault():o.previousKeyMatched=!1}u&&u(e)},tabIndex:o?0:-1,...p,children:v})})),Kd=Gd;const Qd=function(e){return"string"===typeof e};function Jd(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((()=>{e.apply(this,o)}),r)}return n.clear=()=>{clearTimeout(t)},n}const Yd=Jd,Xd=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Zd(e){const t=[],r=[];return Array.from(e.querySelectorAll(Xd)).forEach(((e,n)=>{const o=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==o&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}(e))}(e)&&(0===o?t.push(e):r.push({documentOrder:n,tabIndex:o,node:e}))})),r.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function ep(){return!0}const tp=function(t){const{children:r,disableAutoFocus:n=!1,disableEnforceFocus:o=!1,disableRestoreFocus:a=!1,getTabbable:i=Zd,isEnabled:s=ep,open:l}=t,c=e.useRef(!1),u=e.useRef(null),d=e.useRef(null),p=e.useRef(null),f=e.useRef(null),h=e.useRef(!1),m=e.useRef(null),g=Tl(Bs(r),m),v=e.useRef(null);e.useEffect((()=>{l&&m.current&&(h.current=!n)}),[n,l]),e.useEffect((()=>{if(!l||!m.current)return;const e=Wl(m.current);return m.current.contains(e.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),h.current&&m.current.focus()),()=>{a||(p.current&&p.current.focus&&(c.current=!0,p.current.focus()),p.current=null)}}),[l]),e.useEffect((()=>{if(!l||!m.current)return;const e=Wl(m.current),t=t=>{v.current=t,!o&&s()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(c.current=!0,d.current&&d.current.focus())},r=()=>{const t=m.current;if(null===t)return;if(!e.hasFocus()||!s()||c.current)return void(c.current=!1);if(t.contains(e.activeElement))return;if(o&&e.activeElement!==u.current&&e.activeElement!==d.current)return;if(e.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!h.current)return;let r=[];if(e.activeElement!==u.current&&e.activeElement!==d.current||(r=i(m.current)),r.length>0){const e=Boolean(v.current?.shiftKey&&"Tab"===v.current?.key),t=r[0],n=r[r.length-1];"string"!==typeof t&&"string"!==typeof n&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener("focusin",r),e.addEventListener("keydown",t,!0);const n=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&r()}),50);return()=>{clearInterval(n),e.removeEventListener("focusin",r),e.removeEventListener("keydown",t,!0)}}),[n,o,a,s,l,i]);const y=e=>{null===p.current&&(p.current=e.relatedTarget),h.current=!0};return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)("div",{tabIndex:l?0:-1,onFocus:y,ref:u,"data-testid":"sentinelStart"}),e.cloneElement(r,{ref:g,onFocus:e=>{null===p.current&&(p.current=e.relatedTarget),h.current=!0,f.current=e.target;const t=r.props.onFocus;t&&t(e)}}),(0,dt.jsx)("div",{tabIndex:l?0:-1,onFocus:y,ref:d,"data-testid":"sentinelEnd"})]})},rp={entering:{opacity:1},entered:{opacity:1}},np=e.forwardRef((function(t,r){const n=hl(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:i=!0,children:s,easing:l,in:c,onEnter:u,onEntered:d,onEntering:p,onExit:f,onExited:h,onExiting:m,style:g,timeout:v=o,TransitionComponent:y=Rl,...b}=t,x=e.useRef(null),w=Al(x,Bs(s),r),S=e=>t=>{if(e){const r=x.current;void 0===t?e(r):e(r,t)}},k=S(p),C=S(((e,t)=>{Ml(e);const r=Nl({style:g,timeout:v,easing:l},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),u&&u(e,t)})),j=S(d),$=S(m),E=S((e=>{const t=Nl({style:g,timeout:v,easing:l},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),f&&f(e)})),_=S(h);return(0,dt.jsx)(y,{appear:i,in:c,nodeRef:x,onEnter:C,onEntered:j,onEntering:k,onExit:E,onExited:_,onExiting:$,addEndListener:e=>{a&&a(x.current,e)},timeout:v,...b,children:(t,r)=>{let{ownerState:n,...o}=r;return e.cloneElement(s,{style:{opacity:0,visibility:"exited"!==t||c?void 0:"hidden",...rp[t],...g,...s.props.style},ref:w,...o})}})})),op=np;function ap(e){return vu("MuiBackdrop",e)}yu("MuiBackdrop",["root","invisible"]);const ip=dl("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),sp=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiBackdrop"}),{children:n,className:o,component:a="div",invisible:i=!1,open:s,components:l={},componentsProps:c={},slotProps:u={},slots:d={},TransitionComponent:p,transitionDuration:f,...h}=r,m={...r,component:a,invisible:i},g=(e=>{const{classes:t,invisible:r}=e;return zs({root:["root",r&&"invisible"]},ap,t)})(m),v={slots:{transition:p,root:l.Root,...d},slotProps:{...c,...u}},[y,b]=Iu("root",{elementType:ip,externalForwardedProps:v,className:Ns(g.root,o),ownerState:m}),[x,w]=Iu("transition",{elementType:op,externalForwardedProps:v,ownerState:m});return(0,dt.jsx)(x,{in:s,timeout:f,...h,...w,children:(0,dt.jsx)(y,{"aria-hidden":!0,...b,classes:g,ref:t,children:n})})})),lp=sp;function cp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(((e,t)=>null==t?e:function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n),t.apply(this,n)}),(()=>{}))}function up(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function dp(e){return parseInt(Bd(e).getComputedStyle(e).paddingRight,10)||0}function pp(e,t,r,n,o){const a=[t,r,...n];[].forEach.call(e.children,(e=>{const t=!a.includes(e),r=!function(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||r}(e);t&&r&&up(e,o)}))}function fp(e,t){let r=-1;return e.some(((e,n)=>!!t(e)&&(r=n,!0))),r}function hp(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(function(e){const t=Wl(e);return t.body===e?Bd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(n)){const e=Fd(Bd(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${dp(n)+e}px`;const t=Wl(n).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{r.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${dp(t)+e}px`}))}let e;if(n.parentNode instanceof DocumentFragment)e=Wl(n).body;else{const t=n.parentElement,r=Bd(n);e="HTML"===t?.nodeName&&"scroll"===r.getComputedStyle(t).overflowY?t:n}r.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{r.forEach((e=>{let{value:t,el:r,property:n}=e;t?r.style.setProperty(n,t):r.style.removeProperty(n)}))}}const mp=()=>{},gp=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&up(e.modalRef,!1);const n=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);pp(t,e.mount,e.modalRef,n,!0);const o=fp(this.containers,(e=>e.container===t));return-1!==o?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:n}),r)}mount(e,t){const r=fp(this.containers,(t=>t.modals.includes(e))),n=this.containers[r];n.restore||(n.restore=hp(n,t))}remove(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=this.modals.indexOf(e);if(-1===r)return r;const n=fp(this.containers,(t=>t.modals.includes(e))),o=this.containers[n];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),0===o.modals.length)o.restore&&o.restore(),e.modalRef&&up(e.modalRef,t),pp(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(n,1);else{const e=o.modals[o.modals.length-1];e.modalRef&&up(e.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};const vp=function(t){const{container:r,disableEscapeKeyDown:n=!1,disableScrollLock:o=!1,closeAfterTransition:a=!1,onTransitionEnter:i,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:d}=t,p=e.useRef({}),f=e.useRef(null),h=e.useRef(null),m=Tl(h,d),[g,v]=e.useState(!u),y=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let b=!0;"false"!==t["aria-hidden"]&&!1!==t["aria-hidden"]||(b=!1);const x=()=>(p.current.modalRef=h.current,p.current.mount=f.current,p.current),w=()=>{gp.mount(x(),{disableScrollLock:o}),h.current&&(h.current.scrollTop=0)},S=Eu((()=>{const e=function(e){return"function"===typeof e?e():e}(r)||Wl(f.current).body;gp.add(x(),e),h.current&&w()})),k=()=>gp.isTopModal(x()),C=Eu((e=>{f.current=e,e&&(u&&k()?w():h.current&&up(h.current,b))})),j=e.useCallback((()=>{gp.remove(x(),b)}),[b]);e.useEffect((()=>()=>{j()}),[j]),e.useEffect((()=>{u?S():y&&a||j()}),[u,j,y,a,S]);const $=e=>t=>{e.onKeyDown?.(t),"Escape"===t.key&&229!==t.which&&k()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},E=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=lu(t);delete r.onTransitionEnter,delete r.onTransitionExited;const n={...r,...e};return{role:"presentation",...n,onKeyDown:$(n),ref:m}},getBackdropProps:function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{"aria-hidden":!0,...e,onClick:E(e),open:u}},getTransitionProps:()=>({onEnter:cp((()=>{v(!1),i&&i()}),l?.props.onEnter??mp),onExited:cp((()=>{v(!0),s&&s(),a&&j()}),l?.props.onExited??mp)}),rootRef:m,portalRef:C,isTopModal:k,exited:g,hasTransition:y}};function yp(e){return vu("MuiModal",e)}yu("MuiModal",["root","hidden","backdrop"]);const bp=dl("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(gl((e=>{let{theme:t}=e;return{position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:e=>{let{ownerState:t}=e;return!t.open&&t.exited},style:{visibility:"hidden"}}]}}))),xp=dl(lp,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),wp=e.forwardRef((function(t,r){const n=vl({name:"MuiModal",props:t}),{BackdropComponent:o=xp,BackdropProps:a,classes:i,className:s,closeAfterTransition:l=!1,children:c,container:u,component:d,components:p={},componentsProps:f={},disableAutoFocus:h=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:g=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:b=!1,hideBackdrop:x=!1,keepMounted:w=!1,onBackdropClick:S,onClose:k,onTransitionEnter:C,onTransitionExited:j,open:$,slotProps:E={},slots:_={},theme:P,...O}=n,R={...n,closeAfterTransition:l,disableAutoFocus:h,disableEnforceFocus:m,disableEscapeKeyDown:g,disablePortal:v,disableRestoreFocus:y,disableScrollLock:b,hideBackdrop:x,keepMounted:w},{getRootProps:M,getBackdropProps:N,getTransitionProps:I,portalRef:T,isTopModal:A,exited:D,hasTransition:F}=vp({...R,rootRef:r}),z={...R,exited:D},L=(e=>{const{open:t,exited:r,classes:n}=e;return zs({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},yp,n)})(z),B={};if(void 0===c.props.tabIndex&&(B.tabIndex="-1"),F){const{onEnter:e,onExited:t}=I();B.onEnter=e,B.onExited=t}const W={slots:{root:p.Root,backdrop:p.Backdrop,..._},slotProps:{...f,...E}},[V,H]=Iu("root",{ref:r,elementType:bp,externalForwardedProps:{...W,...O,component:d},getSlotProps:M,ownerState:z,className:Ns(s,L?.root,!z.open&&z.exited&&L?.hidden)}),[U,q]=Iu("backdrop",{ref:a?.ref,elementType:o,externalForwardedProps:W,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:e=>N({...e,onClick:t=>{S&&S(t),e?.onClick&&e.onClick(t)}}),className:Ns(a?.className,L?.backdrop),ownerState:z});return w||$||F&&!D?(0,dt.jsx)(fu,{ref:T,container:u,disablePortal:v,children:(0,dt.jsxs)(V,{...H,children:[!x&&o?(0,dt.jsx)(U,{...q}):null,(0,dt.jsx)(tp,{disableEnforceFocus:m,disableAutoFocus:h,disableRestoreFocus:y,isEnabled:A,open:$,children:e.cloneElement(c,B)})]})}):null})),Sp=wp;function kp(e){return vu("MuiPaper",e)}yu("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Cp=dl("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,"elevation"===r.variant&&t[`elevation${r.elevation}`]]}})(gl((e=>{let{theme:t}=e;return{backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:e=>{let{ownerState:t}=e;return!t.square},style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}}))),jp=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiPaper"}),n=hl(),{className:o,component:a="div",elevation:i=1,square:s=!1,variant:l="elevation",...c}=r,u={...r,component:a,elevation:i,square:s,variant:l},d=(e=>{const{square:t,elevation:r,variant:n,classes:o}=e;return zs({root:["root",n,!t&&"rounded","elevation"===n&&`elevation${r}`]},kp,o)})(u);return(0,dt.jsx)(Cp,{as:a,ownerState:u,className:Ns(d.root,o),ref:t,...c,style:{..."elevation"===l&&{"--Paper-shadow":(n.vars||n).shadows[i],...n.vars&&{"--Paper-overlay":n.vars.overlays?.[i]},...!n.vars&&"dark"===n.palette.mode&&{"--Paper-overlay":`linear-gradient(${No("#fff",Ea(i))}, ${No("#fff",Ea(i))})`}},...c.style}})})),$p=jp;function Ep(e){return vu("MuiPopover",e)}yu("MuiPopover",["root","paper"]);function _p(e,t){if(!e)return t;if("function"===typeof e||"function"===typeof t)return r=>{const n="function"===typeof t?t(r):t,o="function"===typeof e?e({...r,...n}):e,a=Ns(r?.className,n?.className,o?.className);return{...n,...o,...!!a&&{className:a},...n?.style&&o?.style&&{style:{...n.style,...o.style}},...n?.sx&&o?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(o.sx)?o.sx:[o.sx]]}}};const r=t,n=Ns(r?.className,e?.className);return{...t,...e,...!!n&&{className:n},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function Pp(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.height/2:"bottom"===t&&(r=e.height),r}function Op(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.width/2:"right"===t&&(r=e.width),r}function Rp(e){return[e.horizontal,e.vertical].map((e=>"number"===typeof e?`${e}px`:e)).join(" ")}function Mp(e){return"function"===typeof e?e():e}const Np=dl(Sp,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Ip=dl($p,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Tp=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiPopover"}),{action:o,anchorEl:a,anchorOrigin:i={vertical:"top",horizontal:"left"},anchorPosition:s,anchorReference:l="anchorEl",children:c,className:u,container:d,elevation:p=8,marginThreshold:f=16,open:h,PaperProps:m={},slots:g={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:b,transitionDuration:x="auto",TransitionProps:w={},disableScrollLock:S=!1,...k}=n,C=e.useRef(),j={...n,anchorOrigin:i,anchorReference:l,elevation:p,marginThreshold:f,transformOrigin:y,TransitionComponent:b,transitionDuration:x,TransitionProps:w},$=(e=>{const{classes:t}=e;return zs({root:["root"],paper:["paper"]},Ep,t)})(j),E=e.useCallback((()=>{if("anchorPosition"===l)return s;const e=Mp(a),t=(e&&1===e.nodeType?e:Md(C.current).body).getBoundingClientRect();return{top:t.top+Pp(t,i.vertical),left:t.left+Op(t,i.horizontal)}}),[a,i.horizontal,i.vertical,s,l]),_=e.useCallback((e=>({vertical:Pp(e,y.vertical),horizontal:Op(e,y.horizontal)})),[y.horizontal,y.vertical]),P=e.useCallback((e=>{const t={width:e.offsetWidth,height:e.offsetHeight},r=_(t);if("none"===l)return{top:null,left:null,transformOrigin:Rp(r)};const n=E();let o=n.top-r.vertical,i=n.left-r.horizontal;const s=o+t.height,c=i+t.width,u=Wd(Mp(a)),d=u.innerHeight-f,p=u.innerWidth-f;if(null!==f&&o<f){const e=o-f;o-=e,r.vertical+=e}else if(null!==f&&s>d){const e=s-d;o-=e,r.vertical+=e}if(null!==f&&i<f){const e=i-f;i-=e,r.horizontal+=e}else if(c>p){const e=c-p;i-=e,r.horizontal+=e}return{top:`${Math.round(o)}px`,left:`${Math.round(i)}px`,transformOrigin:Rp(r)}}),[a,l,E,_,f]),[O,R]=e.useState(h),M=e.useCallback((()=>{const e=C.current;if(!e)return;const t=P(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,R(!0)}),[P]);e.useEffect((()=>(S&&window.addEventListener("scroll",M),()=>window.removeEventListener("scroll",M))),[a,S,M]);e.useEffect((()=>{h&&M()})),e.useImperativeHandle(o,(()=>h?{updatePosition:()=>{M()}}:null),[h,M]),e.useEffect((()=>{if(!h)return;const e=Yd((()=>{M()})),t=Wd(a);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[a,h,M]);let N=x;const I={slots:{transition:b,...g},slotProps:{transition:w,paper:m,...v}},[T,A]=Iu("transition",{elementType:Bl,externalForwardedProps:I,ownerState:j,getSlotProps:e=>({...e,onEntering:(t,r)=>{e.onEntering?.(t,r),M()},onExited:t=>{e.onExited?.(t),R(!1)}}),additionalProps:{appear:!0,in:h}});"auto"!==x||T.muiSupportAuto||(N=void 0);const D=d||(a?Md(Mp(a)).body:void 0),[F,{slots:z,slotProps:L,...B}]=Iu("root",{ref:r,elementType:Np,externalForwardedProps:{...I,...k},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:g.backdrop},slotProps:{backdrop:_p("function"===typeof v.backdrop?v.backdrop(j):v.backdrop,{invisible:!0})},container:D,open:h},ownerState:j,className:Ns($.root,u)}),[W,V]=Iu("paper",{ref:C,className:$.paper,elementType:Ip,externalForwardedProps:I,shouldForwardComponentProp:!0,additionalProps:{elevation:p,style:O?void 0:{opacity:0}},ownerState:j});return(0,dt.jsx)(F,{...B,...!Qd(F)&&{slots:z,slotProps:L,disableScrollLock:S},children:(0,dt.jsx)(T,{...A,timeout:N,children:(0,dt.jsx)(W,{...V,children:c})})})})),Ap=Tp;function Dp(e){return vu("MuiMenu",e)}yu("MuiMenu",["root","paper","list"]);const Fp={vertical:"top",horizontal:"right"},zp={vertical:"top",horizontal:"left"},Lp=dl(Ap,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Bp=dl(Ip,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Wp=dl(Kd,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),Vp=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:a,className:i,disableAutoFocusItem:s=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:d={},PopoverClasses:p,transitionDuration:f="auto",TransitionProps:{onEntering:h,...m}={},variant:g="selectedMenu",slots:v={},slotProps:y={},...b}=n,x=Hr(),w={...n,autoFocus:o,disableAutoFocusItem:s,MenuListProps:l,onEntering:h,PaperProps:d,transitionDuration:f,TransitionProps:m,variant:g},S=(e=>{const{classes:t}=e;return zs({root:["root"],paper:["paper"],list:["list"]},Dp,t)})(w),k=o&&!s&&u,C=e.useRef(null);let j=-1;e.Children.map(a,((t,r)=>{e.isValidElement(t)&&(t.props.disabled||("selectedMenu"===g&&t.props.selected||-1===j)&&(j=r))}));const $={slots:v,slotProps:{list:l,transition:m,paper:d,...y}},E=pu({elementType:v.root,externalSlotProps:y.root,ownerState:w,className:[S.root,i]}),[_,P]=Iu("paper",{className:S.paper,elementType:Bp,externalForwardedProps:$,shouldForwardComponentProp:!0,ownerState:w}),[O,R]=Iu("list",{className:Ns(S.list,l.className),elementType:Wp,shouldForwardComponentProp:!0,externalForwardedProps:$,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{"Tab"===e.key&&(e.preventDefault(),c&&c(e,"tabKeyDown"))})(t),e.onKeyDown?.(t)}}),ownerState:w}),M="function"===typeof $.slotProps.transition?$.slotProps.transition(w):$.slotProps.transition;return(0,dt.jsx)(Lp,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:x?"right":"left"},transformOrigin:x?Fp:zp,slots:{root:v.root,paper:_,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:E,paper:P,backdrop:"function"===typeof y.backdrop?y.backdrop(w):y.backdrop,transition:{...M,onEntering:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];((e,t)=>{C.current&&C.current.adjustStyleForScrollbar(e,{direction:x?"rtl":"ltr"}),h&&h(e,t)})(...t),M?.onEntering?.(...t)}}},open:u,ref:r,transitionDuration:f,ownerState:w,...b,classes:p,children:(0,dt.jsx)(O,{actions:C,autoFocus:o&&(-1===j||s),autoFocusItem:k,variant:g,...R,children:a})})})),Hp=Vp;function Up(e){return vu("MuiDivider",e)}const qp=yu("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function Gp(e){return vu("MuiListItemIcon",e)}const Kp=yu("MuiListItemIcon",["root","alignItemsFlexStart"]);function Qp(e){return vu("MuiListItemText",e)}const Jp=yu("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function Yp(e){return vu("MuiMenuItem",e)}const Xp=yu("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Zp=dl(hd,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]}})(gl((e=>{let{theme:t}=e;return{...t.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Xp.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Xp.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Xp.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Xp.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Xp.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${qp.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${qp.inset}`]:{marginLeft:52},[`& .${Jp.root}`]:{marginTop:0,marginBottom:0},[`& .${Jp.inset}`]:{paddingLeft:36},[`& .${Kp.root}`]:{minWidth:36},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableGutters},style:{paddingLeft:16,paddingRight:16}},{props:e=>{let{ownerState:t}=e;return t.divider},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:e=>{let{ownerState:t}=e;return!t.dense},style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:e=>{let{ownerState:t}=e;return t.dense},style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${Kp.root} svg`]:{fontSize:"1.25rem"}}}]}}))),ef=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:a="li",dense:i=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:p,...f}=n,h=e.useContext(Nd),m=e.useMemo((()=>({dense:i||h.dense||!1,disableGutters:l})),[h.dense,i,l]),g=e.useRef(null);Ld((()=>{o&&g.current&&g.current.focus()}),[o]);const v={...n,dense:m.dense,divider:s,disableGutters:l},y=(e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:a,classes:i}=e,s=zs({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",a&&"selected"]},Yp,i);return{...i,...s}})(n),b=Al(g,r);let x;return n.disabled||(x=void 0!==d?d:-1),(0,dt.jsx)(Nd.Provider,{value:m,children:(0,dt.jsx)(Zp,{ref:b,role:u,tabIndex:x,component:a,focusVisibleClassName:Ns(y.focusVisible,c),className:Ns(y.root,p),...f,ownerState:v,classes:y})})})),tf=ef,rf=dl("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"flex-start"===r.alignItems&&t.alignItemsFlexStart]}})(gl((e=>{let{theme:t}=e;return{minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}}))),nf=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemIcon"}),{className:o,...a}=n,i=e.useContext(Nd),s={...n,alignItems:i.alignItems},l=(e=>{const{alignItems:t,classes:r}=e;return zs({root:["root","flex-start"===t&&"alignItemsFlexStart"]},Gp,r)})(s);return(0,dt.jsx)(rf,{className:Ns(l.root,o),ownerState:s,ref:r,...a})})),of=nf;function af(e){return vu("MuiTypography",e)}const sf=yu("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),lf=e=>{const t={systemProps:{},otherProps:{}},r=e?.theme?.unstable_sxConfig??so;return Object.keys(e).forEach((n=>{r[n]?t.systemProps[n]=e[n]:t.otherProps[n]=e[n]})),t};function cf(e){const{sx:t,...r}=e,{systemProps:n,otherProps:o}=lf(r);let a;return a=Array.isArray(t)?[n,...t]:"function"===typeof t?function(){const e=t(...arguments);return on(e)?{...n,...e}:n}:{...n,...t},{...o,sx:a}}const uf=function(e){let{styles:t,themeId:r,defaultTheme:n={}}=e;const o=fl(n),a="function"===typeof t?t(r&&o[r]||o):t;return(0,dt.jsx)(mo,{styles:a})};const df=function(e){return(0,dt.jsx)(uf,{...e,defaultTheme:sl,themeId:Zr})};const pf={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},ff=cf,hf=dl("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${yl(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(gl((e=>{let{theme:t}=e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter((e=>{let[t,r]=e;return"inherit"!==t&&r&&"object"===typeof r})).map((e=>{let[t,r]=e;return{props:{variant:t},style:r}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette?.text||{}).filter((e=>{let[,t]=e;return"string"===typeof t})).map((e=>{let[r]=e;return{props:{color:`text${yl(r)}`},style:{color:(t.vars||t).palette.text[r]}}})),{props:e=>{let{ownerState:t}=e;return"inherit"!==t.align},style:{textAlign:"var(--Typography-textAlign)"}},{props:e=>{let{ownerState:t}=e;return t.noWrap},style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:e=>{let{ownerState:t}=e;return t.gutterBottom},style:{marginBottom:"0.35em"}},{props:e=>{let{ownerState:t}=e;return t.paragraph},style:{marginBottom:16}}]}}))),mf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},gf=e.forwardRef((function(e,t){const{color:r,...n}=vl({props:e,name:"MuiTypography"}),o=ff({...n,...!pf[r]&&{color:r}}),{align:a="inherit",className:i,component:s,gutterBottom:l=!1,noWrap:c=!1,paragraph:u=!1,variant:d="body1",variantMapping:p=mf,...f}=o,h={...o,align:a,color:r,className:i,component:s,gutterBottom:l,noWrap:c,paragraph:u,variant:d,variantMapping:p},m=s||(u?"p":p[d]||mf[d])||"span",g=(e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:a,classes:i}=e;return zs({root:["root",a,"inherit"!==e.align&&`align${yl(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]},af,i)})(h);return(0,dt.jsx)(hf,{as:m,ref:t,className:Ns(g.root,i),...f,ownerState:h,style:{..."inherit"!==a&&{"--Typography-textAlign":a},...f.style}})})),vf=gf,yf=dl("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Jp.primary}`]:t.primary},{[`& .${Jp.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${sf.root}:where(& .${Jp.primary})`]:{display:"block"},[`.${sf.root}:where(& .${Jp.secondary})`]:{display:"block"},variants:[{props:e=>{let{ownerState:t}=e;return t.primary&&t.secondary},style:{marginTop:6,marginBottom:6}},{props:e=>{let{ownerState:t}=e;return t.inset},style:{paddingLeft:56}}]}),bf=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemText"}),{children:o,className:a,disableTypography:i=!1,inset:s=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d,slots:p={},slotProps:f={},...h}=n,{dense:m}=e.useContext(Nd);let g=null!=l?l:o,v=u;const y={...n,disableTypography:i,inset:s,primary:!!g,secondary:!!v,dense:m},b=(e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:a}=e;return zs({root:["root",r&&"inset",a&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},Qp,t)})(y),x={slots:p,slotProps:{primary:c,secondary:d,...f}},[w,S]=Iu("primary",{className:b.primary,elementType:vf,externalForwardedProps:x,ownerState:y}),[k,C]=Iu("secondary",{className:b.secondary,elementType:vf,externalForwardedProps:x,ownerState:y});return null==g||g.type===vf||i||(g=(0,dt.jsx)(w,{variant:m?"body2":"body1",component:S?.variant?void 0:"span",...S,children:g})),null==v||v.type===vf||i||(v=(0,dt.jsx)(k,{variant:"body2",color:"textSecondary",...C,children:v})),(0,dt.jsxs)(yf,{className:Ns(b.root,a),ownerState:y,ref:r,...h,children:[g,v]})})),xf=bf,wf=dl("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(gl((e=>{let{theme:t}=e;return{margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:No(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:e=>{let{ownerState:t}=e;return!!t.children},style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:e=>{let{ownerState:t}=e;return t.children&&"vertical"!==t.orientation},style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"vertical"===t.orientation&&t.children},style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"right"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:e=>{let{ownerState:t}=e;return"left"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}}))),Sf=dl("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(gl((e=>{let{theme:t}=e;return{display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}}))),kf=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiDivider"}),{absolute:n=!1,children:o,className:a,orientation:i="horizontal",component:s=(o||"vertical"===i?"div":"hr"),flexItem:l=!1,light:c=!1,role:u=("hr"!==s?"separator":void 0),textAlign:d="center",variant:p="fullWidth",...f}=r,h={...r,absolute:n,component:s,flexItem:l,light:c,orientation:i,role:u,textAlign:d,variant:p},m=(e=>{const{absolute:t,children:r,classes:n,flexItem:o,light:a,orientation:i,textAlign:s,variant:l}=e;return zs({root:["root",t&&"absolute",l,a&&"light","vertical"===i&&"vertical",o&&"flexItem",r&&"withChildren",r&&"vertical"===i&&"withChildrenVertical","right"===s&&"vertical"!==i&&"textAlignRight","left"===s&&"vertical"!==i&&"textAlignLeft"],wrapper:["wrapper","vertical"===i&&"wrapperVertical"]},Up,n)})(h);return(0,dt.jsx)(wf,{as:s,className:Ns(m.root,a),role:u,ref:t,ownerState:h,"aria-orientation":"separator"!==u||"hr"===s&&"vertical"!==i?void 0:i,...f,children:o?(0,dt.jsx)(Sf,{className:m.wrapper,ownerState:h,children:o}):null})}));kf&&(kf.muiSkipListHighlight=!0);const Cf=kf;function jf(e){return vu("MuiSvgIcon",e)}yu("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const $f=dl("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${yl(r.color)}`],t[`fontSize${yl(r.fontSize)}`]]}})(gl((e=>{let{theme:t}=e;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:t.transitions?.create?.("fill",{duration:(t.vars??t).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:t.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:t.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter((e=>{let[,t]=e;return t&&t.main})).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars??t).palette?.[r]?.main}}})),{props:{color:"action"},style:{color:(t.vars??t).palette?.action?.active}},{props:{color:"disabled"},style:{color:(t.vars??t).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}}))),Ef=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiSvgIcon"}),{children:o,className:a,color:i="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:p="0 0 24 24",...f}=n,h=e.isValidElement(o)&&"svg"===o.type,m={...n,color:i,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:p,hasSvgAsChild:h},g={};u||(g.viewBox=p);const v=(e=>{const{color:t,fontSize:r,classes:n}=e;return zs({root:["root","inherit"!==t&&`color${yl(t)}`,`fontSize${yl(r)}`]},jf,n)})(m);return(0,dt.jsxs)($f,{as:s,className:Ns(v.root,a),focusable:"false",color:c,"aria-hidden":!d||void 0,role:d?"img":void 0,ref:r,...g,...f,...h&&o.props,ownerState:m,children:[h?o.props.children:o,d?(0,dt.jsx)("title",{children:d}):null]})}));Ef.muiName="SvgIcon";const _f=Ef;function Pf(t,r){function n(e,n){return(0,dt.jsx)(_f,{"data-testid":`${r}Icon`,ref:n,...e,children:t})}return n.muiName=_f.muiName,e.memo(e.forwardRef(n))}const Of=Pf((0,dt.jsx)("path",{d:"m12 16.5 4-4h-3v-9h-2v9H8zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2"}),"SystemUpdateAlt"),Rf=Pf((0,dt.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt"),Mf=Pf((0,dt.jsx)("path",{d:"M13 3h-2v10h2zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83"}),"PowerSettingsNew"),Nf=Pf((0,dt.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),If=Pf((0,dt.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save"),Tf=Pf((0,dt.jsx)("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),Af=Pf((0,dt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),Df=Pf((0,dt.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17L4 17.17V4h16zM11 5h2v6h-2zm0 8h2v2h-2z"}),"AnnouncementOutlined"),Ff=Pf((0,dt.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"ReportProblem"),zf=Pf((0,dt.jsx)("path",{d:"m16 5-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2"}),"IosShare"),Lf=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");function Bf(e,t,r){const n=t.replace(/\\/g,"*");tM&&console.log("sendCommandToMatterbridge:",e,t,n),fetch(`./api/command/${e}/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r}).then((e=>{if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return e.json()})).then((e=>{tM&&console.log("Command sent successfully:",e)})).catch((e=>{console.error("Error sending command:",e)}))}const Wf=yu("MuiBox",["root"]),Vf=Ba(),Hf=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:r,defaultTheme:n,defaultClassName:o="MuiBox-root",generateClassName:a}=t,i=Js("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(co);return e.forwardRef((function(e,t){const s=fl(n),{className:l,component:c="div",...u}=cf(e);return(0,dt.jsx)(i,{as:c,ref:t,className:Ns(l,a?a(o):o),theme:r&&s[r]||s,...u})}))}({themeId:Zr,defaultTheme:Vf,defaultClassName:Wf.root,generateClassName:mu.generate}),Uf=Hf;function qf(e){return vu("MuiAlert",e)}const Gf=yu("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),Kf=Pf((0,dt.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Qf=Pf((0,dt.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Jf=Pf((0,dt.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Yf=Pf((0,dt.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Xf=Pf((0,dt.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Zf=dl($p,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${yl(r.color||r.severity)}`]]}})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?To:Do,n="light"===t.palette.mode?Do:To;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(qu(["light"])).map((e=>{let[o]=e;return{props:{colorSeverity:o,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${o}Color`]:r(t.palette[o].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${o}StandardBg`]:n(t.palette[o].light,.9),[`& .${Gf.icon}`]:t.vars?{color:t.vars.palette.Alert[`${o}IconColor`]}:{color:t.palette[o].main}}}})),...Object.entries(t.palette).filter(qu(["light"])).map((e=>{let[n]=e;return{props:{colorSeverity:n,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${n}Color`]:r(t.palette[n].light,.6),border:`1px solid ${(t.vars||t).palette[n].light}`,[`& .${Gf.icon}`]:t.vars?{color:t.vars.palette.Alert[`${n}IconColor`]}:{color:t.palette[n].main}}}})),...Object.entries(t.palette).filter(qu(["dark"])).map((e=>{let[r]=e;return{props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:"dark"===t.palette.mode?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}}))]}}))),eh=dl("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),th=dl("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),rh=dl("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),nh={success:(0,dt.jsx)(Kf,{fontSize:"inherit"}),warning:(0,dt.jsx)(Qf,{fontSize:"inherit"}),error:(0,dt.jsx)(Jf,{fontSize:"inherit"}),info:(0,dt.jsx)(Yf,{fontSize:"inherit"})},oh=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiAlert"}),{action:n,children:o,className:a,closeText:i="Close",color:s,components:l={},componentsProps:c={},icon:u,iconMapping:d=nh,onClose:p,role:f="alert",severity:h="success",slotProps:m={},slots:g={},variant:v="standard",...y}=r,b={...r,color:s,severity:h,variant:v,colorSeverity:s||h},x=(e=>{const{variant:t,color:r,severity:n,classes:o}=e;return zs({root:["root",`color${yl(r||n)}`,`${t}${yl(r||n)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},qf,o)})(b),w={slots:{closeButton:l.CloseButton,closeIcon:l.CloseIcon,...g},slotProps:{...c,...m}},[S,k]=Iu("root",{ref:t,shouldForwardComponentProp:!0,className:Ns(x.root,a),elementType:Zf,externalForwardedProps:{...w,...y},ownerState:b,additionalProps:{role:f,elevation:0}}),[C,j]=Iu("icon",{className:x.icon,elementType:eh,externalForwardedProps:w,ownerState:b}),[$,E]=Iu("message",{className:x.message,elementType:th,externalForwardedProps:w,ownerState:b}),[_,P]=Iu("action",{className:x.action,elementType:rh,externalForwardedProps:w,ownerState:b}),[O,R]=Iu("closeButton",{elementType:Rd,externalForwardedProps:w,ownerState:b}),[M,N]=Iu("closeIcon",{elementType:Xf,externalForwardedProps:w,ownerState:b});return(0,dt.jsxs)(S,{...k,children:[!1!==u?(0,dt.jsx)(C,{...j,children:u||d[h]||nh[h]}):null,(0,dt.jsx)($,{...E,children:o}),null!=n?(0,dt.jsx)(_,{...P,children:n}):null,null==n&&p?(0,dt.jsx)(_,{...P,children:(0,dt.jsx)(O,{size:"small","aria-label":i,title:i,color:"inherit",onClick:p,...R,children:(0,dt.jsx)(M,{fontSize:"small",...N})})}):null]})})),ah=oh,ih=Pf((0,dt.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function sh(e){return vu("MuiDialog",e)}const lh=yu("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);const ch=e.createContext({}),uh=dl(lp,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),dh=dl(Sp,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),ph=dl("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.container,t[`scroll${yl(r.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),fh=dl($p,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`scrollPaper${yl(r.scroll)}`],t[`paperWidth${yl(String(r.maxWidth))}`],r.fullWidth&&t.paperFullWidth,r.fullScreen&&t.paperFullScreen]}})(gl((e=>{let{theme:t}=e;return{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:e=>{let{ownerState:t}=e;return!t.maxWidth},style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===t.breakpoints.unit?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${lh.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter((e=>"xs"!==e)).map((e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${lh.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+64)]:{maxWidth:"calc(100% - 64px)"}}}}))),{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"calc(100% - 64px)"}},{props:e=>{let{ownerState:t}=e;return t.fullScreen},style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${lh.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}}))),hh=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiDialog"}),o=hl(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":s,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:d,className:p,disableEscapeKeyDown:f=!1,fullScreen:h=!1,fullWidth:m=!1,maxWidth:g="sm",onBackdropClick:v,onClick:y,onClose:b,open:x,PaperComponent:w=$p,PaperProps:S={},scroll:k="paper",slots:C={},slotProps:j={},TransitionComponent:$=op,transitionDuration:E=a,TransitionProps:_,...P}=n,O={...n,disableEscapeKeyDown:f,fullScreen:h,fullWidth:m,maxWidth:g,scroll:k},R=(e=>{const{classes:t,scroll:r,maxWidth:n,fullWidth:o,fullScreen:a}=e;return zs({root:["root"],container:["container",`scroll${yl(r)}`],paper:["paper",`paperScroll${yl(r)}`,`paperWidth${yl(String(n))}`,o&&"paperFullWidth",a&&"paperFullScreen"]},sh,t)})(O),M=e.useRef(),N=Ru(s),I=e.useMemo((()=>({titleId:N})),[N]),T={slots:{transition:$,...C},slotProps:{transition:_,paper:S,backdrop:u,...j}},[A,D]=Iu("root",{elementType:dh,shouldForwardComponentProp:!0,externalForwardedProps:T,ownerState:O,className:Ns(R.root,p),ref:r}),[F,z]=Iu("backdrop",{elementType:uh,shouldForwardComponentProp:!0,externalForwardedProps:T,ownerState:O}),[L,B]=Iu("paper",{elementType:fh,shouldForwardComponentProp:!0,externalForwardedProps:T,ownerState:O,className:Ns(R.paper,S.className)}),[W,V]=Iu("container",{elementType:ph,externalForwardedProps:T,ownerState:O,className:Ns(R.container)}),[H,U]=Iu("transition",{elementType:op,externalForwardedProps:T,ownerState:O,additionalProps:{appear:!0,in:x,timeout:E,role:"presentation"}});return(0,dt.jsx)(A,{closeAfterTransition:!0,slots:{backdrop:F},slotProps:{backdrop:{transitionDuration:E,as:c,...z}},disableEscapeKeyDown:f,onClose:b,open:x,onClick:e=>{y&&y(e),M.current&&(M.current=null,v&&v(e),b&&b(e,"backdropClick"))},...D,...P,children:(0,dt.jsx)(H,{...U,children:(0,dt.jsx)(W,{onMouseDown:e=>{M.current=e.target===e.currentTarget},...V,children:(0,dt.jsx)(L,{as:w,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":N,"aria-modal":l,...B,children:(0,dt.jsx)(ch.Provider,{value:I,children:d})})})})})})),mh=hh;function gh(e){return vu("MuiDialogTitle",e)}const vh=yu("MuiDialogTitle",["root"]),yh=dl(vf,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),bh=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiDialogTitle"}),{className:o,id:a,...i}=n,s=n,l=(e=>{const{classes:t}=e;return zs({root:["root"]},gh,t)})(s),{titleId:c=a}=e.useContext(ch);return(0,dt.jsx)(yh,{component:"h2",className:Ns(l.root,o),ownerState:s,ref:r,variant:"h6",id:a??c,...i})})),xh=bh;function wh(e){return vu("MuiDialogContent",e)}yu("MuiDialogContent",["root","dividers"]);const Sh=dl("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dividers&&t.dividers]}})(gl((e=>{let{theme:t}=e;return{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:e=>{let{ownerState:t}=e;return t.dividers},style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return!t.dividers},style:{[`.${vh.root} + &`]:{paddingTop:0}}}]}}))),kh=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiDialogContent"}),{className:n,dividers:o=!1,...a}=r,i={...r,dividers:o},s=(e=>{const{classes:t,dividers:r}=e;return zs({root:["root",r&&"dividers"]},wh,t)})(i);return(0,dt.jsx)(Sh,{className:Ns(s.root,n),ownerState:i,ref:t,...a})})),Ch=kh;function jh(e){return vu("MuiButton",e)}const $h=yu("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);const Eh=e.createContext({});const _h=e.createContext(void 0),Ph=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Oh=dl(hd,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${yl(r.color)}`],t[`size${yl(r.size)}`],t[`${r.variant}Size${yl(r.size)}`],"inherit"===r.color&&t.colorInherit,r.disableElevation&&t.disableElevation,r.fullWidth&&t.fullWidth,r.loading&&t.loading]}})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?t.palette.grey[300]:t.palette.grey[800],n="light"===t.palette.mode?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${$h.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${$h.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${$h.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${$h.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:No(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity)}}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:r,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${$h.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${$h.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${$h.loading}`]:{color:"transparent"}}}]}}))),Rh=dl("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.startIcon,r.loading&&t.startIconLoadingStart,t[`iconSize${yl(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Ph]}})),Mh=dl("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.endIcon,r.loading&&t.endIconLoadingEnd,t[`iconSize${yl(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Ph]}})),Nh=dl("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(t.vars||t).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]}})),Ih=dl("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Th=e.forwardRef((function(t,r){const n=e.useContext(Eh),o=e.useContext(_h),a=vl({props:qr(n,t),name:"MuiButton"}),{children:i,color:s="primary",component:l="button",className:c,disabled:u=!1,disableElevation:d=!1,disableFocusRipple:p=!1,endIcon:f,focusVisibleClassName:h,fullWidth:m=!1,id:g,loading:v=null,loadingIndicator:y,loadingPosition:b="center",size:x="medium",startIcon:w,type:S,variant:k="text",...C}=a,j=Mu(g),$=y??(0,dt.jsx)(jd,{"aria-labelledby":j,color:"inherit",size:16}),E={...a,color:s,component:l,disabled:u,disableElevation:d,disableFocusRipple:p,fullWidth:m,loading:v,loadingIndicator:$,loadingPosition:b,size:x,type:S,variant:k},_=(e=>{const{color:t,disableElevation:r,fullWidth:n,size:o,variant:a,loading:i,loadingPosition:s,classes:l}=e,c=zs({root:["root",i&&"loading",a,`${a}${yl(t)}`,`size${yl(o)}`,`${a}Size${yl(o)}`,`color${yl(t)}`,r&&"disableElevation",n&&"fullWidth",i&&`loadingPosition${yl(s)}`],startIcon:["icon","startIcon",`iconSize${yl(o)}`],endIcon:["icon","endIcon",`iconSize${yl(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},jh,l);return{...l,...c}})(E),P=(w||v&&"start"===b)&&(0,dt.jsx)(Rh,{className:_.startIcon,ownerState:E,children:w||(0,dt.jsx)(Ih,{className:_.loadingIconPlaceholder,ownerState:E})}),O=(f||v&&"end"===b)&&(0,dt.jsx)(Mh,{className:_.endIcon,ownerState:E,children:f||(0,dt.jsx)(Ih,{className:_.loadingIconPlaceholder,ownerState:E})}),R=o||"",M="boolean"===typeof v?(0,dt.jsx)("span",{className:_.loadingWrapper,style:{display:"contents"},children:v&&(0,dt.jsx)(Nh,{className:_.loadingIndicator,ownerState:E,children:$})}):null;return(0,dt.jsxs)(Oh,{ownerState:E,className:Ns(n.className,_.root,c,R),component:l,disabled:u||v,focusRipple:!p,focusVisibleClassName:Ns(_.focusVisible,h),ref:r,type:S,id:v?j:g,...C,classes:_,children:[P,"end"!==b&&M,i,"end"===b&&M,O]})})),Ah=Th;function Dh(e){let{open:t,title:r,message:n,onConfirm:o,onCancel:a}=e;return(0,dt.jsxs)(mh,{open:t,children:[(0,dt.jsx)(xh,{gap:"20px",children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h4",{style:{margin:0},children:r})]})}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",margin:"0",marginBottom:"20px",maxHeight:"350px",maxWidth:"350px"},children:(0,dt.jsx)("p",{style:{flex:1,margin:"0"},children:n})}),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around"},children:[(0,dt.jsx)(Ah,{onClick:e=>{tM&&console.log("Confirmed"),e.preventDefault(),o()},variant:"contained",color:"primary",size:"small",children:"Confirm"}),(0,dt.jsx)(Ah,{onClick:e=>{tM&&console.log("Canceled"),e.preventDefault(),a()},variant:"contained",color:"primary",size:"small",children:"Cancel"})]})]})]})}const Fh=(0,e.createContext)();function zh(t){let{children:r}=t;const{enqueueSnackbar:n,closeSnackbar:o}=Rs(),a=(0,e.useCallback)(((e,t,r)=>{tM&&console.log(`UiProvider showSnackbarMessage: message ${e} timeout ${t}`),n(e,{variant:"default",autoHideDuration:null===t||void 0===t||t>0?1e3*(null!==t&&void 0!==t?t:5):null,persist:0===t,dense:!0,content:t=>(0,dt.jsx)(Uf,{sx:{margin:"0",padding:"0",width:"300px",marginRight:"30px"},children:(0,dt.jsx)(ah,{severity:null!==r&&void 0!==r?r:"info",variant:"filled",sx:{color:"#fff",fontWeight:"normal",width:"100%",cursor:"pointer",padding:"2px 10px"},onClick:()=>o(t),action:(0,dt.jsx)(Rd,{size:"small",onClick:()=>o(t),sx:{color:"#fff"},children:(0,dt.jsx)(ih,{fontSize:"small"})}),children:e},t)},t)})}),[]),[i,s]=(0,e.useState)(!1),[l,c]=(0,e.useState)(""),[u,d]=(0,e.useState)(""),[p,f]=(0,e.useState)(""),h=(0,e.useRef)(null),m=(0,e.useRef)(null),g=(0,e.useCallback)(((e,t,r,n,o)=>{tM&&console.log(`UiProvider showConfirmCancelDialog for command ${r}`),c(e),d(t),f(r),h.current=n,m.current=o,s(!0)}),[]),v=(0,e.useMemo)((()=>({showSnackbarMessage:a,closeSnackbar:o,showConfirmCancelDialog:g})),[a]);return(0,dt.jsxs)(Fh.Provider,{value:v,children:[(0,dt.jsx)(Dh,{open:i,title:l,message:u,onConfirm:()=>{tM&&console.log(`UiProvider handle confirm action ${p}`),s(!1),h.current&&h.current(p)},onCancel:()=>{tM&&console.log(`UiProvider handle cancel action ${p}`),s(!1),m.current&&m.current(p)}}),r]})}const Lh=0,Bh=1,Wh=2,Vh=3,Hh=4,Uh=6,qh=100,Gh=101,Kh=(0,e.createContext)(),Qh=(0,e.createContext)();function Jh(t){var r,n;let{children:o}=t;const[a,i]=(0,e.useState)(null!==(r=localStorage.getItem("logFilterLevel"))&&void 0!==r?r:"info"),[s,l]=(0,e.useState)(null!==(n=localStorage.getItem("logFilterSearch"))&&void 0!==n?n:"*"),[c,u]=(0,e.useState)([]),[d,p]=(0,e.useState)(1e3),[f,h]=(0,e.useState)(!0),[m,g]=(0,e.useState)(!1),{showSnackbarMessage:v,closeSnackbar:y}=(0,e.useContext)(Fh),b=(0,e.useRef)([]),x=(0,e.useRef)(null),w=(0,e.useRef)(1),S=(0,e.useRef)(Math.floor(999e3*Math.random())+1e3),k=(0,e.useRef)(null),C=(0,e.useRef)(null),j=(0,e.useRef)(null),$=(0,e.useRef)(a),E=(0,e.useRef)(s),_=(0,e.useMemo)((()=>window.location.href.replace(/^http/,"ws")),[]),P=(0,e.useMemo)((()=>window.location.href.includes("api/hassio_ingress")),[]),O=100;(0,e.useEffect)((()=>{$.current=a}),[a]),(0,e.useEffect)((()=>{E.current=s}),[s]);const R=(0,e.useCallback)((()=>Math.floor(999e3*Math.random())+1e3),[]),M=(0,e.useCallback)((e=>{if(x.current&&x.current.readyState===WebSocket.OPEN)try{void 0===e.id&&(e.id=S.current);const t=JSON.stringify(e);x.current.send(t),tM&&console.log("WebSocket sent message:",e)}catch(t){tM&&console.error(`WebSocket error sending message: ${t}`)}else tM&&console.error("WebSocket message not sent, WebSocket not connected:",e)}),[]),N=(0,e.useCallback)(((e,t)=>{const r=`<span style="background-color: #5c0e91; color: white; padding: 1px 5px; font-size: 12px; border-radius: 3px;">${e}</span>`;u((e=>[...e,r+' <span style="color: var(--main-log-color);">'+t+"</span>"]))}),[]),I=(0,e.useCallback)(((e,t)=>{i(e),l(t),N("WebSocket",`Filtering by log level "${e}" and log search "${t}"`)}),[N]),T=(0,e.useCallback)((e=>{tM&&console.log("WebSocket addListener:",e),b.current=[...b.current,e],tM&&console.log("WebSocket addListener total listeners:",b.current.length)}),[]),A=(0,e.useCallback)((e=>{tM&&console.log("WebSocket removeListener:",e),b.current=b.current.filter((t=>t!==e)),tM&&console.log("WebSocket removeListener total listeners:",b.current.length)}),[]),D=(0,e.useCallback)((()=>{""!==_&&null!==_&&void 0!==_&&(N("WebSocket",`Connecting to WebSocket: ${_}`),x.current=new WebSocket(_),x.current.onmessage=e=>{m||g(!0);try{const t=JSON.parse(e.data);if(t.error&&tM&&console.error("WebSocket error message:",t),void 0===t.id)return;if(t.id===Bh)return tM&&console.log("WebSocket WS_ID_REFRESH_NEEDED message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Wh)return tM&&console.log("WebSocket WS_ID_RESTART_NEEDED message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Vh)return tM&&console.log("WebSocket WS_ID_CPU_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Hh)return tM&&console.log("WebSocket WS_ID_MEMORY_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Uh)return tM&&console.log("WebSocket WS_ID_SNACKBAR message:",t,"listeners:",b.current.length),void v(t.params.message,t.params.timeout,t.params.severity);if(t.id===qh)return tM&&console.log("WebSocket WS_ID_SHELLY_SYS_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Gh)return tM&&console.log("WebSocket WS_ID_SHELLY_MAIN_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===S.current&&"Matterbridge"===t.src&&"Frontend"===t.dst&&"pong"===t.response)return tM&&console.log("WebSocket pong response message:",t,"listeners:",b.current.length),clearTimeout(C.current),void b.current.forEach((e=>e(t)));if(t.id!==Lh)return tM&&console.log("WebSocket message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id!==Lh||!t.level||!t.time||!t.name||!t.message)return;if(["debug","info","notice","warn","error","fatal"].includes(t.level)){if("info"===$.current&&"debug"===t.level)return;if("notice"===$.current&&("debug"===t.level||"info"===t.level))return;if("warn"===$.current&&("debug"===t.level||"info"===t.level||"notice"===t.level))return;if("error"===$.current&&("debug"===t.level||"info"===t.level||"notice"===t.level||"warn"===t.level))return;if("fatal"===$.current&&("debug"===t.level||"info"===t.level||"notice"===t.level||"warn"===t.level||"error"===t.level))return}if("*"!==E.current&&""!==E.current&&!t.message.toLowerCase().includes(E.current.toLowerCase())&&!t.name.toLowerCase().includes(E.current.toLowerCase()))return;if("Commissioning"===t.name&&t.message.includes("is uncommissioned"))return;u((e=>{const r=`<span style="color: #505050;">[${t.time}]</span>`,n=`<span style="background-color: ${(e=>{switch(e.toLowerCase()){case"debug":return"gray";case"info":return"#267fb7";case"notice":return"green";case"warn":return"#e9db18";case"error":return"red";case"fatal":return"#ff0000";case"spawn":return"#ff00d0";default:return"lightblue"}})(t.level)}; color: ${o=t.level,"warn"===o.toLowerCase()?"black":"white"}; padding: 1px 5px; font-size: 12px; border-radius: 3px;">${t.level}</span>`;var o;const a=[...e,`${n} ${r} <span style="color: #09516d;">[${t.name}]</span> <span style="color: var(--main-log-color);">${t.message}</span>`];return a.length>d?a.slice(d/10):a}))}catch(t){console.error(`WebSocketUse error parsing message: ${t}`)}},x.current.onopen=()=>{tM&&console.log(`WebSocket: Connected to WebSocket: ${_}`),N("WebSocket",`Connected to WebSocket: ${_}`),g(!0),y(),w.current=1,j.current=setTimeout((()=>{k.current=setInterval((()=>{M({id:S.current,method:"ping",src:"Frontend",dst:"Matterbridge",params:{}}),clearTimeout(C.current),C.current=setTimeout((()=>{tM&&console.error(`WebSocketUse: No pong response received from WebSocket: ${_}`),N("WebSocket",`No pong response received from WebSocket: ${_}`),g(!1)}),5e4)}),6e4)}),3e5)},x.current.onclose=()=>{tM&&console.error(`WebSocket: Disconnected from WebSocket: ${_}`),N("WebSocket",`Disconnected from WebSocket: ${_}`),g(!1),y(),clearTimeout(j.current),clearTimeout(C.current),clearInterval(k.current),N("WebSocket",`Reconnecting (attempt ${w.current} of 100) to WebSocket${P?" (Ingress)":""}: ${_}`),w.current<O?setTimeout(F,(P?2e4:1e3)*w.current):N("WebSocket",`Reconnect attempts exceeded limit of 100 retries, refresh the page to reconnect to: ${_}`),w.current=w.current+1},x.current.onerror=e=>{tM&&console.error(`WebSocket: WebSocket error connecting to ${_}:`,e),N("WebSocket",`WebSocket error connecting to ${_}`)})}),[_]),F=(0,e.useCallback)((()=>{tM&&console.log(`WebSocket attemptReconnect ${w.current}/100 to:`,_),D()}),[D]);(0,e.useEffect)((()=>(D(),()=>{x.current&&x.current.readyState===WebSocket.OPEN&&x.current.close()})),[D]);const z=(0,e.useMemo)((()=>({messages:c,maxMessages:d,autoScroll:f,setMessages:u,setLogFilters:I,setMaxMessages:p,setAutoScroll:h})),[c,u,I]),L=(0,e.useMemo)((()=>({maxMessages:d,autoScroll:f,logFilterLevel:a,logFilterSearch:s,setMessages:u,setLogFilters:I,setMaxMessages:p,setAutoScroll:h,online:m,getUniqueId:R,addListener:T,removeListener:A,sendMessage:M,logMessage:N})),[d,f,u,I,p,h,m,T,A,M,N]);return(0,dt.jsx)(Kh.Provider,{value:z,children:(0,dt.jsx)(Qh.Provider,{value:L,children:o})})}const Yh=function(){const{showSnackbarMessage:t,showConfirmCancelDialog:r}=(0,e.useContext)(Fh),{online:n,sendMessage:o,logMessage:a,addListener:i,removeListener:s,getUniqueId:l}=(0,e.useContext)(Qh),[c,u]=(0,e.useState)(!1),[d,p]=(0,e.useState)(!1),[f,h]=(0,e.useState)(null),m=(0,e.useRef)(l()),[g,v]=(0,e.useState)(null),[y,b]=(0,e.useState)(null),[x,w]=(0,e.useState)(null),[S,k]=(0,e.useState)(null),C=()=>{window.open("https://github.com/Luligu/matterbridge/blob/main/CHANGELOG.md","_blank")},j=()=>{o({id:m.current,method:"/api/install",src:"Frontend",dst:"Matterbridge",params:{packageName:"matterbridge",restart:!0}})},$=()=>{tM&&console.log("Header: handleShellySystemUpdateClick"),a("Matterbridge","Installing system updates..."),o({id:m.current,method:"/api/shellysysupdate",src:"Frontend",dst:"Matterbridge",params:{}})},E=()=>{tM&&console.log("Header: handleShellyMainUpdateClick"),a("Matterbridge","Installing software updates..."),o({id:m.current,method:"/api/shellymainupdate",src:"Frontend",dst:"Matterbridge",params:{}})},_=()=>{""===f.matterbridgeInformation.restartMode?o({id:m.current,method:"/api/restart",src:"Frontend",dst:"Matterbridge",params:{}}):o({id:m.current,method:"/api/shutdown",src:"Frontend",dst:"Matterbridge",params:{}})},P=()=>{o({id:m.current,method:"/api/shutdown",src:"Frontend",dst:"Matterbridge",params:{}})},O=e=>{tM&&console.log("Header: handleMenuClose",e),v(null),"download-mblog"===e?(a("Matterbridge","Downloading matterbridge log..."),t("Downloading matterbridge log...",5),window.location.href="./api/download-mblog"):"download-mjlog"===e?(a("Matterbridge","Downloading matter log..."),t("Downloading matter log...",5),window.location.href="./api/download-mjlog"):"download-mbstorage"===e?(a("Matterbridge","Downloading matterbridge storage..."),t("Downloading matterbridge storage...",5),window.location.href="./api/download-mbstorage"):"download-pluginstorage"===e?(a("Matterbridge","Downloading matterbridge plugins storage..."),t("Downloading matterbridge plugins storage...",5),window.location.href="./api/download-pluginstorage"):"download-pluginconfig"===e?(a("Matterbridge","Downloading matterbridge plugins config..."),t("Downloading matterbridge plugins config...",5),window.location.href="./api/download-pluginconfig"):"download-mjstorage"===e?(a("Matterbridge","Downloading matter storage..."),t("Downloading matter storage...",5),window.location.href="./api/download-mjstorage"):"download-backup"===e?(a("Matterbridge","Downloading backup..."),t("Downloading backup...",10),window.location.href="./api/download-backup"):"update"===e?j():"shelly-sys-update"===e?$():"shelly-main-update"===e?E():"shelly-create-system-log"===e?(tM&&console.log("Header: handleShellyCreateSystemLog"),o({id:m.current,method:"/api/shellycreatesystemlog",src:"Frontend",dst:"Matterbridge",params:{}})):"shelly-download-system-log"===e?(tM&&console.log("Header: handleShellyDownloadSystemLog"),a("Matterbridge","Downloading Shelly system log..."),t("Downloading Shelly system log...",5),window.location.href="./api/shellydownloadsystemlog"):"softreset"===e?o({id:m.current,method:"/api/softreset",src:"Frontend",dst:"Matterbridge",params:{}}):"hardreset"===e?o({id:m.current,method:"/api/hardreset",src:"Frontend",dst:"Matterbridge",params:{}}):"restart"===e?_():"shutdown"===e?P():"reboot"===e?o({id:m.current,method:"/api/reboot",src:"Frontend",dst:"Matterbridge",params:{}}):"startshare"===e?o({id:m.current,method:"/api/advertise",src:"Frontend",dst:"Matterbridge",params:{}}):"stopshare"===e?o({id:m.current,method:"/api/stopadvertise",src:"Frontend",dst:"Matterbridge",params:{}}):"create-backup"===e?(a("Matterbridge","Creating backup..."),t("Creating backup...",10),Bf("backup","create")):"unregister"===e?(a("Matterbridge","Uregistering all bridged devices..."),t("Uregistering all bridged devices...",10),Bf("unregister","now")):"reset"===e?(a("Matterbridge","Resetting matterbridge commissioning..."),t("Resetting matterbridge commissioning...",10),Bf("reset","now")):"factoryreset"===e&&(a("Matterbridge","Factory reset of matterbridge..."),t("Factory reset of matterbridge...",10),Bf("factoryreset","now"))},R=e=>{tM&&console.log("Header: handleMenuCloseCancel:",e),v(null)},M=()=>{b(null)},N=()=>{w(null)},I=()=>{k(null)};return(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&(e.id===m.current&&"/api/settings"===e.method&&(tM&&console.log("Header received settings:",e.response),h(e.response),u(e.response.matterbridgeInformation.restartRequired),p(e.response.matterbridgeInformation.updateRequired)),"refresh_required"===e.method&&(null!==e.params.changed&&"matterbridgeLatestVersion"!==e.params.changed&&"fabrics"!==e.params.changed||(tM&&console.log(`Header received refresh_required: changed=${e.params.changed}`),o({id:m.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))),"restart_required"===e.method&&(tM&&console.log("Header received restart_required"),u(!0)),"update_required"===e.method&&(tM&&console.log("Header received update_required"),p(!0)),e.id===qh&&(tM&&console.log("Header received WS_ID_SHELLY_SYS_UPDATE:"),h((t=>({...t,matterbridgeInformation:{...t.matterbridgeInformation,shellySysUpdate:e.params.available}})))),e.id===Gh&&(tM&&console.log("Header received WS_ID_SHELLY_MAIN_UPDATE:"),h((t=>({...t,matterbridgeInformation:{...t.matterbridgeInformation,shellyMainUpdate:e.params.available}})))))};return i(e),tM&&console.log(`Header added WebSocket listener id ${m.current}`),()=>{s(e),tM&&console.log("Header removed WebSocket listener")}}),[i,s,o,t]),(0,e.useEffect)((()=>{n&&(tM&&console.log("Header sending /api/settings requests"),o({id:m.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))}),[n,o]),tM&&console.log("Header rendering..."),n&&f?(0,dt.jsxs)("div",{className:"header",children:[(0,dt.jsxs)("div",{className:"sub-header",children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"30px"},onClick:()=>{rM(),tM&&console.log("Matterbridge logo clicked: debug is now",tM)}}),(0,dt.jsx)("h2",{style:{fontSize:"22px",color:"var(--main-icon-color)",margin:"0px"},children:"Matterbridge"}),(0,dt.jsxs)("nav",{children:[(0,dt.jsx)(et,{to:"/",className:"nav-link",children:"Home"}),(0,dt.jsx)(et,{to:"/devices",className:"nav-link",children:"Devices"}),(0,dt.jsx)(et,{to:"/log",className:"nav-link",children:"Logs"}),(0,dt.jsx)(et,{to:"/settings",className:"nav-link",children:"Settings"})]})]}),(0,dt.jsxs)("div",{className:"sub-header",children:[f.matterbridgeInformation&&!f.matterbridgeInformation.readOnly&&(0,dt.jsx)(Uu,{title:"Sponsor Matterbridge and its plugins",children:(0,dt.jsx)("span",{className:"status-sponsor",onClick:()=>{window.open("https://www.buymeacoffee.com/luligugithub","_blank")},children:"Sponsor"})}),!f.matterbridgeInformation.readOnly&&!d&&(0,dt.jsx)(Uu,{title:"Matterbridge version",children:(0,dt.jsxs)("span",{className:"status-information",onClick:C,children:["v.",f.matterbridgeInformation.matterbridgeVersion]})}),!f.matterbridgeInformation.readOnly&&d&&(0,dt.jsx)(Uu,{title:"New Matterbridge version available, click to install",children:(0,dt.jsxs)("span",{className:"status-warning",onClick:j,children:["Update v.",f.matterbridgeInformation.matterbridgeVersion," to v.",f.matterbridgeInformation.matterbridgeLatestVersion]})}),f.matterbridgeInformation.shellyBoard&&(0,dt.jsx)("img",{src:"Shelly.svg",alt:"Shelly Icon",style:{height:"30px",padding:"0px",margin:"0px",marginRight:"30px"}}),f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.xxxmatterbridgeVersion&&(0,dt.jsx)(Uu,{title:"Matterbridge version",children:(0,dt.jsxs)("span",{style:{fontSize:"12px",color:"var(--main-icon-color)"},onClick:C,children:["v.",f.matterbridgeInformation.matterbridgeVersion]})}),""!==f.matterbridgeInformation.bridgeMode&&!1===f.matterbridgeInformation.readOnly?(0,dt.jsx)(Uu,{title:"Bridge mode",children:(0,dt.jsx)("span",{className:"status-information",style:{cursor:"default"},children:f.matterbridgeInformation.bridgeMode})}):null,""!==f.matterbridgeInformation.restartMode&&!1===f.matterbridgeInformation.readOnly?(0,dt.jsx)(Uu,{title:"Restart mode",children:(0,dt.jsx)("span",{className:"status-information",style:{cursor:"default"},children:f.matterbridgeInformation.restartMode})}):null]}),(0,dt.jsxs)("div",{className:"sub-header",style:{gap:"5px"},children:[(0,dt.jsx)(Uu,{title:"Matterbridge help",children:(0,dt.jsx)(Rd,{onClick:()=>{window.open("https://github.com/Luligu/matterbridge/blob/main/README.md","_blank")},children:(0,dt.jsx)(Af,{style:{color:"var(--main-icon-color)"}})})}),(0,dt.jsx)(Uu,{title:"Matterbridge changelog",children:(0,dt.jsx)(Rd,{onClick:C,children:(0,dt.jsx)(Df,{style:{color:"var(--main-icon-color)"}})})}),f.matterbridgeInformation&&!f.matterbridgeInformation.readOnly&&(0,dt.jsx)(Uu,{title:"Update matterbridge",children:(0,dt.jsx)(Rd,{style:{color:d?"var(--primary-color)":"var(--main-icon-color)"},onClick:j,children:(0,dt.jsx)(Of,{})})}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellySysUpdate&&(0,dt.jsx)(Uu,{title:"Shelly system update",children:(0,dt.jsx)(Rd,{style:{color:"var(--primary-color)"},onClick:$,children:(0,dt.jsx)(Of,{})})}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellyMainUpdate&&(0,dt.jsx)(Uu,{title:"Shelly software update",children:(0,dt.jsx)(Rd,{style:{color:"var(--primary-color)"},onClick:E,children:(0,dt.jsx)(Of,{})})}),(0,dt.jsx)(Uu,{title:"Restart matterbridge",children:(0,dt.jsx)(Rd,{style:{color:c?"var(--primary-color)":"var(--main-icon-color)"},onClick:_,children:(0,dt.jsx)(Rf,{})})}),""===f.matterbridgeInformation.restartMode?(0,dt.jsx)(Uu,{title:"Shut down matterbridge",children:(0,dt.jsx)(Rd,{style:{color:c?"var(--primary-color)":"var(--main-icon-color)"},onClick:P,children:(0,dt.jsx)(Mf,{})})}):null,(0,dt.jsx)(Uu,{title:"Download, backup and more",children:(0,dt.jsx)(Rd,{onClick:e=>{v(e.currentTarget)},children:(0,dt.jsx)(Nf,{style:{color:"var(--main-icon-color)"}})})}),(0,dt.jsxs)(Hp,{id:"command-menu",anchorEl:g,keepMounted:!0,open:Boolean(g),onClose:()=>O(""),children:[f.matterbridgeInformation&&!f.matterbridgeInformation.readOnly&&(0,dt.jsxs)(tf,{onClick:()=>O("update"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Of,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Update",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellySysUpdate&&(0,dt.jsxs)(tf,{onClick:()=>O("shelly-sys-update"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Of,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Shelly system update",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellyMainUpdate&&(0,dt.jsxs)(tf,{onClick:()=>O("shelly-main-update"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Of,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Shelly software update",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>O("restart"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Rf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Restart",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),""===f.matterbridgeInformation.restartMode?(0,dt.jsxs)(tf,{onClick:()=>O("shutdown"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Shutdown",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}):null,f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{r("Reboot","Are you sure you want to reboot the Shelly board?","reboot",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Rf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reboot...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),!0===f.matterbridgeInformation.matterbridgePaired&&!1===f.matterbridgeInformation.matterbridgeAdvertise?(0,dt.jsxs)(tf,{onClick:()=>O("startshare"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(zf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Share fabrics",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}):null,!0===f.matterbridgeInformation.matterbridgeAdvertise?(0,dt.jsxs)(tf,{onClick:()=>O("stopshare"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Lf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Stop sharing",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}):null,(0,dt.jsx)(Cf,{}),(0,dt.jsxs)(tf,{onClick:e=>{w(e.currentTarget)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Download",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(Hp,{id:"sub-menu-download",anchorEl:x,keepMounted:!0,open:Boolean(x),onClose:N,sx:{"& .MuiPaper-root":{backgroundColor:"#e2e2e2"}},children:[(0,dt.jsxs)(tf,{onClick:()=>{O("download-mbstorage"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge storage",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-pluginstorage"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge plugins storage",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-pluginconfig"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge plugins config",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-mblog"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-mjstorage"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matter storage",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-mjlog"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matter log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{O("shelly-create-system-log"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Create Shelly system log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{O("shelly-download-system-log"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Download Shelly system log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]})]}),(0,dt.jsx)(Cf,{}),(0,dt.jsxs)(tf,{onClick:e=>{b(e.currentTarget)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(If,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Backup",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(Hp,{id:"sub-menu-backup",anchorEl:y,keepMounted:!0,open:Boolean(y),onClose:M,sx:{"& .MuiPaper-root":{backgroundColor:"#e2e2e2"}},children:[(0,dt.jsxs)(tf,{onClick:()=>{O("create-backup"),M()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(If,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Create backup",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-backup"),M()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(If,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Download backup",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]})]}),(0,dt.jsx)(Cf,{}),(0,dt.jsxs)(tf,{onClick:e=>{k(e.currentTarget)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Ff,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(Hp,{id:"sub-menu-reset",anchorEl:S,keepMounted:!0,open:Boolean(S),onClose:I,sx:{"& .MuiPaper-root":{backgroundColor:"#e2e2e2"}},children:[(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Reset all devices and shutdown","Are you sure you want to unregister all devices? This will temporarily remove all devices from the controller and you may loose the controller configuration.","unregister",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset all devices...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Reset commissioning and shutdown","Are you sure you want to reset the commissioning? You will have to manually remove Matterbridge from the controller.","reset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset commissioning...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),!f.matterbridgeInformation.readOnly&&(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Factory reset and shutdown","Are you sure you want to factory reset Matterbridge? You will have to manually remove Matterbridge from the controller.","factoryreset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Factory reset...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Network reset","Are you sure you want to factory reset the network parameters?","softreset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset network...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Factory reset","Are you sure you want to factory reset Matterbridge? You will have to manually remove Matterbridge from the controller.","hardreset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Factory reset...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]})]})]})]})]}):null},Xh=Pf((0,dt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),Zh=()=>{let e=!1;return("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(e=!0),e};function em(){const{messages:t,autoScroll:r}=(0,e.useContext)(Kh),[n,o]=(0,e.useState)(!1),a=(0,e.useRef)(null);return(0,e.useEffect)((()=>{!r||n||Zh()||a.current.scrollIntoView({behavior:"smooth"})}),[t,n,r]),(0,dt.jsx)("div",{style:{margin:"0px",padding:"0px"},children:(0,dt.jsxs)("ul",{style:{margin:"0px",padding:"0px"},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.map(((e,t)=>(0,dt.jsx)("li",{style:{wordWrap:"break-word",maxHeight:"200px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:e}},t))),(0,dt.jsx)("div",{ref:a})," "]})})}function tm(){return(0,dt.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:"20px",flexDirection:"column",color:"var(--main-text-color)",height:"100vh",backgroundColor:"var(--main-bg-color)"},children:(0,dt.jsxs)(Uf,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[(0,dt.jsx)(jd,{style:{color:"var(--primary-color)"}}),(0,dt.jsx)("div",{style:{marginTop:"20px",color:"var(--primary-color)"},children:"Connecting to Matterbridge..."})]})})}function rm(e){let{value:t,maxChars:r}=e,n=t;if(t.length>r&&r>3){const e=r-3;n=`${t.substring(0,Math.ceil(e/2))} \u2026 ${t.substring(t.length-Math.floor(e/2),t.length)}`}return t!==n?(0,dt.jsx)(Uu,{title:t,placement:"top",PopperProps:{modifiers:[{name:"offset",options:{offset:[0,12]}}]},children:(0,dt.jsx)("span",{children:n})}):(0,dt.jsx)("span",{children:n})}function nm(t){let{systemInfo:r,compact:n}=t;const[o,a]=(0,e.useState)(r),{sendMessage:i,addListener:s,removeListener:l}=(0,e.useContext)(Qh);if(tM&&console.log("SystemInfoTable:",o,"compact:",n),n&&o.totalMemory){const e=o.totalMemory,t=o.freeMemory;o.freeMemory=`${t} / ${e}`,delete o.totalMemory}if(n&&o.heapTotal){const e=o.heapTotal,t=o.heapUsed;o.heapUsed=`${t} / ${e}`,delete o.heapTotal}if(n&&o.osRelease){const e=o.osType,t=o.osRelease;o.osType=`${e} (${t})`,delete o.osRelease}if(n&&o.osArch){const e=o.osPlatform,t=o.osArch;o.osPlatform=`${e} (${t})`,delete o.osArch}return(0,e.useEffect)((()=>{tM&&console.log("SystemInfoTable useEffect WebSocketMessage mounting");const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst?("memory_update"===e.method&&e.params&&e.params.totalMemory&&e.params.freeMemory&&(tM&&console.log("SystemInfoTable received memory_update",e),a((t=>({...t,totalMemory:e.params.totalMemory,freeMemory:e.params.freeMemory,heapTotal:e.params.heapTotal,heapUsed:e.params.heapUsed,rss:e.params.rss})))),"cpu_update"===e.method&&e.params&&e.params.cpuUsage&&(tM&&console.log("SystemInfoTable received cpu_update",e),a((t=>({...t,cpuUsage:e.params.cpuUsage.toFixed(2)+" %"})))),"uptime_update"===e.method&&e.params&&e.params.systemUptime&&e.params.processUptime&&(tM&&console.log("SystemInfoTable received uptime_update",e),a((t=>({...t,systemUptime:e.params.systemUptime,processUptime:e.params.processUptime}))))):tM&&console.log("Test received WebSocketMessage:",e.method,e.src,e.dst,e.response)};return s(e),tM&&console.log("SystemInfoTable useEffect WebSocketMessage mounted"),()=>{tM&&console.log("SystemInfoTable useEffect WebSocketMessage unmounting"),l(e),tM&&console.log("SystemInfoTable useEffect WebSocketMessage unmounted")}}),[s,l,i]),o?(tM&&console.log("SystemInfoTable rendering..."),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{minWidth:"302px",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"System Information"})}),(0,dt.jsx)("div",{className:"MbfWindowDivTable",children:(0,dt.jsx)("table",{style:{border:"none",borderCollapse:"collapse"},children:(0,dt.jsx)("tbody",{style:{border:"none",borderCollapse:"collapse"},children:Object.entries(o).map(((e,t)=>{let[r,n]=e;return(0,dt.jsxs)("tr",{className:t%2===0?"table-content-even":"table-content-odd",style:{border:"none",borderCollapse:"collapse"},children:[(0,dt.jsx)("td",{style:{border:"none",borderCollapse:"collapse"},children:r}),(0,dt.jsx)("td",{style:{border:"none",borderCollapse:"collapse"},children:(0,dt.jsx)(rm,{value:"string"!==typeof n?n.toString():n,maxChars:25})})]},r)}))})})})]})):null}var om,am=Object.defineProperty,im=Object.getOwnPropertySymbols,sm=Object.prototype.hasOwnProperty,lm=Object.prototype.propertyIsEnumerable,cm=(e,t,r)=>t in e?am(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,um=(e,t)=>{for(var r in t||(t={}))sm.call(t,r)&&cm(e,r,t[r]);if(im)for(var r of im(t))lm.call(t,r)&&cm(e,r,t[r]);return e},dm=(e,t)=>{var r={};for(var n in e)sm.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&im)for(var n of im(e))t.indexOf(n)<0&&lm.call(e,n)&&(r[n]=e[n]);return r};(e=>{const t=class t{constructor(e,r,n,a){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(a<-1||a>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let i=[];for(let t=0;t<this.size;t++)i.push(!1);for(let t=0;t<this.size;t++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(n);if(this.drawCodewords(s),-1==a){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const r=this.getPenaltyScore();r<e&&(a=t,e=r),this.applyMask(t)}}o(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(r,n){const o=e.QrSegment.makeSegments(r);return t.encodeSegments(o,n)}static encodeBinary(r,n){const o=e.QrSegment.makeBytes(r);return t.encodeSegments([o],n)}static encodeSegments(e,n){let a,s,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:40,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,d=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(!(t.MIN_VERSION<=l&&l<=c&&c<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");for(a=l;;a++){const r=8*t.getNumDataCodewords(a,n),o=i.getTotalBits(e,a);if(o<=r){s=o;break}if(a>=c)throw new RangeError("Data too long")}for(const r of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])d&&s<=8*t.getNumDataCodewords(a,r)&&(n=r);let p=[];for(const t of e){r(t.mode.modeBits,4,p),r(t.numChars,t.mode.numCharCountBits(a),p);for(const e of t.getData())p.push(e)}o(p.length==s);const f=8*t.getNumDataCodewords(a,n);o(p.length<=f),r(0,Math.min(4,f-p.length),p),r(0,(8-p.length%8)%8,p),o(p.length%8==0);for(let t=236;p.length<f;t^=253)r(t,8,p);let h=[];for(;8*h.length<p.length;)h.push(0);return p.forEach(((e,t)=>h[t>>>3]|=e<<7-(7&t))),new t(a,n,h,u)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let n=0;n<t;n++)0==r&&0==n||0==r&&n==t-1||r==t-1&&0==n||this.drawAlignmentPattern(e[r],e[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let r=t;for(let n=0;n<10;n++)r=r<<1^1335*(r>>>9);const a=21522^(t<<10|r);o(a>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,n(a,o));this.setFunctionModule(8,7,n(a,6)),this.setFunctionModule(8,8,n(a,7)),this.setFunctionModule(7,8,n(a,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,n(a,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,n(a,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,n(a,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let r=0;r<12;r++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let r=0;r<18;r++){const e=n(t,r),o=this.size-11+r%3,a=Math.floor(r/3);this.setFunctionModule(o,a,e),this.setFunctionModule(a,o,e)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){const o=Math.max(Math.abs(n),Math.abs(r)),a=e+n,i=t+r;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,1!=Math.max(Math.abs(n),Math.abs(r)))}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){const r=this.version,n=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(r,n))throw new RangeError("Invalid argument");const a=t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r],i=t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r],s=Math.floor(t.getNumRawDataModules(r)/8),l=a-s%a,c=Math.floor(s/a);let u=[];const d=t.reedSolomonComputeDivisor(i);for(let o=0,f=0;o<a;o++){let r=e.slice(f,f+c-i+(o<l?0:1));f+=r.length;const n=t.reedSolomonComputeRemainder(r,d);o<l&&r.push(0),u.push(r.concat(n))}let p=[];for(let t=0;t<u[0].length;t++)u.forEach(((e,r)=>{(t!=c-i||r>=l)&&p.push(e[t])}));return o(p.length==s),p}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let o=0;o<this.size;o++)for(let a=0;a<2;a++){const i=t-a,s=0==(t+1&2)?this.size-1-o:o;!this.isFunction[s][i]&&r<8*e.length&&(this.modules[s][i]=n(e[r>>>3],7-(7&r)),r++)}}o(r==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let n;switch(e){case 0:n=(r+t)%2==0;break;case 1:n=t%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+t)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:n=r*t%2+r*t%3==0;break;case 6:n=(r*t%2+r*t%3)%2==0;break;case 7:n=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&n&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let o=0;o<this.size;o++){let r=!1,n=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[o][i]==r?(n++,5==n?e+=t.PENALTY_N1:n>5&&e++):(this.finderPenaltyAddHistory(n,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][i],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,a)*t.PENALTY_N3}for(let o=0;o<this.size;o++){let r=!1,n=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][o]==r?(n++,5==n?e+=t.PENALTY_N1:n>5&&e++):(this.finderPenaltyAddHistory(n,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[i][o],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,a)*t.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let r=0;r<this.size-1;r++){const n=this.modules[o][r];n==this.modules[o][r+1]&&n==this.modules[o+1][r]&&n==this.modules[o+1][r+1]&&(e+=t.PENALTY_N2)}let r=0;for(const t of this.modules)r=t.reduce(((e,t)=>e+(t?1:0)),r);const n=this.size*this.size,a=Math.ceil(Math.abs(20*r-10*n)/n)-1;return o(0<=a&&a<=9),e+=a*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let r=[6];for(let n=this.size-7;r.length<e;n-=t)r.splice(1,0,n);return r}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return o(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let r=[];for(let t=0;t<e-1;t++)r.push(0);r.push(1);let n=1;for(let o=0;o<e;o++){for(let e=0;e<r.length;e++)r[e]=t.reedSolomonMultiply(r[e],n),e+1<r.length&&(r[e]^=r[e+1]);n=t.reedSolomonMultiply(n,2)}return r}static reedSolomonComputeRemainder(e,r){let n=r.map((e=>0));for(const o of e){const e=o^n.shift();n.push(0),r.forEach(((r,o)=>n[o]^=t.reedSolomonMultiply(r,e)))}return n}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return o(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];function r(e,t,r){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(e>>>n&1)}function n(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}e.QrCode=t;const a=class e{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let n=[];for(const e of t)r(e,8,n);return new e(e.Mode.BYTE,t.length,n)}static makeNumeric(t){if(!e.isNumeric(t))throw new RangeError("String contains non-numeric characters");let n=[];for(let e=0;e<t.length;){const o=Math.min(t.length-e,3);r(parseInt(t.substring(e,e+o),10),3*o+1,n),e+=o}return new e(e.Mode.NUMERIC,t.length,n)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n,o=[];for(n=0;n+2<=t.length;n+=2){let a=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n));a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n+1)),r(a,11,o)}return n<t.length&&r(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)),6,o),new e(e.Mode.ALPHANUMERIC,t.length,o)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let n=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)r(t,8,n);else if(t<16384)r(2,2,n),r(t,14,n);else{if(!(t<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,n),r(t,21,n)}return new e(e.Mode.ECI,0,n)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(const n of e){const e=n.mode.numCharCountBits(t);if(n.numChars>=1<<e)return 1/0;r+=4+e+n.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)"%"!=e.charAt(r)?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=a;e.QrSegment=a})(om||(om={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2);e.Ecc=t})(t=e.QrCode||(e.QrCode={}))})(om||(om={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]);e.Mode=t})(t=e.QrSegment||(e.QrSegment={}))})(om||(om={}));var pm=om,fm={L:pm.QrCode.Ecc.LOW,M:pm.QrCode.Ecc.MEDIUM,Q:pm.QrCode.Ecc.QUARTILE,H:pm.QrCode.Ecc.HIGH},hm=128,mm="L",gm="#FFFFFF",vm="#000000",ym=!1,bm=1,xm=4,wm=0,Sm=.1;function km(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=[];return e.forEach((function(e,n){let o=null;e.forEach((function(a,i){if(!a&&null!==o)return r.push(`M${o+t} ${n+t}h${i-o}v1H${o+t}z`),void(o=null);if(i!==e.length-1)a&&null===o&&(o=i);else{if(!a)return;null===o?r.push(`M${i+t},${n+t} h1v1H${i+t}z`):r.push(`M${o+t},${n+t} h${i+1-o}v1H${o+t}z`)}}))})),r.join("")}function Cm(e,t){return e.slice().map(((e,r)=>r<t.y||r>=t.y+t.h?e:e.map(((e,r)=>(r<t.x||r>=t.x+t.w)&&e))))}function jm(t){let{value:r,level:n,minVersion:o,includeMargin:a,marginSize:i,imageSettings:s,size:l,boostLevel:c}=t,u=e.useMemo((()=>{const e=(Array.isArray(r)?r:[r]).reduce(((e,t)=>(e.push(...pm.QrSegment.makeSegments(t)),e)),[]);return pm.QrCode.encodeSegments(e,fm[n],o,void 0,void 0,c)}),[r,n,o,c]);const{cells:d,margin:p,numCells:f,calculatedImageSettings:h}=e.useMemo((()=>{let e=u.getModules();const t=function(e,t){return null!=t?Math.max(Math.floor(t),0):e?xm:wm}(a,i),r=e.length+2*t,n=function(e,t,r,n){if(null==n)return null;const o=e.length+2*r,a=Math.floor(t*Sm),i=o/t,s=(n.width||a)*i,l=(n.height||a)*i,c=null==n.x?e.length/2-s/2:n.x*i,u=null==n.y?e.length/2-l/2:n.y*i,d=null==n.opacity?1:n.opacity;let p=null;if(n.excavate){let e=Math.floor(c),t=Math.floor(u);p={x:e,y:t,w:Math.ceil(s+c-e),h:Math.ceil(l+u-t)}}return{x:c,y:u,h:l,w:s,excavation:p,opacity:d,crossOrigin:n.crossOrigin}}(e,l,t,s);return{cells:e,margin:t,numCells:r,calculatedImageSettings:n}}),[u,l,s,a,i]);return{qrcode:u,margin:p,cells:d,numCells:f,calculatedImageSettings:h}}var $m=function(){try{(new Path2D).addPath(new Path2D)}catch(Ya){return!1}return!0}(),Em=e.forwardRef((function(t,r){const n=t,{value:o,size:a=hm,level:i=mm,bgColor:s=gm,fgColor:l=vm,includeMargin:c=ym,minVersion:u=bm,boostLevel:d,marginSize:p,imageSettings:f}=n,h=dm(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:m}=h,g=dm(h,["style"]),v=null==f?void 0:f.src,y=e.useRef(null),b=e.useRef(null),x=e.useCallback((e=>{y.current=e,"function"===typeof r?r(e):r&&(r.current=e)}),[r]),[w,S]=e.useState(!1),{margin:k,cells:C,numCells:j,calculatedImageSettings:$}=jm({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:p,imageSettings:f,size:a});e.useEffect((()=>{if(null!=y.current){const e=y.current,t=e.getContext("2d");if(!t)return;let r=C;const n=b.current,o=null!=$&&null!==n&&n.complete&&0!==n.naturalHeight&&0!==n.naturalWidth;o&&null!=$.excavation&&(r=Cm(C,$.excavation));const i=window.devicePixelRatio||1;e.height=e.width=a*i;const c=a/j*i;t.scale(c,c),t.fillStyle=s,t.fillRect(0,0,j,j),t.fillStyle=l,$m?t.fill(new Path2D(km(r,k))):C.forEach((function(e,r){e.forEach((function(e,n){e&&t.fillRect(n+k,r+k,1,1)}))})),$&&(t.globalAlpha=$.opacity),o&&t.drawImage(n,$.x+k,$.y+k,$.w,$.h)}})),e.useEffect((()=>{S(!1)}),[v]);const E=um({height:a,width:a},m);let _=null;return null!=v&&(_=e.createElement("img",{src:v,key:v,style:{display:"none"},onLoad:()=>{S(!0)},ref:b,crossOrigin:null==$?void 0:$.crossOrigin})),e.createElement(e.Fragment,null,e.createElement("canvas",um({style:E,height:a,width:a,ref:x,role:"img"},g)),_)}));Em.displayName="QRCodeCanvas";var _m=e.forwardRef((function(t,r){const n=t,{value:o,size:a=hm,level:i=mm,bgColor:s=gm,fgColor:l=vm,includeMargin:c=ym,minVersion:u=bm,boostLevel:d,title:p,marginSize:f,imageSettings:h}=n,m=dm(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:g,cells:v,numCells:y,calculatedImageSettings:b}=jm({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:f,imageSettings:h,size:a});let x=v,w=null;null!=h&&null!=b&&(null!=b.excavation&&(x=Cm(v,b.excavation)),w=e.createElement("image",{href:h.src,height:b.h,width:b.w,x:b.x+g,y:b.y+g,preserveAspectRatio:"none",opacity:b.opacity,crossOrigin:b.crossOrigin}));const S=km(x,g);return e.createElement("svg",um({height:a,width:a,viewBox:`0 0 ${y} ${y}`,ref:r,role:"img"},m),!!p&&e.createElement("title",null,p),e.createElement("path",{fill:s,d:`M0,0 h${y}v${y}H0z`,shapeRendering:"crispEdges"}),e.createElement("path",{fill:l,d:S,shapeRendering:"crispEdges"}),w)}));function Pm(e){let{matterbridgeInfo:t,plugin:r}=e;var n,o,a,i;return tM&&console.log("QRDiv:",t,r),"bridge"===t.bridgeMode&&!0===t.matterbridgePaired&&!1===t.matterbridgeAdvertise&&t.matterbridgeFabricInformations?(tM&&console.log(`QRDiv: paired ${t.matterbridgePaired}, got ${null===(n=t.matterbridgeFabricInformations)||void 0===n?void 0:n.length} fabrics, got ${null===(o=t.matterbridgeSessionInformations)||void 0===o?void 0:o.length} sessions`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left",overflow:"hidden"},children:"Paired fabrics"})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",children:t.matterbridgeFabricInformations.map(((e,r)=>(0,dt.jsxs)("div",{style:{margin:"0px",padding:"10px",gap:"0px",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",textAlign:"left",fontSize:"14px"},children:[(0,dt.jsxs)("p",{className:"status-blue",style:{margin:"0px 10px 10px 10px",fontSize:"14px",padding:0,color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},children:["Fabric: ",e.fabricIndex]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Vendor: ",e.rootVendorId," ",e.rootVendorName]}),""!==e.label&&(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Label: ",e.label]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Active sessions: ",t.matterbridgeSessionInformations?t.matterbridgeSessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive)).length:"0"," ","subscriptions: ",t.matterbridgeSessionInformations?t.matterbridgeSessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive&&t.numberOfActiveSubscriptions>0)).length:"0"]})]},r)))})]})):"childbridge"===t.bridgeMode&&r&&!0===r.paired&&r.fabricInformations?(tM&&console.log(`QRDiv: paired ${r.paired}, got ${null===(a=r.fabricInformations)||void 0===a?void 0:a.length} fabrics, got ${null===(i=r.sessionInformations)||void 0===i?void 0:i.length} sessions`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"Paired fabrics"})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",children:r.fabricInformations.map(((e,t)=>(0,dt.jsxs)("div",{style:{margin:"0px",padding:"10px",gap:"0px",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",textAlign:"left",fontSize:"14px"},children:[(0,dt.jsxs)("p",{className:"status-blue",style:{margin:"0px 10px 10px 10px",fontSize:"14px",padding:0,color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},children:["Fabric: ",e.fabricIndex]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Vendor: ",e.rootVendorId," ",e.rootVendorName]}),""!==e.label&&(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Label: ",e.label]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Active sessions: ",r.sessionInformations?r.sessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive)).length:"0"," ","subscriptions: ",r.sessionInformations?r.sessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive&&t.numberOfActiveSubscriptions>0)).length:"0"]})]},t)))})]})):"bridge"===t.bridgeMode&&(!1===t.matterbridgePaired||!0===t.matterbridgeAdvertise)&&t.matterbridgeQrPairingCode&&t.matterbridgeManualPairingCode?(tM&&console.log(`QRDiv: qrText ${t.matterbridgeQrPairingCode} pairingText ${t.matterbridgeManualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)(_m,{value:t.matterbridgeQrPairingCode,size:256,level:"M",fgColor:"var(--div-text-color)",bgColor:"var(--div-bg-color)",style:{margin:"20px"}}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,marginTop:"-5px",height:"30px"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:["Manual pairing code: ",t.matterbridgeManualPairingCode]})})]})):"childbridge"===t.bridgeMode&&r&&!1===r.paired&&r.qrPairingCode&&r.manualPairingCode?(tM&&console.log(`QRDiv: qrText ${r.qrPairingCode} pairingText ${r.manualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)(_m,{value:r.qrPairingCode,size:256,level:"M",fgColor:"var(--div-text-color)",bgColor:"var(--div-bg-color)",style:{margin:"20px"}}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,marginTop:"-5px",height:"30px"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:["Manual pairing code: ",r.manualPairingCode]})})]})):"bridge"!==t.bridgeMode||!1!==t.matterbridgePaired||t.matterbridgeQrPairingCode||t.matterbridgeManualPairingCode?"childbridge"!==t.bridgeMode||!r||!1!==r.paired||r.qrPairingCode||r.manualPairingCode?void 0:(tM&&console.log(`QRDiv: qrText ${r.qrPairingCode} pairingText ${r.manualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,marginTop:"-5px",height:"30px"},children:(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:"Restart to generate a new QRCode."})})]})):(tM&&console.log(`QRDiv: qrText ${t.matterbridgeQrPairingCode} pairingText ${t.matterbridgeManualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,marginTop:"-5px",height:"30px"},children:(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:"Restart to generate a new QRCode."})})]}))}function Om(e){return parseInt(e,10)||0}_m.displayName="QRCodeSVG";const Rm={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};const Mm=e.forwardRef((function(t,r){const{onChange:n,maxRows:o,minRows:a=1,style:i,value:s,...l}=t,{current:c}=e.useRef(null!=s),u=e.useRef(null),d=Tl(r,u),p=e.useRef(null),f=e.useRef(null),h=e.useCallback((()=>{const e=u.current,r=f.current;if(!e||!r)return;const n=Bd(e).getComputedStyle(e);if("0px"===n.width)return{outerHeightStyle:0,overflowing:!1};r.style.width=n.width,r.value=e.value||t.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");const i=n.boxSizing,s=Om(n.paddingBottom)+Om(n.paddingTop),l=Om(n.borderBottomWidth)+Om(n.borderTopWidth),c=r.scrollHeight;r.value="x";const d=r.scrollHeight;let p=c;a&&(p=Math.max(Number(a)*d,p)),o&&(p=Math.min(Number(o)*d,p)),p=Math.max(p,d);return{outerHeightStyle:p+("border-box"===i?s+l:0),overflowing:Math.abs(p-c)<=1}}),[o,a,t.placeholder]),m=e.useCallback((()=>{const e=u.current,t=h();if(!e||!t||(function(e){for(const t in e)return!1;return!0}(r=t)||0===r.outerHeightStyle&&!r.overflowing))return;var r;const n=t.outerHeightStyle;p.current!==n&&(p.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?"hidden":""}),[h]),g=e.useRef(-1);go((()=>{const e=Jd((()=>m())),t=u?.current;if(!t)return;const r=Bd(t);let n;return r.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(n=new ResizeObserver((()=>{n.unobserve(t),cancelAnimationFrame(g.current),m(),g.current=requestAnimationFrame((()=>{n.observe(t)}))})),n.observe(t)),()=>{e.clear(),cancelAnimationFrame(g.current),r.removeEventListener("resize",e),n&&n.disconnect()}}),[h,m]),go((()=>{m()}));return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)("textarea",{value:s,onChange:e=>{c||m(),n&&n(e)},ref:d,rows:a,style:i,...l}),(0,dt.jsx)("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:f,tabIndex:-1,style:{...Rm,...i,paddingTop:0,paddingBottom:0}})]})})),Nm=Mm;function Im(e){let{props:t,states:r,muiFormControl:n}=e;return r.reduce(((e,r)=>(e[r]=t[r],n&&"undefined"===typeof t[r]&&(e[r]=n[r]),e)),{})}const Tm=e.createContext(void 0);function Am(){return e.useContext(Tm)}function Dm(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function Fm(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(Dm(e.value)&&""!==e.value||t&&Dm(e.defaultValue)&&""!==e.defaultValue)}function zm(e){return vu("MuiInputBase",e)}const Lm=yu("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Bm;const Wm=(e,t)=>{const{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,"small"===r.size&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${yl(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]},Vm=(e,t)=>{const{ownerState:r}=e;return[t.input,"small"===r.size&&t.inputSizeSmall,r.multiline&&t.inputMultiline,"search"===r.type&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]},Hm=dl("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Wm})(gl((e=>{let{theme:t}=e;return{...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Lm.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"4px 0 5px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"100%"}}]}}))),Um=dl("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Vm})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},o={opacity:"0 !important"},a=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Lm.formControl} &`]:{"&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&::-ms-input-placeholder":o,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus::-ms-input-placeholder":a},[`&.${Lm.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableInjectingGlobalStyles},style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}}))),qm=function(e){return function(t){return(0,dt.jsx)(df,{styles:"function"===typeof e?r=>e({theme:r,...t}):e})}}({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Gm=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:i,className:s,color:l,components:c={},componentsProps:u={},defaultValue:d,disabled:p,disableInjectingGlobalStyles:f,endAdornment:h,error:m,fullWidth:g=!1,id:v,inputComponent:y="input",inputProps:b={},inputRef:x,margin:w,maxRows:S,minRows:k,multiline:C=!1,name:j,onBlur:$,onChange:E,onClick:_,onFocus:P,onKeyDown:O,onKeyUp:R,placeholder:M,readOnly:N,renderSuffix:I,rows:T,size:A,slotProps:D={},slots:F={},startAdornment:z,type:L="text",value:B,...W}=n,V=null!=b.value?b.value:B,{current:H}=e.useRef(null!=V),U=e.useRef(),q=e.useCallback((e=>{0}),[]),G=Al(U,x,b.ref,q),[K,Q]=e.useState(!1),J=Am();const Y=Im({props:n,muiFormControl:J,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Y.focused=J?J.focused:K,e.useEffect((()=>{!J&&p&&K&&(Q(!1),$&&$())}),[J,p,K,$]);const X=J&&J.onFilled,Z=J&&J.onEmpty,ee=e.useCallback((e=>{Fm(e)?X&&X():Z&&Z()}),[X,Z]);Ld((()=>{H&&ee({value:V})}),[V,ee,H]);e.useEffect((()=>{ee(U.current)}),[]);let te=y,re=b;C&&"input"===te&&(re=T?{type:void 0,minRows:T,maxRows:T,...re}:{type:void 0,maxRows:S,minRows:k,...re},te=Nm);e.useEffect((()=>{J&&J.setAdornedStart(Boolean(z))}),[J,z]);const ne={...n,color:Y.color||"primary",disabled:Y.disabled,endAdornment:h,error:Y.error,focused:Y.focused,formControl:J,fullWidth:g,hiddenLabel:Y.hiddenLabel,multiline:C,size:Y.size,startAdornment:z,type:L},oe=(e=>{const{classes:t,color:r,disabled:n,error:o,endAdornment:a,focused:i,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:d,size:p,startAdornment:f,type:h}=e;return zs({root:["root",`color${yl(r)}`,n&&"disabled",o&&"error",l&&"fullWidth",i&&"focused",s&&"formControl",p&&"medium"!==p&&`size${yl(p)}`,u&&"multiline",f&&"adornedStart",a&&"adornedEnd",c&&"hiddenLabel",d&&"readOnly"],input:["input",n&&"disabled","search"===h&&"inputTypeSearch",u&&"inputMultiline","small"===p&&"inputSizeSmall",c&&"inputHiddenLabel",f&&"inputAdornedStart",a&&"inputAdornedEnd",d&&"readOnly"]},zm,t)})(ne),ae=F.root||c.Root||Hm,ie=D.root||u.root||{},se=F.input||c.Input||Um;return re={...re,...D.input??u.input},(0,dt.jsxs)(e.Fragment,{children:[!f&&"function"===typeof qm&&(Bm||(Bm=(0,dt.jsx)(qm,{}))),(0,dt.jsxs)(ae,{...ie,ref:r,onClick:e=>{U.current&&e.currentTarget===e.target&&U.current.focus(),_&&_(e)},...W,...!Qd(ae)&&{ownerState:{...ne,...ie.ownerState}},className:Ns(oe.root,ie.className,s,N&&"MuiInputBase-readOnly"),children:[z,(0,dt.jsx)(Tm.Provider,{value:null,children:(0,dt.jsx)(se,{"aria-invalid":Y.error,"aria-describedby":o,autoComplete:a,autoFocus:i,defaultValue:d,disabled:Y.disabled,id:v,onAnimationStart:e=>{ee("mui-auto-fill-cancel"===e.animationName?U.current:{value:"x"})},name:j,placeholder:M,readOnly:N,required:Y.required,rows:T,value:V,onKeyDown:O,onKeyUp:R,type:L,...re,...!Qd(se)&&{as:te,ownerState:{...ne,...re.ownerState}},ref:G,className:Ns(oe.input,re.className,N&&"MuiInputBase-readOnly"),onBlur:e=>{$&&$(e),b.onBlur&&b.onBlur(e),J&&J.onBlur?J.onBlur(e):Q(!1)},onChange:function(e){if(!H){const t=e.target||U.current;if(null==t)throw new Error(tn(1));ee({value:t.value})}for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];b.onChange&&b.onChange(e,...r),E&&E(e,...r)},onFocus:e=>{P&&P(e),b.onFocus&&b.onFocus(e),J&&J.onFocus?J.onFocus(e):Q(!0)}})}),h,I?I({...Y,startAdornment:z}):null]})]})})),Km=Gm;function Qm(e){return vu("MuiInput",e)}const Jm={...Lm,...yu("MuiInput",["root","underline","input"])},Ym=dl(Hm,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...Wm(e,t),!r.disableUnderline&&t.underline]}})(gl((e=>{let{theme:t}=e;let r="light"===t.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{"label + &":{marginTop:16}}},{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Jm.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Jm.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Jm.disabled}, .${Jm.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Jm.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}}))]}}))),Xm=dl(Um,{name:"MuiInput",slot:"Input",overridesResolver:Vm})({}),Zm=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiInput"}),{disableUnderline:n=!1,components:o={},componentsProps:a,fullWidth:i=!1,inputComponent:s="input",multiline:l=!1,slotProps:c,slots:u={},type:d="text",...p}=r,f=(e=>{const{classes:t,disableUnderline:r}=e,n=zs({root:["root",!r&&"underline"],input:["input"]},Qm,t);return{...t,...n}})(r),h={root:{ownerState:{disableUnderline:n}}},m=c??a?sn(c??a,h):h,g=u.root??o.Root??Ym,v=u.input??o.Input??Xm;return(0,dt.jsx)(Km,{slots:{root:g,input:v},slotProps:m,fullWidth:i,inputComponent:s,multiline:l,ref:t,type:d,...p,classes:f})}));Zm.muiName="Input";const eg=Zm;function tg(e){return vu("MuiFilledInput",e)}const rg={...Lm,...yu("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},ng=dl(Hm,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...Wm(e,t),!r.disableUnderline&&t.underline]}})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${rg.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${rg.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:i},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rg.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rg.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rg.disabled}, .${rg.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${rg.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{disableUnderline:!1,color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r]?.main}`}}}})),{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:12}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:12}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"25px 12px 8px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}}]}}))),og=dl(Um,{name:"MuiFilledInput",slot:"Input",overridesResolver:Vm})(gl((e=>{let{theme:t}=e;return{paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}}))),ag=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFilledInput"}),{disableUnderline:n=!1,components:o={},componentsProps:a,fullWidth:i=!1,hiddenLabel:s,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:d={},type:p="text",...f}=r,h={...r,disableUnderline:n,fullWidth:i,inputComponent:l,multiline:c,type:p},m=(e=>{const{classes:t,disableUnderline:r,startAdornment:n,endAdornment:o,size:a,hiddenLabel:i,multiline:s}=e,l=zs({root:["root",!r&&"underline",n&&"adornedStart",o&&"adornedEnd","small"===a&&`size${yl(a)}`,i&&"hiddenLabel",s&&"multiline"],input:["input"]},tg,t);return{...t,...l}})(r),g={root:{ownerState:h},input:{ownerState:h}},v=u??a?sn(g,u??a):g,y=d.root??o.Root??ng,b=d.input??o.Input??og;return(0,dt.jsx)(Km,{slots:{root:y,input:b},slotProps:v,fullWidth:i,inputComponent:l,multiline:c,ref:t,type:p,...f,classes:m})}));ag.muiName="Input";const ig=ag;var sg;const lg=dl("fieldset",{shouldForwardProp:cl})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),cg=dl("legend",{shouldForwardProp:cl})(gl((e=>{let{theme:t}=e;return{float:"unset",width:"auto",overflow:"hidden",variants:[{props:e=>{let{ownerState:t}=e;return!t.withLabel},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:e=>{let{ownerState:t}=e;return t.withLabel},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:e=>{let{ownerState:t}=e;return t.withLabel&&t.notched},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}})));function ug(e){return vu("MuiOutlinedInput",e)}const dg={...Lm,...yu("MuiOutlinedInput",["root","notchedOutline","input"])},pg=dl(Hm,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:Wm})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${dg.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${dg.focused} .${dg.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${dg.focused} .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${dg.error} .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${dg.disabled} .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:14}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:14}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"16.5px 14px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{padding:"8.5px 14px"}}]}}))),fg=dl((function(e){const{children:t,classes:r,className:n,label:o,notched:a,...i}=e,s=null!=o&&""!==o,l={...e,notched:a,withLabel:s};return(0,dt.jsx)(lg,{"aria-hidden":!0,className:n,ownerState:l,...i,children:(0,dt.jsx)(cg,{ownerState:l,children:s?(0,dt.jsx)("span",{children:o}):sg||(sg=(0,dt.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"}))})})}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}}))),hg=dl(Um,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Vm})(gl((e=>{let{theme:t}=e;return{padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:0}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}}]}}))),mg=e.forwardRef((function(t,r){var n;const o=vl({props:t,name:"MuiOutlinedInput"}),{components:a={},fullWidth:i=!1,inputComponent:s="input",label:l,multiline:c=!1,notched:u,slots:d={},type:p="text",...f}=o,h=(e=>{const{classes:t}=e,r=zs({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},ug,t);return{...t,...r}})(o),m=Am(),g=Im({props:o,muiFormControl:m,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...o,color:g.color||"primary",disabled:g.disabled,error:g.error,focused:g.focused,formControl:m,fullWidth:i,hiddenLabel:g.hiddenLabel,multiline:c,size:g.size,type:p},y=d.root??a.Root??pg,b=d.input??a.Input??hg;return(0,dt.jsx)(Km,{slots:{root:y,input:b},renderSuffix:t=>(0,dt.jsx)(fg,{ownerState:v,className:h.notchedOutline,label:null!=l&&""!==l&&g.required?n||(n=(0,dt.jsxs)(e.Fragment,{children:[l,"\u2009","*"]})):l,notched:"undefined"!==typeof u?u:Boolean(t.startAdornment||t.filled||t.focused)}),fullWidth:i,inputComponent:s,multiline:c,ref:r,type:p,...f,classes:{...h,notchedOutline:null}})}));mg.muiName="Input";const gg=mg;function vg(e){return vu("MuiFormLabel",e)}const yg=yu("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),bg=dl("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"secondary"===r.color&&t.colorSecondary,r.filled&&t.filled]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${yg.focused}`]:{color:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${yg.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${yg.error}`]:{color:(t.vars||t).palette.error.main}}}]}}))),xg=dl("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(gl((e=>{let{theme:t}=e;return{[`&.${yg.error}`]:{color:(t.vars||t).palette.error.main}}}))),wg=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFormLabel"}),{children:n,className:o,color:a,component:i="label",disabled:s,error:l,filled:c,focused:u,required:d,...p}=r,f=Im({props:r,muiFormControl:Am(),states:["color","required","focused","disabled","error","filled"]}),h={...r,color:f.color||"primary",component:i,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required},m=(e=>{const{classes:t,color:r,focused:n,disabled:o,error:a,filled:i,required:s}=e;return zs({root:["root",`color${yl(r)}`,o&&"disabled",a&&"error",i&&"filled",n&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]},vg,t)})(h);return(0,dt.jsxs)(bg,{as:i,ownerState:h,className:Ns(m.root,o),ref:t,...p,children:[n,f.required&&(0,dt.jsxs)(xg,{ownerState:h,"aria-hidden":!0,className:m.asterisk,children:["\u2009","*"]})]})})),Sg=wg;function kg(e){return vu("MuiInputLabel",e)}yu("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Cg=dl(Sg,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${yg.asterisk}`]:t.asterisk},t.root,r.formControl&&t.formControl,"small"===r.size&&t.sizeSmall,r.shrink&&t.shrink,!r.disableAnimation&&t.animated,r.focused&&t.focused,t[r.variant]]}})(gl((e=>{let{theme:t}=e;return{display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:e=>{let{ownerState:t}=e;return t.shrink},style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:e=>{let{ownerState:t}=e;return!t.disableAnimation},style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"filled"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:e=>{let{variant:t,ownerState:r,size:n}=e;return"filled"===t&&r.shrink&&"small"===n},style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"outlined"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}}))),jg=e.forwardRef((function(e,t){const r=vl({name:"MuiInputLabel",props:e}),{disableAnimation:n=!1,margin:o,shrink:a,variant:i,className:s,...l}=r,c=Am();let u=a;"undefined"===typeof u&&c&&(u=c.filled||c.focused||c.adornedStart);const d=Im({props:r,muiFormControl:c,states:["size","variant","required","focused"]}),p={...r,disableAnimation:n,formControl:c,shrink:u,size:d.size,variant:d.variant,required:d.required,focused:d.focused},f=(e=>{const{classes:t,formControl:r,size:n,shrink:o,disableAnimation:a,variant:i,required:s}=e,l=zs({root:["root",r&&"formControl",!a&&"animated",o&&"shrink",n&&"normal"!==n&&`size${yl(n)}`,i],asterisk:[s&&"asterisk"]},kg,t);return{...t,...l}})(p);return(0,dt.jsx)(Cg,{"data-shrink":u,ref:t,className:Ns(f.root,s),...l,ownerState:p,classes:f})})),$g=jg;const Eg=function(t,r){return e.isValidElement(t)&&-1!==r.indexOf(t.type.muiName??t.type?._payload?.value?.muiName)};function _g(e){return vu("MuiFormControl",e)}yu("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Pg=dl("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`margin${yl(r.margin)}`],r.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Og=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiFormControl"}),{children:o,className:a,color:i="primary",component:s="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:d=!1,hiddenLabel:p=!1,margin:f="none",required:h=!1,size:m="medium",variant:g="outlined",...v}=n,y={...n,color:i,component:s,disabled:l,error:c,fullWidth:d,hiddenLabel:p,margin:f,required:h,size:m,variant:g},b=(e=>{const{classes:t,margin:r,fullWidth:n}=e;return zs({root:["root","none"!==r&&`margin${yl(r)}`,n&&"fullWidth"]},_g,t)})(y),[x,w]=e.useState((()=>{let t=!1;return o&&e.Children.forEach(o,(e=>{if(!Eg(e,["Input","Select"]))return;const r=Eg(e,["Select"])?e.props.input:e;r&&r.props.startAdornment&&(t=!0)})),t})),[S,k]=e.useState((()=>{let t=!1;return o&&e.Children.forEach(o,(e=>{Eg(e,["Input","Select"])&&(Fm(e.props,!0)||Fm(e.props.inputProps,!0))&&(t=!0)})),t})),[C,j]=e.useState(!1);l&&C&&j(!1);const $=void 0===u||l?C:u;let E;e.useRef(!1);const _=e.useCallback((()=>{k(!0)}),[]),P=e.useCallback((()=>{k(!1)}),[]),O=e.useMemo((()=>({adornedStart:x,setAdornedStart:w,color:i,disabled:l,error:c,filled:S,focused:$,fullWidth:d,hiddenLabel:p,size:m,onBlur:()=>{j(!1)},onFocus:()=>{j(!0)},onEmpty:P,onFilled:_,registerEffect:E,required:h,variant:g})),[x,i,l,c,S,$,d,p,E,P,_,h,m,g]);return(0,dt.jsx)(Tm.Provider,{value:O,children:(0,dt.jsx)(Pg,{as:s,ownerState:y,className:Ns(b.root,a),ref:r,...v,children:o})})})),Rg=Og;function Mg(e){return vu("MuiFormHelperText",e)}const Ng=yu("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Ig;const Tg=dl("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size&&t[`size${yl(r.size)}`],r.contained&&t.contained,r.filled&&t.filled]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Ng.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Ng.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:e=>{let{ownerState:t}=e;return t.contained},style:{marginLeft:14,marginRight:14}}]}}))),Ag=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFormHelperText"}),{children:n,className:o,component:a="p",disabled:i,error:s,filled:l,focused:c,margin:u,required:d,variant:p,...f}=r,h=Im({props:r,muiFormControl:Am(),states:["variant","size","disabled","error","filled","focused","required"]}),m={...r,component:a,contained:"filled"===h.variant||"outlined"===h.variant,variant:h.variant,size:h.size,disabled:h.disabled,error:h.error,filled:h.filled,focused:h.focused,required:h.required};delete m.ownerState;const g=(e=>{const{classes:t,contained:r,size:n,disabled:o,error:a,filled:i,focused:s,required:l}=e;return zs({root:["root",o&&"disabled",a&&"error",n&&`size${yl(n)}`,r&&"contained",s&&"focused",i&&"filled",l&&"required"]},Mg,t)})(m);return(0,dt.jsx)(Tg,{as:a,className:Ns(g.root,o),ref:t,...f,ownerState:m,children:" "===n?Ig||(Ig=(0,dt.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):n})})),Dg=Ag;function Fg(e){return vu("MuiNativeSelect",e)}const zg=yu("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Lg=dl("select")((e=>{let{theme:t}=e;return{MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${zg.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:e=>{let{ownerState:t}=e;return"filled"!==t.variant&&"outlined"!==t.variant},style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]}})),Bg=dl(Lg,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:cl,overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.select,t[r.variant],r.error&&t.error,{[`&.${zg.multiple}`]:t.multiple}]}})({}),Wg=dl("svg")((e=>{let{theme:t}=e;return{position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${zg.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:e=>{let{ownerState:t}=e;return t.open},style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]}})),Vg=dl(Wg,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${yl(r.variant)}`],r.open&&t.iconOpen]}})({}),Hg=e.forwardRef((function(t,r){const{className:n,disabled:o,error:a,IconComponent:i,inputRef:s,variant:l="standard",...c}=t,u={...t,disabled:o,variant:l,error:a},d=(e=>{const{classes:t,variant:r,disabled:n,multiple:o,open:a,error:i}=e;return zs({select:["select",r,n&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${yl(r)}`,a&&"iconOpen",n&&"disabled"]},Fg,t)})(u);return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)(Bg,{ownerState:u,className:Ns(d.select,n),disabled:o,ref:s||r,...c}),t.multiple?null:(0,dt.jsx)(Vg,{as:i,ownerState:u,className:d.icon})]})})),Ug=Hg;function qg(e){return vu("MuiSelect",e)}const Gg=yu("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Kg;const Qg=dl(Lg,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`&.${Gg.select}`]:t.select},{[`&.${Gg.select}`]:t[r.variant]},{[`&.${Gg.error}`]:t.error},{[`&.${Gg.multiple}`]:t.multiple}]}})({[`&.${Gg.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Jg=dl(Wg,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${yl(r.variant)}`],r.open&&t.iconOpen]}})({}),Yg=dl("input",{shouldForwardProp:e=>ll(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Xg(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function Zg(e){return null==e||"string"===typeof e&&!e.trim()}const ev=e.forwardRef((function(t,r){const{"aria-describedby":n,"aria-label":o,autoFocus:a,autoWidth:i,children:s,className:l,defaultOpen:c,defaultValue:u,disabled:d,displayEmpty:p,error:f=!1,IconComponent:h,inputRef:m,labelId:g,MenuProps:v={},multiple:y,name:b,onBlur:x,onChange:w,onClose:S,onFocus:k,onOpen:C,open:j,readOnly:$,renderValue:E,required:_,SelectDisplayProps:P={},tabIndex:O,type:R,value:M,variant:N="standard",...I}=t,[T,A]=Nu({controlled:M,default:u,name:"Select"}),[D,F]=Nu({controlled:j,default:c,name:"Select"}),z=e.useRef(null),L=e.useRef(null),[B,W]=e.useState(null),{current:V}=e.useRef(null!=j),[H,U]=e.useState(),q=Al(r,m),G=e.useCallback((e=>{L.current=e,e&&W(e)}),[]),K=B?.parentNode;e.useImperativeHandle(q,(()=>({focus:()=>{L.current.focus()},node:z.current,value:T})),[T]),e.useEffect((()=>{c&&D&&B&&!V&&(U(i?null:K.clientWidth),L.current.focus())}),[B,i]),e.useEffect((()=>{a&&L.current.focus()}),[a]),e.useEffect((()=>{if(!g)return;const e=Md(L.current).getElementById(g);if(e){const t=()=>{getSelection().isCollapsed&&L.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[g]);const Q=(e,t)=>{e?C&&C(t):S&&S(t),V||(U(i?null:K.clientWidth),F(e))},J=e.Children.toArray(s),Y=e=>t=>{let r;if(t.currentTarget.hasAttribute("tabindex")){if(y){r=Array.isArray(T)?T.slice():[];const t=T.indexOf(e.props.value);-1===t?r.push(e.props.value):r.splice(t,1)}else r=e.props.value;if(e.props.onClick&&e.props.onClick(t),T!==r&&(A(r),w)){const n=t.nativeEvent||t,o=new n.constructor(n.type,n);Object.defineProperty(o,"target",{writable:!0,value:{value:r,name:b}}),w(o,e)}y||Q(!1,t)}},X=null!==B&&D;let Z,ee;delete I["aria-invalid"];const te=[];let re=!1,ne=!1;(Fm({value:T})||p)&&(E?Z=E(T):re=!0);const oe=J.map((t=>{if(!e.isValidElement(t))return null;let r;if(y){if(!Array.isArray(T))throw new Error(tn(2));r=T.some((e=>Xg(e,t.props.value))),r&&re&&te.push(t.props.children)}else r=Xg(T,t.props.value),r&&re&&(ee=t.props.children);return r&&(ne=!0),e.cloneElement(t,{"aria-selected":r?"true":"false",onClick:Y(t),onKeyUp:e=>{" "===e.key&&e.preventDefault(),t.props.onKeyUp&&t.props.onKeyUp(e)},role:"option",selected:r,value:void 0,"data-value":t.props.value})}));re&&(Z=y?0===te.length?null:te.reduce(((e,t,r)=>(e.push(t),r<te.length-1&&e.push(", "),e)),[]):ee);let ae,ie=H;!i&&V&&B&&(ie=K.clientWidth),ae="undefined"!==typeof O?O:d?null:0;const se=P.id||(b?`mui-component-select-${b}`:void 0),le={...t,variant:N,value:T,open:X,error:f},ce=(e=>{const{classes:t,variant:r,disabled:n,multiple:o,open:a,error:i}=e;return zs({select:["select",r,n&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${yl(r)}`,a&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]},qg,t)})(le),ue={...v.PaperProps,...v.slotProps?.paper},de=Ru();return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)(Qg,{as:"div",ref:G,tabIndex:ae,role:"combobox","aria-controls":X?de:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":X?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[g,se].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":_?"true":void 0,"aria-invalid":f?"true":void 0,onKeyDown:e=>{if(!$){[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),Q(!0,e))}},onMouseDown:d||$?null:e=>{0===e.button&&(e.preventDefault(),L.current.focus(),Q(!0,e))},onBlur:e=>{!X&&x&&(Object.defineProperty(e,"target",{writable:!0,value:{value:T,name:b}}),x(e))},onFocus:k,...P,ownerState:le,className:Ns(P.className,ce.select,l),id:se,children:Zg(Z)?Kg||(Kg=(0,dt.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):Z}),(0,dt.jsx)(Yg,{"aria-invalid":f,value:Array.isArray(T)?T.join(","):T,name:b,ref:z,"aria-hidden":!0,onChange:e=>{const t=J.find((t=>t.props.value===e.target.value));void 0!==t&&(A(t.props.value),w&&w(e,t))},tabIndex:-1,disabled:d,className:ce.nativeInput,autoFocus:a,required:_,...I,ownerState:le}),(0,dt.jsx)(Jg,{as:h,className:ce.icon,ownerState:le}),(0,dt.jsx)(Hp,{id:`menu-${b||""}`,anchorEl:K,open:X,onClose:e=>{Q(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...v,slotProps:{...v.slotProps,list:{"aria-labelledby":g,role:"listbox","aria-multiselectable":y?"true":void 0,disableListWrap:!0,id:de,...v.MenuListProps},paper:{...ue,style:{minWidth:ie,...null!=ue?ue.style:null}}},children:oe})]})})),tv=ev,rv=Pf((0,dt.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),nv={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>cl(e)&&"variant"!==e,slot:"Root"},ov=dl(eg,nv)(""),av=dl(gg,nv)(""),iv=dl(ig,nv)(""),sv=e.forwardRef((function(t,r){const n=vl({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:a,classes:i={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=rv,id:d,input:p,inputProps:f,label:h,labelId:m,MenuProps:g,multiple:v=!1,native:y=!1,onClose:b,onOpen:x,open:w,renderValue:S,SelectDisplayProps:k,variant:C="outlined",...j}=n,$=y?Ug:tv,E=Im({props:n,muiFormControl:Am(),states:["variant","error"]}),_=E.variant||C,P={...n,variant:_,classes:i},O=(e=>{const{classes:t}=e,r=zs({root:["root"]},qg,t);return{...t,...r}})(P),{root:R,...M}=O,N=p||{standard:(0,dt.jsx)(ov,{ownerState:P}),outlined:(0,dt.jsx)(av,{label:h,ownerState:P}),filled:(0,dt.jsx)(iv,{ownerState:P})}[_],I=Al(r,Bs(N));return(0,dt.jsx)(e.Fragment,{children:e.cloneElement(N,{inputComponent:$,inputProps:{children:a,error:E.error,IconComponent:u,variant:_,type:void 0,multiple:v,...y?{id:d}:{autoWidth:o,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:b,onOpen:x,open:w,renderValue:S,SelectDisplayProps:{id:d,...k}},...f,classes:f?sn(M,f.classes):M,...p?p.props.inputProps:{}},...(v&&y||c)&&"outlined"===_?{notched:!0}:{},ref:I,className:Ns(N.props.className,s,O.root),...!p&&{variant:_},...j})})}));sv.muiName="Select";const lv=sv;function cv(e){return vu("MuiTextField",e)}yu("MuiTextField",["root"]);const uv={standard:eg,filled:ig,outlined:gg},dv=dl(Rg,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),pv=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiTextField"}),{autoComplete:n,autoFocus:o=!1,children:a,className:i,color:s="primary",defaultValue:l,disabled:c=!1,error:u=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:f,id:h,InputLabelProps:m,inputProps:g,InputProps:v,inputRef:y,label:b,maxRows:x,minRows:w,multiline:S=!1,name:k,onBlur:C,onChange:j,onFocus:$,placeholder:E,required:_=!1,rows:P,select:O=!1,SelectProps:R,slots:M={},slotProps:N={},type:I,value:T,variant:A="outlined",...D}=r,F={...r,autoFocus:o,color:s,disabled:c,error:u,fullWidth:p,multiline:S,required:_,select:O,variant:A},z=(e=>{const{classes:t}=e;return zs({root:["root"]},cv,t)})(F);const L=Ru(h),B=f&&L?`${L}-helper-text`:void 0,W=b&&L?`${L}-label`:void 0,V=uv[A],H={slots:M,slotProps:{input:v,inputLabel:m,htmlInput:g,formHelperText:d,select:R,...N}},U={},q=H.slotProps.inputLabel;"outlined"===A&&(q&&"undefined"!==typeof q.shrink&&(U.notched=q.shrink),U.label=b),O&&(R&&R.native||(U.id=void 0),U["aria-describedby"]=void 0);const[G,K]=Iu("input",{elementType:V,externalForwardedProps:H,additionalProps:U,ownerState:F}),[Q,J]=Iu("inputLabel",{elementType:$g,externalForwardedProps:H,ownerState:F}),[Y,X]=Iu("htmlInput",{elementType:"input",externalForwardedProps:H,ownerState:F}),[Z,ee]=Iu("formHelperText",{elementType:Dg,externalForwardedProps:H,ownerState:F}),[te,re]=Iu("select",{elementType:lv,externalForwardedProps:H,ownerState:F}),ne=(0,dt.jsx)(G,{"aria-describedby":B,autoComplete:n,autoFocus:o,defaultValue:l,fullWidth:p,multiline:S,name:k,rows:P,maxRows:x,minRows:w,type:I,value:T,id:L,inputRef:y,onBlur:C,onChange:j,onFocus:$,placeholder:E,inputProps:X,slots:{input:M.htmlInput?Y:void 0},...K});return(0,dt.jsxs)(dv,{className:Ns(z.root,i),disabled:c,error:u,fullWidth:p,ref:t,required:_,color:s,variant:A,ownerState:F,...D,children:[null!=b&&""!==b&&(0,dt.jsx)(Q,{htmlFor:L,id:W,...J,children:b}),O?(0,dt.jsx)(te,{"aria-describedby":B,id:L,labelId:W,value:T,input:ne,...re,children:a}):ne,f&&(0,dt.jsx)(Z,{id:B,...ee,children:f})]})})),fv=pv,hv=Pf((0,dt.jsx)("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"}),"FileUpload"),mv=Pf((0,dt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),gv=Pf((0,dt.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");function vv(){const[t,r]=(0,e.useState)("matterbridge-"),[n,o]=(0,e.useState)(!1),[a,i]=e.useState(null),{logMessage:s}=(0,e.useContext)(Qh),l=e=>{""!==e&&r(e),i(null)};return tM&&console.log("AddRemovePlugins rendering..."),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 auto",alignItems:"center",justifyContent:"space-between",margin:"0px",padding:"10px",gap:"20px"},onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>{o(!1)},onDrop:e=>{e.preventDefault(),o(!1);const t=e.dataTransfer.files[0];if(t){s("Plugins",`Installing package ${t.name}. Please wait...`);const e=new FormData;e.append("file",t),e.append("filename",t.name),fetch("./api/uploadpackage",{method:"POST",body:e}).then((e=>e.text())).then((e=>{s("Plugins",`Server response: ${e}`)})).catch((e=>{console.error("Error uploading plugin file:",e),s("Plugins",`Error installing package ${e}`)}))}},children:[(0,dt.jsx)(fv,{value:t,onChange:e=>{r(e.target.value)},size:"small",id:"plugin-name",label:"Plugin name or plugin path",variant:"outlined",fullWidth:!0}),(0,dt.jsx)(Rd,{onClick:e=>{i(e.currentTarget)},children:(0,dt.jsx)(gv,{})}),(0,dt.jsxs)(Hp,{id:"simple-menu",anchorEl:a,keepMounted:!0,open:Boolean(a),onClose:()=>l(""),children:[(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-zigbee2mqtt"),children:"matterbridge-zigbee2mqtt"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-somfy-tahoma"),children:"matterbridge-somfy-tahoma"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-shelly"),children:"matterbridge-shelly"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-hass"),children:"matterbridge-hass"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-webhooks"),children:"matterbridge-webhooks"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-example-accessory-platform"),children:"matterbridge-example-accessory-platform"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-example-dynamic-platform"),children:"matterbridge-example-dynamic-platform"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-door"),children:"matterbridge-eve-door"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-motion"),children:"matterbridge-eve-motion"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-energy"),children:"matterbridge-eve-energy"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-weather"),children:"matterbridge-eve-weather"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-room"),children:"matterbridge-eve-room"})]}),(0,dt.jsx)(Uu,{title:"Install or update a plugin from npm",children:(0,dt.jsx)(Ah,{onClick:()=>{"matterbridge"===t.split("@")[0]?s("Matterbridge",`Installing matterbridge package: ${t}`):s("Plugins",`Installing plugin: ${t}`),Bf("installplugin",t)},endIcon:(0,dt.jsx)(Tf,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Install"})}),(0,dt.jsx)(Uu,{title:"Upload and install a plugin from a tarball",children:(0,dt.jsx)(Ah,{onClick:()=>{document.getElementById("file-upload").click()},endIcon:(0,dt.jsx)(hv,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Upload"})}),(0,dt.jsx)(Uu,{title:"Add an installed plugin",children:(0,dt.jsx)(Ah,{onClick:()=>{s("Plugins",`Adding plugin: ${t}`),Bf("addplugin",t)},endIcon:(0,dt.jsx)(mv,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Add"})}),(0,dt.jsx)("input",{id:"file-upload",type:"file",accept:".tgz",style:{display:"none"},onChange:e=>{const t=e.target.files[0];if(t){s("Plugins",`Uploading package ${t.name}`);const e=new FormData;e.append("file",t),e.append("filename",t.name),fetch("./api/uploadpackage",{method:"POST",body:e}).then((e=>e.text())).then((e=>{s("Plugins",`Server response: ${e}`)})).catch((e=>{console.error("Error uploading plugin file:",e),s("Plugins",`Error uploading package ${e}`)}))}}})]})}var yv=r(1094);function bv(e){return vu("MuiDialogActions",e)}yu("MuiDialogActions",["root","spacing"]);const xv=dl("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableSpacing},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),wv=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiDialogActions"}),{className:n,disableSpacing:o=!1,...a}=r,i={...r,disableSpacing:o},s=(e=>{const{classes:t,disableSpacing:r}=e;return zs({root:["root",!r&&"spacing"]},bv,t)})(i);return(0,dt.jsx)(xv,{className:Ns(s.root,n),ownerState:i,ref:t,...a})})),Sv=wv;function kv(e){return vu("MuiFormGroup",e)}yu("MuiFormGroup",["root","row","error"]);const Cv=dl("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),jv=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFormGroup"}),{className:n,row:o=!1,...a}=r,i=Im({props:r,muiFormControl:Am(),states:["error"]}),s={...r,row:o,error:i.error},l=(e=>{const{classes:t,row:r,error:n}=e;return zs({root:["root",r&&"row",n&&"error"]},kv,t)})(s);return(0,dt.jsx)(Cv,{className:Ns(l.root,n),ownerState:s,ref:t,...a})})),$v=jv;function Ev(e){return vu("MuiFormControlLabel",e)}const _v=yu("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Pv=dl("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${_v.label}`]:t.label},t.root,t[`labelPlacement${yl(r.labelPlacement)}`]]}})(gl((e=>{let{theme:t}=e;return{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${_v.disabled}`]:{cursor:"default"},[`& .${_v.label}`]:{[`&.${_v.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:e=>{let{labelPlacement:t}=e;return"start"===t||"top"===t||"bottom"===t},style:{marginLeft:16}}]}}))),Ov=dl("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(gl((e=>{let{theme:t}=e;return{[`&.${_v.error}`]:{color:(t.vars||t).palette.error.main}}}))),Rv=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiFormControlLabel"}),{checked:o,className:a,componentsProps:i={},control:s,disabled:l,disableTypography:c,inputRef:u,label:d,labelPlacement:p="end",name:f,onChange:h,required:m,slots:g={},slotProps:v={},value:y,...b}=n,x=Am(),w=l??s.props.disabled??x?.disabled,S=m??s.props.required,k={disabled:w,required:S};["checked","name","onChange","value","inputRef"].forEach((e=>{"undefined"===typeof s.props[e]&&"undefined"!==typeof n[e]&&(k[e]=n[e])}));const C=Im({props:n,muiFormControl:x,states:["error"]}),j={...n,disabled:w,labelPlacement:p,required:S,error:C.error},$=(e=>{const{classes:t,disabled:r,labelPlacement:n,error:o,required:a}=e;return zs({root:["root",r&&"disabled",`labelPlacement${yl(n)}`,o&&"error",a&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",o&&"error"]},Ev,t)})(j),E={slots:g,slotProps:{...i,...v}},[_,P]=Iu("typography",{elementType:vf,externalForwardedProps:E,ownerState:j});let O=d;return null==O||O.type===vf||c||(O=(0,dt.jsx)(_,{component:"span",...P,className:Ns($.label,P?.className),children:O})),(0,dt.jsxs)(Pv,{className:Ns($.root,a),ownerState:j,ref:r,...b,children:[e.cloneElement(s,k),S?(0,dt.jsxs)("div",{children:[O,(0,dt.jsxs)(Ov,{ownerState:j,"aria-hidden":!0,className:$.asterisk,children:["\u2009","*"]})]}):O]})})),Mv=Rv;function Nv(e){return vu("PrivateSwitchBase",e)}yu("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Iv=dl(hd)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"start"===t&&"small"!==r.size},style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"end"===t&&"small"!==r.size},style:{marginRight:-12}}]}),Tv=dl("input",{shouldForwardProp:cl})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Av=e.forwardRef((function(e,t){const{autoFocus:r,checked:n,checkedIcon:o,defaultChecked:a,disabled:i,disableFocusRipple:s=!1,edge:l=!1,icon:c,id:u,inputProps:d,inputRef:p,name:f,onBlur:h,onChange:m,onFocus:g,readOnly:v,required:y=!1,tabIndex:b,type:x,value:w,slots:S={},slotProps:k={},...C}=e,[j,$]=Nu({controlled:n,default:Boolean(a),name:"SwitchBase",state:"checked"}),E=Am();let _=i;E&&"undefined"===typeof _&&(_=E.disabled);const P="checkbox"===x||"radio"===x,O={...e,checked:j,disabled:_,disableFocusRipple:s,edge:l},R=(e=>{const{classes:t,checked:r,disabled:n,edge:o}=e;return zs({root:["root",r&&"checked",n&&"disabled",o&&`edge${yl(o)}`],input:["input"]},Nv,t)})(O),M={slots:S,slotProps:{input:d,...k}},[N,I]=Iu("root",{ref:t,elementType:Iv,className:R.root,shouldForwardComponentProp:!0,externalForwardedProps:{...M,component:"span",...C},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{g&&g(e),E&&E.onFocus&&E.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{h&&h(e),E&&E.onBlur&&E.onBlur(e)})(t)}}),ownerState:O,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:_,role:void 0,tabIndex:null}}),[T,A]=Iu("input",{ref:p,elementType:Tv,className:R.input,externalForwardedProps:M,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;$(t),m&&m(e,t)})(t)}}),ownerState:O,additionalProps:{autoFocus:r,checked:n,defaultChecked:a,disabled:_,id:P?u:void 0,name:f,readOnly:v,required:y,tabIndex:b,type:x,..."checkbox"===x&&void 0===w?{}:{value:w}}});return(0,dt.jsxs)(N,{...I,children:[(0,dt.jsx)(T,{...A}),j?o:c]})})),Dv=Av,Fv=Pf((0,dt.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),zv=Pf((0,dt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Lv=Pf((0,dt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Bv(e){return vu("MuiCheckbox",e)}const Wv=yu("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Vv=dl(Dv,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.indeterminate&&t.indeterminate,t[`size${yl(r.size)}`],"default"!==r.color&&t[`color${yl(r.color)}`]]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${Wv.checked}, &.${Wv.indeterminate}`]:{color:(t.vars||t).palette[r].main},[`&.${Wv.disabled}`]:{color:(t.vars||t).palette.action.disabled}}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}}))),Hv=(0,dt.jsx)(zv,{}),Uv=(0,dt.jsx)(Fv,{}),qv=(0,dt.jsx)(Lv,{}),Gv=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiCheckbox"}),{checkedIcon:o=Hv,color:a="primary",icon:i=Uv,indeterminate:s=!1,indeterminateIcon:l=qv,inputProps:c,size:u="medium",disableRipple:d=!1,className:p,slots:f={},slotProps:h={},...m}=n,g=s?l:i,v=s?l:o,y={...n,disableRipple:d,color:a,indeterminate:s,size:u},b=(e=>{const{classes:t,indeterminate:r,color:n,size:o}=e,a=zs({root:["root",r&&"indeterminate",`color${yl(n)}`,`size${yl(o)}`]},Bv,t);return{...t,...a}})(y),x=h.input??c,[w,S]=Iu("root",{ref:r,elementType:Vv,className:Ns(b.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:h,...m},ownerState:y,additionalProps:{type:"checkbox",icon:e.cloneElement(g,{fontSize:g.props.fontSize??u}),checkedIcon:e.cloneElement(v,{fontSize:v.props.fontSize??u}),disableRipple:d,slots:f,slotProps:{input:_p("function"===typeof x?x(y):x,{"data-indeterminate":s})}}});return(0,dt.jsx)(w,{...S,classes:b})})),Kv=Gv,Qv=Pf((0,dt.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),Jv=Pf((0,dt.jsx)("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"}),"Favorite"),Yv=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help"),Xv=Pf((0,dt.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 9h-2V5h2zm0 4h-2v-2h2z"}),"Announcement"),Zv=Pf((0,dt.jsx)("path",{d:"m17.66 9.53-7.07 7.07-4.24-4.24 1.41-1.41 2.83 2.83 5.66-5.66zM4 12c0-2.33 1.02-4.42 2.62-5.88L9 8.5v-6H3l2.2 2.2C3.24 6.52 2 9.11 2 12c0 5.19 3.95 9.45 9 9.95v-2.02c-3.94-.49-7-3.86-7-7.93m18 0c0-5.19-3.95-9.45-9-9.95v2.02c3.94.49 7 3.86 7 7.93 0 2.33-1.02 4.42-2.62 5.88L15 15.5v6h6l-2.2-2.2c1.96-1.82 3.2-4.41 3.2-7.3"}),"PublishedWithChanges"),ey=Pf((0,dt.jsx)("path",{d:"M21.19 21.19 2.81 2.81 1.39 4.22l2.27 2.27C2.61 8.07 2 9.96 2 12c0 5.52 4.48 10 10 10 2.04 0 3.93-.61 5.51-1.66l2.27 2.27zm-10.6-4.59-4.24-4.24 1.41-1.41 2.83 2.83.18-.18 1.41 1.41zm3-5.84-7.1-7.1C8.07 2.61 9.96 2 12 2c5.52 0 10 4.48 10 10 0 2.04-.61 3.93-1.66 5.51L15 12.17l2.65-2.65-1.41-1.41z"}),"Unpublished"),ty=Pf((0,dt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever"),ry=Pf((0,dt.jsx)("path",{d:"M15 21h-2v-2h2zm-2-7h-2v5h2zm8-2h-2v4h2zm-2-2h-2v2h2zM7 12H5v2h2zm-2-2H3v2h2zm7-5h2V3h-2zm-7.5-.5v3h3v-3zM9 9H3V3h6zm-4.5 7.5v3h3v-3zM9 21H3v-6h6zm7.5-16.5v3h3v-3zM21 9h-6V3h6zm-2 10v-3h-4v2h2v3h4v-2zm-2-7h-4v2h4zm-4-2H7v2h2v2h2v-2h2zm1-1V7h-2V5h-2v4zM6.75 5.25h-1.5v1.5h1.5zm0 12h-1.5v1.5h1.5zm12-12h-1.5v1.5h1.5z"}),"QrCode2");function ny(e){let{status:t,enabledText:r="Enabled",disabledText:n,tooltipText:o,onClick:a}=e;return void 0===t?(0,dt.jsx)("div",{style:{margin:"-2.5px"},children:(0,dt.jsx)("div",{})}):void 0!==o?(0,dt.jsxs)("div",{className:"tooltip-container",children:[(0,dt.jsx)("div",{className:t?"status-enabled":"status-disabled",style:{cursor:"default"},onClick:a,children:t?r:null!==n&&void 0!==n?n:r}),(0,dt.jsx)("span",{className:"tooltip-text",children:o})]}):(0,dt.jsx)("div",{className:t?"status-enabled":"status-disabled",style:{cursor:"default"},children:t?r:null!==n&&void 0!==n?n:r})}function oy(e){return vu("MuiListItem",e)}yu("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function ay(e){return vu("MuiListItemButton",e)}const iy=yu("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function sy(e){return vu("MuiListItemSecondaryAction",e)}yu("MuiListItemSecondaryAction",["root","disableGutters"]);const ly=dl("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:e=>{let{ownerState:t}=e;return t.disableGutters},style:{right:0}}]}),cy=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...a}=n,i=e.useContext(Nd),s={...n,disableGutters:i.disableGutters},l=(e=>{const{disableGutters:t,classes:r}=e;return zs({root:["root",t&&"disableGutters"]},sy,r)})(s);return(0,dt.jsx)(ly,{className:Ns(l.root,o),ownerState:s,ref:r,...a})}));cy.muiName="ListItemSecondaryAction";const uy=cy,dy=dl("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,"flex-start"===r.alignItems&&t.alignItemsFlexStart,r.divider&&t.divider,!r.disableGutters&&t.gutters,!r.disablePadding&&t.padding,r.hasSecondaryAction&&t.secondaryAction]}})(gl((e=>{let{theme:t}=e;return{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:e=>{let{ownerState:t}=e;return!t.disablePadding},style:{paddingTop:8,paddingBottom:8}},{props:e=>{let{ownerState:t}=e;return!t.disablePadding&&t.dense},style:{paddingTop:4,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return!t.disablePadding&&!t.disableGutters},style:{paddingLeft:16,paddingRight:16}},{props:e=>{let{ownerState:t}=e;return!t.disablePadding&&!!t.secondaryAction},style:{paddingRight:48}},{props:e=>{let{ownerState:t}=e;return!!t.secondaryAction},style:{[`& > .${iy.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:e=>{let{ownerState:t}=e;return t.divider},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:e=>{let{ownerState:t}=e;return t.button},style:{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:e=>{let{ownerState:t}=e;return t.hasSecondaryAction},style:{paddingRight:48}}]}}))),py=dl("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),fy=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItem"}),{alignItems:o="center",children:a,className:i,component:s,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:d,...p}={},dense:f=!1,disableGutters:h=!1,disablePadding:m=!1,divider:g=!1,secondaryAction:v,slotProps:y={},slots:b={},...x}=n,w=e.useContext(Nd),S=e.useMemo((()=>({dense:f||w.dense||!1,alignItems:o,disableGutters:h})),[o,w.dense,f,h]),k=e.useRef(null),C=e.Children.toArray(a),j=C.length&&Eg(C[C.length-1],["ListItemSecondaryAction"]),$={...n,alignItems:o,dense:S.dense,disableGutters:h,disablePadding:m,divider:g,hasSecondaryAction:j},E=(e=>{const{alignItems:t,classes:r,dense:n,disableGutters:o,disablePadding:a,divider:i,hasSecondaryAction:s}=e;return zs({root:["root",n&&"dense",!o&&"gutters",!a&&"padding",i&&"divider","flex-start"===t&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},oy,r)})($),_=Al(k,r),P=b.root||l.Root||dy,O=y.root||c.root||{},R={className:Ns(E.root,O.className,i),...x};let M=s||"li";return j?(M=R.component||s?M:"div","li"===u&&("li"===M?M="div":"li"===R.component&&(R.component="div")),(0,dt.jsx)(Nd.Provider,{value:S,children:(0,dt.jsxs)(py,{as:u,className:Ns(E.container,d),ref:_,ownerState:$,...p,children:[(0,dt.jsx)(P,{...O,...!Qd(P)&&{as:M,ownerState:{...$,...O.ownerState}},...R,children:C}),C.pop()]})})):(0,dt.jsx)(Nd.Provider,{value:S,children:(0,dt.jsxs)(P,{...O,as:M,ref:_,...!Qd(P)&&{ownerState:{...$,...O.ownerState}},...R,children:[C,v&&(0,dt.jsx)(uy,{children:v})]})})})),hy=fy,my=dl(hd,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,"flex-start"===r.alignItems&&t.alignItemsFlexStart,r.divider&&t.divider,!r.disableGutters&&t.gutters]}})(gl((e=>{let{theme:t}=e;return{display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${iy.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${iy.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${iy.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${iy.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${iy.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:e=>{let{ownerState:t}=e;return t.divider},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:e=>{let{ownerState:t}=e;return!t.disableGutters},style:{paddingLeft:16,paddingRight:16}},{props:e=>{let{ownerState:t}=e;return t.dense},style:{paddingTop:4,paddingBottom:4}}]}}))),gy=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:a=!1,component:i="div",children:s,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:d,selected:p=!1,className:f,...h}=n,m=e.useContext(Nd),g=e.useMemo((()=>({dense:l||m.dense||!1,alignItems:o,disableGutters:c})),[o,m.dense,l,c]),v=e.useRef(null);Ld((()=>{a&&v.current&&v.current.focus()}),[a]);const y={...n,alignItems:o,dense:g.dense,disableGutters:c,divider:u,selected:p},b=(e=>{const{alignItems:t,classes:r,dense:n,disabled:o,disableGutters:a,divider:i,selected:s}=e,l=zs({root:["root",n&&"dense",!a&&"gutters",i&&"divider",o&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},ay,r);return{...r,...l}})(y),x=Al(v,r);return(0,dt.jsx)(Nd.Provider,{value:g,children:(0,dt.jsx)(my,{ref:x,href:h.href||h.to,component:(h.href||h.to)&&"div"===i?"button":i,focusVisibleClassName:Ns(b.focusVisible,d),ownerState:y,className:Ns(b.root,f),...h,classes:b,children:s})})})),vy=gy,yy=Pf((0,dt.jsx)("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),by=Pf((0,dt.jsx)("path",{d:"m1 9 2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9m8 8 3 3 3-3c-1.65-1.66-4.34-1.66-6 0m-4-4 2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13"}),"Wifi"),xy=Pf((0,dt.jsx)("path",{d:"M17.71 7.71 12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29zM13 5.83l1.88 1.88L13 9.59zm1.88 10.46L13 18.17v-3.76z"}),"Bluetooth"),wy=Pf((0,dt.jsx)("path",{d:"M8.4 18.2c.38.5.6 1.12.6 1.8 0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3c.44 0 .85.09 1.23.26l1.41-1.77c-.92-1.03-1.29-2.39-1.09-3.69l-2.03-.68c-.54.83-1.46 1.38-2.52 1.38-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3c0 .07 0 .14-.01.21l2.03.68c.64-1.21 1.82-2.09 3.22-2.32V5.91C9.96 5.57 9 4.4 9 3c0-1.66 1.34-3 3-3s3 1.34 3 3c0 1.4-.96 2.57-2.25 2.91v2.16c1.4.23 2.58 1.11 3.22 2.32L18 9.71V9.5c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-1.06 0-1.98-.55-2.52-1.37l-2.03.68c.2 1.29-.16 2.65-1.09 3.69l1.41 1.77Q17.34 17 18 17c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.68.22-1.3.6-1.8l-1.41-1.77c-1.35.75-3.01.76-4.37 0z"}),"Hub"),Sy=Pf([(0,dt.jsx)("path",{d:"M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"},"0"),(0,dt.jsx)("path",{d:"m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"},"1")],"KeyboardDoubleArrowUp"),ky=Pf([(0,dt.jsx)("path",{d:"M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z"},"0"),(0,dt.jsx)("path",{d:"m18 13-1.41-1.41L12 16.17l-4.59-4.58L6 13l6 6z"},"1")],"KeyboardDoubleArrowDown"),Cy=Pf((0,dt.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),jy=Pf((0,dt.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr"),$y=Pf((0,dt.jsx)("path",{d:"m17 16-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5z"}),"DeviceHub");function Ey(e){return"object"===typeof e&&null!==e&&(!("number"===typeof e.lastModified&&"undefined"!==typeof File&&e instanceof File)&&(!("function"===typeof e.getMonth&&"undefined"!==typeof Date&&e instanceof Date)&&!Array.isArray(e)))}function _y(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;const t=Number(e);return"number"===typeof t&&!Number.isNaN(t)?t:e}const Py="__additional_property",Oy="additionalProperties",Ry="allOf",My="anyOf",Ny="const",Iy="default",Ty="dependencies",Ay="enum",Dy="__errors",Fy="$id",zy="if",Ly="items",By="$name",Wy="oneOf",Vy="properties",Hy="required",Uy="submitButtonOptions",qy="$ref",Gy="__rjsf_additionalProperties",Ky="__rjsf_rootSchema",Qy="ui:widget",Jy="ui:options";function Yy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).filter((e=>0===e.indexOf("ui:"))).reduce(((t,r)=>{const n=e[r];return r===Qy&&Ey(n)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===Jy&&Ey(n)?{...t,...n}:{...t,[r.substring(3)]:n}}),{...t})}function Xy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!e.additionalProperties)return!1;const{expandable:n=!0}=Yy(t);return!1===n?n:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties}const Zy="object"==typeof global&&global&&global.Object===Object&&global;var eb="object"==typeof self&&self&&self.Object===Object&&self;const tb=Zy||eb||Function("return this")();const rb=tb.Symbol;var nb=Object.prototype,ob=nb.hasOwnProperty,ab=nb.toString,ib=rb?rb.toStringTag:void 0;const sb=function(e){var t=ob.call(e,ib),r=e[ib];try{e[ib]=void 0;var n=!0}catch(Ya){}var o=ab.call(e);return n&&(t?e[ib]=r:delete e[ib]),o};var lb=Object.prototype.toString;const cb=function(e){return lb.call(e)};var ub=rb?rb.toStringTag:void 0;const db=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ub&&ub in Object(e)?sb(e):cb(e)};const pb=function(e,t){return function(r){return e(t(r))}};const fb=pb(Object.getPrototypeOf,Object);const hb=function(e){return null!=e&&"object"==typeof e};var mb=Function.prototype,gb=Object.prototype,vb=mb.toString,yb=gb.hasOwnProperty,bb=vb.call(Object);const xb=function(e){if(!hb(e)||"[object Object]"!=db(e))return!1;var t=fb(e);if(null===t)return!0;var r=yb.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&vb.call(r)==bb};function wb(e){const t={[Dy]:[],addError(e){this[Dy].push(e)}};if(Array.isArray(e))return e.reduce(((e,t,r)=>({...e,[r]:wb(t)})),t);if(xb(e)){const r=e;return Object.keys(r).reduce(((e,t)=>({...e,[t]:wb(r[t])})),t)}return t}const Sb=function(){this.__data__=[],this.size=0};const kb=function(e,t){return e===t||e!==e&&t!==t};const Cb=function(e,t){for(var r=e.length;r--;)if(kb(e[r][0],t))return r;return-1};var jb=Array.prototype.splice;const $b=function(e){var t=this.__data__,r=Cb(t,e);return!(r<0)&&(r==t.length-1?t.pop():jb.call(t,r,1),--this.size,!0)};const Eb=function(e){var t=this.__data__,r=Cb(t,e);return r<0?void 0:t[r][1]};const _b=function(e){return Cb(this.__data__,e)>-1};const Pb=function(e,t){var r=this.__data__,n=Cb(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ob(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ob.prototype.clear=Sb,Ob.prototype.delete=$b,Ob.prototype.get=Eb,Ob.prototype.has=_b,Ob.prototype.set=Pb;const Rb=Ob;const Mb=function(){this.__data__=new Rb,this.size=0};const Nb=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};const Ib=function(e){return this.__data__.get(e)};const Tb=function(e){return this.__data__.has(e)};const Ab=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Db=function(e){if(!Ab(e))return!1;var t=db(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const Fb=tb["__core-js_shared__"];var zb=function(){var e=/[^.]+$/.exec(Fb&&Fb.keys&&Fb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();const Lb=function(e){return!!zb&&zb in e};var Bb=Function.prototype.toString;const Wb=function(e){if(null!=e){try{return Bb.call(e)}catch(Ya){}try{return e+""}catch(Ya){}}return""};var Vb=/^\[object .+?Constructor\]$/,Hb=Function.prototype,Ub=Object.prototype,qb=Hb.toString,Gb=Ub.hasOwnProperty,Kb=RegExp("^"+qb.call(Gb).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Qb=function(e){return!(!Ab(e)||Lb(e))&&(Db(e)?Kb:Vb).test(Wb(e))};const Jb=function(e,t){return null==e?void 0:e[t]};const Yb=function(e,t){var r=Jb(e,t);return Qb(r)?r:void 0};const Xb=Yb(tb,"Map");const Zb=Yb(Object,"create");const ex=function(){this.__data__=Zb?Zb(null):{},this.size=0};const tx=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var rx=Object.prototype.hasOwnProperty;const nx=function(e){var t=this.__data__;if(Zb){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return rx.call(t,e)?t[e]:void 0};var ox=Object.prototype.hasOwnProperty;const ax=function(e){var t=this.__data__;return Zb?void 0!==t[e]:ox.call(t,e)};const ix=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Zb&&void 0===t?"__lodash_hash_undefined__":t,this};function sx(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}sx.prototype.clear=ex,sx.prototype.delete=tx,sx.prototype.get=nx,sx.prototype.has=ax,sx.prototype.set=ix;const lx=sx;const cx=function(){this.size=0,this.__data__={hash:new lx,map:new(Xb||Rb),string:new lx}};const ux=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const dx=function(e,t){var r=e.__data__;return ux(t)?r["string"==typeof t?"string":"hash"]:r.map};const px=function(e){var t=dx(this,e).delete(e);return this.size-=t?1:0,t};const fx=function(e){return dx(this,e).get(e)};const hx=function(e){return dx(this,e).has(e)};const mx=function(e,t){var r=dx(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function gx(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gx.prototype.clear=cx,gx.prototype.delete=px,gx.prototype.get=fx,gx.prototype.has=hx,gx.prototype.set=mx;const vx=gx;const yx=function(e,t){var r=this.__data__;if(r instanceof Rb){var n=r.__data__;if(!Xb||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new vx(n)}return r.set(e,t),this.size=r.size,this};function bx(e){var t=this.__data__=new Rb(e);this.size=t.size}bx.prototype.clear=Mb,bx.prototype.delete=Nb,bx.prototype.get=Ib,bx.prototype.has=Tb,bx.prototype.set=yx;const xx=bx;const wx=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Sx=function(e){return this.__data__.has(e)};function kx(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new vx;++t<r;)this.add(e[t])}kx.prototype.add=kx.prototype.push=wx,kx.prototype.has=Sx;const Cx=kx;const jx=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};const $x=function(e,t){return e.has(t)};const Ex=function(e,t,r,n,o,a){var i=1&r,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,f=2&r?new Cx:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(n)var g=i?n(m,h,d,t,e,a):n(h,m,d,e,t,a);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!jx(t,(function(e,t){if(!$x(f,t)&&(h===e||o(h,e,r,n,a)))return f.push(t)}))){p=!1;break}}else if(h!==m&&!o(h,m,r,n,a)){p=!1;break}}return a.delete(e),a.delete(t),p};const _x=tb.Uint8Array;const Px=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r};const Ox=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r};var Rx=rb?rb.prototype:void 0,Mx=Rx?Rx.valueOf:void 0;const Nx=function(e,t,r,n,o,a,i){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new _x(e),new _x(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return kb(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Px;case"[object Set]":var l=1&n;if(s||(s=Ox),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;n|=2,i.set(e,t);var u=Ex(s(e),s(t),n,o,a,i);return i.delete(e),u;case"[object Symbol]":if(Mx)return Mx.call(e)==Mx.call(t)}return!1};const Ix=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e};const Tx=Array.isArray;const Ax=function(e,t,r){var n=t(e);return Tx(e)?n:Ix(n,r(e))};const Dx=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};const Fx=function(){return[]};var zx=Object.prototype.propertyIsEnumerable,Lx=Object.getOwnPropertySymbols;const Bx=Lx?function(e){return null==e?[]:(e=Object(e),Dx(Lx(e),(function(t){return zx.call(e,t)})))}:Fx;const Wx=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};const Vx=function(e){return hb(e)&&"[object Arguments]"==db(e)};var Hx=Object.prototype,Ux=Hx.hasOwnProperty,qx=Hx.propertyIsEnumerable;const Gx=Vx(function(){return arguments}())?Vx:function(e){return hb(e)&&Ux.call(e,"callee")&&!qx.call(e,"callee")};const Kx=function(){return!1};var Qx="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jx=Qx&&"object"==typeof module&&module&&!module.nodeType&&module,Yx=Jx&&Jx.exports===Qx?tb.Buffer:void 0;const Xx=(Yx?Yx.isBuffer:void 0)||Kx;var Zx=/^(?:0|[1-9]\d*)$/;const ew=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&Zx.test(e))&&e>-1&&e%1==0&&e<t};const tw=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var rw={};rw["[object Float32Array]"]=rw["[object Float64Array]"]=rw["[object Int8Array]"]=rw["[object Int16Array]"]=rw["[object Int32Array]"]=rw["[object Uint8Array]"]=rw["[object Uint8ClampedArray]"]=rw["[object Uint16Array]"]=rw["[object Uint32Array]"]=!0,rw["[object Arguments]"]=rw["[object Array]"]=rw["[object ArrayBuffer]"]=rw["[object Boolean]"]=rw["[object DataView]"]=rw["[object Date]"]=rw["[object Error]"]=rw["[object Function]"]=rw["[object Map]"]=rw["[object Number]"]=rw["[object Object]"]=rw["[object RegExp]"]=rw["[object Set]"]=rw["[object String]"]=rw["[object WeakMap]"]=!1;const nw=function(e){return hb(e)&&tw(e.length)&&!!rw[db(e)]};const ow=function(e){return function(t){return e(t)}};var aw="object"==typeof exports&&exports&&!exports.nodeType&&exports,iw=aw&&"object"==typeof module&&module&&!module.nodeType&&module,sw=iw&&iw.exports===aw&&Zy.process;const lw=function(){try{var e=iw&&iw.require&&iw.require("util").types;return e||sw&&sw.binding&&sw.binding("util")}catch(Ya){}}();var cw=lw&&lw.isTypedArray;const uw=cw?ow(cw):nw;var dw=Object.prototype.hasOwnProperty;const pw=function(e,t){var r=Tx(e),n=!r&&Gx(e),o=!r&&!n&&Xx(e),a=!r&&!n&&!o&&uw(e),i=r||n||o||a,s=i?Wx(e.length,String):[],l=s.length;for(var c in e)!t&&!dw.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ew(c,l))||s.push(c);return s};var fw=Object.prototype;const hw=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fw)};const mw=pb(Object.keys,Object);var gw=Object.prototype.hasOwnProperty;const vw=function(e){if(!hw(e))return mw(e);var t=[];for(var r in Object(e))gw.call(e,r)&&"constructor"!=r&&t.push(r);return t};const yw=function(e){return null!=e&&tw(e.length)&&!Db(e)};const bw=function(e){return yw(e)?pw(e):vw(e)};const xw=function(e){return Ax(e,bw,Bx)};var ww=Object.prototype.hasOwnProperty;const Sw=function(e,t,r,n,o,a){var i=1&r,s=xw(e),l=s.length;if(l!=xw(t).length&&!i)return!1;for(var c=l;c--;){var u=s[c];if(!(i?u in t:ww.call(t,u)))return!1}var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var f=!0;a.set(e,t),a.set(t,e);for(var h=i;++c<l;){var m=e[u=s[c]],g=t[u];if(n)var v=i?n(g,m,u,t,e,a):n(m,g,u,e,t,a);if(!(void 0===v?m===g||o(m,g,r,n,a):v)){f=!1;break}h||(h="constructor"==u)}if(f&&!h){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(f=!1)}return a.delete(e),a.delete(t),f};const kw=Yb(tb,"DataView");const Cw=Yb(tb,"Promise");const jw=Yb(tb,"Set");const $w=Yb(tb,"WeakMap");var Ew="[object Map]",_w="[object Promise]",Pw="[object Set]",Ow="[object WeakMap]",Rw="[object DataView]",Mw=Wb(kw),Nw=Wb(Xb),Iw=Wb(Cw),Tw=Wb(jw),Aw=Wb($w),Dw=db;(kw&&Dw(new kw(new ArrayBuffer(1)))!=Rw||Xb&&Dw(new Xb)!=Ew||Cw&&Dw(Cw.resolve())!=_w||jw&&Dw(new jw)!=Pw||$w&&Dw(new $w)!=Ow)&&(Dw=function(e){var t=db(e),r="[object Object]"==t?e.constructor:void 0,n=r?Wb(r):"";if(n)switch(n){case Mw:return Rw;case Nw:return Ew;case Iw:return _w;case Tw:return Pw;case Aw:return Ow}return t});const Fw=Dw;var zw="[object Arguments]",Lw="[object Array]",Bw="[object Object]",Ww=Object.prototype.hasOwnProperty;const Vw=function(e,t,r,n,o,a){var i=Tx(e),s=Tx(t),l=i?Lw:Fw(e),c=s?Lw:Fw(t),u=(l=l==zw?Bw:l)==Bw,d=(c=c==zw?Bw:c)==Bw,p=l==c;if(p&&Xx(e)){if(!Xx(t))return!1;i=!0,u=!1}if(p&&!u)return a||(a=new xx),i||uw(e)?Ex(e,t,r,n,o,a):Nx(e,t,l,r,n,o,a);if(!(1&r)){var f=u&&Ww.call(e,"__wrapped__"),h=d&&Ww.call(t,"__wrapped__");if(f||h){var m=f?e.value():e,g=h?t.value():t;return a||(a=new xx),o(m,g,r,n,a)}}return!!p&&(a||(a=new xx),Sw(e,t,r,n,o,a))};const Hw=function e(t,r,n,o,a){return t===r||(null==t||null==r||!hb(t)&&!hb(r)?t!==t&&r!==r:Vw(t,r,n,o,e,a))};const Uw=function(e,t,r){var n=(r="function"==typeof r?r:void 0)?r(e,t):void 0;return void 0===n?Hw(e,t,void 0,r):!!n};function qw(e,t){return Uw(e,t,((e,t)=>{if("function"===typeof e&&"function"===typeof t)return!0}))}const Gw=function(e){return"symbol"==typeof e||hb(e)&&"[object Symbol]"==db(e)};var Kw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qw=/^\w*$/;const Jw=function(e,t){if(Tx(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Gw(e))||(Qw.test(e)||!Kw.test(e)||null!=t&&e in Object(t))};function Yw(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Yw.Cache||vx),r}Yw.Cache=vx;const Xw=Yw;var Zw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eS=/\\(\\)?/g;const tS=function(e){var t=Xw(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Zw,(function(e,r,n,o){t.push(n?o.replace(eS,"$1"):r||e)})),t}));const rS=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o};var nS=rb?rb.prototype:void 0,oS=nS?nS.toString:void 0;const aS=function e(t){if("string"==typeof t)return t;if(Tx(t))return rS(t,e)+"";if(Gw(t))return oS?oS.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r};const iS=function(e){return null==e?"":aS(e)};const sS=function(e,t){return Tx(e)?e:Jw(e,t)?[e]:tS(iS(e))};const lS=function(e){if("string"==typeof e||Gw(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const cS=function(e,t){for(var r=0,n=(t=sS(t,e)).length;null!=e&&r<n;)e=e[lS(t[r++])];return r&&r==n?e:void 0};const uS=function(e,t,r){var n=null==e?void 0:cS(e,t);return void 0===n?r:n};var dS=Object.prototype.hasOwnProperty;const pS=function(e){if(null==e)return!0;if(yw(e)&&(Tx(e)||"string"==typeof e||"function"==typeof e.splice||Xx(e)||uw(e)||Gx(e)))return!e.length;var t=Fw(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(hw(e))return!vw(e).length;for(var r in e)if(dS.call(e,r))return!1;return!0};var fS=r(5492);const hS=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e};const mS=function(){try{var e=Yb(Object,"defineProperty");return e({},"",{}),e}catch(Ya){}}();const gS=function(e,t,r){"__proto__"==t&&mS?mS(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r};var vS=Object.prototype.hasOwnProperty;const yS=function(e,t,r){var n=e[t];vS.call(e,t)&&kb(n,r)&&(void 0!==r||t in e)||gS(e,t,r)};const bS=function(e,t,r,n){var o=!r;r||(r={});for(var a=-1,i=t.length;++a<i;){var s=t[a],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),o?gS(r,s,l):yS(r,s,l)}return r};const xS=function(e,t){return e&&bS(t,bw(t),e)};const wS=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t};var SS=Object.prototype.hasOwnProperty;const kS=function(e){if(!Ab(e))return wS(e);var t=hw(e),r=[];for(var n in e)("constructor"!=n||!t&&SS.call(e,n))&&r.push(n);return r};const CS=function(e){return yw(e)?pw(e,!0):kS(e)};const jS=function(e,t){return e&&bS(t,CS(t),e)};var $S="object"==typeof exports&&exports&&!exports.nodeType&&exports,ES=$S&&"object"==typeof module&&module&&!module.nodeType&&module,_S=ES&&ES.exports===$S?tb.Buffer:void 0,PS=_S?_S.allocUnsafe:void 0;const OS=function(e,t){if(t)return e.slice();var r=e.length,n=PS?PS(r):new e.constructor(r);return e.copy(n),n};const RS=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};const MS=function(e,t){return bS(e,Bx(e),t)};const NS=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ix(t,Bx(e)),e=fb(e);return t}:Fx;const IS=function(e,t){return bS(e,NS(e),t)};const TS=function(e){return Ax(e,CS,NS)};var AS=Object.prototype.hasOwnProperty;const DS=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&AS.call(e,"index")&&(r.index=e.index,r.input=e.input),r};const FS=function(e){var t=new e.constructor(e.byteLength);return new _x(t).set(new _x(e)),t};const zS=function(e,t){var r=t?FS(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)};var LS=/\w*$/;const BS=function(e){var t=new e.constructor(e.source,LS.exec(e));return t.lastIndex=e.lastIndex,t};var WS=rb?rb.prototype:void 0,VS=WS?WS.valueOf:void 0;const HS=function(e){return VS?Object(VS.call(e)):{}};const US=function(e,t){var r=t?FS(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)};const qS=function(e,t,r){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return FS(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return zS(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return US(e,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return BS(e);case"[object Symbol]":return HS(e)}};var GS=Object.create;const KS=function(){function e(){}return function(t){if(!Ab(t))return{};if(GS)return GS(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const QS=function(e){return"function"!=typeof e.constructor||hw(e)?{}:KS(fb(e))};const JS=function(e){return hb(e)&&"[object Map]"==Fw(e)};var YS=lw&&lw.isMap;const XS=YS?ow(YS):JS;const ZS=function(e){return hb(e)&&"[object Set]"==Fw(e)};var ek=lw&&lw.isSet;const tk=ek?ow(ek):ZS;var rk="[object Arguments]",nk="[object Function]",ok="[object Object]",ak={};ak[rk]=ak["[object Array]"]=ak["[object ArrayBuffer]"]=ak["[object DataView]"]=ak["[object Boolean]"]=ak["[object Date]"]=ak["[object Float32Array]"]=ak["[object Float64Array]"]=ak["[object Int8Array]"]=ak["[object Int16Array]"]=ak["[object Int32Array]"]=ak["[object Map]"]=ak["[object Number]"]=ak[ok]=ak["[object RegExp]"]=ak["[object Set]"]=ak["[object String]"]=ak["[object Symbol]"]=ak["[object Uint8Array]"]=ak["[object Uint8ClampedArray]"]=ak["[object Uint16Array]"]=ak["[object Uint32Array]"]=!0,ak["[object Error]"]=ak[nk]=ak["[object WeakMap]"]=!1;const ik=function e(t,r,n,o,a,i){var s,l=1&r,c=2&r,u=4&r;if(n&&(s=a?n(t,o,a,i):n(t)),void 0!==s)return s;if(!Ab(t))return t;var d=Tx(t);if(d){if(s=DS(t),!l)return RS(t,s)}else{var p=Fw(t),f=p==nk||"[object GeneratorFunction]"==p;if(Xx(t))return OS(t,l);if(p==ok||p==rk||f&&!a){if(s=c||f?{}:QS(t),!l)return c?IS(t,jS(s,t)):MS(t,xS(s,t))}else{if(!ak[p])return a?t:{};s=qS(t,p,l)}}i||(i=new xx);var h=i.get(t);if(h)return h;i.set(t,s),tk(t)?t.forEach((function(o){s.add(e(o,r,n,o,t,i))})):XS(t)&&t.forEach((function(o,a){s.set(a,e(o,r,n,a,t,i))}));var m=d?void 0:(u?c?TS:xw:c?CS:bw)(t);return hS(m||t,(function(o,a){m&&(o=t[a=o]),yS(s,a,e(o,r,n,a,t,i))})),s};const sk=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const lk=function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++n<o;)a[n]=e[n+t];return a};const ck=function(e,t){return t.length<2?e:cS(e,lk(t,0,-1))};const uk=function(e,t){return t=sS(t,e),null==(e=ck(e,t))||delete e[lS(sk(t))]};const dk=function(e){return xb(e)?void 0:e};var pk=rb?rb.isConcatSpreadable:void 0;const fk=function(e){return Tx(e)||Gx(e)||!!(pk&&e&&e[pk])};const hk=function e(t,r,n,o,a){var i=-1,s=t.length;for(n||(n=fk),a||(a=[]);++i<s;){var l=t[i];r>0&&n(l)?r>1?e(l,r-1,n,o,a):Ix(a,l):o||(a[a.length]=l)}return a};const mk=function(e){return(null==e?0:e.length)?hk(e,1):[]};const gk=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)};var vk=Math.max;const yk=function(e,t,r){return t=vk(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=vk(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),gk(e,this,s)}};const bk=function(e){return function(){return e}};const xk=function(e){return e};const wk=mS?function(e,t){return mS(e,"toString",{configurable:!0,enumerable:!1,value:bk(t),writable:!0})}:xk;var Sk=Date.now;const kk=function(e){var t=0,r=0;return function(){var n=Sk(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(wk);const Ck=function(e){return kk(yk(e,void 0,mk),e+"")};const jk=Ck((function(e,t){var r={};if(null==e)return r;var n=!1;t=rS(t,(function(t){return t=sS(t,e),n||(n=t.length>1),t})),bS(e,TS(e),r),n&&(r=ik(r,7,dk));for(var o=t.length;o--;)uk(r,t[o]);return r}));function $k(e,t){const r=t[e];return[jk(t,[e]),r]}function Ek(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=e||"";let o;if(!n.startsWith("#"))throw new Error(`Could not find a definition for ${e}.`);o=decodeURIComponent(n.substring(1));const a=fS.get(t,o);if(void 0===a)throw new Error(`Could not find a definition for ${e}.`);const i=a[qy];if(i){if(r.includes(i)){if(1===r.length)throw new Error(`Definition for ${e} is a circular reference`);const[t,...o]=r,a=[...o,n,t].join(" -> ");throw new Error(`Definition for ${t} contains a circular reference through ${a}`)}const[o,s]=$k(qy,a),l=Ek(s,t,[...r,n]);return Object.keys(o).length>0?{...o,...l}:l}return a}function _k(e){return Ek(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[])}var Pk=Object.prototype.hasOwnProperty;const Ok=function(e,t){return null!=e&&Pk.call(e,t)};const Rk=function(e,t,r){for(var n=-1,o=(t=sS(t,e)).length,a=!1;++n<o;){var i=lS(t[n]);if(!(a=null!=e&&r(e,i)))break;e=e[i]}return a||++n!=o?a:!!(o=null==e?0:e.length)&&tw(o)&&ew(i,o)&&(Tx(e)||Gx(e))};const Mk=function(e,t){return null!=e&&Rk(e,t,Ok)};const Nk=function(e){return"number"==typeof e||hb(e)&&"[object Number]"==db(e)};const Ik=function(e){return"string"==typeof e||!Tx(e)&&hb(e)&&"[object String]"==db(e)};const Tk=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r};const Ak=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),s=i.length;s--;){var l=i[e?s:++o];if(!1===r(a[l],l,a))break}return t}}();const Dk=function(e,t){return e&&Ak(e,t,bw)};const Fk=function(e,t){return function(r,n){if(null==r)return r;if(!yw(r))return e(r,n);for(var o=r.length,a=t?o:-1,i=Object(r);(t?a--:++a<o)&&!1!==n(i[a],a,i););return r}}(Dk);const zk=function(e,t,r,n){var o=r.length,a=o,i=!n;if(null==e)return!a;for(e=Object(e);o--;){var s=r[o];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<a;){var l=(s=r[o])[0],c=e[l],u=s[1];if(i&&s[2]){if(void 0===c&&!(l in e))return!1}else{var d=new xx;if(n)var p=n(c,u,l,e,t,d);if(!(void 0===p?Hw(u,c,3,n,d):p))return!1}}return!0};const Lk=function(e){return e===e&&!Ab(e)};const Bk=function(e){for(var t=bw(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Lk(o)]}return t};const Wk=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}};const Vk=function(e){var t=Bk(e);return 1==t.length&&t[0][2]?Wk(t[0][0],t[0][1]):function(r){return r===e||zk(r,e,t)}};const Hk=function(e,t){return null!=e&&t in Object(e)};const Uk=function(e,t){return null!=e&&Rk(e,t,Hk)};const qk=function(e,t){return Jw(e)&&Lk(t)?Wk(lS(e),t):function(r){var n=uS(r,e);return void 0===n&&n===t?Uk(r,e):Hw(t,n,3)}};const Gk=function(e){return function(t){return null==t?void 0:t[e]}};const Kk=function(e){return function(t){return cS(t,e)}};const Qk=function(e){return Jw(e)?Gk(lS(e)):Kk(e)};const Jk=function(e){return"function"==typeof e?e:null==e?xk:"object"==typeof e?Tx(e)?qk(e[0],e[1]):Vk(e):Qk(e)};const Yk=function(e,t,r,n,o){return o(e,(function(e,o,a){r=n?(n=!1,e):t(r,e,o,a)})),r};const Xk=function(e,t,r){var n=Tx(e)?Tk:Yk,o=arguments.length<3;return n(e,Jk(t,4),r,o,Fk)};const Zk=function(e){return"function"==typeof e?e:xk};var eC=/\s/;const tC=function(e){for(var t=e.length;t--&&eC.test(e.charAt(t)););return t};var rC=/^\s+/;const nC=function(e){return e?e.slice(0,tC(e)+1).replace(rC,""):e};var oC=/^[-+]0x[0-9a-f]+$/i,aC=/^0b[01]+$/i,iC=/^0o[0-7]+$/i,sC=parseInt;const lC=function(e){if("number"==typeof e)return e;if(Gw(e))return NaN;if(Ab(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ab(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=nC(e);var r=aC.test(e);return r||iC.test(e)?sC(e.slice(2),r?2:8):oC.test(e)?NaN:+e};var cC=1/0;const uC=function(e){return e?(e=lC(e))===cC||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0};const dC=function(e){var t=uC(e),r=t%1;return t===t?r?t-r:t:0};var pC=4294967295,fC=Math.min;const hC=function(e,t){if((e=dC(e))<1||e>9007199254740991)return[];var r=pC,n=fC(e,pC);t=Zk(t),e-=pC;for(var o=Wx(n,t);++r<e;)t(r);return o};function mC(e,t,r){var n;if(e&&r){const o=uS(e,r);if(void 0===o)return;for(let e=0;e<t.length;e++){const a=t[e],i=uS(a,[Vy,r],{});if("object"!==i.type&&"array"!==i.type){if(i.const===o)return e;if(null===(n=i.enum)||void 0===n?void 0:n.includes(o))return e}}}}function gC(e,t,r,n,o){if(void 0===t)return 0;const a=mC(t,r,o);if(Nk(a))return a;for(let i=0;i<r.length;i++){const a=r[i];if(o&&Mk(a,[Vy,o])){const r=uS(t,o),s=uS(a,[Vy,o],{});if(e.isValid(s,r,n))return i}else if(a[Vy]){const r={anyOf:Object.keys(a[Vy]).map((e=>({required:[e]})))};let o;if(a.anyOf){const{...e}=a;e.allOf?e.allOf=e.allOf.slice():e.allOf=[],e.allOf.push(r),o=e}else o=Object.assign({},a,r);if(delete o.required,e.isValid(o,t,n))return i}else if(e.isValid(a,t,n))return i}return 0}function vC(e,t,r,n,o){return gC(e,t,r,n,o)}const yC=function(e,t,r,n){if(!Ab(e))return e;for(var o=-1,a=(t=sS(t,e)).length,i=a-1,s=e;null!=s&&++o<a;){var l=lS(t[o]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=i){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=Ab(u)?u:ew(t[o+1])?[]:{})}yS(s,l,c),s=s[l]}return e};const bC=function(e,t,r){return null==e?e:yC(e,t,r)};const xC=function(e,t,r){var n=Tx(e),o=n||Xx(e)||uw(e);if(t=Jk(t,4),null==r){var a=e&&e.constructor;r=o?n?new a:[]:Ab(e)&&Db(a)?KS(fb(e)):{}}return(o?hS:Dk)(e,(function(e,n,o){return t(r,e,n,o)})),r};const wC=function(e,t,r){(void 0!==r&&!kb(e[t],r)||void 0===r&&!(t in e))&&gS(e,t,r)};const SC=function(e){return hb(e)&&yw(e)};const kC=function(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]};const CC=function(e){return bS(e,CS(e))};const jC=function(e,t,r,n,o,a,i){var s=kC(e,r),l=kC(t,r),c=i.get(l);if(c)wC(e,r,c);else{var u=a?a(s,l,r+"",e,t,i):void 0,d=void 0===u;if(d){var p=Tx(l),f=!p&&Xx(l),h=!p&&!f&&uw(l);u=l,p||f||h?Tx(s)?u=s:SC(s)?u=RS(s):f?(d=!1,u=OS(l,!0)):h?(d=!1,u=US(l,!0)):u=[]:xb(l)||Gx(l)?(u=s,Gx(s)?u=CC(s):Ab(s)&&!Db(s)||(u=QS(l))):d=!1}d&&(i.set(l,u),o(u,l,n,a,i),i.delete(l)),wC(e,r,u)}};const $C=function e(t,r,n,o,a){t!==r&&Ak(r,(function(i,s){if(a||(a=new xx),Ab(i))jC(t,r,s,n,e,o,a);else{var l=o?o(kC(t,s),i,s+"",t,r,a):void 0;void 0===l&&(l=i),wC(t,s,l)}}),CS)};const EC=function(e,t){return kk(yk(e,t,xk),e+"")};const _C=function(e,t,r){if(!Ab(r))return!1;var n=typeof t;return!!("number"==n?yw(r)&&ew(t,r.length):"string"==n&&t in r)&&kb(r[t],e)};const PC=function(e){return EC((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&_C(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t}))}((function(e,t,r){$C(e,t,r)}));const OC=function(e){return(null==e?0:e.length)?hk(e,Infinity):[]};const RC=function(e,t,r,n){for(var o=e.length,a=r+(n?1:-1);n?a--:++a<o;)if(t(e[a],a,e))return a;return-1};const MC=function(e){return e!==e};const NC=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1};const IC=function(e,t,r){return t===t?NC(e,t,r):RC(e,MC,r)};const TC=function(e,t){return!!(null==e?0:e.length)&&IC(e,t,0)>-1};const AC=function(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1};const DC=function(){};var FC=jw&&1/Ox(new jw([,-0]))[1]==1/0?function(e){return new jw(e)}:DC;const zC=FC;const LC=function(e,t,r){var n=-1,o=TC,a=e.length,i=!0,s=[],l=s;if(r)i=!1,o=AC;else if(a>=200){var c=t?null:zC(e);if(c)return Ox(c);i=!1,o=$x,l=new Cx}else l=t?[]:s;e:for(;++n<a;){var u=e[n],d=t?t(u):u;if(u=r||0!==u?u:0,i&&d===d){for(var p=l.length;p--;)if(l[p]===d)continue e;t&&l.push(d),s.push(u)}else o(l,d,r)||(l!==s&&l.push(d),s.push(u))}return s};const BC=function(e){return e&&e.length?LC(e):[]};var WC=r(2093),VC=r.n(WC);function HC(e){let t;const r=uS(e,"discriminator.propertyName",void 0);return Ik(r)?t=r:void 0!==r&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function UC(e){return Array.isArray(e)?"array":"string"===typeof e?"string":null==e?"null":"boolean"===typeof e?"boolean":isNaN(e)?"object"===typeof e?"object":"string":"number"}const qC=EC((function(e){return LC(hk(e,1,SC,!0))}));function GC(e){let{type:t}=e;return!t&&e.const?UC(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&(t=2===t.length&&t.includes("null")?t.find((e=>"null"!==e)):t[0]),t):"object"}function KC(e,t){const r=Object.assign({},e);return Object.keys(t).reduce(((r,n)=>{const o=e?e[n]:{},a=t[n];return e&&n in e&&Ey(a)?r[n]=KC(o,a):e&&t&&("object"===GC(e)||"object"===GC(t))&&n===Hy&&Array.isArray(o)&&Array.isArray(a)?r[n]=qC(o,a):r[n]=a,r}),r)}function QC(e,t){return ZC(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3?arguments[3]:void 0,void 0,void 0,arguments.length>4?arguments[4]:void 0)[0]}function JC(e){const t=e.reduce(((e,t)=>t.length>1?t.flatMap((t=>hC(e.length,(r=>[...e[r]].concat(t))))):(e.forEach((e=>e.push(t[0]))),e)),[[]]);return t}function YC(e,t,r,n,o,a,i){const s=XC(t,r,o);return s!==t?ZC(e,s,r,a,n,o,i):[t]}function XC(e,t,r){if(!Ey(e))return e;let n=e;if(qy in n){const{$ref:e,...o}=n;if(r.includes(e))return n;r.push(e);n={..._k(e,t),...o}}if(Vy in n){const e=[],o=xC(n[Vy],((n,o,a)=>{const i=[...r];n[a]=XC(o,t,i),e.push(i)}),{});PC(r,BC(OC(e))),n={...n,[Vy]:o}}return Ly in n&&!Array.isArray(n.items)&&"boolean"!==typeof n.items&&(n={...n,items:XC(n.items,t,r)}),qw(e,n)?e:n}function ZC(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],i=arguments.length>6?arguments[6]:void 0;if(!Ey(t))return[{}];const s=function(e,t,r,n,o,a,i){const s=YC(e,t,r,n,o,a);if(s.length>1||s[0]!==t)return s;if(Ty in t)return ej(e,t,r,n,o,a).flatMap((t=>ZC(e,t,r,a,n,o,i)));if(Ry in t&&Array.isArray(t.allOf))return JC(t.allOf.map((t=>ZC(e,t,r,a,n,o,i)))).map((e=>({...t,allOf:e})));return[t]}(e,t,r,o,a,n,i);return s.flatMap((t=>{var s;let l=t;if(zy in l)return function(e,t,r,n,o,a,i){const{if:s,then:l,else:c,...u}=t,d=e.isValid(s,a||{},r);let p=[u],f=[];if(n)l&&"boolean"!==typeof l&&(f=f.concat(ZC(e,l,r,a,n,o,i))),c&&"boolean"!==typeof c&&(f=f.concat(ZC(e,c,r,a,n,o,i)));else{const t=d?l:c;t&&"boolean"!==typeof t&&(f=f.concat(ZC(e,t,r,a,n,o,i)))}return f.length&&(p=f.map((e=>KC(u,e)))),p.flatMap((t=>ZC(e,t,r,a,n,o,i)))}(e,l,r,o,a,n,i);if(Ry in l){if(o){const{allOf:e,...t}=l;return[...e,t]}try{const e=[],t=[];null===(s=l.allOf)||void 0===s||s.forEach((r=>{"object"===typeof r&&r.contains?e.push(r):t.push(r)})),e.length&&(l={...l,allOf:t}),l=i?i(l):VC()(l,{deep:!1}),e.length&&(l.allOf=e)}catch(Ya){console.warn("could not merge subschemas in allOf:\n",Ya);const{allOf:t,...r}=l;return r}}return Oy in l&&!1!==l.additionalProperties?function(e,t,r,n,o){const a={...t,properties:{...t.properties}},i=n&&Ey(n)?n:{};return Object.keys(i).forEach((t=>{if(t in a.properties)return;let n={};n="boolean"!==typeof a.additionalProperties?qy in a.additionalProperties?QC(e,{$ref:uS(a.additionalProperties,[qy])},r,i,o):"type"in a.additionalProperties?{...a.additionalProperties}:My in a.additionalProperties||Wy in a.additionalProperties?{type:"object",...a.additionalProperties}:{type:UC(uS(i,[t]))}:{type:UC(uS(i,[t]))},a.properties[t]=n,bC(a.properties,[t,Py],!0)})),a}(e,l,r,n,i):l}))}function ej(e,t,r,n,o,a,i){const{dependencies:s,...l}=t,c=function(e,t,r,n,o){let a;const{oneOf:i,anyOf:s,...l}=t;if(Array.isArray(i)?a=i:Array.isArray(s)&&(a=s),a){const i=void 0===o&&n?{}:o,s=HC(t);a=a.map((e=>XC(e,r,[])));const c=vC(e,i,a,r,s);if(n)return a.map((e=>KC(l,e)));t=KC(l,a[c])}return[t]}(e,l,r,n,a);return c.flatMap((t=>tj(e,s,t,r,n,o,a,i)))}function tj(e,t,r,n,o,a,i,s){let l=[r];for(const c in t){if(!o&&void 0===uS(i,[c]))continue;if(r.properties&&!(c in r.properties))continue;const[u,d]=$k(c,t);return Array.isArray(d)?l[0]=rj(r,d):Ey(d)&&(l=nj(e,r,n,c,d,o,a,i,s)),l.flatMap((t=>tj(e,u,t,n,o,a,i,s)))}return l}function rj(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function nj(e,t,r,n,o,a,i,s,l){return ZC(e,o,r,s,a,i,l).flatMap((o=>{const{oneOf:c,...u}=o;if(t=KC(t,u),void 0===c)return t;return JC(c.map((t=>"boolean"!==typeof t&&qy in t?YC(e,t,r,a,i,s):[t]))).flatMap((o=>function(e,t,r,n,o,a,i,s,l){const c=o.filter((t=>{if("boolean"===typeof t||!t||!t.properties)return!1;const{[n]:o}=t.properties;if(o){const t={type:"object",properties:{[n]:o}};return e.isValid(t,s,r)||a}return!1}));if(!a&&1!==c.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t];return c.flatMap((o=>{const c=o,[u]=$k(n,c.properties),d={...c,properties:u};return ZC(e,d,r,s,a,i,l).map((e=>KC(t,e)))}))}(e,t,r,n,o,a,i,s,l)))}))}const oj={type:"object",$id:"_$junk_option_schema_id$_",properties:{__not_really_there__:{type:"number"}}};function aj(e,t,r,n,o){let a=0;return r&&(Ab(r.properties)?a+=Xk(r.properties,((r,a,i)=>{const s=uS(n,i);if("boolean"===typeof a)return r;if(Mk(a,qy)){const n=QC(e,a,t,s,o);return r+aj(e,t,n,s||{},o)}if((Mk(a,Wy)||Mk(a,My))&&s){const n=Mk(a,Wy)?Wy:My,i=HC(a);return r+ij(e,t,s,uS(a,n),-1,i,o)}if("object"===a.type)return Ab(s)&&(r+=1),r+aj(e,t,a,s,o);if(a.type===UC(s)){let e=r+1;return a.default?e+=s===a.default?1:-1:a.const&&(e+=s===a.const?1:-1),e}return r}),0):Ik(r.type)&&r.type===UC(n)&&(a+=1)),a}function ij(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0;const s=n.map((e=>XC(e,t,[]))),l=mC(r,n,a);if(Nk(l))return l;const c=s.reduce(((n,o,i)=>(1===vC(e,r,[oj,o],t,a)&&n.push(i),n)),[]);if(1===c.length)return c[0];c.length||hC(s.length,(e=>c.push(e)));const u=new Set,{bestIndex:d}=c.reduce(((n,o)=>{const{bestScore:a}=n,l=s[o],c=aj(e,t,l,r,i);return u.add(c),c>a?{bestIndex:o,bestScore:c}:n}),{bestIndex:o,bestScore:0});return 1===u.size&&o>=0?o:d}function sj(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((e=>Ey(e)))}const lj=function(e){return null==e};function cj(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Array.isArray(t)){const a=Array.isArray(e)?e:[],i=o?t:a,s=(o?a:t).map(((e,s)=>void 0!==i[s]?cj(a[s],t[s],r,n,o):e));return(r||o)&&s.length<i.length&&s.push(...i.slice(s.length)),s}if(Ey(t)){const a=Object.assign({},e);return Object.keys(t).reduce(((a,i)=>{const s=uS(t,i),l=Ey(e)&&i in e,c=i in t;return a[i]=cj(e?uS(e,i):{},s,r,n,o&&(l||!c)),a}),a)}return n&&(!lj(e)&&lj(t)||"number"===typeof t&&isNaN(t))||o&&!lj(t)?e:t}function uj(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object.keys(t).reduce(((n,o)=>{const a=e?e[o]:{},i=t[o];if(e&&o in e&&Ey(i))n[o]=uj(a,i,r);else if(r&&Array.isArray(a)&&Array.isArray(i)){let e=i;"preventDuplicates"===r&&(e=i.reduce(((e,t)=>(a.includes(t)||e.push(t),e)),[])),n[o]=a.concat(e)}else n[o]=i;return n}),Object.assign({},e))}function dj(e){return Array.isArray(e.enum)&&1===e.enum.length||Ny in e}function pj(e,t){const r=QC(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},void 0,arguments.length>3?arguments[3]:void 0),n=r.oneOf||r.anyOf;return!!Array.isArray(r.enum)||!!Array.isArray(n)&&n.every((e=>"boolean"!==typeof e&&dj(e)))}function fj(e,t,r,n){return!(!t.uniqueItems||!t.items||"boolean"===typeof t.items)&&pj(e,t.items,r,n)}function hj(e){const t=e[Ny],r=GC(e);return Ey(t)&&Ik(null===t||void 0===t?void 0:t.$data)&&"object"!==r&&"array"!==r}function mj(e,t){const r=e;if(e.enum){let n;if(t){const{enumNames:e}=Yy(t);n=e}return!n&&r.enumNames&&(n=r.enumNames),e.enum.map(((e,t)=>({label:(null===n||void 0===n?void 0:n[t])||String(e),value:e})))}let n,o;return e.anyOf?(n=e.anyOf,o=null===t||void 0===t?void 0:t.anyOf):e.oneOf&&(n=e.oneOf,o=null===t||void 0===t?void 0:t.oneOf),n&&n.map(((e,t)=>{const{title:r}=Yy(null===o||void 0===o?void 0:o[t]),n=e,a=function(e){if(Ay in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(Ny in e)return e.const;throw new Error("schema cannot be inferred as a constant")}(n);return{schema:n,label:r||n.title||String(a),value:a}}))}const gj=["string","number","integer","boolean","null"];var vj;function yj(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vj.Ignore,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(r>=0){if(Array.isArray(e.items)&&r<e.items.length){const t=e.items[r];if("boolean"!==typeof t)return t}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!==typeof e.items)return e.items;return t!==vj.Ignore&&Ey(e.additionalItems)?e.additionalItems:{}}function bj(e,t,r,n,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const{emptyObjectFields:l="populateAllDefaults"}=i;if(n||s)e[t]=r;else if("skipDefaults"!==l){const n=void 0===o?a.includes(t):o;Ey(r)?"skipEmptyDefaults"===l?pS(r)||(e[t]=r):pS(r)&&!a.includes(t)||!n&&"populateRequiredDefaults"===l||(e[t]=r):void 0!==r&&("populateAllDefaults"===l||"skipEmptyDefaults"===l||n&&a.includes(t))&&(e[t]=r)}}function xj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{parentDefaults:n,rawFormData:o,rootSchema:a={},includeUndefinedValues:i=!1,_recurseList:s=[],experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:c,required:u,shouldMergeDefaultsIntoFormData:d=!1}=r,p=Ey(o)?o:{},f=Ey(t)?t:{};let h=n,m=null,g=l,v=s;if(f[Ny]&&"never"!==(null===l||void 0===l?void 0:l.constAsDefaults)&&!hj(f))h=f[Ny];else if(Ey(h)&&Ey(f.default))h=uj(h,f.default);else if(Iy in f)h=f.default;else if(qy in f){const e=f[qy];s.includes(e)||(v=s.concat(e),m=_k(e,a))}else if(Ty in f){const t={...wj(e,f,r,h),...p};m=ej(e,f,a,!1,[],t,c)[0]}else if(sj(f))h=f.items.map(((t,r)=>xj(e,t,{rootSchema:a,includeUndefinedValues:i,_recurseList:s,experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:c,parentDefaults:Array.isArray(n)?n[r]:void 0,rawFormData:p,required:u,shouldMergeDefaultsIntoFormData:d})));else if(Wy in f){const{oneOf:t,...r}=f;if(0===t.length)return;const n=HC(f),{type:i="null"}=r;!Array.isArray(i)&&gj.includes(i)&&"skipOneOf"===(null===g||void 0===g?void 0:g.constAsDefaults)&&(g={...g,constAsDefaults:"never"}),m=t[ij(e,a,o,t,0,n,c)],m=KC(r,m)}else if(My in f){const{anyOf:t,...r}=f;if(0===t.length)return;const n=HC(f);m=t[ij(e,a,o,t,0,n,c)],m=KC(r,m)}if(m)return xj(e,m,{rootSchema:a,includeUndefinedValues:i,_recurseList:v,experimental_defaultFormStateBehavior:g,experimental_customMergeAllOf:c,parentDefaults:h,rawFormData:p,required:u,shouldMergeDefaultsIntoFormData:d});void 0===h&&(h=f.default);const y=wj(e,f,r,h);let b=null!==y&&void 0!==y?y:h;if(d){const{arrayMinItems:t={}}=l||{},{mergeExtraDefaults:r}=t,n=function(e,t,r,n,o,a){const i=!dj(t)&&pj(e,t,r,a);let s=n;if(i){const e=mj(t);s=(null===e||void 0===e?void 0:e.some((e=>qw(e.value,n))))?n:void 0}const l=t[Ny]&&"always"===(null===o||void 0===o?void 0:o.constAsDefaults);l&&(s=t.const);return s}(e,f,a,o,l,c);Ey(o)||(b=cj(b,n,r,!0))}return b}function wj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;switch(GC(t)){case"object":return function(e,t){let{rawFormData:r,rootSchema:n={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,required:l,shouldMergeDefaultsIntoFormData:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;{const d=Ey(r)?r:{},p=t,f="populateDefaults"===(null===i||void 0===i?void 0:i.allOf)&&Ry in p?QC(e,p,n,d,s):p,h=f[Ny],m=Object.keys(f.properties||{}).reduce(((t,r)=>{var p;const m=uS(f,[Vy,r]),g=Ey(h)&&void 0!==h[r],v=(Ey(m)&&Ny in m||g)&&"never"!==(null===i||void 0===i?void 0:i.constAsDefaults)&&!hj(m);return bj(t,r,xj(e,m,{rootSchema:n,_recurseList:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,includeUndefinedValues:!0===o,parentDefaults:uS(u,[r]),rawFormData:uS(d,[r]),required:null===(p=f.required)||void 0===p?void 0:p.includes(r),shouldMergeDefaultsIntoFormData:c}),o,l,f.required,i,v),t}),{});if(f.additionalProperties){const t=Ey(f.additionalProperties)?f.additionalProperties:{},r=new Set;Ey(u)&&Object.keys(u).filter((e=>!f.properties||!f.properties[e])).forEach((e=>r.add(e)));const p=[];Object.keys(d).filter((e=>!f.properties||!f.properties[e])).forEach((e=>{r.add(e),p.push(e)})),r.forEach((r=>{var h;const g=xj(e,t,{rootSchema:n,_recurseList:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,includeUndefinedValues:!0===o,parentDefaults:uS(u,[r]),rawFormData:uS(d,[r]),required:null===(h=f.required)||void 0===h?void 0:h.includes(r),shouldMergeDefaultsIntoFormData:c});bj(m,r,g,o,l,p)}))}return m}}(e,t,r,n);case"array":return function(e,t){let{rawFormData:r,rootSchema:n={},_recurseList:o=[],experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,required:s,shouldMergeDefaultsIntoFormData:l}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0;var u,d;const p=t,f=null!==(u=null===a||void 0===a?void 0:a.arrayMinItems)&&void 0!==u?u:{},{populate:h,mergeExtraDefaults:m}=f,g="never"===h,v="requiredOnly"===h,y="all"===h||!g&&!v,b=null!==(d=null===f||void 0===f?void 0:f.computeSkipPopulate)&&void 0!==d?d:()=>!1,x="skipEmptyDefaults"===(null===a||void 0===a?void 0:a.emptyObjectFields)?void 0:[];if(Array.isArray(c)&&(c=c.map(((t,r)=>{const c=yj(p,vj.Fallback,r);return xj(e,c,{rootSchema:n,_recurseList:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,parentDefaults:t,required:s,shouldMergeDefaultsIntoFormData:l})}))),Array.isArray(r)){const t=yj(p);if(g)c=r;else{const u=r.map(((r,u)=>xj(e,t,{rootSchema:n,_recurseList:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,rawFormData:r,parentDefaults:uS(c,[u]),required:s,shouldMergeDefaultsIntoFormData:l})));c=cj(c,u,(v&&s||y)&&m)}}if(!1===(Ey(p)&&Ny in p&&"never"!==(null===a||void 0===a?void 0:a.constAsDefaults))){if(g)return null!==c&&void 0!==c?c:x;if(v&&!s)return c||void 0}const w=Array.isArray(c)?c.length:0;if(!p.minItems||fj(e,p,n,i)||b(e,p,n)||p.minItems<=w)return c||x;const S=c||[],k=yj(p,vj.Invert),C=k.default,j=new Array(p.minItems-w).fill(xj(e,k,{parentDefaults:C,rootSchema:n,_recurseList:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,required:s,shouldMergeDefaultsIntoFormData:l}));return S.concat(j)}(e,t,r,n)}}function Sj(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0;if(!Ey(t))throw new Error("Invalid schema: "+t);const s=xj(e,QC(e,t,n,r,i),{rootSchema:n,includeUndefinedValues:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,rawFormData:r,shouldMergeDefaultsIntoFormData:!0});if(Ey(r)||Array.isArray(r)){const{mergeDefaultsIntoFormData:e}=a||{};return cj(s,r,!0,"useDefaultIfFormDataUndefined"===e,!0)}return s}function kj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"widget"in Yy(e)&&"hidden"!==Yy(e).widget}function Cj(e,t){let r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if("files"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})[Qy])return!0;if(t.items){const o=QC(e,t.items,r,void 0,n);return"string"===o.type&&"data-url"===o.format}return!1}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(vj||(vj={}));const jj=Symbol("no Value");function $j(e,t,r,n){let o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5?arguments[5]:void 0;if(Mk(r,Vy)){const s={};if(Mk(n,Vy)){const e=uS(n,Vy,{});Object.keys(e).forEach((e=>{Mk(a,e)&&(s[e]=void 0)}))}const l=Object.keys(uS(r,Vy,{})),c={};l.forEach((o=>{const l=uS(a,o);let u=uS(n,[Vy,o],{}),d=uS(r,[Vy,o],{});Mk(u,qy)&&(u=QC(e,u,t,l,i)),Mk(d,qy)&&(d=QC(e,d,t,l,i));const p=uS(u,"type"),f=uS(d,"type");if(!p||p===f)if(Mk(s,o)&&delete s[o],"object"===f||"array"===f&&Array.isArray(l)){const r=$j(e,t,d,u,l,i);void 0===r&&"array"!==f||(c[o]=r)}else{const e=uS(d,"default",jj),t=uS(u,"default",jj);e!==jj&&e!==l&&(t===l?s[o]=e:!0===uS(d,"readOnly")&&(s[o]=void 0));const r=uS(d,"const",jj),n=uS(u,"const",jj);r!==jj&&r!==l&&(s[o]=n===l?r:void 0)}})),o={..."string"==typeof a||Array.isArray(a)?void 0:a,...s,...c}}else if("array"===uS(n,"type")&&"array"===uS(r,"type")&&Array.isArray(a)){let s=uS(n,"items"),l=uS(r,"items");if("object"!==typeof s||"object"!==typeof l||Array.isArray(s)||Array.isArray(l))"boolean"===typeof s&&"boolean"===typeof l&&s===l&&(o=a);else{Mk(s,qy)&&(s=QC(e,s,t,a,i)),Mk(l,qy)&&(l=QC(e,l,t,a,i));const n=uS(s,"type"),c=uS(l,"type");if(!n||n===c){const n=uS(r,"maxItems",-1);o="object"===c?a.reduce(((r,o)=>{const a=$j(e,t,l,s,o,i);return void 0!==a&&(n<0||r.length<n)&&r.push(a),r}),[]):n>0&&a.length>n?a.slice(0,n):a}}}return o}function Ej(e,t,r,n,o,a,i){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],l=arguments.length>8?arguments[8]:void 0;if(qy in t||Ty in t||Ry in t){const c=QC(e,t,a,i,l);if(-1===s.findIndex((e=>qw(e,c))))return Ej(e,c,r,n,o,a,i,s.concat(c),l)}if(Ly in t&&!uS(t,[Ly,qy]))return Ej(e,uS(t,Ly),r,n,o,a,i,s,l);const c={$id:o||r};if("object"===GC(t)&&Vy in t)for(const u in t.properties){const o=uS(t,[Vy,u]),d=c[Fy]+n+u;c[u]=Ej(e,Ey(o)?o:{},r,n,d,a,uS(i,[u]),s,l)}return c}function _j(e,t,r,n,o){return Ej(e,t,arguments.length>5&&void 0!==arguments[5]?arguments[5]:"root",arguments.length>6&&void 0!==arguments[6]?arguments[6]:"_",r,n,o,void 0,arguments.length>7?arguments[7]:void 0)}function Pj(e,t,r,n,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],i=arguments.length>6?arguments[6]:void 0;if(qy in t||Ty in t||Ry in t){const s=QC(e,t,n,o,i);if(-1===a.findIndex((e=>qw(e,s))))return Pj(e,s,r,n,o,a.concat(s),i)}let s={[By]:r.replace(/^\./,"")};if(Wy in t||My in t){const l=Wy in t?t.oneOf:t.anyOf,c=HC(t),u=l[ij(e,n,o,l,0,c,i)];s={...s,...Pj(e,u,r,n,o,a,i)}}if(Oy in t&&!1!==t[Oy]&&bC(s,Gy,!0),Ly in t&&Array.isArray(o)){const{items:l,additionalItems:c}=t;Array.isArray(l)?o.forEach(((t,o)=>{l[o]?s[o]=Pj(e,l[o],`${r}.${o}`,n,t,a,i):c?s[o]=Pj(e,c,`${r}.${o}`,n,t,a,i):console.warn(`Unable to generate path schema for "${r}.${o}". No schema defined for it`)})):o.forEach(((t,o)=>{s[o]=Pj(e,l,`${r}.${o}`,n,t,a,i)}))}else if(Vy in t)for(const l in t.properties){const c=uS(t,[Vy,l]);s[l]=Pj(e,c,`${r}.${l}`,n,uS(o,[l]),a,i)}return s}function Oj(e,t){return Pj(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,void 0,arguments.length>5?arguments[5]:void 0)}class Rj{constructor(e,t,r,n){this.rootSchema=t,this.validator=e,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=n}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;return!(!e||!t)&&(this.validator!==e||!qw(this.rootSchema,t)||!qw(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==n)}getDefaultFormState(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sj(this.validator,e,t,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf)}getDisplayLabel(e,t,r){return function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,o=arguments.length>5?arguments[5]:void 0;const a=Yy(r,arguments.length>4?arguments[4]:void 0),{label:i=!0}=a;let s=!!i;const l=GC(t);return"array"===l&&(s=fj(e,t,n,o)||Cj(e,t,r,n,o)||kj(r)),"object"===l&&(s=!1),"boolean"!==l||r[Qy]||(s=!1),r["ui:field"]&&(s=!1),s}(this.validator,e,t,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(e,t,r,n){return ij(this.validator,this.rootSchema,e,t,r,n,this.experimental_customMergeAllOf)}getFirstMatchingOption(e,t,r){return vC(this.validator,e,t,this.rootSchema,r)}getMatchingOption(e,t,r){return gC(this.validator,e,t,this.rootSchema,r)}isFilesArray(e,t){return Cj(this.validator,e,t,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(e){return fj(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(e){return pj(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}mergeValidationData(e,t){return function(e,t,r){if(!r)return t;const{errors:n,errorSchema:o}=t;let a=e.toErrorList(r),i=r;return pS(o)||(i=uj(o,r,!0),a=[...n].concat(a)),{errorSchema:i,errors:a}}(this.validator,e,t)}retrieveSchema(e,t){return QC(this.validator,e,this.rootSchema,t,this.experimental_customMergeAllOf)}sanitizeDataForNewSchema(e,t,r){return $j(this.validator,this.rootSchema,e,t,r,this.experimental_customMergeAllOf)}toIdSchema(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"root",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"_";return _j(this.validator,e,t,this.rootSchema,r,n,o,this.experimental_customMergeAllOf)}toPathSchema(e,t,r){return Oj(this.validator,e,t,this.rootSchema,r,this.experimental_customMergeAllOf)}}function Mj(e,t){let r=String(e);for(;r.length<t;)r="0"+r;return r}function Nj(e,t){if(e<=0&&t<=0)e=(new Date).getFullYear()+e,t=(new Date).getFullYear()+t;else if(e<0||t<0)throw new Error(`Both start (${e}) and stop (${t}) must both be <= 0 or > 0, got one of each`);if(e>t)return Nj(t,e).reverse();const r=[];for(let n=e;n<=t;n++)r.push({value:n,label:Mj(n,2)});return r}function Ij(e,t){return function(e,t){let r=e;if(Array.isArray(t)){const e=r.split(/(%\d)/);t.forEach(((t,r)=>{const n=e.findIndex((e=>e===`%${r+1}`));n>=0&&(e[n]=t)})),r=e.join("")}return r}(e,t)}function Tj(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;if(Array.isArray(e))return e.map((e=>Tj(e,t))).filter((e=>e!==r));const n=""===e||null===e?-1:Number(e),o=t[n];return o?o.value:r}function Aj(e,t){return Array.isArray(t)?t.some((t=>qw(t,e))):qw(t,e)}function Dj(e){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map(((t,r)=>Aj(t.value,e)?String(r):void 0)).filter((e=>"undefined"!==typeof e));return t?r:r[0]}function Fj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[1900,(new Date).getFullYear()+2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YMD";const{day:o,month:a,year:i,hour:s,minute:l,second:c}=e,u={type:"day",range:[1,31],value:o},d={type:"month",range:[1,12],value:a},p={type:"year",range:r,value:i},f=[];switch(n){case"MDY":f.push(d,u,p);break;case"DMY":f.push(u,d,p);break;default:f.push(p,d,u)}return t&&f.push({type:"hour",range:[0,23],value:s},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:c}),f}function zj(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||0===e.minimum)&&(t.min=e.minimum),(e.maximum||0===e.maximum)&&(t.max=e.maximum),t}function Lj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const o={type:t||"text",...zj(e)};return r.inputType?o.type=r.inputType:t||("number"===e.type?(o.type="number",n&&void 0===o.step&&(o.step="any")):"integer"===e.type&&(o.type="number",void 0===o.step&&(o.step=1))),r.autocomplete&&(o.autoComplete=r.autocomplete),r.accept&&(o.accept=r.accept),o}const Bj={props:{disabled:!1},submitText:"Submit",norender:!1};function Wj(){const e=Yy(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});if(e&&e[Uy]){const t=e[Uy];return{...Bj,...t}}return Bj}function Vj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{templates:n}=t;return"ButtonTemplates"===e?n[e]:r[e]||n[e]}var Hj=r(1697);const Uj={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function qj(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=GC(t);if("function"===typeof r||r&&Hj.isForwardRef((0,e.createElement)(r))||Hj.isMemo(r))return function(e){let t=uS(e,"MergedWidget");if(!t){const r=e.defaultProps&&e.defaultProps.options||{};t=t=>{let{options:n,...o}=t;return(0,dt.jsx)(e,{options:{...r,...n},...o})},bC(e,"MergedWidget",t)}return t}(r);if("string"!==typeof r)throw new Error("Unsupported widget definition: "+typeof r);if(r in n){return qj(t,n[r],n)}if("string"===typeof o){if(!(o in Uj))throw new Error(`No widget for type '${o}'`);if(r in Uj[o]){return qj(t,n[Uj[o][r]],n)}}throw new Error(`No widget '${r}' for type '${o}'`)}function Gj(e,t){return`${Ik(e)?e:e[Fy]}__${t}`}function Kj(e){return Gj(e,"description")}function Qj(e){return Gj(e,"error")}function Jj(e){return Gj(e,"examples")}function Yj(e){return Gj(e,"help")}function Xj(e){return Gj(e,"title")}function Zj(e){const t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?` ${Jj(e)}`:"";return`${Qj(e)} ${Kj(e)} ${Yj(e)}${t}`}function e$(e,t){return`${e}-${t}`}function t$(e,t,r){return t?r:e}function r$(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const r=new Date(e);if(Number.isNaN(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}}function n$(e){if(e.const)return!0;if(e.enum&&1===e.enum.length&&!0===e.enum[0])return!0;if(e.anyOf&&1===e.anyOf.length)return n$(e.anyOf[0]);if(e.oneOf&&1===e.oneOf.length)return n$(e.oneOf[0]);if(e.allOf){const t=e=>n$(e);return e.allOf.some(t)}return!1}function o$(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{year:r,month:n,day:o,hour:a=0,minute:i=0,second:s=0}=e,l=Date.UTC(r,n-1,o,a,i,s),c=new Date(l).toJSON();return t?c:c.slice(0,10)}function a$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return[];let r=[];return Dy in e&&(r=r.concat(e[Dy].map((e=>{const r=`.${t.join(".")}`;return{property:r,message:e,stack:`${r} ${e}`}})))),Object.keys(e).reduce(((r,n)=>{if(n!==Dy){const o=e[n];xb(o)&&(r=r.concat(a$(o,[...t,n])))}return r}),r)}const i$=function(e){return Tx(e)?rS(e,lS):Gw(e)?[e]:RS(tS(iS(e)))};const s$=function(e){return ik(e,5)};const l$=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:yC(e,t,r,n)};class c${constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let t=Array.isArray(e)&&e.length>0||"string"===typeof e?uS(this.errorSchema,e):this.errorSchema;return!t&&e&&(t={},l$(this.errorSchema,e,t,Object)),t}resetAllErrors(e){return this.errorSchema=e?s$(e):{},this}addErrors(e,t){const r=this.getOrCreateErrorBlock(t);let n=uS(r,Dy);return Array.isArray(n)||(n=[],r[Dy]=n),Array.isArray(e)?bC(r,Dy,[...new Set([...n,...e])]):bC(r,Dy,[...new Set([...n,e])]),this}setErrors(e,t){const r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[...new Set([...e])]:[e];return bC(r,Dy,n),this}clearErrors(e){const t=this.getOrCreateErrorBlock(e);return bC(t,Dy,[]),this}}function u$(e){return Object.keys(e).reduce(((t,r)=>{if("addError"===r)return t;{const n=e[r];return xb(n)?{...t,[r]:u$(n)}:{...t,[r]:n}}}),{})}function d$(e){if(!e)return"";const t=new Date(e);return`${Mj(t.getFullYear(),4)}-${Mj(t.getMonth()+1,2)}-${Mj(t.getDate(),2)}T${Mj(t.getHours(),2)}:${Mj(t.getMinutes(),2)}:${Mj(t.getSeconds(),2)}.${Mj(t.getMilliseconds(),3)}`}function p$(e,t){if(!t)return e;const{errors:r,errorSchema:n}=e;let o=a$(t),a=t;return pS(n)||(a=uj(n,t,!0),o=[...r].concat(o)),{errorSchema:a,errors:o}}function f$(e){return Array.isArray(e)?function(e){for(let t=0;t<e.length;t++)e[t]=f$(e[t]);return e}([...e]):Ab(e)?function(e){for(const t in e){const r=e,n=r[t];t===qy&&"string"===typeof n&&n.startsWith("#")?r[t]=Ky+n:r[t]=f$(n)}return e}({...e}):e}const h$=function(e,t,r){for(var n=-1,o=t.length,a={};++n<o;){var i=t[n],s=cS(e,i);r(s,i)&&yC(a,sS(i,e),s)}return a};const m$=function(e,t){if(null==e)return{};var r=rS(TS(e),(function(e){return[e]}));return t=Jk(t),h$(e,r,(function(e,r){return t(e,r[0])}))};const g$=function(e,t,r,n){var o=-1,a=TC,i=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=rS(t,ow(r))),n?(a=AC,i=!1):t.length>=200&&(a=$x,i=!1,t=new Cx(t));e:for(;++o<s;){var u=e[o],d=null==r?u:r(u);if(u=n||0!==u?u:0,i&&d===d){for(var p=c;p--;)if(t[p]===d)continue e;l.push(u)}else a(t,d,n)||l.push(u)}return l};var v$=EC((function(e,t){return SC(e)?g$(e,hk(t,1,SC,!0)):[]}));const y$=v$;var b$;!function(e){e.ArrayItemTitle="Item",e.MissingItems="Missing items definition",e.YesLabel="Yes",e.NoLabel="No",e.CloseLabel="Close",e.ErrorsLabel="Errors",e.NewStringDefault="New Value",e.AddButton="Add",e.AddItemButton="Add Item",e.CopyButton="Copy",e.MoveDownButton="Move down",e.MoveUpButton="Move up",e.RemoveButton="Remove",e.NowLabel="Now",e.ClearLabel="Clear",e.AriaDateLabel="Select a date",e.PreviewLabel="Preview",e.DecrementAriaLabel="Decrease value by 1",e.IncrementAriaLabel="Increase value by 1",e.UnknownFieldType="Unknown field type %1",e.OptionPrefix="Option %1",e.TitleOptionPrefix="%1 option %2",e.KeyLabel="%1 Key",e.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',e.UnsupportedField="Unsupported field schema.",e.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",e.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",e.FilesInfo="**%1** (%2, %3 bytes)"}(b$||(b$={}));const x$=function(e,t){return(Tx(e)?hS:Fk)(e,Zk(t))};const w$=function(e,t){return h$(e,t,(function(t,r){return Uk(e,r)}))};const S$=Ck((function(e,t){return null==e?{}:w$(e,t)}));let k$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")};function C$(){return k$()}function j$(e){return Array.isArray(e)?e.map((e=>({key:C$(),item:e}))):[]}function $$(e){return Array.isArray(e)?e.map((e=>e.item)):[]}class E$ extends e.Component{constructor(e){super(e);const{formData:t=[]}=e,r=j$(t);this.state={keyedFormData:r,updatedKeyedFormData:!1}}static getDerivedStateFromProps(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};const r=Array.isArray(e.formData)?e.formData:[],n=t.keyedFormData||[];return{keyedFormData:r.length===n.length?n.map(((e,t)=>({key:e.key,item:r[t]}))):j$(r)}}get itemTitle(){const{schema:e,registry:t}=this.props,{translateString:r}=t;return uS(e,[Ly,"title"],uS(e,[Ly,"description"],r(b$.ArrayItemTitle)))}isItemRequired(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type}canAddItem(e){const{schema:t,uiSchema:r,registry:n}=this.props;let{addable:o}=Yy(r,n.globalUiOptions);return!1!==o&&(o=void 0===t.maxItems||e.length<t.maxItems),o}_getNewFormDataRow=()=>{const{schema:e,registry:t}=this.props,{schemaUtils:r}=t;let n=e.items;return sj(e)&&function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),Ey(e.additionalItems)}(e)&&(n=e.additionalItems),r.getDefaultFormState(n)};_handleAddClick(e,t){e&&e.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const e in n){const r=parseInt(e);void 0===t||r<t?bC(a,[r],n[e]):r>=t&&bC(a,[r+1],n[e])}}const i={key:C$(),item:this._getNewFormDataRow()},s=[...o];void 0!==t?s.splice(t,0,i):s.push(i),this.setState({keyedFormData:s,updatedKeyedFormData:!0},(()=>r($$(s),a)))}onAddClick=e=>{this._handleAddClick(e)};onAddIndexClick=e=>t=>{this._handleAddClick(t,e)};onCopyIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const t in n){const r=parseInt(t);r<=e?bC(a,[r],n[t]):r>e&&bC(a,[r+1],n[t])}}const i={key:C$(),item:s$(o[e].item)},s=[...o];void 0!==e?s.splice(e+1,0,i):s.push(i),this.setState({keyedFormData:s,updatedKeyedFormData:!0},(()=>r($$(s),a)))};onDropIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const t in n){const r=parseInt(t);r<e?bC(a,[r],n[t]):r>e&&bC(a,[r-1],n[t])}}const i=o.filter(((t,r)=>r!==e));this.setState({keyedFormData:i,updatedKeyedFormData:!0},(()=>r($$(i),a)))};onReorderClick=(e,t)=>r=>{r&&(r.preventDefault(),r.currentTarget.blur());const{onChange:n,errorSchema:o}=this.props;let a;if(o){a={};for(const r in o){const n=parseInt(r);n==e?bC(a,[t],o[e]):n==t?bC(a,[e],o[t]):bC(a,[r],o[n])}}const{keyedFormData:i}=this.state;const s=function(){const r=i.slice();return r.splice(e,1),r.splice(t,0,i[e]),r}();this.setState({keyedFormData:s},(()=>n($$(s),a)))};onChangeForIndex=e=>(t,r,n)=>{const{formData:o,onChange:a,errorSchema:i}=this.props,s=(Array.isArray(o)?o:[]).map(((r,n)=>e===n?"undefined"===typeof t?null:t:r));a(s,i&&i&&{...i,[e]:r},n)};onSelectChange=e=>{const{onChange:t,idSchema:r}=this.props;t(e,void 0,r&&r.$id)};render(){const{schema:e,uiSchema:t,idSchema:r,registry:n}=this.props,{schemaUtils:o,translateString:a}=n;if(!(Ly in e)){const o=Vj("UnsupportedFieldTemplate",n,Yy(t));return(0,dt.jsx)(o,{schema:e,idSchema:r,reason:a(b$.MissingItems),registry:n})}return o.isMultiSelect(e)?this.renderMultiSelect():kj(t)?this.renderCustomWidget():sj(e)?this.renderFixedArray():o.isFilesArray(e,t)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:e,uiSchema:t={},errorSchema:r,idSchema:n,name:o,title:a,disabled:i=!1,readonly:s=!1,autofocus:l=!1,required:c=!1,registry:u,onBlur:d,onFocus:p,idPrefix:f,idSeparator:h="_",rawErrors:m}=this.props,{keyedFormData:g}=this.state,v=e.title||a||o,{schemaUtils:y,formContext:b}=u,x=Yy(t),w=Ab(e.items)?e.items:{},S=y.retrieveSchema(w),k=$$(this.state.keyedFormData),C=this.canAddItem(k),j={canAdd:C,items:g.map(((e,a)=>{const{key:i,item:s}=e,c=s,u=y.retrieveSchema(w,c),b=r?r[a]:void 0,x=n.$id+h+a,S=y.toIdSchema(u,x,c,f,h);return this.renderArrayFieldItem({key:i,index:a,name:o&&`${o}-${a}`,title:v?`${v}-${a+1}`:void 0,canAdd:C,canMoveUp:a>0,canMoveDown:a<k.length-1,itemSchema:u,itemIdSchema:S,itemErrorSchema:b,itemData:c,itemUiSchema:t.items,autofocus:l&&0===a,onBlur:d,onFocus:p,rawErrors:m,totalItems:g.length})})),className:`field field-array field-array-of-${S.type}`,disabled:i,idSchema:n,uiSchema:t,onAddClick:this.onAddClick,readonly:s,required:c,schema:e,title:v,formContext:b,formData:k,rawErrors:m,registry:u},$=Vj("ArrayFieldTemplate",u,x);return(0,dt.jsx)($,{...j})}renderCustomWidget(){const{schema:e,idSchema:t,uiSchema:r,disabled:n=!1,readonly:o=!1,autofocus:a=!1,required:i=!1,hideError:s,placeholder:l,onBlur:c,onFocus:u,formData:d=[],registry:p,rawErrors:f,name:h}=this.props,{widgets:m,formContext:g,globalUiOptions:v,schemaUtils:y}=p,{widget:b,title:x,...w}=Yy(r,v),S=qj(e,b,m),k=x??e.title??h,C=y.getDisplayLabel(e,r,v);return(0,dt.jsx)(S,{id:t.$id,name:h,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:w,schema:e,uiSchema:r,registry:p,value:d,disabled:n,readonly:o,hideError:s,required:i,label:k,hideLabel:!C,placeholder:l,formContext:g,autofocus:a,rawErrors:f})}renderMultiSelect(){const{schema:e,idSchema:t,uiSchema:r,formData:n=[],disabled:o=!1,readonly:a=!1,autofocus:i=!1,required:s=!1,placeholder:l,onBlur:c,onFocus:u,registry:d,rawErrors:p,name:f}=this.props,{widgets:h,schemaUtils:m,formContext:g,globalUiOptions:v}=d,y=mj(m.retrieveSchema(e.items,n),r),{widget:b="select",title:x,...w}=Yy(r,v),S=qj(e,b,h),k=x??e.title??f,C=m.getDisplayLabel(e,r,v);return(0,dt.jsx)(S,{id:t.$id,name:f,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:{...w,enumOptions:y},schema:e,uiSchema:r,registry:d,value:n,disabled:o,readonly:a,required:s,label:k,hideLabel:!C,placeholder:l,formContext:g,autofocus:i,rawErrors:p})}renderFiles(){const{schema:e,uiSchema:t,idSchema:r,name:n,disabled:o=!1,readonly:a=!1,autofocus:i=!1,required:s=!1,onBlur:l,onFocus:c,registry:u,formData:d=[],rawErrors:p}=this.props,{widgets:f,formContext:h,globalUiOptions:m,schemaUtils:g}=u,{widget:v="files",title:y,...b}=Yy(t,m),x=qj(e,v,f),w=y??e.title??n,S=g.getDisplayLabel(e,t,m);return(0,dt.jsx)(x,{options:b,id:r.$id,name:n,multiple:!0,onChange:this.onSelectChange,onBlur:l,onFocus:c,schema:e,uiSchema:t,value:d,disabled:o,readonly:a,required:s,registry:u,formContext:h,autofocus:i,rawErrors:p,label:w,hideLabel:!S})}renderFixedArray(){const{schema:e,uiSchema:t={},formData:r=[],errorSchema:n,idPrefix:o,idSeparator:a="_",idSchema:i,name:s,title:l,disabled:c=!1,readonly:u=!1,autofocus:d=!1,required:p=!1,registry:f,onBlur:h,onFocus:m,rawErrors:g}=this.props,{keyedFormData:v}=this.state;let{formData:y=[]}=this.props;const b=e.title||l||s,x=Yy(t),{schemaUtils:w,formContext:S}=f,k=(Ab(e.items)?e.items:[]).map(((e,t)=>w.retrieveSchema(e,r[t]))),C=Ab(e.additionalItems)?w.retrieveSchema(e.additionalItems,r):null;(!y||y.length<k.length)&&(y=y||[],y=y.concat(new Array(k.length-y.length)));const j=this.canAddItem(y)&&!!C,$={canAdd:j,className:"field field-array field-array-fixed-items",disabled:c,idSchema:i,formData:r,items:v.map(((r,l)=>{const{key:c,item:u}=r,p=u,f=l>=k.length,x=(f&&Ab(e.additionalItems)?w.retrieveSchema(e.additionalItems,p):k[l])||{},S=i.$id+a+l,C=w.toIdSchema(x,S,p,o,a),$=f?t.additionalItems||{}:Array.isArray(t.items)?t.items[l]:t.items||{},E=n?n[l]:void 0;return this.renderArrayFieldItem({key:c,index:l,name:s&&`${s}-${l}`,title:b?`${b}-${l+1}`:void 0,canAdd:j,canRemove:f,canMoveUp:l>=k.length+1,canMoveDown:f&&l<y.length-1,itemSchema:x,itemData:p,itemUiSchema:$,itemIdSchema:C,itemErrorSchema:E,autofocus:d&&0===l,onBlur:h,onFocus:m,rawErrors:g,totalItems:v.length})})),onAddClick:this.onAddClick,readonly:u,required:p,registry:f,schema:e,uiSchema:t,title:b,formContext:S,errorSchema:n,rawErrors:g},E=Vj("ArrayFieldTemplate",f,x);return(0,dt.jsx)(E,{...$})}renderArrayFieldItem(e){const{key:t,index:r,name:n,canAdd:o,canRemove:a=!0,canMoveUp:i,canMoveDown:s,itemSchema:l,itemData:c,itemUiSchema:u,itemIdSchema:d,itemErrorSchema:p,autofocus:f,onBlur:h,onFocus:m,rawErrors:g,totalItems:v,title:y}=e,{disabled:b,hideError:x,idPrefix:w,idSeparator:S,readonly:k,uiSchema:C,registry:j,formContext:$}=this.props,{fields:{ArraySchemaField:E,SchemaField:_},globalUiOptions:P}=j,O=E||_,{orderable:R=!0,removable:M=!0,copyable:N=!1}=Yy(C,P),I={moveUp:R&&i,moveDown:R&&s,copy:N&&o,remove:M&&a,toolbar:!1};return I.toolbar=Object.keys(I).some((e=>I[e])),{children:(0,dt.jsx)(O,{name:n,title:y,index:r,schema:l,uiSchema:u,formData:c,formContext:$,errorSchema:p,idPrefix:w,idSeparator:S,idSchema:d,required:this.isItemRequired(l),onChange:this.onChangeForIndex(r),onBlur:h,onFocus:m,registry:j,disabled:b,readonly:k,hideError:x,autofocus:f,rawErrors:g}),className:"array-item",disabled:b,canAdd:o,hasCopy:I.copy,hasToolbar:I.toolbar,hasMoveUp:I.moveUp,hasMoveDown:I.moveDown,hasRemove:I.remove,index:r,totalItems:v,key:t,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:k,registry:j,schema:l,uiSchema:u}}}const _$=E$;const P$=function(e){const{schema:t,name:r,uiSchema:n,idSchema:o,formData:a,registry:i,required:s,disabled:l,readonly:c,hideError:u,autofocus:d,title:p,onChange:f,onFocus:h,onBlur:m,rawErrors:g}=e,{title:v}=t,{widgets:y,formContext:b,translateString:x,globalUiOptions:w}=i,{widget:S="checkbox",title:k,label:C=!0,...j}=Yy(n,w),$=qj(t,S,y),E=x(b$.YesLabel),_=x(b$.NoLabel);let P;const O=k??v??p??r;if(Array.isArray(t.oneOf))P=mj({oneOf:t.oneOf.map((e=>{if(Ab(e))return{...e,title:e.title||(!0===e.const?E:_)}})).filter((e=>e))},n);else{const e=t,r=t.enum??[!0,!1];P=!e.enumNames&&2===r.length&&r.every((e=>"boolean"===typeof e))?[{value:r[0],label:r[0]?E:_},{value:r[1],label:r[1]?E:_}]:mj({enum:r,enumNames:e.enumNames},n)}return(0,dt.jsx)($,{options:{...j,enumOptions:P},schema:t,uiSchema:n,id:o.$id,name:r,onChange:f,onFocus:h,onBlur:m,label:O,hideLabel:!C,value:a,required:s,disabled:l,readonly:c,hideError:u,registry:i,formContext:b,autofocus:d,rawErrors:g})};class O$ extends e.Component{constructor(e){super(e);const{formData:t,options:r,registry:{schemaUtils:n}}=this.props,o=r.map((e=>n.retrieveSchema(e,t)));this.state={retrievedOptions:o,selectedOption:this.getMatchingOption(0,t,o)}}componentDidUpdate(e,t){const{formData:r,options:n,idSchema:o}=this.props,{selectedOption:a}=this.state;let i=this.state;if(!qw(e.options,n)){const{registry:{schemaUtils:e}}=this.props;i={selectedOption:a,retrievedOptions:n.map((t=>e.retrieveSchema(t,r)))}}if(!qw(r,e.formData)&&o.$id===e.idSchema.$id){const{retrievedOptions:e}=i,n=this.getMatchingOption(a,r,e);t&&n!==a&&(i={selectedOption:n,retrievedOptions:e})}i!==this.state&&this.setState(i)}getMatchingOption(e,t,r){const{schema:n,registry:{schemaUtils:o}}=this.props,a=HC(n);return o.getClosestMatchingOption(t,r,e,a)}onOptionChange=e=>{const{selectedOption:t,retrievedOptions:r}=this.state,{formData:n,onChange:o,registry:a}=this.props,{schemaUtils:i}=a,s=void 0!==e?parseInt(e,10):-1;if(s===t)return;const l=s>=0?r[s]:void 0,c=t>=0?r[t]:void 0;let u=i.sanitizeDataForNewSchema(l,c,n);l&&(u=i.getDefaultFormState(l,u,"excludeObjectChildren")),this.setState({selectedOption:s},(()=>{o(u,void 0,this.getFieldId())}))};getFieldId(){const{idSchema:e,schema:t}=this.props;return`${e.$id}${t.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,disabled:t=!1,errorSchema:r={},formContext:n,onBlur:o,onFocus:a,readonly:i,registry:s,schema:l,uiSchema:c}=this.props,{widgets:u,fields:d,translateString:p,globalUiOptions:f,schemaUtils:h}=s,{SchemaField:m}=d,{selectedOption:g,retrievedOptions:v}=this.state,{widget:y="select",placeholder:b,autofocus:x,autocomplete:w,title:S=l.title,...k}=Yy(c,f),C=qj({type:"number"},y,u),j=uS(r,Dy,[]),$=jk(r,[Dy]),E=h.getDisplayLabel(l,c,f),_=g>=0&&v[g]||null;let P;if(_){const{required:e}=l;P=e?KC({required:e},_):_}let O=[];Wy in l&&c&&Wy in c?Array.isArray(c[Wy])?O=c[Wy]:console.warn(`uiSchema.oneOf is not an array for "${S||e}"`):My in l&&c&&My in c&&(Array.isArray(c[My])?O=c[My]:console.warn(`uiSchema.anyOf is not an array for "${S||e}"`));let R=c;g>=0&&O.length>g&&(R=O[g]);const M=S?b$.TitleOptionPrefix:b$.OptionPrefix,N=S?[S]:[],I=v.map(((e,t)=>{const{title:r=e.title}=Yy(O[t]);return{label:r||p(M,N.concat(String(t+1))),value:t}}));return(0,dt.jsxs)("div",{className:"panel panel-default panel-body",children:[(0,dt.jsx)("div",{className:"form-group",children:(0,dt.jsx)(C,{id:this.getFieldId(),name:`${e}${l.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:o,onFocus:a,disabled:t||pS(I),multiple:!1,rawErrors:j,errorSchema:$,value:g>=0?g:void 0,options:{enumOptions:I,...k},registry:s,formContext:n,placeholder:b,autocomplete:w,autofocus:x,label:S??e,hideLabel:!E,readonly:i})}),P&&(0,dt.jsx)(m,{...this.props,schema:P,uiSchema:R})]})}}const R$=O$,M$=/\.([0-9]*0)*$/,N$=/[0.]0*$/;const I$=function(t){const{registry:r,onChange:n,formData:o,value:a}=t,[i,s]=(0,e.useState)(a),{StringField:l}=r.fields;let c=o;const u=(0,e.useCallback)(((e,t,r)=>{s(e),"."===`${e}`.charAt(0)&&(e=`0${e}`);const o="string"===typeof e&&e.match(M$)?_y(e.replace(N$,"")):_y(e);n(o,t,r)}),[n]);if("string"===typeof i&&"number"===typeof c){const e=new RegExp(`^(${String(c).replace(".","\\.")})?\\.?0*$`);i.match(e)&&(c=i)}return(0,dt.jsx)(l,{...t,formData:c,onChange:u})};function T$(){return T$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},T$.apply(this,arguments)}const A$=["children","options"];var D$,F$;!function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"}(D$||(D$={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(F$||(F$={}));const z$=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{for:"htmlFor"}),L$={amp:"&",apos:"'",gt:">",lt:"<",nbsp:"\xa0",quot:"\u201c"},B$=["style","script"],W$=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,V$=/mailto:/i,H$=/\n{2,}$/,U$=/^(\s*>[\s\S]*?)(?=\n{2,})/,q$=/^ *> ?/gm,G$=/^ {2,}\n/,K$=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,Q$=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,J$=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Y$=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,X$=/^(?:\n *)*\n/,Z$=/\r\n?/g,eE=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,tE=/^\[\^([^\]]+)]/,rE=/\f/g,nE=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,oE=/^\s*?\[(x|\s)\]/,aE=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,iE=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,sE=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,lE=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,cE=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,uE=/^<!--[\s\S]*?(?:-->)/,dE=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,pE=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,fE=/^\{.*\}$/,hE=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,mE=/^<([^ >]+@[^ >]+)>/,gE=/^<([^ >]+:\/[^ >]+)>/,vE=/-([a-z])?/gi,yE=/^(.*\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,bE=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,xE=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,wE=/^\[([^\]]*)\] ?\[([^\]]*)\]/,SE=/(\[|\])/g,kE=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,CE=/\t/g,jE=/(^ *\||\| *$)/g,$E=/^ *:-+: *$/,EE=/^ *:-+ *$/,_E=/^ *-+: *$/,PE="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~~.*?~~|==.*?==|.|\\n)*?)",OE=new RegExp(`^([*_])\\1${PE}\\1\\1(?!\\1)`),RE=new RegExp(`^([*_])${PE}\\1(?!\\1|\\w)`),ME=new RegExp(`^==${PE}==`),NE=new RegExp(`^~~${PE}~~`),IE=/^\\([^0-9A-Za-z\s])/,TE=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,AE=/^\n+/,DE=/^([ \t]*)/,FE=/\\([^\\])/g,zE=/ *\n+$/,LE=/(?:^|\n)( *)$/,BE="(?:\\d+\\.)",WE="(?:[*+-])";function VE(e){return"( *)("+(1===e?BE:WE)+") +"}const HE=VE(1),UE=VE(2);function qE(e){return new RegExp("^"+(1===e?HE:UE))}const GE=qE(1),KE=qE(2);function QE(e){return new RegExp("^"+(1===e?HE:UE)+"[^\\n]*(?:\\n(?!\\1"+(1===e?BE:WE)+" )[^\\n]*)*(\\n|$)","gm")}const JE=QE(1),YE=QE(2);function XE(e){const t=1===e?BE:WE;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const ZE=XE(1),e_=XE(2);function t_(e,t){const r=1===t,n=r?ZE:e_,o=r?JE:YE,a=r?GE:KE;return{match(e,t,r){const o=LE.exec(r);return o&&(t.list||!t.inline&&!t.simple)?n.exec(e=o[1]+e):null},order:1,parse(e,t,n){const i=r?+e[2]:void 0,s=e[0].replace(H$,"\n").match(o);let l=!1;return{items:s.map((function(e,r){const o=a.exec(e)[0].length,i=new RegExp("^ {1,"+o+"}","gm"),c=e.replace(i,"").replace(a,""),u=r===s.length-1,d=-1!==c.indexOf("\n\n")||u&&l;l=d;const p=n.inline,f=n.list;let h;n.list=!0,d?(n.inline=!1,h=c.replace(zE,"\n\n")):(n.inline=!0,h=c.replace(zE,""));const m=t(h,n);return n.inline=p,n.list=f,m})),ordered:r,start:i}},render:(t,r,n)=>e(t.ordered?"ol":"ul",{key:n.key,start:"20"===t.type?t.start:void 0},t.items.map((function(t,o){return e("li",{key:o},r(t,n))})))}}const r_=new RegExp("^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),n_=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,o_=[U$,Q$,J$,aE,sE,iE,uE,yE,JE,ZE,YE,e_],a_=[...o_,/^[^\n]+(?: \n|\n{2,})/,lE,pE];function i_(e){return e.replace(/[\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xc6]/g,"a").replace(/[\xe7\xc7]/g,"c").replace(/[\xf0\xd0]/g,"d").replace(/[\xc8\xc9\xca\xcb\xe9\xe8\xea\xeb]/g,"e").replace(/[\xcf\xef\xce\xee\xcd\xed\xcc\xec]/g,"i").replace(/[\xd1\xf1]/g,"n").replace(/[\xf8\xd8\u0153\u0152\xd5\xf5\xd4\xf4\xd3\xf3\xd2\xf2]/g,"o").replace(/[\xdc\xfc\xdb\xfb\xda\xfa\xd9\xf9]/g,"u").replace(/[\u0178\xff\xdd\xfd]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function s_(e){return _E.test(e)?"right":$E.test(e)?"center":EE.test(e)?"left":null}function l_(e,t,r,n){const o=r.inTable;r.inTable=!0;let a=e.trim().split(/( *(?:`[^`]*`|<.*?>.*?<\/.*?>(?!<\/.*?>)|\\\||\|) *)/).reduce(((e,o)=>("|"===o.trim()?e.push(n?{type:"26"}:{type:"27",text:o}):""!==o&&e.push.apply(e,t(o,r)),e)),[]);r.inTable=o;let i=[[]];return a.forEach((function(e,t){"26"===e.type?0!==t&&t!==a.length-1&&i.push([]):("27"!==e.type||null!=a[t+1]&&"26"!==a[t+1].type||(e.text=e.text.trimEnd()),i[i.length-1].push(e))})),i}function c_(e,t,r){r.inline=!0;const n=e[2]?e[2].replace(jE,"").split("|").map(s_):[],o=e[3]?function(e,t,r){return e.trim().split("\n").map((function(e){return l_(e,t,r,!0)}))}(e[3],t,r):[],a=l_(e[1],t,r,!!o.length);return r.inline=!1,o.length?{align:n,cells:o,header:a,type:"25"}:{children:a,type:"21"}}function u_(e,t){return null==e.align[t]?{}:{textAlign:e.align[t]}}function d_(e){return function(t,r){return r.inline?e.exec(t):null}}function p_(e){return function(t,r){return r.inline||r.simple?e.exec(t):null}}function f_(e){return function(t,r){return r.inline||r.simple?null:e.exec(t)}}function h_(e){return function(t){return e.exec(t)}}function m_(e,t,r){if(t.inline||t.simple)return null;if(r&&!r.endsWith("\n"))return null;let n="";e.split("\n").every((e=>!o_.some((t=>t.test(e)))&&(n+=e+"\n",e.trim())));const o=n.trimEnd();return""==o?null:[n,o]}function g_(e){try{if(decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return}catch(e){return null}return e}function v_(e){return e.replace(FE,"$1")}function y_(e,t,r){const n=r.inline||!1,o=r.simple||!1;r.inline=!0,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=o,a}function b_(e,t,r){const n=r.inline||!1,o=r.simple||!1;r.inline=!1,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=o,a}function x_(e,t,r){const n=r.inline||!1;r.inline=!1;const o=e(t,r);return r.inline=n,o}const w_=(e,t,r)=>({children:y_(t,e[1],r)});function S_(){return{}}function k_(){return null}function C_(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}function j_(e,t,r){let n=e;const o=t.split(".");for(;o.length&&(n=n[o[0]],void 0!==n);)o.shift();return n||r}const $_=t=>{let{children:r="",options:n}=t,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(o[r]=e[r]);return o}(t,A$);return e.cloneElement(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.overrides=r.overrides||{},r.slugify=r.slugify||i_,r.namedCodesToUnicode=r.namedCodesToUnicode?T$({},L$,r.namedCodesToUnicode):L$;const n=r.createElement||e.createElement;function o(e,t){const o=j_(r.overrides,`${e}.props`,{});for(var a=arguments.length,i=new Array(a>2?a-2:0),s=2;s<a;s++)i[s-2]=arguments[s];return n(function(e,t){const r=j_(t,e);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:j_(t,`${e}.component`,e):e}(e,r.overrides),T$({},t,o,{className:C_(null==t?void 0:t.className,o.className)||void 0}),...i)}function a(t){t=t.replace(nE,"");let n=!1;r.forceInline?n=!0:r.forceBlock||(n=!1===kE.test(t));const a=d(u(n?t:`${t.trimEnd().replace(AE,"")}\n\n`,{inline:n}));for(;"string"==typeof a[a.length-1]&&!a[a.length-1].trim();)a.pop();if(null===r.wrapper)return a;const i=r.wrapper||(n?"span":"div");let s;if(a.length>1||r.forceWrapper)s=a;else{if(1===a.length)return s=a[0],"string"==typeof s?o("span",{key:"outer"},s):s;s=null}return e.createElement(i,{key:"outer"},s)}function i(t){const r=t.match(W$);return r?r.reduce((function(t,r,n){const o=r.indexOf("=");if(-1!==o){const i=function(e){return-1!==e.indexOf("-")&&null===e.match(dE)&&(e=e.replace(vE,(function(e,t){return t.toUpperCase()}))),e}(r.slice(0,o)).trim(),s=function(e){const t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e}(r.slice(o+1).trim()),l=z$[i]||i,c=t[l]=function(e,t){return"style"===e?t.split(/;\s?/).reduce((function(e,t){const r=t.slice(0,t.indexOf(":"));return e[r.trim().replace(/(-[a-z])/g,(e=>e[1].toUpperCase()))]=t.slice(r.length+1).trim(),e}),{}):"href"===e||"src"===e?g_(t):(t.match(fE)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(i,s);"string"==typeof c&&(lE.test(c)||pE.test(c))&&(t[l]=e.cloneElement(a(c.trim()),{key:n}))}else"style"!==r&&(t[z$[r]||r]=!0);return t}),{}):null}const s=[],l={},c={0:{match:f_(U$),order:1,parse:(e,t,r)=>({children:t(e[0].replace(q$,""),r)}),render:(e,t,r)=>o("blockquote",{key:r.key},t(e.children,r))},1:{match:h_(G$),order:1,parse:S_,render:(e,t,r)=>o("br",{key:r.key})},2:{match:f_(K$),order:1,parse:S_,render:(e,t,r)=>o("hr",{key:r.key})},3:{match:f_(J$),order:0,parse:e=>({lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(e,t,r)=>o("pre",{key:r.key},o("code",T$({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},4:{match:f_(Q$),order:0,parse:e=>({attrs:i(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"})},5:{match:p_(Y$),order:3,parse:e=>({text:e[2]}),render:(e,t,r)=>o("code",{key:r.key},e.text)},6:{match:f_(eE),order:0,parse:e=>(s.push({footnote:e[2],identifier:e[1]}),{}),render:k_},7:{match:d_(tE),order:1,parse:e=>({target:`#${r.slugify(e[1])}`,text:e[1]}),render:(e,t,r)=>o("a",{key:r.key,href:g_(e.target)},o("sup",{key:r.key},e.text))},8:{match:d_(oE),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,t,r)=>o("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})},9:{match:f_(r.enforceAtxHeadings?iE:aE),order:1,parse:(e,t,n)=>({children:y_(t,e[2],n),id:r.slugify(e[2]),level:e[1].length}),render:(e,t,r)=>o(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r))},10:{match:f_(sE),order:0,parse:(e,t,r)=>({children:y_(t,e[1],r),level:"="===e[2]?1:2,type:"9"})},11:{match:h_(lE),order:1,parse(e,t,r){const[,n]=e[3].match(DE),o=new RegExp(`^${n}`,"gm"),a=e[3].replace(o,""),s=(l=a,a_.some((e=>e.test(l)))?x_:y_);var l;const c=e[1].toLowerCase(),u=-1!==B$.indexOf(c),d={attrs:i(e[2]),noInnerParse:u,tag:(u?c:e[1]).trim()};return r.inAnchor=r.inAnchor||"a"===c,u?d.text=e[3]:d.children=s(t,a,r),r.inAnchor=!1,d},render:(e,t,r)=>o(e.tag,T$({key:r.key},e.attrs),e.text||t(e.children,r))},13:{match:h_(pE),order:1,parse:e=>({attrs:i(e[2]||""),tag:e[1].trim()}),render:(e,t,r)=>o(e.tag,T$({},e.attrs,{key:r.key}))},12:{match:h_(uE),order:1,parse:()=>({}),render:k_},14:{match:p_(n_),order:1,parse:e=>({alt:e[1],target:v_(e[2]),title:e[3]}),render:(e,t,r)=>o("img",{key:r.key,alt:e.alt||void 0,title:e.title||void 0,src:g_(e.target)})},15:{match:d_(r_),order:3,parse:(e,t,r)=>({children:b_(t,e[1],r),target:v_(e[2]),title:e[3]}),render:(e,t,r)=>o("a",{key:r.key,href:g_(e.target),title:e.title},t(e.children,r))},16:{match:d_(gE),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],type:"15"})},17:{match:(e,t)=>t.inAnchor?null:d_(hE)(e,t),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"})},18:{match:d_(mE),order:0,parse(e){let t=e[1],r=e[1];return V$.test(r)||(r="mailto:"+r),{children:[{text:t.replace("mailto:",""),type:"27"}],target:r,type:"15"}}},20:t_(o,1),33:t_(o,2),19:{match:f_(X$),order:3,parse:S_,render:()=>"\n"},21:{match:m_,order:3,parse:w_,render:(e,t,r)=>o("p",{key:r.key},t(e.children,r))},22:{match:d_(bE),order:0,parse:e=>(l[e[1]]={target:e[2],title:e[4]},{}),render:k_},23:{match:p_(xE),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,t,r)=>l[e.ref]?o("img",{key:r.key,alt:e.alt,src:g_(l[e.ref].target),title:l[e.ref].title}):null},24:{match:d_(wE),order:0,parse:(e,t,r)=>({children:t(e[1],r),fallbackChildren:t(e[0].replace(SE,"\\$1"),r),ref:e[2]}),render:(e,t,r)=>l[e.ref]?o("a",{key:r.key,href:g_(l[e.ref].target),title:l[e.ref].title},t(e.children,r)):o("span",{key:r.key},t(e.fallbackChildren,r))},25:{match:f_(yE),order:1,parse:c_,render(e,t,r){const n=e;return o("table",{key:r.key},o("thead",null,o("tr",null,n.header.map((function(e,a){return o("th",{key:a,style:u_(n,a)},t(e,r))})))),o("tbody",null,n.cells.map((function(e,a){return o("tr",{key:a},e.map((function(e,a){return o("td",{key:a,style:u_(n,a)},t(e,r))})))}))))}},27:{match:h_(TE),order:4,parse:e=>({text:e[0].replace(cE,((e,t)=>r.namedCodesToUnicode[t]?r.namedCodesToUnicode[t]:e))}),render:e=>e.text},28:{match:p_(OE),order:2,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>o("strong",{key:r.key},t(e.children,r))},29:{match:p_(RE),order:3,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>o("em",{key:r.key},t(e.children,r))},30:{match:p_(IE),order:1,parse:e=>({text:e[1],type:"27"})},31:{match:p_(ME),order:3,parse:w_,render:(e,t,r)=>o("mark",{key:r.key},t(e.children,r))},32:{match:p_(NE),order:3,parse:w_,render:(e,t,r)=>o("del",{key:r.key},t(e.children,r))}};!0===r.disableParsingRawHTML&&(delete c[11],delete c[13]);const u=function(e){let t=Object.keys(e);function r(n,o){let a=[],i="";for(;n;){let s=0;for(;s<t.length;){const l=t[s],c=e[l],u=c.match(n,o,i);if(u){const e=u[0];n=n.substring(e.length);const t=c.parse(u,r,o);null==t.type&&(t.type=l),a.push(t),i=e;break}s++}}return a}return t.sort((function(t,r){let n=e[t].order,o=e[r].order;return n!==o?n-o:t<r?-1:1})),function(e,t){return r(function(e){return e.replace(Z$,"\n").replace(rE,"").replace(CE," ")}(e),t)}}(c),d=(p=function(e,t){return function(r,n,o){const a=e[r.type].render;return t?t((()=>a(r,n,o)),r,n,o):a(r,n,o)}}(c,r.renderRule),function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(t)){const n=r.key,o=[];let a=!1;for(let i=0;i<t.length;i++){r.key=i;const n=e(t[i],r),s="string"==typeof n;s&&a?o[o.length-1]+=n:null!==n&&o.push(n),a=s}return r.key=n,o}return p(t,e,r)});var p;const f=a(t);return s.length?o("div",null,f,o("footer",{key:"footer"},s.map((function(e){return o("div",{id:r.slugify(e.identifier),key:e.identifier},e.identifier,d(u(e.footnote,{inline:!0})))})))):f}(r,n),o)};const E_=function(e,t){return null==e||uk(e,t)};class __ extends e.Component{state={wasPropertyKeyModified:!1,additionalProperties:{}};isRequired(e){const{schema:t}=this.props;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)}onPropertyChange=(()=>{var e=this;return function(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(n,o,a)=>{const{formData:i,onChange:s,errorSchema:l}=e.props;void 0===n&&r&&(n="");s({...i,[t]:n},l&&l&&{...l,[t]:o},a)}}})();onDropPropertyClick=e=>t=>{t.preventDefault();const{onChange:r,formData:n}=this.props,o={...n};E_(o,e),r(o)};getAvailableKey=(e,t)=>{const{uiSchema:r,registry:n}=this.props,{duplicateKeySuffixSeparator:o="-"}=Yy(r,n.globalUiOptions);let a=0,i=e;for(;Mk(t,i);)i=`${e}${o}${++a}`;return i};onKeyChange=e=>(t,r)=>{if(e===t)return;const{formData:n,onChange:o,errorSchema:a}=this.props;t=this.getAvailableKey(t,n);const i={...n},s={[e]:t},l=Object.keys(i).map((e=>({[s[e]||e]:i[e]}))),c=Object.assign({},...l);this.setState({wasPropertyKeyModified:!0}),o(c,a&&a&&{...a,[t]:r})};getDefaultValue(e){const{registry:{translateString:t}}=this.props;switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return t(b$.NewStringDefault)}}handleAddClick=e=>()=>{if(!e.additionalProperties)return;const{formData:t,onChange:r,registry:n}=this.props,o={...t};let a,i,s;if(Ab(e.additionalProperties)){a=e.additionalProperties.type,i=e.additionalProperties.const,s=e.additionalProperties.default;let r=e.additionalProperties;if(qy in r){const{schemaUtils:e}=n;r=e.retrieveSchema({$ref:r[qy]},t),a=r.type,i=r.const,s=r.default}a||!(My in r)&&!(Wy in r)||(a="object")}const l=this.getAvailableKey("newKey",o),c=i??s??this.getDefaultValue(a);bC(o,l,c),r(o)};render(){const{schema:e,uiSchema:t={},formData:r,errorSchema:n,idSchema:o,name:a,required:i=!1,disabled:s,readonly:l,hideError:c,idPrefix:u,idSeparator:d,onBlur:p,onFocus:f,registry:h,title:m}=this.props,{fields:g,formContext:v,schemaUtils:y,translateString:b,globalUiOptions:x}=h,{SchemaField:w}=g,S=y.retrieveSchema(e,r),k=Yy(t,x),{properties:C={}}=S,j=k.title??S.title??m??a,$=k.description??S.description;let E;try{E=function(e,t){if(!Array.isArray(t))return e;const r=e=>e.reduce(((e,t)=>(e[t]=!0,e)),{}),n=r(e),o=t.filter((e=>"*"===e||n[e])),a=r(o),i=e.filter((e=>!a[e])),s=o.indexOf("*");if(-1===s){if(i.length)throw new Error("uiSchema order list does not contain "+((l=i).length>1?`properties '${l.join("', '")}'`:`property '${l[0]}'`));return o}var l;if(s!==o.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const c=[...o];return c.splice(s,1,...i),c}(Object.keys(C),k.order)}catch(O){return(0,dt.jsxs)("div",{children:[(0,dt.jsx)("p",{className:"config-error",style:{color:"red"},children:(0,dt.jsx)($_,{options:{disableParsingRawHTML:!0},children:b(b$.InvalidObjectField,[a||"root",O.message])})}),(0,dt.jsx)("pre",{children:JSON.stringify(S)})]})}const _=Vj("ObjectFieldTemplate",h,k),P={title:!1===k.label?"":j,description:!1===k.label?void 0:$,properties:E.map((e=>{const a=Mk(S,[Vy,e,Py]),m=a?t.additionalProperties:t[e],g="hidden"===Yy(m).widget,y=uS(o,[e],{});return{content:(0,dt.jsx)(w,{name:e,required:this.isRequired(e),schema:uS(S,[Vy,e],{}),uiSchema:m,errorSchema:uS(n,e),idSchema:y,idPrefix:u,idSeparator:d,formData:uS(r,e),formContext:v,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(e),onChange:this.onPropertyChange(e,a),onBlur:p,onFocus:f,registry:h,disabled:s,readonly:l,hideError:c,onDropPropertyClick:this.onDropPropertyClick},e),name:e,readonly:l,disabled:s,required:i,hidden:g}})),readonly:l,disabled:s,required:i,idSchema:o,uiSchema:t,errorSchema:n,schema:S,formData:r,formContext:v,registry:h};return(0,dt.jsx)(_,{...P,onAddClick:this.handleAddClick})}}const P_=__,O_={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function R_(t){const{schema:r,idSchema:n,uiSchema:o,formData:a,errorSchema:i,idPrefix:s,idSeparator:l,name:c,onChange:u,onKeyChange:d,onDropPropertyClick:p,required:f,registry:h,wasPropertyKeyModified:m=!1}=t,{formContext:g,schemaUtils:v,globalUiOptions:y}=h,b=Yy(o,y),x=Vj("FieldTemplate",h,b),w=Vj("DescriptionFieldTemplate",h,b),S=Vj("FieldHelpTemplate",h,b),k=Vj("FieldErrorTemplate",h,b),C=v.retrieveSchema(r,a),j=n[Fy],$=uj(v.toIdSchema(C,j,a,s,l),n),E=(0,e.useCallback)(((e,t,r)=>u(e,t,r||j)),[j,u]),_=function(e,t,r,n){const o=t.field,{fields:a,translateString:i}=n;if("function"===typeof o)return o;if("string"===typeof o&&o in a)return a[o];const s=GC(e),l=Array.isArray(s)?s[0]:s||"",c=e.$id;let u=O_[l];return c&&c in a&&(u=c),u||!e.anyOf&&!e.oneOf?u in a?a[u]:()=>{const o=Vj("UnsupportedFieldTemplate",n,t);return(0,dt.jsx)(o,{schema:e,idSchema:r,reason:i(b$.UnknownFieldType,[String(e.type)]),registry:n})}:()=>null}(C,b,$,h),P=Boolean(b.disabled??t.disabled),O=Boolean(b.readonly??(t.readonly||t.schema.readOnly||C.readOnly)),R=b.hideError,M=void 0===R?t.hideError:Boolean(R),N=Boolean(b.autofocus??t.autofocus);if(0===Object.keys(C).length)return null;const I=v.getDisplayLabel(C,o,y),{__errors:T,...A}=i||{},D=jk(o,["ui:classNames","classNames","ui:style"]);Jy in D&&(D[Jy]=jk(D[Jy],["classNames","style"]));const F=(0,dt.jsx)(_,{...t,onChange:E,idSchema:$,schema:C,uiSchema:D,disabled:P,readonly:O,hideError:M,autofocus:N,errorSchema:A,formContext:g,rawErrors:T}),z=$[Fy];let L;L=m||Py in C?c:b.title||t.schema.title||C.title||t.title||c;const B=b.description||t.schema.description||C.description||"",W=b.enableMarkdownInDescription?(0,dt.jsx)($_,{options:{disableParsingRawHTML:!0},children:B}):B,V=b.help,H="hidden"===b.widget,U=["form-group","field",`field-${GC(C)}`];!M&&T&&T.length>0&&U.push("field-error has-error has-danger"),o?.classNames&&U.push(o.classNames),b.classNames&&U.push(b.classNames);const q=(0,dt.jsx)(S,{help:V,idSchema:$,schema:C,uiSchema:o,hasErrors:!M&&T&&T.length>0,registry:h}),G=M||(C.anyOf||C.oneOf)&&!v.isSelect(C)?void 0:(0,dt.jsx)(k,{errors:T,errorSchema:i,idSchema:$,schema:C,uiSchema:o,registry:h}),K={description:(0,dt.jsx)(w,{id:Kj(z),description:W,schema:C,uiSchema:o,registry:h}),rawDescription:B,help:q,rawHelp:"string"===typeof V?V:void 0,errors:G,rawErrors:M?void 0:T,id:z,label:L,hidden:H,onChange:u,onKeyChange:d,onDropPropertyClick:p,required:f,disabled:P,readonly:O,hideError:M,displayLabel:I,classNames:U.join(" ").trim(),style:b.style,formContext:g,formData:a,schema:C,uiSchema:o,registry:h},Q=h.fields.AnyOfField,J=h.fields.OneOfField,Y=o?.["ui:field"]&&!0===o?.["ui:fieldReplacesAnyOrOneOf"];return(0,dt.jsx)(x,{...K,children:(0,dt.jsxs)(dt.Fragment,{children:[F,C.anyOf&&!Y&&!v.isSelect(C)&&(0,dt.jsx)(Q,{name:c,disabled:P,readonly:O,hideError:M,errorSchema:i,formData:a,formContext:g,idPrefix:s,idSchema:$,idSeparator:l,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:C.anyOf.map((e=>v.retrieveSchema(Ab(e)?e:{},a))),registry:h,required:f,schema:C,uiSchema:o}),C.oneOf&&!Y&&!v.isSelect(C)&&(0,dt.jsx)(J,{name:c,disabled:P,readonly:O,hideError:M,errorSchema:i,formData:a,formContext:g,idPrefix:s,idSchema:$,idSeparator:l,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:C.oneOf.map((e=>v.retrieveSchema(Ab(e)?e:{},a))),registry:h,required:f,schema:C,uiSchema:o})]})})}class M_ extends e.Component{shouldComponentUpdate(e){return!qw(this.props,e)}render(){return(0,dt.jsx)(R_,{...this.props})}}const N_=M_;const I_=function(e){const{schema:t,name:r,uiSchema:n,idSchema:o,formData:a,required:i,disabled:s=!1,readonly:l=!1,autofocus:c=!1,onChange:u,onBlur:d,onFocus:p,registry:f,rawErrors:h,hideError:m}=e,{title:g,format:v}=t,{widgets:y,formContext:b,schemaUtils:x,globalUiOptions:w}=f,S=x.isSelect(t)?mj(t,n):void 0;let k=S?"select":"text";v&&function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return qj(e,t,r),!0}catch(Ya){const t=Ya;if(t.message&&(t.message.startsWith("No widget")||t.message.startsWith("Unsupported widget")))return!1;throw Ya}}(t,v,y)&&(k=v);const{widget:C=k,placeholder:j="",title:$,...E}=Yy(n),_=x.getDisplayLabel(t,n,w),P=$??g??r,O=qj(t,C,y);return(0,dt.jsx)(O,{options:{...E,enumOptions:S},schema:t,uiSchema:n,id:o.$id,name:r,label:P,hideLabel:!_,hideError:m,value:a,onChange:u,onBlur:d,onFocus:p,required:i,disabled:s,readonly:l,formContext:b,autofocus:c,registry:f,placeholder:j,rawErrors:h})};const T_=function(t){const{formData:r,onChange:n}=t;return(0,e.useEffect)((()=>{void 0===r&&n(null)}),[r,n]),null};const A_=function(){return{AnyOfField:R$,ArrayField:_$,BooleanField:P$,NumberField:I$,ObjectField:P_,OneOfField:R$,SchemaField:N_,StringField:I_,NullField:T_}};function D_(e){const{idSchema:t,description:r,registry:n,schema:o,uiSchema:a}=e,i=Yy(a,n.globalUiOptions),{label:s=!0}=i;if(!r||!s)return null;const l=Vj("DescriptionFieldTemplate",n,i);return(0,dt.jsx)(l,{id:Kj(t),description:r,schema:o,uiSchema:a,registry:n})}function F_(e){const{children:t,className:r,disabled:n,hasToolbar:o,hasMoveDown:a,hasMoveUp:i,hasRemove:s,hasCopy:l,index:c,onCopyIndexClick:u,onDropIndexClick:d,onReorderClick:p,readonly:f,registry:h,uiSchema:m}=e,{CopyButton:g,MoveDownButton:v,MoveUpButton:y,RemoveButton:b}=h.templates.ButtonTemplates,x={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return(0,dt.jsxs)("div",{className:r,children:[(0,dt.jsx)("div",{className:o?"col-xs-9":"col-xs-12",children:t}),o&&(0,dt.jsx)("div",{className:"col-xs-3 array-item-toolbox",children:(0,dt.jsxs)("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(i||a)&&(0,dt.jsx)(y,{style:x,disabled:n||f||!i,onClick:p(c,c-1),uiSchema:m,registry:h}),(i||a)&&(0,dt.jsx)(v,{style:x,disabled:n||f||!a,onClick:p(c,c+1),uiSchema:m,registry:h}),l&&(0,dt.jsx)(g,{style:x,disabled:n||f,onClick:u(c),uiSchema:m,registry:h}),s&&(0,dt.jsx)(b,{style:x,disabled:n||f,onClick:d(c),uiSchema:m,registry:h})]})})]})}function z_(e){const{canAdd:t,className:r,disabled:n,idSchema:o,uiSchema:a,items:i,onAddClick:s,readonly:l,registry:c,required:u,schema:d,title:p}=e,f=Yy(a),h=Vj("ArrayFieldDescriptionTemplate",c,f),m=Vj("ArrayFieldItemTemplate",c,f),g=Vj("ArrayFieldTitleTemplate",c,f),{ButtonTemplates:{AddButton:v}}=c.templates;return(0,dt.jsxs)("fieldset",{className:r,id:o.$id,children:[(0,dt.jsx)(g,{idSchema:o,title:f.title||p,required:u,schema:d,uiSchema:a,registry:c}),(0,dt.jsx)(h,{idSchema:o,description:f.description||d.description,schema:d,uiSchema:a,registry:c}),(0,dt.jsx)("div",{className:"row array-item-list",children:i&&i.map((e=>{let{key:t,...r}=e;return(0,dt.jsx)(m,{...r},t)}))}),t&&(0,dt.jsx)(v,{className:"array-item-add",onClick:s,disabled:n||l,uiSchema:a,registry:c})]})}function L_(e){const{idSchema:t,title:r,schema:n,uiSchema:o,required:a,registry:i}=e,s=Yy(o,i.globalUiOptions),{label:l=!0}=s;if(!r||!l)return null;const c=Vj("TitleFieldTemplate",i,s);return(0,dt.jsx)(c,{id:Xj(t),title:r,required:a,schema:n,uiSchema:o,registry:i})}function B_(t){const{id:r,name:n,value:o,readonly:a,disabled:i,autofocus:s,onBlur:l,onFocus:c,onChange:u,onChangeOverride:d,options:p,schema:f,uiSchema:h,formContext:m,registry:g,rawErrors:v,type:y,hideLabel:b,hideError:x,...w}=t;if(!r)throw console.log("No id for",t),new Error(`no id for props ${JSON.stringify(t)}`);const S={...w,...Lj(f,y,p)};let k;k="number"===S.type||"integer"===S.type?o||0===o?o:"":null==o?"":o;const C=(0,e.useCallback)((e=>{let{target:{value:t}}=e;return u(""===t?p.emptyValue:t)}),[u,p]),j=(0,e.useCallback)((e=>{let{target:t}=e;return l(r,t&&t.value)}),[l,r]),$=(0,e.useCallback)((e=>{let{target:t}=e;return c(r,t&&t.value)}),[c,r]);return(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)("input",{id:r,name:r,className:"form-control",readOnly:a,disabled:i,autoFocus:s,value:k,...S,list:f.examples?Jj(r):void 0,onChange:d||C,onBlur:j,onFocus:$,"aria-describedby":Zj(r,!!f.examples)}),Array.isArray(f.examples)&&(0,dt.jsx)("datalist",{id:Jj(r),children:f.examples.concat(f.default&&!f.examples.includes(f.default)?[f.default]:[]).map((e=>(0,dt.jsx)("option",{value:e},e)))},`datalist_${r}`)]})}function W_(e){let{uiSchema:t}=e;const{submitText:r,norender:n,props:o={}}=Wj(t);return n?null:(0,dt.jsx)("div",{children:(0,dt.jsx)("button",{type:"submit",...o,className:`btn btn-info ${o.className||""}`,children:r})})}function V_(e){const{iconType:t="default",icon:r,className:n,uiSchema:o,registry:a,...i}=e;return(0,dt.jsx)("button",{type:"button",className:`btn btn-${t} ${n}`,...i,children:(0,dt.jsx)("i",{className:`glyphicon glyphicon-${r}`})})}function H_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.CopyButton),className:"array-item-copy",...e,icon:"copy"})}function U_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.MoveDownButton),className:"array-item-move-down",...e,icon:"arrow-down"})}function q_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.MoveUpButton),className:"array-item-move-up",...e,icon:"arrow-up"})}function G_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.RemoveButton),className:"array-item-remove",...e,iconType:"danger",icon:"remove"})}function K_(e){let{className:t,onClick:r,disabled:n,registry:o}=e;const{translateString:a}=o;return(0,dt.jsx)("div",{className:"row",children:(0,dt.jsx)("p",{className:`col-xs-3 col-xs-offset-9 text-right ${t}`,children:(0,dt.jsx)(V_,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:a(b$.AddButton),onClick:r,disabled:n,registry:o})})})}const Q_=function(){return{SubmitButton:W_,AddButton:K_,CopyButton:H_,MoveDownButton:U_,MoveUpButton:q_,RemoveButton:G_}};function J_(e){const{id:t,description:r}=e;return r?"string"===typeof r?(0,dt.jsx)("p",{id:t,className:"field-description",children:r}):(0,dt.jsx)("div",{id:t,className:"field-description",children:r}):null}function Y_(e){let{errors:t,registry:r}=e;const{translateString:n}=r;return(0,dt.jsxs)("div",{className:"panel panel-danger errors",children:[(0,dt.jsx)("div",{className:"panel-heading",children:(0,dt.jsx)("h3",{className:"panel-title",children:n(b$.ErrorsLabel)})}),(0,dt.jsx)("ul",{className:"list-group",children:t.map(((e,t)=>(0,dt.jsx)("li",{className:"list-group-item text-danger",children:e.stack},t)))})]})}const X_="*";function Z_(e){const{label:t,required:r,id:n}=e;return t?(0,dt.jsxs)("label",{className:"control-label",htmlFor:n,children:[t,r&&(0,dt.jsx)("span",{className:"required",children:X_})]}):null}const eP=function(e){const{id:t,label:r,children:n,errors:o,help:a,description:i,hidden:s,required:l,displayLabel:c,registry:u,uiSchema:d}=e,p=Vj("WrapIfAdditionalTemplate",u,Yy(d));return s?(0,dt.jsx)("div",{className:"hidden",children:n}):(0,dt.jsxs)(p,{...e,children:[c&&(0,dt.jsx)(Z_,{label:r,required:l,id:t}),c&&i?i:null,n,o,a]})};function tP(e){const{errors:t=[],idSchema:r}=e;if(0===t.length)return null;const n=Qj(r);return(0,dt.jsx)("div",{children:(0,dt.jsx)("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:t.filter((e=>!!e)).map(((e,t)=>(0,dt.jsx)("li",{className:"text-danger",children:e},t)))})})}function rP(e){const{idSchema:t,help:r}=e;if(!r)return null;const n=Yj(t);return"string"===typeof r?(0,dt.jsx)("p",{id:n,className:"help-block",children:r}):(0,dt.jsx)("div",{id:n,className:"help-block",children:r})}function nP(e){const{description:t,disabled:r,formData:n,idSchema:o,onAddClick:a,properties:i,readonly:s,registry:l,required:c,schema:u,title:d,uiSchema:p}=e,f=Yy(p),h=Vj("TitleFieldTemplate",l,f),m=Vj("DescriptionFieldTemplate",l,f),{ButtonTemplates:{AddButton:g}}=l.templates;return(0,dt.jsxs)("fieldset",{id:o.$id,children:[d&&(0,dt.jsx)(h,{id:Xj(o),title:d,required:c,schema:u,uiSchema:p,registry:l}),t&&(0,dt.jsx)(m,{id:Kj(o),description:t,schema:u,uiSchema:p,registry:l}),i.map((e=>e.content)),Xy(u,p,n)&&(0,dt.jsx)(g,{className:"object-property-expand",onClick:a(u),disabled:r||s,uiSchema:p,registry:l})]})}const oP="*";function aP(e){const{id:t,title:r,required:n}=e;return(0,dt.jsxs)("legend",{id:t,children:[r,n&&(0,dt.jsx)("span",{className:"required",children:oP})]})}const iP=function(e){const{schema:t,idSchema:r,reason:n,registry:o}=e,{translateString:a}=o;let i=b$.UnsupportedField;const s=[];return r&&r.$id&&(i=b$.UnsupportedFieldWithId,s.push(r.$id)),n&&(i=i===b$.UnsupportedField?b$.UnsupportedFieldWithReason:b$.UnsupportedFieldWithIdAndReason,s.push(n)),(0,dt.jsxs)("div",{className:"unsupported-field",children:[(0,dt.jsx)("p",{children:(0,dt.jsx)($_,{options:{disableParsingRawHTML:!0},children:a(i,s)})}),t&&(0,dt.jsx)("pre",{children:JSON.stringify(t,null,2)})]})};function sP(e){const{id:t,classNames:r,style:n,disabled:o,label:a,onKeyChange:i,onDropPropertyClick:s,readonly:l,required:c,schema:u,children:d,uiSchema:p,registry:f}=e,{templates:h,translateString:m}=f,{RemoveButton:g}=h.ButtonTemplates,v=m(b$.KeyLabel,[a]);return Py in u?(0,dt.jsx)("div",{className:r,style:n,children:(0,dt.jsxs)("div",{className:"row",children:[(0,dt.jsx)("div",{className:"col-xs-5 form-additional",children:(0,dt.jsxs)("div",{className:"form-group",children:[(0,dt.jsx)(Z_,{label:v,required:c,id:`${t}-key`}),(0,dt.jsx)("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:e=>{let{target:t}=e;return i(t&&t.value)},defaultValue:a})]})}),(0,dt.jsx)("div",{className:"form-additional form-group col-xs-5",children:d}),(0,dt.jsx)("div",{className:"col-xs-2",children:(0,dt.jsx)(g,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||l,onClick:s(a),uiSchema:p,registry:f})})]})}):(0,dt.jsx)("div",{className:r,style:n,children:d})}const lP=function(){return{ArrayFieldDescriptionTemplate:D_,ArrayFieldItemTemplate:F_,ArrayFieldTemplate:z_,ArrayFieldTitleTemplate:L_,ButtonTemplates:Q_(),BaseInputTemplate:B_,DescriptionFieldTemplate:J_,ErrorListTemplate:Y_,FieldTemplate:eP,FieldErrorTemplate:tP,FieldHelpTemplate:rP,ObjectFieldTemplate:nP,TitleFieldTemplate:aP,UnsupportedFieldTemplate:iP,WrapIfAdditionalTemplate:sP}};function cP(e){let{type:t,range:r,value:n,select:o,rootId:a,name:i,disabled:s,readonly:l,autofocus:c,registry:u,onBlur:d,onFocus:p}=e;const f=a+"_"+t,{SelectWidget:h}=u.widgets;return(0,dt.jsx)(h,{schema:{type:"integer"},id:f,name:i,className:"form-control",options:{enumOptions:Nj(r[0],r[1])},placeholder:t,value:n,disabled:s,readonly:l,autofocus:c,onChange:e=>o(t,e),onBlur:d,onFocus:p,registry:u,label:"","aria-describedby":Zj(a)})}const uP=function(t){let{time:r=!1,disabled:n=!1,readonly:o=!1,autofocus:a=!1,options:i,id:s,name:l,registry:c,onBlur:u,onFocus:d,onChange:p,value:f}=t;const{translateString:h}=c,[m,g]=(0,e.useState)(f),[v,y]=(0,e.useReducer)(((e,t)=>({...e,...t})),r$(f,r));(0,e.useEffect)((()=>{const e=o$(v,r);!function(e){return Object.values(e).every((e=>-1!==e))}(v)||e===f?m!==f&&(g(f),y(r$(f,r))):p(e)}),[r,f,p,v,m]);const b=(0,e.useCallback)(((e,t)=>{y({[e]:t})}),[]),x=(0,e.useCallback)((e=>{if(e.preventDefault(),n||o)return;const t=r$((new Date).toJSON(),r);p(o$(t,r))}),[n,o,r]),w=(0,e.useCallback)((e=>{e.preventDefault(),n||o||p(void 0)}),[n,o,p]);return(0,dt.jsxs)("ul",{className:"list-inline",children:[Fj(v,r,i.yearsRange,i.format).map(((e,t)=>(0,dt.jsx)("li",{className:"list-inline-item",children:(0,dt.jsx)(cP,{rootId:s,name:l,select:b,...e,disabled:n,readonly:o,registry:c,onBlur:u,onFocus:d,autofocus:a&&0===t})},t))),("undefined"===i.hideNowButton||!i.hideNowButton)&&(0,dt.jsx)("li",{className:"list-inline-item",children:(0,dt.jsx)("a",{href:"#",className:"btn btn-info btn-now",onClick:x,children:h(b$.NowLabel)})}),("undefined"===i.hideClearButton||!i.hideClearButton)&&(0,dt.jsx)("li",{className:"list-inline-item",children:(0,dt.jsx)("a",{href:"#",className:"btn btn-warning btn-clear",onClick:w,children:h(b$.ClearLabel)})})]})};const dP=function(e){let{time:t=!0,...r}=e;const{AltDateWidget:n}=r.registry.widgets;return(0,dt.jsx)(n,{time:t,...r})};const pP=function(t){let{schema:r,uiSchema:n,options:o,id:a,value:i,disabled:s,readonly:l,label:c,hideLabel:u,autofocus:d=!1,onBlur:p,onFocus:f,onChange:h,registry:m}=t;const g=Vj("DescriptionFieldTemplate",m,o),v=n$(r),y=(0,e.useCallback)((e=>h(e.target.checked)),[h]),b=(0,e.useCallback)((e=>p(a,e.target.checked)),[p,a]),x=(0,e.useCallback)((e=>f(a,e.target.checked)),[f,a]),w=o.description??r.description;return(0,dt.jsxs)("div",{className:"checkbox "+(s||l?"disabled":""),children:[!u&&!!w&&(0,dt.jsx)(g,{id:Kj(a),description:w,schema:r,uiSchema:n,registry:m}),(0,dt.jsxs)("label",{children:[(0,dt.jsx)("input",{type:"checkbox",id:a,name:a,checked:"undefined"!==typeof i&&i,required:v,disabled:s||l,autoFocus:d,onChange:y,onBlur:b,onFocus:x,"aria-describedby":Zj(a)}),t$((0,dt.jsx)("span",{children:c}),u)]})]})};const fP=function(t){let{id:r,disabled:n,options:{inline:o=!1,enumOptions:a,enumDisabled:i,emptyValue:s},value:l,autofocus:c=!1,readonly:u,onChange:d,onBlur:p,onFocus:f}=t;const h=Array.isArray(l)?l:[l],m=(0,e.useCallback)((e=>{let{target:t}=e;return p(r,Tj(t&&t.value,a,s))}),[p,r]),g=(0,e.useCallback)((e=>{let{target:t}=e;return f(r,Tj(t&&t.value,a,s))}),[f,r]);return(0,dt.jsx)("div",{className:"checkboxes",id:r,children:Array.isArray(a)&&a.map(((e,t)=>{const s=Aj(e.value,h),l=Array.isArray(i)&&-1!==i.indexOf(e.value),p=n||l||u?"disabled":"",f=(0,dt.jsxs)("span",{children:[(0,dt.jsx)("input",{type:"checkbox",id:e$(r,t),name:r,checked:s,value:String(t),disabled:n||l||u,autoFocus:c&&0===t,onChange:e=>{e.target.checked?d(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=Tj(e,r);if(!lj(n)){const e=r.findIndex((e=>n===e.value)),o=r.map((e=>{let{value:t}=e;return t}));return t.slice(0,e).concat(n,t.slice(e)).sort(((e,t)=>Number(o.indexOf(e)>o.indexOf(t))))}return t}(t,h,a)):d(function(e,t){const r=Tj(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);return Array.isArray(t)?t.filter((e=>!qw(e,r))):qw(r,t)?void 0:t}(t,h,a))},onBlur:m,onFocus:g,"aria-describedby":Zj(r)}),(0,dt.jsx)("span",{children:e.label})]});return o?(0,dt.jsx)("label",{className:`checkbox-inline ${p}`,children:f},t):(0,dt.jsx)("div",{className:`checkbox ${p}`,children:(0,dt.jsx)("label",{children:f})},t)}))})};function hP(e){const{disabled:t,readonly:r,options:n,registry:o}=e,a=Vj("BaseInputTemplate",o,n);return(0,dt.jsx)(a,{type:"color",...e,disabled:t||r})}function mP(t){const{onChange:r,options:n,registry:o}=t,a=Vj("BaseInputTemplate",o,n),i=(0,e.useCallback)((e=>r(e||void 0)),[r]);return(0,dt.jsx)(a,{type:"date",...t,onChange:i})}function gP(e){const{onChange:t,value:r,options:n,registry:o}=e,a=Vj("BaseInputTemplate",o,n);return(0,dt.jsx)(a,{type:"datetime-local",...e,value:d$(r),onChange:e=>{return t((r=e)?new Date(r).toJSON():void 0);var r}})}function vP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"email",...e})}function yP(e,t){return null===e?null:e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function bP(e){const{name:t,size:r,type:n}=e;return new Promise(((o,a)=>{const i=new window.FileReader;i.onerror=a,i.onload=e=>{"string"===typeof e.target?.result?o({dataURL:yP(e.target.result,t),name:t,size:r,type:n}):o({dataURL:null,name:t,size:r,type:n})},i.readAsDataURL(e)}))}function xP(e){let{fileInfo:t,registry:r}=e;const{translateString:n}=r,{dataURL:o,type:a,name:i}=t;return o?["image/jpeg","image/png"].includes(a)?(0,dt.jsx)("img",{src:o,style:{maxWidth:"100%"},className:"file-preview"}):(0,dt.jsxs)(dt.Fragment,{children:[" ",(0,dt.jsx)("a",{download:`preview-${i}`,href:o,className:"file-download",children:n(b$.PreviewLabel)})]}):null}function wP(e){let{filesInfo:t,registry:r,preview:n,onRemove:o,options:a}=e;if(0===t.length)return null;const{translateString:i}=r,{RemoveButton:s}=Vj("ButtonTemplates",r,a);return(0,dt.jsx)("ul",{className:"file-info",children:t.map(((e,t)=>{const{name:a,size:l,type:c}=e;return(0,dt.jsxs)("li",{children:[(0,dt.jsx)($_,{children:i(b$.FilesInfo,[a,c,String(l)])}),n&&(0,dt.jsx)(xP,{fileInfo:e,registry:r}),(0,dt.jsx)(s,{onClick:()=>o(t),registry:r})]},t)}))})}function SP(e){return e.reduce(((e,t)=>{if(!t)return e;try{const{blob:r,name:n}=function(e){var t;if(-1===e.indexOf("data:"))throw new Error("File is invalid: URI must be a dataURI");const r=e.slice(5).split(";base64,");if(2!==r.length)throw new Error("File is invalid: dataURI must be base64");const[n,o]=r,[a,...i]=n.split(";"),s=a||"",l=decodeURI((null===(t=i.map((e=>e.split("="))).find((e=>{let[t]=e;return"name"===t})))||void 0===t?void 0:t[1])||"unknown");try{const e=atob(o),t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return{blob:new window.Blob([new Uint8Array(t)],{type:s}),name:l}}catch(c){throw new Error("File is invalid: "+c.message)}}(t);return[...e,{dataURL:t,name:n,size:r.size,type:r.type}]}catch(Ya){return e}}),[])}const kP=function(t){const{disabled:r,readonly:n,required:o,multiple:a,onChange:i,value:s,options:l,registry:c}=t,u=Vj("BaseInputTemplate",c,l),d=(0,e.useCallback)((e=>{var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(bP))).then((e=>{const t=e.map((e=>e.dataURL));i(a?s.concat(t):t[0])}))}),[a,s,i]),p=(0,e.useMemo)((()=>SP(Array.isArray(s)?s:[s])),[s]),f=(0,e.useCallback)((e=>{if(a){const t=s.filter(((t,r)=>r!==e));i(t)}else i(void 0)}),[a,s,i]);return(0,dt.jsxs)("div",{children:[(0,dt.jsx)(u,{...t,disabled:r||n,type:"file",required:!s&&o,onChangeOverride:d,value:"",accept:l.accept?String(l.accept):void 0}),(0,dt.jsx)(wP,{filesInfo:p,onRemove:f,registry:c,preview:l.filePreview,options:l})]})};const CP=function(e){let{id:t,value:r}=e;return(0,dt.jsx)("input",{type:"hidden",id:t,name:t,value:"undefined"===typeof r?"":r})};function jP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"password",...e})}const $P=function(t){let{options:r,value:n,required:o,disabled:a,readonly:i,autofocus:s=!1,onBlur:l,onFocus:c,onChange:u,id:d}=t;const{enumOptions:p,enumDisabled:f,inline:h,emptyValue:m}=r,g=(0,e.useCallback)((e=>{let{target:t}=e;return l(d,Tj(t&&t.value,p,m))}),[l,d]),v=(0,e.useCallback)((e=>{let{target:t}=e;return c(d,Tj(t&&t.value,p,m))}),[c,d]);return(0,dt.jsx)("div",{className:"field-radio-group",id:d,children:Array.isArray(p)&&p.map(((e,t)=>{const r=Aj(e.value,n),l=Array.isArray(f)&&-1!==f.indexOf(e.value),c=a||l||i?"disabled":"",p=(0,dt.jsxs)("span",{children:[(0,dt.jsx)("input",{type:"radio",id:e$(d,t),checked:r,name:d,required:o,value:String(t),disabled:a||l||i,autoFocus:s&&0===t,onChange:()=>u(e.value),onBlur:g,onFocus:v,"aria-describedby":Zj(d)}),(0,dt.jsx)("span",{children:e.label})]});return h?(0,dt.jsx)("label",{className:`radio-inline ${c}`,children:p},t):(0,dt.jsx)("div",{className:`radio ${c}`,children:(0,dt.jsx)("label",{children:p})},t)}))})};function EP(e){const{value:t,registry:{templates:{BaseInputTemplate:r}}}=e;return(0,dt.jsxs)("div",{className:"field-range-wrapper",children:[(0,dt.jsx)(r,{type:"range",...e}),(0,dt.jsx)("span",{className:"range-view",children:t})]})}function _P(e,t){return t?Array.from(e.target.options).slice().filter((e=>e.selected)).map((e=>e.value)):e.target.value}const PP=function(t){let{schema:r,id:n,options:o,value:a,required:i,disabled:s,readonly:l,multiple:c=!1,autofocus:u=!1,onChange:d,onBlur:p,onFocus:f,placeholder:h}=t;const{enumOptions:m,enumDisabled:g,emptyValue:v}=o,y=c?[]:"",b=(0,e.useCallback)((e=>{const t=_P(e,c);return f(n,Tj(t,m,v))}),[f,n,r,c,m,v]),x=(0,e.useCallback)((e=>{const t=_P(e,c);return p(n,Tj(t,m,v))}),[p,n,r,c,m,v]),w=(0,e.useCallback)((e=>{const t=_P(e,c);return d(Tj(t,m,v))}),[d,r,c,m,v]),S=Dj(a,m,c),k=!c&&void 0===r.default;return(0,dt.jsxs)("select",{id:n,name:n,multiple:c,className:"form-control",value:"undefined"===typeof S?y:S,required:i,disabled:s||l,autoFocus:u,onBlur:x,onFocus:b,onChange:w,"aria-describedby":Zj(n),children:[k&&(0,dt.jsx)("option",{value:"",children:h}),Array.isArray(m)&&m.map(((e,t)=>{let{value:r,label:n}=e;const o=g&&-1!==g.indexOf(r);return(0,dt.jsx)("option",{value:String(t),disabled:o,children:n},t)}))]})};function OP(t){let{id:r,options:n={},placeholder:o,value:a,required:i,disabled:s,readonly:l,autofocus:c=!1,onChange:u,onBlur:d,onFocus:p}=t;const f=(0,e.useCallback)((e=>{let{target:{value:t}}=e;return u(""===t?n.emptyValue:t)}),[u,n.emptyValue]),h=(0,e.useCallback)((e=>{let{target:t}=e;return d(r,t&&t.value)}),[d,r]),m=(0,e.useCallback)((e=>{let{target:t}=e;return p(r,t&&t.value)}),[r,p]);return(0,dt.jsx)("textarea",{id:r,name:r,className:"form-control",value:a||"",placeholder:o,required:i,disabled:s,readOnly:l,autoFocus:c,rows:n.rows,onBlur:h,onFocus:m,onChange:f,"aria-describedby":Zj(r)})}OP.defaultProps={autofocus:!1,options:{}};const RP=OP;function MP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{...e})}function NP(t){const{onChange:r,options:n,registry:o}=t,a=Vj("BaseInputTemplate",o,n),i=(0,e.useCallback)((e=>r(e?`${e}:00`:void 0)),[r]);return(0,dt.jsx)(a,{type:"time",...t,onChange:i})}function IP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"url",...e})}function TP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"number",...e})}const AP=function(){return{AltDateWidget:uP,AltDateTimeWidget:dP,CheckboxWidget:pP,CheckboxesWidget:fP,ColorWidget:hP,DateWidget:mP,DateTimeWidget:gP,EmailWidget:vP,FileWidget:kP,HiddenWidget:CP,PasswordWidget:jP,RadioWidget:$P,RangeWidget:EP,SelectWidget:PP,TextWidget:MP,TextareaWidget:RP,TimeWidget:NP,UpDownWidget:TP,URLWidget:IP}};class DP extends e.Component{formElement;constructor(t){if(super(t),!t.validator)throw new Error("A validator is required for Form functionality to work");this.state=this.getStateFromProps(t,t.formData),this.props.onChange&&!qw(this.state.formData,this.props.formData)&&this.props.onChange(this.state),this.formElement=(0,e.createRef)()}getSnapshotBeforeUpdate(e,t){if(!qw(this.props,e)){const r=function(e,t){const r=xb(e),n=xb(t);return e===t||!r&&!n?[]:r&&!n?bw(e):!r&&n?bw(t):[...bw(m$(e,((e,r)=>!qw(e,uS(t,r))))),...y$(bw(t),bw(e))]}(this.props.formData,e.formData),n=!qw(e.schema,this.props.schema),o=r.length>0||!qw(e.formData,this.props.formData),a=this.getStateFromProps(this.props,this.props.formData,n||o?void 0:this.state.retrievedSchema,n,r);return{nextState:a,shouldUpdate:!qw(a,t)}}return{shouldUpdate:!1}}componentDidUpdate(e,t,r){if(r.shouldUpdate){const{nextState:e}=r;qw(e.formData,this.props.formData)||qw(e.formData,t.formData)||!this.props.onChange||this.props.onChange(e),this.setState(e)}}getStateFromProps(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=this.state||{},i="schema"in e?e.schema:this.props.schema,s=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},l="undefined"!==typeof t,c="liveValidate"in e?e.liveValidate:this.props.liveValidate,u=l&&!e.noValidate&&c,d=i,p="experimental_defaultFormStateBehavior"in e?e.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,f="experimental_customMergeAllOf"in e?e.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let h=a.schemaUtils;h&&!h.doesSchemaUtilsDiffer(e.validator,d,p,f)||(h=function(e,t){return new Rj(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3?arguments[3]:void 0)}(e.validator,d,p,f));const m=h.getDefaultFormState(i,t),g=this.updateRetrievedSchema(r??h.retrieveSchema(i,m));let v,y,b=a.schemaValidationErrors,x=a.schemaValidationErrorSchema;if(u){const e=this.validate(m,i,h,g);v=e.errors,y=void 0===r?e.errorSchema:uj(this.state?.errorSchema,e.errorSchema,"preventDuplicates"),b=v,x=y}else{const t=e.noValidate||n?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};if(v=t.errors,y=t.errorSchema,o.length>0){const e=o.reduce(((e,t)=>(e[t]=void 0,e)),{});y=x=uj(t.errorSchema,e,"preventDuplicates")}}if(e.extraErrors){const t=p$({errorSchema:y,errors:v},e.extraErrors);y=t.errorSchema,v=t.errors}const w=h.toIdSchema(g,s["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:h,schema:i,uiSchema:s,idSchema:w,formData:m,edit:l,errors:v,errorSchema:y,schemaValidationErrors:b,schemaValidationErrorSchema:x,retrievedSchema:g}}shouldComponentUpdate(e,t){return function(e,t,r){const{props:n,state:o}=e;return!qw(n,t)||!qw(o,r)}(this,e,t)}getPreviousCustomValidateErrors(){const{customValidate:e,uiSchema:t}=this.props,r=this.state.formData;let n={};if("function"===typeof e){n=u$(e(r,wb(r),t))}return n}validate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.schema,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;const o=r||this.state.schemaUtils,{customValidate:a,transformErrors:i,uiSchema:s}=this.props,l=n??o.retrieveSchema(t,e);return o.getValidator().validateFormData(e,l,a,i,s)}renderErrors(e){const{errors:t,errorSchema:r,schema:n,uiSchema:o}=this.state,{formContext:a}=this.props,i=Vj("ErrorListTemplate",e,Yy(o));return t&&t.length?(0,dt.jsx)(i,{errors:t,errorSchema:r||{},schema:n,uiSchema:o,formContext:a,registry:e}):null}getUsedFormData=(e,t)=>{if(0===t.length&&"object"!==typeof e)return e;const r=S$(e,t);return Array.isArray(e)?Object.keys(r).map((e=>r[e])):r};getFieldNames=(e,t)=>{const r=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[[]];return Object.keys(e).forEach((a=>{if("object"===typeof e[a]){const t=o.map((e=>[...e,a]));e[a][Gy]&&""!==e[a][By]?n.push(e[a][By]):r(e[a],n,t)}else a===By&&""!==e[a]&&o.forEach((e=>{const r=uS(t,e);("object"!==typeof r||pS(r)||Array.isArray(r)&&r.every((e=>"object"!==typeof e)))&&n.push(e)}))})),n};return r(e)};omitExtraData=e=>{const{schema:t,schemaUtils:r}=this.state,n=r.retrieveSchema(t,e),o=r.toPathSchema(n,"",e),a=this.getFieldNames(o,e);return this.getUsedFormData(e,a)};filterErrorsBasedOnSchema(e,t,r){const{retrievedSchema:n,schemaUtils:o}=this.state,a=t??n,i=o.toPathSchema(a,"",r),s=this.getFieldNames(i,r),l=S$(e,s);"object"!==t?.type&&"array"!==t?.type&&(l.__errors=e.__errors);const c=this.getPreviousCustomValidateErrors(),u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return x$(e,((r,n)=>{const o=t[n];lj(r)||Array.isArray(r)&&0===r.length?delete e[n]:Ey(r)&&Ey(o)&&Array.isArray(o?.__errors)?e[n]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return 0===e.length?e:e.filter((e=>!t.includes(e)))}(r.__errors,o.__errors):"object"!==typeof r||Array.isArray(r.__errors)||u(r,t[n])})),e};return u(l,c)}onChange=(e,t,r)=>{const{extraErrors:n,omitExtraData:o,liveOmit:a,noValidate:i,liveValidate:s,onChange:l}=this.props,{schemaUtils:c,schema:u}=this.state;let d=this.state.retrievedSchema;if(Ey(e)||Array.isArray(e)){const t=this.getStateFromProps(this.props,e);e=t.formData,d=t.retrievedSchema}const p=!i&&s;let f={formData:e,schema:u},h=e;if(!0===o&&!0===a&&(h=this.omitExtraData(e),f={formData:h}),p){const e=this.validate(h,u,c,d);let r=e.errors,o=e.errorSchema;const a=r,i=o;if(n){const t=p$(e,n);o=t.errorSchema,r=t.errors}if(t){o=uj(o,this.filterErrorsBasedOnSchema(t,d,h),"preventDuplicates")}f={formData:h,errors:r,errorSchema:o,schemaValidationErrors:a,schemaValidationErrorSchema:i}}else if(!i&&t){const e=n?uj(t,n,"preventDuplicates"):t;f={formData:h,errorSchema:e,errors:a$(e)}}this.setState(f,(()=>l&&l({...this.state,...f},r)))};updateRetrievedSchema(e){return qw(e,this.state?.retrievedSchema)?this.state.retrievedSchema:e}reset=()=>{const{onChange:e}=this.props,t={formData:this.getStateFromProps(this.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};this.setState(t,(()=>e&&e({...this.state,...t})))};onBlur=(e,t)=>{const{onBlur:r}=this.props;r&&r(e,t)};onFocus=(e,t)=>{const{onFocus:r}=this.props;r&&r(e,t)};onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:t,extraErrors:r,noValidate:n,onSubmit:o}=this.props;let{formData:a}=this.state;if(!0===t&&(a=this.omitExtraData(a)),n||this.validateFormWithFormData(a)){const t=r||{},n=r?a$(r):[];this.setState({formData:a,errors:n,errorSchema:t,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(()=>{o&&o({...this.state,formData:a,status:"submitted"},e)}))}};getRegistry(){const{translateString:e,uiSchema:t={}}=this.props,{schemaUtils:r}=this.state,{fields:n,templates:o,widgets:a,formContext:i,translateString:s}={fields:A_(),templates:lP(),widgets:AP(),rootSchema:{},formContext:{},translateString:Ij};return{fields:{...n,...this.props.fields},templates:{...o,...this.props.templates,ButtonTemplates:{...o.ButtonTemplates,...this.props.templates?.ButtonTemplates}},widgets:{...a,...this.props.widgets},rootSchema:this.props.schema,formContext:this.props.formContext||i,schemaUtils:r,translateString:e||s,globalUiOptions:t["ui:globalOptions"]}}submit=()=>{if(this.formElement.current){const e=new CustomEvent("submit",{cancelable:!0});e.preventDefault(),this.formElement.current.dispatchEvent(e),this.formElement.current.requestSubmit()}};focusOnError(e){const{idPrefix:t="root",idSeparator:r="_"}=this.props,{property:n}=e,o=i$(n);""===o[0]?o[0]=t:o.unshift(t);const a=o.join(r);let i=this.formElement.current.elements[a];i||(i=this.formElement.current.querySelector(`input[id^="${a}"`)),i&&i.length&&(i=i[0]),i&&i.focus()}validateFormWithFormData=e=>{const{extraErrors:t,extraErrorsBlockSubmit:r,focusOnFirstError:n,onError:o}=this.props,{errors:a}=this.state,i=this.validate(e);let s=i.errors,l=i.errorSchema;const c=s,u=l,d=s.length>0||t&&r;if(d){if(t){const e=p$(i,t);l=e.errorSchema,s=e.errors}n&&("function"===typeof n?n(s[0]):this.focusOnError(s[0])),this.setState({errors:s,errorSchema:l,schemaValidationErrors:c,schemaValidationErrorSchema:u},(()=>{o?o(s):console.error("Form validation failed",s)}))}else a.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!d};validateForm(){const{omitExtraData:e}=this.props;let{formData:t}=this.state;return!0===e&&(t=this.omitExtraData(t)),this.validateFormWithFormData(t)}render(){const{children:e,id:t,idPrefix:r,idSeparator:n,className:o="",tagName:a,name:i,method:s,target:l,action:c,autoComplete:u,enctype:d,acceptcharset:p,acceptCharset:f,noHtml5Validate:h=!1,disabled:m,readonly:g,formContext:v,showErrorList:y="top",_internalFormWrapper:b}=this.props,{schema:x,uiSchema:w,formData:S,errorSchema:k,idSchema:C}=this.state,j=this.getRegistry(),{SchemaField:$}=j.fields,{SubmitButton:E}=j.templates.ButtonTemplates,_=b?a:void 0,P=b||a||"form";let{[Uy]:O={}}=Yy(w);m&&(O={...O,props:{...O.props,disabled:!0}});const R={[Jy]:{[Uy]:O}};return(0,dt.jsxs)(P,{className:o||"rjsf",id:t,name:i,method:s,target:l,action:c,autoComplete:u,encType:d,acceptCharset:f||p,noValidate:h,onSubmit:this.onSubmit,as:_,ref:this.formElement,children:["top"===y&&this.renderErrors(j),(0,dt.jsx)($,{name:"",schema:x,uiSchema:w,errorSchema:k,idSchema:C,idPrefix:r,idSeparator:n,formContext:v,formData:S,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:j,disabled:m,readonly:g}),e||(0,dt.jsx)(E,{uiSchema:R,registry:j}),"bottom"===y&&this.renderErrors(j)]})}}const FP=DP;var zP=r(3081),LP=r.n(zP),BP=r(483),WP=r.n(BP);const VP={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},HP=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,UP=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function qP(e,t,r,n,o,a,i){const{validationError:s}=t;let l=function(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((t=>{var r;const{instancePath:n,keyword:o,params:a,schemaPath:i,parentSchema:s,...l}=t;let{message:c=""}=l,u=n.replace(/\//g,"."),d=`${u} ${c}`.trim();const p=[...(null===(r=a.deps)||void 0===r?void 0:r.split(", "))||[],a.missingProperty,a.property].filter((e=>e));if(p.length>0)p.forEach((t=>{let r=Yy(uS(e,`${(u?`${u}.${t}`:t).replace(/^\./,"")}`)).title;if(void 0===r){const n=i.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([t]);r=Yy(uS(e,n)).title}if(r)c=c.replace(`'${t}'`,`'${r}'`);else{const e=uS(s,[Vy,t,"title"]);e&&(c=c.replace(`'${t}'`,`'${e}'`))}})),d=c;else{const t=Yy(uS(e,`${u.replace(/^\./,"")}`)).title;if(t)d=`'${t}' ${c}`.trim();else{const e=null===s||void 0===s?void 0:s.title;e&&(d=`'${e}' ${c}`.trim())}}return"missingProperty"in a&&(u=u?`${u}.${a.missingProperty}`:a.missingProperty),{name:o,property:u,message:c,params:a,stack:d,schemaPath:i}}))}(t.errors,i);s&&(l=[...l,{stack:s.message}]),"function"===typeof a&&(l=a(l,i));let c=function(e){const t=new c$;return e.length&&e.forEach((e=>{const{property:r,message:n}=e,o="."===r?[]:i$(r);o.length>0&&""===o[0]&&o.splice(0,1),n&&t.addErrors(n,o)})),t.ErrorSchema}(l);if(s&&(c={...c,$schema:{__errors:[s.message]}}),"function"!==typeof o)return{errors:l,errorSchema:c};const u=Sj(e,n,r,n,!0);return p$({errors:l,errorSchema:c},u$(o(u,wb(u),i)))}class GP{constructor(e,t){const{additionalMetaSchemas:r,customFormats:n,ajvOptionsOverrides:o,ajvFormatOptions:a,AjvClass:i}=e;this.ajv=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;const o=new(arguments.length>4&&void 0!==arguments[4]?arguments[4]:LP())({...VP,...r});return n?WP()(o,n):!1!==n&&WP()(o),o.addFormat("data-url",UP),o.addFormat("color",HP),o.addKeyword(Py),o.addKeyword(Gy),Array.isArray(e)&&o.addMetaSchema(e),Ab(t)&&Object.keys(t).forEach((e=>{o.addFormat(e,t[e])})),o}(r,n,o,a,i),this.localizer=t}reset(){this.ajv.removeSchema()}toErrorList(e){return a$(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])}rawValidation(e,t){var r,n;let o,a,i;e[Fy]&&(a=this.ajv.getSchema(e[Fy]));try{void 0===a&&(a=this.ajv.compile(e)),a(t)}catch(s){o=s}return a&&("function"===typeof this.localizer&&((null!==(r=a.errors)&&void 0!==r?r:[]).forEach((e=>{var t;["missingProperty","property"].forEach((t=>{var r;(null===(r=e.params)||void 0===r?void 0:r[t])&&(e.params[t]=`'${e.params[t]}'`)})),(null===(t=e.params)||void 0===t?void 0:t.deps)&&(e.params.deps=e.params.deps.split(", ").map((e=>`'${e}'`)).join(", "))})),this.localizer(a.errors),(null!==(n=a.errors)&&void 0!==n?n:[]).forEach((e=>{var t;["missingProperty","property"].forEach((t=>{var r;(null===(r=e.params)||void 0===r?void 0:r[t])&&(e.params[t]=e.params[t].slice(1,-1))})),(null===(t=e.params)||void 0===t?void 0:t.deps)&&(e.params.deps=e.params.deps.split(", ").map((e=>e.slice(1,-1))).join(", "))}))),i=a.errors||void 0,a.errors=null),{errors:i,validationError:o}}validateFormData(e,t,r,n,o){return qP(this,this.rawValidation(t,e),e,t,r,n,o)}handleSchemaUpdate(e){var t,r;const n=null!==(t=e[Fy])&&void 0!==t?t:Ky;void 0===this.ajv.getSchema(n)?this.ajv.addSchema(e,n):qw(e,null===(r=this.ajv.getSchema(n))||void 0===r?void 0:r.schema)||(this.ajv.removeSchema(n),this.ajv.addSchema(e,n))}isValid(e,t,r){var n;try{this.handleSchemaUpdate(r);const o=f$(e),a=null!==(n=o[Fy])&&void 0!==n?n:function(e){const t=new Set;return JSON.stringify(e,((e,r)=>(t.add(e),r))),function(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t.toString(16)}(JSON.stringify(e,Array.from(t).sort()))}(o);let i;i=this.ajv.getSchema(a),void 0===i&&(i=this.ajv.addSchema(o,a).getSchema(a)||this.ajv.compile(o));return i(t)}catch(Ya){return console.warn("Error encountered compiling schema:",Ya),!1}}}const KP=function(){return new GP(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}(),QP=!1,JP={fontSize:"16px",fontWeight:"bold",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"},YP={fontSize:"12px",fontWeight:"normal",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"},XP={fontSize:"14px",fontWeight:"normal",color:"var(--secondary-color)",backgroundColor:"var(--div-bg-color)"},ZP={fontSize:"16px",fontWeight:"bold",backgroundColor:"var(--div-bg-color)"},eO={padding:"0px",margin:"0px"},tO={},rO={},nO={},oO={};let aO=[],iO=[];const sO=t=>{let{open:r,onClose:n,plugin:o}=t;const{sendMessage:a,addListener:i,removeListener:s,getUniqueId:l}=(0,e.useContext)(Qh),c=(0,e.useRef)(l()),[u,d]=(0,e.useState)(o.configJson),[p,f]=(0,e.useState)(o.schemaJson),[h,m]=(0,e.useState)({"ui:submitButtonOptions":{submitText:"Confirm"},"ui:globalOptions":{orderable:!0}}),[g,v]=(0,e.useState)("");(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&(e.id===c.current&&"/api/select/devices"===e.method&&(e.response&&(aO=e.response),e.error&&console.error("ConfigPluginDialog received /api/select/devices error:",e.error)),e.id===c.current&&"/api/select/entities"===e.method&&(e.response&&(iO=e.response),e.error&&console.error("ConfigPluginDialog received /api/select/entities error:",e.error)))};return i(e),void 0!==u&&void 0!==p&&(Object.keys(p.properties).forEach((e=>{Object.keys(p.properties[e]).forEach((t=>{t.startsWith("ui:")&&(h[e]={},h[e][t]=p.properties[e][t],delete p.properties[e][t])}))})),m(h)),void 0!==o.name&&void 0!==o.configJson&&void 0!==o.schemaJson&&(d(o.configJson),f(o.schemaJson),a({id:c.current,method:"/api/select/devices",src:"Frontend",dst:"Matterbridge",params:{plugin:o.name}}),a({id:c.current,method:"/api/select/entities",src:"Frontend",dst:"Matterbridge",params:{plugin:o.name}})),()=>{s(e)}}),[i,u,o,s,p,a,h]);const y=e=>{let{formData:t}=e;d(t),o.configJson=t,o.restartRequired=!0;const r=JSON.stringify(t,null,2);Bf("saveconfig",t.name,r),n()};return r&&p&&u?(0,dt.jsxs)(mh,{open:r,onClose:n,maxWidth:"800px",children:[(0,dt.jsx)(xh,{gap:"20px",children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h3",{children:"Matterbridge plugin configuration"})]})}),(0,dt.jsx)(Ch,{style:{padding:"0px",margin:"0px",width:"800px",height:"600px",overflow:"auto"},children:(0,dt.jsx)(FP,{schema:p,formData:u,uiSchema:h,validator:KP,templates:{FieldTemplate:function(e){const{children:t,description:r,displayLabel:n,errors:o,help:a,hidden:i,id:s,label:l,registry:c,uiSchema:u}=e,d=Vj("WrapIfAdditionalTemplate",c,Yy(u));return i?(0,dt.jsx)("div",{style:{display:"none"},children:t}):(0,dt.jsx)(Uf,{sx:{display:"flex",flexDirection:"column",flexGrow:1,padding:0,margin:0,border:"none"},children:(0,dt.jsxs)(d,{...e,children:[!0===n&&r,t,o,a]})})},BaseInputTemplate:function(e){const{id:t,name:r,schema:n,uiSchema:o,value:a,options:i,label:s,type:l,placeholder:c,required:u,disabled:d,readonly:p,autofocus:f,onChange:h,onChangeOverride:m,onBlur:g,onFocus:v,rawErrors:y,hideError:b,registry:x,formContext:w}=e;return(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px"},children:(0,dt.jsx)(fv,{id:t,name:t,label:c&&""!==c?s:void 0,variant:"outlined",placeholder:c&&""!==c?c:s,required:u,disabled:d||p,autoFocus:f,value:a||0===a?a:"",type:l,autoComplete:"password"===l?"current-password":r,onChange:m||(e=>{let{target:{value:t}}=e;return h(""===t?i.emptyValue:t)}),onBlur:e=>{let{target:r}=e;return g(t,r&&r.value)},onFocus:e=>{let{target:r}=e;return v(t,r&&r.value)},fullWidth:!0})})},TitleFieldTemplate:function(e){const{required:t,title:r}=e;return r?(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginTop:"5px"},children:(0,dt.jsxs)(vf,{sx:JP,children:["Title ",r," ",t&&(0,dt.jsx)("mark",{children:"***"})]})}):null},DescriptionFieldTemplate:function(e){const{description:t}=e;return t?(0,dt.jsx)(vf,{sx:YP,children:t}):null},FieldHelpTemplate:function(e){const{help:t,idSchema:r}=e;return t?(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginTop:"5px"},children:(0,dt.jsx)(vf,{sx:XP,children:t})}):null},FieldErrorTemplate:function(e){const{errors:t}=e;return t?(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginTop:"5px"},children:t.map(((e,t)=>(0,dt.jsxs)(vf,{color:"error",variant:"body2",sx:{marginLeft:1},children:["This field ",e]},t)))}):null},ErrorListTemplate:function(e){const{errors:t}=e;return t?(0,dt.jsxs)(Uf,{sx:{padding:"10px",margin:"10px",border:"1px solid grey"},children:[(0,dt.jsx)(vf,{color:"error",sx:ZP,children:"Please fix the following errors:"}),(0,dt.jsx)(Dd,{children:t.map(((e,t)=>(0,dt.jsxs)(hy,{children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Cy,{color:"error"})}),(0,dt.jsx)(xf,{primary:e.stack})]},t)))})]}):null},WrapIfAdditionalTemplate:function(e){const{id:t,label:r,onKeyChange:n,onDropPropertyClick:o,disabled:a,schema:i,children:s,registry:l,readonly:c,required:u}=e,{templates:d}=l,{RemoveButton:p}=d.ButtonTemplates;return Py in i?(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",flexGrow:1,padding:0,margin:0,border:"none"},children:[(0,dt.jsx)(fv,{id:`${t}-key`,name:`${t}-key`,required:u,disabled:a||c,defaultValue:r,onBlur:c?void 0:e=>{let{target:t}=e;return n(t&&t.value)},type:"text",variant:"outlined",sx:{width:"250px",minWidth:"250px",maxWidth:"250px",marginRight:"20px"}}),(0,dt.jsx)(Uf,{sx:{flex:1},children:s}),(0,dt.jsx)(p,{disabled:a||c,onClick:o(r)})]}):(0,dt.jsx)(Uf,{sx:{display:"flex",flexDirection:"column",flexGrow:1,padding:0,margin:0,border:"none"},children:s})},ArrayFieldTitleTemplate:function(e){return console.log("ArrayFieldTitleTemplate:",e),null},ArrayFieldDescriptionTemplate:function(e){return console.log("ArrayFieldDescriptionTemplate:",e),null},ArrayFieldItemTemplate:function(e){return console.log("ArrayFieldItemTemplate:",e),null},ArrayFieldTemplate:function(t){const{canAdd:r,className:n,disabled:o,formContext:a,formData:i,idSchema:s,items:l,onAddClick:c,rawErrors:u,readonly:d,registry:p,required:f,schema:h,title:m,uiSchema:g}=t,[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)(!1),[w,S]=(0,e.useState)(!1),[k,C]=(0,e.useState)(""),j=e=>{C(e.target.value)},$=()=>{y(!v)},E=()=>{x(!b)},_=()=>{S(!w)};return(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"5px 10px 5px 10px",border:"1px solid grey"},children:[m&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"0px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[m&&(0,dt.jsx)(vf,{sx:JP,children:m}),r&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"0px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.selectFrom&&(0,dt.jsx)(Uu,{title:"Add a device from the list",children:(0,dt.jsx)(Rd,{onClick:$,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),h.selectEntityFrom&&(0,dt.jsx)(Uu,{title:"Add an entity from the list",children:(0,dt.jsx)(Rd,{onClick:E,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),h.selectDeviceEntityFrom&&(0,dt.jsx)(Uu,{title:"Add a device entity from the list",children:(0,dt.jsx)(Rd,{onClick:_,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),(0,dt.jsx)(Uu,{title:"Add a new item",children:(0,dt.jsx)(Rd,{onClick:c,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(mv,{})})})]})]}),h.description&&(0,dt.jsx)(vf,{sx:YP,children:h.description}),t.items.map((e=>(0,dt.jsxs)(Uf,{sx:{margin:"2px 0px",padding:"0px",display:"flex",alignItems:"center"},children:[(0,dt.jsx)(Uf,{sx:{flexGrow:1,marginRight:"10px"},children:e.children}),(0,dt.jsx)(Rd,{disabled:!e.hasMoveUp,onClick:e.onReorderClick(e.index,e.index-1),size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(Sy,{})}),(0,dt.jsx)(Rd,{disabled:!e.hasMoveDown,onClick:e.onReorderClick(e.index,e.index+1),size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(ky,{})}),(0,dt.jsx)(Rd,{onClick:e.onDropIndexClick(e.index),size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(ty,{})})]},e.index))),(0,dt.jsxs)(mh,{open:v,onClose:$,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsx)(xh,{children:"Select a device"}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",marginBottom:"10px"},children:[(0,dt.jsx)(vf,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{fullWidth:!0,variant:"outlined",value:k,onChange:j,placeholder:"Enter serial or name"})]}),(0,dt.jsx)(Dd,{dense:!0,children:aO.filter((e=>e.serial.toLowerCase().includes(k.toLowerCase())||e.name.toLowerCase().includes(k.toLowerCase()))).map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{y(!1),"serial"===h.selectFrom?h.items.default=e.serial:"name"===h.selectFrom&&(h.items.default=e.name),c()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.serial,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))})]}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:$,children:"Close"})})]}),(0,dt.jsxs)(mh,{open:b,onClose:E,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsx)(xh,{children:"Select an entity"}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",marginBottom:"10px"},children:[(0,dt.jsx)(vf,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{fullWidth:!0,variant:"outlined",value:k,onChange:j,placeholder:"Enter name or description"})]}),(0,dt.jsx)(Dd,{dense:!0,children:iO.filter((e=>e.name.toLowerCase().includes(k.toLowerCase())||e.description.toLowerCase().includes(k.toLowerCase()))).map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{x(!1),"name"===h.selectEntityFrom?h.items.default=e.name:"description"===h.selectEntityFrom&&(h.items.default=e.description),c()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),"component"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(jy,{style:rO})}),"matter"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)($y,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.description,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))})]}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:E,children:"Close"})})]}),(0,dt.jsxs)(mh,{open:w,onClose:_,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsxs)(xh,{children:["Select an entity for ",m]}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)(Dd,{dense:!0,children:aO.filter((e=>e.serial===m||e.name===m)).map((e=>{var t;return null===(t=e.entities)||void 0===t?void 0:t.map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{S(!1),"name"===h.selectDeviceEntityFrom?h.items.default=e.name:"description"===h.selectDeviceEntityFrom&&(h.items.default=e.description),c()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),"component"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(jy,{style:rO})}),"matter"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)($y,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.description,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))}))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:_,children:"Close"})})]})]})},ObjectFieldTemplate:function(t){const{onAddClick:r,schema:n,properties:o,title:a,description:i}=t,[s,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(""),d=()=>{l(!s)},p=!n.additionalProperties;return p||""===g||o.forEach((e=>{if("newKey"===e.name&&"newKey"===e.content.key&&"newKey"===e.content.props.name&&e.content.props.onKeyChange&&""!==g){QP;const t=g;v(""),e.content.props.onKeyChange(t)}})),(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:p?"10px":"5px 10px 0px 10px",border:p?"none":"1px solid grey"},children:[n.title&&p&&(0,dt.jsx)(Uf,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px",margin:"0px",marginBottom:"10px"},children:(0,dt.jsx)(vf,{sx:JP,children:n.title})}),a&&!p&&(0,dt.jsxs)(Uf,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px",margin:"0px"},children:[(0,dt.jsx)(vf,{sx:JP,children:a}),(0,dt.jsxs)(Uf,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px",margin:"0px"},children:[n.selectFrom&&(0,dt.jsx)(Uu,{title:"Add a device from the list",children:(0,dt.jsx)(Rd,{onClick:d,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),(0,dt.jsx)(Uu,{title:"Add a new item",children:(0,dt.jsx)(Rd,{onClick:()=>{r(n)()},size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(mv,{})})})]})]}),n.description&&(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginBottom:"10px"},children:(0,dt.jsx)(vf,{sx:YP,children:n.description})}),o.map((e=>{let{content:t,name:r,hidden:o}=e;return!o&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",marginBottom:"10px",padding:["object","array","boolean"].includes(n.properties[r].type)?"0px":"5px 10px 5px 10px",border:["object","array","boolean"].includes(n.properties[r].type)?"none":"1px solid grey"},children:[!["object","array","boolean"].includes(n.properties[r].type)&&(0,dt.jsx)(vf,{sx:JP,children:r}),(0,dt.jsx)(Uf,{sx:{flexGrow:1,padding:"0px",margin:"0px"},children:t})]},r)})),(0,dt.jsxs)(mh,{open:s,onClose:d,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsx)(xh,{children:"Select a device"}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",marginBottom:"10px"},children:[(0,dt.jsx)(vf,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{fullWidth:!0,variant:"outlined",value:c,onChange:e=>{u(e.target.value)},placeholder:"Enter serial or name"})]}),(0,dt.jsx)(Dd,{dense:!0,children:aO.filter((e=>e.serial.toLowerCase().includes(c.toLowerCase())||e.name.toLowerCase().includes(c.toLowerCase()))).map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{l(!1);let t="";"serial"===n.selectFrom?t=e.serial:"name"===n.selectFrom&&(t=e.name),v(t),r(n)()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.serial,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))})]}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:d,children:"Close"})})]})]})},ButtonTemplates:{SubmitButton:function(e){const{uiSchema:t}=e,{submitText:r,norender:o}=Wj(t);return o?null:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"10px",padding:"0px",gap:"20px"},children:[(0,dt.jsx)(Ah,{type:"submit",variant:"contained",color:"primary",children:r}),(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:n,children:"Cancel"})]})},RemoveButton:function(e){const{className:t,disabled:r,onClick:n,registry:o,style:a,uiSchema:i,...s}=e;return(0,dt.jsx)(Uu,{title:"Remove the item",children:(0,dt.jsx)(Rd,{disabled:r,size:"small",color:"primary",onClick:n,children:(0,dt.jsx)(ty,{})})})},AddButton:function(e){const{className:t,disabled:r,onClick:n,registry:o,uiSchema:a,...i}=e;return(0,dt.jsx)(Uu,{title:"Add an item",children:(0,dt.jsx)(Rd,{size:"small",color:"primary",onClick:n,children:(0,dt.jsx)(mv,{})})})},MoveUpButton:function(e){const{disabled:t,onClick:r,registry:n,style:o,uiSchema:a,...i}=e;return(0,dt.jsx)(Uu,{title:"Move up the item",children:(0,dt.jsx)(Rd,{size:"small",color:"primary",onClick:r,children:(0,dt.jsx)(Sy,{})})})},MoveDownButton:function(e){const{disabled:t,onClick:r,registry:n,style:o,uiSchema:a,...i}=e;return(0,dt.jsx)(Uu,{title:"Move down the item",children:(0,dt.jsx)(Rd,{size:"small",color:"primary",onClick:r,children:(0,dt.jsx)(ky,{})})})}}},widgets:{CheckboxWidget:function(t){const{id:r,name:i,value:s,schema:l,readonly:d,onChange:p}=t,[f,h]=(0,e.useState)(void 0),m=()=>{a({id:c.current,method:"/api/action",src:"Frontend",dst:"Matterbridge",params:{plugin:o.name,action:i,value:f,id:r}}),!0===l.buttonClose?n():!0===l.buttonSave&&y({formData:u})};return l.buttonText&&l.description?(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"10px",border:"1px solid grey",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,dt.jsx)(vf,{sx:YP,children:l.description}),(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:()=>m(),children:l.buttonText})]}):l.buttonField&&l.description?(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"10px",gap:"20px",border:"1px solid grey",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,dt.jsx)(vf,{sx:YP,children:l.description}),(0,dt.jsx)(fv,{id:i+"-input",name:i,label:l.textLabel,placeholder:l.textPlaceholder,onChange:e=>(e=>{h(e&&""!==e?e:void 0)})(e.target.value),sx:{width:"250px",minWidth:"250px",maxWidth:"250px"}}),(0,dt.jsx)(Ah,{id:i+"-button",variant:"contained",color:"primary",disabled:void 0===f,onClick:()=>m(),children:l.buttonField})]}):(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"5px 10px",border:"1px solid grey"},children:[i&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"0px",gap:"10px",display:"flex",justifyContent:"flex-start",alignItems:"center"},children:[(0,dt.jsx)(vf,{sx:JP,children:i}),(0,dt.jsx)(Kv,{checked:s,readOnly:d,onChange:()=>p(!s),sx:{padding:"0px",margin:"0px"}})]}),l.description&&(0,dt.jsx)(vf,{sx:YP,children:l.description})]})},SelectWidget:function(e){let{schema:t,id:r,name:n,options:o,label:a,hideLabel:i,required:s,disabled:l,placeholder:c,readonly:u,value:d,multiple:p,autofocus:f,onChange:h,onBlur:m,onFocus:g,errorSchema:v,rawErrors:y=[],registry:b,uiSchema:x,hideError:w,formContext:S,...k}=e;const{enumOptions:C,enumDisabled:j,emptyValue:$}=o;p="undefined"!==typeof p&&!!p;const E=p?[]:"",_="undefined"===typeof d||p&&d.length<1||!p&&d===E,P=Dj(d,C,p),{InputLabelProps:O,SelectProps:R,autocomplete:M,...N}=k,I=!p&&void 0===t.default;return(0,dt.jsxs)(fv,{id:r,name:r,value:_||"undefined"===typeof P?E:P,required:s,disabled:l||u,autoFocus:f,autoComplete:M,placeholder:c,error:y.length>0,onChange:e=>{let{target:{value:t}}=e;return h(Tj(t,C,$))},onBlur:e=>{let{target:t}=e;return m(r,Tj(t&&t.value,C,$))},onFocus:e=>{let{target:t}=e;return g(r,Tj(t&&t.value,C,$))},...N,select:!0,InputLabelProps:{...O,shrink:!_},SelectProps:{...R,multiple:p},"aria-describedby":Zj(r),children:[I&&(0,dt.jsx)(tf,{value:"",children:c}),Array.isArray(C)&&C.map(((e,t)=>{let{value:r,label:n}=e;const o=Array.isArray(j)&&-1!==j.indexOf(r);return(0,dt.jsx)(tf,{value:String(t),disabled:o,children:n},t)}))]})}},onSubmit:y})})]}):null};function lO(t){let{data:r,columns:n,columnVisibility:o}=t;const a=e.useMemo((()=>n.filter((e=>o[e.accessor]))),[n,o]),{getTableProps:i,getTableBodyProps:s,headerGroups:l,rows:c,prepareRow:u}=(0,yv.useTable)({columns:a,data:r},yv.useSortBy);return(0,dt.jsxs)("table",{...i(),style:{border:"none",borderCollapse:"collapse"},children:[(0,dt.jsx)("thead",{style:{border:"none",borderCollapse:"collapse"},children:l.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),style:{border:"none",borderCollapse:"collapse"},children:e.headers.map((e=>(0,dt.jsx)("th",{...e.getHeaderProps(void 0),style:{border:"none",borderCollapse:"collapse",cursor:e.noSort?"default":"pointer"},children:e.render("Header")})))})))}),(0,dt.jsx)("tbody",{...s(),style:{border:"none",borderCollapse:"collapse"},children:c.map(((e,t)=>(u(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),style:{border:"none",borderCollapse:"collapse"},children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),style:{border:"none",borderCollapse:"collapse"},children:e.render("Cell")})))},t))))})]})}function cO(t){let{selectPlugin:r}=t;const{online:n,logMessage:o,sendMessage:a,addListener:i,removeListener:s,getUniqueId:l}=(0,e.useContext)(Qh),{showConfirmCancelDialog:c}=(0,e.useContext)(Fh),u=(0,e.useRef)(l()),[d,p]=(0,e.useState)(null),[f,h]=(0,e.useState)(null),[m,g]=(0,e.useState)([]),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)({name:!0,description:!0,version:!0,author:!0,type:!0,addedDevices:!0,actions:!0,status:!0}),w=[{Header:"Name",accessor:"name",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(Uu,{title:"Open the plugin homepage",children:(0,dt.jsx)("span",{style:{cursor:"pointer"},onClick:()=>O(t.original),children:t.original.name})})}},{Header:"Description",accessor:"description",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(Uu,{title:"Open the plugin homepage",children:(0,dt.jsx)("span",{style:{cursor:"pointer"},onClick:()=>O(t.original),children:t.original.description})})}},{Header:"Version",accessor:"version",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(dt.Fragment,{children:void 0===t.original.latestVersion||t.original.latestVersion===t.original.version||f&&f.readOnly?(0,dt.jsx)(Uu,{title:"Plugin version",children:t.original.version}):(0,dt.jsx)(Uu,{title:"New plugin version available, click to install",children:(0,dt.jsxs)("span",{className:"status-warning",onClick:()=>E(t.original),children:["Update v.",t.original.version," to v.",t.original.latestVersion]})})})}},{Header:"Author",accessor:"author",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(dt.Fragment,{children:t.original.author?t.original.author.replace("https://github.com/",""):"Unknown"})}},{Header:"Type",accessor:"type",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(dt.Fragment,{children:t.original.type?t.original.type.replace("Platform",""):"Unknown"})}},{Header:"Devices",accessor:"addedDevices"},{Header:"Actions",accessor:"actions",Cell:e=>{let{row:t}=e;return(0,dt.jsxs)("div",{style:{margin:"0px",padding:"0px",gap:"4px",display:"flex",flexDirection:"row"},children:[f&&"childbridge"===f.bridgeMode&&!t.original.error&&t.original.enabled&&(0,dt.jsx)(Uu,{title:"Shows the QRCode or the fabrics",children:(0,dt.jsx)(Rd,{style:{margin:"0",padding:"0"},onClick:()=>r(t.original),size:"small",children:(0,dt.jsx)(ry,{})})}),(0,dt.jsx)(Uu,{title:"Plugin config",children:(0,dt.jsx)(Rd,{disabled:!0===t.original.restartRequired||!0===(null===f||void 0===f?void 0:f.restartRequired),style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>F(t.original),size:"small",children:(0,dt.jsx)(Qv,{})})}),f&&!f.readOnly&&(0,dt.jsx)(Uu,{title:"Remove the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>{C("Remove plugin","Are you sure? This will remove also all the devices and configuration in the controller.","remove",t.original)},size:"small",children:(0,dt.jsx)(ty,{})})}),t.original.enabled?(0,dt.jsx)(Uu,{title:"Disable the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>{C("Disable plugin","Are you sure? This will remove also all the devices and configuration in the controller.","disable",t.original)},size:"small",children:(0,dt.jsx)(ey,{})})}):(0,dt.jsx)(dt.Fragment,{}),t.original.enabled?(0,dt.jsx)(dt.Fragment,{}):(0,dt.jsx)(Uu,{title:"Enable the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>P(t.original),size:"small",children:(0,dt.jsx)(Zv,{})})}),(0,dt.jsx)(Uu,{title:"Open the plugin help",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>M(t.original),size:"small",children:(0,dt.jsx)(Yv,{})})}),(0,dt.jsx)(Uu,{title:"Open the plugin version history",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>N(t.original),size:"small",children:(0,dt.jsx)(Xv,{})})}),f&&!f.readOnly&&(0,dt.jsx)(Uu,{title:"Sponsor the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0",padding:"0",width:"19px",height:"19px",color:"#b6409c"},onClick:()=>R(t.original),size:"small",children:(0,dt.jsx)(Jv,{})})})]})}},{Header:"Status",accessor:"status",Cell:e=>{let{row:t}=e;return(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 auto",gap:"5px"},children:t.original.error?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:!1,enabledText:"Error",disabledText:"Error",tooltipText:"The plugin is in error state. Check the log!"})}):(0,dt.jsx)(dt.Fragment,{children:!1===t.original.enabled?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:t.original.enabled,enabledText:"Enabled",disabledText:"Disabled",tooltipText:"Whether the plugin is enable or disabled"})}):(0,dt.jsx)(dt.Fragment,{children:t.original.loaded&&t.original.started&&t.original.configured&&t.original.paired?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:t.original.loaded,enabledText:"Running",tooltipText:"Whether the plugin is running"})}):(0,dt.jsx)(dt.Fragment,{children:t.original.loaded&&t.original.started&&t.original.configured?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:t.original.loaded,enabledText:"Running",tooltipText:"Whether the plugin is running"})}):(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(ny,{status:t.original.enabled,enabledText:"Enabled",disabledText:"Disabled",tooltipText:"Whether the plugin is enable or disabled"}),(0,dt.jsx)(ny,{status:t.original.loaded,enabledText:"Loaded",tooltipText:"Whether the plugin has been loaded"}),(0,dt.jsx)(ny,{status:t.original.started,enabledText:"Started",tooltipText:"Whether the plugin started"}),(0,dt.jsx)(ny,{status:t.original.configured,enabledText:"Configured",tooltipText:"Whether the plugin has been configured"}),f&&"childbridge"===f.bridgeMode?(0,dt.jsx)(ny,{status:t.original.paired,enabledText:"Paired",tooltipText:"Whether the plugin has been paired"}):(0,dt.jsx)(dt.Fragment,{})]})})})})})}}];(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&"plugins"===e.params.changed&&(tM&&console.log("HomePlugins received refresh_required for",e.params.changed),a({id:u.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}})),"restart_required"===e.method&&(tM&&console.log("HomePlugins received restart_required"),a({id:u.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}})),e.id===u.current&&"/api/settings"===e.method&&(tM&&console.log(`HomePlugins (id: ${e.id}) received settings:`,e.response),p(e.response.systemInformation),h(e.response.matterbridgeInformation)),e.id===u.current&&"/api/plugins"===e.method&&(tM&&console.log(`HomePlugins (id: ${e.id}) received ${e.response.length} plugins:`,e.response),g(e.response)))};return i(e),tM&&console.log("HomePlugins added WebSocket listener id:",u.current),()=>{s(e),tM&&console.log("HomePlugins removed WebSocket listener")}}),[i,s,a]),(0,e.useEffect)((()=>{n&&(tM&&console.log("HomePlugins sending api requests"),a({id:u.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),a({id:u.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}))}),[n,a]),(0,e.useEffect)((()=>{const e=localStorage.getItem("homePluginsColumnVisibility");e&&x(JSON.parse(e))}),[]);const S=()=>{y(!v)},k=(0,e.useRef)(null),C=(e,t,r,n)=>{tM&&console.log(`handleActionWithConfirmCancel ${r} ${n.name}`),k.current=n,c(e,t,r,j,$)},j=e=>{tM&&console.log(`handleConfirm action confirmed ${e} ${k.current.name}`),"remove"===e&&k.current?_(k.current):"disable"===e&&k.current&&P(k.current),k.current=null},$=e=>{tM&&console.log(`handleCancel action canceled ${e} ${k.current.name}`),k.current=null},E=e=>{tM&&console.log("handleUpdatePlugin plugin:",e.name),o("Plugins",`Updating plugin: ${e.name}`),Bf("installplugin",e.name)},_=e=>{tM&&console.log("handleRemovePlugin plugin:",e.name),o("Plugins",`Removing plugin: ${e.name}`),Bf("removeplugin",e.name)},P=e=>{tM&&console.log("handleEnableDisablePlugin plugin:",e.name,"enabled:",e.enabled),!0===e.enabled?(e.enabled=!1,o("Plugins",`Disabling plugin: ${e.name}`),Bf("disableplugin",e.name)):(e.enabled=!0,o("Plugins",`Enabling plugin: ${e.name}`),Bf("enableplugin",e.name))},O=e=>{tM&&console.log(`handleHomepagePlugin plugin: ${e.name} homepage: ${e.homepage}`),e.homepage&&window.open(e.homepage,"_blank")},R=e=>{tM&&console.log("handleSponsorPlugin plugin:",e.name,"funding:",e.funding),e.funding&&window.open(e.funding,"_blank")},M=e=>{tM&&console.log("handleHelpPlugin plugin:",e.name,"help:",e.help),e.help&&window.open(e.help,"_blank")},N=e=>{tM&&console.log("handleChangelogPlugin plugin:",e.name,"changelog:",e.changelog),e.changelog&&window.open(e.changelog,"_blank")},[I,T]=(0,e.useState)({}),[A,D]=(0,e.useState)(!1),F=e=>{tM&&console.log("handleConfigPlugin plugin:",e.name),a({id:u.current,method:"/api/select/devices",src:"Frontend",dst:"Matterbridge",params:{plugin:e.name}}),a({id:u.current,method:"/api/select/entities",src:"Frontend",dst:"Matterbridge",params:{plugin:e.name}}),T(e),z()},z=()=>{D(!0)};return tM&&console.log("HomePlugins rendering..."),n?(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",width:"100%",flex:"0 0 auto",overflow:"hidden"},children:[(0,dt.jsx)(sO,{open:A,onClose:()=>{D(!1)},plugin:I}),(0,dt.jsxs)(mh,{open:v,onClose:S,children:[(0,dt.jsx)(xh,{children:"Configure Plugins Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:w.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["description","actions","status"].includes(e.accessor),checked:b[e.accessor],onChange:()=>{return t=e.accessor,void x((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("homePluginsColumnVisibility",JSON.stringify(r)),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:S,children:"Close"})})]}),(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("p",{style:{margin:"0px",padding:"0px"},children:"Plugins"}),(0,dt.jsx)(Rd,{onClick:S,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0px",padding:"0px",gap:"0",overflow:"auto"},children:(0,dt.jsx)(lO,{data:m,columns:w,columnVisibility:b})})]}):(0,dt.jsx)(tm,{})}var uO=r(3651),dO=r.n(uO),pO="M19 17H22L18 21L14 17H17V3H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z",fO="M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z";function hO(t){let{data:r,columns:n,columnVisibility:o}=t;const a=e.useMemo((()=>{const e=localStorage.getItem("homeDevicesColumnsSortBy");return e?JSON.parse(e):[{id:"name",desc:!1}]}),[n]),i=e.useMemo((()=>n.filter((e=>o[e.accessor]))),[o,n]),{getTableProps:s,getTableBodyProps:l,headerGroups:c,rows:u,prepareRow:d,state:{sortBy:p}}=(0,yv.useTable)({columns:i,data:r,initialState:{sortBy:a}},yv.useSortBy);return e.useEffect((()=>{localStorage.setItem("homeDevicesColumnsSortBy",JSON.stringify(p))}),[p]),(0,dt.jsxs)("table",{...s(),style:{border:"none",borderCollapse:"collapse"},children:[(0,dt.jsx)("thead",{style:{border:"none",borderCollapse:"collapse"},children:c.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),style:{border:"none",borderCollapse:"collapse"},children:e.headers.map((e=>(0,dt.jsxs)("th",{...e.getHeaderProps(e.noSort?void 0:e.getSortByToggleProps()),style:{border:"none",borderCollapse:"collapse",cursor:e.noSort?"default":"pointer"},children:[e.render("Header"),!e.noSort&&(0,dt.jsx)("span",{style:{margin:"0px",marginLeft:"5px",padding:"0px"},children:e.isSorted?e.isSortedDesc?(0,dt.jsx)(dO(),{path:fO,size:"15px"}):(0,dt.jsx)(dO(),{path:pO,size:"15px"}):null})]})))})))}),(0,dt.jsx)("tbody",{...l(),style:{border:"none",borderCollapse:"collapse"},children:u.map(((e,t)=>(d(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),style:{border:"none",borderCollapse:"collapse"},children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),style:{border:"none",borderCollapse:"collapse"},children:e.render("Cell")})))},t))))})]})}function mO(){const{online:t,sendMessage:r,addListener:n,removeListener:o,getUniqueId:a}=(0,e.useContext)(Qh),[i,s]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!0),[u,d]=(0,e.useState)(null),[p,f]=(0,e.useState)(null),[h,m]=(0,e.useState)([]),[g,v]=(0,e.useState)([]),[y,b]=(0,e.useState)([]),[x,w]=(0,e.useState)([]),[S,k]=(0,e.useState)(!1),[C,j]=(0,e.useState)({pluginName:!0,name:!0,serial:!0,reachable:!0,configUrl:!1,actions:!0}),$=(0,e.useRef)(a()),E=[{Header:"Plugin",accessor:"pluginName"},{Header:"Name",accessor:"name"},{Header:"Serial",accessor:"serial"},{Header:"Availability",accessor:"reachable",Cell:e=>{let{row:t}=e;return!0===t.original.reachable?"Online":!1===t.original.reachable?(0,dt.jsx)("span",{style:{color:"red"},children:"Offline"}):""},sortType:(e,t)=>(!0===e.original.reachable?1:!1===e.original.reachable?0:-1)-(!0===t.original.reachable?1:!1===t.original.reachable?0:-1)},{Header:"Url",accessor:"configUrl"},{Header:"Actions",accessor:"actions",noSort:!0,Cell:e=>{let{row:t}=e;return(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[t.original.configUrl?(0,dt.jsx)(Uu,{title:"Open the configuration page",children:(0,dt.jsx)(Rd,{onClick:()=>window.open(t.original.configUrl,"_blank"),"aria-label":"Open config url",sx:{margin:0,padding:0},children:(0,dt.jsx)(Qv,{fontSize:"small"})})}):(0,dt.jsx)("div",{style:{width:"20px",height:"20px"}}),void 0!==t.original.selected?(0,dt.jsx)(Uu,{title:"Select/unselect the device",children:(0,dt.jsx)(Kv,{checked:t.original.selected,onChange:e=>P(e,t.original),sx:{margin:"0",marginLeft:"8px",padding:"0"},size:"small"})}):(0,dt.jsx)("div",{style:{width:"20px",height:"20px"}})]})}}];(0,e.useEffect)((()=>{const e=e=>{if("Matterbridge"===e.src&&"Frontend"===e.dst){var t,n,o;if("refresh_required"===e.method&&"sessions"!==e.params.changed&&"matterbridgeLatestVersion"!==e.params.changed&&"reachability"!==e.params.changed&&(tM&&console.log(`HomeDevices received refresh_required: changed=${e.params.changed}`),r({id:$.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}})),"restart_required"===e.method&&(tM&&console.log("HomeDevices received restart_required"),s(!0)),"state_update"===e.method&&e.params.plugin&&e.params.serialNumber&&e.params.cluster.includes("BasicInformationServer")&&"reachable"===e.params.attribute&&(tM&&console.log(`HomeDevices updating device reachability for plugin ${e.params.plugin} serial ${e.params.serialNumber} value ${e.params.value}`),v((t=>t.map((t=>t.pluginName===e.params.plugin&&t.serial===e.params.serialNumber?{...t,reachable:e.params.value}:t))))),e.id===$.current&&"/api/settings"===e.method&&(tM&&console.log(`HomeDevices (id: ${e.id}) received settings:`,e.response),d(e.response.systemInformation),f(e.response.matterbridgeInformation),s(e.response.matterbridgeInformation.restartRequired)),e.id===$.current&&"/api/plugins"===e.method)if(tM&&console.log(`HomeDevices (id: ${e.id}) received ${null===(t=e.response)||void 0===t?void 0:t.length} plugins:`,e.response),e.response){let t=!0;for(const r of e.response)!0===r.enabled&&(!0===r.loaded&&!0===r.started&&!0!==r.error||(t=!1));if(!t)return;c(!1),m(e.response),v([]),b([]),r({id:$.current,method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}}),tM&&console.log("HomeDevices sent /api/devices");for(const n of e.response)!0===n.enabled&&!0===n.loaded&&!0===n.started&&!0!==n.error&&(r({id:$.current,method:"/api/select/devices",src:"Frontend",dst:"Matterbridge",params:{plugin:n.name}}),tM&&console.log(`HomeDevices sent /api/select/devices for plugin: ${n.name}`))}if(e.id===$.current&&"/api/devices"===e.method)if(tM&&console.log(`HomeDevices (id: ${e.id}) received ${null===(n=e.response)||void 0===n?void 0:n.length} devices:`,e.response),e.response){for(const t of e.response){0===h.length&&console.error("HomeDevices: /api/devices with plugins lenght 0");const e=h.find((e=>e.name===t.pluginName));e||console.error(`HomeDevices: device ${t.deviceName} has no plugin ${t.pluginName}`),!0===(null===e||void 0===e?void 0:e.hasBlackList)?t.selected=!0:t.selected=void 0}v(e.response)}if(e.id===$.current&&"/api/select/devices"===e.method)tM&&console.log(`HomeDevices (id: ${e.id}) received ${null===(o=e.response)||void 0===o?void 0:o.length} selectDevices for plugin ${e.plugin}:`,e.response),e.response&&b((t=>[...t.filter((t=>t.pluginName!==e.plugin)),...e.response.map((e=>({...e,selected:!1})))]))}};return n(e),tM&&console.log(`HomeDevices added WebSocket listener id ${$.current}`),()=>{o(e),tM&&console.log("HomeDevices removed WebSocket listener")}}),[h,n,o,r]),(0,e.useEffect)((()=>{tM&&console.log("HomeDevices mixing devices and selectDevices");const e=[];for(const t of g)e.push(t);for(const t of y)g.find((e=>e.pluginName===t.pluginName&&e.serial.includes(t.serial)))||e.push(t);w(e)}),[h,g,y,w]),(0,e.useEffect)((()=>{t&&(tM&&console.log("HomeDevices sending api requests"),r({id:$.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({id:$.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}))}),[t,r]);const _=()=>{k(!S)},P=(e,t)=>{tM&&console.log(`handleCheckboxChange: checkbox changed to ${e.target.checked} for device ${t.name} serial ${t.serial}`),w((r=>r.map((r=>r.serial===t.serial?{...r,selected:e.target.checked}:r)))),e.target.checked?r({id:$.current,method:"/api/command",src:"Frontend",dst:"Matterbridge",params:{command:"selectdevice",plugin:t.pluginName,serial:t.serial,name:t.name}}):r({id:$.current,method:"/api/command",src:"Frontend",dst:"Matterbridge",params:{command:"unselectdevice",plugin:t.pluginName,serial:t.serial,name:t.name}})};return(0,e.useEffect)((()=>{const e=localStorage.getItem("homeDevicesColumnVisibility");e&&(j(JSON.parse(e)),tM&&console.log("HomeDevices effect: loaded column visibility from localStorage"))}),[]),tM&&console.log("HomeDevices rendering..."),t?(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",width:"100%",flex:"1 1 auto",overflow:"hidden"},children:[(0,dt.jsxs)(mh,{open:S,onClose:_,children:[(0,dt.jsx)(xh,{children:"Configure Devices Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:E.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["name","actions"].includes(e.accessor),checked:C[e.accessor],onChange:()=>{return t=e.accessor,void j((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("homeDevicesColumnVisibility",JSON.stringify(r)),tM&&console.log("HomeDevices effect: saved column visibility to localStorage"),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:_,children:"Close"})})]}),(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("p",{style:{margin:"0px",padding:"0px"},children:"Devices"}),(0,dt.jsx)(Rd,{onClick:_,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0px",padding:"0px",gap:"0",overflow:"auto"},children:(0,dt.jsx)(hO,{data:x,columns:E,columnVisibility:C})}),(0,dt.jsxs)("div",{className:"MbfWindowFooter",style:{margin:"0",padding:"0px",paddingLeft:"10px",paddingRight:"10px",borderTop:"1px solid var(--table-border-color)",display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[l&&(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{margin:"0",padding:"2px",fontWeight:"normal",fontSize:"14px",color:"var(--secondary-color)"},children:"Waiting for the plugins to fully load..."}),!l&&(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{margin:"0",padding:"5px",fontWeight:"normal",fontSize:"14px",color:"var(--secondary-color)"},children:["Registered devices: ",g.length.toString()]}),i&&(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{margin:"0",padding:"2px",fontWeight:"normal",fontSize:"14px",color:"var(--secondary-color)"},children:"Restart required"})]})]}):(0,dt.jsx)(tm,{})}const gO=function(){var t;const[r,n]=(0,e.useState)(null),[o,a]=(0,e.useState)(null),[i,s]=(0,e.useState)(void 0),[l]=(0,e.useState)("false"!==localStorage.getItem("homePagePlugins")),[c,u]=(0,e.useState)(null!==(t=localStorage.getItem("homePageMode"))&&void 0!==t?t:"logs"),[d,p]=(0,e.useState)(!1),{addListener:f,removeListener:h,online:m,sendMessage:g,logFilterLevel:v,logFilterSearch:y,autoScroll:b,getUniqueId:x}=(0,e.useContext)(Qh),w=(0,e.useRef)(x()),S=(0,e.useCallback)((e=>{tM&&console.log("handleSelectPlugin plugin:",e.name),s(i?void 0:e)}),[i]);return(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&"matterbridgeLatestVersion"!==e.params.changed&&"reachability"!==e.params.changed&&(tM&&console.log(`Home received refresh_required: changed=${e.params.changed}`),g({id:w.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}})),e.id===w.current&&"/api/settings"===e.method&&(tM&&console.log("Home received settings:",e.response),n(e.response.systemInformation),a(e.response.matterbridgeInformation),localStorage.getItem("matterbridgeVersion")&&e.response.matterbridgeInformation.matterbridgeVersion!==localStorage.getItem("matterbridgeVersion")&&(localStorage.setItem("matterbridgeVersion",e.response.matterbridgeInformation.matterbridgeVersion),p(!0)),e.response.matterbridgeInformation.shellyBoard&&(localStorage.getItem("homePageMode")||(localStorage.setItem("homePageMode","devices"),u("devices")))))};return f(e),tM&&console.log(`Home added WebSocket listener id ${w.current}`),()=>{h(e),tM&&console.log("Home removed WebSocket listener")}}),[f,h,g]),(0,e.useEffect)((()=>{m&&(tM&&console.log("Home received online"),g({id:w.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))}),[m,g]),tM&&console.log("Home rendering..."),m&&r&&o?(0,dt.jsxs)("div",{className:"MbfPageDiv",style:{flexDirection:"row"},children:[(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"302px",minWidth:"302px",gap:"20px"},children:[(0,dt.jsx)(Pm,{matterbridgeInfo:o,plugin:i}),(0,dt.jsx)(nm,{systemInfo:r,compact:!0})]}),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",gap:"20px"},children:[d&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto",width:"100%",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Update"})}),(0,dt.jsxs)("div",{className:"MbfWindowBody",style:{flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("h4",{style:{margin:0},children:"Matterbridge has been updated. You are viewing an outdated web UI. Please refresh the page now."}),(0,dt.jsx)(Ah,{onClick:()=>window.location.reload(),endIcon:(0,dt.jsx)(Xh,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px"},children:"Refresh"})]})]}),l&&!o.readOnly&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto",width:"100%",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Install plugins"})}),(0,dt.jsx)(vv,{})]}),l&&(0,dt.jsx)(cO,{selectPlugin:S}),"devices"===c&&(0,dt.jsx)(mO,{}),"logs"===c&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"1 1 auto",width:"100%",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",style:{flexShrink:0},children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",justifyContent:"space-between"},children:["Logs",(0,dt.jsxs)("span",{style:{fontWeight:"normal",fontSize:"12px",marginTop:"2px"},children:['Filter: logger level "',v,'" and search "',y,'" Scroll: ',b?"auto":"manual"]})]})}),(0,dt.jsx)("div",{style:{flex:"1 1 auto",margin:"0px",padding:"10px",overflow:"auto"},children:(0,dt.jsx)(em,{})})]})]})]}):(0,dt.jsx)(tm,{})},vO=Pf((0,dt.jsx)("path",{d:"M19 7H9c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m0 2v2H9V9zm-6 6v-2h2v2zm2 2v2h-2v-2zm-4-2H9v-2h2zm6-2h2v2h-2zm-8 4h2v2H9zm8 2v-2h2v2zM6 17H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v1h-2V5H5v10h1z"}),"TableView"),yO=Pf((0,dt.jsx)("path",{d:"M14.67 5v6.5H9.33V5zm1 6.5H21V5h-5.33zm-1 7.5v-6.5H9.33V19zm1-6.5V19H21v-6.5zm-7.34 0H3V19h5.33zm0-1V5H3v6.5z"}),"ViewModule"),bO=Pf((0,dt.jsx)("path",{d:"M17 5v16c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1V5c0-.55.45-1 1-1h2V2h4v2h2c.55 0 1 .45 1 1m-2 1H9v6h6z"}),"Battery4Bar"),xO=Pf([(0,dt.jsx)("path",{d:"M21 14c0-.55-.45-1-1-1h-2v2h2c.55 0 1-.45 1-1m-1 3h-2v2h2c.55 0 1-.45 1-1s-.45-1-1-1m-8-3h-2v4h2c0 1.1.9 2 2 2h3v-8h-3c-1.1 0-2 .9-2 2"},"0"),(0,dt.jsx)("path",{d:"M5 13c0-1.1.9-2 2-2h1.5c1.93 0 3.5-1.57 3.5-3.5S10.43 4 8.5 4H5c-.55 0-1 .45-1 1s.45 1 1 1h3.5c.83 0 1.5.67 1.5 1.5S9.33 9 8.5 9H7c-2.21 0-4 1.79-4 4s1.79 4 4 4h2v-2H7c-1.1 0-2-.9-2-2"},"1")],"ElectricalServices"),wO=Pf((0,dt.jsx)("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff"),SO=Pf((0,dt.jsx)("path",{d:"M14 6v15H3v-2h2V3h9v1h5v15h2v2h-4V6zm-4 5v2h2v-2z"}),"MeetingRoom"),kO=Pf((0,dt.jsx)("path",{d:"M19 19V5c0-1.1-.9-2-2-2H7c-1.1 0-2 .9-2 2v14H3v2h18v-2zm-4-6h-2v-2h2z"}),"DoorFront"),CO=Pf((0,dt.jsx)("path",{d:"M12 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3m0 1c-1.84 0-3.56.5-5.03 1.37-.61.35-.97 1.02-.97 1.72V17h12v-1.91c0-.7-.36-1.36-.97-1.72C15.56 12.5 13.84 12 12 12m9.23-3.85 1.85-.77c-1.22-2.91-3.55-5.25-6.46-6.46l-.77 1.85c2.42 1.02 4.36 2.96 5.38 5.38M8.15 2.77 7.38.92C4.47 2.14 2.14 4.47.92 7.38l1.85.77c1.02-2.42 2.96-4.36 5.38-5.38M2.77 15.85l-1.85.77c1.22 2.91 3.55 5.25 6.46 6.46l.77-1.85c-2.42-1.02-4.36-2.96-5.38-5.38m13.08 5.38.77 1.85c2.91-1.22 5.25-3.55 6.46-6.46l-1.85-.77c-1.02 2.42-2.96 4.36-5.38 5.38"}),"SensorOccupied"),jO=Pf((0,dt.jsx)("path",{d:"M8.14 10.96c-.09.33-.14.68-.14 1.04 0 1.1.45 2.1 1.17 2.83l-1.42 1.42C6.67 15.16 6 13.66 6 12c0-.93.21-1.8.58-2.59L5.11 7.94C4.4 9.13 4 10.52 4 12c0 2.21.9 4.21 2.35 5.65l-1.42 1.42C3.12 17.26 2 14.76 2 12c0-2.04.61-3.93 1.66-5.51L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41zm9.28 3.63c.37-.79.58-1.66.58-2.59 0-1.66-.67-3.16-1.76-4.24l-1.42 1.42C15.55 9.9 16 10.9 16 12c0 .36-.05.71-.14 1.04zM20 12c0 1.48-.4 2.87-1.11 4.06l1.45 1.45C21.39 15.93 22 14.04 22 12c0-2.76-1.12-5.26-2.93-7.07l-1.42 1.42C19.1 7.79 20 9.79 20 12"}),"SensorsOff"),$O=Pf((0,dt.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightMode"),EO=Pf((0,dt.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.61 5.64 5.36 8.04 2.35 8.36 0 10.9 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4h2c0-2.76-1.86-5.08-4.4-5.78C8.61 6.88 10.2 6 12 6c3.03 0 5.5 2.47 5.5 5.5v.5H19c1.65 0 3 1.35 3 3s-1.35 3-3 3"}),"FilterDrama"),_O=Pf((0,dt.jsx)("path",{d:"M15 13V5c0-1.66-1.34-3-3-3S9 3.34 9 5v8c-1.21.91-2 2.37-2 4 0 2.76 2.24 5 5 5s5-2.24 5-5c0-1.63-.79-3.09-2-4m-4-2V5c0-.55.45-1 1-1s1 .45 1 1v1h-1v1h1v2h-1v1h1v1z"}),"Thermostat"),PO=Pf((0,dt.jsx)("path",{d:"M12 2c-5.33 4.55-8 8.48-8 11.8 0 4.98 3.8 8.2 8 8.2s8-3.22 8-8.2c0-3.32-2.67-7.25-8-11.8M7.83 14c.37 0 .67.26.74.62.41 2.22 2.28 2.98 3.64 2.87.43-.02.79.32.79.75 0 .4-.32.73-.72.75-2.13.13-4.62-1.09-5.19-4.12-.08-.45.28-.87.74-.87"}),"WaterDrop"),OO=Pf((0,dt.jsx)("path",{d:"M16 4h-1V2h-2v2h-2V2H9v2H8C5.79 4 4 5.79 4 8v10c0 2.21 1.79 4 4 4h8c2.21 0 4-1.79 4-4V8c0-2.21-1.79-4-4-4m-4 14c-1.38 0-2.5-1.1-2.5-2.46 0-1.09.43-1.39 2.5-3.79 2.05 2.38 2.5 2.7 2.5 3.79C14.5 16.9 13.38 18 12 18m4-8H8V8h8z"}),"GasMeter"),RO=Pf((0,dt.jsx)("path",{d:"M9 21c0 .5.4 1 1 1h4c.6 0 1-.5 1-1v-1H9zm3-19C8.1 2 5 5.1 5 9c0 2.4 1.2 4.5 3 5.7V17c0 .5.4 1 1 1h6c.6 0 1-.5 1-1v-2.3c1.8-1.3 3-3.4 3-5.7 0-3.9-3.1-7-7-7"}),"Lightbulb"),MO=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9 12c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v3c0 .55-.45 1-1 1m5 6h-4v-2c0-1.1.9-2 2-2s2 .9 2 2zm2-7c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1z"}),"Outlet"),NO=Pf((0,dt.jsx)("path",{d:"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5m0 8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3"}),"ToggleOn"),IO=Pf((0,dt.jsx)("path",{d:"M20 19V3H4v16H2v2h20v-2zM16 9h2v2h-2zm-2 2H6V9h8zm4-4h-2V5h2zm-4-2v2H6V5zM6 19v-6h8v1.82c-.45.32-.75.84-.75 1.43 0 .97.78 1.75 1.75 1.75s1.75-.78 1.75-1.75c0-.59-.3-1.12-.75-1.43V13h2v6z"}),"Blinds"),TO=Pf((0,dt.jsx)("path",{d:"M11 12V6c0-1.66-1.34-3-3-3S5 4.34 5 6v6c-1.21.91-2 2.37-2 4 0 1.12.38 2.14 1 2.97V19h.02c.91 1.21 2.35 2 3.98 2s3.06-.79 3.98-2H12v-.03c.62-.83 1-1.85 1-2.97 0-1.63-.79-3.09-2-4m-6 4c0-.94.45-1.84 1.2-2.4L7 13V6c0-.55.45-1 1-1s1 .45 1 1v7l.8.6c.75.57 1.2 1.46 1.2 2.4zM18.62 4h-1.61l-3.38 9h1.56l.81-2.3h3.63l.8 2.3H22zm-2.15 5.39 1.31-3.72h.08l1.31 3.72z"}),"ThermostatAuto"),AO=Pf((0,dt.jsx)("path",{d:"M16.01 7 16 3h-2v4h-4V3H8v4h-.01C7 6.99 6 7.99 6 8.99v5.49L9.5 18v3h5v-3l3.5-3.51v-5.5c0-1-1-2-1.99-1.99"}),"Power"),DO=Pf((0,dt.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),FO=Pf((0,dt.jsx)("path",{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12z"}),"LockOpen"),zO=Pf([(0,dt.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"},"0"),(0,dt.jsx)("path",{d:"M22 7.47V5.35C20.05 4.77 16.56 4 12 4c-2.15 0-4.11.86-5.54 2.24.13-.85.4-2.4 1.01-4.24H5.35C4.77 3.95 4 7.44 4 12c0 2.15.86 4.11 2.24 5.54-.85-.14-2.4-.4-4.24-1.01v2.12C3.95 19.23 7.44 20 12 20c2.15 0 4.11-.86 5.54-2.24-.14.85-.4 2.4-1.01 4.24h2.12c.58-1.95 1.35-5.44 1.35-10 0-2.15-.86-4.11-2.24-5.54.85.13 2.4.4 4.24 1.01M12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"},"1")],"Cyclone"),LO=Pf((0,dt.jsx)("path",{d:"M14.5 17c0 1.65-1.35 3-3 3s-3-1.35-3-3h2c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1H2v-2h9.5c1.65 0 3 1.35 3 3M19 6.5C19 4.57 17.43 3 15.5 3S12 4.57 12 6.5h2c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S16.33 8 15.5 8H2v2h13.5c1.93 0 3.5-1.57 3.5-3.5m-.5 4.5H2v2h16.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5v2c1.93 0 3.5-1.57 3.5-3.5S20.43 11 18.5 11"}),"Air"),BO=Pf([(0,dt.jsx)("path",{d:"M12 16c1.01 0 1.91-.39 2.62-1H9.38c.71.61 1.61 1 2.62 1m-3.44-2h6.89c.26-.45.44-.96.51-1.5h-7.9c.06.54.23 1.05.5 1.5M12 8c-1.01 0-1.91.39-2.62 1h5.24c-.71-.61-1.61-1-2.62-1m-3.44 2c-.26.45-.44.96-.51 1.5h7.9c-.07-.54-.24-1.05-.51-1.5z"},"0"),(0,dt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 15c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"},"1")],"Hvac"),WO=Pf((0,dt.jsx)("path",{d:"M22 11h-4.17l3.24-3.24-1.41-1.42L15 11h-2V9l4.66-4.66-1.42-1.41L13 6.17V2h-2v4.17L7.76 2.93 6.34 4.34 11 9v2H9L4.34 6.34 2.93 7.76 6.17 11H2v2h4.17l-3.24 3.24 1.41 1.42L9 13h2v2l-4.66 4.66 1.42 1.41L11 17.83V22h2v-4.17l3.24 3.24 1.42-1.41L13 15v-2h2l4.66 4.66 1.41-1.42L17.83 13H22z"}),"AcUnit"),VO=Pf((0,dt.jsx)("path",{d:"M17.92 7.02C17.45 4.18 14.97 2 12 2 9.82 2 7.83 3.18 6.78 5.06 4.09 5.41 2 7.74 2 10.5 2 13.53 4.47 16 7.5 16h10c2.48 0 4.5-2.02 4.5-4.5 0-2.34-1.79-4.27-4.08-4.48M14.8 17l-2.9 3.32 2 1L11.55 24h2.65l2.9-3.32-2-1L17.45 17zm-6 0-2.9 3.32 2 1L5.55 24H8.2l2.9-3.32-2-1L11.45 17z"}),"Thunderstorm"),HO=Pf((0,dt.jsx)("path",{d:"M21.98 14H22zM5.35 13c1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.4.98 3.31 1v-2c-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1v2c1.9 0 2.17-1 3.35-1m13.32 2c-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.1 1-3.34 1s-1.38-1-3.33-1-2.1 1-3.34 1v2c1.95 0 2.11-1 3.34-1 1.24 0 1.38 1 3.33 1s2.1-1 3.34-1c1.19 0 1.42 1 3.33 1 1.94 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1v-2c-1.24 0-1.38-1-3.33-1M5.35 9c1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.4.98 3.31 1V8c-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1C3.38 7 3.24 8 2 8v2c1.9 0 2.17-1 3.35-1"}),"Water"),UO=Pf([(0,dt.jsx)("path",{d:"m12 12.9-2.13 2.09c-.56.56-.87 1.29-.87 2.07C9 18.68 10.35 20 12 20s3-1.32 3-2.94c0-.78-.31-1.52-.87-2.07z"},"0"),(0,dt.jsx)("path",{d:"m16 6-.44.55C14.38 8.02 12 7.19 12 5.3V2S4 6 4 13c0 2.92 1.56 5.47 3.89 6.86-.56-.79-.89-1.76-.89-2.8 0-1.32.52-2.56 1.47-3.5L12 10.1l3.53 3.47c.95.93 1.47 2.17 1.47 3.5 0 1.02-.31 1.96-.85 2.75 1.89-1.15 3.29-3.06 3.71-5.3.66-3.55-1.07-6.9-3.86-8.52"},"1")],"LocalFireDepartment"),qO=Pf((0,dt.jsx)("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity"),GO=Pf((0,dt.jsx)("path",{d:"M19.5 6c-1.31 0-2.37 1.01-2.48 2.3-1.88-.5-2.84-1.8-5.02-1.8-2.19 0-3.14 1.3-5.02 1.8C6.87 7.02 5.81 6 4.5 6 3.12 6 2 7.12 2 8.5V9c0 6 3.6 7.81 6.52 7.98C9.53 17.62 10.72 18 12 18s2.47-.38 3.48-1.02C18.4 16.81 22 15 22 9v-.5C22 7.12 20.88 6 19.5 6m-16 3v-.5c0-.55.45-1 1-1s1 .45 1 1v3c0 1.28.38 2.47 1.01 3.48C4.99 14.27 3.5 12.65 3.5 9m17 0c0 3.65-1.49 5.27-3.01 5.98.64-1.01 1.01-2.2 1.01-3.48v-3c0-.55.45-1 1-1s1 .45 1 1zm-9.81 1.48c-.44.26-.96.56-1.69.76V10.2c.48-.17.84-.38 1.18-.58C10.72 9.3 11.23 9 12 9s1.27.3 1.8.62c.34.2.71.42 1.2.59v1.04c-.75-.21-1.26-.51-1.71-.78-.46-.27-.8-.47-1.29-.47s-.84.2-1.31.48"}),"Masks"),KO=Pf((0,dt.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonChecked"),QO=Pf((0,dt.jsx)("path",{d:"M22 7h-9v2h9zm0 8h-9v2h9zM5.54 11 2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"Checklist"),JO={display:"flex",gap:"2px",justifyContent:"space-evenly",width:"100%",height:"40px"},YO={margin:"0",padding:"0",fontSize:"36px",fontWeight:"medium",color:"var(--primary-color)"},XO={margin:"0",padding:"0",fontSize:"20px",fontWeight:"medium",color:"var(--div-text-color)",textAlign:"center"},ZO={margin:"0",padding:"0",fontSize:"16px",fontWeight:"medium",color:"var(--div-text-color)",textAlign:"center"},eR={display:"flex",gap:"2px",justifyContent:"center",width:"100%",height:"18px",margin:"0",padding:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},tR={margin:"0",padding:"0",fontSize:"12px",fontWeight:"normal",color:"var(--div-text-color)"},rR={display:"flex",justifyContent:"center",width:"100%",height:"52px",margin:"0",padding:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},nR={margin:"0",padding:"0",fontSize:"14px",fontWeight:"bold",color:"var(--div-text-color)"},oR={display:"flex",gap:"4px",justifyContent:"center",width:"100%",height:"15px",margin:"0",padding:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},aR={margin:"0",padding:"0px 4px",borderRadius:"5px",textAlign:"center",fontSize:"12px",fontWeight:"normal",color:"var(--secondary-color)"},iR=[256,257,268],sR=[266,267],lR=[259,260,261],cR=[256,257,268,266,267,259,260,261];function uR(t){let{icon:r,iconColor:n,cluster:o,value:a,unit:i}=t;return tM&&console.log(`Render cluster "${o.clusterName}.${o.attributeName}" value(${typeof a}-${isNaN(a)}) "${a}" unit "${i}"`),(0,dt.jsxs)(Uf,{sx:JO,children:[r&&e.cloneElement(r,{key:`${o.clusterId}-${o.attributeId}-icon`,sx:{...YO,color:null!==n&&void 0!==n?n:"var(--primary-color)"}}),(0,dt.jsxs)(Uf,{sx:{...JO,gap:"4px",alignContent:"center",alignItems:"end",justifyContent:"center"},children:[(0,dt.jsx)(vf,{sx:XO,children:null===a||void 0===a||"number"===typeof a&&isNaN(a)||"NaN"===a?"---":a},`${o.clusterId}-${o.attributeId}-value`),i&&(0,dt.jsx)(vf,{sx:ZO,children:i},`${o.clusterId}-${o.attributeId}-unit`)]},`${o.clusterId}-${o.attributeId}-valueunitbox`)]},`${o.clusterId}-${o.attributeId}-box`)}function dR(e){let{device:t,endpoint:r,id:n,deviceType:o,clusters:a}=e;const i=["Unknown","Good","Fair","Moderate","Poor","VeryPoor","Ext.Poor"];let s="";return tM&&console.log(`Device "${t.name}" endpoint "${r}" id "${n}" deviceType "0x${o.toString(16).padStart(4,"0")}" clusters (${null===a||void 0===a?void 0:a.length}):`,a),17===o&&a.filter((e=>"PowerSource"===e.clusterName&&"batVoltage"===e.attributeName)).map((e=>s=`${e.attributeLocalValue} mV`)),cR.includes(o)&&a.filter((e=>"LevelControl"===e.clusterName&&"currentLevel"===e.attributeName)).map((e=>s=`Level ${e.attributeValue}`)),514===o&&a.filter((e=>"WindowCovering"===e.clusterName&&"currentPositionLiftPercent100ths"===e.attributeName)).map((e=>s=`Position ${e.attributeValue/100}%`)),769===o&&a.filter((e=>"Thermostat"===e.clusterName&&"occupiedHeatingSetpoint"===e.attributeName)).map((e=>s=`Heat ${e.attributeValue/100}\xb0C `)),769===o&&a.filter((e=>"Thermostat"===e.clusterName&&"occupiedCoolingSetpoint"===e.attributeName)).map((e=>s+=`Cool ${e.attributeValue/100}\xb0C`)),118===o&&a.filter((e=>"SmokeCoAlarm"===e.clusterName&&"coState"===e.attributeName)).map((e=>s=""+(0===e.attributeLocalValue?"No CO detected":"CO alarm!"))),1296===o&&a.filter((e=>"ElectricalPowerMeasurement"===e.clusterName&&"voltage"===e.attributeName)).map((e=>s=e.attributeLocalValue/1e3+" V, ")),1296===o&&a.filter((e=>"ElectricalPowerMeasurement"===e.clusterName&&"activeCurrent"===e.attributeName)).map((e=>s+=e.attributeLocalValue/1e3+" A, ")),1296===o&&a.filter((e=>"ElectricalPowerMeasurement"===e.clusterName&&"activePower"===e.attributeName)).map((e=>s+=e.attributeLocalValue/1e3+" W")),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0px",padding:"5px",width:"150px",height:"150px",borderColor:"var(--div-bg-color)",borderRadius:"5px",justifyContent:"space-between"},children:[19===o&&a.filter((e=>"BridgedDeviceBasicInformation"===e.clusterName&&"reachable"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:!0===e.attributeLocalValue?(0,dt.jsx)(by,{}):(0,dt.jsx)(wO,{}),iconColor:!0===e.attributeLocalValue?"green":"red",cluster:e,value:!0===e.attributeLocalValue?"Online":"Offline"}))),17===o&&a.filter((e=>"PowerSource"===e.clusterName&&"batPercentRemaining"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(bO,{}),cluster:e,value:e.attributeValue/2,unit:"%"}))),17===o&&a.filter((e=>"PowerSource"===e.clusterName&&"wiredCurrentType"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(xO,{}),cluster:e,value:0===e.attributeLocalValue?"AC":"DC"}))),iR.includes(o)&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(RO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),sR.includes(o)&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(MO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),lR.includes(o)&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(NO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),514===o&&a.filter((e=>"WindowCovering"===e.clusterName&&"currentPositionLiftPercent100ths"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(IO,{}),cluster:e,value:e.attributeLocalValue/100,unit:"%"}))),769===o&&a.filter((e=>"Thermostat"===e.clusterName&&"localTemperature"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(TO,{}),cluster:e,value:(null!==(t=e.attributeLocalValue)&&void 0!==t?t:0)/100,unit:"\xb0C"})})),10===o&&a.filter((e=>"DoorLock"===e.clusterName&&"lockState"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:"1"===e.attributeValue?(0,dt.jsx)(DO,{}):(0,dt.jsx)(FO,{}),cluster:e,value:"1"===e.attributeValue?"Locked":"Unlocked"}))),43===o&&a.filter((e=>"FanControl"===e.clusterName&&"percentCurrent"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(LO,{}),cluster:e,value:e.attributeValue,unit:"%"}))),15===o&&a.filter((e=>"Switch"===e.clusterName&&"currentPosition"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(KO,{}),cluster:e,value:e.attributeValue,unit:"pos"}))),39===o&&a.filter((e=>"ModeSelect"===e.clusterName&&"currentMode"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(QO,{}),cluster:e,value:e.attributeValue,unit:"mode"}))),771===o&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(zO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),45===o&&a.filter((e=>"FanControl"===e.clusterName&&"percentCurrent"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(BO,{}),cluster:e,value:e.attributeValue,unit:"%"}))),114===o&&a.filter((e=>"Thermostat"===e.clusterName&&"localTemperature"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(BO,{}),cluster:e,value:(null!==(t=e.attributeLocalValue)&&void 0!==t?t:0)/100,unit:"\xb0C"})})),67===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(HO,{}),cluster:e,value:!0===e.attributeLocalValue?"No leak":"Leak"}))),65===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(WO,{}),cluster:e,value:!0===e.attributeLocalValue?"No freeze":"Freeze"}))),68===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(VO,{}),cluster:e,value:!0===e.attributeLocalValue?"No rain":"Rain"}))),118===o&&a.filter((e=>"SmokeCoAlarm"===e.clusterName&&"smokeState"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(UO,{}),cluster:e,value:0===e.attributeLocalValue?"No smoke":"Smoke"}))),66===o&&a.filter((e=>"ValveConfigurationAndControl"===e.clusterName&&"currentState"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(qO,{}),cluster:e,value:0===e.attributeLocalValue?"Closed":"Opened"}))),44===o&&a.filter((e=>"AirQuality"===e.clusterName&&"airQuality"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(GO,{}),cluster:e,value:i[null!==(t=e.attributeLocalValue)&&void 0!==t?t:0]})})),770===o&&a.filter((e=>"TemperatureMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(_O,{}),cluster:e,value:e.attributeLocalValue/100,unit:"\xb0C"}))),775===o&&a.filter((e=>"RelativeHumidityMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(PO,{}),cluster:e,value:e.attributeLocalValue/100,unit:"%"}))),774===o&&a.filter((e=>"FlowMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(OO,{}),cluster:e,value:e.attributeLocalValue,unit:"l/h"}))),773===o&&a.filter((e=>"PressureMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(EO,{}),cluster:e,value:e.attributeLocalValue,unit:"hPa"}))),21===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:"true"===e.attributeValue?(0,dt.jsx)(kO,{}):(0,dt.jsx)(SO,{}),cluster:e,value:"true"===e.attributeValue?"Closed":"Opened"}))),263===o&&a.filter((e=>"OccupancySensing"===e.clusterName&&"occupancy"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:"{ occupied: true }"===e.attributeValue?(0,dt.jsx)(CO,{}):(0,dt.jsx)(jO,{}),cluster:e,value:"{ occupied: true }"===e.attributeValue?"Occupied":"Unocc."}))),262===o&&a.filter((e=>"IlluminanceMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)($O,{}),cluster:e,value:Math.round(Math.pow(10,e.attributeValue/1e4)),unit:"lx"}))),1296===o&&a.filter((e=>"ElectricalEnergyMeasurement"===e.clusterName&&"cumulativeEnergyImported"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(AO,{}),cluster:e,value:Math.round((null===(t=e.attributeLocalValue)||void 0===t?void 0:t.energy)/1e6),unit:"kwh"})})),(0,dt.jsx)(Uf,{sx:eR,children:(0,dt.jsx)(vf,{sx:tR,children:s})}),(0,dt.jsx)(Uf,{sx:rR,children:(0,dt.jsx)(vf,{sx:nR,children:t.name})}),(0,dt.jsxs)(Uf,{sx:oR,children:[tM&&(0,dt.jsx)(vf,{sx:aR,children:r}),(0,dt.jsx)(vf,{sx:aR,children:n}),tM&&(0,dt.jsxs)(vf,{sx:aR,children:["0x",o.toString(16).padStart(4,"0")]})]})]})}function pR(t){let{filter:r}=t;const{online:n,sendMessage:o,addListener:a,removeListener:i}=(0,e.useContext)(Qh),[s,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)({}),[d,p]=(0,e.useState)([]),[f,h]=(0,e.useState)([]),[m,g]=(0,e.useState)({}),[v,y]=(0,e.useState)({}),[b,x]=(0,e.useState)({}),[w,S]=(0,e.useState)(f),k=()=>{l(!s)};return(0,e.useEffect)((()=>{const e=e=>{if("Matterbridge"===e.src&&"Frontend"===e.dst){if("refresh_required"===e.method&&(tM&&console.log("DevicesIcons received refresh_required and sending api requests"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),"/api/settings"===e.method&&e.response&&(tM&&console.log("DevicesIcons received settings:",e.response),u(e.response)),"/api/plugins"===e.method&&e.response&&(tM&&console.log("DevicesIcons received plugins:",e.response),p(e.response)),"/api/devices"===e.method&&e.response){tM&&console.log(`DevicesIcons received ${e.response.length} devices:`,e.response),h(e.response);for(let t of e.response)tM&&console.log("DevicesIcons sending /api/clusters"),o({method:"/api/clusters",src:"Frontend",dst:"Matterbridge",params:{plugin:t.pluginName,endpoint:t.endpoint}})}if("/api/clusters"===e.method&&e.response){if(tM&&console.log(`DevicesIcons received for device "${e.deviceName}" serial "${e.serialNumber}" deviceType ${e.deviceTypes.join(" ")} clusters (${e.response.length}):`,e.response),0===e.response.length)return;const t=e.serialNumber;m[t]=[],v[t]=e.deviceTypes,b[t]=[];for(let r of e.response)m[t].find((e=>e.endpoint===r.endpoint))||m[t].push({endpoint:r.endpoint,id:r.id,deviceTypes:r.deviceTypes}),["FixedLabel","Descriptor","Identify","Groups","PowerTopology"].includes(r.clusterName)||b[t].push(r);g({...m}),y({...v}),x({...b}),tM&&console.log(`DevicesIcons endpoints for "${t}":`,m[t]),tM&&console.log(`DevicesIcons deviceTypes for "${t}":`,v[t]),tM&&console.log(`DevicesIcons clusters for "${t}":`,b[t])}}};return a(e),tM&&console.log("DevicesIcons useEffect webSocket mounted"),()=>{i(e),tM&&console.log("DevicesIcons useEffect webSocket unmounted")}}),[a,i,o]),(0,e.useEffect)((()=>(tM&&console.log("DevicesIcons useEffect online mounting"),n&&(tM&&console.log("DevicesIcons useEffect online sending api requests"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),tM&&console.log("DevicesIcons useEffect online mounted"),()=>{tM&&console.log("DevicesIcons useEffect online unmounted")})),[n,o]),(0,e.useEffect)((()=>{if(""===r)return void S(f);const e=f.filter((e=>e.name.toLowerCase().includes(r)||e.serial.toLowerCase().includes(r)));S(e)}),[f,r]),tM&&console.log("DevicesIcons rendering..."),(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsxs)(mh,{open:s,onClose:k,PaperProps:{style:{color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",border:"2px solid var(--primary-color)",borderRadius:"var(--div-border-radius)",boxShadow:"2px 2px 5px var(--div-shadow-color)"}},children:[(0,dt.jsx)(xh,{children:"Configure accessories"}),(0,dt.jsx)(Ch,{}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:k,children:"Close"})})]}),(0,dt.jsx)("div",{style:{display:"flex",flexWrap:"wrap",paddingBottom:"5px",gap:"20px",width:"100%",overflow:"auto"},children:w.map((e=>m[e.serial]&&m[e.serial].map((t=>t.deviceTypes.map((r=>(0,dt.jsx)(dR,{device:e,endpoint:t.endpoint,id:t.id,deviceType:r,clusters:b[e.serial].filter((e=>e.endpoint===t.endpoint))})))))))})]})}const fR=[{Header:"Plugin name",accessor:"pluginName"},{Header:"Device type",accessor:"type"},{Header:"Endpoint",accessor:"endpoint"},{Header:"Name",accessor:"name"},{Header:"Serial number",accessor:"serial"},{Header:"Unique ID",accessor:"uniqueId"},{Header:"Url",accessor:"configUrl"},{Header:"Config",accessor:"configButton",noSort:!0,Cell:e=>{let{row:t}=e;return t.original.configUrl?(0,dt.jsx)(Rd,{onClick:()=>window.open(t.original.configUrl,"_blank"),"aria-label":"Open Config",sx:{margin:0,padding:0},children:(0,dt.jsx)(Qv,{fontSize:"small"})}):null}},{Header:"Cluster",accessor:"cluster"}],hR=[{Header:"Endpoint",accessor:"endpoint"},{Header:"Id",accessor:"id"},{Header:"Device Types",accessor:"deviceTypes",Cell:e=>{let{value:t}=e;return Array.isArray(t)?t.map((e=>`0x${e.toString(16).padStart(4,"0")}`)).join(", "):t}},{Header:"Cluster Name",accessor:"clusterName"},{Header:"Cluster ID",accessor:"clusterId"},{Header:"Attribute Name",accessor:"attributeName"},{Header:"Attribute ID",accessor:"attributeId"},{Header:"Attribute Value",accessor:"attributeValue",Cell:e=>{let{value:t}=e;return(0,dt.jsx)(Uu,{title:t,componentsProps:{tooltip:{sx:{fontSize:"14px",fontWeight:"normal",color:"#ffffff",backgroundColor:"var(--primary-color)"}}},children:(0,dt.jsx)("div",{style:{maxWidth:"500px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})})}}];function mR(t){let{data:r,columnVisibility:n,setPlugin:o,setEndpoint:a,setDeviceName:i}=t;const[s,l]=(0,e.useState)(null),c=e.useMemo((()=>fR.filter((e=>n[e.accessor]))),[n]),{getTableProps:u,getTableBodyProps:d,headerGroups:p,rows:f,prepareRow:h}=(0,yv.useTable)({columns:c,data:r},yv.useSortBy);return(0,dt.jsxs)("table",{...u(),style:{margin:"-1px",border:"1px solid var(--table-border-color)"},children:[(0,dt.jsx)("thead",{children:p.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),children:e.headers.map((e=>(0,dt.jsxs)("th",{...e.getHeaderProps(e.noSort?void 0:e.getSortByToggleProps()),children:[e.render("Header"),!e.noSort&&(0,dt.jsx)("span",{style:{margin:"0px",marginLeft:"5px",padding:"0px"},children:e.isSorted?e.isSortedDesc?(0,dt.jsx)(dO(),{path:fO,size:"15px"}):(0,dt.jsx)(dO(),{path:pO,size:"15px"}):null})]})))})))}),(0,dt.jsx)("tbody",{...d(),children:f.map(((e,t)=>(h(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),onClick:()=>(e=>{const t=f[e];if(e===s)return l(null),o(null),a(null),i(null),void(tM&&console.log("Device unclicked:",e,"selectedDeviceIndex:",s));l(e),o(t.original.pluginName),a(t.original.endpoint),i(t.original.name),tM&&console.log("Device clicked:",e,"selectedDeviceIndex:",s,"pluginName:",r[e].pluginName,"endpoint:",r[e].endpoint)})(t),style:{backgroundColor:s===t?"var(--table-selected-bg-color)":"",cursor:"pointer"},children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),children:e.render("Cell")})))},t))))})]})}function gR(t){let{data:r,columnVisibility:n}=t;const o=e.useMemo((()=>hR.filter((e=>n[e.accessor]))),[n]),{getTableProps:a,getTableBodyProps:i,headerGroups:s,rows:l,prepareRow:c}=(0,yv.useTable)({columns:o,data:r},yv.useSortBy);return(0,dt.jsxs)("table",{...a(),style:{margin:"-1px"},children:[(0,dt.jsx)("thead",{children:s.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),children:e.headers.map((e=>(0,dt.jsx)("th",{...e.getHeaderProps(),children:e.render("Header")})))})))}),(0,dt.jsx)("tbody",{...i(),children:l.map(((e,t)=>(c(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),children:e.render("Cell")})))},t))))})]})}const vR=function(){const{online:t,sendMessage:r,addListener:n,removeListener:o}=(0,e.useContext)(Qh),[a,i]=(0,e.useState)([]),[s,l]=(0,e.useState)([]),[c,u]=(0,e.useState)(null),[d,p]=(0,e.useState)(null),[f,h]=(0,e.useState)(null),[m,g]=(0,e.useState)(0),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)({pluginName:!0,type:!0,endpoint:!0,name:!0,serial:!0,uniqueId:!1,configUrl:!1,configButton:!0,cluster:!0}),[w,S]=(0,e.useState)(!1),[k,C]=(0,e.useState)({endpoint:!0,id:!0,deviceTypes:!0,clusterName:!0,clusterId:!0,attributeName:!0,attributeId:!0,attributeValue:!0}),[j,$]=(0,e.useState)(""),[E,_]=(0,e.useState)(a),[P,O]=(0,e.useState)("table");(0,e.useEffect)((()=>{const e=e=>{if(tM&&console.log("Devices received WebSocket Message:",e),"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&(tM&&console.log("Devices received refresh_required"),r({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),"/api/devices"===e.method&&(tM&&console.log(`Devices received ${e.response.length} devices:`,e.response),i(e.response)),"/api/clusters"===e.method)){tM&&console.log(`Devices received ${e.response.length} clusters:`,e.response),l(e.response);const t={};for(const r of e.response)tM&&console.log("Cluster:",r.endpoint),t[r.endpoint]?t[r.endpoint]++:t[r.endpoint]=1;g(Object.keys(t).length)}};return n(e),tM&&console.log("Devices added WebSocket listener"),()=>{o(e),tM&&console.log("Devices removed WebSocket listener")}}),[n,o,r]),(0,e.useEffect)((()=>{t&&(tM&&console.log("Devices sending api requests"),r({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}}))}),[t,r]),(0,e.useEffect)((()=>{c&&d&&(tM&&console.log("Devices sending /api/clusters"),r({method:"/api/clusters",src:"Frontend",dst:"Matterbridge",params:{plugin:c,endpoint:d}}))}),[c,d,r]);const R=()=>{y(!v)};(0,e.useEffect)((()=>{const e=localStorage.getItem("devicesColumnVisibility");e&&x(JSON.parse(e))}),[]);const M=()=>{S(!w)};(0,e.useEffect)((()=>{const e=localStorage.getItem("clustersColumnVisibility");e&&C(JSON.parse(e))}),[]);const N=e=>{O(e),localStorage.setItem("devicesViewMode",e)};return(0,e.useEffect)((()=>{if(""===j)return void _(a);const e=a.filter((e=>e.name.toLowerCase().includes(j)||e.serial.toLowerCase().includes(j)));_(e)}),[a,j]),(0,e.useEffect)((()=>{const e=localStorage.getItem("devicesFilter");e&&$(e)}),[]),(0,e.useEffect)((()=>{const e=localStorage.getItem("devicesViewMode");e&&O(e)}),[]),tM&&console.log("Devices rendering..."),t?(0,dt.jsxs)("div",{className:"MbfPageDiv",children:[(0,dt.jsxs)("div",{className:"MbfWindowBodyRow",style:{justifyContent:"space-between",padding:0,gap:"20px",width:"100%",height:"45px",minHeight:"45px",maxHeight:"45px"},children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[(0,dt.jsx)(vf,{sx:{fontSize:"16px",fontWeight:"normal",color:"var(--div-text-color)",marginLeft:"5px",whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{variant:"outlined",value:j,onChange:e=>{$(e.target.value.toLowerCase()),localStorage.setItem("devicesFilter",e.target.value.toLowerCase())},placeholder:"Enter the device name or serial number",sx:{width:"320px"},InputProps:{style:{backgroundColor:"var(--main-bg-color)"}}})]}),(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[(0,dt.jsx)(vf,{sx:{fontSize:"16px",fontWeight:"normal",color:"var(--div-text-color)",marginLeft:"5px",whiteSpace:"nowrap"},children:"View mode:"}),(0,dt.jsx)(Rd,{onClick:()=>N("table"),"aria-label":"Table View",disabled:"table"===P,children:(0,dt.jsx)(Uu,{title:"Table View",children:(0,dt.jsx)(vO,{style:{color:"table"===P?"var(--main-icon-color)":"var(--primary-color)"}})})}),(0,dt.jsx)(Rd,{onClick:()=>N("icon"),"aria-label":"Icon View",disabled:"icon"===P,children:(0,dt.jsx)(Uu,{title:"Icon View (beta)",children:(0,dt.jsx)(yO,{style:{color:"icon"===P?"var(--main-icon-color)":"var(--primary-color)"}})})})]})]}),(0,dt.jsxs)(mh,{open:v,onClose:R,children:[(0,dt.jsx)(xh,{children:"Configure Devices Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:fR.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["pluginName","name","configButton"].includes(e.accessor),checked:b[e.accessor],onChange:()=>{return t=e.accessor,void x((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("devicesColumnVisibility",JSON.stringify(r)),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:R,children:"Close"})})]}),"table"===P&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",maxHeight:""+(c&&d?"50%":"100%"),width:"100%",flex:"1 1 auto",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("p",{style:{margin:"0px",padding:"0px"},children:"Registered devices"}),(0,dt.jsx)(Rd,{onClick:R,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0",padding:"0",gap:"0"},children:(0,dt.jsx)(mR,{data:E,columnVisibility:b,setPlugin:u,setEndpoint:p,setDeviceName:h})}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{height:"",padding:"0",borderTop:"1px solid var(--table-border-color)"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{paddingLeft:"10px",fontWeight:"normal",textAlign:"left"},children:["Total devices: ",E.length.toString()]})})]}),(0,dt.jsxs)(mh,{open:w,onClose:M,children:[(0,dt.jsx)(xh,{children:"Configure Clusters Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:hR.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["clusterName","attributeName","attributeValue"].includes(e.accessor),checked:k[e.accessor],onChange:()=>{return t=e.accessor,void C((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("clustersColumnVisibility",JSON.stringify(r)),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:M,children:"Close"})})]}),"table"===P&&c&&d&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",height:"50%",maxHeight:"50%",width:"100%",flex:"1 1 auto",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsxs)("p",{style:{margin:"0px",padding:"0px"},children:['Clusters for device "',f,'" on endpoint ',d]}),(0,dt.jsx)(Rd,{onClick:M,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0",padding:"0",gap:"0"},children:(0,dt.jsx)(gR,{data:s,columnVisibility:k})}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{height:"",padding:"0",borderTop:"1px solid var(--table-border-color)"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{paddingLeft:"10px",fontWeight:"normal",textAlign:"left"},children:["Total child endpoints: ",m-1]})})]}),"icon"===P&&(0,dt.jsx)(pR,{filter:j,devices:E})]}):(0,dt.jsx)(tm,{})},yR=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),bR=Pf((0,dt.jsx)("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),xR=dl("span",{shouldForwardProp:cl})({position:"relative",display:"flex"}),wR=dl(yR)({transform:"scale(1)"}),SR=dl(bR)(gl((e=>{let{theme:t}=e;return{left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}}]}})));const kR=function(e){const{checked:t=!1,classes:r={},fontSize:n}=e,o={...e,checked:t};return(0,dt.jsxs)(xR,{className:r.root,ownerState:o,children:[(0,dt.jsx)(wR,{fontSize:n,className:r.background,ownerState:o}),(0,dt.jsx)(SR,{fontSize:n,className:r.dot,ownerState:o})]})},CR=cp;const jR=e.createContext(void 0);function $R(e){return vu("MuiRadio",e)}const ER=yu("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),_R=dl(Dv,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"medium"!==r.size&&t[`size${yl(r.size)}`],t[`color${yl(r.color)}`]]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,[`&.${ER.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disabled:!1},style:{[`&.${ER.checked}`]:{color:(t.vars||t).palette[r].main}}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}})));const PR=(0,dt.jsx)(kR,{checked:!0}),OR=(0,dt.jsx)(kR,{}),RR=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiRadio"}),{checked:o,checkedIcon:a=PR,color:i="primary",icon:s=OR,name:l,onChange:c,size:u="medium",className:d,disabled:p,disableRipple:f=!1,slots:h={},slotProps:m={},inputProps:g,...v}=n,y=Am();let b=p;y&&"undefined"===typeof b&&(b=y.disabled),b??=!1;const x={...n,disabled:b,disableRipple:f,color:i,size:u},w=(e=>{const{classes:t,color:r,size:n}=e,o={root:["root",`color${yl(r)}`,"medium"!==n&&`size${yl(n)}`]};return{...t,...zs(o,$R,t)}})(x),S=e.useContext(jR);let k=o;const C=CR(c,S&&S.onChange);let j=l;S&&("undefined"===typeof k&&(k=function(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}(S.value,n.value)),"undefined"===typeof j&&(j=S.name));const $=m.input??g,[E,_]=Iu("root",{ref:r,elementType:_R,className:Ns(w.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:m,...v},getSlotProps:e=>({...e,onChange:function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.onChange?.(t,...n),C(t,...n)}}),ownerState:x,additionalProps:{type:"radio",icon:e.cloneElement(s,{fontSize:s.props.fontSize??u}),checkedIcon:e.cloneElement(a,{fontSize:a.props.fontSize??u}),disabled:b,name:j,checked:k,slots:h,slotProps:{input:"function"===typeof $?$(x):$}}});return(0,dt.jsx)(E,{..._,classes:w})})),MR=RR;function NR(e){return vu("MuiRadioGroup",e)}yu("MuiRadioGroup",["root","row","error"]);const IR=e.forwardRef((function(t,r){const{actions:n,children:o,className:a,defaultValue:i,name:s,onChange:l,value:c,...u}=t,d=e.useRef(null),p=(e=>{const{classes:t,row:r,error:n}=e;return zs({root:["root",r&&"row",n&&"error"]},NR,t)})(t),[f,h]=Nu({controlled:c,default:i,name:"RadioGroup"});e.useImperativeHandle(n,(()=>({focus:()=>{let e=d.current.querySelector("input:not(:disabled):checked");e||(e=d.current.querySelector("input:not(:disabled)")),e&&e.focus()}})),[]);const m=Al(r,d),g=Mu(s),v=e.useMemo((()=>({name:g,onChange(e){h(e.target.value),l&&l(e,e.target.value)},value:f})),[g,l,h,f]);return(0,dt.jsx)(jR.Provider,{value:v,children:(0,dt.jsx)($v,{role:"radiogroup",ref:m,className:Ns(p.root,a),...u,children:o})})})),TR=IR;const AR=e.createContext();function DR(e){return vu("MuiGrid",e)}const FR=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],zR=yu("MuiGrid",["root","container","item","zeroMinWidth",...[0,1,2,3,4,5,6,7,8,9,10].map((e=>`spacing-xs-${e}`)),...["column-reverse","column","row-reverse","row"].map((e=>`direction-xs-${e}`)),...["nowrap","wrap-reverse","wrap"].map((e=>`wrap-xs-${e}`)),...FR.map((e=>`grid-xs-${e}`)),...FR.map((e=>`grid-sm-${e}`)),...FR.map((e=>`grid-md-${e}`)),...FR.map((e=>`grid-lg-${e}`)),...FR.map((e=>`grid-xl-${e}`))]),LR=zR;function BR(e){let{breakpoints:t,values:r}=e,n="";Object.keys(r).forEach((e=>{""===n&&0!==r[e]&&(n=e)}));const o=Object.keys(t).sort(((e,r)=>t[e]-t[r]));return o.slice(0,o.indexOf(n))}const WR=dl("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e,{container:n,direction:o,item:a,spacing:i,wrap:s,zeroMinWidth:l,breakpoints:c}=r;let u=[];n&&(u=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||e<=0)return[];if("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e)return[r[`spacing-xs-${String(e)}`]];const n=[];return t.forEach((t=>{const o=e[t];Number(o)>0&&n.push(r[`spacing-${t}-${String(o)}`])})),n}(i,c,t));const d=[];return c.forEach((e=>{const n=r[e];n&&d.push(t[`grid-${e}-${String(n)}`])})),[t.root,n&&t.container,a&&t.item,l&&t.zeroMinWidth,...u,"row"!==o&&t[`direction-xs-${String(o)}`],"wrap"!==s&&t[`wrap-xs-${String(s)}`],...d]}})((e=>{let{ownerState:t}=e;return{boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},..."wrap"!==t.wrap&&{flexWrap:t.wrap}}}),(function(e){let{theme:t,ownerState:r}=e;return pn({theme:t},mn({values:r.direction,breakpoints:t.breakpoints.values}),(e=>{const t={flexDirection:e};return e.startsWith("column")&&(t[`& > .${LR.item}`]={maxWidth:"none"}),t}))}),(function(e){let{theme:t,ownerState:r}=e;const{container:n,rowSpacing:o}=r;let a={};if(n&&0!==o){const e=mn({values:o,breakpoints:t.breakpoints.values});let r;"object"===typeof e&&(r=BR({breakpoints:t.breakpoints.values,values:e})),a=pn({theme:t},e,((e,n)=>{const o=t.spacing(e);return"0px"!==o?{marginTop:`calc(-1 * ${o})`,[`& > .${LR.item}`]:{paddingTop:o}}:r?.includes(n)?{}:{marginTop:0,[`& > .${LR.item}`]:{paddingTop:0}}}))}return a}),(function(e){let{theme:t,ownerState:r}=e;const{container:n,columnSpacing:o}=r;let a={};if(n&&0!==o){const e=mn({values:o,breakpoints:t.breakpoints.values});let r;"object"===typeof e&&(r=BR({breakpoints:t.breakpoints.values,values:e})),a=pn({theme:t},e,((e,n)=>{const o=t.spacing(e);if("0px"!==o){return{width:`calc(100% + ${o})`,marginLeft:`calc(-1 * ${o})`,[`& > .${LR.item}`]:{paddingLeft:o}}}return r?.includes(n)?{}:{width:"100%",marginLeft:0,[`& > .${LR.item}`]:{paddingLeft:0}}}))}return a}),(function(e){let t,{theme:r,ownerState:n}=e;return r.breakpoints.keys.reduce(((e,o)=>{let a={};if(n[o]&&(t=n[o]),!t)return e;if(!0===t)a={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===t)a={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const i=mn({values:n.columns,breakpoints:r.breakpoints.values}),s="object"===typeof i?i[o]:i;if(void 0===s||null===s)return e;const l=Math.round(t/s*1e8)/1e6+"%";let c={};if(n.container&&n.item&&0!==n.columnSpacing){const e=r.spacing(n.columnSpacing);if("0px"!==e){const t=`calc(${l} + ${e})`;c={flexBasis:t,maxWidth:t}}}a={flexBasis:l,flexGrow:0,maxWidth:l,...c}}return 0===r.breakpoints.values[o]?Object.assign(e,a):e[r.breakpoints.up(o)]=a,e}),{})}));const VR=e=>{const{classes:t,container:r,direction:n,item:o,spacing:a,wrap:i,zeroMinWidth:s,breakpoints:l}=e;let c=[];r&&(c=function(e,t){if(!e||e<=0)return[];if("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e)return[`spacing-xs-${String(e)}`];const r=[];return t.forEach((t=>{const n=e[t];if(Number(n)>0){const e=`spacing-${t}-${String(n)}`;r.push(e)}})),r}(a,l));const u=[];l.forEach((t=>{const r=e[t];r&&u.push(`grid-${t}-${String(r)}`)}));return zs({root:["root",r&&"container",o&&"item",s&&"zeroMinWidth",...c,"row"!==n&&`direction-xs-${String(n)}`,"wrap"!==i&&`wrap-xs-${String(i)}`,...u]},DR,t)},HR=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiGrid"}),{breakpoints:o}=hl(),a=cf(n),{className:i,columns:s,columnSpacing:l,component:c="div",container:u=!1,direction:d="row",item:p=!1,rowSpacing:f,spacing:h=0,wrap:m="wrap",zeroMinWidth:g=!1,...v}=a,y=f||h,b=l||h,x=e.useContext(AR),w=u?s||12:x,S={},k={...v};o.keys.forEach((e=>{null!=v[e]&&(S[e]=v[e],delete k[e])}));const C={...a,columns:w,container:u,direction:d,item:p,rowSpacing:y,columnSpacing:b,wrap:m,zeroMinWidth:g,spacing:h,...S,breakpoints:o.keys},j=VR(C);return(0,dt.jsx)(AR.Provider,{value:w,children:(0,dt.jsx)(WR,{ownerState:C,className:Ns(j.root,i),as:c,ref:r,...k})})}));const UR=HR,qR=t=>{let{open:r,ip:n,onClose:o,onSave:a}=t;const i=n?n.split(".").slice(0,3).join(".")+".1":"",[s,l]=(0,e.useState)("dhcp"),[c,u]=(0,e.useState)({ip:null!==n&&void 0!==n?n:"",subnet:"255.255.255.0",gateway:i,dns:i}),d=e=>t=>{u({...c,[e]:t.target.value})};return(0,dt.jsxs)(mh,{open:r,onClose:(e,t)=>{"backdropClick"!==t&&"escapeKeyDown"!==t&&o()},maxWidth:"sm",style:{maxWidth:"550px",margin:"auto"},children:[(0,dt.jsx)(xh,{gap:"20px",children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h4",{style:{margin:0},children:"Network Configuration"})]})}),(0,dt.jsxs)(Ch,{dividers:!0,children:[(0,dt.jsxs)(Rg,{component:"fieldset",fullWidth:!0,children:[(0,dt.jsx)(Sg,{component:"legend",children:"Select IP Configuration"}),(0,dt.jsxs)(TR,{row:!0,value:s,onChange:e=>l(e.target.value),children:[(0,dt.jsx)(Mv,{value:"dhcp",control:(0,dt.jsx)(MR,{}),label:"DHCP"}),(0,dt.jsx)(Mv,{value:"static",control:(0,dt.jsx)(MR,{}),label:"Static"})]})]}),"static"===s&&(0,dt.jsxs)(UR,{container:!0,spacing:2,sx:{mt:2},children:[(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"IP Address",fullWidth:!0,value:c.ip,onChange:d("ip")})}),(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"Subnet Mask",fullWidth:!0,value:c.subnet,onChange:d("subnet")})}),(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"Gateway",fullWidth:!0,value:c.gateway,onChange:d("gateway")})}),(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"DNS Server",fullWidth:!0,value:c.dns,onChange:d("dns")})})]})]}),(0,dt.jsxs)(Sv,{children:[(0,dt.jsx)(Ah,{onClick:()=>{o()},children:"Cancel"}),(0,dt.jsx)(Ah,{variant:"contained",onClick:()=>{const e="static"===s?{type:s,...c}:{type:s};a(e),o()},children:"Save"})]})]})},GR=t=>{let{open:r,onClose:n,onSave:o}=t;const[a,i]=(0,e.useState)(""),[s,l]=(0,e.useState)(""),c=a.length>0&&a===s;return(0,dt.jsxs)(mh,{open:r,onClose:(e,t)=>{"backdropClick"!==t&&"escapeKeyDown"!==t&&n()},maxWidth:"sm",style:{maxWidth:"500px",margin:"auto"},disableEscapeKeyDown:!0,children:[(0,dt.jsx)(xh,{children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h4",{style:{margin:0},children:"Change Password"})]})}),(0,dt.jsx)(Ch,{dividers:!0,children:(0,dt.jsx)(Rg,{component:"fieldset",fullWidth:!0,sx:{margin:0,padding:0,gap:"20px"},children:(0,dt.jsxs)(UR,{container:!0,spacing:2,sx:{mt:2},children:[(0,dt.jsx)(UR,{item:!0,xs:12,children:(0,dt.jsx)(fv,{type:"password",autoComplete:"new-password",label:"New Password",size:"small",variant:"outlined",fullWidth:!0,value:a,onChange:e=>{i(e.target.value)}})}),(0,dt.jsx)(UR,{item:!0,xs:12,children:(0,dt.jsx)(fv,{type:"password",autoComplete:"new-password",label:"Confirm Password",size:"small",variant:"outlined",fullWidth:!0,value:s,onChange:e=>{l(e.target.value)},error:""!==s&&a!==s,helperText:""!==s&&a!==s?"Passwords do not match":""})})]})})}),(0,dt.jsxs)(Sv,{children:[(0,dt.jsx)(Ah,{onClick:()=>{n()},children:"Cancel"}),(0,dt.jsx)(Ah,{variant:"contained",onClick:()=>{c&&(o(a),n())},disabled:!c,children:"Change"}),(0,dt.jsx)(Ah,{variant:"contained",onClick:()=>{o(""),n()},children:"Reset"})]})]})};function KR(t){var r;let{matterbridgeInfo:n,systemInfo:o}=t;const[a,i]=(0,e.useState)("bridge"),[s,l]=(0,e.useState)("Info"),[c,u]=(0,e.useState)(!1),[d,p]=(0,e.useState)("dark"),[f,h]=(0,e.useState)("false"!==localStorage.getItem("homePagePlugins")),[m,g]=(0,e.useState)(null!==(r=localStorage.getItem("homePageMode"))&&void 0!==r?r:"logs"),{sendMessage:v}=(0,e.useContext)(Qh),[y,b]=(0,e.useState)(!1),[x,w]=(0,e.useState)(!1);(0,e.useEffect)((()=>{void 0!==n.bridgeMode&&(i("bridge"===n.bridgeMode?"bridge":"childbridge"),l(n.loggerLevel.charAt(0).toUpperCase()+n.loggerLevel.slice(1)),u(n.fileLogger))}),[n]),(0,e.useEffect)((()=>{const e=localStorage.getItem("frontendTheme");e&&p(e)}),[]);return(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Matterbridge settings"})}),(0,dt.jsx)(qR,{open:y,ip:o.ipv4Address,onClose:()=>b(!1),onSave:e=>{tM&&console.log("handleSaveNetConfig called with config:",e),v({method:"/api/shellynetconfig",src:"Frontend",dst:"Matterbridge",params:e})}}),(0,dt.jsx)(GR,{open:x,onClose:()=>w(!1),onSave:e=>{tM&&console.log("handleSaveChangePassword called with password:",e),Bf("setpassword","*"+e+"*")}}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px",flex:"0 0 auto"},children:(0,dt.jsxs)(Uf,{sx:{gap:"10px",margin:"0px",padding:"10px",width:"400px",backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)"},children:[(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"matterbridgeInfo-mode",children:"Matterbridge mode:"}),(0,dt.jsxs)(TR,{row:!0,name:"mode-buttons-group",value:a,onChange:e=>{tM&&console.log("handleChangeBridgeMode called with value:",e.target.value),i(e.target.value),Bf("setbridgemode",e.target.value)},children:[(0,dt.jsx)(Mv,{value:"bridge",control:(0,dt.jsx)(MR,{}),label:"Bridge",disabled:!0===n.readOnly}),(0,dt.jsx)(Mv,{value:"childbridge",control:(0,dt.jsx)(MR,{}),label:"Childbridge",disabled:!0===n.readOnly})]})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"mblogger-level-label",children:"Logger level:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"mblogger-level-label",id:"mblogger-level",value:s,onChange:e=>{tM&&console.log("handleChangeMbLoggerLevel called with value:",e.target.value),l(e.target.value),Bf("setmbloglevel",e.target.value)},children:[(0,dt.jsx)(tf,{value:"Debug",children:"Debug"}),(0,dt.jsx)(tf,{value:"Info",children:"Info"}),(0,dt.jsx)(tf,{value:"Notice",children:"Notice"}),(0,dt.jsx)(tf,{value:"Warn",children:"Warn"}),(0,dt.jsx)(tf,{value:"Error",children:"Error"}),(0,dt.jsx)(tf,{value:"Fatal",children:"Fatal"})]}),(0,dt.jsx)(Mv,{style:{padding:"0px",margin:"0px"},control:(0,dt.jsx)(Kv,{checked:c,onChange:e=>{tM&&console.log("handleLogOnFileMbChange called with value:",e.target.checked),u(e.target.checked),Bf("setmblogfile",e.target.checked?"true":"false")},name:"logOnFileMb"}),label:"Log on file:",labelPlacement:"start"})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"5px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"frontend-theme-label",children:"Frontend theme:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"frontend-theme-label",id:"frontend-theme",value:d,onChange:e=>{const t=e.target.value;tM&&console.log("handleChangeTheme called with value:",t),p(t),localStorage.setItem("frontendTheme",t),document.body.setAttribute("frontend-theme",t)},children:[(0,dt.jsx)(tf,{value:"classic",children:"Classic"}),(0,dt.jsx)(tf,{value:"light",children:"Light"}),(0,dt.jsx)(tf,{value:"dark",children:"Dark"})]})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"5px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"frontend-home-plugin-label",children:"Home page plugins:"}),(0,dt.jsx)(Kv,{checked:f,onChange:e=>{const t=e.target.checked;tM&&console.log("handleChangeHomePagePlugins called with value:",t),h(t),localStorage.setItem("homePagePlugins",t?"true":"false")},name:"showPlugins"})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"5px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"frontend-home-label",children:"Home page bottom panel:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"frontend-home-label",id:"frontend-home",value:m,onChange:e=>{const t=e.target.value;tM&&console.log("handleChangeHomePageMode called with value:",t),g(t),localStorage.setItem("homePageMode",t)},children:[(0,dt.jsx)(tf,{value:"logs",children:"Logs"}),(0,dt.jsx)(tf,{value:"devices",children:"Devices"})]})]}),(0,dt.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"20px"},children:(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:()=>w(!0),children:"Change password"})}),n.shellyBoard&&(0,dt.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"20px"},children:(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:()=>b(!0),children:"Configure IP"})})]})})]})}function QR(t){let{matterbridgeInfo:r}=t;const[n,o]=(0,e.useState)("Info"),[a,i]=(0,e.useState)(!1),[s,l]=(0,e.useState)(""),[c,u]=(0,e.useState)(""),[d,p]=(0,e.useState)(""),[f,h]=(0,e.useState)(),[m,g]=(0,e.useState)(),[v,y]=(0,e.useState)(),{showSnackbarMessage:b}=(0,e.useContext)(Fh);(0,e.useEffect)((()=>{void 0!==r.bridgeMode&&(o(["Debug","Info","Notice","Warn","Error","Fatal"][r.matterLoggerLevel]),i(r.matterFileLogger),l(r.mattermdnsinterface),u(r.matteripv4address),p(r.matteripv6address),h(r.matterPort),g(r.matterDiscriminator),y(r.matterPasscode))}),[r]);return(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Matter settings"})}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px",flex:"0 0 auto"},children:(0,dt.jsxs)(Uf,{sx:{gap:"10px",margin:"0px",padding:"10px",width:"400px",backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)"},children:[(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"mjdebug-info",children:"Logger level:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"select-mjlevel",id:"mjdebug-level",value:n,onChange:e=>{tM&&console.log("handleChangeMjLoggerLevel called with value:",e.target.value),o(e.target.value),Bf("setmjloglevel",e.target.value)},children:[(0,dt.jsx)(tf,{value:"Debug",children:"Debug"}),(0,dt.jsx)(tf,{value:"Info",children:"Info"}),(0,dt.jsx)(tf,{value:"Notice",children:"Notice"}),(0,dt.jsx)(tf,{value:"Warn",children:"Warn"}),(0,dt.jsx)(tf,{value:"Error",children:"Error"}),(0,dt.jsx)(tf,{value:"Fatal",children:"Fatal"})]}),(0,dt.jsx)(Mv,{style:{padding:"0px",margin:"0px"},control:(0,dt.jsx)(Kv,{checked:a,onChange:e=>{tM&&console.log("handleLogOnFileMjChange called with value:",e.target.checked),i(e.target.checked),Bf("setmjlogfile",e.target.checked?"true":"false")},name:"logOnFileMj"}),label:"Log on file:",labelPlacement:"start"})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Mdns interface:"}),(0,dt.jsx)(fv,{value:s,onChange:e=>{tM&&console.log("handleChangeMdnsInterface called with value:",e.target.value),l(e.target.value),Bf("setmdnsinterface","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Ipv4 address:"}),(0,dt.jsx)(fv,{value:c,onChange:e=>{tM&&console.log("handleChangeIpv4Address called with value:",e.target.value),u(e.target.value),Bf("setipv4address","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Ipv6 address:"}),(0,dt.jsx)(fv,{value:d,onChange:e=>{tM&&console.log("handleChangeIpv6Address called with value:",e.target.value),p(e.target.value),Bf("setipv6address","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Commissioning port:"}),(0,dt.jsx)(fv,{value:f,onChange:e=>{tM&&console.log("handleChangeMatterPort called with value:",e.target.value),h(e.target.value),Bf("setmatterport","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Commissioning discriminator:"}),(0,dt.jsx)(fv,{value:m,onChange:e=>{tM&&console.log("handleChangeMatterDiscriminator called with value:",e.target.value),g(e.target.value),Bf("setmatterdiscriminator","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Commissioning passcode:"}),(0,dt.jsx)(fv,{value:v,onChange:e=>{tM&&console.log("handleChangemMatterPasscode called with value:",e.target.value),y(e.target.value),Bf("setmatterpasscode","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]})]})})]})}function JR(e){let{matterbridgeInfo:t}=e;return(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Matterbridge info"})}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px",flex:"0 0 auto"},children:(0,dt.jsxs)(Uf,{sx:{gap:"10px",margin:"0px",padding:"10px",width:"400px",backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)"},children:[" ",(0,dt.jsx)(YR,{value:t.matterbridgeVersion,label:"Current Version"}),(0,dt.jsx)(YR,{value:t.matterbridgeLatestVersion,label:"Latest Version"}),(0,dt.jsx)(YR,{value:t.homeDirectory,label:"Home Directory"}),(0,dt.jsx)(YR,{value:t.rootDirectory,label:"Root Directory"}),(0,dt.jsx)(YR,{value:t.matterbridgeDirectory,label:"Matterbridge Storage Directory"}),(0,dt.jsx)(YR,{value:t.matterbridgePluginDirectory,label:"Matterbridge Plugin Directory"}),(0,dt.jsx)(YR,{value:t.globalModulesDirectory,label:"Global Module Directory"})]})})]})}function YR(e){let{value:t,label:r}=e;return(0,dt.jsx)(fv,{focused:!0,value:t,size:"small",label:r,variant:"standard",sx:{width:"400px"},InputProps:{readOnly:!0,sx:{color:"var(--div-text-color)","&:before":{borderBottomColor:"var(--main-label-color)"},"&:after":{borderBottomColor:"var(--main-label-color)"}}},InputLabelProps:{sx:{marginTop:"3px",color:"var(--main-label-color)","&.Mui-focused":{color:"var(--main-label-color)"}}}})}const XR=function(){const{online:t,addListener:r,removeListener:n,sendMessage:o}=(0,e.useContext)(Qh),[a,i]=(0,e.useState)(null),[s,l]=(0,e.useState)(null);return(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&(tM&&console.log("Settings received refresh_required"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}})),"/api/settings"===e.method&&(tM&&console.log("Settings received /api/settings:",e.response),i(e.response.matterbridgeInformation),l(e.response.systemInformation)))};return r(e),tM&&console.log("Settings added WebSocket listener"),()=>{n(e),tM&&console.log("Settings removed WebSocket listener")}}),[r,n,o]),(0,e.useEffect)((()=>{t&&(tM&&console.log("Settings received online"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))}),[t,o]),a?(tM&&console.log("Settings rendering..."),t?(0,dt.jsx)("div",{className:"MbfPageDiv",children:(0,dt.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"20px",width:"100%"},children:[(0,dt.jsx)(KR,{matterbridgeInfo:a,systemInfo:s}),(0,dt.jsx)(QR,{matterbridgeInfo:a}),(0,dt.jsx)(JR,{matterbridgeInfo:a})]})}):(0,dt.jsx)(tm,{})):null};const ZR=function(){const{online:t,sendMessage:r,addListener:n,removeListener:o,getUniqueId:a}=(0,e.useContext)(Qh),{showSnackbarMessage:i}=(0,e.useContext)(Fh),[s,l]=(0,e.useState)(null),[c,u]=(0,e.useState)([]),[d,p]=(0,e.useState)([]),[f,h]=(0,e.useState)([]),[m,g]=(0,e.useState)(null),[v,y]=(0,e.useState)(null),[b,x]=(0,e.useState)(null),w=(0,e.useRef)(null);return w.current||(w.current=a(),tM&&console.log("Test uniqueId:",w)),(0,e.useEffect)((()=>{tM&&console.log("Test useEffect WebSocketMessage mounting");const e=e=>{if("Matterbridge"===e.src&&"Frontend"===e.dst){if("restart_required"===e.method&&(tM&&console.log("Test received restart_required"),i("Restart required",0)),"refresh_required"===e.method&&(tM&&console.log("Test received refresh_required"),i("Refresh required",0),r({id:w.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({id:w.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),r({id:w.current,method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),"memory_update"===e.method&&(tM&&console.log("Test received memory_update",e),y(e.params)),"cpu_update"===e.method&&(tM&&console.log("Test received cpu_update",e),g(e.params)),"uptime_update"===e.method&&(tM&&console.log("Test received uptime_update",e),x(e.params)),"/api/settings"===e.method&&e.response&&(tM&&console.log("Test received /api/settings:",e.response),i("Test received /api/settings"),l(e.response)),"/api/plugins"===e.method&&e.response&&(tM&&console.log(`Test received ${e.response.length} plugins:`,e.response),i("Test received /api/plugins"),u(e.response)),"/api/devices"===e.method&&e.response){tM&&console.log(`Test received ${e.response.length} devices:`,e.response),i("Test received /api/devices"),p(e.response);for(let t of e.response)tM&&console.log("Test sending /api/clusters for device:",t.pluginName,t.name,t.endpoint),r({method:"/api/clusters",src:"Frontend",dst:"Matterbridge",params:{plugin:t.pluginName,endpoint:t.endpoint}})}"/api/clusters"===e.method&&(tM&&console.log(`Test received ${e.response.length} clusters for device ${e.deviceName} endpoint ${e.endpoint}:`,e),i("Test received /api/clusters"),h(e.response))}else tM&&console.log("Test received WebSocketMessage:",e.method,e.src,e.dst,e.response)};return n(e),tM&&console.log("Test useEffect WebSocketMessage mounted"),()=>{tM&&console.log("Test useEffect WebSocketMessage unmounting"),o(e),tM&&console.log("Test useEffect WebSocketMessage unmounted")}}),[n,o,r,i]),(0,e.useEffect)((()=>(tM&&console.log("Test useEffect online mounting"),t&&(tM&&console.log("Test useEffect online received online"),r({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}}),i("Test useEffect online received online (info)",30,"info"),i("Test useEffect online received online (warning)",30,"warning"),i("Test useEffect online received online (error)",30,"error"),i("Test useEffect online received online (success)",30,"success")),tM&&console.log("Test useEffect online mounted"),()=>{tM&&console.log("Test useEffect online unmounted")})),[t,r,i]),tM&&console.log("Test rendering..."),t?(0,dt.jsx)("div",{className:"MbfPageDiv",style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"20px",width:"100%"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"256px",width:"256px",margin:"10px"}}),(0,dt.jsx)("p",{children:"Welcome to the Test page of the Matterbridge frontend"})]})}):(0,dt.jsx)(tm,{})};const eM=function(){var t,r;const[n,o]=(0,e.useState)(null!==(t=localStorage.getItem("logFilterLevel"))&&void 0!==t?t:"info"),[a,i]=(0,e.useState)(null!==(r=localStorage.getItem("logFilterSearch"))&&void 0!==r?r:"*"),[s,l]=(0,e.useState)("false"!==localStorage.getItem("logAutoScroll")),{setMessages:c,setLogFilters:u,online:d,setAutoScroll:p}=(0,e.useContext)(Qh);return tM&&console.log("Logs rendering..."),d?(0,dt.jsxs)("div",{className:"MbfPageDiv",children:[(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",margin:"0px",padding:"0px",gap:"10px"},children:[(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)($g,{id:"select-level",style:{color:"var(--div-text-color)"},children:"Filter log by level:"}),(0,dt.jsxs)(lv,{style:{height:"30px",backgroundColor:"var(--main-bg-color)"},labelId:"select-level",id:"debug-level",value:n,onChange:e=>{o(e.target.value),u(e.target.value,a),localStorage.setItem("logFilterLevel",e.target.value),tM&&console.log("handleChangeLevel called with value:",e.target.value)},children:[(0,dt.jsx)(tf,{value:"debug",children:"Debug"}),(0,dt.jsx)(tf,{value:"info",children:"Info"}),(0,dt.jsx)(tf,{value:"notice",children:"Notice"}),(0,dt.jsx)(tf,{value:"warn",children:"Warn"}),(0,dt.jsx)(tf,{value:"error",children:"Error"}),(0,dt.jsx)(tf,{value:"fatal",children:"Fatal"})]}),(0,dt.jsx)($g,{id:"search",style:{color:"var(--div-text-color)"},children:"Filter log by text:"}),(0,dt.jsx)(fv,{style:{width:"300px"},size:"small",id:"logsearch",variant:"outlined",value:a,onChange:e=>{i(e.target.value),u(n,e.target.value),localStorage.setItem("logFilterSearch",e.target.value),tM&&console.log("handleChangeSearch called with value:",e.target.value)},InputProps:{style:{height:"30px",padding:"0 0px",backgroundColor:"var(--main-bg-color)"}}}),(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{checked:s,onChange:e=>{l(e.target.checked),p(e.target.checked),localStorage.setItem("logAutoScroll",e.target.value?"true":"false"),tM&&console.log("handleAutoScrollChange called with value:",e.target.checked)}}),label:"Auto scroll",style:{color:"var(--div-text-color)"}})]}),(0,dt.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:(0,dt.jsx)(Uu,{title:"Clear the logs",children:(0,dt.jsx)(Ah,{onClick:()=>{tM&&console.log("handleClearLogsClick called"),c([])},endIcon:(0,dt.jsx)(ty,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px"},children:"Clear"})})})]}),(0,dt.jsx)("div",{style:{flex:"1",overflow:"auto",margin:"0px",padding:"0px"},children:(0,dt.jsx)(em,{})})]}):(0,dt.jsx)(tm,{})};var tM=!1;const rM=()=>{tM=!tM},nM=(0,e.createContext)();function oM(t){let{children:r}=t;const[n,o]=(0,e.useState)(!1),[a,i]=(0,e.useState)("");return(0,dt.jsx)(nM.Provider,{value:{loggedIn:n,logIn:async e=>{try{const t=await fetch("./api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok){const{valid:r}=await t.json();r?o(!0):""!==e&&i("Incorrect password!")}else console.error("Failed to log in:",t.statusText)}catch(t){console.error("Failed to log in:",t)}},errorMessage:a},children:r})}function aM(){const[t,r]=(0,e.useState)(""),{loggedIn:n,logIn:o,errorMessage:a}=(0,e.useContext)(nM),[i,s]=(0,e.useState)("#1976d2"),l=e=>{e.preventDefault(),o(t)},c={display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",backgroundColor:"var(--main-bg-color)"},u={display:"flex",flexDirection:"column",maxWidth:"400px",margin:"0 auto",padding:"20px",gap:"20px",border:"1px solid var(--div-border-color)",borderRadius:"var(--div-border-radius)",boxShadow:"2px 2px 5px var(--div-shadow-color)",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"},d={margin:"10px 0",padding:"3px 3px",fontSize:"14px",width:"230px",border:"1px solid var(--main-label-color)",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"};(0,e.useEffect)((()=>{tM&&console.log("Setting frontend theme");const e=localStorage.getItem("frontendTheme");tM&&console.log("Saved theme:",e),e?document.body.setAttribute("frontend-theme",e):document.body.setAttribute("frontend-theme","dark");const t=function(e,t){const r=getComputedStyle(document.body).getPropertyValue(e).trim();return r||console.error("getCssVariable: undefined",r),r||t}("--primary-color","#1976d2");tM&&console.log("Primary color from CSS:",t),s(t)}),[]);const p=window.location.pathname.includes("/matterbridge/")?"/matterbridge":window.location.href.includes("/api/hassio_ingress/")?window.location.pathname:"/";console.log(`Loading App.js with href="${window.location.href}" and pathname="${window.location.pathname}" >>> baseName="${p}"`);const f=function(e){return Ba({palette:{primary:{main:e},action:{disabled:"var(--main-label-color)"},text:{disabled:"var(--main-label-color)"}},components:{MuiTypography:{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},MuiDialog:{styleOverrides:{paper:{color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",border:"2px solid var(--div-border-color)",borderRadius:"var(--div-border-radius)",boxShadow:"2px 2px 5px var(--div-shadow-color)"}}},MuiTooltip:{defaultProps:{placement:"top-start",arrow:!0}},MuiButton:{styleOverrides:{root:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)","&:hover":{backgroundColor:"var(--main-button-bg-color)"},"&.Mui-disabled":{color:"var(--main-button-color)",backgroundColor:"var(--main-grey-color)"}},contained:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},outlined:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},text:{color:"var(--main-button-color)"}},defaultProps:{variant:"contained",size:"small"}},MuiIconButton:{styleOverrides:{root:{color:"var(--main-icon-color)","&:hover .MuiSvgIcon-root":{color:"var(--primary-color)"}}}},MuiCheckbox:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-checked":{color:"var(--primary-color)"}}}},MuiTextField:{defaultProps:{size:"small",variant:"outlined",fullWidth:!0}},MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:"var(--div-bg-color)","& .MuiOutlinedInput-notchedOutline":{borderColor:"var(--main-label-color)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"var(--main-text-color)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"var(--primary-color)"},padding:"0px"},input:{color:"var(--div-text-color)",padding:"4px 8px"}}},MuiInputLabel:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-focused":{color:"var(--primary-color)"}}}},MuiFormLabel:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-focused":{color:"var(--main-label-color)"}}}},MuiFormControl:{styleOverrides:{root:{color:"var(--main-grey-color)"}}},MuiRadio:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-checked":{color:"var(--primary-color)"}}}},MuiSelect:{styleOverrides:{root:{backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)",height:"30px","&:hover":{borderColor:"var(--main-text-color)"},"&.Mui-focused":{borderColor:"var(--primary-color)"}}}},MuiMenu:{styleOverrides:{paper:{backgroundColor:"var(--main-menu-bg-color)",padding:"0px",margin:"0px"},list:{padding:"0px"}}},MuiMenuItem:{styleOverrides:{root:{color:"var(--main-menu-color)",backgroundColor:"var(--main-menu-bg-color)","&:hover":{backgroundColor:"var(--main-menu-hover-color)"},"&.Mui-selected":{color:"var(--main-menu-color)",backgroundColor:"var(--main-menu-bg-color)"},"&.Mui-selected:hover":{backgroundColor:"var(--main-menu-hover-color)"}}}},MuiListItemButton:{styleOverrides:{root:{cursor:"pointer","&:hover":{backgroundColor:"var(--main-bg-color)"}}}},MuiListItemIcon:{styleOverrides:{root:{color:"var(--div-text-color)"}}},MuiListItemText:{styleOverrides:{primary:{fontSize:"16px",fontWeight:"bold",color:"var(--div-text-color)"},secondary:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"}}}}})}(i);return o(""),n?(0,dt.jsx)(Ga,{theme:f,children:(0,dt.jsx)(Os,{dense:!0,maxSnack:10,preventDuplicate:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,dt.jsx)(zh,{children:(0,dt.jsx)(Jh,{children:(0,dt.jsx)(Xe,{basename:p,future:{v7_relativeSplatPath:!0,v7_startTransition:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0},children:(0,dt.jsxs)("div",{className:"MbfScreen",children:[(0,dt.jsx)(Yh,{}),(0,dt.jsxs)(ye,{children:[(0,dt.jsx)(ge,{path:"/",element:(0,dt.jsx)(gO,{})}),(0,dt.jsx)(ge,{path:"/devices",element:(0,dt.jsx)(vR,{})}),(0,dt.jsx)(ge,{path:"/log",element:(0,dt.jsx)(eM,{})}),(0,dt.jsx)(ge,{path:"/settings",element:(0,dt.jsx)(XR,{})}),(0,dt.jsx)(ge,{path:"/test",element:(0,dt.jsx)(ZR,{})}),(0,dt.jsx)(ge,{path:"*",element:(0,dt.jsx)(me,{to:"/"})})]})]})})})})})}):(0,dt.jsx)("div",{style:c,children:(0,dt.jsxs)("form",{onSubmit:l,style:u,children:[(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"64px",width:"64px"}}),(0,dt.jsx)("h3",{style:{color:"var(--div-text-color)"},children:"Welcome to Matterbridge"})]}),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"20px"},children:[(0,dt.jsx)("input",{type:"password",value:t,onChange:e=>r(e.target.value),style:d,placeholder:"password",autocomplete:"current-password"}),(0,dt.jsx)("button",{type:"submit",style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",borderColor:"var(--div-bg-color)"},children:"Log in"})]}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",margin:0,height:"30px"},children:a&&(0,dt.jsx)("p",{style:{color:"red"},children:a})})]})})}const iM=function(){return(0,dt.jsx)(oM,{children:(0,dt.jsx)(aM,{})})},sM=e=>{e&&e instanceof Function&&r.e(453).then(r.bind(r,6453)).then((t=>{let{getCLS:r,getFID:n,getFCP:o,getLCP:a,getTTFB:i}=t;r(e),n(e),o(e),a(e),i(e)}))};n.createRoot(document.getElementById("root")).render((0,dt.jsx)(e.StrictMode,{children:(0,dt.jsx)(iM,{})})),sM()})()})();
|
|
115
|
-
//# sourceMappingURL=main.
|
|
114
|
+
`:null,wd=dl("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${yl(r.color)}`]]}})(gl((e=>{let{theme:t}=e;return{display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:bd||{animation:`${vd} 1.4s linear infinite`}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}}))]}}))),Sd=dl("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),kd=dl("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${yl(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(gl((e=>{let{theme:t}=e;return{stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink},style:xd||{animation:`${yd} 1.4s ease-in-out infinite`}}]}}))),Cd=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiCircularProgress"}),{className:n,color:o="primary",disableShrink:a=!1,size:i=40,style:s,thickness:l=3.6,value:c=0,variant:u="indeterminate",...d}=r,p={...r,color:o,disableShrink:a,size:i,thickness:l,value:c,variant:u},f=(e=>{const{classes:t,variant:r,color:n,disableShrink:o}=e;return zs({root:["root",r,`color${yl(n)}`],svg:["svg"],circle:["circle",`circle${yl(r)}`,o&&"circleDisableShrink"]},md,t)})(p),h={},m={},g={};if("determinate"===u){const e=2*Math.PI*((gd-l)/2);h.strokeDasharray=e.toFixed(3),g["aria-valuenow"]=Math.round(c),h.strokeDashoffset=`${((100-c)/100*e).toFixed(3)}px`,m.transform="rotate(-90deg)"}return(0,dt.jsx)(wd,{className:Ns(f.root,n),style:{width:i,height:i,...m,...s},ownerState:p,ref:t,role:"progressbar",...g,...d,children:(0,dt.jsx)(Sd,{className:f.svg,ownerState:p,viewBox:"22 22 44 44",children:(0,dt.jsx)(kd,{className:f.circle,style:h,ownerState:p,cx:gd,cy:gd,r:(gd-l)/2,fill:"none",strokeWidth:l})})})})),jd=Cd;function $d(e){return vu("MuiIconButton",e)}const Ed=yu("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),_d=dl(hd,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,"default"!==r.color&&t[`color${yl(r.color)}`],r.edge&&t[`edge${yl(r.edge)}`],t[`size${yl(r.size)}`]]}})(gl((e=>{let{theme:t}=e;return{textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]}})),gl((e=>{let{theme:t}=e;return{variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No((t.vars||t).palette[r].main,t.palette.action.hoverOpacity)}}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${Ed.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled},[`&.${Ed.loading}`]:{color:"transparent"}}}))),Pd=dl("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(t.vars||t).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]}})),Od=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiIconButton"}),{edge:n=!1,children:o,className:a,color:i="default",disabled:s=!1,disableFocusRipple:l=!1,size:c="medium",id:u,loading:d=null,loadingIndicator:p,...f}=r,h=Mu(u),m=p??(0,dt.jsx)(jd,{"aria-labelledby":h,color:"inherit",size:16}),g={...r,edge:n,color:i,disabled:s,disableFocusRipple:l,loading:d,loadingIndicator:m,size:c},v=(e=>{const{classes:t,disabled:r,color:n,edge:o,size:a,loading:i}=e;return zs({root:["root",i&&"loading",r&&"disabled","default"!==n&&`color${yl(n)}`,o&&`edge${yl(o)}`,`size${yl(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},$d,t)})(g);return(0,dt.jsxs)(_d,{id:d?h:u,className:Ns(v.root,a),centerRipple:!0,focusRipple:!l,disabled:s||d,ref:t,...f,ownerState:g,children:["boolean"===typeof d&&(0,dt.jsx)("span",{className:v.loadingWrapper,style:{display:"contents"},children:(0,dt.jsx)(Pd,{className:v.loadingIndicator,ownerState:g,children:d&&m})}),o]})})),Rd=Od,Md=Wl;const Nd=e.createContext({});function Id(e){return vu("MuiList",e)}yu("MuiList",["root","padding","dense","subheader"]);const Td=dl("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return!t.disablePadding},style:{paddingTop:8,paddingBottom:8}},{props:e=>{let{ownerState:t}=e;return t.subheader},style:{paddingTop:0}}]}),Ad=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiList"}),{children:o,className:a,component:i="ul",dense:s=!1,disablePadding:l=!1,subheader:c,...u}=n,d=e.useMemo((()=>({dense:s})),[s]),p={...n,component:i,dense:s,disablePadding:l},f=(e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return zs({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},Id,t)})(p);return(0,dt.jsx)(Nd.Provider,{value:d,children:(0,dt.jsxs)(Td,{as:i,className:Ns(f.root,a),ref:r,ownerState:p,...u,children:[c,o]})})})),Dd=Ad;function Fd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document.documentElement.clientWidth;return e.innerWidth-t}const zd=Fd,Ld=go;function Bd(e){return Wl(e).defaultView||window}const Wd=Bd;function Vd(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function Hd(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function Ud(e,t){if(void 0===t)return!0;let r=e.innerText;return void 0===r&&(r=e.textContent),r=r.trim().toLowerCase(),0!==r.length&&(t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join("")))}function qd(e,t,r,n,o,a){let i=!1,s=o(e,t,!!t&&r);for(;s;){if(s===e.firstChild){if(i)return!1;i=!0}const t=!n&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&Ud(s,a)&&!t)return s.focus(),!0;s=o(e,s,r)}return!1}const Gd=e.forwardRef((function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:a=!1,children:i,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu",...p}=t,f=e.useRef(null),h=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ld((()=>{o&&f.current.focus()}),[o]),e.useImperativeHandle(n,(()=>({adjustStyleForScrollbar:(e,t)=>{let{direction:r}=t;const n=!f.current.style.width;if(e.clientHeight<f.current.clientHeight&&n){const t=`${zd(Wd(e))}px`;f.current.style["rtl"===r?"paddingLeft":"paddingRight"]=t,f.current.style.width=`calc(100% + ${t})`}return f.current}})),[]);const m=Al(f,r);let g=-1;e.Children.forEach(i,((t,r)=>{e.isValidElement(t)?(t.props.disabled||("selectedMenu"===d&&t.props.selected||-1===g)&&(g=r),g===r&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(g+=1,g>=i.length&&(g=-1))):g===r&&(g+=1,g>=i.length&&(g=-1))}));const v=e.Children.map(i,((t,r)=>{if(r===g){const r={};return a&&(r.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===d&&(r.tabIndex=0),e.cloneElement(t,r)}return t}));return(0,dt.jsx)(Dd,{role:"menu",ref:m,className:s,onKeyDown:e=>{const t=f.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey)return void(u&&u(e));const n=Md(t).activeElement;if("ArrowDown"===r)e.preventDefault(),qd(t,n,c,l,Vd);else if("ArrowUp"===r)e.preventDefault(),qd(t,n,c,l,Hd);else if("Home"===r)e.preventDefault(),qd(t,null,c,l,Vd);else if("End"===r)e.preventDefault(),qd(t,null,c,l,Hd);else if(1===r.length){const o=h.current,a=r.toLowerCase(),i=performance.now();o.keys.length>0&&(i-o.lastTime>500?(o.keys=[],o.repeating=!0,o.previousKeyMatched=!0):o.repeating&&a!==o.keys[0]&&(o.repeating=!1)),o.lastTime=i,o.keys.push(a);const s=n&&!o.repeating&&Ud(n,o);o.previousKeyMatched&&(s||qd(t,n,!1,l,Vd,o))?e.preventDefault():o.previousKeyMatched=!1}u&&u(e)},tabIndex:o?0:-1,...p,children:v})})),Kd=Gd;const Qd=function(e){return"string"===typeof e};function Jd(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((()=>{e.apply(this,o)}),r)}return n.clear=()=>{clearTimeout(t)},n}const Yd=Jd,Xd=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Zd(e){const t=[],r=[];return Array.from(e.querySelectorAll(Xd)).forEach(((e,n)=>{const o=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==o&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}(e))}(e)&&(0===o?t.push(e):r.push({documentOrder:n,tabIndex:o,node:e}))})),r.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function ep(){return!0}const tp=function(t){const{children:r,disableAutoFocus:n=!1,disableEnforceFocus:o=!1,disableRestoreFocus:a=!1,getTabbable:i=Zd,isEnabled:s=ep,open:l}=t,c=e.useRef(!1),u=e.useRef(null),d=e.useRef(null),p=e.useRef(null),f=e.useRef(null),h=e.useRef(!1),m=e.useRef(null),g=Tl(Bs(r),m),v=e.useRef(null);e.useEffect((()=>{l&&m.current&&(h.current=!n)}),[n,l]),e.useEffect((()=>{if(!l||!m.current)return;const e=Wl(m.current);return m.current.contains(e.activeElement)||(m.current.hasAttribute("tabIndex")||m.current.setAttribute("tabIndex","-1"),h.current&&m.current.focus()),()=>{a||(p.current&&p.current.focus&&(c.current=!0,p.current.focus()),p.current=null)}}),[l]),e.useEffect((()=>{if(!l||!m.current)return;const e=Wl(m.current),t=t=>{v.current=t,!o&&s()&&"Tab"===t.key&&e.activeElement===m.current&&t.shiftKey&&(c.current=!0,d.current&&d.current.focus())},r=()=>{const t=m.current;if(null===t)return;if(!e.hasFocus()||!s()||c.current)return void(c.current=!1);if(t.contains(e.activeElement))return;if(o&&e.activeElement!==u.current&&e.activeElement!==d.current)return;if(e.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!h.current)return;let r=[];if(e.activeElement!==u.current&&e.activeElement!==d.current||(r=i(m.current)),r.length>0){const e=Boolean(v.current?.shiftKey&&"Tab"===v.current?.key),t=r[0],n=r[r.length-1];"string"!==typeof t&&"string"!==typeof n&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener("focusin",r),e.addEventListener("keydown",t,!0);const n=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&r()}),50);return()=>{clearInterval(n),e.removeEventListener("focusin",r),e.removeEventListener("keydown",t,!0)}}),[n,o,a,s,l,i]);const y=e=>{null===p.current&&(p.current=e.relatedTarget),h.current=!0};return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)("div",{tabIndex:l?0:-1,onFocus:y,ref:u,"data-testid":"sentinelStart"}),e.cloneElement(r,{ref:g,onFocus:e=>{null===p.current&&(p.current=e.relatedTarget),h.current=!0,f.current=e.target;const t=r.props.onFocus;t&&t(e)}}),(0,dt.jsx)("div",{tabIndex:l?0:-1,onFocus:y,ref:d,"data-testid":"sentinelEnd"})]})},rp={entering:{opacity:1},entered:{opacity:1}},np=e.forwardRef((function(t,r){const n=hl(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:i=!0,children:s,easing:l,in:c,onEnter:u,onEntered:d,onEntering:p,onExit:f,onExited:h,onExiting:m,style:g,timeout:v=o,TransitionComponent:y=Rl,...b}=t,x=e.useRef(null),w=Al(x,Bs(s),r),S=e=>t=>{if(e){const r=x.current;void 0===t?e(r):e(r,t)}},k=S(p),C=S(((e,t)=>{Ml(e);const r=Nl({style:g,timeout:v,easing:l},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),u&&u(e,t)})),j=S(d),$=S(m),E=S((e=>{const t=Nl({style:g,timeout:v,easing:l},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),f&&f(e)})),_=S(h);return(0,dt.jsx)(y,{appear:i,in:c,nodeRef:x,onEnter:C,onEntered:j,onEntering:k,onExit:E,onExited:_,onExiting:$,addEndListener:e=>{a&&a(x.current,e)},timeout:v,...b,children:(t,r)=>{let{ownerState:n,...o}=r;return e.cloneElement(s,{style:{opacity:0,visibility:"exited"!==t||c?void 0:"hidden",...rp[t],...g,...s.props.style},ref:w,...o})}})})),op=np;function ap(e){return vu("MuiBackdrop",e)}yu("MuiBackdrop",["root","invisible"]);const ip=dl("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),sp=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiBackdrop"}),{children:n,className:o,component:a="div",invisible:i=!1,open:s,components:l={},componentsProps:c={},slotProps:u={},slots:d={},TransitionComponent:p,transitionDuration:f,...h}=r,m={...r,component:a,invisible:i},g=(e=>{const{classes:t,invisible:r}=e;return zs({root:["root",r&&"invisible"]},ap,t)})(m),v={slots:{transition:p,root:l.Root,...d},slotProps:{...c,...u}},[y,b]=Iu("root",{elementType:ip,externalForwardedProps:v,className:Ns(g.root,o),ownerState:m}),[x,w]=Iu("transition",{elementType:op,externalForwardedProps:v,ownerState:m});return(0,dt.jsx)(x,{in:s,timeout:f,...h,...w,children:(0,dt.jsx)(y,{"aria-hidden":!0,...b,classes:g,ref:t,children:n})})})),lp=sp;function cp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(((e,t)=>null==t?e:function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n),t.apply(this,n)}),(()=>{}))}function up(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function dp(e){return parseInt(Bd(e).getComputedStyle(e).paddingRight,10)||0}function pp(e,t,r,n,o){const a=[t,r,...n];[].forEach.call(e.children,(e=>{const t=!a.includes(e),r=!function(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||r}(e);t&&r&&up(e,o)}))}function fp(e,t){let r=-1;return e.some(((e,n)=>!!t(e)&&(r=n,!0))),r}function hp(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(function(e){const t=Wl(e);return t.body===e?Bd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(n)){const e=Fd(Bd(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${dp(n)+e}px`;const t=Wl(n).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{r.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${dp(t)+e}px`}))}let e;if(n.parentNode instanceof DocumentFragment)e=Wl(n).body;else{const t=n.parentElement,r=Bd(n);e="HTML"===t?.nodeName&&"scroll"===r.getComputedStyle(t).overflowY?t:n}r.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{r.forEach((e=>{let{value:t,el:r,property:n}=e;t?r.style.setProperty(n,t):r.style.removeProperty(n)}))}}const mp=()=>{},gp=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&up(e.modalRef,!1);const n=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);pp(t,e.mount,e.modalRef,n,!0);const o=fp(this.containers,(e=>e.container===t));return-1!==o?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:n}),r)}mount(e,t){const r=fp(this.containers,(t=>t.modals.includes(e))),n=this.containers[r];n.restore||(n.restore=hp(n,t))}remove(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=this.modals.indexOf(e);if(-1===r)return r;const n=fp(this.containers,(t=>t.modals.includes(e))),o=this.containers[n];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),0===o.modals.length)o.restore&&o.restore(),e.modalRef&&up(e.modalRef,t),pp(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(n,1);else{const e=o.modals[o.modals.length-1];e.modalRef&&up(e.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};const vp=function(t){const{container:r,disableEscapeKeyDown:n=!1,disableScrollLock:o=!1,closeAfterTransition:a=!1,onTransitionEnter:i,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:d}=t,p=e.useRef({}),f=e.useRef(null),h=e.useRef(null),m=Tl(h,d),[g,v]=e.useState(!u),y=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let b=!0;"false"!==t["aria-hidden"]&&!1!==t["aria-hidden"]||(b=!1);const x=()=>(p.current.modalRef=h.current,p.current.mount=f.current,p.current),w=()=>{gp.mount(x(),{disableScrollLock:o}),h.current&&(h.current.scrollTop=0)},S=Eu((()=>{const e=function(e){return"function"===typeof e?e():e}(r)||Wl(f.current).body;gp.add(x(),e),h.current&&w()})),k=()=>gp.isTopModal(x()),C=Eu((e=>{f.current=e,e&&(u&&k()?w():h.current&&up(h.current,b))})),j=e.useCallback((()=>{gp.remove(x(),b)}),[b]);e.useEffect((()=>()=>{j()}),[j]),e.useEffect((()=>{u?S():y&&a||j()}),[u,j,y,a,S]);const $=e=>t=>{e.onKeyDown?.(t),"Escape"===t.key&&229!==t.which&&k()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},E=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=lu(t);delete r.onTransitionEnter,delete r.onTransitionExited;const n={...r,...e};return{role:"presentation",...n,onKeyDown:$(n),ref:m}},getBackdropProps:function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{"aria-hidden":!0,...e,onClick:E(e),open:u}},getTransitionProps:()=>({onEnter:cp((()=>{v(!1),i&&i()}),l?.props.onEnter??mp),onExited:cp((()=>{v(!0),s&&s(),a&&j()}),l?.props.onExited??mp)}),rootRef:m,portalRef:C,isTopModal:k,exited:g,hasTransition:y}};function yp(e){return vu("MuiModal",e)}yu("MuiModal",["root","hidden","backdrop"]);const bp=dl("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(gl((e=>{let{theme:t}=e;return{position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:e=>{let{ownerState:t}=e;return!t.open&&t.exited},style:{visibility:"hidden"}}]}}))),xp=dl(lp,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),wp=e.forwardRef((function(t,r){const n=vl({name:"MuiModal",props:t}),{BackdropComponent:o=xp,BackdropProps:a,classes:i,className:s,closeAfterTransition:l=!1,children:c,container:u,component:d,components:p={},componentsProps:f={},disableAutoFocus:h=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:g=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:b=!1,hideBackdrop:x=!1,keepMounted:w=!1,onBackdropClick:S,onClose:k,onTransitionEnter:C,onTransitionExited:j,open:$,slotProps:E={},slots:_={},theme:P,...O}=n,R={...n,closeAfterTransition:l,disableAutoFocus:h,disableEnforceFocus:m,disableEscapeKeyDown:g,disablePortal:v,disableRestoreFocus:y,disableScrollLock:b,hideBackdrop:x,keepMounted:w},{getRootProps:M,getBackdropProps:N,getTransitionProps:I,portalRef:T,isTopModal:A,exited:D,hasTransition:F}=vp({...R,rootRef:r}),z={...R,exited:D},L=(e=>{const{open:t,exited:r,classes:n}=e;return zs({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},yp,n)})(z),B={};if(void 0===c.props.tabIndex&&(B.tabIndex="-1"),F){const{onEnter:e,onExited:t}=I();B.onEnter=e,B.onExited=t}const W={slots:{root:p.Root,backdrop:p.Backdrop,..._},slotProps:{...f,...E}},[V,H]=Iu("root",{ref:r,elementType:bp,externalForwardedProps:{...W,...O,component:d},getSlotProps:M,ownerState:z,className:Ns(s,L?.root,!z.open&&z.exited&&L?.hidden)}),[U,q]=Iu("backdrop",{ref:a?.ref,elementType:o,externalForwardedProps:W,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:e=>N({...e,onClick:t=>{S&&S(t),e?.onClick&&e.onClick(t)}}),className:Ns(a?.className,L?.backdrop),ownerState:z});return w||$||F&&!D?(0,dt.jsx)(fu,{ref:T,container:u,disablePortal:v,children:(0,dt.jsxs)(V,{...H,children:[!x&&o?(0,dt.jsx)(U,{...q}):null,(0,dt.jsx)(tp,{disableEnforceFocus:m,disableAutoFocus:h,disableRestoreFocus:y,isEnabled:A,open:$,children:e.cloneElement(c,B)})]})}):null})),Sp=wp;function kp(e){return vu("MuiPaper",e)}yu("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Cp=dl("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,"elevation"===r.variant&&t[`elevation${r.elevation}`]]}})(gl((e=>{let{theme:t}=e;return{backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:e=>{let{ownerState:t}=e;return!t.square},style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}}))),jp=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiPaper"}),n=hl(),{className:o,component:a="div",elevation:i=1,square:s=!1,variant:l="elevation",...c}=r,u={...r,component:a,elevation:i,square:s,variant:l},d=(e=>{const{square:t,elevation:r,variant:n,classes:o}=e;return zs({root:["root",n,!t&&"rounded","elevation"===n&&`elevation${r}`]},kp,o)})(u);return(0,dt.jsx)(Cp,{as:a,ownerState:u,className:Ns(d.root,o),ref:t,...c,style:{..."elevation"===l&&{"--Paper-shadow":(n.vars||n).shadows[i],...n.vars&&{"--Paper-overlay":n.vars.overlays?.[i]},...!n.vars&&"dark"===n.palette.mode&&{"--Paper-overlay":`linear-gradient(${No("#fff",Ea(i))}, ${No("#fff",Ea(i))})`}},...c.style}})})),$p=jp;function Ep(e){return vu("MuiPopover",e)}yu("MuiPopover",["root","paper"]);function _p(e,t){if(!e)return t;if("function"===typeof e||"function"===typeof t)return r=>{const n="function"===typeof t?t(r):t,o="function"===typeof e?e({...r,...n}):e,a=Ns(r?.className,n?.className,o?.className);return{...n,...o,...!!a&&{className:a},...n?.style&&o?.style&&{style:{...n.style,...o.style}},...n?.sx&&o?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(o.sx)?o.sx:[o.sx]]}}};const r=t,n=Ns(r?.className,e?.className);return{...t,...e,...!!n&&{className:n},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function Pp(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.height/2:"bottom"===t&&(r=e.height),r}function Op(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.width/2:"right"===t&&(r=e.width),r}function Rp(e){return[e.horizontal,e.vertical].map((e=>"number"===typeof e?`${e}px`:e)).join(" ")}function Mp(e){return"function"===typeof e?e():e}const Np=dl(Sp,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Ip=dl($p,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Tp=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiPopover"}),{action:o,anchorEl:a,anchorOrigin:i={vertical:"top",horizontal:"left"},anchorPosition:s,anchorReference:l="anchorEl",children:c,className:u,container:d,elevation:p=8,marginThreshold:f=16,open:h,PaperProps:m={},slots:g={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:b,transitionDuration:x="auto",TransitionProps:w={},disableScrollLock:S=!1,...k}=n,C=e.useRef(),j={...n,anchorOrigin:i,anchorReference:l,elevation:p,marginThreshold:f,transformOrigin:y,TransitionComponent:b,transitionDuration:x,TransitionProps:w},$=(e=>{const{classes:t}=e;return zs({root:["root"],paper:["paper"]},Ep,t)})(j),E=e.useCallback((()=>{if("anchorPosition"===l)return s;const e=Mp(a),t=(e&&1===e.nodeType?e:Md(C.current).body).getBoundingClientRect();return{top:t.top+Pp(t,i.vertical),left:t.left+Op(t,i.horizontal)}}),[a,i.horizontal,i.vertical,s,l]),_=e.useCallback((e=>({vertical:Pp(e,y.vertical),horizontal:Op(e,y.horizontal)})),[y.horizontal,y.vertical]),P=e.useCallback((e=>{const t={width:e.offsetWidth,height:e.offsetHeight},r=_(t);if("none"===l)return{top:null,left:null,transformOrigin:Rp(r)};const n=E();let o=n.top-r.vertical,i=n.left-r.horizontal;const s=o+t.height,c=i+t.width,u=Wd(Mp(a)),d=u.innerHeight-f,p=u.innerWidth-f;if(null!==f&&o<f){const e=o-f;o-=e,r.vertical+=e}else if(null!==f&&s>d){const e=s-d;o-=e,r.vertical+=e}if(null!==f&&i<f){const e=i-f;i-=e,r.horizontal+=e}else if(c>p){const e=c-p;i-=e,r.horizontal+=e}return{top:`${Math.round(o)}px`,left:`${Math.round(i)}px`,transformOrigin:Rp(r)}}),[a,l,E,_,f]),[O,R]=e.useState(h),M=e.useCallback((()=>{const e=C.current;if(!e)return;const t=P(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,R(!0)}),[P]);e.useEffect((()=>(S&&window.addEventListener("scroll",M),()=>window.removeEventListener("scroll",M))),[a,S,M]);e.useEffect((()=>{h&&M()})),e.useImperativeHandle(o,(()=>h?{updatePosition:()=>{M()}}:null),[h,M]),e.useEffect((()=>{if(!h)return;const e=Yd((()=>{M()})),t=Wd(a);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[a,h,M]);let N=x;const I={slots:{transition:b,...g},slotProps:{transition:w,paper:m,...v}},[T,A]=Iu("transition",{elementType:Bl,externalForwardedProps:I,ownerState:j,getSlotProps:e=>({...e,onEntering:(t,r)=>{e.onEntering?.(t,r),M()},onExited:t=>{e.onExited?.(t),R(!1)}}),additionalProps:{appear:!0,in:h}});"auto"!==x||T.muiSupportAuto||(N=void 0);const D=d||(a?Md(Mp(a)).body:void 0),[F,{slots:z,slotProps:L,...B}]=Iu("root",{ref:r,elementType:Np,externalForwardedProps:{...I,...k},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:g.backdrop},slotProps:{backdrop:_p("function"===typeof v.backdrop?v.backdrop(j):v.backdrop,{invisible:!0})},container:D,open:h},ownerState:j,className:Ns($.root,u)}),[W,V]=Iu("paper",{ref:C,className:$.paper,elementType:Ip,externalForwardedProps:I,shouldForwardComponentProp:!0,additionalProps:{elevation:p,style:O?void 0:{opacity:0}},ownerState:j});return(0,dt.jsx)(F,{...B,...!Qd(F)&&{slots:z,slotProps:L,disableScrollLock:S},children:(0,dt.jsx)(T,{...A,timeout:N,children:(0,dt.jsx)(W,{...V,children:c})})})})),Ap=Tp;function Dp(e){return vu("MuiMenu",e)}yu("MuiMenu",["root","paper","list"]);const Fp={vertical:"top",horizontal:"right"},zp={vertical:"top",horizontal:"left"},Lp=dl(Ap,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Bp=dl(Ip,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Wp=dl(Kd,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),Vp=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:a,className:i,disableAutoFocusItem:s=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:d={},PopoverClasses:p,transitionDuration:f="auto",TransitionProps:{onEntering:h,...m}={},variant:g="selectedMenu",slots:v={},slotProps:y={},...b}=n,x=Hr(),w={...n,autoFocus:o,disableAutoFocusItem:s,MenuListProps:l,onEntering:h,PaperProps:d,transitionDuration:f,TransitionProps:m,variant:g},S=(e=>{const{classes:t}=e;return zs({root:["root"],paper:["paper"],list:["list"]},Dp,t)})(w),k=o&&!s&&u,C=e.useRef(null);let j=-1;e.Children.map(a,((t,r)=>{e.isValidElement(t)&&(t.props.disabled||("selectedMenu"===g&&t.props.selected||-1===j)&&(j=r))}));const $={slots:v,slotProps:{list:l,transition:m,paper:d,...y}},E=pu({elementType:v.root,externalSlotProps:y.root,ownerState:w,className:[S.root,i]}),[_,P]=Iu("paper",{className:S.paper,elementType:Bp,externalForwardedProps:$,shouldForwardComponentProp:!0,ownerState:w}),[O,R]=Iu("list",{className:Ns(S.list,l.className),elementType:Wp,shouldForwardComponentProp:!0,externalForwardedProps:$,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{"Tab"===e.key&&(e.preventDefault(),c&&c(e,"tabKeyDown"))})(t),e.onKeyDown?.(t)}}),ownerState:w}),M="function"===typeof $.slotProps.transition?$.slotProps.transition(w):$.slotProps.transition;return(0,dt.jsx)(Lp,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:x?"right":"left"},transformOrigin:x?Fp:zp,slots:{root:v.root,paper:_,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:E,paper:P,backdrop:"function"===typeof y.backdrop?y.backdrop(w):y.backdrop,transition:{...M,onEntering:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];((e,t)=>{C.current&&C.current.adjustStyleForScrollbar(e,{direction:x?"rtl":"ltr"}),h&&h(e,t)})(...t),M?.onEntering?.(...t)}}},open:u,ref:r,transitionDuration:f,ownerState:w,...b,classes:p,children:(0,dt.jsx)(O,{actions:C,autoFocus:o&&(-1===j||s),autoFocusItem:k,variant:g,...R,children:a})})})),Hp=Vp;function Up(e){return vu("MuiDivider",e)}const qp=yu("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function Gp(e){return vu("MuiListItemIcon",e)}const Kp=yu("MuiListItemIcon",["root","alignItemsFlexStart"]);function Qp(e){return vu("MuiListItemText",e)}const Jp=yu("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function Yp(e){return vu("MuiMenuItem",e)}const Xp=yu("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Zp=dl(hd,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]}})(gl((e=>{let{theme:t}=e;return{...t.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Xp.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Xp.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Xp.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Xp.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Xp.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${qp.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${qp.inset}`]:{marginLeft:52},[`& .${Jp.root}`]:{marginTop:0,marginBottom:0},[`& .${Jp.inset}`]:{paddingLeft:36},[`& .${Kp.root}`]:{minWidth:36},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableGutters},style:{paddingLeft:16,paddingRight:16}},{props:e=>{let{ownerState:t}=e;return t.divider},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:e=>{let{ownerState:t}=e;return!t.dense},style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:e=>{let{ownerState:t}=e;return t.dense},style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${Kp.root} svg`]:{fontSize:"1.25rem"}}}]}}))),ef=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:a="li",dense:i=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:p,...f}=n,h=e.useContext(Nd),m=e.useMemo((()=>({dense:i||h.dense||!1,disableGutters:l})),[h.dense,i,l]),g=e.useRef(null);Ld((()=>{o&&g.current&&g.current.focus()}),[o]);const v={...n,dense:m.dense,divider:s,disableGutters:l},y=(e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:a,classes:i}=e,s=zs({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",a&&"selected"]},Yp,i);return{...i,...s}})(n),b=Al(g,r);let x;return n.disabled||(x=void 0!==d?d:-1),(0,dt.jsx)(Nd.Provider,{value:m,children:(0,dt.jsx)(Zp,{ref:b,role:u,tabIndex:x,component:a,focusVisibleClassName:Ns(y.focusVisible,c),className:Ns(y.root,p),...f,ownerState:v,classes:y})})})),tf=ef,rf=dl("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"flex-start"===r.alignItems&&t.alignItemsFlexStart]}})(gl((e=>{let{theme:t}=e;return{minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}}))),nf=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemIcon"}),{className:o,...a}=n,i=e.useContext(Nd),s={...n,alignItems:i.alignItems},l=(e=>{const{alignItems:t,classes:r}=e;return zs({root:["root","flex-start"===t&&"alignItemsFlexStart"]},Gp,r)})(s);return(0,dt.jsx)(rf,{className:Ns(l.root,o),ownerState:s,ref:r,...a})})),of=nf;function af(e){return vu("MuiTypography",e)}const sf=yu("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),lf=e=>{const t={systemProps:{},otherProps:{}},r=e?.theme?.unstable_sxConfig??so;return Object.keys(e).forEach((n=>{r[n]?t.systemProps[n]=e[n]:t.otherProps[n]=e[n]})),t};function cf(e){const{sx:t,...r}=e,{systemProps:n,otherProps:o}=lf(r);let a;return a=Array.isArray(t)?[n,...t]:"function"===typeof t?function(){const e=t(...arguments);return on(e)?{...n,...e}:n}:{...n,...t},{...o,sx:a}}const uf=function(e){let{styles:t,themeId:r,defaultTheme:n={}}=e;const o=fl(n),a="function"===typeof t?t(r&&o[r]||o):t;return(0,dt.jsx)(mo,{styles:a})};const df=function(e){return(0,dt.jsx)(uf,{...e,defaultTheme:sl,themeId:Zr})};const pf={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},ff=cf,hf=dl("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${yl(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(gl((e=>{let{theme:t}=e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter((e=>{let[t,r]=e;return"inherit"!==t&&r&&"object"===typeof r})).map((e=>{let[t,r]=e;return{props:{variant:t},style:r}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette?.text||{}).filter((e=>{let[,t]=e;return"string"===typeof t})).map((e=>{let[r]=e;return{props:{color:`text${yl(r)}`},style:{color:(t.vars||t).palette.text[r]}}})),{props:e=>{let{ownerState:t}=e;return"inherit"!==t.align},style:{textAlign:"var(--Typography-textAlign)"}},{props:e=>{let{ownerState:t}=e;return t.noWrap},style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:e=>{let{ownerState:t}=e;return t.gutterBottom},style:{marginBottom:"0.35em"}},{props:e=>{let{ownerState:t}=e;return t.paragraph},style:{marginBottom:16}}]}}))),mf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},gf=e.forwardRef((function(e,t){const{color:r,...n}=vl({props:e,name:"MuiTypography"}),o=ff({...n,...!pf[r]&&{color:r}}),{align:a="inherit",className:i,component:s,gutterBottom:l=!1,noWrap:c=!1,paragraph:u=!1,variant:d="body1",variantMapping:p=mf,...f}=o,h={...o,align:a,color:r,className:i,component:s,gutterBottom:l,noWrap:c,paragraph:u,variant:d,variantMapping:p},m=s||(u?"p":p[d]||mf[d])||"span",g=(e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:a,classes:i}=e;return zs({root:["root",a,"inherit"!==e.align&&`align${yl(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]},af,i)})(h);return(0,dt.jsx)(hf,{as:m,ref:t,className:Ns(g.root,i),...f,ownerState:h,style:{..."inherit"!==a&&{"--Typography-textAlign":a},...f.style}})})),vf=gf,yf=dl("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Jp.primary}`]:t.primary},{[`& .${Jp.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${sf.root}:where(& .${Jp.primary})`]:{display:"block"},[`.${sf.root}:where(& .${Jp.secondary})`]:{display:"block"},variants:[{props:e=>{let{ownerState:t}=e;return t.primary&&t.secondary},style:{marginTop:6,marginBottom:6}},{props:e=>{let{ownerState:t}=e;return t.inset},style:{paddingLeft:56}}]}),bf=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemText"}),{children:o,className:a,disableTypography:i=!1,inset:s=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d,slots:p={},slotProps:f={},...h}=n,{dense:m}=e.useContext(Nd);let g=null!=l?l:o,v=u;const y={...n,disableTypography:i,inset:s,primary:!!g,secondary:!!v,dense:m},b=(e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:a}=e;return zs({root:["root",r&&"inset",a&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},Qp,t)})(y),x={slots:p,slotProps:{primary:c,secondary:d,...f}},[w,S]=Iu("primary",{className:b.primary,elementType:vf,externalForwardedProps:x,ownerState:y}),[k,C]=Iu("secondary",{className:b.secondary,elementType:vf,externalForwardedProps:x,ownerState:y});return null==g||g.type===vf||i||(g=(0,dt.jsx)(w,{variant:m?"body2":"body1",component:S?.variant?void 0:"span",...S,children:g})),null==v||v.type===vf||i||(v=(0,dt.jsx)(k,{variant:"body2",color:"textSecondary",...C,children:v})),(0,dt.jsxs)(yf,{className:Ns(b.root,a),ownerState:y,ref:r,...h,children:[g,v]})})),xf=bf,wf=dl("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(gl((e=>{let{theme:t}=e;return{margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:No(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:e=>{let{ownerState:t}=e;return!!t.children},style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:e=>{let{ownerState:t}=e;return t.children&&"vertical"!==t.orientation},style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"vertical"===t.orientation&&t.children},style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"right"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:e=>{let{ownerState:t}=e;return"left"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}}))),Sf=dl("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(gl((e=>{let{theme:t}=e;return{display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}}))),kf=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiDivider"}),{absolute:n=!1,children:o,className:a,orientation:i="horizontal",component:s=(o||"vertical"===i?"div":"hr"),flexItem:l=!1,light:c=!1,role:u=("hr"!==s?"separator":void 0),textAlign:d="center",variant:p="fullWidth",...f}=r,h={...r,absolute:n,component:s,flexItem:l,light:c,orientation:i,role:u,textAlign:d,variant:p},m=(e=>{const{absolute:t,children:r,classes:n,flexItem:o,light:a,orientation:i,textAlign:s,variant:l}=e;return zs({root:["root",t&&"absolute",l,a&&"light","vertical"===i&&"vertical",o&&"flexItem",r&&"withChildren",r&&"vertical"===i&&"withChildrenVertical","right"===s&&"vertical"!==i&&"textAlignRight","left"===s&&"vertical"!==i&&"textAlignLeft"],wrapper:["wrapper","vertical"===i&&"wrapperVertical"]},Up,n)})(h);return(0,dt.jsx)(wf,{as:s,className:Ns(m.root,a),role:u,ref:t,ownerState:h,"aria-orientation":"separator"!==u||"hr"===s&&"vertical"!==i?void 0:i,...f,children:o?(0,dt.jsx)(Sf,{className:m.wrapper,ownerState:h,children:o}):null})}));kf&&(kf.muiSkipListHighlight=!0);const Cf=kf;function jf(e){return vu("MuiSvgIcon",e)}yu("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const $f=dl("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${yl(r.color)}`],t[`fontSize${yl(r.fontSize)}`]]}})(gl((e=>{let{theme:t}=e;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:t.transitions?.create?.("fill",{duration:(t.vars??t).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:t.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:t.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter((e=>{let[,t]=e;return t&&t.main})).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars??t).palette?.[r]?.main}}})),{props:{color:"action"},style:{color:(t.vars??t).palette?.action?.active}},{props:{color:"disabled"},style:{color:(t.vars??t).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}}))),Ef=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiSvgIcon"}),{children:o,className:a,color:i="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:d,viewBox:p="0 0 24 24",...f}=n,h=e.isValidElement(o)&&"svg"===o.type,m={...n,color:i,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:p,hasSvgAsChild:h},g={};u||(g.viewBox=p);const v=(e=>{const{color:t,fontSize:r,classes:n}=e;return zs({root:["root","inherit"!==t&&`color${yl(t)}`,`fontSize${yl(r)}`]},jf,n)})(m);return(0,dt.jsxs)($f,{as:s,className:Ns(v.root,a),focusable:"false",color:c,"aria-hidden":!d||void 0,role:d?"img":void 0,ref:r,...g,...f,...h&&o.props,ownerState:m,children:[h?o.props.children:o,d?(0,dt.jsx)("title",{children:d}):null]})}));Ef.muiName="SvgIcon";const _f=Ef;function Pf(t,r){function n(e,n){return(0,dt.jsx)(_f,{"data-testid":`${r}Icon`,ref:n,...e,children:t})}return n.muiName=_f.muiName,e.memo(e.forwardRef(n))}const Of=Pf((0,dt.jsx)("path",{d:"m12 16.5 4-4h-3v-9h-2v9H8zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2"}),"SystemUpdateAlt"),Rf=Pf((0,dt.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt"),Mf=Pf((0,dt.jsx)("path",{d:"M13 3h-2v10h2zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83"}),"PowerSettingsNew"),Nf=Pf((0,dt.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),If=Pf((0,dt.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save"),Tf=Pf((0,dt.jsx)("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),Af=Pf((0,dt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),Df=Pf((0,dt.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H5.17L4 17.17V4h16zM11 5h2v6h-2zm0 8h2v2h-2z"}),"AnnouncementOutlined"),Ff=Pf((0,dt.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"ReportProblem"),zf=Pf((0,dt.jsx)("path",{d:"m16 5-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2"}),"IosShare"),Lf=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");function Bf(e,t,r){const n=t.replace(/\\/g,"*");tM&&console.log("sendCommandToMatterbridge:",e,t,n),fetch(`./api/command/${e}/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},body:r}).then((e=>{if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return e.json()})).then((e=>{tM&&console.log("Command sent successfully:",e)})).catch((e=>{console.error("Error sending command:",e)}))}const Wf=yu("MuiBox",["root"]),Vf=Ba(),Hf=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:r,defaultTheme:n,defaultClassName:o="MuiBox-root",generateClassName:a}=t,i=Js("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(co);return e.forwardRef((function(e,t){const s=fl(n),{className:l,component:c="div",...u}=cf(e);return(0,dt.jsx)(i,{as:c,ref:t,className:Ns(l,a?a(o):o),theme:r&&s[r]||s,...u})}))}({themeId:Zr,defaultTheme:Vf,defaultClassName:Wf.root,generateClassName:mu.generate}),Uf=Hf;function qf(e){return vu("MuiAlert",e)}const Gf=yu("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),Kf=Pf((0,dt.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Qf=Pf((0,dt.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Jf=Pf((0,dt.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Yf=Pf((0,dt.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Xf=Pf((0,dt.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Zf=dl($p,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${yl(r.color||r.severity)}`]]}})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?To:Do,n="light"===t.palette.mode?Do:To;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(qu(["light"])).map((e=>{let[o]=e;return{props:{colorSeverity:o,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${o}Color`]:r(t.palette[o].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${o}StandardBg`]:n(t.palette[o].light,.9),[`& .${Gf.icon}`]:t.vars?{color:t.vars.palette.Alert[`${o}IconColor`]}:{color:t.palette[o].main}}}})),...Object.entries(t.palette).filter(qu(["light"])).map((e=>{let[n]=e;return{props:{colorSeverity:n,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${n}Color`]:r(t.palette[n].light,.6),border:`1px solid ${(t.vars||t).palette[n].light}`,[`& .${Gf.icon}`]:t.vars?{color:t.vars.palette.Alert[`${n}IconColor`]}:{color:t.palette[n].main}}}})),...Object.entries(t.palette).filter(qu(["dark"])).map((e=>{let[r]=e;return{props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:"dark"===t.palette.mode?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}}))]}}))),eh=dl("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),th=dl("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),rh=dl("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),nh={success:(0,dt.jsx)(Kf,{fontSize:"inherit"}),warning:(0,dt.jsx)(Qf,{fontSize:"inherit"}),error:(0,dt.jsx)(Jf,{fontSize:"inherit"}),info:(0,dt.jsx)(Yf,{fontSize:"inherit"})},oh=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiAlert"}),{action:n,children:o,className:a,closeText:i="Close",color:s,components:l={},componentsProps:c={},icon:u,iconMapping:d=nh,onClose:p,role:f="alert",severity:h="success",slotProps:m={},slots:g={},variant:v="standard",...y}=r,b={...r,color:s,severity:h,variant:v,colorSeverity:s||h},x=(e=>{const{variant:t,color:r,severity:n,classes:o}=e;return zs({root:["root",`color${yl(r||n)}`,`${t}${yl(r||n)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},qf,o)})(b),w={slots:{closeButton:l.CloseButton,closeIcon:l.CloseIcon,...g},slotProps:{...c,...m}},[S,k]=Iu("root",{ref:t,shouldForwardComponentProp:!0,className:Ns(x.root,a),elementType:Zf,externalForwardedProps:{...w,...y},ownerState:b,additionalProps:{role:f,elevation:0}}),[C,j]=Iu("icon",{className:x.icon,elementType:eh,externalForwardedProps:w,ownerState:b}),[$,E]=Iu("message",{className:x.message,elementType:th,externalForwardedProps:w,ownerState:b}),[_,P]=Iu("action",{className:x.action,elementType:rh,externalForwardedProps:w,ownerState:b}),[O,R]=Iu("closeButton",{elementType:Rd,externalForwardedProps:w,ownerState:b}),[M,N]=Iu("closeIcon",{elementType:Xf,externalForwardedProps:w,ownerState:b});return(0,dt.jsxs)(S,{...k,children:[!1!==u?(0,dt.jsx)(C,{...j,children:u||d[h]||nh[h]}):null,(0,dt.jsx)($,{...E,children:o}),null!=n?(0,dt.jsx)(_,{...P,children:n}):null,null==n&&p?(0,dt.jsx)(_,{...P,children:(0,dt.jsx)(O,{size:"small","aria-label":i,title:i,color:"inherit",onClick:p,...R,children:(0,dt.jsx)(M,{fontSize:"small",...N})})}):null]})})),ah=oh,ih=Pf((0,dt.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function sh(e){return vu("MuiDialog",e)}const lh=yu("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);const ch=e.createContext({}),uh=dl(lp,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),dh=dl(Sp,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),ph=dl("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.container,t[`scroll${yl(r.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),fh=dl($p,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`scrollPaper${yl(r.scroll)}`],t[`paperWidth${yl(String(r.maxWidth))}`],r.fullWidth&&t.paperFullWidth,r.fullScreen&&t.paperFullScreen]}})(gl((e=>{let{theme:t}=e;return{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:e=>{let{ownerState:t}=e;return!t.maxWidth},style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===t.breakpoints.unit?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${lh.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter((e=>"xs"!==e)).map((e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${lh.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+64)]:{maxWidth:"calc(100% - 64px)"}}}}))),{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"calc(100% - 64px)"}},{props:e=>{let{ownerState:t}=e;return t.fullScreen},style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${lh.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}}))),hh=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiDialog"}),o=hl(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":s,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:d,className:p,disableEscapeKeyDown:f=!1,fullScreen:h=!1,fullWidth:m=!1,maxWidth:g="sm",onBackdropClick:v,onClick:y,onClose:b,open:x,PaperComponent:w=$p,PaperProps:S={},scroll:k="paper",slots:C={},slotProps:j={},TransitionComponent:$=op,transitionDuration:E=a,TransitionProps:_,...P}=n,O={...n,disableEscapeKeyDown:f,fullScreen:h,fullWidth:m,maxWidth:g,scroll:k},R=(e=>{const{classes:t,scroll:r,maxWidth:n,fullWidth:o,fullScreen:a}=e;return zs({root:["root"],container:["container",`scroll${yl(r)}`],paper:["paper",`paperScroll${yl(r)}`,`paperWidth${yl(String(n))}`,o&&"paperFullWidth",a&&"paperFullScreen"]},sh,t)})(O),M=e.useRef(),N=Ru(s),I=e.useMemo((()=>({titleId:N})),[N]),T={slots:{transition:$,...C},slotProps:{transition:_,paper:S,backdrop:u,...j}},[A,D]=Iu("root",{elementType:dh,shouldForwardComponentProp:!0,externalForwardedProps:T,ownerState:O,className:Ns(R.root,p),ref:r}),[F,z]=Iu("backdrop",{elementType:uh,shouldForwardComponentProp:!0,externalForwardedProps:T,ownerState:O}),[L,B]=Iu("paper",{elementType:fh,shouldForwardComponentProp:!0,externalForwardedProps:T,ownerState:O,className:Ns(R.paper,S.className)}),[W,V]=Iu("container",{elementType:ph,externalForwardedProps:T,ownerState:O,className:Ns(R.container)}),[H,U]=Iu("transition",{elementType:op,externalForwardedProps:T,ownerState:O,additionalProps:{appear:!0,in:x,timeout:E,role:"presentation"}});return(0,dt.jsx)(A,{closeAfterTransition:!0,slots:{backdrop:F},slotProps:{backdrop:{transitionDuration:E,as:c,...z}},disableEscapeKeyDown:f,onClose:b,open:x,onClick:e=>{y&&y(e),M.current&&(M.current=null,v&&v(e),b&&b(e,"backdropClick"))},...D,...P,children:(0,dt.jsx)(H,{...U,children:(0,dt.jsx)(W,{onMouseDown:e=>{M.current=e.target===e.currentTarget},...V,children:(0,dt.jsx)(L,{as:w,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":N,"aria-modal":l,...B,children:(0,dt.jsx)(ch.Provider,{value:I,children:d})})})})})})),mh=hh;function gh(e){return vu("MuiDialogTitle",e)}const vh=yu("MuiDialogTitle",["root"]),yh=dl(vf,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),bh=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiDialogTitle"}),{className:o,id:a,...i}=n,s=n,l=(e=>{const{classes:t}=e;return zs({root:["root"]},gh,t)})(s),{titleId:c=a}=e.useContext(ch);return(0,dt.jsx)(yh,{component:"h2",className:Ns(l.root,o),ownerState:s,ref:r,variant:"h6",id:a??c,...i})})),xh=bh;function wh(e){return vu("MuiDialogContent",e)}yu("MuiDialogContent",["root","dividers"]);const Sh=dl("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dividers&&t.dividers]}})(gl((e=>{let{theme:t}=e;return{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:e=>{let{ownerState:t}=e;return t.dividers},style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return!t.dividers},style:{[`.${vh.root} + &`]:{paddingTop:0}}}]}}))),kh=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiDialogContent"}),{className:n,dividers:o=!1,...a}=r,i={...r,dividers:o},s=(e=>{const{classes:t,dividers:r}=e;return zs({root:["root",r&&"dividers"]},wh,t)})(i);return(0,dt.jsx)(Sh,{className:Ns(s.root,n),ownerState:i,ref:t,...a})})),Ch=kh;function jh(e){return vu("MuiButton",e)}const $h=yu("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);const Eh=e.createContext({});const _h=e.createContext(void 0),Ph=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Oh=dl(hd,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${yl(r.color)}`],t[`size${yl(r.size)}`],t[`${r.variant}Size${yl(r.size)}`],"inherit"===r.color&&t.colorInherit,r.disableElevation&&t.disableElevation,r.fullWidth&&t.fullWidth,r.loading&&t.loading]}})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?t.palette.grey[300]:t.palette.grey[800],n="light"===t.palette.mode?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${$h.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${$h.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${$h.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${$h.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:No(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity)}}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:r,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${$h.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${$h.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${$h.loading}`]:{color:"transparent"}}}]}}))),Rh=dl("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.startIcon,r.loading&&t.startIconLoadingStart,t[`iconSize${yl(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Ph]}})),Mh=dl("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.endIcon,r.loading&&t.endIconLoadingEnd,t[`iconSize${yl(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Ph]}})),Nh=dl("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(t.vars||t).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]}})),Ih=dl("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Th=e.forwardRef((function(t,r){const n=e.useContext(Eh),o=e.useContext(_h),a=vl({props:qr(n,t),name:"MuiButton"}),{children:i,color:s="primary",component:l="button",className:c,disabled:u=!1,disableElevation:d=!1,disableFocusRipple:p=!1,endIcon:f,focusVisibleClassName:h,fullWidth:m=!1,id:g,loading:v=null,loadingIndicator:y,loadingPosition:b="center",size:x="medium",startIcon:w,type:S,variant:k="text",...C}=a,j=Mu(g),$=y??(0,dt.jsx)(jd,{"aria-labelledby":j,color:"inherit",size:16}),E={...a,color:s,component:l,disabled:u,disableElevation:d,disableFocusRipple:p,fullWidth:m,loading:v,loadingIndicator:$,loadingPosition:b,size:x,type:S,variant:k},_=(e=>{const{color:t,disableElevation:r,fullWidth:n,size:o,variant:a,loading:i,loadingPosition:s,classes:l}=e,c=zs({root:["root",i&&"loading",a,`${a}${yl(t)}`,`size${yl(o)}`,`${a}Size${yl(o)}`,`color${yl(t)}`,r&&"disableElevation",n&&"fullWidth",i&&`loadingPosition${yl(s)}`],startIcon:["icon","startIcon",`iconSize${yl(o)}`],endIcon:["icon","endIcon",`iconSize${yl(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},jh,l);return{...l,...c}})(E),P=(w||v&&"start"===b)&&(0,dt.jsx)(Rh,{className:_.startIcon,ownerState:E,children:w||(0,dt.jsx)(Ih,{className:_.loadingIconPlaceholder,ownerState:E})}),O=(f||v&&"end"===b)&&(0,dt.jsx)(Mh,{className:_.endIcon,ownerState:E,children:f||(0,dt.jsx)(Ih,{className:_.loadingIconPlaceholder,ownerState:E})}),R=o||"",M="boolean"===typeof v?(0,dt.jsx)("span",{className:_.loadingWrapper,style:{display:"contents"},children:v&&(0,dt.jsx)(Nh,{className:_.loadingIndicator,ownerState:E,children:$})}):null;return(0,dt.jsxs)(Oh,{ownerState:E,className:Ns(n.className,_.root,c,R),component:l,disabled:u||v,focusRipple:!p,focusVisibleClassName:Ns(_.focusVisible,h),ref:r,type:S,id:v?j:g,...C,classes:_,children:[P,"end"!==b&&M,i,"end"===b&&M,O]})})),Ah=Th;function Dh(e){let{open:t,title:r,message:n,onConfirm:o,onCancel:a}=e;return(0,dt.jsxs)(mh,{open:t,children:[(0,dt.jsx)(xh,{gap:"20px",children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h4",{style:{margin:0},children:r})]})}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",margin:"0",marginBottom:"20px",maxHeight:"350px",maxWidth:"350px"},children:(0,dt.jsx)("p",{style:{flex:1,margin:"0"},children:n})}),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around"},children:[(0,dt.jsx)(Ah,{onClick:e=>{tM&&console.log("Confirmed"),e.preventDefault(),o()},variant:"contained",color:"primary",size:"small",children:"Confirm"}),(0,dt.jsx)(Ah,{onClick:e=>{tM&&console.log("Canceled"),e.preventDefault(),a()},variant:"contained",color:"primary",size:"small",children:"Cancel"})]})]})]})}const Fh=(0,e.createContext)();function zh(t){let{children:r}=t;const{enqueueSnackbar:n,closeSnackbar:o}=Rs(),a=(0,e.useCallback)(((e,t,r)=>{tM&&console.log(`UiProvider showSnackbarMessage: message ${e} timeout ${t}`),n(e,{variant:"default",autoHideDuration:null===t||void 0===t||t>0?1e3*(null!==t&&void 0!==t?t:5):null,persist:0===t,dense:!0,content:t=>(0,dt.jsx)(Uf,{sx:{margin:"0",padding:"0",width:"300px",marginRight:"30px"},children:(0,dt.jsx)(ah,{severity:null!==r&&void 0!==r?r:"info",variant:"filled",sx:{color:"#fff",fontWeight:"normal",width:"100%",cursor:"pointer",padding:"2px 10px"},onClick:()=>o(t),action:(0,dt.jsx)(Rd,{size:"small",onClick:()=>o(t),sx:{color:"#fff"},children:(0,dt.jsx)(ih,{fontSize:"small"})}),children:e},t)},t)})}),[]),[i,s]=(0,e.useState)(!1),[l,c]=(0,e.useState)(""),[u,d]=(0,e.useState)(""),[p,f]=(0,e.useState)(""),h=(0,e.useRef)(null),m=(0,e.useRef)(null),g=(0,e.useCallback)(((e,t,r,n,o)=>{tM&&console.log(`UiProvider showConfirmCancelDialog for command ${r}`),c(e),d(t),f(r),h.current=n,m.current=o,s(!0)}),[]),v=(0,e.useMemo)((()=>({showSnackbarMessage:a,closeSnackbar:o,showConfirmCancelDialog:g})),[a]);return(0,dt.jsxs)(Fh.Provider,{value:v,children:[(0,dt.jsx)(Dh,{open:i,title:l,message:u,onConfirm:()=>{tM&&console.log(`UiProvider handle confirm action ${p}`),s(!1),h.current&&h.current(p)},onCancel:()=>{tM&&console.log(`UiProvider handle cancel action ${p}`),s(!1),m.current&&m.current(p)}}),r]})}const Lh=0,Bh=1,Wh=2,Vh=3,Hh=4,Uh=6,qh=100,Gh=101,Kh=(0,e.createContext)(),Qh=(0,e.createContext)();function Jh(t){var r,n;let{children:o}=t;const[a,i]=(0,e.useState)(null!==(r=localStorage.getItem("logFilterLevel"))&&void 0!==r?r:"info"),[s,l]=(0,e.useState)(null!==(n=localStorage.getItem("logFilterSearch"))&&void 0!==n?n:"*"),[c,u]=(0,e.useState)([]),[d,p]=(0,e.useState)(1e3),[f,h]=(0,e.useState)(!0),[m,g]=(0,e.useState)(!1),{showSnackbarMessage:v,closeSnackbar:y}=(0,e.useContext)(Fh),b=(0,e.useRef)([]),x=(0,e.useRef)(null),w=(0,e.useRef)(1),S=(0,e.useRef)(Math.floor(999e3*Math.random())+1e3),k=(0,e.useRef)(null),C=(0,e.useRef)(null),j=(0,e.useRef)(null),$=(0,e.useRef)(a),E=(0,e.useRef)(s),_=(0,e.useMemo)((()=>window.location.href.replace(/^http/,"ws")),[]),P=(0,e.useMemo)((()=>window.location.href.includes("api/hassio_ingress")),[]),O=100;(0,e.useEffect)((()=>{$.current=a}),[a]),(0,e.useEffect)((()=>{E.current=s}),[s]);const R=(0,e.useCallback)((()=>Math.floor(999e3*Math.random())+1e3),[]),M=(0,e.useCallback)((e=>{if(x.current&&x.current.readyState===WebSocket.OPEN)try{void 0===e.id&&(e.id=S.current);const t=JSON.stringify(e);x.current.send(t),tM&&console.log("WebSocket sent message:",e)}catch(t){tM&&console.error(`WebSocket error sending message: ${t}`)}else tM&&console.error("WebSocket message not sent, WebSocket not connected:",e)}),[]),N=(0,e.useCallback)(((e,t)=>{const r=`<span style="background-color: #5c0e91; color: white; padding: 1px 5px; font-size: 12px; border-radius: 3px;">${e}</span>`;u((e=>[...e,r+' <span style="color: var(--main-log-color);">'+t+"</span>"]))}),[]),I=(0,e.useCallback)(((e,t)=>{i(e),l(t),N("WebSocket",`Filtering by log level "${e}" and log search "${t}"`)}),[N]),T=(0,e.useCallback)((e=>{tM&&console.log("WebSocket addListener:",e),b.current=[...b.current,e],tM&&console.log("WebSocket addListener total listeners:",b.current.length)}),[]),A=(0,e.useCallback)((e=>{tM&&console.log("WebSocket removeListener:",e),b.current=b.current.filter((t=>t!==e)),tM&&console.log("WebSocket removeListener total listeners:",b.current.length)}),[]),D=(0,e.useCallback)((()=>{""!==_&&null!==_&&void 0!==_&&(N("WebSocket",`Connecting to WebSocket: ${_}`),x.current=new WebSocket(_),x.current.onmessage=e=>{m||g(!0);try{const t=JSON.parse(e.data);if(t.error&&tM&&console.error("WebSocket error message:",t),void 0===t.id)return;if(t.id===Bh)return tM&&console.log("WebSocket WS_ID_REFRESH_NEEDED message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Wh)return tM&&console.log("WebSocket WS_ID_RESTART_NEEDED message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Vh)return tM&&console.log("WebSocket WS_ID_CPU_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Hh)return tM&&console.log("WebSocket WS_ID_MEMORY_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Uh)return tM&&console.log("WebSocket WS_ID_SNACKBAR message:",t,"listeners:",b.current.length),void v(t.params.message,t.params.timeout,t.params.severity);if(t.id===qh)return tM&&console.log("WebSocket WS_ID_SHELLY_SYS_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===Gh)return tM&&console.log("WebSocket WS_ID_SHELLY_MAIN_UPDATE message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id===S.current&&"Matterbridge"===t.src&&"Frontend"===t.dst&&"pong"===t.response)return tM&&console.log("WebSocket pong response message:",t,"listeners:",b.current.length),clearTimeout(C.current),void b.current.forEach((e=>e(t)));if(t.id!==Lh)return tM&&console.log("WebSocket message:",t,"listeners:",b.current.length),void b.current.forEach((e=>e(t)));if(t.id!==Lh||!t.level||!t.time||!t.name||!t.message)return;if(["debug","info","notice","warn","error","fatal"].includes(t.level)){if("info"===$.current&&"debug"===t.level)return;if("notice"===$.current&&("debug"===t.level||"info"===t.level))return;if("warn"===$.current&&("debug"===t.level||"info"===t.level||"notice"===t.level))return;if("error"===$.current&&("debug"===t.level||"info"===t.level||"notice"===t.level||"warn"===t.level))return;if("fatal"===$.current&&("debug"===t.level||"info"===t.level||"notice"===t.level||"warn"===t.level||"error"===t.level))return}if("*"!==E.current&&""!==E.current&&!t.message.toLowerCase().includes(E.current.toLowerCase())&&!t.name.toLowerCase().includes(E.current.toLowerCase()))return;if("Commissioning"===t.name&&t.message.includes("is uncommissioned"))return;u((e=>{const r=`<span style="color: #505050;">[${t.time}]</span>`,n=`<span style="background-color: ${(e=>{switch(e.toLowerCase()){case"debug":return"gray";case"info":return"#267fb7";case"notice":return"green";case"warn":return"#e9db18";case"error":return"red";case"fatal":return"#ff0000";case"spawn":return"#ff00d0";default:return"lightblue"}})(t.level)}; color: ${o=t.level,"warn"===o.toLowerCase()?"black":"white"}; padding: 1px 5px; font-size: 12px; border-radius: 3px;">${t.level}</span>`;var o;const a=[...e,`${n} ${r} <span style="color: #09516d;">[${t.name}]</span> <span style="color: var(--main-log-color);">${t.message}</span>`];return a.length>d?a.slice(d/10):a}))}catch(t){console.error(`WebSocketUse error parsing message: ${t}`)}},x.current.onopen=()=>{tM&&console.log(`WebSocket: Connected to WebSocket: ${_}`),N("WebSocket",`Connected to WebSocket: ${_}`),g(!0),y(),w.current=1,j.current=setTimeout((()=>{k.current=setInterval((()=>{M({id:S.current,method:"ping",src:"Frontend",dst:"Matterbridge",params:{}}),clearTimeout(C.current),C.current=setTimeout((()=>{tM&&console.error(`WebSocketUse: No pong response received from WebSocket: ${_}`),N("WebSocket",`No pong response received from WebSocket: ${_}`),g(!1)}),5e4)}),6e4)}),3e5)},x.current.onclose=()=>{tM&&console.error(`WebSocket: Disconnected from WebSocket: ${_}`),N("WebSocket",`Disconnected from WebSocket: ${_}`),g(!1),y(),clearTimeout(j.current),clearTimeout(C.current),clearInterval(k.current),N("WebSocket",`Reconnecting (attempt ${w.current} of 100) to WebSocket${P?" (Ingress)":""}: ${_}`),w.current<O?setTimeout(F,(P?2e4:1e3)*w.current):N("WebSocket",`Reconnect attempts exceeded limit of 100 retries, refresh the page to reconnect to: ${_}`),w.current=w.current+1},x.current.onerror=e=>{tM&&console.error(`WebSocket: WebSocket error connecting to ${_}:`,e),N("WebSocket",`WebSocket error connecting to ${_}`)})}),[_]),F=(0,e.useCallback)((()=>{tM&&console.log(`WebSocket attemptReconnect ${w.current}/100 to:`,_),D()}),[D]);(0,e.useEffect)((()=>(D(),()=>{x.current&&x.current.readyState===WebSocket.OPEN&&x.current.close()})),[D]);const z=(0,e.useMemo)((()=>({messages:c,maxMessages:d,autoScroll:f,setMessages:u,setLogFilters:I,setMaxMessages:p,setAutoScroll:h})),[c,u,I]),L=(0,e.useMemo)((()=>({maxMessages:d,autoScroll:f,logFilterLevel:a,logFilterSearch:s,setMessages:u,setLogFilters:I,setMaxMessages:p,setAutoScroll:h,online:m,getUniqueId:R,addListener:T,removeListener:A,sendMessage:M,logMessage:N})),[d,f,u,I,p,h,m,T,A,M,N]);return(0,dt.jsx)(Kh.Provider,{value:z,children:(0,dt.jsx)(Qh.Provider,{value:L,children:o})})}const Yh=function(){const{showSnackbarMessage:t,showConfirmCancelDialog:r}=(0,e.useContext)(Fh),{online:n,sendMessage:o,logMessage:a,addListener:i,removeListener:s,getUniqueId:l}=(0,e.useContext)(Qh),[c,u]=(0,e.useState)(!1),[d,p]=(0,e.useState)(!1),[f,h]=(0,e.useState)(null),m=(0,e.useRef)(l()),[g,v]=(0,e.useState)(null),[y,b]=(0,e.useState)(null),[x,w]=(0,e.useState)(null),[S,k]=(0,e.useState)(null),C=()=>{window.open("https://github.com/Luligu/matterbridge/blob/main/CHANGELOG.md","_blank")},j=()=>{o({id:m.current,method:"/api/install",src:"Frontend",dst:"Matterbridge",params:{packageName:"matterbridge",restart:!0}})},$=()=>{tM&&console.log("Header: handleShellySystemUpdateClick"),a("Matterbridge","Installing system updates..."),o({id:m.current,method:"/api/shellysysupdate",src:"Frontend",dst:"Matterbridge",params:{}})},E=()=>{tM&&console.log("Header: handleShellyMainUpdateClick"),a("Matterbridge","Installing software updates..."),o({id:m.current,method:"/api/shellymainupdate",src:"Frontend",dst:"Matterbridge",params:{}})},_=()=>{""===f.matterbridgeInformation.restartMode?o({id:m.current,method:"/api/restart",src:"Frontend",dst:"Matterbridge",params:{}}):o({id:m.current,method:"/api/shutdown",src:"Frontend",dst:"Matterbridge",params:{}})},P=()=>{o({id:m.current,method:"/api/shutdown",src:"Frontend",dst:"Matterbridge",params:{}})},O=e=>{tM&&console.log("Header: handleMenuClose",e),v(null),"download-mblog"===e?(a("Matterbridge","Downloading matterbridge log..."),t("Downloading matterbridge log...",5),window.location.href="./api/download-mblog"):"download-mjlog"===e?(a("Matterbridge","Downloading matter log..."),t("Downloading matter log...",5),window.location.href="./api/download-mjlog"):"download-mbstorage"===e?(a("Matterbridge","Downloading matterbridge storage..."),t("Downloading matterbridge storage...",5),window.location.href="./api/download-mbstorage"):"download-pluginstorage"===e?(a("Matterbridge","Downloading matterbridge plugins storage..."),t("Downloading matterbridge plugins storage...",5),window.location.href="./api/download-pluginstorage"):"download-pluginconfig"===e?(a("Matterbridge","Downloading matterbridge plugins config..."),t("Downloading matterbridge plugins config...",5),window.location.href="./api/download-pluginconfig"):"download-mjstorage"===e?(a("Matterbridge","Downloading matter storage..."),t("Downloading matter storage...",5),window.location.href="./api/download-mjstorage"):"download-backup"===e?(a("Matterbridge","Downloading backup..."),t("Downloading backup...",10),window.location.href="./api/download-backup"):"update"===e?j():"shelly-sys-update"===e?$():"shelly-main-update"===e?E():"shelly-create-system-log"===e?(tM&&console.log("Header: handleShellyCreateSystemLog"),o({id:m.current,method:"/api/shellycreatesystemlog",src:"Frontend",dst:"Matterbridge",params:{}})):"shelly-download-system-log"===e?(tM&&console.log("Header: handleShellyDownloadSystemLog"),a("Matterbridge","Downloading Shelly system log..."),t("Downloading Shelly system log...",5),window.location.href="./api/shellydownloadsystemlog"):"softreset"===e?o({id:m.current,method:"/api/softreset",src:"Frontend",dst:"Matterbridge",params:{}}):"hardreset"===e?o({id:m.current,method:"/api/hardreset",src:"Frontend",dst:"Matterbridge",params:{}}):"restart"===e?_():"shutdown"===e?P():"reboot"===e?o({id:m.current,method:"/api/reboot",src:"Frontend",dst:"Matterbridge",params:{}}):"startshare"===e?o({id:m.current,method:"/api/advertise",src:"Frontend",dst:"Matterbridge",params:{}}):"stopshare"===e?o({id:m.current,method:"/api/stopadvertise",src:"Frontend",dst:"Matterbridge",params:{}}):"create-backup"===e?(a("Matterbridge","Creating backup..."),t("Creating backup...",10),Bf("backup","create")):"unregister"===e?(a("Matterbridge","Uregistering all bridged devices..."),t("Uregistering all bridged devices...",10),Bf("unregister","now")):"reset"===e?(a("Matterbridge","Resetting matterbridge commissioning..."),t("Resetting matterbridge commissioning...",10),Bf("reset","now")):"factoryreset"===e&&(a("Matterbridge","Factory reset of matterbridge..."),t("Factory reset of matterbridge...",10),Bf("factoryreset","now"))},R=e=>{tM&&console.log("Header: handleMenuCloseCancel:",e),v(null)},M=()=>{b(null)},N=()=>{w(null)},I=()=>{k(null)};return(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&(e.id===m.current&&"/api/settings"===e.method&&(tM&&console.log("Header received settings:",e.response),h(e.response),u(e.response.matterbridgeInformation.restartRequired),p(e.response.matterbridgeInformation.updateRequired)),"refresh_required"===e.method&&(null!==e.params.changed&&"matterbridgeLatestVersion"!==e.params.changed&&"fabrics"!==e.params.changed||(tM&&console.log(`Header received refresh_required: changed=${e.params.changed}`),o({id:m.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))),"restart_required"===e.method&&(tM&&console.log("Header received restart_required"),u(!0)),"update_required"===e.method&&(tM&&console.log("Header received update_required"),p(!0)),e.id===qh&&(tM&&console.log("Header received WS_ID_SHELLY_SYS_UPDATE:"),h((t=>({...t,matterbridgeInformation:{...t.matterbridgeInformation,shellySysUpdate:e.params.available}})))),e.id===Gh&&(tM&&console.log("Header received WS_ID_SHELLY_MAIN_UPDATE:"),h((t=>({...t,matterbridgeInformation:{...t.matterbridgeInformation,shellyMainUpdate:e.params.available}})))))};return i(e),tM&&console.log(`Header added WebSocket listener id ${m.current}`),()=>{s(e),tM&&console.log("Header removed WebSocket listener")}}),[i,s,o,t]),(0,e.useEffect)((()=>{n&&(tM&&console.log("Header sending /api/settings requests"),o({id:m.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))}),[n,o]),tM&&console.log("Header rendering..."),n&&f?(0,dt.jsxs)("div",{className:"header",children:[(0,dt.jsxs)("div",{className:"sub-header",children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"30px"},onClick:()=>{rM(),tM&&console.log("Matterbridge logo clicked: debug is now",tM)}}),(0,dt.jsx)("h2",{style:{fontSize:"22px",color:"var(--main-icon-color)",margin:"0px"},children:"Matterbridge"}),(0,dt.jsxs)("nav",{children:[(0,dt.jsx)(et,{to:"/",className:"nav-link",children:"Home"}),(0,dt.jsx)(et,{to:"/devices",className:"nav-link",children:"Devices"}),(0,dt.jsx)(et,{to:"/log",className:"nav-link",children:"Logs"}),(0,dt.jsx)(et,{to:"/settings",className:"nav-link",children:"Settings"})]})]}),(0,dt.jsxs)("div",{className:"sub-header",children:[f.matterbridgeInformation&&!f.matterbridgeInformation.readOnly&&(0,dt.jsx)(Uu,{title:"Sponsor Matterbridge and its plugins",children:(0,dt.jsx)("span",{className:"status-sponsor",onClick:()=>{window.open("https://www.buymeacoffee.com/luligugithub","_blank")},children:"Sponsor"})}),!f.matterbridgeInformation.readOnly&&!d&&(0,dt.jsx)(Uu,{title:"Matterbridge version",children:(0,dt.jsxs)("span",{className:"status-information",onClick:C,children:["v.",f.matterbridgeInformation.matterbridgeVersion]})}),!f.matterbridgeInformation.readOnly&&d&&(0,dt.jsx)(Uu,{title:"New Matterbridge version available, click to install",children:(0,dt.jsxs)("span",{className:"status-warning",onClick:j,children:["Update v.",f.matterbridgeInformation.matterbridgeVersion," to v.",f.matterbridgeInformation.matterbridgeLatestVersion]})}),f.matterbridgeInformation.shellyBoard&&(0,dt.jsx)("img",{src:"Shelly.svg",alt:"Shelly Icon",style:{height:"30px",padding:"0px",margin:"0px",marginRight:"30px"}}),f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.xxxmatterbridgeVersion&&(0,dt.jsx)(Uu,{title:"Matterbridge version",children:(0,dt.jsxs)("span",{style:{fontSize:"12px",color:"var(--main-icon-color)"},onClick:C,children:["v.",f.matterbridgeInformation.matterbridgeVersion]})}),""!==f.matterbridgeInformation.bridgeMode&&!1===f.matterbridgeInformation.readOnly?(0,dt.jsx)(Uu,{title:"Bridge mode",children:(0,dt.jsx)("span",{className:"status-information",style:{cursor:"default"},children:f.matterbridgeInformation.bridgeMode})}):null,""!==f.matterbridgeInformation.restartMode&&!1===f.matterbridgeInformation.readOnly?(0,dt.jsx)(Uu,{title:"Restart mode",children:(0,dt.jsx)("span",{className:"status-information",style:{cursor:"default"},children:f.matterbridgeInformation.restartMode})}):null]}),(0,dt.jsxs)("div",{className:"sub-header",style:{gap:"5px"},children:[(0,dt.jsx)(Uu,{title:"Matterbridge help",children:(0,dt.jsx)(Rd,{onClick:()=>{window.open("https://github.com/Luligu/matterbridge/blob/main/README.md","_blank")},children:(0,dt.jsx)(Af,{style:{color:"var(--main-icon-color)"}})})}),(0,dt.jsx)(Uu,{title:"Matterbridge changelog",children:(0,dt.jsx)(Rd,{onClick:C,children:(0,dt.jsx)(Df,{style:{color:"var(--main-icon-color)"}})})}),f.matterbridgeInformation&&!f.matterbridgeInformation.readOnly&&(0,dt.jsx)(Uu,{title:"Update matterbridge",children:(0,dt.jsx)(Rd,{style:{color:d?"var(--primary-color)":"var(--main-icon-color)"},onClick:j,children:(0,dt.jsx)(Of,{})})}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellySysUpdate&&(0,dt.jsx)(Uu,{title:"Shelly system update",children:(0,dt.jsx)(Rd,{style:{color:"var(--primary-color)"},onClick:$,children:(0,dt.jsx)(Of,{})})}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellyMainUpdate&&(0,dt.jsx)(Uu,{title:"Shelly software update",children:(0,dt.jsx)(Rd,{style:{color:"var(--primary-color)"},onClick:E,children:(0,dt.jsx)(Of,{})})}),(0,dt.jsx)(Uu,{title:"Restart matterbridge",children:(0,dt.jsx)(Rd,{style:{color:c?"var(--primary-color)":"var(--main-icon-color)"},onClick:_,children:(0,dt.jsx)(Rf,{})})}),""===f.matterbridgeInformation.restartMode?(0,dt.jsx)(Uu,{title:"Shut down matterbridge",children:(0,dt.jsx)(Rd,{style:{color:c?"var(--primary-color)":"var(--main-icon-color)"},onClick:P,children:(0,dt.jsx)(Mf,{})})}):null,(0,dt.jsx)(Uu,{title:"Download, backup and more",children:(0,dt.jsx)(Rd,{onClick:e=>{v(e.currentTarget)},children:(0,dt.jsx)(Nf,{style:{color:"var(--main-icon-color)"}})})}),(0,dt.jsxs)(Hp,{id:"command-menu",anchorEl:g,keepMounted:!0,open:Boolean(g),onClose:()=>O(""),children:[f.matterbridgeInformation&&!f.matterbridgeInformation.readOnly&&(0,dt.jsxs)(tf,{onClick:()=>O("update"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Of,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Update",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellySysUpdate&&(0,dt.jsxs)(tf,{onClick:()=>O("shelly-sys-update"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Of,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Shelly system update",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&f.matterbridgeInformation.shellyMainUpdate&&(0,dt.jsxs)(tf,{onClick:()=>O("shelly-main-update"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Of,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Shelly software update",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>O("restart"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Rf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Restart",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),""===f.matterbridgeInformation.restartMode?(0,dt.jsxs)(tf,{onClick:()=>O("shutdown"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Shutdown",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}):null,f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{r("Reboot","Are you sure you want to reboot the Shelly board?","reboot",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Rf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reboot...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),!0===f.matterbridgeInformation.matterbridgePaired&&!1===f.matterbridgeInformation.matterbridgeAdvertise?(0,dt.jsxs)(tf,{onClick:()=>O("startshare"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(zf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Share fabrics",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}):null,!0===f.matterbridgeInformation.matterbridgeAdvertise?(0,dt.jsxs)(tf,{onClick:()=>O("stopshare"),children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Lf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Stop sharing",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}):null,(0,dt.jsx)(Cf,{}),(0,dt.jsxs)(tf,{onClick:e=>{w(e.currentTarget)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Download",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(Hp,{id:"sub-menu-download",anchorEl:x,keepMounted:!0,open:Boolean(x),onClose:N,sx:{"& .MuiPaper-root":{backgroundColor:"#e2e2e2"}},children:[(0,dt.jsxs)(tf,{onClick:()=>{O("download-mbstorage"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge storage",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-pluginstorage"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge plugins storage",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-pluginconfig"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge plugins config",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-mblog"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matterbridge log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-mjstorage"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matter storage",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-mjlog"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Matter log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{O("shelly-create-system-log"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Create Shelly system log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{O("shelly-download-system-log"),N()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Tf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Download Shelly system log",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]})]}),(0,dt.jsx)(Cf,{}),(0,dt.jsxs)(tf,{onClick:e=>{b(e.currentTarget)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(If,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Backup",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(Hp,{id:"sub-menu-backup",anchorEl:y,keepMounted:!0,open:Boolean(y),onClose:M,sx:{"& .MuiPaper-root":{backgroundColor:"#e2e2e2"}},children:[(0,dt.jsxs)(tf,{onClick:()=>{O("create-backup"),M()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(If,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Create backup",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{O("download-backup"),M()},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(If,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Download backup",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]})]}),(0,dt.jsx)(Cf,{}),(0,dt.jsxs)(tf,{onClick:e=>{k(e.currentTarget)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Ff,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(Hp,{id:"sub-menu-reset",anchorEl:S,keepMounted:!0,open:Boolean(S),onClose:I,sx:{"& .MuiPaper-root":{backgroundColor:"#e2e2e2"}},children:[(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Reset all devices and shutdown","Are you sure you want to unregister all devices? This will temporarily remove all devices from the controller and you may loose the controller configuration.","unregister",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset all devices...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Reset commissioning and shutdown","Are you sure you want to reset the commissioning? You will have to manually remove Matterbridge from the controller.","reset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset commissioning...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),!f.matterbridgeInformation.readOnly&&(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Factory reset and shutdown","Are you sure you want to factory reset Matterbridge? You will have to manually remove Matterbridge from the controller.","factoryreset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Factory reset...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Network reset","Are you sure you want to factory reset the network parameters?","softreset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Reset network...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]}),f.matterbridgeInformation&&f.matterbridgeInformation.shellyBoard&&(0,dt.jsxs)(tf,{onClick:()=>{I(),r("Factory reset","Are you sure you want to factory reset Matterbridge? You will have to manually remove Matterbridge from the controller.","hardreset",O,R)},children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Mf,{style:{color:"var(--main-icon-color)"}})}),(0,dt.jsx)(xf,{primary:"Factory reset...",primaryTypographyProps:{style:{fontWeight:"normal",color:"var(--main-icon-color)"}}})]})]})]})]})]}):null},Xh=Pf((0,dt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),Zh=()=>{let e=!1;return("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(e=!0),e};function em(){const{messages:t,autoScroll:r}=(0,e.useContext)(Kh),[n,o]=(0,e.useState)(!1),a=(0,e.useRef)(null);return(0,e.useEffect)((()=>{!r||n||Zh()||a.current.scrollIntoView({behavior:"smooth"})}),[t,n,r]),(0,dt.jsx)("div",{style:{margin:"0px",padding:"0px"},children:(0,dt.jsxs)("ul",{style:{margin:"0px",padding:"0px"},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.map(((e,t)=>(0,dt.jsx)("li",{style:{wordWrap:"break-word",maxHeight:"200px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:e}},t))),(0,dt.jsx)("div",{ref:a})," "]})})}function tm(){return(0,dt.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:"20px",flexDirection:"column",color:"var(--main-text-color)",height:"100vh",backgroundColor:"var(--main-bg-color)"},children:(0,dt.jsxs)(Uf,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[(0,dt.jsx)(jd,{style:{color:"var(--primary-color)"}}),(0,dt.jsx)("div",{style:{marginTop:"20px",color:"var(--primary-color)"},children:"Connecting to Matterbridge..."})]})})}function rm(e){let{value:t,maxChars:r}=e,n=t;if(t.length>r&&r>3){const e=r-3;n=`${t.substring(0,Math.ceil(e/2))} \u2026 ${t.substring(t.length-Math.floor(e/2),t.length)}`}return t!==n?(0,dt.jsx)(Uu,{title:t,placement:"top",PopperProps:{modifiers:[{name:"offset",options:{offset:[0,12]}}]},children:(0,dt.jsx)("span",{children:n})}):(0,dt.jsx)("span",{children:n})}function nm(t){let{systemInfo:r,compact:n}=t;const[o,a]=(0,e.useState)(r),{sendMessage:i,addListener:s,removeListener:l}=(0,e.useContext)(Qh);if(tM&&console.log("SystemInfoTable:",o,"compact:",n),n&&o.totalMemory){const e=o.totalMemory,t=o.freeMemory;o.freeMemory=`${t} / ${e}`,delete o.totalMemory}if(n&&o.heapTotal){const e=o.heapTotal,t=o.heapUsed;o.heapUsed=`${t} / ${e}`,delete o.heapTotal}if(n&&o.osRelease){const e=o.osType,t=o.osRelease;o.osType=`${e} (${t})`,delete o.osRelease}if(n&&o.osArch){const e=o.osPlatform,t=o.osArch;o.osPlatform=`${e} (${t})`,delete o.osArch}return(0,e.useEffect)((()=>{tM&&console.log("SystemInfoTable useEffect WebSocketMessage mounting");const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst?("memory_update"===e.method&&e.params&&e.params.totalMemory&&e.params.freeMemory&&(tM&&console.log("SystemInfoTable received memory_update",e),a((t=>({...t,totalMemory:e.params.totalMemory,freeMemory:e.params.freeMemory,heapTotal:e.params.heapTotal,heapUsed:e.params.heapUsed,rss:e.params.rss})))),"cpu_update"===e.method&&e.params&&e.params.cpuUsage&&(tM&&console.log("SystemInfoTable received cpu_update",e),a((t=>({...t,cpuUsage:e.params.cpuUsage.toFixed(2)+" %"})))),"uptime_update"===e.method&&e.params&&e.params.systemUptime&&e.params.processUptime&&(tM&&console.log("SystemInfoTable received uptime_update",e),a((t=>({...t,systemUptime:e.params.systemUptime,processUptime:e.params.processUptime}))))):tM&&console.log("Test received WebSocketMessage:",e.method,e.src,e.dst,e.response)};return s(e),tM&&console.log("SystemInfoTable useEffect WebSocketMessage mounted"),()=>{tM&&console.log("SystemInfoTable useEffect WebSocketMessage unmounting"),l(e),tM&&console.log("SystemInfoTable useEffect WebSocketMessage unmounted")}}),[s,l,i]),o?(tM&&console.log("SystemInfoTable rendering..."),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{minWidth:"302px",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"System Information"})}),(0,dt.jsx)("div",{className:"MbfWindowDivTable",children:(0,dt.jsx)("table",{style:{border:"none",borderCollapse:"collapse"},children:(0,dt.jsx)("tbody",{style:{border:"none",borderCollapse:"collapse"},children:Object.entries(o).map(((e,t)=>{let[r,n]=e;return(0,dt.jsxs)("tr",{className:t%2===0?"table-content-even":"table-content-odd",style:{border:"none",borderCollapse:"collapse"},children:[(0,dt.jsx)("td",{style:{border:"none",borderCollapse:"collapse"},children:r}),(0,dt.jsx)("td",{style:{border:"none",borderCollapse:"collapse"},children:(0,dt.jsx)(rm,{value:"string"!==typeof n?n.toString():n,maxChars:25})})]},r)}))})})})]})):null}var om,am=Object.defineProperty,im=Object.getOwnPropertySymbols,sm=Object.prototype.hasOwnProperty,lm=Object.prototype.propertyIsEnumerable,cm=(e,t,r)=>t in e?am(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,um=(e,t)=>{for(var r in t||(t={}))sm.call(t,r)&&cm(e,r,t[r]);if(im)for(var r of im(t))lm.call(t,r)&&cm(e,r,t[r]);return e},dm=(e,t)=>{var r={};for(var n in e)sm.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&im)for(var n of im(e))t.indexOf(n)<0&&lm.call(e,n)&&(r[n]=e[n]);return r};(e=>{const t=class t{constructor(e,r,n,a){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(a<-1||a>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let i=[];for(let t=0;t<this.size;t++)i.push(!1);for(let t=0;t<this.size;t++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(n);if(this.drawCodewords(s),-1==a){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const r=this.getPenaltyScore();r<e&&(a=t,e=r),this.applyMask(t)}}o(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(r,n){const o=e.QrSegment.makeSegments(r);return t.encodeSegments(o,n)}static encodeBinary(r,n){const o=e.QrSegment.makeBytes(r);return t.encodeSegments([o],n)}static encodeSegments(e,n){let a,s,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:40,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,d=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(!(t.MIN_VERSION<=l&&l<=c&&c<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");for(a=l;;a++){const r=8*t.getNumDataCodewords(a,n),o=i.getTotalBits(e,a);if(o<=r){s=o;break}if(a>=c)throw new RangeError("Data too long")}for(const r of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])d&&s<=8*t.getNumDataCodewords(a,r)&&(n=r);let p=[];for(const t of e){r(t.mode.modeBits,4,p),r(t.numChars,t.mode.numCharCountBits(a),p);for(const e of t.getData())p.push(e)}o(p.length==s);const f=8*t.getNumDataCodewords(a,n);o(p.length<=f),r(0,Math.min(4,f-p.length),p),r(0,(8-p.length%8)%8,p),o(p.length%8==0);for(let t=236;p.length<f;t^=253)r(t,8,p);let h=[];for(;8*h.length<p.length;)h.push(0);return p.forEach(((e,t)=>h[t>>>3]|=e<<7-(7&t))),new t(a,n,h,u)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let r=0;r<this.size;r++)this.setFunctionModule(6,r,r%2==0),this.setFunctionModule(r,6,r%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let n=0;n<t;n++)0==r&&0==n||0==r&&n==t-1||r==t-1&&0==n||this.drawAlignmentPattern(e[r],e[n]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let r=t;for(let n=0;n<10;n++)r=r<<1^1335*(r>>>9);const a=21522^(t<<10|r);o(a>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,n(a,o));this.setFunctionModule(8,7,n(a,6)),this.setFunctionModule(8,8,n(a,7)),this.setFunctionModule(7,8,n(a,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,n(a,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,n(a,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,n(a,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let r=0;r<12;r++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;o(t>>>18==0);for(let r=0;r<18;r++){const e=n(t,r),o=this.size-11+r%3,a=Math.floor(r/3);this.setFunctionModule(o,a,e),this.setFunctionModule(a,o,e)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){const o=Math.max(Math.abs(n),Math.abs(r)),a=e+n,i=t+r;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,1!=Math.max(Math.abs(n),Math.abs(r)))}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){const r=this.version,n=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(r,n))throw new RangeError("Invalid argument");const a=t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r],i=t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r],s=Math.floor(t.getNumRawDataModules(r)/8),l=a-s%a,c=Math.floor(s/a);let u=[];const d=t.reedSolomonComputeDivisor(i);for(let o=0,f=0;o<a;o++){let r=e.slice(f,f+c-i+(o<l?0:1));f+=r.length;const n=t.reedSolomonComputeRemainder(r,d);o<l&&r.push(0),u.push(r.concat(n))}let p=[];for(let t=0;t<u[0].length;t++)u.forEach(((e,r)=>{(t!=c-i||r>=l)&&p.push(e[t])}));return o(p.length==s),p}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let o=0;o<this.size;o++)for(let a=0;a<2;a++){const i=t-a,s=0==(t+1&2)?this.size-1-o:o;!this.isFunction[s][i]&&r<8*e.length&&(this.modules[s][i]=n(e[r>>>3],7-(7&r)),r++)}}o(r==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let n;switch(e){case 0:n=(r+t)%2==0;break;case 1:n=t%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+t)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:n=r*t%2+r*t%3==0;break;case 6:n=(r*t%2+r*t%3)%2==0;break;case 7:n=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&n&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let o=0;o<this.size;o++){let r=!1,n=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[o][i]==r?(n++,5==n?e+=t.PENALTY_N1:n>5&&e++):(this.finderPenaltyAddHistory(n,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][i],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,a)*t.PENALTY_N3}for(let o=0;o<this.size;o++){let r=!1,n=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][o]==r?(n++,5==n?e+=t.PENALTY_N1:n>5&&e++):(this.finderPenaltyAddHistory(n,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[i][o],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,a)*t.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let r=0;r<this.size-1;r++){const n=this.modules[o][r];n==this.modules[o][r+1]&&n==this.modules[o+1][r]&&n==this.modules[o+1][r+1]&&(e+=t.PENALTY_N2)}let r=0;for(const t of this.modules)r=t.reduce(((e,t)=>e+(t?1:0)),r);const n=this.size*this.size,a=Math.ceil(Math.abs(20*r-10*n)/n)-1;return o(0<=a&&a<=9),e+=a*t.PENALTY_N4,o(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let r=[6];for(let n=this.size-7;r.length<e;n-=t)r.splice(1,0,n);return r}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return o(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let r=[];for(let t=0;t<e-1;t++)r.push(0);r.push(1);let n=1;for(let o=0;o<e;o++){for(let e=0;e<r.length;e++)r[e]=t.reedSolomonMultiply(r[e],n),e+1<r.length&&(r[e]^=r[e+1]);n=t.reedSolomonMultiply(n,2)}return r}static reedSolomonComputeRemainder(e,r){let n=r.map((e=>0));for(const o of e){const e=o^n.shift();n.push(0),r.forEach(((r,o)=>n[o]^=t.reedSolomonMultiply(r,e)))}return n}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return o(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];o(t<=3*this.size);const r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];function r(e,t,r){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(e>>>n&1)}function n(e,t){return 0!=(e>>>t&1)}function o(e){if(!e)throw new Error("Assertion error")}e.QrCode=t;const a=class e{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let n=[];for(const e of t)r(e,8,n);return new e(e.Mode.BYTE,t.length,n)}static makeNumeric(t){if(!e.isNumeric(t))throw new RangeError("String contains non-numeric characters");let n=[];for(let e=0;e<t.length;){const o=Math.min(t.length-e,3);r(parseInt(t.substring(e,e+o),10),3*o+1,n),e+=o}return new e(e.Mode.NUMERIC,t.length,n)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n,o=[];for(n=0;n+2<=t.length;n+=2){let a=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n));a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n+1)),r(a,11,o)}return n<t.length&&r(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)),6,o),new e(e.Mode.ALPHANUMERIC,t.length,o)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let n=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)r(t,8,n);else if(t<16384)r(2,2,n),r(t,14,n);else{if(!(t<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,n),r(t,21,n)}return new e(e.Mode.ECI,0,n)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(const n of e){const e=n.mode.numCharCountBits(t);if(n.numChars>=1<<e)return 1/0;r+=4+e+n.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)"%"!=e.charAt(r)?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let i=a;e.QrSegment=a})(om||(om={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2);e.Ecc=t})(t=e.QrCode||(e.QrCode={}))})(om||(om={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]);e.Mode=t})(t=e.QrSegment||(e.QrSegment={}))})(om||(om={}));var pm=om,fm={L:pm.QrCode.Ecc.LOW,M:pm.QrCode.Ecc.MEDIUM,Q:pm.QrCode.Ecc.QUARTILE,H:pm.QrCode.Ecc.HIGH},hm=128,mm="L",gm="#FFFFFF",vm="#000000",ym=!1,bm=1,xm=4,wm=0,Sm=.1;function km(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=[];return e.forEach((function(e,n){let o=null;e.forEach((function(a,i){if(!a&&null!==o)return r.push(`M${o+t} ${n+t}h${i-o}v1H${o+t}z`),void(o=null);if(i!==e.length-1)a&&null===o&&(o=i);else{if(!a)return;null===o?r.push(`M${i+t},${n+t} h1v1H${i+t}z`):r.push(`M${o+t},${n+t} h${i+1-o}v1H${o+t}z`)}}))})),r.join("")}function Cm(e,t){return e.slice().map(((e,r)=>r<t.y||r>=t.y+t.h?e:e.map(((e,r)=>(r<t.x||r>=t.x+t.w)&&e))))}function jm(t){let{value:r,level:n,minVersion:o,includeMargin:a,marginSize:i,imageSettings:s,size:l,boostLevel:c}=t,u=e.useMemo((()=>{const e=(Array.isArray(r)?r:[r]).reduce(((e,t)=>(e.push(...pm.QrSegment.makeSegments(t)),e)),[]);return pm.QrCode.encodeSegments(e,fm[n],o,void 0,void 0,c)}),[r,n,o,c]);const{cells:d,margin:p,numCells:f,calculatedImageSettings:h}=e.useMemo((()=>{let e=u.getModules();const t=function(e,t){return null!=t?Math.max(Math.floor(t),0):e?xm:wm}(a,i),r=e.length+2*t,n=function(e,t,r,n){if(null==n)return null;const o=e.length+2*r,a=Math.floor(t*Sm),i=o/t,s=(n.width||a)*i,l=(n.height||a)*i,c=null==n.x?e.length/2-s/2:n.x*i,u=null==n.y?e.length/2-l/2:n.y*i,d=null==n.opacity?1:n.opacity;let p=null;if(n.excavate){let e=Math.floor(c),t=Math.floor(u);p={x:e,y:t,w:Math.ceil(s+c-e),h:Math.ceil(l+u-t)}}return{x:c,y:u,h:l,w:s,excavation:p,opacity:d,crossOrigin:n.crossOrigin}}(e,l,t,s);return{cells:e,margin:t,numCells:r,calculatedImageSettings:n}}),[u,l,s,a,i]);return{qrcode:u,margin:p,cells:d,numCells:f,calculatedImageSettings:h}}var $m=function(){try{(new Path2D).addPath(new Path2D)}catch(Ya){return!1}return!0}(),Em=e.forwardRef((function(t,r){const n=t,{value:o,size:a=hm,level:i=mm,bgColor:s=gm,fgColor:l=vm,includeMargin:c=ym,minVersion:u=bm,boostLevel:d,marginSize:p,imageSettings:f}=n,h=dm(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:m}=h,g=dm(h,["style"]),v=null==f?void 0:f.src,y=e.useRef(null),b=e.useRef(null),x=e.useCallback((e=>{y.current=e,"function"===typeof r?r(e):r&&(r.current=e)}),[r]),[w,S]=e.useState(!1),{margin:k,cells:C,numCells:j,calculatedImageSettings:$}=jm({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:p,imageSettings:f,size:a});e.useEffect((()=>{if(null!=y.current){const e=y.current,t=e.getContext("2d");if(!t)return;let r=C;const n=b.current,o=null!=$&&null!==n&&n.complete&&0!==n.naturalHeight&&0!==n.naturalWidth;o&&null!=$.excavation&&(r=Cm(C,$.excavation));const i=window.devicePixelRatio||1;e.height=e.width=a*i;const c=a/j*i;t.scale(c,c),t.fillStyle=s,t.fillRect(0,0,j,j),t.fillStyle=l,$m?t.fill(new Path2D(km(r,k))):C.forEach((function(e,r){e.forEach((function(e,n){e&&t.fillRect(n+k,r+k,1,1)}))})),$&&(t.globalAlpha=$.opacity),o&&t.drawImage(n,$.x+k,$.y+k,$.w,$.h)}})),e.useEffect((()=>{S(!1)}),[v]);const E=um({height:a,width:a},m);let _=null;return null!=v&&(_=e.createElement("img",{src:v,key:v,style:{display:"none"},onLoad:()=>{S(!0)},ref:b,crossOrigin:null==$?void 0:$.crossOrigin})),e.createElement(e.Fragment,null,e.createElement("canvas",um({style:E,height:a,width:a,ref:x,role:"img"},g)),_)}));Em.displayName="QRCodeCanvas";var _m=e.forwardRef((function(t,r){const n=t,{value:o,size:a=hm,level:i=mm,bgColor:s=gm,fgColor:l=vm,includeMargin:c=ym,minVersion:u=bm,boostLevel:d,title:p,marginSize:f,imageSettings:h}=n,m=dm(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:g,cells:v,numCells:y,calculatedImageSettings:b}=jm({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:f,imageSettings:h,size:a});let x=v,w=null;null!=h&&null!=b&&(null!=b.excavation&&(x=Cm(v,b.excavation)),w=e.createElement("image",{href:h.src,height:b.h,width:b.w,x:b.x+g,y:b.y+g,preserveAspectRatio:"none",opacity:b.opacity,crossOrigin:b.crossOrigin}));const S=km(x,g);return e.createElement("svg",um({height:a,width:a,viewBox:`0 0 ${y} ${y}`,ref:r,role:"img"},m),!!p&&e.createElement("title",null,p),e.createElement("path",{fill:s,d:`M0,0 h${y}v${y}H0z`,shapeRendering:"crispEdges"}),e.createElement("path",{fill:l,d:S,shapeRendering:"crispEdges"}),w)}));function Pm(t){let{matterbridgeInfo:r,plugin:n}=t;const{sendMessage:o}=(0,e.useContext)(Qh),a=()=>{""===r.restartMode?o({method:"/api/restart",src:"Frontend",dst:"Matterbridge",params:{}}):o({method:"/api/shutdown",src:"Frontend",dst:"Matterbridge",params:{}})};var i,s,l,c;return tM&&console.log("QRDiv:",r,n),"bridge"===r.bridgeMode&&!0===r.matterbridgePaired&&!1===r.matterbridgeAdvertise&&r.matterbridgeFabricInformations?(tM&&console.log(`QRDiv: paired ${r.matterbridgePaired}, got ${null===(i=r.matterbridgeFabricInformations)||void 0===i?void 0:i.length} fabrics, got ${null===(s=r.matterbridgeSessionInformations)||void 0===s?void 0:s.length} sessions`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left",overflow:"hidden"},children:"Paired fabrics"})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",children:r.matterbridgeFabricInformations.map(((e,t)=>(0,dt.jsxs)("div",{style:{margin:"0px",padding:"10px",gap:"0px",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",textAlign:"left",fontSize:"14px"},children:[(0,dt.jsxs)("p",{className:"status-blue",style:{margin:"0px 10px 10px 10px",fontSize:"14px",padding:0,color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},children:["Fabric: ",e.fabricIndex]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Vendor: ",e.rootVendorId," ",e.rootVendorName]}),""!==e.label&&(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Label: ",e.label]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Sessions: ",r.matterbridgeSessionInformations?r.matterbridgeSessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive)).length:"0"," ","subscriptions: ",r.matterbridgeSessionInformations?r.matterbridgeSessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive&&t.numberOfActiveSubscriptions>0)).length:"0"]})]},t)))})]})):"childbridge"===r.bridgeMode&&n&&!0===n.paired&&n.fabricInformations?(tM&&console.log(`QRDiv: paired ${n.paired}, got ${null===(l=n.fabricInformations)||void 0===l?void 0:l.length} fabrics, got ${null===(c=n.sessionInformations)||void 0===c?void 0:c.length} sessions`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"Paired fabrics"})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",children:n.fabricInformations.map(((e,t)=>(0,dt.jsxs)("div",{style:{margin:"0px",padding:"10px",gap:"0px",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",textAlign:"left",fontSize:"14px"},children:[(0,dt.jsxs)("p",{className:"status-blue",style:{margin:"0px 10px 10px 10px",fontSize:"14px",padding:0,color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},children:["Fabric: ",e.fabricIndex]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Vendor: ",e.rootVendorId," ",e.rootVendorName]}),""!==e.label&&(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Label: ",e.label]}),(0,dt.jsxs)("p",{style:{margin:"0px 20px 0px 20px",color:"var(--div-text-color)"},children:["Sessions: ",n.sessionInformations?n.sessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive)).length:"0"," ","subscriptions: ",n.sessionInformations?n.sessionInformations.filter((t=>t.fabric.fabricIndex===e.fabricIndex&&!0===t.isPeerActive&&t.numberOfActiveSubscriptions>0)).length:"0"]})]},t)))})]})):"bridge"===r.bridgeMode&&(!1===r.matterbridgePaired||!0===r.matterbridgeAdvertise)&&r.matterbridgeQrPairingCode&&r.matterbridgeManualPairingCode?(tM&&console.log(`QRDiv: qrText ${r.matterbridgeQrPairingCode} pairingText ${r.matterbridgeManualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)(_m,{value:r.matterbridgeQrPairingCode,size:256,level:"M",fgColor:"var(--div-text-color)",bgColor:"var(--div-bg-color)",style:{margin:"20px"}}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,marginTop:"-5px",height:"30px"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:["Manual pairing code: ",r.matterbridgeManualPairingCode]})})]})):"childbridge"===r.bridgeMode&&n&&!1===n.paired&&n.qrPairingCode&&n.manualPairingCode?(tM&&console.log(`QRDiv: qrText ${n.qrPairingCode} pairingText ${n.manualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)(_m,{value:n.qrPairingCode,size:256,level:"M",fgColor:"var(--div-text-color)",bgColor:"var(--div-bg-color)",style:{margin:"20px"}}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,marginTop:"-5px",height:"30px"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:["Manual pairing code: ",n.manualPairingCode]})})]})):"bridge"!==r.bridgeMode||!1!==r.matterbridgePaired||r.matterbridgeQrPairingCode||r.matterbridgeManualPairingCode?"childbridge"!==r.bridgeMode||!n||!1!==n.paired||n.qrPairingCode||n.manualPairingCode?void 0:(tM&&console.log(`QRDiv: qrText ${n.qrPairingCode} pairingText ${n.manualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)(Ah,{onClick:a,endIcon:(0,dt.jsx)(Rf,{}),style:{margin:"20px",color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Restart"}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,margin:0,height:"30px"},children:(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:"Restart to generate a new QRCode."})})]})):(tM&&console.log(`QRDiv: qrText ${r.matterbridgeQrPairingCode} pairingText ${r.matterbridgeManualPairingCode}`),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{alignItems:"center",minWidth:"302px"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",style:{textAlign:"left"},children:"QR pairing code"})}),(0,dt.jsx)(Ah,{onClick:a,endIcon:(0,dt.jsx)(Rf,{}),style:{margin:"20px",color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Restart"}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{padding:0,margin:0,height:"30px"},children:(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"},children:"Restart to generate a new QRCode."})})]}))}function Om(e){return parseInt(e,10)||0}_m.displayName="QRCodeSVG";const Rm={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};const Mm=e.forwardRef((function(t,r){const{onChange:n,maxRows:o,minRows:a=1,style:i,value:s,...l}=t,{current:c}=e.useRef(null!=s),u=e.useRef(null),d=Tl(r,u),p=e.useRef(null),f=e.useRef(null),h=e.useCallback((()=>{const e=u.current,r=f.current;if(!e||!r)return;const n=Bd(e).getComputedStyle(e);if("0px"===n.width)return{outerHeightStyle:0,overflowing:!1};r.style.width=n.width,r.value=e.value||t.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");const i=n.boxSizing,s=Om(n.paddingBottom)+Om(n.paddingTop),l=Om(n.borderBottomWidth)+Om(n.borderTopWidth),c=r.scrollHeight;r.value="x";const d=r.scrollHeight;let p=c;a&&(p=Math.max(Number(a)*d,p)),o&&(p=Math.min(Number(o)*d,p)),p=Math.max(p,d);return{outerHeightStyle:p+("border-box"===i?s+l:0),overflowing:Math.abs(p-c)<=1}}),[o,a,t.placeholder]),m=e.useCallback((()=>{const e=u.current,t=h();if(!e||!t||(function(e){for(const t in e)return!1;return!0}(r=t)||0===r.outerHeightStyle&&!r.overflowing))return;var r;const n=t.outerHeightStyle;p.current!==n&&(p.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?"hidden":""}),[h]),g=e.useRef(-1);go((()=>{const e=Jd((()=>m())),t=u?.current;if(!t)return;const r=Bd(t);let n;return r.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(n=new ResizeObserver((()=>{n.unobserve(t),cancelAnimationFrame(g.current),m(),g.current=requestAnimationFrame((()=>{n.observe(t)}))})),n.observe(t)),()=>{e.clear(),cancelAnimationFrame(g.current),r.removeEventListener("resize",e),n&&n.disconnect()}}),[h,m]),go((()=>{m()}));return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)("textarea",{value:s,onChange:e=>{c||m(),n&&n(e)},ref:d,rows:a,style:i,...l}),(0,dt.jsx)("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:f,tabIndex:-1,style:{...Rm,...i,paddingTop:0,paddingBottom:0}})]})})),Nm=Mm;function Im(e){let{props:t,states:r,muiFormControl:n}=e;return r.reduce(((e,r)=>(e[r]=t[r],n&&"undefined"===typeof t[r]&&(e[r]=n[r]),e)),{})}const Tm=e.createContext(void 0);function Am(){return e.useContext(Tm)}function Dm(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function Fm(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(Dm(e.value)&&""!==e.value||t&&Dm(e.defaultValue)&&""!==e.defaultValue)}function zm(e){return vu("MuiInputBase",e)}const Lm=yu("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Bm;const Wm=(e,t)=>{const{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,"small"===r.size&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${yl(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]},Vm=(e,t)=>{const{ownerState:r}=e;return[t.input,"small"===r.size&&t.inputSizeSmall,r.multiline&&t.inputMultiline,"search"===r.type&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]},Hm=dl("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Wm})(gl((e=>{let{theme:t}=e;return{...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Lm.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"4px 0 5px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"100%"}}]}}))),Um=dl("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Vm})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},o={opacity:"0 !important"},a=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Lm.formControl} &`]:{"&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&::-ms-input-placeholder":o,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus::-ms-input-placeholder":a},[`&.${Lm.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableInjectingGlobalStyles},style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}}))),qm=function(e){return function(t){return(0,dt.jsx)(df,{styles:"function"===typeof e?r=>e({theme:r,...t}):e})}}({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Gm=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:i,className:s,color:l,components:c={},componentsProps:u={},defaultValue:d,disabled:p,disableInjectingGlobalStyles:f,endAdornment:h,error:m,fullWidth:g=!1,id:v,inputComponent:y="input",inputProps:b={},inputRef:x,margin:w,maxRows:S,minRows:k,multiline:C=!1,name:j,onBlur:$,onChange:E,onClick:_,onFocus:P,onKeyDown:O,onKeyUp:R,placeholder:M,readOnly:N,renderSuffix:I,rows:T,size:A,slotProps:D={},slots:F={},startAdornment:z,type:L="text",value:B,...W}=n,V=null!=b.value?b.value:B,{current:H}=e.useRef(null!=V),U=e.useRef(),q=e.useCallback((e=>{0}),[]),G=Al(U,x,b.ref,q),[K,Q]=e.useState(!1),J=Am();const Y=Im({props:n,muiFormControl:J,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Y.focused=J?J.focused:K,e.useEffect((()=>{!J&&p&&K&&(Q(!1),$&&$())}),[J,p,K,$]);const X=J&&J.onFilled,Z=J&&J.onEmpty,ee=e.useCallback((e=>{Fm(e)?X&&X():Z&&Z()}),[X,Z]);Ld((()=>{H&&ee({value:V})}),[V,ee,H]);e.useEffect((()=>{ee(U.current)}),[]);let te=y,re=b;C&&"input"===te&&(re=T?{type:void 0,minRows:T,maxRows:T,...re}:{type:void 0,maxRows:S,minRows:k,...re},te=Nm);e.useEffect((()=>{J&&J.setAdornedStart(Boolean(z))}),[J,z]);const ne={...n,color:Y.color||"primary",disabled:Y.disabled,endAdornment:h,error:Y.error,focused:Y.focused,formControl:J,fullWidth:g,hiddenLabel:Y.hiddenLabel,multiline:C,size:Y.size,startAdornment:z,type:L},oe=(e=>{const{classes:t,color:r,disabled:n,error:o,endAdornment:a,focused:i,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:d,size:p,startAdornment:f,type:h}=e;return zs({root:["root",`color${yl(r)}`,n&&"disabled",o&&"error",l&&"fullWidth",i&&"focused",s&&"formControl",p&&"medium"!==p&&`size${yl(p)}`,u&&"multiline",f&&"adornedStart",a&&"adornedEnd",c&&"hiddenLabel",d&&"readOnly"],input:["input",n&&"disabled","search"===h&&"inputTypeSearch",u&&"inputMultiline","small"===p&&"inputSizeSmall",c&&"inputHiddenLabel",f&&"inputAdornedStart",a&&"inputAdornedEnd",d&&"readOnly"]},zm,t)})(ne),ae=F.root||c.Root||Hm,ie=D.root||u.root||{},se=F.input||c.Input||Um;return re={...re,...D.input??u.input},(0,dt.jsxs)(e.Fragment,{children:[!f&&"function"===typeof qm&&(Bm||(Bm=(0,dt.jsx)(qm,{}))),(0,dt.jsxs)(ae,{...ie,ref:r,onClick:e=>{U.current&&e.currentTarget===e.target&&U.current.focus(),_&&_(e)},...W,...!Qd(ae)&&{ownerState:{...ne,...ie.ownerState}},className:Ns(oe.root,ie.className,s,N&&"MuiInputBase-readOnly"),children:[z,(0,dt.jsx)(Tm.Provider,{value:null,children:(0,dt.jsx)(se,{"aria-invalid":Y.error,"aria-describedby":o,autoComplete:a,autoFocus:i,defaultValue:d,disabled:Y.disabled,id:v,onAnimationStart:e=>{ee("mui-auto-fill-cancel"===e.animationName?U.current:{value:"x"})},name:j,placeholder:M,readOnly:N,required:Y.required,rows:T,value:V,onKeyDown:O,onKeyUp:R,type:L,...re,...!Qd(se)&&{as:te,ownerState:{...ne,...re.ownerState}},ref:G,className:Ns(oe.input,re.className,N&&"MuiInputBase-readOnly"),onBlur:e=>{$&&$(e),b.onBlur&&b.onBlur(e),J&&J.onBlur?J.onBlur(e):Q(!1)},onChange:function(e){if(!H){const t=e.target||U.current;if(null==t)throw new Error(tn(1));ee({value:t.value})}for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];b.onChange&&b.onChange(e,...r),E&&E(e,...r)},onFocus:e=>{P&&P(e),b.onFocus&&b.onFocus(e),J&&J.onFocus?J.onFocus(e):Q(!0)}})}),h,I?I({...Y,startAdornment:z}):null]})]})})),Km=Gm;function Qm(e){return vu("MuiInput",e)}const Jm={...Lm,...yu("MuiInput",["root","underline","input"])},Ym=dl(Hm,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...Wm(e,t),!r.disableUnderline&&t.underline]}})(gl((e=>{let{theme:t}=e;let r="light"===t.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{"label + &":{marginTop:16}}},{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Jm.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Jm.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Jm.disabled}, .${Jm.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Jm.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}}))]}}))),Xm=dl(Um,{name:"MuiInput",slot:"Input",overridesResolver:Vm})({}),Zm=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiInput"}),{disableUnderline:n=!1,components:o={},componentsProps:a,fullWidth:i=!1,inputComponent:s="input",multiline:l=!1,slotProps:c,slots:u={},type:d="text",...p}=r,f=(e=>{const{classes:t,disableUnderline:r}=e,n=zs({root:["root",!r&&"underline"],input:["input"]},Qm,t);return{...t,...n}})(r),h={root:{ownerState:{disableUnderline:n}}},m=c??a?sn(c??a,h):h,g=u.root??o.Root??Ym,v=u.input??o.Input??Xm;return(0,dt.jsx)(Km,{slots:{root:g,input:v},slotProps:m,fullWidth:i,inputComponent:s,multiline:l,ref:t,type:d,...p,classes:f})}));Zm.muiName="Input";const eg=Zm;function tg(e){return vu("MuiFilledInput",e)}const rg={...Lm,...yu("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},ng=dl(Hm,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...Wm(e,t),!r.disableUnderline&&t.underline]}})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${rg.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${rg.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:i},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rg.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rg.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rg.disabled}, .${rg.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${rg.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{disableUnderline:!1,color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r]?.main}`}}}})),{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:12}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:12}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"25px 12px 8px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}}]}}))),og=dl(Um,{name:"MuiFilledInput",slot:"Input",overridesResolver:Vm})(gl((e=>{let{theme:t}=e;return{paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}}))),ag=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFilledInput"}),{disableUnderline:n=!1,components:o={},componentsProps:a,fullWidth:i=!1,hiddenLabel:s,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:d={},type:p="text",...f}=r,h={...r,disableUnderline:n,fullWidth:i,inputComponent:l,multiline:c,type:p},m=(e=>{const{classes:t,disableUnderline:r,startAdornment:n,endAdornment:o,size:a,hiddenLabel:i,multiline:s}=e,l=zs({root:["root",!r&&"underline",n&&"adornedStart",o&&"adornedEnd","small"===a&&`size${yl(a)}`,i&&"hiddenLabel",s&&"multiline"],input:["input"]},tg,t);return{...t,...l}})(r),g={root:{ownerState:h},input:{ownerState:h}},v=u??a?sn(g,u??a):g,y=d.root??o.Root??ng,b=d.input??o.Input??og;return(0,dt.jsx)(Km,{slots:{root:y,input:b},slotProps:v,fullWidth:i,inputComponent:l,multiline:c,ref:t,type:p,...f,classes:m})}));ag.muiName="Input";const ig=ag;var sg;const lg=dl("fieldset",{shouldForwardProp:cl})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),cg=dl("legend",{shouldForwardProp:cl})(gl((e=>{let{theme:t}=e;return{float:"unset",width:"auto",overflow:"hidden",variants:[{props:e=>{let{ownerState:t}=e;return!t.withLabel},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:e=>{let{ownerState:t}=e;return t.withLabel},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:e=>{let{ownerState:t}=e;return t.withLabel&&t.notched},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}})));function ug(e){return vu("MuiOutlinedInput",e)}const dg={...Lm,...yu("MuiOutlinedInput",["root","notchedOutline","input"])},pg=dl(Hm,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:Wm})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${dg.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${dg.focused} .${dg.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${dg.focused} .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${dg.error} .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${dg.disabled} .${dg.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:14}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:14}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"16.5px 14px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{padding:"8.5px 14px"}}]}}))),fg=dl((function(e){const{children:t,classes:r,className:n,label:o,notched:a,...i}=e,s=null!=o&&""!==o,l={...e,notched:a,withLabel:s};return(0,dt.jsx)(lg,{"aria-hidden":!0,className:n,ownerState:l,...i,children:(0,dt.jsx)(cg,{ownerState:l,children:s?(0,dt.jsx)("span",{children:o}):sg||(sg=(0,dt.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"}))})})}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(gl((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}}))),hg=dl(Um,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Vm})(gl((e=>{let{theme:t}=e;return{padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:0}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}}]}}))),mg=e.forwardRef((function(t,r){var n;const o=vl({props:t,name:"MuiOutlinedInput"}),{components:a={},fullWidth:i=!1,inputComponent:s="input",label:l,multiline:c=!1,notched:u,slots:d={},type:p="text",...f}=o,h=(e=>{const{classes:t}=e,r=zs({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},ug,t);return{...t,...r}})(o),m=Am(),g=Im({props:o,muiFormControl:m,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...o,color:g.color||"primary",disabled:g.disabled,error:g.error,focused:g.focused,formControl:m,fullWidth:i,hiddenLabel:g.hiddenLabel,multiline:c,size:g.size,type:p},y=d.root??a.Root??pg,b=d.input??a.Input??hg;return(0,dt.jsx)(Km,{slots:{root:y,input:b},renderSuffix:t=>(0,dt.jsx)(fg,{ownerState:v,className:h.notchedOutline,label:null!=l&&""!==l&&g.required?n||(n=(0,dt.jsxs)(e.Fragment,{children:[l,"\u2009","*"]})):l,notched:"undefined"!==typeof u?u:Boolean(t.startAdornment||t.filled||t.focused)}),fullWidth:i,inputComponent:s,multiline:c,ref:r,type:p,...f,classes:{...h,notchedOutline:null}})}));mg.muiName="Input";const gg=mg;function vg(e){return vu("MuiFormLabel",e)}const yg=yu("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),bg=dl("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"secondary"===r.color&&t.colorSecondary,r.filled&&t.filled]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${yg.focused}`]:{color:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${yg.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${yg.error}`]:{color:(t.vars||t).palette.error.main}}}]}}))),xg=dl("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(gl((e=>{let{theme:t}=e;return{[`&.${yg.error}`]:{color:(t.vars||t).palette.error.main}}}))),wg=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFormLabel"}),{children:n,className:o,color:a,component:i="label",disabled:s,error:l,filled:c,focused:u,required:d,...p}=r,f=Im({props:r,muiFormControl:Am(),states:["color","required","focused","disabled","error","filled"]}),h={...r,color:f.color||"primary",component:i,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required},m=(e=>{const{classes:t,color:r,focused:n,disabled:o,error:a,filled:i,required:s}=e;return zs({root:["root",`color${yl(r)}`,o&&"disabled",a&&"error",i&&"filled",n&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]},vg,t)})(h);return(0,dt.jsxs)(bg,{as:i,ownerState:h,className:Ns(m.root,o),ref:t,...p,children:[n,f.required&&(0,dt.jsxs)(xg,{ownerState:h,"aria-hidden":!0,className:m.asterisk,children:["\u2009","*"]})]})})),Sg=wg;function kg(e){return vu("MuiInputLabel",e)}yu("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Cg=dl(Sg,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${yg.asterisk}`]:t.asterisk},t.root,r.formControl&&t.formControl,"small"===r.size&&t.sizeSmall,r.shrink&&t.shrink,!r.disableAnimation&&t.animated,r.focused&&t.focused,t[r.variant]]}})(gl((e=>{let{theme:t}=e;return{display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:e=>{let{ownerState:t}=e;return t.shrink},style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:e=>{let{ownerState:t}=e;return!t.disableAnimation},style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"filled"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:e=>{let{variant:t,ownerState:r,size:n}=e;return"filled"===t&&r.shrink&&"small"===n},style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"outlined"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}}))),jg=e.forwardRef((function(e,t){const r=vl({name:"MuiInputLabel",props:e}),{disableAnimation:n=!1,margin:o,shrink:a,variant:i,className:s,...l}=r,c=Am();let u=a;"undefined"===typeof u&&c&&(u=c.filled||c.focused||c.adornedStart);const d=Im({props:r,muiFormControl:c,states:["size","variant","required","focused"]}),p={...r,disableAnimation:n,formControl:c,shrink:u,size:d.size,variant:d.variant,required:d.required,focused:d.focused},f=(e=>{const{classes:t,formControl:r,size:n,shrink:o,disableAnimation:a,variant:i,required:s}=e,l=zs({root:["root",r&&"formControl",!a&&"animated",o&&"shrink",n&&"normal"!==n&&`size${yl(n)}`,i],asterisk:[s&&"asterisk"]},kg,t);return{...t,...l}})(p);return(0,dt.jsx)(Cg,{"data-shrink":u,ref:t,className:Ns(f.root,s),...l,ownerState:p,classes:f})})),$g=jg;const Eg=function(t,r){return e.isValidElement(t)&&-1!==r.indexOf(t.type.muiName??t.type?._payload?.value?.muiName)};function _g(e){return vu("MuiFormControl",e)}yu("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Pg=dl("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`margin${yl(r.margin)}`],r.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Og=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiFormControl"}),{children:o,className:a,color:i="primary",component:s="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:d=!1,hiddenLabel:p=!1,margin:f="none",required:h=!1,size:m="medium",variant:g="outlined",...v}=n,y={...n,color:i,component:s,disabled:l,error:c,fullWidth:d,hiddenLabel:p,margin:f,required:h,size:m,variant:g},b=(e=>{const{classes:t,margin:r,fullWidth:n}=e;return zs({root:["root","none"!==r&&`margin${yl(r)}`,n&&"fullWidth"]},_g,t)})(y),[x,w]=e.useState((()=>{let t=!1;return o&&e.Children.forEach(o,(e=>{if(!Eg(e,["Input","Select"]))return;const r=Eg(e,["Select"])?e.props.input:e;r&&r.props.startAdornment&&(t=!0)})),t})),[S,k]=e.useState((()=>{let t=!1;return o&&e.Children.forEach(o,(e=>{Eg(e,["Input","Select"])&&(Fm(e.props,!0)||Fm(e.props.inputProps,!0))&&(t=!0)})),t})),[C,j]=e.useState(!1);l&&C&&j(!1);const $=void 0===u||l?C:u;let E;e.useRef(!1);const _=e.useCallback((()=>{k(!0)}),[]),P=e.useCallback((()=>{k(!1)}),[]),O=e.useMemo((()=>({adornedStart:x,setAdornedStart:w,color:i,disabled:l,error:c,filled:S,focused:$,fullWidth:d,hiddenLabel:p,size:m,onBlur:()=>{j(!1)},onFocus:()=>{j(!0)},onEmpty:P,onFilled:_,registerEffect:E,required:h,variant:g})),[x,i,l,c,S,$,d,p,E,P,_,h,m,g]);return(0,dt.jsx)(Tm.Provider,{value:O,children:(0,dt.jsx)(Pg,{as:s,ownerState:y,className:Ns(b.root,a),ref:r,...v,children:o})})})),Rg=Og;function Mg(e){return vu("MuiFormHelperText",e)}const Ng=yu("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Ig;const Tg=dl("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size&&t[`size${yl(r.size)}`],r.contained&&t.contained,r.filled&&t.filled]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Ng.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Ng.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:e=>{let{ownerState:t}=e;return t.contained},style:{marginLeft:14,marginRight:14}}]}}))),Ag=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFormHelperText"}),{children:n,className:o,component:a="p",disabled:i,error:s,filled:l,focused:c,margin:u,required:d,variant:p,...f}=r,h=Im({props:r,muiFormControl:Am(),states:["variant","size","disabled","error","filled","focused","required"]}),m={...r,component:a,contained:"filled"===h.variant||"outlined"===h.variant,variant:h.variant,size:h.size,disabled:h.disabled,error:h.error,filled:h.filled,focused:h.focused,required:h.required};delete m.ownerState;const g=(e=>{const{classes:t,contained:r,size:n,disabled:o,error:a,filled:i,focused:s,required:l}=e;return zs({root:["root",o&&"disabled",a&&"error",n&&`size${yl(n)}`,r&&"contained",s&&"focused",i&&"filled",l&&"required"]},Mg,t)})(m);return(0,dt.jsx)(Tg,{as:a,className:Ns(g.root,o),ref:t,...f,ownerState:m,children:" "===n?Ig||(Ig=(0,dt.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):n})})),Dg=Ag;function Fg(e){return vu("MuiNativeSelect",e)}const zg=yu("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Lg=dl("select")((e=>{let{theme:t}=e;return{MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${zg.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:e=>{let{ownerState:t}=e;return"filled"!==t.variant&&"outlined"!==t.variant},style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]}})),Bg=dl(Lg,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:cl,overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.select,t[r.variant],r.error&&t.error,{[`&.${zg.multiple}`]:t.multiple}]}})({}),Wg=dl("svg")((e=>{let{theme:t}=e;return{position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${zg.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:e=>{let{ownerState:t}=e;return t.open},style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]}})),Vg=dl(Wg,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${yl(r.variant)}`],r.open&&t.iconOpen]}})({}),Hg=e.forwardRef((function(t,r){const{className:n,disabled:o,error:a,IconComponent:i,inputRef:s,variant:l="standard",...c}=t,u={...t,disabled:o,variant:l,error:a},d=(e=>{const{classes:t,variant:r,disabled:n,multiple:o,open:a,error:i}=e;return zs({select:["select",r,n&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${yl(r)}`,a&&"iconOpen",n&&"disabled"]},Fg,t)})(u);return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)(Bg,{ownerState:u,className:Ns(d.select,n),disabled:o,ref:s||r,...c}),t.multiple?null:(0,dt.jsx)(Vg,{as:i,ownerState:u,className:d.icon})]})})),Ug=Hg;function qg(e){return vu("MuiSelect",e)}const Gg=yu("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Kg;const Qg=dl(Lg,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`&.${Gg.select}`]:t.select},{[`&.${Gg.select}`]:t[r.variant]},{[`&.${Gg.error}`]:t.error},{[`&.${Gg.multiple}`]:t.multiple}]}})({[`&.${Gg.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Jg=dl(Wg,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${yl(r.variant)}`],r.open&&t.iconOpen]}})({}),Yg=dl("input",{shouldForwardProp:e=>ll(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Xg(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function Zg(e){return null==e||"string"===typeof e&&!e.trim()}const ev=e.forwardRef((function(t,r){const{"aria-describedby":n,"aria-label":o,autoFocus:a,autoWidth:i,children:s,className:l,defaultOpen:c,defaultValue:u,disabled:d,displayEmpty:p,error:f=!1,IconComponent:h,inputRef:m,labelId:g,MenuProps:v={},multiple:y,name:b,onBlur:x,onChange:w,onClose:S,onFocus:k,onOpen:C,open:j,readOnly:$,renderValue:E,required:_,SelectDisplayProps:P={},tabIndex:O,type:R,value:M,variant:N="standard",...I}=t,[T,A]=Nu({controlled:M,default:u,name:"Select"}),[D,F]=Nu({controlled:j,default:c,name:"Select"}),z=e.useRef(null),L=e.useRef(null),[B,W]=e.useState(null),{current:V}=e.useRef(null!=j),[H,U]=e.useState(),q=Al(r,m),G=e.useCallback((e=>{L.current=e,e&&W(e)}),[]),K=B?.parentNode;e.useImperativeHandle(q,(()=>({focus:()=>{L.current.focus()},node:z.current,value:T})),[T]),e.useEffect((()=>{c&&D&&B&&!V&&(U(i?null:K.clientWidth),L.current.focus())}),[B,i]),e.useEffect((()=>{a&&L.current.focus()}),[a]),e.useEffect((()=>{if(!g)return;const e=Md(L.current).getElementById(g);if(e){const t=()=>{getSelection().isCollapsed&&L.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[g]);const Q=(e,t)=>{e?C&&C(t):S&&S(t),V||(U(i?null:K.clientWidth),F(e))},J=e.Children.toArray(s),Y=e=>t=>{let r;if(t.currentTarget.hasAttribute("tabindex")){if(y){r=Array.isArray(T)?T.slice():[];const t=T.indexOf(e.props.value);-1===t?r.push(e.props.value):r.splice(t,1)}else r=e.props.value;if(e.props.onClick&&e.props.onClick(t),T!==r&&(A(r),w)){const n=t.nativeEvent||t,o=new n.constructor(n.type,n);Object.defineProperty(o,"target",{writable:!0,value:{value:r,name:b}}),w(o,e)}y||Q(!1,t)}},X=null!==B&&D;let Z,ee;delete I["aria-invalid"];const te=[];let re=!1,ne=!1;(Fm({value:T})||p)&&(E?Z=E(T):re=!0);const oe=J.map((t=>{if(!e.isValidElement(t))return null;let r;if(y){if(!Array.isArray(T))throw new Error(tn(2));r=T.some((e=>Xg(e,t.props.value))),r&&re&&te.push(t.props.children)}else r=Xg(T,t.props.value),r&&re&&(ee=t.props.children);return r&&(ne=!0),e.cloneElement(t,{"aria-selected":r?"true":"false",onClick:Y(t),onKeyUp:e=>{" "===e.key&&e.preventDefault(),t.props.onKeyUp&&t.props.onKeyUp(e)},role:"option",selected:r,value:void 0,"data-value":t.props.value})}));re&&(Z=y?0===te.length?null:te.reduce(((e,t,r)=>(e.push(t),r<te.length-1&&e.push(", "),e)),[]):ee);let ae,ie=H;!i&&V&&B&&(ie=K.clientWidth),ae="undefined"!==typeof O?O:d?null:0;const se=P.id||(b?`mui-component-select-${b}`:void 0),le={...t,variant:N,value:T,open:X,error:f},ce=(e=>{const{classes:t,variant:r,disabled:n,multiple:o,open:a,error:i}=e;return zs({select:["select",r,n&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${yl(r)}`,a&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]},qg,t)})(le),ue={...v.PaperProps,...v.slotProps?.paper},de=Ru();return(0,dt.jsxs)(e.Fragment,{children:[(0,dt.jsx)(Qg,{as:"div",ref:G,tabIndex:ae,role:"combobox","aria-controls":X?de:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":X?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[g,se].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":_?"true":void 0,"aria-invalid":f?"true":void 0,onKeyDown:e=>{if(!$){[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),Q(!0,e))}},onMouseDown:d||$?null:e=>{0===e.button&&(e.preventDefault(),L.current.focus(),Q(!0,e))},onBlur:e=>{!X&&x&&(Object.defineProperty(e,"target",{writable:!0,value:{value:T,name:b}}),x(e))},onFocus:k,...P,ownerState:le,className:Ns(P.className,ce.select,l),id:se,children:Zg(Z)?Kg||(Kg=(0,dt.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):Z}),(0,dt.jsx)(Yg,{"aria-invalid":f,value:Array.isArray(T)?T.join(","):T,name:b,ref:z,"aria-hidden":!0,onChange:e=>{const t=J.find((t=>t.props.value===e.target.value));void 0!==t&&(A(t.props.value),w&&w(e,t))},tabIndex:-1,disabled:d,className:ce.nativeInput,autoFocus:a,required:_,...I,ownerState:le}),(0,dt.jsx)(Jg,{as:h,className:ce.icon,ownerState:le}),(0,dt.jsx)(Hp,{id:`menu-${b||""}`,anchorEl:K,open:X,onClose:e=>{Q(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...v,slotProps:{...v.slotProps,list:{"aria-labelledby":g,role:"listbox","aria-multiselectable":y?"true":void 0,disableListWrap:!0,id:de,...v.MenuListProps},paper:{...ue,style:{minWidth:ie,...null!=ue?ue.style:null}}},children:oe})]})})),tv=ev,rv=Pf((0,dt.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),nv={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>cl(e)&&"variant"!==e,slot:"Root"},ov=dl(eg,nv)(""),av=dl(gg,nv)(""),iv=dl(ig,nv)(""),sv=e.forwardRef((function(t,r){const n=vl({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:a,classes:i={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=rv,id:d,input:p,inputProps:f,label:h,labelId:m,MenuProps:g,multiple:v=!1,native:y=!1,onClose:b,onOpen:x,open:w,renderValue:S,SelectDisplayProps:k,variant:C="outlined",...j}=n,$=y?Ug:tv,E=Im({props:n,muiFormControl:Am(),states:["variant","error"]}),_=E.variant||C,P={...n,variant:_,classes:i},O=(e=>{const{classes:t}=e,r=zs({root:["root"]},qg,t);return{...t,...r}})(P),{root:R,...M}=O,N=p||{standard:(0,dt.jsx)(ov,{ownerState:P}),outlined:(0,dt.jsx)(av,{label:h,ownerState:P}),filled:(0,dt.jsx)(iv,{ownerState:P})}[_],I=Al(r,Bs(N));return(0,dt.jsx)(e.Fragment,{children:e.cloneElement(N,{inputComponent:$,inputProps:{children:a,error:E.error,IconComponent:u,variant:_,type:void 0,multiple:v,...y?{id:d}:{autoWidth:o,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:b,onOpen:x,open:w,renderValue:S,SelectDisplayProps:{id:d,...k}},...f,classes:f?sn(M,f.classes):M,...p?p.props.inputProps:{}},...(v&&y||c)&&"outlined"===_?{notched:!0}:{},ref:I,className:Ns(N.props.className,s,O.root),...!p&&{variant:_},...j})})}));sv.muiName="Select";const lv=sv;function cv(e){return vu("MuiTextField",e)}yu("MuiTextField",["root"]);const uv={standard:eg,filled:ig,outlined:gg},dv=dl(Rg,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),pv=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiTextField"}),{autoComplete:n,autoFocus:o=!1,children:a,className:i,color:s="primary",defaultValue:l,disabled:c=!1,error:u=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:f,id:h,InputLabelProps:m,inputProps:g,InputProps:v,inputRef:y,label:b,maxRows:x,minRows:w,multiline:S=!1,name:k,onBlur:C,onChange:j,onFocus:$,placeholder:E,required:_=!1,rows:P,select:O=!1,SelectProps:R,slots:M={},slotProps:N={},type:I,value:T,variant:A="outlined",...D}=r,F={...r,autoFocus:o,color:s,disabled:c,error:u,fullWidth:p,multiline:S,required:_,select:O,variant:A},z=(e=>{const{classes:t}=e;return zs({root:["root"]},cv,t)})(F);const L=Ru(h),B=f&&L?`${L}-helper-text`:void 0,W=b&&L?`${L}-label`:void 0,V=uv[A],H={slots:M,slotProps:{input:v,inputLabel:m,htmlInput:g,formHelperText:d,select:R,...N}},U={},q=H.slotProps.inputLabel;"outlined"===A&&(q&&"undefined"!==typeof q.shrink&&(U.notched=q.shrink),U.label=b),O&&(R&&R.native||(U.id=void 0),U["aria-describedby"]=void 0);const[G,K]=Iu("input",{elementType:V,externalForwardedProps:H,additionalProps:U,ownerState:F}),[Q,J]=Iu("inputLabel",{elementType:$g,externalForwardedProps:H,ownerState:F}),[Y,X]=Iu("htmlInput",{elementType:"input",externalForwardedProps:H,ownerState:F}),[Z,ee]=Iu("formHelperText",{elementType:Dg,externalForwardedProps:H,ownerState:F}),[te,re]=Iu("select",{elementType:lv,externalForwardedProps:H,ownerState:F}),ne=(0,dt.jsx)(G,{"aria-describedby":B,autoComplete:n,autoFocus:o,defaultValue:l,fullWidth:p,multiline:S,name:k,rows:P,maxRows:x,minRows:w,type:I,value:T,id:L,inputRef:y,onBlur:C,onChange:j,onFocus:$,placeholder:E,inputProps:X,slots:{input:M.htmlInput?Y:void 0},...K});return(0,dt.jsxs)(dv,{className:Ns(z.root,i),disabled:c,error:u,fullWidth:p,ref:t,required:_,color:s,variant:A,ownerState:F,...D,children:[null!=b&&""!==b&&(0,dt.jsx)(Q,{htmlFor:L,id:W,...J,children:b}),O?(0,dt.jsx)(te,{"aria-describedby":B,id:L,labelId:W,value:T,input:ne,...re,children:a}):ne,f&&(0,dt.jsx)(Z,{id:B,...ee,children:f})]})})),fv=pv,hv=Pf((0,dt.jsx)("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"}),"FileUpload"),mv=Pf((0,dt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),gv=Pf((0,dt.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");function vv(){const[t,r]=(0,e.useState)("matterbridge-"),[n,o]=(0,e.useState)(!1),[a,i]=e.useState(null),{logMessage:s}=(0,e.useContext)(Qh),l=e=>{""!==e&&r(e),i(null)};return tM&&console.log("AddRemovePlugins rendering..."),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 auto",alignItems:"center",justifyContent:"space-between",margin:"0px",padding:"10px",gap:"20px"},onDragOver:e=>{e.preventDefault(),o(!0)},onDragLeave:()=>{o(!1)},onDrop:e=>{e.preventDefault(),o(!1);const t=e.dataTransfer.files[0];if(t){s("Plugins",`Installing package ${t.name}. Please wait...`);const e=new FormData;e.append("file",t),e.append("filename",t.name),fetch("./api/uploadpackage",{method:"POST",body:e}).then((e=>e.text())).then((e=>{s("Plugins",`Server response: ${e}`)})).catch((e=>{console.error("Error uploading plugin file:",e),s("Plugins",`Error installing package ${e}`)}))}},children:[(0,dt.jsx)(fv,{value:t,onChange:e=>{r(e.target.value)},size:"small",id:"plugin-name",label:"Plugin name or plugin path",variant:"outlined",fullWidth:!0}),(0,dt.jsx)(Rd,{onClick:e=>{i(e.currentTarget)},children:(0,dt.jsx)(gv,{})}),(0,dt.jsxs)(Hp,{id:"simple-menu",anchorEl:a,keepMounted:!0,open:Boolean(a),onClose:()=>l(""),children:[(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-zigbee2mqtt"),children:"matterbridge-zigbee2mqtt"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-somfy-tahoma"),children:"matterbridge-somfy-tahoma"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-shelly"),children:"matterbridge-shelly"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-hass"),children:"matterbridge-hass"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-webhooks"),children:"matterbridge-webhooks"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-example-accessory-platform"),children:"matterbridge-example-accessory-platform"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-example-dynamic-platform"),children:"matterbridge-example-dynamic-platform"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-door"),children:"matterbridge-eve-door"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-motion"),children:"matterbridge-eve-motion"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-energy"),children:"matterbridge-eve-energy"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-weather"),children:"matterbridge-eve-weather"}),(0,dt.jsx)(tf,{onClick:()=>l("matterbridge-eve-room"),children:"matterbridge-eve-room"})]}),(0,dt.jsx)(Uu,{title:"Install or update a plugin from npm",children:(0,dt.jsx)(Ah,{onClick:()=>{"matterbridge"===t.split("@")[0]?s("Matterbridge",`Installing matterbridge package: ${t}`):s("Plugins",`Installing plugin: ${t}`),Bf("installplugin",t)},endIcon:(0,dt.jsx)(Tf,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Install"})}),(0,dt.jsx)(Uu,{title:"Upload and install a plugin from a tarball",children:(0,dt.jsx)(Ah,{onClick:()=>{document.getElementById("file-upload").click()},endIcon:(0,dt.jsx)(hv,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Upload"})}),(0,dt.jsx)(Uu,{title:"Add an installed plugin",children:(0,dt.jsx)(Ah,{onClick:()=>{s("Plugins",`Adding plugin: ${t}`),Bf("addplugin",t)},endIcon:(0,dt.jsx)(mv,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px",minWidth:"90px"},children:" Add"})}),(0,dt.jsx)("input",{id:"file-upload",type:"file",accept:".tgz",style:{display:"none"},onChange:e=>{const t=e.target.files[0];if(t){s("Plugins",`Uploading package ${t.name}`);const e=new FormData;e.append("file",t),e.append("filename",t.name),fetch("./api/uploadpackage",{method:"POST",body:e}).then((e=>e.text())).then((e=>{s("Plugins",`Server response: ${e}`)})).catch((e=>{console.error("Error uploading plugin file:",e),s("Plugins",`Error uploading package ${e}`)}))}}})]})}var yv=r(1094);function bv(e){return vu("MuiDialogActions",e)}yu("MuiDialogActions",["root","spacing"]);const xv=dl("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableSpacing},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),wv=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiDialogActions"}),{className:n,disableSpacing:o=!1,...a}=r,i={...r,disableSpacing:o},s=(e=>{const{classes:t,disableSpacing:r}=e;return zs({root:["root",!r&&"spacing"]},bv,t)})(i);return(0,dt.jsx)(xv,{className:Ns(s.root,n),ownerState:i,ref:t,...a})})),Sv=wv;function kv(e){return vu("MuiFormGroup",e)}yu("MuiFormGroup",["root","row","error"]);const Cv=dl("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),jv=e.forwardRef((function(e,t){const r=vl({props:e,name:"MuiFormGroup"}),{className:n,row:o=!1,...a}=r,i=Im({props:r,muiFormControl:Am(),states:["error"]}),s={...r,row:o,error:i.error},l=(e=>{const{classes:t,row:r,error:n}=e;return zs({root:["root",r&&"row",n&&"error"]},kv,t)})(s);return(0,dt.jsx)(Cv,{className:Ns(l.root,n),ownerState:s,ref:t,...a})})),$v=jv;function Ev(e){return vu("MuiFormControlLabel",e)}const _v=yu("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Pv=dl("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${_v.label}`]:t.label},t.root,t[`labelPlacement${yl(r.labelPlacement)}`]]}})(gl((e=>{let{theme:t}=e;return{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${_v.disabled}`]:{cursor:"default"},[`& .${_v.label}`]:{[`&.${_v.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:e=>{let{labelPlacement:t}=e;return"start"===t||"top"===t||"bottom"===t},style:{marginLeft:16}}]}}))),Ov=dl("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(gl((e=>{let{theme:t}=e;return{[`&.${_v.error}`]:{color:(t.vars||t).palette.error.main}}}))),Rv=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiFormControlLabel"}),{checked:o,className:a,componentsProps:i={},control:s,disabled:l,disableTypography:c,inputRef:u,label:d,labelPlacement:p="end",name:f,onChange:h,required:m,slots:g={},slotProps:v={},value:y,...b}=n,x=Am(),w=l??s.props.disabled??x?.disabled,S=m??s.props.required,k={disabled:w,required:S};["checked","name","onChange","value","inputRef"].forEach((e=>{"undefined"===typeof s.props[e]&&"undefined"!==typeof n[e]&&(k[e]=n[e])}));const C=Im({props:n,muiFormControl:x,states:["error"]}),j={...n,disabled:w,labelPlacement:p,required:S,error:C.error},$=(e=>{const{classes:t,disabled:r,labelPlacement:n,error:o,required:a}=e;return zs({root:["root",r&&"disabled",`labelPlacement${yl(n)}`,o&&"error",a&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",o&&"error"]},Ev,t)})(j),E={slots:g,slotProps:{...i,...v}},[_,P]=Iu("typography",{elementType:vf,externalForwardedProps:E,ownerState:j});let O=d;return null==O||O.type===vf||c||(O=(0,dt.jsx)(_,{component:"span",...P,className:Ns($.label,P?.className),children:O})),(0,dt.jsxs)(Pv,{className:Ns($.root,a),ownerState:j,ref:r,...b,children:[e.cloneElement(s,k),S?(0,dt.jsxs)("div",{children:[O,(0,dt.jsxs)(Ov,{ownerState:j,"aria-hidden":!0,className:$.asterisk,children:["\u2009","*"]})]}):O]})})),Mv=Rv;function Nv(e){return vu("PrivateSwitchBase",e)}yu("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Iv=dl(hd)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"start"===t&&"small"!==r.size},style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"end"===t&&"small"!==r.size},style:{marginRight:-12}}]}),Tv=dl("input",{shouldForwardProp:cl})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Av=e.forwardRef((function(e,t){const{autoFocus:r,checked:n,checkedIcon:o,defaultChecked:a,disabled:i,disableFocusRipple:s=!1,edge:l=!1,icon:c,id:u,inputProps:d,inputRef:p,name:f,onBlur:h,onChange:m,onFocus:g,readOnly:v,required:y=!1,tabIndex:b,type:x,value:w,slots:S={},slotProps:k={},...C}=e,[j,$]=Nu({controlled:n,default:Boolean(a),name:"SwitchBase",state:"checked"}),E=Am();let _=i;E&&"undefined"===typeof _&&(_=E.disabled);const P="checkbox"===x||"radio"===x,O={...e,checked:j,disabled:_,disableFocusRipple:s,edge:l},R=(e=>{const{classes:t,checked:r,disabled:n,edge:o}=e;return zs({root:["root",r&&"checked",n&&"disabled",o&&`edge${yl(o)}`],input:["input"]},Nv,t)})(O),M={slots:S,slotProps:{input:d,...k}},[N,I]=Iu("root",{ref:t,elementType:Iv,className:R.root,shouldForwardComponentProp:!0,externalForwardedProps:{...M,component:"span",...C},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{g&&g(e),E&&E.onFocus&&E.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{h&&h(e),E&&E.onBlur&&E.onBlur(e)})(t)}}),ownerState:O,additionalProps:{centerRipple:!0,focusRipple:!s,disabled:_,role:void 0,tabIndex:null}}),[T,A]=Iu("input",{ref:p,elementType:Tv,className:R.input,externalForwardedProps:M,getSlotProps:e=>({onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;$(t),m&&m(e,t)})(t)}}),ownerState:O,additionalProps:{autoFocus:r,checked:n,defaultChecked:a,disabled:_,id:P?u:void 0,name:f,readOnly:v,required:y,tabIndex:b,type:x,..."checkbox"===x&&void 0===w?{}:{value:w}}});return(0,dt.jsxs)(N,{...I,children:[(0,dt.jsx)(T,{...A}),j?o:c]})})),Dv=Av,Fv=Pf((0,dt.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),zv=Pf((0,dt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Lv=Pf((0,dt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Bv(e){return vu("MuiCheckbox",e)}const Wv=yu("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Vv=dl(Dv,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.indeterminate&&t.indeterminate,t[`size${yl(r.size)}`],"default"!==r.color&&t[`color${yl(r.color)}`]]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${Wv.checked}, &.${Wv.indeterminate}`]:{color:(t.vars||t).palette[r].main},[`&.${Wv.disabled}`]:{color:(t.vars||t).palette.action.disabled}}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}}))),Hv=(0,dt.jsx)(zv,{}),Uv=(0,dt.jsx)(Fv,{}),qv=(0,dt.jsx)(Lv,{}),Gv=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiCheckbox"}),{checkedIcon:o=Hv,color:a="primary",icon:i=Uv,indeterminate:s=!1,indeterminateIcon:l=qv,inputProps:c,size:u="medium",disableRipple:d=!1,className:p,slots:f={},slotProps:h={},...m}=n,g=s?l:i,v=s?l:o,y={...n,disableRipple:d,color:a,indeterminate:s,size:u},b=(e=>{const{classes:t,indeterminate:r,color:n,size:o}=e,a=zs({root:["root",r&&"indeterminate",`color${yl(n)}`,`size${yl(o)}`]},Bv,t);return{...t,...a}})(y),x=h.input??c,[w,S]=Iu("root",{ref:r,elementType:Vv,className:Ns(b.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:f,slotProps:h,...m},ownerState:y,additionalProps:{type:"checkbox",icon:e.cloneElement(g,{fontSize:g.props.fontSize??u}),checkedIcon:e.cloneElement(v,{fontSize:v.props.fontSize??u}),disableRipple:d,slots:f,slotProps:{input:_p("function"===typeof x?x(y):x,{"data-indeterminate":s})}}});return(0,dt.jsx)(w,{...S,classes:b})})),Kv=Gv,Qv=Pf((0,dt.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),Jv=Pf((0,dt.jsx)("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"}),"Favorite"),Yv=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help"),Xv=Pf((0,dt.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-7 9h-2V5h2zm0 4h-2v-2h2z"}),"Announcement"),Zv=Pf((0,dt.jsx)("path",{d:"m17.66 9.53-7.07 7.07-4.24-4.24 1.41-1.41 2.83 2.83 5.66-5.66zM4 12c0-2.33 1.02-4.42 2.62-5.88L9 8.5v-6H3l2.2 2.2C3.24 6.52 2 9.11 2 12c0 5.19 3.95 9.45 9 9.95v-2.02c-3.94-.49-7-3.86-7-7.93m18 0c0-5.19-3.95-9.45-9-9.95v2.02c3.94.49 7 3.86 7 7.93 0 2.33-1.02 4.42-2.62 5.88L15 15.5v6h6l-2.2-2.2c1.96-1.82 3.2-4.41 3.2-7.3"}),"PublishedWithChanges"),ey=Pf((0,dt.jsx)("path",{d:"M21.19 21.19 2.81 2.81 1.39 4.22l2.27 2.27C2.61 8.07 2 9.96 2 12c0 5.52 4.48 10 10 10 2.04 0 3.93-.61 5.51-1.66l2.27 2.27zm-10.6-4.59-4.24-4.24 1.41-1.41 2.83 2.83.18-.18 1.41 1.41zm3-5.84-7.1-7.1C8.07 2.61 9.96 2 12 2c5.52 0 10 4.48 10 10 0 2.04-.61 3.93-1.66 5.51L15 12.17l2.65-2.65-1.41-1.41z"}),"Unpublished"),ty=Pf((0,dt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever"),ry=Pf((0,dt.jsx)("path",{d:"M15 21h-2v-2h2zm-2-7h-2v5h2zm8-2h-2v4h2zm-2-2h-2v2h2zM7 12H5v2h2zm-2-2H3v2h2zm7-5h2V3h-2zm-7.5-.5v3h3v-3zM9 9H3V3h6zm-4.5 7.5v3h3v-3zM9 21H3v-6h6zm7.5-16.5v3h3v-3zM21 9h-6V3h6zm-2 10v-3h-4v2h2v3h4v-2zm-2-7h-4v2h4zm-4-2H7v2h2v2h2v-2h2zm1-1V7h-2V5h-2v4zM6.75 5.25h-1.5v1.5h1.5zm0 12h-1.5v1.5h1.5zm12-12h-1.5v1.5h1.5z"}),"QrCode2");function ny(e){let{status:t,enabledText:r="Enabled",disabledText:n,tooltipText:o,onClick:a}=e;return void 0===t?(0,dt.jsx)("div",{style:{margin:"-2.5px"},children:(0,dt.jsx)("div",{})}):void 0!==o?(0,dt.jsxs)("div",{className:"tooltip-container",children:[(0,dt.jsx)("div",{className:t?"status-enabled":"status-disabled",style:{cursor:"default"},onClick:a,children:t?r:null!==n&&void 0!==n?n:r}),(0,dt.jsx)("span",{className:"tooltip-text",children:o})]}):(0,dt.jsx)("div",{className:t?"status-enabled":"status-disabled",style:{cursor:"default"},children:t?r:null!==n&&void 0!==n?n:r})}function oy(e){return vu("MuiListItem",e)}yu("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function ay(e){return vu("MuiListItemButton",e)}const iy=yu("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function sy(e){return vu("MuiListItemSecondaryAction",e)}yu("MuiListItemSecondaryAction",["root","disableGutters"]);const ly=dl("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:e=>{let{ownerState:t}=e;return t.disableGutters},style:{right:0}}]}),cy=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...a}=n,i=e.useContext(Nd),s={...n,disableGutters:i.disableGutters},l=(e=>{const{disableGutters:t,classes:r}=e;return zs({root:["root",t&&"disableGutters"]},sy,r)})(s);return(0,dt.jsx)(ly,{className:Ns(l.root,o),ownerState:s,ref:r,...a})}));cy.muiName="ListItemSecondaryAction";const uy=cy,dy=dl("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,"flex-start"===r.alignItems&&t.alignItemsFlexStart,r.divider&&t.divider,!r.disableGutters&&t.gutters,!r.disablePadding&&t.padding,r.hasSecondaryAction&&t.secondaryAction]}})(gl((e=>{let{theme:t}=e;return{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:e=>{let{ownerState:t}=e;return!t.disablePadding},style:{paddingTop:8,paddingBottom:8}},{props:e=>{let{ownerState:t}=e;return!t.disablePadding&&t.dense},style:{paddingTop:4,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return!t.disablePadding&&!t.disableGutters},style:{paddingLeft:16,paddingRight:16}},{props:e=>{let{ownerState:t}=e;return!t.disablePadding&&!!t.secondaryAction},style:{paddingRight:48}},{props:e=>{let{ownerState:t}=e;return!!t.secondaryAction},style:{[`& > .${iy.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:e=>{let{ownerState:t}=e;return t.divider},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:e=>{let{ownerState:t}=e;return t.button},style:{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:e=>{let{ownerState:t}=e;return t.hasSecondaryAction},style:{paddingRight:48}}]}}))),py=dl("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),fy=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItem"}),{alignItems:o="center",children:a,className:i,component:s,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:d,...p}={},dense:f=!1,disableGutters:h=!1,disablePadding:m=!1,divider:g=!1,secondaryAction:v,slotProps:y={},slots:b={},...x}=n,w=e.useContext(Nd),S=e.useMemo((()=>({dense:f||w.dense||!1,alignItems:o,disableGutters:h})),[o,w.dense,f,h]),k=e.useRef(null),C=e.Children.toArray(a),j=C.length&&Eg(C[C.length-1],["ListItemSecondaryAction"]),$={...n,alignItems:o,dense:S.dense,disableGutters:h,disablePadding:m,divider:g,hasSecondaryAction:j},E=(e=>{const{alignItems:t,classes:r,dense:n,disableGutters:o,disablePadding:a,divider:i,hasSecondaryAction:s}=e;return zs({root:["root",n&&"dense",!o&&"gutters",!a&&"padding",i&&"divider","flex-start"===t&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},oy,r)})($),_=Al(k,r),P=b.root||l.Root||dy,O=y.root||c.root||{},R={className:Ns(E.root,O.className,i),...x};let M=s||"li";return j?(M=R.component||s?M:"div","li"===u&&("li"===M?M="div":"li"===R.component&&(R.component="div")),(0,dt.jsx)(Nd.Provider,{value:S,children:(0,dt.jsxs)(py,{as:u,className:Ns(E.container,d),ref:_,ownerState:$,...p,children:[(0,dt.jsx)(P,{...O,...!Qd(P)&&{as:M,ownerState:{...$,...O.ownerState}},...R,children:C}),C.pop()]})})):(0,dt.jsx)(Nd.Provider,{value:S,children:(0,dt.jsxs)(P,{...O,as:M,ref:_,...!Qd(P)&&{ownerState:{...$,...O.ownerState}},...R,children:[C,v&&(0,dt.jsx)(uy,{children:v})]})})})),hy=fy,my=dl(hd,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,"flex-start"===r.alignItems&&t.alignItemsFlexStart,r.divider&&t.divider,!r.disableGutters&&t.gutters]}})(gl((e=>{let{theme:t}=e;return{display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${iy.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${iy.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${iy.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:No(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:No(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${iy.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${iy.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:e=>{let{ownerState:t}=e;return t.divider},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:e=>{let{ownerState:t}=e;return!t.disableGutters},style:{paddingLeft:16,paddingRight:16}},{props:e=>{let{ownerState:t}=e;return t.dense},style:{paddingTop:4,paddingBottom:4}}]}}))),gy=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:a=!1,component:i="div",children:s,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:d,selected:p=!1,className:f,...h}=n,m=e.useContext(Nd),g=e.useMemo((()=>({dense:l||m.dense||!1,alignItems:o,disableGutters:c})),[o,m.dense,l,c]),v=e.useRef(null);Ld((()=>{a&&v.current&&v.current.focus()}),[a]);const y={...n,alignItems:o,dense:g.dense,disableGutters:c,divider:u,selected:p},b=(e=>{const{alignItems:t,classes:r,dense:n,disabled:o,disableGutters:a,divider:i,selected:s}=e,l=zs({root:["root",n&&"dense",!a&&"gutters",i&&"divider",o&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},ay,r);return{...r,...l}})(y),x=Al(v,r);return(0,dt.jsx)(Nd.Provider,{value:g,children:(0,dt.jsx)(my,{ref:x,href:h.href||h.to,component:(h.href||h.to)&&"div"===i?"button":i,focusVisibleClassName:Ns(b.focusVisible,d),ownerState:y,className:Ns(b.root,f),...h,classes:b,children:s})})})),vy=gy,yy=Pf((0,dt.jsx)("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),by=Pf((0,dt.jsx)("path",{d:"m1 9 2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9m8 8 3 3 3-3c-1.65-1.66-4.34-1.66-6 0m-4-4 2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13"}),"Wifi"),xy=Pf((0,dt.jsx)("path",{d:"M17.71 7.71 12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29zM13 5.83l1.88 1.88L13 9.59zm1.88 10.46L13 18.17v-3.76z"}),"Bluetooth"),wy=Pf((0,dt.jsx)("path",{d:"M8.4 18.2c.38.5.6 1.12.6 1.8 0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3c.44 0 .85.09 1.23.26l1.41-1.77c-.92-1.03-1.29-2.39-1.09-3.69l-2.03-.68c-.54.83-1.46 1.38-2.52 1.38-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3c0 .07 0 .14-.01.21l2.03.68c.64-1.21 1.82-2.09 3.22-2.32V5.91C9.96 5.57 9 4.4 9 3c0-1.66 1.34-3 3-3s3 1.34 3 3c0 1.4-.96 2.57-2.25 2.91v2.16c1.4.23 2.58 1.11 3.22 2.32L18 9.71V9.5c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-1.06 0-1.98-.55-2.52-1.37l-2.03.68c.2 1.29-.16 2.65-1.09 3.69l1.41 1.77Q17.34 17 18 17c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.68.22-1.3.6-1.8l-1.41-1.77c-1.35.75-3.01.76-4.37 0z"}),"Hub"),Sy=Pf([(0,dt.jsx)("path",{d:"M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"},"0"),(0,dt.jsx)("path",{d:"m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"},"1")],"KeyboardDoubleArrowUp"),ky=Pf([(0,dt.jsx)("path",{d:"M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z"},"0"),(0,dt.jsx)("path",{d:"m18 13-1.41-1.41L12 16.17l-4.59-4.58L6 13l6 6z"},"1")],"KeyboardDoubleArrowDown"),Cy=Pf((0,dt.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),jy=Pf((0,dt.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr"),$y=Pf((0,dt.jsx)("path",{d:"m17 16-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5z"}),"DeviceHub");function Ey(e){return"object"===typeof e&&null!==e&&(!("number"===typeof e.lastModified&&"undefined"!==typeof File&&e instanceof File)&&(!("function"===typeof e.getMonth&&"undefined"!==typeof Date&&e instanceof Date)&&!Array.isArray(e)))}function _y(e){if(""===e)return;if(null===e)return null;if(/\.$/.test(e))return e;if(/\.0$/.test(e))return e;if(/\.\d*0$/.test(e))return e;const t=Number(e);return"number"===typeof t&&!Number.isNaN(t)?t:e}const Py="__additional_property",Oy="additionalProperties",Ry="allOf",My="anyOf",Ny="const",Iy="default",Ty="dependencies",Ay="enum",Dy="__errors",Fy="$id",zy="if",Ly="items",By="$name",Wy="oneOf",Vy="properties",Hy="required",Uy="submitButtonOptions",qy="$ref",Gy="__rjsf_additionalProperties",Ky="__rjsf_rootSchema",Qy="ui:widget",Jy="ui:options";function Yy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).filter((e=>0===e.indexOf("ui:"))).reduce(((t,r)=>{const n=e[r];return r===Qy&&Ey(n)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),t):r===Jy&&Ey(n)?{...t,...n}:{...t,[r.substring(3)]:n}}),{...t})}function Xy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!e.additionalProperties)return!1;const{expandable:n=!0}=Yy(t);return!1===n?n:void 0===e.maxProperties||!r||Object.keys(r).length<e.maxProperties}const Zy="object"==typeof global&&global&&global.Object===Object&&global;var eb="object"==typeof self&&self&&self.Object===Object&&self;const tb=Zy||eb||Function("return this")();const rb=tb.Symbol;var nb=Object.prototype,ob=nb.hasOwnProperty,ab=nb.toString,ib=rb?rb.toStringTag:void 0;const sb=function(e){var t=ob.call(e,ib),r=e[ib];try{e[ib]=void 0;var n=!0}catch(Ya){}var o=ab.call(e);return n&&(t?e[ib]=r:delete e[ib]),o};var lb=Object.prototype.toString;const cb=function(e){return lb.call(e)};var ub=rb?rb.toStringTag:void 0;const db=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ub&&ub in Object(e)?sb(e):cb(e)};const pb=function(e,t){return function(r){return e(t(r))}};const fb=pb(Object.getPrototypeOf,Object);const hb=function(e){return null!=e&&"object"==typeof e};var mb=Function.prototype,gb=Object.prototype,vb=mb.toString,yb=gb.hasOwnProperty,bb=vb.call(Object);const xb=function(e){if(!hb(e)||"[object Object]"!=db(e))return!1;var t=fb(e);if(null===t)return!0;var r=yb.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&vb.call(r)==bb};function wb(e){const t={[Dy]:[],addError(e){this[Dy].push(e)}};if(Array.isArray(e))return e.reduce(((e,t,r)=>({...e,[r]:wb(t)})),t);if(xb(e)){const r=e;return Object.keys(r).reduce(((e,t)=>({...e,[t]:wb(r[t])})),t)}return t}const Sb=function(){this.__data__=[],this.size=0};const kb=function(e,t){return e===t||e!==e&&t!==t};const Cb=function(e,t){for(var r=e.length;r--;)if(kb(e[r][0],t))return r;return-1};var jb=Array.prototype.splice;const $b=function(e){var t=this.__data__,r=Cb(t,e);return!(r<0)&&(r==t.length-1?t.pop():jb.call(t,r,1),--this.size,!0)};const Eb=function(e){var t=this.__data__,r=Cb(t,e);return r<0?void 0:t[r][1]};const _b=function(e){return Cb(this.__data__,e)>-1};const Pb=function(e,t){var r=this.__data__,n=Cb(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ob(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ob.prototype.clear=Sb,Ob.prototype.delete=$b,Ob.prototype.get=Eb,Ob.prototype.has=_b,Ob.prototype.set=Pb;const Rb=Ob;const Mb=function(){this.__data__=new Rb,this.size=0};const Nb=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};const Ib=function(e){return this.__data__.get(e)};const Tb=function(e){return this.__data__.has(e)};const Ab=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Db=function(e){if(!Ab(e))return!1;var t=db(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const Fb=tb["__core-js_shared__"];var zb=function(){var e=/[^.]+$/.exec(Fb&&Fb.keys&&Fb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();const Lb=function(e){return!!zb&&zb in e};var Bb=Function.prototype.toString;const Wb=function(e){if(null!=e){try{return Bb.call(e)}catch(Ya){}try{return e+""}catch(Ya){}}return""};var Vb=/^\[object .+?Constructor\]$/,Hb=Function.prototype,Ub=Object.prototype,qb=Hb.toString,Gb=Ub.hasOwnProperty,Kb=RegExp("^"+qb.call(Gb).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Qb=function(e){return!(!Ab(e)||Lb(e))&&(Db(e)?Kb:Vb).test(Wb(e))};const Jb=function(e,t){return null==e?void 0:e[t]};const Yb=function(e,t){var r=Jb(e,t);return Qb(r)?r:void 0};const Xb=Yb(tb,"Map");const Zb=Yb(Object,"create");const ex=function(){this.__data__=Zb?Zb(null):{},this.size=0};const tx=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var rx=Object.prototype.hasOwnProperty;const nx=function(e){var t=this.__data__;if(Zb){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return rx.call(t,e)?t[e]:void 0};var ox=Object.prototype.hasOwnProperty;const ax=function(e){var t=this.__data__;return Zb?void 0!==t[e]:ox.call(t,e)};const ix=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Zb&&void 0===t?"__lodash_hash_undefined__":t,this};function sx(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}sx.prototype.clear=ex,sx.prototype.delete=tx,sx.prototype.get=nx,sx.prototype.has=ax,sx.prototype.set=ix;const lx=sx;const cx=function(){this.size=0,this.__data__={hash:new lx,map:new(Xb||Rb),string:new lx}};const ux=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const dx=function(e,t){var r=e.__data__;return ux(t)?r["string"==typeof t?"string":"hash"]:r.map};const px=function(e){var t=dx(this,e).delete(e);return this.size-=t?1:0,t};const fx=function(e){return dx(this,e).get(e)};const hx=function(e){return dx(this,e).has(e)};const mx=function(e,t){var r=dx(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function gx(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gx.prototype.clear=cx,gx.prototype.delete=px,gx.prototype.get=fx,gx.prototype.has=hx,gx.prototype.set=mx;const vx=gx;const yx=function(e,t){var r=this.__data__;if(r instanceof Rb){var n=r.__data__;if(!Xb||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new vx(n)}return r.set(e,t),this.size=r.size,this};function bx(e){var t=this.__data__=new Rb(e);this.size=t.size}bx.prototype.clear=Mb,bx.prototype.delete=Nb,bx.prototype.get=Ib,bx.prototype.has=Tb,bx.prototype.set=yx;const xx=bx;const wx=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Sx=function(e){return this.__data__.has(e)};function kx(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new vx;++t<r;)this.add(e[t])}kx.prototype.add=kx.prototype.push=wx,kx.prototype.has=Sx;const Cx=kx;const jx=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};const $x=function(e,t){return e.has(t)};const Ex=function(e,t,r,n,o,a){var i=1&r,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,f=2&r?new Cx:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(n)var g=i?n(m,h,d,t,e,a):n(h,m,d,e,t,a);if(void 0!==g){if(g)continue;p=!1;break}if(f){if(!jx(t,(function(e,t){if(!$x(f,t)&&(h===e||o(h,e,r,n,a)))return f.push(t)}))){p=!1;break}}else if(h!==m&&!o(h,m,r,n,a)){p=!1;break}}return a.delete(e),a.delete(t),p};const _x=tb.Uint8Array;const Px=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r};const Ox=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r};var Rx=rb?rb.prototype:void 0,Mx=Rx?Rx.valueOf:void 0;const Nx=function(e,t,r,n,o,a,i){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new _x(e),new _x(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return kb(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Px;case"[object Set]":var l=1&n;if(s||(s=Ox),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;n|=2,i.set(e,t);var u=Ex(s(e),s(t),n,o,a,i);return i.delete(e),u;case"[object Symbol]":if(Mx)return Mx.call(e)==Mx.call(t)}return!1};const Ix=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e};const Tx=Array.isArray;const Ax=function(e,t,r){var n=t(e);return Tx(e)?n:Ix(n,r(e))};const Dx=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};const Fx=function(){return[]};var zx=Object.prototype.propertyIsEnumerable,Lx=Object.getOwnPropertySymbols;const Bx=Lx?function(e){return null==e?[]:(e=Object(e),Dx(Lx(e),(function(t){return zx.call(e,t)})))}:Fx;const Wx=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};const Vx=function(e){return hb(e)&&"[object Arguments]"==db(e)};var Hx=Object.prototype,Ux=Hx.hasOwnProperty,qx=Hx.propertyIsEnumerable;const Gx=Vx(function(){return arguments}())?Vx:function(e){return hb(e)&&Ux.call(e,"callee")&&!qx.call(e,"callee")};const Kx=function(){return!1};var Qx="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jx=Qx&&"object"==typeof module&&module&&!module.nodeType&&module,Yx=Jx&&Jx.exports===Qx?tb.Buffer:void 0;const Xx=(Yx?Yx.isBuffer:void 0)||Kx;var Zx=/^(?:0|[1-9]\d*)$/;const ew=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&Zx.test(e))&&e>-1&&e%1==0&&e<t};const tw=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var rw={};rw["[object Float32Array]"]=rw["[object Float64Array]"]=rw["[object Int8Array]"]=rw["[object Int16Array]"]=rw["[object Int32Array]"]=rw["[object Uint8Array]"]=rw["[object Uint8ClampedArray]"]=rw["[object Uint16Array]"]=rw["[object Uint32Array]"]=!0,rw["[object Arguments]"]=rw["[object Array]"]=rw["[object ArrayBuffer]"]=rw["[object Boolean]"]=rw["[object DataView]"]=rw["[object Date]"]=rw["[object Error]"]=rw["[object Function]"]=rw["[object Map]"]=rw["[object Number]"]=rw["[object Object]"]=rw["[object RegExp]"]=rw["[object Set]"]=rw["[object String]"]=rw["[object WeakMap]"]=!1;const nw=function(e){return hb(e)&&tw(e.length)&&!!rw[db(e)]};const ow=function(e){return function(t){return e(t)}};var aw="object"==typeof exports&&exports&&!exports.nodeType&&exports,iw=aw&&"object"==typeof module&&module&&!module.nodeType&&module,sw=iw&&iw.exports===aw&&Zy.process;const lw=function(){try{var e=iw&&iw.require&&iw.require("util").types;return e||sw&&sw.binding&&sw.binding("util")}catch(Ya){}}();var cw=lw&&lw.isTypedArray;const uw=cw?ow(cw):nw;var dw=Object.prototype.hasOwnProperty;const pw=function(e,t){var r=Tx(e),n=!r&&Gx(e),o=!r&&!n&&Xx(e),a=!r&&!n&&!o&&uw(e),i=r||n||o||a,s=i?Wx(e.length,String):[],l=s.length;for(var c in e)!t&&!dw.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ew(c,l))||s.push(c);return s};var fw=Object.prototype;const hw=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fw)};const mw=pb(Object.keys,Object);var gw=Object.prototype.hasOwnProperty;const vw=function(e){if(!hw(e))return mw(e);var t=[];for(var r in Object(e))gw.call(e,r)&&"constructor"!=r&&t.push(r);return t};const yw=function(e){return null!=e&&tw(e.length)&&!Db(e)};const bw=function(e){return yw(e)?pw(e):vw(e)};const xw=function(e){return Ax(e,bw,Bx)};var ww=Object.prototype.hasOwnProperty;const Sw=function(e,t,r,n,o,a){var i=1&r,s=xw(e),l=s.length;if(l!=xw(t).length&&!i)return!1;for(var c=l;c--;){var u=s[c];if(!(i?u in t:ww.call(t,u)))return!1}var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var f=!0;a.set(e,t),a.set(t,e);for(var h=i;++c<l;){var m=e[u=s[c]],g=t[u];if(n)var v=i?n(g,m,u,t,e,a):n(m,g,u,e,t,a);if(!(void 0===v?m===g||o(m,g,r,n,a):v)){f=!1;break}h||(h="constructor"==u)}if(f&&!h){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(f=!1)}return a.delete(e),a.delete(t),f};const kw=Yb(tb,"DataView");const Cw=Yb(tb,"Promise");const jw=Yb(tb,"Set");const $w=Yb(tb,"WeakMap");var Ew="[object Map]",_w="[object Promise]",Pw="[object Set]",Ow="[object WeakMap]",Rw="[object DataView]",Mw=Wb(kw),Nw=Wb(Xb),Iw=Wb(Cw),Tw=Wb(jw),Aw=Wb($w),Dw=db;(kw&&Dw(new kw(new ArrayBuffer(1)))!=Rw||Xb&&Dw(new Xb)!=Ew||Cw&&Dw(Cw.resolve())!=_w||jw&&Dw(new jw)!=Pw||$w&&Dw(new $w)!=Ow)&&(Dw=function(e){var t=db(e),r="[object Object]"==t?e.constructor:void 0,n=r?Wb(r):"";if(n)switch(n){case Mw:return Rw;case Nw:return Ew;case Iw:return _w;case Tw:return Pw;case Aw:return Ow}return t});const Fw=Dw;var zw="[object Arguments]",Lw="[object Array]",Bw="[object Object]",Ww=Object.prototype.hasOwnProperty;const Vw=function(e,t,r,n,o,a){var i=Tx(e),s=Tx(t),l=i?Lw:Fw(e),c=s?Lw:Fw(t),u=(l=l==zw?Bw:l)==Bw,d=(c=c==zw?Bw:c)==Bw,p=l==c;if(p&&Xx(e)){if(!Xx(t))return!1;i=!0,u=!1}if(p&&!u)return a||(a=new xx),i||uw(e)?Ex(e,t,r,n,o,a):Nx(e,t,l,r,n,o,a);if(!(1&r)){var f=u&&Ww.call(e,"__wrapped__"),h=d&&Ww.call(t,"__wrapped__");if(f||h){var m=f?e.value():e,g=h?t.value():t;return a||(a=new xx),o(m,g,r,n,a)}}return!!p&&(a||(a=new xx),Sw(e,t,r,n,o,a))};const Hw=function e(t,r,n,o,a){return t===r||(null==t||null==r||!hb(t)&&!hb(r)?t!==t&&r!==r:Vw(t,r,n,o,e,a))};const Uw=function(e,t,r){var n=(r="function"==typeof r?r:void 0)?r(e,t):void 0;return void 0===n?Hw(e,t,void 0,r):!!n};function qw(e,t){return Uw(e,t,((e,t)=>{if("function"===typeof e&&"function"===typeof t)return!0}))}const Gw=function(e){return"symbol"==typeof e||hb(e)&&"[object Symbol]"==db(e)};var Kw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qw=/^\w*$/;const Jw=function(e,t){if(Tx(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Gw(e))||(Qw.test(e)||!Kw.test(e)||null!=t&&e in Object(t))};function Yw(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Yw.Cache||vx),r}Yw.Cache=vx;const Xw=Yw;var Zw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eS=/\\(\\)?/g;const tS=function(e){var t=Xw(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Zw,(function(e,r,n,o){t.push(n?o.replace(eS,"$1"):r||e)})),t}));const rS=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o};var nS=rb?rb.prototype:void 0,oS=nS?nS.toString:void 0;const aS=function e(t){if("string"==typeof t)return t;if(Tx(t))return rS(t,e)+"";if(Gw(t))return oS?oS.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r};const iS=function(e){return null==e?"":aS(e)};const sS=function(e,t){return Tx(e)?e:Jw(e,t)?[e]:tS(iS(e))};const lS=function(e){if("string"==typeof e||Gw(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};const cS=function(e,t){for(var r=0,n=(t=sS(t,e)).length;null!=e&&r<n;)e=e[lS(t[r++])];return r&&r==n?e:void 0};const uS=function(e,t,r){var n=null==e?void 0:cS(e,t);return void 0===n?r:n};var dS=Object.prototype.hasOwnProperty;const pS=function(e){if(null==e)return!0;if(yw(e)&&(Tx(e)||"string"==typeof e||"function"==typeof e.splice||Xx(e)||uw(e)||Gx(e)))return!e.length;var t=Fw(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(hw(e))return!vw(e).length;for(var r in e)if(dS.call(e,r))return!1;return!0};var fS=r(5492);const hS=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e};const mS=function(){try{var e=Yb(Object,"defineProperty");return e({},"",{}),e}catch(Ya){}}();const gS=function(e,t,r){"__proto__"==t&&mS?mS(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r};var vS=Object.prototype.hasOwnProperty;const yS=function(e,t,r){var n=e[t];vS.call(e,t)&&kb(n,r)&&(void 0!==r||t in e)||gS(e,t,r)};const bS=function(e,t,r,n){var o=!r;r||(r={});for(var a=-1,i=t.length;++a<i;){var s=t[a],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),o?gS(r,s,l):yS(r,s,l)}return r};const xS=function(e,t){return e&&bS(t,bw(t),e)};const wS=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t};var SS=Object.prototype.hasOwnProperty;const kS=function(e){if(!Ab(e))return wS(e);var t=hw(e),r=[];for(var n in e)("constructor"!=n||!t&&SS.call(e,n))&&r.push(n);return r};const CS=function(e){return yw(e)?pw(e,!0):kS(e)};const jS=function(e,t){return e&&bS(t,CS(t),e)};var $S="object"==typeof exports&&exports&&!exports.nodeType&&exports,ES=$S&&"object"==typeof module&&module&&!module.nodeType&&module,_S=ES&&ES.exports===$S?tb.Buffer:void 0,PS=_S?_S.allocUnsafe:void 0;const OS=function(e,t){if(t)return e.slice();var r=e.length,n=PS?PS(r):new e.constructor(r);return e.copy(n),n};const RS=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};const MS=function(e,t){return bS(e,Bx(e),t)};const NS=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ix(t,Bx(e)),e=fb(e);return t}:Fx;const IS=function(e,t){return bS(e,NS(e),t)};const TS=function(e){return Ax(e,CS,NS)};var AS=Object.prototype.hasOwnProperty;const DS=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&AS.call(e,"index")&&(r.index=e.index,r.input=e.input),r};const FS=function(e){var t=new e.constructor(e.byteLength);return new _x(t).set(new _x(e)),t};const zS=function(e,t){var r=t?FS(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)};var LS=/\w*$/;const BS=function(e){var t=new e.constructor(e.source,LS.exec(e));return t.lastIndex=e.lastIndex,t};var WS=rb?rb.prototype:void 0,VS=WS?WS.valueOf:void 0;const HS=function(e){return VS?Object(VS.call(e)):{}};const US=function(e,t){var r=t?FS(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)};const qS=function(e,t,r){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return FS(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return zS(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return US(e,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return BS(e);case"[object Symbol]":return HS(e)}};var GS=Object.create;const KS=function(){function e(){}return function(t){if(!Ab(t))return{};if(GS)return GS(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const QS=function(e){return"function"!=typeof e.constructor||hw(e)?{}:KS(fb(e))};const JS=function(e){return hb(e)&&"[object Map]"==Fw(e)};var YS=lw&&lw.isMap;const XS=YS?ow(YS):JS;const ZS=function(e){return hb(e)&&"[object Set]"==Fw(e)};var ek=lw&&lw.isSet;const tk=ek?ow(ek):ZS;var rk="[object Arguments]",nk="[object Function]",ok="[object Object]",ak={};ak[rk]=ak["[object Array]"]=ak["[object ArrayBuffer]"]=ak["[object DataView]"]=ak["[object Boolean]"]=ak["[object Date]"]=ak["[object Float32Array]"]=ak["[object Float64Array]"]=ak["[object Int8Array]"]=ak["[object Int16Array]"]=ak["[object Int32Array]"]=ak["[object Map]"]=ak["[object Number]"]=ak[ok]=ak["[object RegExp]"]=ak["[object Set]"]=ak["[object String]"]=ak["[object Symbol]"]=ak["[object Uint8Array]"]=ak["[object Uint8ClampedArray]"]=ak["[object Uint16Array]"]=ak["[object Uint32Array]"]=!0,ak["[object Error]"]=ak[nk]=ak["[object WeakMap]"]=!1;const ik=function e(t,r,n,o,a,i){var s,l=1&r,c=2&r,u=4&r;if(n&&(s=a?n(t,o,a,i):n(t)),void 0!==s)return s;if(!Ab(t))return t;var d=Tx(t);if(d){if(s=DS(t),!l)return RS(t,s)}else{var p=Fw(t),f=p==nk||"[object GeneratorFunction]"==p;if(Xx(t))return OS(t,l);if(p==ok||p==rk||f&&!a){if(s=c||f?{}:QS(t),!l)return c?IS(t,jS(s,t)):MS(t,xS(s,t))}else{if(!ak[p])return a?t:{};s=qS(t,p,l)}}i||(i=new xx);var h=i.get(t);if(h)return h;i.set(t,s),tk(t)?t.forEach((function(o){s.add(e(o,r,n,o,t,i))})):XS(t)&&t.forEach((function(o,a){s.set(a,e(o,r,n,a,t,i))}));var m=d?void 0:(u?c?TS:xw:c?CS:bw)(t);return hS(m||t,(function(o,a){m&&(o=t[a=o]),yS(s,a,e(o,r,n,a,t,i))})),s};const sk=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const lk=function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++n<o;)a[n]=e[n+t];return a};const ck=function(e,t){return t.length<2?e:cS(e,lk(t,0,-1))};const uk=function(e,t){return t=sS(t,e),null==(e=ck(e,t))||delete e[lS(sk(t))]};const dk=function(e){return xb(e)?void 0:e};var pk=rb?rb.isConcatSpreadable:void 0;const fk=function(e){return Tx(e)||Gx(e)||!!(pk&&e&&e[pk])};const hk=function e(t,r,n,o,a){var i=-1,s=t.length;for(n||(n=fk),a||(a=[]);++i<s;){var l=t[i];r>0&&n(l)?r>1?e(l,r-1,n,o,a):Ix(a,l):o||(a[a.length]=l)}return a};const mk=function(e){return(null==e?0:e.length)?hk(e,1):[]};const gk=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)};var vk=Math.max;const yk=function(e,t,r){return t=vk(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=vk(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),gk(e,this,s)}};const bk=function(e){return function(){return e}};const xk=function(e){return e};const wk=mS?function(e,t){return mS(e,"toString",{configurable:!0,enumerable:!1,value:bk(t),writable:!0})}:xk;var Sk=Date.now;const kk=function(e){var t=0,r=0;return function(){var n=Sk(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(wk);const Ck=function(e){return kk(yk(e,void 0,mk),e+"")};const jk=Ck((function(e,t){var r={};if(null==e)return r;var n=!1;t=rS(t,(function(t){return t=sS(t,e),n||(n=t.length>1),t})),bS(e,TS(e),r),n&&(r=ik(r,7,dk));for(var o=t.length;o--;)uk(r,t[o]);return r}));function $k(e,t){const r=t[e];return[jk(t,[e]),r]}function Ek(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=e||"";let o;if(!n.startsWith("#"))throw new Error(`Could not find a definition for ${e}.`);o=decodeURIComponent(n.substring(1));const a=fS.get(t,o);if(void 0===a)throw new Error(`Could not find a definition for ${e}.`);const i=a[qy];if(i){if(r.includes(i)){if(1===r.length)throw new Error(`Definition for ${e} is a circular reference`);const[t,...o]=r,a=[...o,n,t].join(" -> ");throw new Error(`Definition for ${t} contains a circular reference through ${a}`)}const[o,s]=$k(qy,a),l=Ek(s,t,[...r,n]);return Object.keys(o).length>0?{...o,...l}:l}return a}function _k(e){return Ek(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[])}var Pk=Object.prototype.hasOwnProperty;const Ok=function(e,t){return null!=e&&Pk.call(e,t)};const Rk=function(e,t,r){for(var n=-1,o=(t=sS(t,e)).length,a=!1;++n<o;){var i=lS(t[n]);if(!(a=null!=e&&r(e,i)))break;e=e[i]}return a||++n!=o?a:!!(o=null==e?0:e.length)&&tw(o)&&ew(i,o)&&(Tx(e)||Gx(e))};const Mk=function(e,t){return null!=e&&Rk(e,t,Ok)};const Nk=function(e){return"number"==typeof e||hb(e)&&"[object Number]"==db(e)};const Ik=function(e){return"string"==typeof e||!Tx(e)&&hb(e)&&"[object String]"==db(e)};const Tk=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r};const Ak=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),s=i.length;s--;){var l=i[e?s:++o];if(!1===r(a[l],l,a))break}return t}}();const Dk=function(e,t){return e&&Ak(e,t,bw)};const Fk=function(e,t){return function(r,n){if(null==r)return r;if(!yw(r))return e(r,n);for(var o=r.length,a=t?o:-1,i=Object(r);(t?a--:++a<o)&&!1!==n(i[a],a,i););return r}}(Dk);const zk=function(e,t,r,n){var o=r.length,a=o,i=!n;if(null==e)return!a;for(e=Object(e);o--;){var s=r[o];if(i&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<a;){var l=(s=r[o])[0],c=e[l],u=s[1];if(i&&s[2]){if(void 0===c&&!(l in e))return!1}else{var d=new xx;if(n)var p=n(c,u,l,e,t,d);if(!(void 0===p?Hw(u,c,3,n,d):p))return!1}}return!0};const Lk=function(e){return e===e&&!Ab(e)};const Bk=function(e){for(var t=bw(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Lk(o)]}return t};const Wk=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}};const Vk=function(e){var t=Bk(e);return 1==t.length&&t[0][2]?Wk(t[0][0],t[0][1]):function(r){return r===e||zk(r,e,t)}};const Hk=function(e,t){return null!=e&&t in Object(e)};const Uk=function(e,t){return null!=e&&Rk(e,t,Hk)};const qk=function(e,t){return Jw(e)&&Lk(t)?Wk(lS(e),t):function(r){var n=uS(r,e);return void 0===n&&n===t?Uk(r,e):Hw(t,n,3)}};const Gk=function(e){return function(t){return null==t?void 0:t[e]}};const Kk=function(e){return function(t){return cS(t,e)}};const Qk=function(e){return Jw(e)?Gk(lS(e)):Kk(e)};const Jk=function(e){return"function"==typeof e?e:null==e?xk:"object"==typeof e?Tx(e)?qk(e[0],e[1]):Vk(e):Qk(e)};const Yk=function(e,t,r,n,o){return o(e,(function(e,o,a){r=n?(n=!1,e):t(r,e,o,a)})),r};const Xk=function(e,t,r){var n=Tx(e)?Tk:Yk,o=arguments.length<3;return n(e,Jk(t,4),r,o,Fk)};const Zk=function(e){return"function"==typeof e?e:xk};var eC=/\s/;const tC=function(e){for(var t=e.length;t--&&eC.test(e.charAt(t)););return t};var rC=/^\s+/;const nC=function(e){return e?e.slice(0,tC(e)+1).replace(rC,""):e};var oC=/^[-+]0x[0-9a-f]+$/i,aC=/^0b[01]+$/i,iC=/^0o[0-7]+$/i,sC=parseInt;const lC=function(e){if("number"==typeof e)return e;if(Gw(e))return NaN;if(Ab(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ab(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=nC(e);var r=aC.test(e);return r||iC.test(e)?sC(e.slice(2),r?2:8):oC.test(e)?NaN:+e};var cC=1/0;const uC=function(e){return e?(e=lC(e))===cC||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0};const dC=function(e){var t=uC(e),r=t%1;return t===t?r?t-r:t:0};var pC=4294967295,fC=Math.min;const hC=function(e,t){if((e=dC(e))<1||e>9007199254740991)return[];var r=pC,n=fC(e,pC);t=Zk(t),e-=pC;for(var o=Wx(n,t);++r<e;)t(r);return o};function mC(e,t,r){var n;if(e&&r){const o=uS(e,r);if(void 0===o)return;for(let e=0;e<t.length;e++){const a=t[e],i=uS(a,[Vy,r],{});if("object"!==i.type&&"array"!==i.type){if(i.const===o)return e;if(null===(n=i.enum)||void 0===n?void 0:n.includes(o))return e}}}}function gC(e,t,r,n,o){if(void 0===t)return 0;const a=mC(t,r,o);if(Nk(a))return a;for(let i=0;i<r.length;i++){const a=r[i];if(o&&Mk(a,[Vy,o])){const r=uS(t,o),s=uS(a,[Vy,o],{});if(e.isValid(s,r,n))return i}else if(a[Vy]){const r={anyOf:Object.keys(a[Vy]).map((e=>({required:[e]})))};let o;if(a.anyOf){const{...e}=a;e.allOf?e.allOf=e.allOf.slice():e.allOf=[],e.allOf.push(r),o=e}else o=Object.assign({},a,r);if(delete o.required,e.isValid(o,t,n))return i}else if(e.isValid(a,t,n))return i}return 0}function vC(e,t,r,n,o){return gC(e,t,r,n,o)}const yC=function(e,t,r,n){if(!Ab(e))return e;for(var o=-1,a=(t=sS(t,e)).length,i=a-1,s=e;null!=s&&++o<a;){var l=lS(t[o]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=i){var u=s[l];void 0===(c=n?n(u,l,s):void 0)&&(c=Ab(u)?u:ew(t[o+1])?[]:{})}yS(s,l,c),s=s[l]}return e};const bC=function(e,t,r){return null==e?e:yC(e,t,r)};const xC=function(e,t,r){var n=Tx(e),o=n||Xx(e)||uw(e);if(t=Jk(t,4),null==r){var a=e&&e.constructor;r=o?n?new a:[]:Ab(e)&&Db(a)?KS(fb(e)):{}}return(o?hS:Dk)(e,(function(e,n,o){return t(r,e,n,o)})),r};const wC=function(e,t,r){(void 0!==r&&!kb(e[t],r)||void 0===r&&!(t in e))&&gS(e,t,r)};const SC=function(e){return hb(e)&&yw(e)};const kC=function(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]};const CC=function(e){return bS(e,CS(e))};const jC=function(e,t,r,n,o,a,i){var s=kC(e,r),l=kC(t,r),c=i.get(l);if(c)wC(e,r,c);else{var u=a?a(s,l,r+"",e,t,i):void 0,d=void 0===u;if(d){var p=Tx(l),f=!p&&Xx(l),h=!p&&!f&&uw(l);u=l,p||f||h?Tx(s)?u=s:SC(s)?u=RS(s):f?(d=!1,u=OS(l,!0)):h?(d=!1,u=US(l,!0)):u=[]:xb(l)||Gx(l)?(u=s,Gx(s)?u=CC(s):Ab(s)&&!Db(s)||(u=QS(l))):d=!1}d&&(i.set(l,u),o(u,l,n,a,i),i.delete(l)),wC(e,r,u)}};const $C=function e(t,r,n,o,a){t!==r&&Ak(r,(function(i,s){if(a||(a=new xx),Ab(i))jC(t,r,s,n,e,o,a);else{var l=o?o(kC(t,s),i,s+"",t,r,a):void 0;void 0===l&&(l=i),wC(t,s,l)}}),CS)};const EC=function(e,t){return kk(yk(e,t,xk),e+"")};const _C=function(e,t,r){if(!Ab(r))return!1;var n=typeof t;return!!("number"==n?yw(r)&&ew(t,r.length):"string"==n&&t in r)&&kb(r[t],e)};const PC=function(e){return EC((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&_C(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t}))}((function(e,t,r){$C(e,t,r)}));const OC=function(e){return(null==e?0:e.length)?hk(e,Infinity):[]};const RC=function(e,t,r,n){for(var o=e.length,a=r+(n?1:-1);n?a--:++a<o;)if(t(e[a],a,e))return a;return-1};const MC=function(e){return e!==e};const NC=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1};const IC=function(e,t,r){return t===t?NC(e,t,r):RC(e,MC,r)};const TC=function(e,t){return!!(null==e?0:e.length)&&IC(e,t,0)>-1};const AC=function(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1};const DC=function(){};var FC=jw&&1/Ox(new jw([,-0]))[1]==1/0?function(e){return new jw(e)}:DC;const zC=FC;const LC=function(e,t,r){var n=-1,o=TC,a=e.length,i=!0,s=[],l=s;if(r)i=!1,o=AC;else if(a>=200){var c=t?null:zC(e);if(c)return Ox(c);i=!1,o=$x,l=new Cx}else l=t?[]:s;e:for(;++n<a;){var u=e[n],d=t?t(u):u;if(u=r||0!==u?u:0,i&&d===d){for(var p=l.length;p--;)if(l[p]===d)continue e;t&&l.push(d),s.push(u)}else o(l,d,r)||(l!==s&&l.push(d),s.push(u))}return s};const BC=function(e){return e&&e.length?LC(e):[]};var WC=r(2093),VC=r.n(WC);function HC(e){let t;const r=uS(e,"discriminator.propertyName",void 0);return Ik(r)?t=r:void 0!==r&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function UC(e){return Array.isArray(e)?"array":"string"===typeof e?"string":null==e?"null":"boolean"===typeof e?"boolean":isNaN(e)?"object"===typeof e?"object":"string":"number"}const qC=EC((function(e){return LC(hk(e,1,SC,!0))}));function GC(e){let{type:t}=e;return!t&&e.const?UC(e.const):!t&&e.enum?"string":t||!e.properties&&!e.additionalProperties?(Array.isArray(t)&&(t=2===t.length&&t.includes("null")?t.find((e=>"null"!==e)):t[0]),t):"object"}function KC(e,t){const r=Object.assign({},e);return Object.keys(t).reduce(((r,n)=>{const o=e?e[n]:{},a=t[n];return e&&n in e&&Ey(a)?r[n]=KC(o,a):e&&t&&("object"===GC(e)||"object"===GC(t))&&n===Hy&&Array.isArray(o)&&Array.isArray(a)?r[n]=qC(o,a):r[n]=a,r}),r)}function QC(e,t){return ZC(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3?arguments[3]:void 0,void 0,void 0,arguments.length>4?arguments[4]:void 0)[0]}function JC(e){const t=e.reduce(((e,t)=>t.length>1?t.flatMap((t=>hC(e.length,(r=>[...e[r]].concat(t))))):(e.forEach((e=>e.push(t[0]))),e)),[[]]);return t}function YC(e,t,r,n,o,a,i){const s=XC(t,r,o);return s!==t?ZC(e,s,r,a,n,o,i):[t]}function XC(e,t,r){if(!Ey(e))return e;let n=e;if(qy in n){const{$ref:e,...o}=n;if(r.includes(e))return n;r.push(e);n={..._k(e,t),...o}}if(Vy in n){const e=[],o=xC(n[Vy],((n,o,a)=>{const i=[...r];n[a]=XC(o,t,i),e.push(i)}),{});PC(r,BC(OC(e))),n={...n,[Vy]:o}}return Ly in n&&!Array.isArray(n.items)&&"boolean"!==typeof n.items&&(n={...n,items:XC(n.items,t,r)}),qw(e,n)?e:n}function ZC(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],i=arguments.length>6?arguments[6]:void 0;if(!Ey(t))return[{}];const s=function(e,t,r,n,o,a,i){const s=YC(e,t,r,n,o,a);if(s.length>1||s[0]!==t)return s;if(Ty in t)return ej(e,t,r,n,o,a).flatMap((t=>ZC(e,t,r,a,n,o,i)));if(Ry in t&&Array.isArray(t.allOf))return JC(t.allOf.map((t=>ZC(e,t,r,a,n,o,i)))).map((e=>({...t,allOf:e})));return[t]}(e,t,r,o,a,n,i);return s.flatMap((t=>{var s;let l=t;if(zy in l)return function(e,t,r,n,o,a,i){const{if:s,then:l,else:c,...u}=t,d=e.isValid(s,a||{},r);let p=[u],f=[];if(n)l&&"boolean"!==typeof l&&(f=f.concat(ZC(e,l,r,a,n,o,i))),c&&"boolean"!==typeof c&&(f=f.concat(ZC(e,c,r,a,n,o,i)));else{const t=d?l:c;t&&"boolean"!==typeof t&&(f=f.concat(ZC(e,t,r,a,n,o,i)))}return f.length&&(p=f.map((e=>KC(u,e)))),p.flatMap((t=>ZC(e,t,r,a,n,o,i)))}(e,l,r,o,a,n,i);if(Ry in l){if(o){const{allOf:e,...t}=l;return[...e,t]}try{const e=[],t=[];null===(s=l.allOf)||void 0===s||s.forEach((r=>{"object"===typeof r&&r.contains?e.push(r):t.push(r)})),e.length&&(l={...l,allOf:t}),l=i?i(l):VC()(l,{deep:!1}),e.length&&(l.allOf=e)}catch(Ya){console.warn("could not merge subschemas in allOf:\n",Ya);const{allOf:t,...r}=l;return r}}return Oy in l&&!1!==l.additionalProperties?function(e,t,r,n,o){const a={...t,properties:{...t.properties}},i=n&&Ey(n)?n:{};return Object.keys(i).forEach((t=>{if(t in a.properties)return;let n={};n="boolean"!==typeof a.additionalProperties?qy in a.additionalProperties?QC(e,{$ref:uS(a.additionalProperties,[qy])},r,i,o):"type"in a.additionalProperties?{...a.additionalProperties}:My in a.additionalProperties||Wy in a.additionalProperties?{type:"object",...a.additionalProperties}:{type:UC(uS(i,[t]))}:{type:UC(uS(i,[t]))},a.properties[t]=n,bC(a.properties,[t,Py],!0)})),a}(e,l,r,n,i):l}))}function ej(e,t,r,n,o,a,i){const{dependencies:s,...l}=t,c=function(e,t,r,n,o){let a;const{oneOf:i,anyOf:s,...l}=t;if(Array.isArray(i)?a=i:Array.isArray(s)&&(a=s),a){const i=void 0===o&&n?{}:o,s=HC(t);a=a.map((e=>XC(e,r,[])));const c=vC(e,i,a,r,s);if(n)return a.map((e=>KC(l,e)));t=KC(l,a[c])}return[t]}(e,l,r,n,a);return c.flatMap((t=>tj(e,s,t,r,n,o,a,i)))}function tj(e,t,r,n,o,a,i,s){let l=[r];for(const c in t){if(!o&&void 0===uS(i,[c]))continue;if(r.properties&&!(c in r.properties))continue;const[u,d]=$k(c,t);return Array.isArray(d)?l[0]=rj(r,d):Ey(d)&&(l=nj(e,r,n,c,d,o,a,i,s)),l.flatMap((t=>tj(e,u,t,n,o,a,i,s)))}return l}function rj(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function nj(e,t,r,n,o,a,i,s,l){return ZC(e,o,r,s,a,i,l).flatMap((o=>{const{oneOf:c,...u}=o;if(t=KC(t,u),void 0===c)return t;return JC(c.map((t=>"boolean"!==typeof t&&qy in t?YC(e,t,r,a,i,s):[t]))).flatMap((o=>function(e,t,r,n,o,a,i,s,l){const c=o.filter((t=>{if("boolean"===typeof t||!t||!t.properties)return!1;const{[n]:o}=t.properties;if(o){const t={type:"object",properties:{[n]:o}};return e.isValid(t,s,r)||a}return!1}));if(!a&&1!==c.length)return console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t];return c.flatMap((o=>{const c=o,[u]=$k(n,c.properties),d={...c,properties:u};return ZC(e,d,r,s,a,i,l).map((e=>KC(t,e)))}))}(e,t,r,n,o,a,i,s,l)))}))}const oj={type:"object",$id:"_$junk_option_schema_id$_",properties:{__not_really_there__:{type:"number"}}};function aj(e,t,r,n,o){let a=0;return r&&(Ab(r.properties)?a+=Xk(r.properties,((r,a,i)=>{const s=uS(n,i);if("boolean"===typeof a)return r;if(Mk(a,qy)){const n=QC(e,a,t,s,o);return r+aj(e,t,n,s||{},o)}if((Mk(a,Wy)||Mk(a,My))&&s){const n=Mk(a,Wy)?Wy:My,i=HC(a);return r+ij(e,t,s,uS(a,n),-1,i,o)}if("object"===a.type)return Ab(s)&&(r+=1),r+aj(e,t,a,s,o);if(a.type===UC(s)){let e=r+1;return a.default?e+=s===a.default?1:-1:a.const&&(e+=s===a.const?1:-1),e}return r}),0):Ik(r.type)&&r.type===UC(n)&&(a+=1)),a}function ij(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0;const s=n.map((e=>XC(e,t,[]))),l=mC(r,n,a);if(Nk(l))return l;const c=s.reduce(((n,o,i)=>(1===vC(e,r,[oj,o],t,a)&&n.push(i),n)),[]);if(1===c.length)return c[0];c.length||hC(s.length,(e=>c.push(e)));const u=new Set,{bestIndex:d}=c.reduce(((n,o)=>{const{bestScore:a}=n,l=s[o],c=aj(e,t,l,r,i);return u.add(c),c>a?{bestIndex:o,bestScore:c}:n}),{bestIndex:o,bestScore:0});return 1===u.size&&o>=0?o:d}function sj(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every((e=>Ey(e)))}const lj=function(e){return null==e};function cj(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Array.isArray(t)){const a=Array.isArray(e)?e:[],i=o?t:a,s=(o?a:t).map(((e,s)=>void 0!==i[s]?cj(a[s],t[s],r,n,o):e));return(r||o)&&s.length<i.length&&s.push(...i.slice(s.length)),s}if(Ey(t)){const a=Object.assign({},e);return Object.keys(t).reduce(((a,i)=>{const s=uS(t,i),l=Ey(e)&&i in e,c=i in t;return a[i]=cj(e?uS(e,i):{},s,r,n,o&&(l||!c)),a}),a)}return n&&(!lj(e)&&lj(t)||"number"===typeof t&&isNaN(t))||o&&!lj(t)?e:t}function uj(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object.keys(t).reduce(((n,o)=>{const a=e?e[o]:{},i=t[o];if(e&&o in e&&Ey(i))n[o]=uj(a,i,r);else if(r&&Array.isArray(a)&&Array.isArray(i)){let e=i;"preventDuplicates"===r&&(e=i.reduce(((e,t)=>(a.includes(t)||e.push(t),e)),[])),n[o]=a.concat(e)}else n[o]=i;return n}),Object.assign({},e))}function dj(e){return Array.isArray(e.enum)&&1===e.enum.length||Ny in e}function pj(e,t){const r=QC(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},void 0,arguments.length>3?arguments[3]:void 0),n=r.oneOf||r.anyOf;return!!Array.isArray(r.enum)||!!Array.isArray(n)&&n.every((e=>"boolean"!==typeof e&&dj(e)))}function fj(e,t,r,n){return!(!t.uniqueItems||!t.items||"boolean"===typeof t.items)&&pj(e,t.items,r,n)}function hj(e){const t=e[Ny],r=GC(e);return Ey(t)&&Ik(null===t||void 0===t?void 0:t.$data)&&"object"!==r&&"array"!==r}function mj(e,t){const r=e;if(e.enum){let n;if(t){const{enumNames:e}=Yy(t);n=e}return!n&&r.enumNames&&(n=r.enumNames),e.enum.map(((e,t)=>({label:(null===n||void 0===n?void 0:n[t])||String(e),value:e})))}let n,o;return e.anyOf?(n=e.anyOf,o=null===t||void 0===t?void 0:t.anyOf):e.oneOf&&(n=e.oneOf,o=null===t||void 0===t?void 0:t.oneOf),n&&n.map(((e,t)=>{const{title:r}=Yy(null===o||void 0===o?void 0:o[t]),n=e,a=function(e){if(Ay in e&&Array.isArray(e.enum)&&1===e.enum.length)return e.enum[0];if(Ny in e)return e.const;throw new Error("schema cannot be inferred as a constant")}(n);return{schema:n,label:r||n.title||String(a),value:a}}))}const gj=["string","number","integer","boolean","null"];var vj;function yj(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vj.Ignore,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(r>=0){if(Array.isArray(e.items)&&r<e.items.length){const t=e.items[r];if("boolean"!==typeof t)return t}}else if(e.items&&!Array.isArray(e.items)&&"boolean"!==typeof e.items)return e.items;return t!==vj.Ignore&&Ey(e.additionalItems)?e.additionalItems:{}}function bj(e,t,r,n,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const{emptyObjectFields:l="populateAllDefaults"}=i;if(n||s)e[t]=r;else if("skipDefaults"!==l){const n=void 0===o?a.includes(t):o;Ey(r)?"skipEmptyDefaults"===l?pS(r)||(e[t]=r):pS(r)&&!a.includes(t)||!n&&"populateRequiredDefaults"===l||(e[t]=r):void 0!==r&&("populateAllDefaults"===l||"skipEmptyDefaults"===l||n&&a.includes(t))&&(e[t]=r)}}function xj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{parentDefaults:n,rawFormData:o,rootSchema:a={},includeUndefinedValues:i=!1,_recurseList:s=[],experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:c,required:u,shouldMergeDefaultsIntoFormData:d=!1}=r,p=Ey(o)?o:{},f=Ey(t)?t:{};let h=n,m=null,g=l,v=s;if(f[Ny]&&"never"!==(null===l||void 0===l?void 0:l.constAsDefaults)&&!hj(f))h=f[Ny];else if(Ey(h)&&Ey(f.default))h=uj(h,f.default);else if(Iy in f)h=f.default;else if(qy in f){const e=f[qy];s.includes(e)||(v=s.concat(e),m=_k(e,a))}else if(Ty in f){const t={...wj(e,f,r,h),...p};m=ej(e,f,a,!1,[],t,c)[0]}else if(sj(f))h=f.items.map(((t,r)=>xj(e,t,{rootSchema:a,includeUndefinedValues:i,_recurseList:s,experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:c,parentDefaults:Array.isArray(n)?n[r]:void 0,rawFormData:p,required:u,shouldMergeDefaultsIntoFormData:d})));else if(Wy in f){const{oneOf:t,...r}=f;if(0===t.length)return;const n=HC(f),{type:i="null"}=r;!Array.isArray(i)&&gj.includes(i)&&"skipOneOf"===(null===g||void 0===g?void 0:g.constAsDefaults)&&(g={...g,constAsDefaults:"never"}),m=t[ij(e,a,o,t,0,n,c)],m=KC(r,m)}else if(My in f){const{anyOf:t,...r}=f;if(0===t.length)return;const n=HC(f);m=t[ij(e,a,o,t,0,n,c)],m=KC(r,m)}if(m)return xj(e,m,{rootSchema:a,includeUndefinedValues:i,_recurseList:v,experimental_defaultFormStateBehavior:g,experimental_customMergeAllOf:c,parentDefaults:h,rawFormData:p,required:u,shouldMergeDefaultsIntoFormData:d});void 0===h&&(h=f.default);const y=wj(e,f,r,h);let b=null!==y&&void 0!==y?y:h;if(d){const{arrayMinItems:t={}}=l||{},{mergeExtraDefaults:r}=t,n=function(e,t,r,n,o,a){const i=!dj(t)&&pj(e,t,r,a);let s=n;if(i){const e=mj(t);s=(null===e||void 0===e?void 0:e.some((e=>qw(e.value,n))))?n:void 0}const l=t[Ny]&&"always"===(null===o||void 0===o?void 0:o.constAsDefaults);l&&(s=t.const);return s}(e,f,a,o,l,c);Ey(o)||(b=cj(b,n,r,!0))}return b}function wj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;switch(GC(t)){case"object":return function(e,t){let{rawFormData:r,rootSchema:n={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,required:l,shouldMergeDefaultsIntoFormData:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;{const d=Ey(r)?r:{},p=t,f="populateDefaults"===(null===i||void 0===i?void 0:i.allOf)&&Ry in p?QC(e,p,n,d,s):p,h=f[Ny],m=Object.keys(f.properties||{}).reduce(((t,r)=>{var p;const m=uS(f,[Vy,r]),g=Ey(h)&&void 0!==h[r],v=(Ey(m)&&Ny in m||g)&&"never"!==(null===i||void 0===i?void 0:i.constAsDefaults)&&!hj(m);return bj(t,r,xj(e,m,{rootSchema:n,_recurseList:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,includeUndefinedValues:!0===o,parentDefaults:uS(u,[r]),rawFormData:uS(d,[r]),required:null===(p=f.required)||void 0===p?void 0:p.includes(r),shouldMergeDefaultsIntoFormData:c}),o,l,f.required,i,v),t}),{});if(f.additionalProperties){const t=Ey(f.additionalProperties)?f.additionalProperties:{},r=new Set;Ey(u)&&Object.keys(u).filter((e=>!f.properties||!f.properties[e])).forEach((e=>r.add(e)));const p=[];Object.keys(d).filter((e=>!f.properties||!f.properties[e])).forEach((e=>{r.add(e),p.push(e)})),r.forEach((r=>{var h;const g=xj(e,t,{rootSchema:n,_recurseList:a,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,includeUndefinedValues:!0===o,parentDefaults:uS(u,[r]),rawFormData:uS(d,[r]),required:null===(h=f.required)||void 0===h?void 0:h.includes(r),shouldMergeDefaultsIntoFormData:c});bj(m,r,g,o,l,p)}))}return m}}(e,t,r,n);case"array":return function(e,t){let{rawFormData:r,rootSchema:n={},_recurseList:o=[],experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,required:s,shouldMergeDefaultsIntoFormData:l}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0;var u,d;const p=t,f=null!==(u=null===a||void 0===a?void 0:a.arrayMinItems)&&void 0!==u?u:{},{populate:h,mergeExtraDefaults:m}=f,g="never"===h,v="requiredOnly"===h,y="all"===h||!g&&!v,b=null!==(d=null===f||void 0===f?void 0:f.computeSkipPopulate)&&void 0!==d?d:()=>!1,x="skipEmptyDefaults"===(null===a||void 0===a?void 0:a.emptyObjectFields)?void 0:[];if(Array.isArray(c)&&(c=c.map(((t,r)=>{const c=yj(p,vj.Fallback,r);return xj(e,c,{rootSchema:n,_recurseList:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,parentDefaults:t,required:s,shouldMergeDefaultsIntoFormData:l})}))),Array.isArray(r)){const t=yj(p);if(g)c=r;else{const u=r.map(((r,u)=>xj(e,t,{rootSchema:n,_recurseList:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,rawFormData:r,parentDefaults:uS(c,[u]),required:s,shouldMergeDefaultsIntoFormData:l})));c=cj(c,u,(v&&s||y)&&m)}}if(!1===(Ey(p)&&Ny in p&&"never"!==(null===a||void 0===a?void 0:a.constAsDefaults))){if(g)return null!==c&&void 0!==c?c:x;if(v&&!s)return c||void 0}const w=Array.isArray(c)?c.length:0;if(!p.minItems||fj(e,p,n,i)||b(e,p,n)||p.minItems<=w)return c||x;const S=c||[],k=yj(p,vj.Invert),C=k.default,j=new Array(p.minItems-w).fill(xj(e,k,{parentDefaults:C,rootSchema:n,_recurseList:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,required:s,shouldMergeDefaultsIntoFormData:l}));return S.concat(j)}(e,t,r,n)}}function Sj(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0;if(!Ey(t))throw new Error("Invalid schema: "+t);const s=xj(e,QC(e,t,n,r,i),{rootSchema:n,includeUndefinedValues:o,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:i,rawFormData:r,shouldMergeDefaultsIntoFormData:!0});if(Ey(r)||Array.isArray(r)){const{mergeDefaultsIntoFormData:e}=a||{};return cj(s,r,!0,"useDefaultIfFormDataUndefined"===e,!0)}return s}function kj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"widget"in Yy(e)&&"hidden"!==Yy(e).widget}function Cj(e,t){let r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;if("files"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})[Qy])return!0;if(t.items){const o=QC(e,t.items,r,void 0,n);return"string"===o.type&&"data-url"===o.format}return!1}!function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"}(vj||(vj={}));const jj=Symbol("no Value");function $j(e,t,r,n){let o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=arguments.length>5?arguments[5]:void 0;if(Mk(r,Vy)){const s={};if(Mk(n,Vy)){const e=uS(n,Vy,{});Object.keys(e).forEach((e=>{Mk(a,e)&&(s[e]=void 0)}))}const l=Object.keys(uS(r,Vy,{})),c={};l.forEach((o=>{const l=uS(a,o);let u=uS(n,[Vy,o],{}),d=uS(r,[Vy,o],{});Mk(u,qy)&&(u=QC(e,u,t,l,i)),Mk(d,qy)&&(d=QC(e,d,t,l,i));const p=uS(u,"type"),f=uS(d,"type");if(!p||p===f)if(Mk(s,o)&&delete s[o],"object"===f||"array"===f&&Array.isArray(l)){const r=$j(e,t,d,u,l,i);void 0===r&&"array"!==f||(c[o]=r)}else{const e=uS(d,"default",jj),t=uS(u,"default",jj);e!==jj&&e!==l&&(t===l?s[o]=e:!0===uS(d,"readOnly")&&(s[o]=void 0));const r=uS(d,"const",jj),n=uS(u,"const",jj);r!==jj&&r!==l&&(s[o]=n===l?r:void 0)}})),o={..."string"==typeof a||Array.isArray(a)?void 0:a,...s,...c}}else if("array"===uS(n,"type")&&"array"===uS(r,"type")&&Array.isArray(a)){let s=uS(n,"items"),l=uS(r,"items");if("object"!==typeof s||"object"!==typeof l||Array.isArray(s)||Array.isArray(l))"boolean"===typeof s&&"boolean"===typeof l&&s===l&&(o=a);else{Mk(s,qy)&&(s=QC(e,s,t,a,i)),Mk(l,qy)&&(l=QC(e,l,t,a,i));const n=uS(s,"type"),c=uS(l,"type");if(!n||n===c){const n=uS(r,"maxItems",-1);o="object"===c?a.reduce(((r,o)=>{const a=$j(e,t,l,s,o,i);return void 0!==a&&(n<0||r.length<n)&&r.push(a),r}),[]):n>0&&a.length>n?a.slice(0,n):a}}}return o}function Ej(e,t,r,n,o,a,i){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],l=arguments.length>8?arguments[8]:void 0;if(qy in t||Ty in t||Ry in t){const c=QC(e,t,a,i,l);if(-1===s.findIndex((e=>qw(e,c))))return Ej(e,c,r,n,o,a,i,s.concat(c),l)}if(Ly in t&&!uS(t,[Ly,qy]))return Ej(e,uS(t,Ly),r,n,o,a,i,s,l);const c={$id:o||r};if("object"===GC(t)&&Vy in t)for(const u in t.properties){const o=uS(t,[Vy,u]),d=c[Fy]+n+u;c[u]=Ej(e,Ey(o)?o:{},r,n,d,a,uS(i,[u]),s,l)}return c}function _j(e,t,r,n,o){return Ej(e,t,arguments.length>5&&void 0!==arguments[5]?arguments[5]:"root",arguments.length>6&&void 0!==arguments[6]?arguments[6]:"_",r,n,o,void 0,arguments.length>7?arguments[7]:void 0)}function Pj(e,t,r,n,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],i=arguments.length>6?arguments[6]:void 0;if(qy in t||Ty in t||Ry in t){const s=QC(e,t,n,o,i);if(-1===a.findIndex((e=>qw(e,s))))return Pj(e,s,r,n,o,a.concat(s),i)}let s={[By]:r.replace(/^\./,"")};if(Wy in t||My in t){const l=Wy in t?t.oneOf:t.anyOf,c=HC(t),u=l[ij(e,n,o,l,0,c,i)];s={...s,...Pj(e,u,r,n,o,a,i)}}if(Oy in t&&!1!==t[Oy]&&bC(s,Gy,!0),Ly in t&&Array.isArray(o)){const{items:l,additionalItems:c}=t;Array.isArray(l)?o.forEach(((t,o)=>{l[o]?s[o]=Pj(e,l[o],`${r}.${o}`,n,t,a,i):c?s[o]=Pj(e,c,`${r}.${o}`,n,t,a,i):console.warn(`Unable to generate path schema for "${r}.${o}". No schema defined for it`)})):o.forEach(((t,o)=>{s[o]=Pj(e,l,`${r}.${o}`,n,t,a,i)}))}else if(Vy in t)for(const l in t.properties){const c=uS(t,[Vy,l]);s[l]=Pj(e,c,`${r}.${l}`,n,uS(o,[l]),a,i)}return s}function Oj(e,t){return Pj(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,void 0,arguments.length>5?arguments[5]:void 0)}class Rj{constructor(e,t,r,n){this.rootSchema=t,this.validator=e,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=n}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;return!(!e||!t)&&(this.validator!==e||!qw(this.rootSchema,t)||!qw(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==n)}getDefaultFormState(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Sj(this.validator,e,t,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf)}getDisplayLabel(e,t,r){return function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0,o=arguments.length>5?arguments[5]:void 0;const a=Yy(r,arguments.length>4?arguments[4]:void 0),{label:i=!0}=a;let s=!!i;const l=GC(t);return"array"===l&&(s=fj(e,t,n,o)||Cj(e,t,r,n,o)||kj(r)),"object"===l&&(s=!1),"boolean"!==l||r[Qy]||(s=!1),r["ui:field"]&&(s=!1),s}(this.validator,e,t,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(e,t,r,n){return ij(this.validator,this.rootSchema,e,t,r,n,this.experimental_customMergeAllOf)}getFirstMatchingOption(e,t,r){return vC(this.validator,e,t,this.rootSchema,r)}getMatchingOption(e,t,r){return gC(this.validator,e,t,this.rootSchema,r)}isFilesArray(e,t){return Cj(this.validator,e,t,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(e){return fj(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(e){return pj(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}mergeValidationData(e,t){return function(e,t,r){if(!r)return t;const{errors:n,errorSchema:o}=t;let a=e.toErrorList(r),i=r;return pS(o)||(i=uj(o,r,!0),a=[...n].concat(a)),{errorSchema:i,errors:a}}(this.validator,e,t)}retrieveSchema(e,t){return QC(this.validator,e,this.rootSchema,t,this.experimental_customMergeAllOf)}sanitizeDataForNewSchema(e,t,r){return $j(this.validator,this.rootSchema,e,t,r,this.experimental_customMergeAllOf)}toIdSchema(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"root",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"_";return _j(this.validator,e,t,this.rootSchema,r,n,o,this.experimental_customMergeAllOf)}toPathSchema(e,t,r){return Oj(this.validator,e,t,this.rootSchema,r,this.experimental_customMergeAllOf)}}function Mj(e,t){let r=String(e);for(;r.length<t;)r="0"+r;return r}function Nj(e,t){if(e<=0&&t<=0)e=(new Date).getFullYear()+e,t=(new Date).getFullYear()+t;else if(e<0||t<0)throw new Error(`Both start (${e}) and stop (${t}) must both be <= 0 or > 0, got one of each`);if(e>t)return Nj(t,e).reverse();const r=[];for(let n=e;n<=t;n++)r.push({value:n,label:Mj(n,2)});return r}function Ij(e,t){return function(e,t){let r=e;if(Array.isArray(t)){const e=r.split(/(%\d)/);t.forEach(((t,r)=>{const n=e.findIndex((e=>e===`%${r+1}`));n>=0&&(e[n]=t)})),r=e.join("")}return r}(e,t)}function Tj(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;if(Array.isArray(e))return e.map((e=>Tj(e,t))).filter((e=>e!==r));const n=""===e||null===e?-1:Number(e),o=t[n];return o?o.value:r}function Aj(e,t){return Array.isArray(t)?t.some((t=>qw(t,e))):qw(t,e)}function Dj(e){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).map(((t,r)=>Aj(t.value,e)?String(r):void 0)).filter((e=>"undefined"!==typeof e));return t?r:r[0]}function Fj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[1900,(new Date).getFullYear()+2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YMD";const{day:o,month:a,year:i,hour:s,minute:l,second:c}=e,u={type:"day",range:[1,31],value:o},d={type:"month",range:[1,12],value:a},p={type:"year",range:r,value:i},f=[];switch(n){case"MDY":f.push(d,u,p);break;case"DMY":f.push(u,d,p);break;default:f.push(p,d,u)}return t&&f.push({type:"hour",range:[0,23],value:s},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:c}),f}function zj(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||0===e.minimum)&&(t.min=e.minimum),(e.maximum||0===e.maximum)&&(t.max=e.maximum),t}function Lj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const o={type:t||"text",...zj(e)};return r.inputType?o.type=r.inputType:t||("number"===e.type?(o.type="number",n&&void 0===o.step&&(o.step="any")):"integer"===e.type&&(o.type="number",void 0===o.step&&(o.step=1))),r.autocomplete&&(o.autoComplete=r.autocomplete),r.accept&&(o.accept=r.accept),o}const Bj={props:{disabled:!1},submitText:"Submit",norender:!1};function Wj(){const e=Yy(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});if(e&&e[Uy]){const t=e[Uy];return{...Bj,...t}}return Bj}function Vj(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{templates:n}=t;return"ButtonTemplates"===e?n[e]:r[e]||n[e]}var Hj=r(1697);const Uj={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function qj(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=GC(t);if("function"===typeof r||r&&Hj.isForwardRef((0,e.createElement)(r))||Hj.isMemo(r))return function(e){let t=uS(e,"MergedWidget");if(!t){const r=e.defaultProps&&e.defaultProps.options||{};t=t=>{let{options:n,...o}=t;return(0,dt.jsx)(e,{options:{...r,...n},...o})},bC(e,"MergedWidget",t)}return t}(r);if("string"!==typeof r)throw new Error("Unsupported widget definition: "+typeof r);if(r in n){return qj(t,n[r],n)}if("string"===typeof o){if(!(o in Uj))throw new Error(`No widget for type '${o}'`);if(r in Uj[o]){return qj(t,n[Uj[o][r]],n)}}throw new Error(`No widget '${r}' for type '${o}'`)}function Gj(e,t){return`${Ik(e)?e:e[Fy]}__${t}`}function Kj(e){return Gj(e,"description")}function Qj(e){return Gj(e,"error")}function Jj(e){return Gj(e,"examples")}function Yj(e){return Gj(e,"help")}function Xj(e){return Gj(e,"title")}function Zj(e){const t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?` ${Jj(e)}`:"";return`${Qj(e)} ${Kj(e)} ${Yj(e)}${t}`}function e$(e,t){return`${e}-${t}`}function t$(e,t,r){return t?r:e}function r$(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const r=new Date(e);if(Number.isNaN(r.getTime()))throw new Error("Unable to parse date "+e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}}function n$(e){if(e.const)return!0;if(e.enum&&1===e.enum.length&&!0===e.enum[0])return!0;if(e.anyOf&&1===e.anyOf.length)return n$(e.anyOf[0]);if(e.oneOf&&1===e.oneOf.length)return n$(e.oneOf[0]);if(e.allOf){const t=e=>n$(e);return e.allOf.some(t)}return!1}function o$(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{year:r,month:n,day:o,hour:a=0,minute:i=0,second:s=0}=e,l=Date.UTC(r,n-1,o,a,i,s),c=new Date(l).toJSON();return t?c:c.slice(0,10)}function a$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return[];let r=[];return Dy in e&&(r=r.concat(e[Dy].map((e=>{const r=`.${t.join(".")}`;return{property:r,message:e,stack:`${r} ${e}`}})))),Object.keys(e).reduce(((r,n)=>{if(n!==Dy){const o=e[n];xb(o)&&(r=r.concat(a$(o,[...t,n])))}return r}),r)}const i$=function(e){return Tx(e)?rS(e,lS):Gw(e)?[e]:RS(tS(iS(e)))};const s$=function(e){return ik(e,5)};const l$=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:yC(e,t,r,n)};class c${constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let t=Array.isArray(e)&&e.length>0||"string"===typeof e?uS(this.errorSchema,e):this.errorSchema;return!t&&e&&(t={},l$(this.errorSchema,e,t,Object)),t}resetAllErrors(e){return this.errorSchema=e?s$(e):{},this}addErrors(e,t){const r=this.getOrCreateErrorBlock(t);let n=uS(r,Dy);return Array.isArray(n)||(n=[],r[Dy]=n),Array.isArray(e)?bC(r,Dy,[...new Set([...n,...e])]):bC(r,Dy,[...new Set([...n,e])]),this}setErrors(e,t){const r=this.getOrCreateErrorBlock(t),n=Array.isArray(e)?[...new Set([...e])]:[e];return bC(r,Dy,n),this}clearErrors(e){const t=this.getOrCreateErrorBlock(e);return bC(t,Dy,[]),this}}function u$(e){return Object.keys(e).reduce(((t,r)=>{if("addError"===r)return t;{const n=e[r];return xb(n)?{...t,[r]:u$(n)}:{...t,[r]:n}}}),{})}function d$(e){if(!e)return"";const t=new Date(e);return`${Mj(t.getFullYear(),4)}-${Mj(t.getMonth()+1,2)}-${Mj(t.getDate(),2)}T${Mj(t.getHours(),2)}:${Mj(t.getMinutes(),2)}:${Mj(t.getSeconds(),2)}.${Mj(t.getMilliseconds(),3)}`}function p$(e,t){if(!t)return e;const{errors:r,errorSchema:n}=e;let o=a$(t),a=t;return pS(n)||(a=uj(n,t,!0),o=[...r].concat(o)),{errorSchema:a,errors:o}}function f$(e){return Array.isArray(e)?function(e){for(let t=0;t<e.length;t++)e[t]=f$(e[t]);return e}([...e]):Ab(e)?function(e){for(const t in e){const r=e,n=r[t];t===qy&&"string"===typeof n&&n.startsWith("#")?r[t]=Ky+n:r[t]=f$(n)}return e}({...e}):e}const h$=function(e,t,r){for(var n=-1,o=t.length,a={};++n<o;){var i=t[n],s=cS(e,i);r(s,i)&&yC(a,sS(i,e),s)}return a};const m$=function(e,t){if(null==e)return{};var r=rS(TS(e),(function(e){return[e]}));return t=Jk(t),h$(e,r,(function(e,r){return t(e,r[0])}))};const g$=function(e,t,r,n){var o=-1,a=TC,i=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=rS(t,ow(r))),n?(a=AC,i=!1):t.length>=200&&(a=$x,i=!1,t=new Cx(t));e:for(;++o<s;){var u=e[o],d=null==r?u:r(u);if(u=n||0!==u?u:0,i&&d===d){for(var p=c;p--;)if(t[p]===d)continue e;l.push(u)}else a(t,d,n)||l.push(u)}return l};var v$=EC((function(e,t){return SC(e)?g$(e,hk(t,1,SC,!0)):[]}));const y$=v$;var b$;!function(e){e.ArrayItemTitle="Item",e.MissingItems="Missing items definition",e.YesLabel="Yes",e.NoLabel="No",e.CloseLabel="Close",e.ErrorsLabel="Errors",e.NewStringDefault="New Value",e.AddButton="Add",e.AddItemButton="Add Item",e.CopyButton="Copy",e.MoveDownButton="Move down",e.MoveUpButton="Move up",e.RemoveButton="Remove",e.NowLabel="Now",e.ClearLabel="Clear",e.AriaDateLabel="Select a date",e.PreviewLabel="Preview",e.DecrementAriaLabel="Decrease value by 1",e.IncrementAriaLabel="Increase value by 1",e.UnknownFieldType="Unknown field type %1",e.OptionPrefix="Option %1",e.TitleOptionPrefix="%1 option %2",e.KeyLabel="%1 Key",e.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',e.UnsupportedField="Unsupported field schema.",e.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",e.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",e.FilesInfo="**%1** (%2, %3 bytes)"}(b$||(b$={}));const x$=function(e,t){return(Tx(e)?hS:Fk)(e,Zk(t))};const w$=function(e,t){return h$(e,t,(function(t,r){return Uk(e,r)}))};const S$=Ck((function(e,t){return null==e?{}:w$(e,t)}));let k$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")};function C$(){return k$()}function j$(e){return Array.isArray(e)?e.map((e=>({key:C$(),item:e}))):[]}function $$(e){return Array.isArray(e)?e.map((e=>e.item)):[]}class E$ extends e.Component{constructor(e){super(e);const{formData:t=[]}=e,r=j$(t);this.state={keyedFormData:r,updatedKeyedFormData:!1}}static getDerivedStateFromProps(e,t){if(t.updatedKeyedFormData)return{updatedKeyedFormData:!1};const r=Array.isArray(e.formData)?e.formData:[],n=t.keyedFormData||[];return{keyedFormData:r.length===n.length?n.map(((e,t)=>({key:e.key,item:r[t]}))):j$(r)}}get itemTitle(){const{schema:e,registry:t}=this.props,{translateString:r}=t;return uS(e,[Ly,"title"],uS(e,[Ly,"description"],r(b$.ArrayItemTitle)))}isItemRequired(e){return Array.isArray(e.type)?!e.type.includes("null"):"null"!==e.type}canAddItem(e){const{schema:t,uiSchema:r,registry:n}=this.props;let{addable:o}=Yy(r,n.globalUiOptions);return!1!==o&&(o=void 0===t.maxItems||e.length<t.maxItems),o}_getNewFormDataRow=()=>{const{schema:e,registry:t}=this.props,{schemaUtils:r}=t;let n=e.items;return sj(e)&&function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),Ey(e.additionalItems)}(e)&&(n=e.additionalItems),r.getDefaultFormState(n)};_handleAddClick(e,t){e&&e.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const e in n){const r=parseInt(e);void 0===t||r<t?bC(a,[r],n[e]):r>=t&&bC(a,[r+1],n[e])}}const i={key:C$(),item:this._getNewFormDataRow()},s=[...o];void 0!==t?s.splice(t,0,i):s.push(i),this.setState({keyedFormData:s,updatedKeyedFormData:!0},(()=>r($$(s),a)))}onAddClick=e=>{this._handleAddClick(e)};onAddIndexClick=e=>t=>{this._handleAddClick(t,e)};onCopyIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const t in n){const r=parseInt(t);r<=e?bC(a,[r],n[t]):r>e&&bC(a,[r+1],n[t])}}const i={key:C$(),item:s$(o[e].item)},s=[...o];void 0!==e?s.splice(e+1,0,i):s.push(i),this.setState({keyedFormData:s,updatedKeyedFormData:!0},(()=>r($$(s),a)))};onDropIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const t in n){const r=parseInt(t);r<e?bC(a,[r],n[t]):r>e&&bC(a,[r-1],n[t])}}const i=o.filter(((t,r)=>r!==e));this.setState({keyedFormData:i,updatedKeyedFormData:!0},(()=>r($$(i),a)))};onReorderClick=(e,t)=>r=>{r&&(r.preventDefault(),r.currentTarget.blur());const{onChange:n,errorSchema:o}=this.props;let a;if(o){a={};for(const r in o){const n=parseInt(r);n==e?bC(a,[t],o[e]):n==t?bC(a,[e],o[t]):bC(a,[r],o[n])}}const{keyedFormData:i}=this.state;const s=function(){const r=i.slice();return r.splice(e,1),r.splice(t,0,i[e]),r}();this.setState({keyedFormData:s},(()=>n($$(s),a)))};onChangeForIndex=e=>(t,r,n)=>{const{formData:o,onChange:a,errorSchema:i}=this.props,s=(Array.isArray(o)?o:[]).map(((r,n)=>e===n?"undefined"===typeof t?null:t:r));a(s,i&&i&&{...i,[e]:r},n)};onSelectChange=e=>{const{onChange:t,idSchema:r}=this.props;t(e,void 0,r&&r.$id)};render(){const{schema:e,uiSchema:t,idSchema:r,registry:n}=this.props,{schemaUtils:o,translateString:a}=n;if(!(Ly in e)){const o=Vj("UnsupportedFieldTemplate",n,Yy(t));return(0,dt.jsx)(o,{schema:e,idSchema:r,reason:a(b$.MissingItems),registry:n})}return o.isMultiSelect(e)?this.renderMultiSelect():kj(t)?this.renderCustomWidget():sj(e)?this.renderFixedArray():o.isFilesArray(e,t)?this.renderFiles():this.renderNormalArray()}renderNormalArray(){const{schema:e,uiSchema:t={},errorSchema:r,idSchema:n,name:o,title:a,disabled:i=!1,readonly:s=!1,autofocus:l=!1,required:c=!1,registry:u,onBlur:d,onFocus:p,idPrefix:f,idSeparator:h="_",rawErrors:m}=this.props,{keyedFormData:g}=this.state,v=e.title||a||o,{schemaUtils:y,formContext:b}=u,x=Yy(t),w=Ab(e.items)?e.items:{},S=y.retrieveSchema(w),k=$$(this.state.keyedFormData),C=this.canAddItem(k),j={canAdd:C,items:g.map(((e,a)=>{const{key:i,item:s}=e,c=s,u=y.retrieveSchema(w,c),b=r?r[a]:void 0,x=n.$id+h+a,S=y.toIdSchema(u,x,c,f,h);return this.renderArrayFieldItem({key:i,index:a,name:o&&`${o}-${a}`,title:v?`${v}-${a+1}`:void 0,canAdd:C,canMoveUp:a>0,canMoveDown:a<k.length-1,itemSchema:u,itemIdSchema:S,itemErrorSchema:b,itemData:c,itemUiSchema:t.items,autofocus:l&&0===a,onBlur:d,onFocus:p,rawErrors:m,totalItems:g.length})})),className:`field field-array field-array-of-${S.type}`,disabled:i,idSchema:n,uiSchema:t,onAddClick:this.onAddClick,readonly:s,required:c,schema:e,title:v,formContext:b,formData:k,rawErrors:m,registry:u},$=Vj("ArrayFieldTemplate",u,x);return(0,dt.jsx)($,{...j})}renderCustomWidget(){const{schema:e,idSchema:t,uiSchema:r,disabled:n=!1,readonly:o=!1,autofocus:a=!1,required:i=!1,hideError:s,placeholder:l,onBlur:c,onFocus:u,formData:d=[],registry:p,rawErrors:f,name:h}=this.props,{widgets:m,formContext:g,globalUiOptions:v,schemaUtils:y}=p,{widget:b,title:x,...w}=Yy(r,v),S=qj(e,b,m),k=x??e.title??h,C=y.getDisplayLabel(e,r,v);return(0,dt.jsx)(S,{id:t.$id,name:h,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:w,schema:e,uiSchema:r,registry:p,value:d,disabled:n,readonly:o,hideError:s,required:i,label:k,hideLabel:!C,placeholder:l,formContext:g,autofocus:a,rawErrors:f})}renderMultiSelect(){const{schema:e,idSchema:t,uiSchema:r,formData:n=[],disabled:o=!1,readonly:a=!1,autofocus:i=!1,required:s=!1,placeholder:l,onBlur:c,onFocus:u,registry:d,rawErrors:p,name:f}=this.props,{widgets:h,schemaUtils:m,formContext:g,globalUiOptions:v}=d,y=mj(m.retrieveSchema(e.items,n),r),{widget:b="select",title:x,...w}=Yy(r,v),S=qj(e,b,h),k=x??e.title??f,C=m.getDisplayLabel(e,r,v);return(0,dt.jsx)(S,{id:t.$id,name:f,multiple:!0,onChange:this.onSelectChange,onBlur:c,onFocus:u,options:{...w,enumOptions:y},schema:e,uiSchema:r,registry:d,value:n,disabled:o,readonly:a,required:s,label:k,hideLabel:!C,placeholder:l,formContext:g,autofocus:i,rawErrors:p})}renderFiles(){const{schema:e,uiSchema:t,idSchema:r,name:n,disabled:o=!1,readonly:a=!1,autofocus:i=!1,required:s=!1,onBlur:l,onFocus:c,registry:u,formData:d=[],rawErrors:p}=this.props,{widgets:f,formContext:h,globalUiOptions:m,schemaUtils:g}=u,{widget:v="files",title:y,...b}=Yy(t,m),x=qj(e,v,f),w=y??e.title??n,S=g.getDisplayLabel(e,t,m);return(0,dt.jsx)(x,{options:b,id:r.$id,name:n,multiple:!0,onChange:this.onSelectChange,onBlur:l,onFocus:c,schema:e,uiSchema:t,value:d,disabled:o,readonly:a,required:s,registry:u,formContext:h,autofocus:i,rawErrors:p,label:w,hideLabel:!S})}renderFixedArray(){const{schema:e,uiSchema:t={},formData:r=[],errorSchema:n,idPrefix:o,idSeparator:a="_",idSchema:i,name:s,title:l,disabled:c=!1,readonly:u=!1,autofocus:d=!1,required:p=!1,registry:f,onBlur:h,onFocus:m,rawErrors:g}=this.props,{keyedFormData:v}=this.state;let{formData:y=[]}=this.props;const b=e.title||l||s,x=Yy(t),{schemaUtils:w,formContext:S}=f,k=(Ab(e.items)?e.items:[]).map(((e,t)=>w.retrieveSchema(e,r[t]))),C=Ab(e.additionalItems)?w.retrieveSchema(e.additionalItems,r):null;(!y||y.length<k.length)&&(y=y||[],y=y.concat(new Array(k.length-y.length)));const j=this.canAddItem(y)&&!!C,$={canAdd:j,className:"field field-array field-array-fixed-items",disabled:c,idSchema:i,formData:r,items:v.map(((r,l)=>{const{key:c,item:u}=r,p=u,f=l>=k.length,x=(f&&Ab(e.additionalItems)?w.retrieveSchema(e.additionalItems,p):k[l])||{},S=i.$id+a+l,C=w.toIdSchema(x,S,p,o,a),$=f?t.additionalItems||{}:Array.isArray(t.items)?t.items[l]:t.items||{},E=n?n[l]:void 0;return this.renderArrayFieldItem({key:c,index:l,name:s&&`${s}-${l}`,title:b?`${b}-${l+1}`:void 0,canAdd:j,canRemove:f,canMoveUp:l>=k.length+1,canMoveDown:f&&l<y.length-1,itemSchema:x,itemData:p,itemUiSchema:$,itemIdSchema:C,itemErrorSchema:E,autofocus:d&&0===l,onBlur:h,onFocus:m,rawErrors:g,totalItems:v.length})})),onAddClick:this.onAddClick,readonly:u,required:p,registry:f,schema:e,uiSchema:t,title:b,formContext:S,errorSchema:n,rawErrors:g},E=Vj("ArrayFieldTemplate",f,x);return(0,dt.jsx)(E,{...$})}renderArrayFieldItem(e){const{key:t,index:r,name:n,canAdd:o,canRemove:a=!0,canMoveUp:i,canMoveDown:s,itemSchema:l,itemData:c,itemUiSchema:u,itemIdSchema:d,itemErrorSchema:p,autofocus:f,onBlur:h,onFocus:m,rawErrors:g,totalItems:v,title:y}=e,{disabled:b,hideError:x,idPrefix:w,idSeparator:S,readonly:k,uiSchema:C,registry:j,formContext:$}=this.props,{fields:{ArraySchemaField:E,SchemaField:_},globalUiOptions:P}=j,O=E||_,{orderable:R=!0,removable:M=!0,copyable:N=!1}=Yy(C,P),I={moveUp:R&&i,moveDown:R&&s,copy:N&&o,remove:M&&a,toolbar:!1};return I.toolbar=Object.keys(I).some((e=>I[e])),{children:(0,dt.jsx)(O,{name:n,title:y,index:r,schema:l,uiSchema:u,formData:c,formContext:$,errorSchema:p,idPrefix:w,idSeparator:S,idSchema:d,required:this.isItemRequired(l),onChange:this.onChangeForIndex(r),onBlur:h,onFocus:m,registry:j,disabled:b,readonly:k,hideError:x,autofocus:f,rawErrors:g}),className:"array-item",disabled:b,canAdd:o,hasCopy:I.copy,hasToolbar:I.toolbar,hasMoveUp:I.moveUp,hasMoveDown:I.moveDown,hasRemove:I.remove,index:r,totalItems:v,key:t,onAddIndexClick:this.onAddIndexClick,onCopyIndexClick:this.onCopyIndexClick,onDropIndexClick:this.onDropIndexClick,onReorderClick:this.onReorderClick,readonly:k,registry:j,schema:l,uiSchema:u}}}const _$=E$;const P$=function(e){const{schema:t,name:r,uiSchema:n,idSchema:o,formData:a,registry:i,required:s,disabled:l,readonly:c,hideError:u,autofocus:d,title:p,onChange:f,onFocus:h,onBlur:m,rawErrors:g}=e,{title:v}=t,{widgets:y,formContext:b,translateString:x,globalUiOptions:w}=i,{widget:S="checkbox",title:k,label:C=!0,...j}=Yy(n,w),$=qj(t,S,y),E=x(b$.YesLabel),_=x(b$.NoLabel);let P;const O=k??v??p??r;if(Array.isArray(t.oneOf))P=mj({oneOf:t.oneOf.map((e=>{if(Ab(e))return{...e,title:e.title||(!0===e.const?E:_)}})).filter((e=>e))},n);else{const e=t,r=t.enum??[!0,!1];P=!e.enumNames&&2===r.length&&r.every((e=>"boolean"===typeof e))?[{value:r[0],label:r[0]?E:_},{value:r[1],label:r[1]?E:_}]:mj({enum:r,enumNames:e.enumNames},n)}return(0,dt.jsx)($,{options:{...j,enumOptions:P},schema:t,uiSchema:n,id:o.$id,name:r,onChange:f,onFocus:h,onBlur:m,label:O,hideLabel:!C,value:a,required:s,disabled:l,readonly:c,hideError:u,registry:i,formContext:b,autofocus:d,rawErrors:g})};class O$ extends e.Component{constructor(e){super(e);const{formData:t,options:r,registry:{schemaUtils:n}}=this.props,o=r.map((e=>n.retrieveSchema(e,t)));this.state={retrievedOptions:o,selectedOption:this.getMatchingOption(0,t,o)}}componentDidUpdate(e,t){const{formData:r,options:n,idSchema:o}=this.props,{selectedOption:a}=this.state;let i=this.state;if(!qw(e.options,n)){const{registry:{schemaUtils:e}}=this.props;i={selectedOption:a,retrievedOptions:n.map((t=>e.retrieveSchema(t,r)))}}if(!qw(r,e.formData)&&o.$id===e.idSchema.$id){const{retrievedOptions:e}=i,n=this.getMatchingOption(a,r,e);t&&n!==a&&(i={selectedOption:n,retrievedOptions:e})}i!==this.state&&this.setState(i)}getMatchingOption(e,t,r){const{schema:n,registry:{schemaUtils:o}}=this.props,a=HC(n);return o.getClosestMatchingOption(t,r,e,a)}onOptionChange=e=>{const{selectedOption:t,retrievedOptions:r}=this.state,{formData:n,onChange:o,registry:a}=this.props,{schemaUtils:i}=a,s=void 0!==e?parseInt(e,10):-1;if(s===t)return;const l=s>=0?r[s]:void 0,c=t>=0?r[t]:void 0;let u=i.sanitizeDataForNewSchema(l,c,n);l&&(u=i.getDefaultFormState(l,u,"excludeObjectChildren")),this.setState({selectedOption:s},(()=>{o(u,void 0,this.getFieldId())}))};getFieldId(){const{idSchema:e,schema:t}=this.props;return`${e.$id}${t.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,disabled:t=!1,errorSchema:r={},formContext:n,onBlur:o,onFocus:a,readonly:i,registry:s,schema:l,uiSchema:c}=this.props,{widgets:u,fields:d,translateString:p,globalUiOptions:f,schemaUtils:h}=s,{SchemaField:m}=d,{selectedOption:g,retrievedOptions:v}=this.state,{widget:y="select",placeholder:b,autofocus:x,autocomplete:w,title:S=l.title,...k}=Yy(c,f),C=qj({type:"number"},y,u),j=uS(r,Dy,[]),$=jk(r,[Dy]),E=h.getDisplayLabel(l,c,f),_=g>=0&&v[g]||null;let P;if(_){const{required:e}=l;P=e?KC({required:e},_):_}let O=[];Wy in l&&c&&Wy in c?Array.isArray(c[Wy])?O=c[Wy]:console.warn(`uiSchema.oneOf is not an array for "${S||e}"`):My in l&&c&&My in c&&(Array.isArray(c[My])?O=c[My]:console.warn(`uiSchema.anyOf is not an array for "${S||e}"`));let R=c;g>=0&&O.length>g&&(R=O[g]);const M=S?b$.TitleOptionPrefix:b$.OptionPrefix,N=S?[S]:[],I=v.map(((e,t)=>{const{title:r=e.title}=Yy(O[t]);return{label:r||p(M,N.concat(String(t+1))),value:t}}));return(0,dt.jsxs)("div",{className:"panel panel-default panel-body",children:[(0,dt.jsx)("div",{className:"form-group",children:(0,dt.jsx)(C,{id:this.getFieldId(),name:`${e}${l.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:o,onFocus:a,disabled:t||pS(I),multiple:!1,rawErrors:j,errorSchema:$,value:g>=0?g:void 0,options:{enumOptions:I,...k},registry:s,formContext:n,placeholder:b,autocomplete:w,autofocus:x,label:S??e,hideLabel:!E,readonly:i})}),P&&(0,dt.jsx)(m,{...this.props,schema:P,uiSchema:R})]})}}const R$=O$,M$=/\.([0-9]*0)*$/,N$=/[0.]0*$/;const I$=function(t){const{registry:r,onChange:n,formData:o,value:a}=t,[i,s]=(0,e.useState)(a),{StringField:l}=r.fields;let c=o;const u=(0,e.useCallback)(((e,t,r)=>{s(e),"."===`${e}`.charAt(0)&&(e=`0${e}`);const o="string"===typeof e&&e.match(M$)?_y(e.replace(N$,"")):_y(e);n(o,t,r)}),[n]);if("string"===typeof i&&"number"===typeof c){const e=new RegExp(`^(${String(c).replace(".","\\.")})?\\.?0*$`);i.match(e)&&(c=i)}return(0,dt.jsx)(l,{...t,formData:c,onChange:u})};function T$(){return T$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},T$.apply(this,arguments)}const A$=["children","options"];var D$,F$;!function(e){e.blockQuote="0",e.breakLine="1",e.breakThematic="2",e.codeBlock="3",e.codeFenced="4",e.codeInline="5",e.footnote="6",e.footnoteReference="7",e.gfmTask="8",e.heading="9",e.headingSetext="10",e.htmlBlock="11",e.htmlComment="12",e.htmlSelfClosing="13",e.image="14",e.link="15",e.linkAngleBraceStyleDetector="16",e.linkBareUrlDetector="17",e.linkMailtoDetector="18",e.newlineCoalescer="19",e.orderedList="20",e.paragraph="21",e.ref="22",e.refImage="23",e.refLink="24",e.table="25",e.tableSeparator="26",e.text="27",e.textBolded="28",e.textEmphasized="29",e.textEscaped="30",e.textMarked="31",e.textStrikethroughed="32",e.unorderedList="33"}(D$||(D$={})),function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"}(F$||(F$={}));const z$=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","className","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{for:"htmlFor"}),L$={amp:"&",apos:"'",gt:">",lt:"<",nbsp:"\xa0",quot:"\u201c"},B$=["style","script"],W$=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,V$=/mailto:/i,H$=/\n{2,}$/,U$=/^(\s*>[\s\S]*?)(?=\n{2,})/,q$=/^ *> ?/gm,G$=/^ {2,}\n/,K$=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,Q$=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,J$=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Y$=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,X$=/^(?:\n *)*\n/,Z$=/\r\n?/g,eE=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,tE=/^\[\^([^\]]+)]/,rE=/\f/g,nE=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,oE=/^\s*?\[(x|\s)\]/,aE=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,iE=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,sE=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,lE=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,cE=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,uE=/^<!--[\s\S]*?(?:-->)/,dE=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,pE=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,fE=/^\{.*\}$/,hE=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,mE=/^<([^ >]+@[^ >]+)>/,gE=/^<([^ >]+:\/[^ >]+)>/,vE=/-([a-z])?/gi,yE=/^(.*\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,bE=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,xE=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,wE=/^\[([^\]]*)\] ?\[([^\]]*)\]/,SE=/(\[|\])/g,kE=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,CE=/\t/g,jE=/(^ *\||\| *$)/g,$E=/^ *:-+: *$/,EE=/^ *:-+ *$/,_E=/^ *-+: *$/,PE="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~~.*?~~|==.*?==|.|\\n)*?)",OE=new RegExp(`^([*_])\\1${PE}\\1\\1(?!\\1)`),RE=new RegExp(`^([*_])${PE}\\1(?!\\1|\\w)`),ME=new RegExp(`^==${PE}==`),NE=new RegExp(`^~~${PE}~~`),IE=/^\\([^0-9A-Za-z\s])/,TE=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,AE=/^\n+/,DE=/^([ \t]*)/,FE=/\\([^\\])/g,zE=/ *\n+$/,LE=/(?:^|\n)( *)$/,BE="(?:\\d+\\.)",WE="(?:[*+-])";function VE(e){return"( *)("+(1===e?BE:WE)+") +"}const HE=VE(1),UE=VE(2);function qE(e){return new RegExp("^"+(1===e?HE:UE))}const GE=qE(1),KE=qE(2);function QE(e){return new RegExp("^"+(1===e?HE:UE)+"[^\\n]*(?:\\n(?!\\1"+(1===e?BE:WE)+" )[^\\n]*)*(\\n|$)","gm")}const JE=QE(1),YE=QE(2);function XE(e){const t=1===e?BE:WE;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const ZE=XE(1),e_=XE(2);function t_(e,t){const r=1===t,n=r?ZE:e_,o=r?JE:YE,a=r?GE:KE;return{match(e,t,r){const o=LE.exec(r);return o&&(t.list||!t.inline&&!t.simple)?n.exec(e=o[1]+e):null},order:1,parse(e,t,n){const i=r?+e[2]:void 0,s=e[0].replace(H$,"\n").match(o);let l=!1;return{items:s.map((function(e,r){const o=a.exec(e)[0].length,i=new RegExp("^ {1,"+o+"}","gm"),c=e.replace(i,"").replace(a,""),u=r===s.length-1,d=-1!==c.indexOf("\n\n")||u&&l;l=d;const p=n.inline,f=n.list;let h;n.list=!0,d?(n.inline=!1,h=c.replace(zE,"\n\n")):(n.inline=!0,h=c.replace(zE,""));const m=t(h,n);return n.inline=p,n.list=f,m})),ordered:r,start:i}},render:(t,r,n)=>e(t.ordered?"ol":"ul",{key:n.key,start:"20"===t.type?t.start:void 0},t.items.map((function(t,o){return e("li",{key:o},r(t,n))})))}}const r_=new RegExp("^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),n_=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,o_=[U$,Q$,J$,aE,sE,iE,uE,yE,JE,ZE,YE,e_],a_=[...o_,/^[^\n]+(?: \n|\n{2,})/,lE,pE];function i_(e){return e.replace(/[\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xc6]/g,"a").replace(/[\xe7\xc7]/g,"c").replace(/[\xf0\xd0]/g,"d").replace(/[\xc8\xc9\xca\xcb\xe9\xe8\xea\xeb]/g,"e").replace(/[\xcf\xef\xce\xee\xcd\xed\xcc\xec]/g,"i").replace(/[\xd1\xf1]/g,"n").replace(/[\xf8\xd8\u0153\u0152\xd5\xf5\xd4\xf4\xd3\xf3\xd2\xf2]/g,"o").replace(/[\xdc\xfc\xdb\xfb\xda\xfa\xd9\xf9]/g,"u").replace(/[\u0178\xff\xdd\xfd]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function s_(e){return _E.test(e)?"right":$E.test(e)?"center":EE.test(e)?"left":null}function l_(e,t,r,n){const o=r.inTable;r.inTable=!0;let a=e.trim().split(/( *(?:`[^`]*`|<.*?>.*?<\/.*?>(?!<\/.*?>)|\\\||\|) *)/).reduce(((e,o)=>("|"===o.trim()?e.push(n?{type:"26"}:{type:"27",text:o}):""!==o&&e.push.apply(e,t(o,r)),e)),[]);r.inTable=o;let i=[[]];return a.forEach((function(e,t){"26"===e.type?0!==t&&t!==a.length-1&&i.push([]):("27"!==e.type||null!=a[t+1]&&"26"!==a[t+1].type||(e.text=e.text.trimEnd()),i[i.length-1].push(e))})),i}function c_(e,t,r){r.inline=!0;const n=e[2]?e[2].replace(jE,"").split("|").map(s_):[],o=e[3]?function(e,t,r){return e.trim().split("\n").map((function(e){return l_(e,t,r,!0)}))}(e[3],t,r):[],a=l_(e[1],t,r,!!o.length);return r.inline=!1,o.length?{align:n,cells:o,header:a,type:"25"}:{children:a,type:"21"}}function u_(e,t){return null==e.align[t]?{}:{textAlign:e.align[t]}}function d_(e){return function(t,r){return r.inline?e.exec(t):null}}function p_(e){return function(t,r){return r.inline||r.simple?e.exec(t):null}}function f_(e){return function(t,r){return r.inline||r.simple?null:e.exec(t)}}function h_(e){return function(t){return e.exec(t)}}function m_(e,t,r){if(t.inline||t.simple)return null;if(r&&!r.endsWith("\n"))return null;let n="";e.split("\n").every((e=>!o_.some((t=>t.test(e)))&&(n+=e+"\n",e.trim())));const o=n.trimEnd();return""==o?null:[n,o]}function g_(e){try{if(decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return}catch(e){return null}return e}function v_(e){return e.replace(FE,"$1")}function y_(e,t,r){const n=r.inline||!1,o=r.simple||!1;r.inline=!0,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=o,a}function b_(e,t,r){const n=r.inline||!1,o=r.simple||!1;r.inline=!1,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=o,a}function x_(e,t,r){const n=r.inline||!1;r.inline=!1;const o=e(t,r);return r.inline=n,o}const w_=(e,t,r)=>({children:y_(t,e[1],r)});function S_(){return{}}function k_(){return null}function C_(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}function j_(e,t,r){let n=e;const o=t.split(".");for(;o.length&&(n=n[o[0]],void 0!==n);)o.shift();return n||r}const $_=t=>{let{children:r="",options:n}=t,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(o[r]=e[r]);return o}(t,A$);return e.cloneElement(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.overrides=r.overrides||{},r.slugify=r.slugify||i_,r.namedCodesToUnicode=r.namedCodesToUnicode?T$({},L$,r.namedCodesToUnicode):L$;const n=r.createElement||e.createElement;function o(e,t){const o=j_(r.overrides,`${e}.props`,{});for(var a=arguments.length,i=new Array(a>2?a-2:0),s=2;s<a;s++)i[s-2]=arguments[s];return n(function(e,t){const r=j_(t,e);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:j_(t,`${e}.component`,e):e}(e,r.overrides),T$({},t,o,{className:C_(null==t?void 0:t.className,o.className)||void 0}),...i)}function a(t){t=t.replace(nE,"");let n=!1;r.forceInline?n=!0:r.forceBlock||(n=!1===kE.test(t));const a=d(u(n?t:`${t.trimEnd().replace(AE,"")}\n\n`,{inline:n}));for(;"string"==typeof a[a.length-1]&&!a[a.length-1].trim();)a.pop();if(null===r.wrapper)return a;const i=r.wrapper||(n?"span":"div");let s;if(a.length>1||r.forceWrapper)s=a;else{if(1===a.length)return s=a[0],"string"==typeof s?o("span",{key:"outer"},s):s;s=null}return e.createElement(i,{key:"outer"},s)}function i(t){const r=t.match(W$);return r?r.reduce((function(t,r,n){const o=r.indexOf("=");if(-1!==o){const i=function(e){return-1!==e.indexOf("-")&&null===e.match(dE)&&(e=e.replace(vE,(function(e,t){return t.toUpperCase()}))),e}(r.slice(0,o)).trim(),s=function(e){const t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e}(r.slice(o+1).trim()),l=z$[i]||i,c=t[l]=function(e,t){return"style"===e?t.split(/;\s?/).reduce((function(e,t){const r=t.slice(0,t.indexOf(":"));return e[r.trim().replace(/(-[a-z])/g,(e=>e[1].toUpperCase()))]=t.slice(r.length+1).trim(),e}),{}):"href"===e||"src"===e?g_(t):(t.match(fE)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(i,s);"string"==typeof c&&(lE.test(c)||pE.test(c))&&(t[l]=e.cloneElement(a(c.trim()),{key:n}))}else"style"!==r&&(t[z$[r]||r]=!0);return t}),{}):null}const s=[],l={},c={0:{match:f_(U$),order:1,parse:(e,t,r)=>({children:t(e[0].replace(q$,""),r)}),render:(e,t,r)=>o("blockquote",{key:r.key},t(e.children,r))},1:{match:h_(G$),order:1,parse:S_,render:(e,t,r)=>o("br",{key:r.key})},2:{match:f_(K$),order:1,parse:S_,render:(e,t,r)=>o("hr",{key:r.key})},3:{match:f_(J$),order:0,parse:e=>({lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(e,t,r)=>o("pre",{key:r.key},o("code",T$({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},4:{match:f_(Q$),order:0,parse:e=>({attrs:i(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"})},5:{match:p_(Y$),order:3,parse:e=>({text:e[2]}),render:(e,t,r)=>o("code",{key:r.key},e.text)},6:{match:f_(eE),order:0,parse:e=>(s.push({footnote:e[2],identifier:e[1]}),{}),render:k_},7:{match:d_(tE),order:1,parse:e=>({target:`#${r.slugify(e[1])}`,text:e[1]}),render:(e,t,r)=>o("a",{key:r.key,href:g_(e.target)},o("sup",{key:r.key},e.text))},8:{match:d_(oE),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,t,r)=>o("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})},9:{match:f_(r.enforceAtxHeadings?iE:aE),order:1,parse:(e,t,n)=>({children:y_(t,e[2],n),id:r.slugify(e[2]),level:e[1].length}),render:(e,t,r)=>o(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r))},10:{match:f_(sE),order:0,parse:(e,t,r)=>({children:y_(t,e[1],r),level:"="===e[2]?1:2,type:"9"})},11:{match:h_(lE),order:1,parse(e,t,r){const[,n]=e[3].match(DE),o=new RegExp(`^${n}`,"gm"),a=e[3].replace(o,""),s=(l=a,a_.some((e=>e.test(l)))?x_:y_);var l;const c=e[1].toLowerCase(),u=-1!==B$.indexOf(c),d={attrs:i(e[2]),noInnerParse:u,tag:(u?c:e[1]).trim()};return r.inAnchor=r.inAnchor||"a"===c,u?d.text=e[3]:d.children=s(t,a,r),r.inAnchor=!1,d},render:(e,t,r)=>o(e.tag,T$({key:r.key},e.attrs),e.text||t(e.children,r))},13:{match:h_(pE),order:1,parse:e=>({attrs:i(e[2]||""),tag:e[1].trim()}),render:(e,t,r)=>o(e.tag,T$({},e.attrs,{key:r.key}))},12:{match:h_(uE),order:1,parse:()=>({}),render:k_},14:{match:p_(n_),order:1,parse:e=>({alt:e[1],target:v_(e[2]),title:e[3]}),render:(e,t,r)=>o("img",{key:r.key,alt:e.alt||void 0,title:e.title||void 0,src:g_(e.target)})},15:{match:d_(r_),order:3,parse:(e,t,r)=>({children:b_(t,e[1],r),target:v_(e[2]),title:e[3]}),render:(e,t,r)=>o("a",{key:r.key,href:g_(e.target),title:e.title},t(e.children,r))},16:{match:d_(gE),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],type:"15"})},17:{match:(e,t)=>t.inAnchor?null:d_(hE)(e,t),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"})},18:{match:d_(mE),order:0,parse(e){let t=e[1],r=e[1];return V$.test(r)||(r="mailto:"+r),{children:[{text:t.replace("mailto:",""),type:"27"}],target:r,type:"15"}}},20:t_(o,1),33:t_(o,2),19:{match:f_(X$),order:3,parse:S_,render:()=>"\n"},21:{match:m_,order:3,parse:w_,render:(e,t,r)=>o("p",{key:r.key},t(e.children,r))},22:{match:d_(bE),order:0,parse:e=>(l[e[1]]={target:e[2],title:e[4]},{}),render:k_},23:{match:p_(xE),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,t,r)=>l[e.ref]?o("img",{key:r.key,alt:e.alt,src:g_(l[e.ref].target),title:l[e.ref].title}):null},24:{match:d_(wE),order:0,parse:(e,t,r)=>({children:t(e[1],r),fallbackChildren:t(e[0].replace(SE,"\\$1"),r),ref:e[2]}),render:(e,t,r)=>l[e.ref]?o("a",{key:r.key,href:g_(l[e.ref].target),title:l[e.ref].title},t(e.children,r)):o("span",{key:r.key},t(e.fallbackChildren,r))},25:{match:f_(yE),order:1,parse:c_,render(e,t,r){const n=e;return o("table",{key:r.key},o("thead",null,o("tr",null,n.header.map((function(e,a){return o("th",{key:a,style:u_(n,a)},t(e,r))})))),o("tbody",null,n.cells.map((function(e,a){return o("tr",{key:a},e.map((function(e,a){return o("td",{key:a,style:u_(n,a)},t(e,r))})))}))))}},27:{match:h_(TE),order:4,parse:e=>({text:e[0].replace(cE,((e,t)=>r.namedCodesToUnicode[t]?r.namedCodesToUnicode[t]:e))}),render:e=>e.text},28:{match:p_(OE),order:2,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>o("strong",{key:r.key},t(e.children,r))},29:{match:p_(RE),order:3,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>o("em",{key:r.key},t(e.children,r))},30:{match:p_(IE),order:1,parse:e=>({text:e[1],type:"27"})},31:{match:p_(ME),order:3,parse:w_,render:(e,t,r)=>o("mark",{key:r.key},t(e.children,r))},32:{match:p_(NE),order:3,parse:w_,render:(e,t,r)=>o("del",{key:r.key},t(e.children,r))}};!0===r.disableParsingRawHTML&&(delete c[11],delete c[13]);const u=function(e){let t=Object.keys(e);function r(n,o){let a=[],i="";for(;n;){let s=0;for(;s<t.length;){const l=t[s],c=e[l],u=c.match(n,o,i);if(u){const e=u[0];n=n.substring(e.length);const t=c.parse(u,r,o);null==t.type&&(t.type=l),a.push(t),i=e;break}s++}}return a}return t.sort((function(t,r){let n=e[t].order,o=e[r].order;return n!==o?n-o:t<r?-1:1})),function(e,t){return r(function(e){return e.replace(Z$,"\n").replace(rE,"").replace(CE," ")}(e),t)}}(c),d=(p=function(e,t){return function(r,n,o){const a=e[r.type].render;return t?t((()=>a(r,n,o)),r,n,o):a(r,n,o)}}(c,r.renderRule),function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(t)){const n=r.key,o=[];let a=!1;for(let i=0;i<t.length;i++){r.key=i;const n=e(t[i],r),s="string"==typeof n;s&&a?o[o.length-1]+=n:null!==n&&o.push(n),a=s}return r.key=n,o}return p(t,e,r)});var p;const f=a(t);return s.length?o("div",null,f,o("footer",{key:"footer"},s.map((function(e){return o("div",{id:r.slugify(e.identifier),key:e.identifier},e.identifier,d(u(e.footnote,{inline:!0})))})))):f}(r,n),o)};const E_=function(e,t){return null==e||uk(e,t)};class __ extends e.Component{state={wasPropertyKeyModified:!1,additionalProperties:{}};isRequired(e){const{schema:t}=this.props;return Array.isArray(t.required)&&-1!==t.required.indexOf(e)}onPropertyChange=(()=>{var e=this;return function(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(n,o,a)=>{const{formData:i,onChange:s,errorSchema:l}=e.props;void 0===n&&r&&(n="");s({...i,[t]:n},l&&l&&{...l,[t]:o},a)}}})();onDropPropertyClick=e=>t=>{t.preventDefault();const{onChange:r,formData:n}=this.props,o={...n};E_(o,e),r(o)};getAvailableKey=(e,t)=>{const{uiSchema:r,registry:n}=this.props,{duplicateKeySuffixSeparator:o="-"}=Yy(r,n.globalUiOptions);let a=0,i=e;for(;Mk(t,i);)i=`${e}${o}${++a}`;return i};onKeyChange=e=>(t,r)=>{if(e===t)return;const{formData:n,onChange:o,errorSchema:a}=this.props;t=this.getAvailableKey(t,n);const i={...n},s={[e]:t},l=Object.keys(i).map((e=>({[s[e]||e]:i[e]}))),c=Object.assign({},...l);this.setState({wasPropertyKeyModified:!0}),o(c,a&&a&&{...a,[t]:r})};getDefaultValue(e){const{registry:{translateString:t}}=this.props;switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return t(b$.NewStringDefault)}}handleAddClick=e=>()=>{if(!e.additionalProperties)return;const{formData:t,onChange:r,registry:n}=this.props,o={...t};let a,i,s;if(Ab(e.additionalProperties)){a=e.additionalProperties.type,i=e.additionalProperties.const,s=e.additionalProperties.default;let r=e.additionalProperties;if(qy in r){const{schemaUtils:e}=n;r=e.retrieveSchema({$ref:r[qy]},t),a=r.type,i=r.const,s=r.default}a||!(My in r)&&!(Wy in r)||(a="object")}const l=this.getAvailableKey("newKey",o),c=i??s??this.getDefaultValue(a);bC(o,l,c),r(o)};render(){const{schema:e,uiSchema:t={},formData:r,errorSchema:n,idSchema:o,name:a,required:i=!1,disabled:s,readonly:l,hideError:c,idPrefix:u,idSeparator:d,onBlur:p,onFocus:f,registry:h,title:m}=this.props,{fields:g,formContext:v,schemaUtils:y,translateString:b,globalUiOptions:x}=h,{SchemaField:w}=g,S=y.retrieveSchema(e,r),k=Yy(t,x),{properties:C={}}=S,j=k.title??S.title??m??a,$=k.description??S.description;let E;try{E=function(e,t){if(!Array.isArray(t))return e;const r=e=>e.reduce(((e,t)=>(e[t]=!0,e)),{}),n=r(e),o=t.filter((e=>"*"===e||n[e])),a=r(o),i=e.filter((e=>!a[e])),s=o.indexOf("*");if(-1===s){if(i.length)throw new Error("uiSchema order list does not contain "+((l=i).length>1?`properties '${l.join("', '")}'`:`property '${l[0]}'`));return o}var l;if(s!==o.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const c=[...o];return c.splice(s,1,...i),c}(Object.keys(C),k.order)}catch(O){return(0,dt.jsxs)("div",{children:[(0,dt.jsx)("p",{className:"config-error",style:{color:"red"},children:(0,dt.jsx)($_,{options:{disableParsingRawHTML:!0},children:b(b$.InvalidObjectField,[a||"root",O.message])})}),(0,dt.jsx)("pre",{children:JSON.stringify(S)})]})}const _=Vj("ObjectFieldTemplate",h,k),P={title:!1===k.label?"":j,description:!1===k.label?void 0:$,properties:E.map((e=>{const a=Mk(S,[Vy,e,Py]),m=a?t.additionalProperties:t[e],g="hidden"===Yy(m).widget,y=uS(o,[e],{});return{content:(0,dt.jsx)(w,{name:e,required:this.isRequired(e),schema:uS(S,[Vy,e],{}),uiSchema:m,errorSchema:uS(n,e),idSchema:y,idPrefix:u,idSeparator:d,formData:uS(r,e),formContext:v,wasPropertyKeyModified:this.state.wasPropertyKeyModified,onKeyChange:this.onKeyChange(e),onChange:this.onPropertyChange(e,a),onBlur:p,onFocus:f,registry:h,disabled:s,readonly:l,hideError:c,onDropPropertyClick:this.onDropPropertyClick},e),name:e,readonly:l,disabled:s,required:i,hidden:g}})),readonly:l,disabled:s,required:i,idSchema:o,uiSchema:t,errorSchema:n,schema:S,formData:r,formContext:v,registry:h};return(0,dt.jsx)(_,{...P,onAddClick:this.handleAddClick})}}const P_=__,O_={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function R_(t){const{schema:r,idSchema:n,uiSchema:o,formData:a,errorSchema:i,idPrefix:s,idSeparator:l,name:c,onChange:u,onKeyChange:d,onDropPropertyClick:p,required:f,registry:h,wasPropertyKeyModified:m=!1}=t,{formContext:g,schemaUtils:v,globalUiOptions:y}=h,b=Yy(o,y),x=Vj("FieldTemplate",h,b),w=Vj("DescriptionFieldTemplate",h,b),S=Vj("FieldHelpTemplate",h,b),k=Vj("FieldErrorTemplate",h,b),C=v.retrieveSchema(r,a),j=n[Fy],$=uj(v.toIdSchema(C,j,a,s,l),n),E=(0,e.useCallback)(((e,t,r)=>u(e,t,r||j)),[j,u]),_=function(e,t,r,n){const o=t.field,{fields:a,translateString:i}=n;if("function"===typeof o)return o;if("string"===typeof o&&o in a)return a[o];const s=GC(e),l=Array.isArray(s)?s[0]:s||"",c=e.$id;let u=O_[l];return c&&c in a&&(u=c),u||!e.anyOf&&!e.oneOf?u in a?a[u]:()=>{const o=Vj("UnsupportedFieldTemplate",n,t);return(0,dt.jsx)(o,{schema:e,idSchema:r,reason:i(b$.UnknownFieldType,[String(e.type)]),registry:n})}:()=>null}(C,b,$,h),P=Boolean(b.disabled??t.disabled),O=Boolean(b.readonly??(t.readonly||t.schema.readOnly||C.readOnly)),R=b.hideError,M=void 0===R?t.hideError:Boolean(R),N=Boolean(b.autofocus??t.autofocus);if(0===Object.keys(C).length)return null;const I=v.getDisplayLabel(C,o,y),{__errors:T,...A}=i||{},D=jk(o,["ui:classNames","classNames","ui:style"]);Jy in D&&(D[Jy]=jk(D[Jy],["classNames","style"]));const F=(0,dt.jsx)(_,{...t,onChange:E,idSchema:$,schema:C,uiSchema:D,disabled:P,readonly:O,hideError:M,autofocus:N,errorSchema:A,formContext:g,rawErrors:T}),z=$[Fy];let L;L=m||Py in C?c:b.title||t.schema.title||C.title||t.title||c;const B=b.description||t.schema.description||C.description||"",W=b.enableMarkdownInDescription?(0,dt.jsx)($_,{options:{disableParsingRawHTML:!0},children:B}):B,V=b.help,H="hidden"===b.widget,U=["form-group","field",`field-${GC(C)}`];!M&&T&&T.length>0&&U.push("field-error has-error has-danger"),o?.classNames&&U.push(o.classNames),b.classNames&&U.push(b.classNames);const q=(0,dt.jsx)(S,{help:V,idSchema:$,schema:C,uiSchema:o,hasErrors:!M&&T&&T.length>0,registry:h}),G=M||(C.anyOf||C.oneOf)&&!v.isSelect(C)?void 0:(0,dt.jsx)(k,{errors:T,errorSchema:i,idSchema:$,schema:C,uiSchema:o,registry:h}),K={description:(0,dt.jsx)(w,{id:Kj(z),description:W,schema:C,uiSchema:o,registry:h}),rawDescription:B,help:q,rawHelp:"string"===typeof V?V:void 0,errors:G,rawErrors:M?void 0:T,id:z,label:L,hidden:H,onChange:u,onKeyChange:d,onDropPropertyClick:p,required:f,disabled:P,readonly:O,hideError:M,displayLabel:I,classNames:U.join(" ").trim(),style:b.style,formContext:g,formData:a,schema:C,uiSchema:o,registry:h},Q=h.fields.AnyOfField,J=h.fields.OneOfField,Y=o?.["ui:field"]&&!0===o?.["ui:fieldReplacesAnyOrOneOf"];return(0,dt.jsx)(x,{...K,children:(0,dt.jsxs)(dt.Fragment,{children:[F,C.anyOf&&!Y&&!v.isSelect(C)&&(0,dt.jsx)(Q,{name:c,disabled:P,readonly:O,hideError:M,errorSchema:i,formData:a,formContext:g,idPrefix:s,idSchema:$,idSeparator:l,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:C.anyOf.map((e=>v.retrieveSchema(Ab(e)?e:{},a))),registry:h,required:f,schema:C,uiSchema:o}),C.oneOf&&!Y&&!v.isSelect(C)&&(0,dt.jsx)(J,{name:c,disabled:P,readonly:O,hideError:M,errorSchema:i,formData:a,formContext:g,idPrefix:s,idSchema:$,idSeparator:l,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:C.oneOf.map((e=>v.retrieveSchema(Ab(e)?e:{},a))),registry:h,required:f,schema:C,uiSchema:o})]})})}class M_ extends e.Component{shouldComponentUpdate(e){return!qw(this.props,e)}render(){return(0,dt.jsx)(R_,{...this.props})}}const N_=M_;const I_=function(e){const{schema:t,name:r,uiSchema:n,idSchema:o,formData:a,required:i,disabled:s=!1,readonly:l=!1,autofocus:c=!1,onChange:u,onBlur:d,onFocus:p,registry:f,rawErrors:h,hideError:m}=e,{title:g,format:v}=t,{widgets:y,formContext:b,schemaUtils:x,globalUiOptions:w}=f,S=x.isSelect(t)?mj(t,n):void 0;let k=S?"select":"text";v&&function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return qj(e,t,r),!0}catch(Ya){const t=Ya;if(t.message&&(t.message.startsWith("No widget")||t.message.startsWith("Unsupported widget")))return!1;throw Ya}}(t,v,y)&&(k=v);const{widget:C=k,placeholder:j="",title:$,...E}=Yy(n),_=x.getDisplayLabel(t,n,w),P=$??g??r,O=qj(t,C,y);return(0,dt.jsx)(O,{options:{...E,enumOptions:S},schema:t,uiSchema:n,id:o.$id,name:r,label:P,hideLabel:!_,hideError:m,value:a,onChange:u,onBlur:d,onFocus:p,required:i,disabled:s,readonly:l,formContext:b,autofocus:c,registry:f,placeholder:j,rawErrors:h})};const T_=function(t){const{formData:r,onChange:n}=t;return(0,e.useEffect)((()=>{void 0===r&&n(null)}),[r,n]),null};const A_=function(){return{AnyOfField:R$,ArrayField:_$,BooleanField:P$,NumberField:I$,ObjectField:P_,OneOfField:R$,SchemaField:N_,StringField:I_,NullField:T_}};function D_(e){const{idSchema:t,description:r,registry:n,schema:o,uiSchema:a}=e,i=Yy(a,n.globalUiOptions),{label:s=!0}=i;if(!r||!s)return null;const l=Vj("DescriptionFieldTemplate",n,i);return(0,dt.jsx)(l,{id:Kj(t),description:r,schema:o,uiSchema:a,registry:n})}function F_(e){const{children:t,className:r,disabled:n,hasToolbar:o,hasMoveDown:a,hasMoveUp:i,hasRemove:s,hasCopy:l,index:c,onCopyIndexClick:u,onDropIndexClick:d,onReorderClick:p,readonly:f,registry:h,uiSchema:m}=e,{CopyButton:g,MoveDownButton:v,MoveUpButton:y,RemoveButton:b}=h.templates.ButtonTemplates,x={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return(0,dt.jsxs)("div",{className:r,children:[(0,dt.jsx)("div",{className:o?"col-xs-9":"col-xs-12",children:t}),o&&(0,dt.jsx)("div",{className:"col-xs-3 array-item-toolbox",children:(0,dt.jsxs)("div",{className:"btn-group",style:{display:"flex",justifyContent:"space-around"},children:[(i||a)&&(0,dt.jsx)(y,{style:x,disabled:n||f||!i,onClick:p(c,c-1),uiSchema:m,registry:h}),(i||a)&&(0,dt.jsx)(v,{style:x,disabled:n||f||!a,onClick:p(c,c+1),uiSchema:m,registry:h}),l&&(0,dt.jsx)(g,{style:x,disabled:n||f,onClick:u(c),uiSchema:m,registry:h}),s&&(0,dt.jsx)(b,{style:x,disabled:n||f,onClick:d(c),uiSchema:m,registry:h})]})})]})}function z_(e){const{canAdd:t,className:r,disabled:n,idSchema:o,uiSchema:a,items:i,onAddClick:s,readonly:l,registry:c,required:u,schema:d,title:p}=e,f=Yy(a),h=Vj("ArrayFieldDescriptionTemplate",c,f),m=Vj("ArrayFieldItemTemplate",c,f),g=Vj("ArrayFieldTitleTemplate",c,f),{ButtonTemplates:{AddButton:v}}=c.templates;return(0,dt.jsxs)("fieldset",{className:r,id:o.$id,children:[(0,dt.jsx)(g,{idSchema:o,title:f.title||p,required:u,schema:d,uiSchema:a,registry:c}),(0,dt.jsx)(h,{idSchema:o,description:f.description||d.description,schema:d,uiSchema:a,registry:c}),(0,dt.jsx)("div",{className:"row array-item-list",children:i&&i.map((e=>{let{key:t,...r}=e;return(0,dt.jsx)(m,{...r},t)}))}),t&&(0,dt.jsx)(v,{className:"array-item-add",onClick:s,disabled:n||l,uiSchema:a,registry:c})]})}function L_(e){const{idSchema:t,title:r,schema:n,uiSchema:o,required:a,registry:i}=e,s=Yy(o,i.globalUiOptions),{label:l=!0}=s;if(!r||!l)return null;const c=Vj("TitleFieldTemplate",i,s);return(0,dt.jsx)(c,{id:Xj(t),title:r,required:a,schema:n,uiSchema:o,registry:i})}function B_(t){const{id:r,name:n,value:o,readonly:a,disabled:i,autofocus:s,onBlur:l,onFocus:c,onChange:u,onChangeOverride:d,options:p,schema:f,uiSchema:h,formContext:m,registry:g,rawErrors:v,type:y,hideLabel:b,hideError:x,...w}=t;if(!r)throw console.log("No id for",t),new Error(`no id for props ${JSON.stringify(t)}`);const S={...w,...Lj(f,y,p)};let k;k="number"===S.type||"integer"===S.type?o||0===o?o:"":null==o?"":o;const C=(0,e.useCallback)((e=>{let{target:{value:t}}=e;return u(""===t?p.emptyValue:t)}),[u,p]),j=(0,e.useCallback)((e=>{let{target:t}=e;return l(r,t&&t.value)}),[l,r]),$=(0,e.useCallback)((e=>{let{target:t}=e;return c(r,t&&t.value)}),[c,r]);return(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)("input",{id:r,name:r,className:"form-control",readOnly:a,disabled:i,autoFocus:s,value:k,...S,list:f.examples?Jj(r):void 0,onChange:d||C,onBlur:j,onFocus:$,"aria-describedby":Zj(r,!!f.examples)}),Array.isArray(f.examples)&&(0,dt.jsx)("datalist",{id:Jj(r),children:f.examples.concat(f.default&&!f.examples.includes(f.default)?[f.default]:[]).map((e=>(0,dt.jsx)("option",{value:e},e)))},`datalist_${r}`)]})}function W_(e){let{uiSchema:t}=e;const{submitText:r,norender:n,props:o={}}=Wj(t);return n?null:(0,dt.jsx)("div",{children:(0,dt.jsx)("button",{type:"submit",...o,className:`btn btn-info ${o.className||""}`,children:r})})}function V_(e){const{iconType:t="default",icon:r,className:n,uiSchema:o,registry:a,...i}=e;return(0,dt.jsx)("button",{type:"button",className:`btn btn-${t} ${n}`,...i,children:(0,dt.jsx)("i",{className:`glyphicon glyphicon-${r}`})})}function H_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.CopyButton),className:"array-item-copy",...e,icon:"copy"})}function U_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.MoveDownButton),className:"array-item-move-down",...e,icon:"arrow-down"})}function q_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.MoveUpButton),className:"array-item-move-up",...e,icon:"arrow-up"})}function G_(e){const{registry:{translateString:t}}=e;return(0,dt.jsx)(V_,{title:t(b$.RemoveButton),className:"array-item-remove",...e,iconType:"danger",icon:"remove"})}function K_(e){let{className:t,onClick:r,disabled:n,registry:o}=e;const{translateString:a}=o;return(0,dt.jsx)("div",{className:"row",children:(0,dt.jsx)("p",{className:`col-xs-3 col-xs-offset-9 text-right ${t}`,children:(0,dt.jsx)(V_,{iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:a(b$.AddButton),onClick:r,disabled:n,registry:o})})})}const Q_=function(){return{SubmitButton:W_,AddButton:K_,CopyButton:H_,MoveDownButton:U_,MoveUpButton:q_,RemoveButton:G_}};function J_(e){const{id:t,description:r}=e;return r?"string"===typeof r?(0,dt.jsx)("p",{id:t,className:"field-description",children:r}):(0,dt.jsx)("div",{id:t,className:"field-description",children:r}):null}function Y_(e){let{errors:t,registry:r}=e;const{translateString:n}=r;return(0,dt.jsxs)("div",{className:"panel panel-danger errors",children:[(0,dt.jsx)("div",{className:"panel-heading",children:(0,dt.jsx)("h3",{className:"panel-title",children:n(b$.ErrorsLabel)})}),(0,dt.jsx)("ul",{className:"list-group",children:t.map(((e,t)=>(0,dt.jsx)("li",{className:"list-group-item text-danger",children:e.stack},t)))})]})}const X_="*";function Z_(e){const{label:t,required:r,id:n}=e;return t?(0,dt.jsxs)("label",{className:"control-label",htmlFor:n,children:[t,r&&(0,dt.jsx)("span",{className:"required",children:X_})]}):null}const eP=function(e){const{id:t,label:r,children:n,errors:o,help:a,description:i,hidden:s,required:l,displayLabel:c,registry:u,uiSchema:d}=e,p=Vj("WrapIfAdditionalTemplate",u,Yy(d));return s?(0,dt.jsx)("div",{className:"hidden",children:n}):(0,dt.jsxs)(p,{...e,children:[c&&(0,dt.jsx)(Z_,{label:r,required:l,id:t}),c&&i?i:null,n,o,a]})};function tP(e){const{errors:t=[],idSchema:r}=e;if(0===t.length)return null;const n=Qj(r);return(0,dt.jsx)("div",{children:(0,dt.jsx)("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:t.filter((e=>!!e)).map(((e,t)=>(0,dt.jsx)("li",{className:"text-danger",children:e},t)))})})}function rP(e){const{idSchema:t,help:r}=e;if(!r)return null;const n=Yj(t);return"string"===typeof r?(0,dt.jsx)("p",{id:n,className:"help-block",children:r}):(0,dt.jsx)("div",{id:n,className:"help-block",children:r})}function nP(e){const{description:t,disabled:r,formData:n,idSchema:o,onAddClick:a,properties:i,readonly:s,registry:l,required:c,schema:u,title:d,uiSchema:p}=e,f=Yy(p),h=Vj("TitleFieldTemplate",l,f),m=Vj("DescriptionFieldTemplate",l,f),{ButtonTemplates:{AddButton:g}}=l.templates;return(0,dt.jsxs)("fieldset",{id:o.$id,children:[d&&(0,dt.jsx)(h,{id:Xj(o),title:d,required:c,schema:u,uiSchema:p,registry:l}),t&&(0,dt.jsx)(m,{id:Kj(o),description:t,schema:u,uiSchema:p,registry:l}),i.map((e=>e.content)),Xy(u,p,n)&&(0,dt.jsx)(g,{className:"object-property-expand",onClick:a(u),disabled:r||s,uiSchema:p,registry:l})]})}const oP="*";function aP(e){const{id:t,title:r,required:n}=e;return(0,dt.jsxs)("legend",{id:t,children:[r,n&&(0,dt.jsx)("span",{className:"required",children:oP})]})}const iP=function(e){const{schema:t,idSchema:r,reason:n,registry:o}=e,{translateString:a}=o;let i=b$.UnsupportedField;const s=[];return r&&r.$id&&(i=b$.UnsupportedFieldWithId,s.push(r.$id)),n&&(i=i===b$.UnsupportedField?b$.UnsupportedFieldWithReason:b$.UnsupportedFieldWithIdAndReason,s.push(n)),(0,dt.jsxs)("div",{className:"unsupported-field",children:[(0,dt.jsx)("p",{children:(0,dt.jsx)($_,{options:{disableParsingRawHTML:!0},children:a(i,s)})}),t&&(0,dt.jsx)("pre",{children:JSON.stringify(t,null,2)})]})};function sP(e){const{id:t,classNames:r,style:n,disabled:o,label:a,onKeyChange:i,onDropPropertyClick:s,readonly:l,required:c,schema:u,children:d,uiSchema:p,registry:f}=e,{templates:h,translateString:m}=f,{RemoveButton:g}=h.ButtonTemplates,v=m(b$.KeyLabel,[a]);return Py in u?(0,dt.jsx)("div",{className:r,style:n,children:(0,dt.jsxs)("div",{className:"row",children:[(0,dt.jsx)("div",{className:"col-xs-5 form-additional",children:(0,dt.jsxs)("div",{className:"form-group",children:[(0,dt.jsx)(Z_,{label:v,required:c,id:`${t}-key`}),(0,dt.jsx)("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:e=>{let{target:t}=e;return i(t&&t.value)},defaultValue:a})]})}),(0,dt.jsx)("div",{className:"form-additional form-group col-xs-5",children:d}),(0,dt.jsx)("div",{className:"col-xs-2",children:(0,dt.jsx)(g,{className:"array-item-remove btn-block",style:{border:"0"},disabled:o||l,onClick:s(a),uiSchema:p,registry:f})})]})}):(0,dt.jsx)("div",{className:r,style:n,children:d})}const lP=function(){return{ArrayFieldDescriptionTemplate:D_,ArrayFieldItemTemplate:F_,ArrayFieldTemplate:z_,ArrayFieldTitleTemplate:L_,ButtonTemplates:Q_(),BaseInputTemplate:B_,DescriptionFieldTemplate:J_,ErrorListTemplate:Y_,FieldTemplate:eP,FieldErrorTemplate:tP,FieldHelpTemplate:rP,ObjectFieldTemplate:nP,TitleFieldTemplate:aP,UnsupportedFieldTemplate:iP,WrapIfAdditionalTemplate:sP}};function cP(e){let{type:t,range:r,value:n,select:o,rootId:a,name:i,disabled:s,readonly:l,autofocus:c,registry:u,onBlur:d,onFocus:p}=e;const f=a+"_"+t,{SelectWidget:h}=u.widgets;return(0,dt.jsx)(h,{schema:{type:"integer"},id:f,name:i,className:"form-control",options:{enumOptions:Nj(r[0],r[1])},placeholder:t,value:n,disabled:s,readonly:l,autofocus:c,onChange:e=>o(t,e),onBlur:d,onFocus:p,registry:u,label:"","aria-describedby":Zj(a)})}const uP=function(t){let{time:r=!1,disabled:n=!1,readonly:o=!1,autofocus:a=!1,options:i,id:s,name:l,registry:c,onBlur:u,onFocus:d,onChange:p,value:f}=t;const{translateString:h}=c,[m,g]=(0,e.useState)(f),[v,y]=(0,e.useReducer)(((e,t)=>({...e,...t})),r$(f,r));(0,e.useEffect)((()=>{const e=o$(v,r);!function(e){return Object.values(e).every((e=>-1!==e))}(v)||e===f?m!==f&&(g(f),y(r$(f,r))):p(e)}),[r,f,p,v,m]);const b=(0,e.useCallback)(((e,t)=>{y({[e]:t})}),[]),x=(0,e.useCallback)((e=>{if(e.preventDefault(),n||o)return;const t=r$((new Date).toJSON(),r);p(o$(t,r))}),[n,o,r]),w=(0,e.useCallback)((e=>{e.preventDefault(),n||o||p(void 0)}),[n,o,p]);return(0,dt.jsxs)("ul",{className:"list-inline",children:[Fj(v,r,i.yearsRange,i.format).map(((e,t)=>(0,dt.jsx)("li",{className:"list-inline-item",children:(0,dt.jsx)(cP,{rootId:s,name:l,select:b,...e,disabled:n,readonly:o,registry:c,onBlur:u,onFocus:d,autofocus:a&&0===t})},t))),("undefined"===i.hideNowButton||!i.hideNowButton)&&(0,dt.jsx)("li",{className:"list-inline-item",children:(0,dt.jsx)("a",{href:"#",className:"btn btn-info btn-now",onClick:x,children:h(b$.NowLabel)})}),("undefined"===i.hideClearButton||!i.hideClearButton)&&(0,dt.jsx)("li",{className:"list-inline-item",children:(0,dt.jsx)("a",{href:"#",className:"btn btn-warning btn-clear",onClick:w,children:h(b$.ClearLabel)})})]})};const dP=function(e){let{time:t=!0,...r}=e;const{AltDateWidget:n}=r.registry.widgets;return(0,dt.jsx)(n,{time:t,...r})};const pP=function(t){let{schema:r,uiSchema:n,options:o,id:a,value:i,disabled:s,readonly:l,label:c,hideLabel:u,autofocus:d=!1,onBlur:p,onFocus:f,onChange:h,registry:m}=t;const g=Vj("DescriptionFieldTemplate",m,o),v=n$(r),y=(0,e.useCallback)((e=>h(e.target.checked)),[h]),b=(0,e.useCallback)((e=>p(a,e.target.checked)),[p,a]),x=(0,e.useCallback)((e=>f(a,e.target.checked)),[f,a]),w=o.description??r.description;return(0,dt.jsxs)("div",{className:"checkbox "+(s||l?"disabled":""),children:[!u&&!!w&&(0,dt.jsx)(g,{id:Kj(a),description:w,schema:r,uiSchema:n,registry:m}),(0,dt.jsxs)("label",{children:[(0,dt.jsx)("input",{type:"checkbox",id:a,name:a,checked:"undefined"!==typeof i&&i,required:v,disabled:s||l,autoFocus:d,onChange:y,onBlur:b,onFocus:x,"aria-describedby":Zj(a)}),t$((0,dt.jsx)("span",{children:c}),u)]})]})};const fP=function(t){let{id:r,disabled:n,options:{inline:o=!1,enumOptions:a,enumDisabled:i,emptyValue:s},value:l,autofocus:c=!1,readonly:u,onChange:d,onBlur:p,onFocus:f}=t;const h=Array.isArray(l)?l:[l],m=(0,e.useCallback)((e=>{let{target:t}=e;return p(r,Tj(t&&t.value,a,s))}),[p,r]),g=(0,e.useCallback)((e=>{let{target:t}=e;return f(r,Tj(t&&t.value,a,s))}),[f,r]);return(0,dt.jsx)("div",{className:"checkboxes",id:r,children:Array.isArray(a)&&a.map(((e,t)=>{const s=Aj(e.value,h),l=Array.isArray(i)&&-1!==i.indexOf(e.value),p=n||l||u?"disabled":"",f=(0,dt.jsxs)("span",{children:[(0,dt.jsx)("input",{type:"checkbox",id:e$(r,t),name:r,checked:s,value:String(t),disabled:n||l||u,autoFocus:c&&0===t,onChange:e=>{e.target.checked?d(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=Tj(e,r);if(!lj(n)){const e=r.findIndex((e=>n===e.value)),o=r.map((e=>{let{value:t}=e;return t}));return t.slice(0,e).concat(n,t.slice(e)).sort(((e,t)=>Number(o.indexOf(e)>o.indexOf(t))))}return t}(t,h,a)):d(function(e,t){const r=Tj(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]);return Array.isArray(t)?t.filter((e=>!qw(e,r))):qw(r,t)?void 0:t}(t,h,a))},onBlur:m,onFocus:g,"aria-describedby":Zj(r)}),(0,dt.jsx)("span",{children:e.label})]});return o?(0,dt.jsx)("label",{className:`checkbox-inline ${p}`,children:f},t):(0,dt.jsx)("div",{className:`checkbox ${p}`,children:(0,dt.jsx)("label",{children:f})},t)}))})};function hP(e){const{disabled:t,readonly:r,options:n,registry:o}=e,a=Vj("BaseInputTemplate",o,n);return(0,dt.jsx)(a,{type:"color",...e,disabled:t||r})}function mP(t){const{onChange:r,options:n,registry:o}=t,a=Vj("BaseInputTemplate",o,n),i=(0,e.useCallback)((e=>r(e||void 0)),[r]);return(0,dt.jsx)(a,{type:"date",...t,onChange:i})}function gP(e){const{onChange:t,value:r,options:n,registry:o}=e,a=Vj("BaseInputTemplate",o,n);return(0,dt.jsx)(a,{type:"datetime-local",...e,value:d$(r),onChange:e=>{return t((r=e)?new Date(r).toJSON():void 0);var r}})}function vP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"email",...e})}function yP(e,t){return null===e?null:e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function bP(e){const{name:t,size:r,type:n}=e;return new Promise(((o,a)=>{const i=new window.FileReader;i.onerror=a,i.onload=e=>{"string"===typeof e.target?.result?o({dataURL:yP(e.target.result,t),name:t,size:r,type:n}):o({dataURL:null,name:t,size:r,type:n})},i.readAsDataURL(e)}))}function xP(e){let{fileInfo:t,registry:r}=e;const{translateString:n}=r,{dataURL:o,type:a,name:i}=t;return o?["image/jpeg","image/png"].includes(a)?(0,dt.jsx)("img",{src:o,style:{maxWidth:"100%"},className:"file-preview"}):(0,dt.jsxs)(dt.Fragment,{children:[" ",(0,dt.jsx)("a",{download:`preview-${i}`,href:o,className:"file-download",children:n(b$.PreviewLabel)})]}):null}function wP(e){let{filesInfo:t,registry:r,preview:n,onRemove:o,options:a}=e;if(0===t.length)return null;const{translateString:i}=r,{RemoveButton:s}=Vj("ButtonTemplates",r,a);return(0,dt.jsx)("ul",{className:"file-info",children:t.map(((e,t)=>{const{name:a,size:l,type:c}=e;return(0,dt.jsxs)("li",{children:[(0,dt.jsx)($_,{children:i(b$.FilesInfo,[a,c,String(l)])}),n&&(0,dt.jsx)(xP,{fileInfo:e,registry:r}),(0,dt.jsx)(s,{onClick:()=>o(t),registry:r})]},t)}))})}function SP(e){return e.reduce(((e,t)=>{if(!t)return e;try{const{blob:r,name:n}=function(e){var t;if(-1===e.indexOf("data:"))throw new Error("File is invalid: URI must be a dataURI");const r=e.slice(5).split(";base64,");if(2!==r.length)throw new Error("File is invalid: dataURI must be base64");const[n,o]=r,[a,...i]=n.split(";"),s=a||"",l=decodeURI((null===(t=i.map((e=>e.split("="))).find((e=>{let[t]=e;return"name"===t})))||void 0===t?void 0:t[1])||"unknown");try{const e=atob(o),t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return{blob:new window.Blob([new Uint8Array(t)],{type:s}),name:l}}catch(c){throw new Error("File is invalid: "+c.message)}}(t);return[...e,{dataURL:t,name:n,size:r.size,type:r.type}]}catch(Ya){return e}}),[])}const kP=function(t){const{disabled:r,readonly:n,required:o,multiple:a,onChange:i,value:s,options:l,registry:c}=t,u=Vj("BaseInputTemplate",c,l),d=(0,e.useCallback)((e=>{var t;e.target.files&&(t=e.target.files,Promise.all(Array.from(t).map(bP))).then((e=>{const t=e.map((e=>e.dataURL));i(a?s.concat(t):t[0])}))}),[a,s,i]),p=(0,e.useMemo)((()=>SP(Array.isArray(s)?s:[s])),[s]),f=(0,e.useCallback)((e=>{if(a){const t=s.filter(((t,r)=>r!==e));i(t)}else i(void 0)}),[a,s,i]);return(0,dt.jsxs)("div",{children:[(0,dt.jsx)(u,{...t,disabled:r||n,type:"file",required:!s&&o,onChangeOverride:d,value:"",accept:l.accept?String(l.accept):void 0}),(0,dt.jsx)(wP,{filesInfo:p,onRemove:f,registry:c,preview:l.filePreview,options:l})]})};const CP=function(e){let{id:t,value:r}=e;return(0,dt.jsx)("input",{type:"hidden",id:t,name:t,value:"undefined"===typeof r?"":r})};function jP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"password",...e})}const $P=function(t){let{options:r,value:n,required:o,disabled:a,readonly:i,autofocus:s=!1,onBlur:l,onFocus:c,onChange:u,id:d}=t;const{enumOptions:p,enumDisabled:f,inline:h,emptyValue:m}=r,g=(0,e.useCallback)((e=>{let{target:t}=e;return l(d,Tj(t&&t.value,p,m))}),[l,d]),v=(0,e.useCallback)((e=>{let{target:t}=e;return c(d,Tj(t&&t.value,p,m))}),[c,d]);return(0,dt.jsx)("div",{className:"field-radio-group",id:d,children:Array.isArray(p)&&p.map(((e,t)=>{const r=Aj(e.value,n),l=Array.isArray(f)&&-1!==f.indexOf(e.value),c=a||l||i?"disabled":"",p=(0,dt.jsxs)("span",{children:[(0,dt.jsx)("input",{type:"radio",id:e$(d,t),checked:r,name:d,required:o,value:String(t),disabled:a||l||i,autoFocus:s&&0===t,onChange:()=>u(e.value),onBlur:g,onFocus:v,"aria-describedby":Zj(d)}),(0,dt.jsx)("span",{children:e.label})]});return h?(0,dt.jsx)("label",{className:`radio-inline ${c}`,children:p},t):(0,dt.jsx)("div",{className:`radio ${c}`,children:(0,dt.jsx)("label",{children:p})},t)}))})};function EP(e){const{value:t,registry:{templates:{BaseInputTemplate:r}}}=e;return(0,dt.jsxs)("div",{className:"field-range-wrapper",children:[(0,dt.jsx)(r,{type:"range",...e}),(0,dt.jsx)("span",{className:"range-view",children:t})]})}function _P(e,t){return t?Array.from(e.target.options).slice().filter((e=>e.selected)).map((e=>e.value)):e.target.value}const PP=function(t){let{schema:r,id:n,options:o,value:a,required:i,disabled:s,readonly:l,multiple:c=!1,autofocus:u=!1,onChange:d,onBlur:p,onFocus:f,placeholder:h}=t;const{enumOptions:m,enumDisabled:g,emptyValue:v}=o,y=c?[]:"",b=(0,e.useCallback)((e=>{const t=_P(e,c);return f(n,Tj(t,m,v))}),[f,n,r,c,m,v]),x=(0,e.useCallback)((e=>{const t=_P(e,c);return p(n,Tj(t,m,v))}),[p,n,r,c,m,v]),w=(0,e.useCallback)((e=>{const t=_P(e,c);return d(Tj(t,m,v))}),[d,r,c,m,v]),S=Dj(a,m,c),k=!c&&void 0===r.default;return(0,dt.jsxs)("select",{id:n,name:n,multiple:c,className:"form-control",value:"undefined"===typeof S?y:S,required:i,disabled:s||l,autoFocus:u,onBlur:x,onFocus:b,onChange:w,"aria-describedby":Zj(n),children:[k&&(0,dt.jsx)("option",{value:"",children:h}),Array.isArray(m)&&m.map(((e,t)=>{let{value:r,label:n}=e;const o=g&&-1!==g.indexOf(r);return(0,dt.jsx)("option",{value:String(t),disabled:o,children:n},t)}))]})};function OP(t){let{id:r,options:n={},placeholder:o,value:a,required:i,disabled:s,readonly:l,autofocus:c=!1,onChange:u,onBlur:d,onFocus:p}=t;const f=(0,e.useCallback)((e=>{let{target:{value:t}}=e;return u(""===t?n.emptyValue:t)}),[u,n.emptyValue]),h=(0,e.useCallback)((e=>{let{target:t}=e;return d(r,t&&t.value)}),[d,r]),m=(0,e.useCallback)((e=>{let{target:t}=e;return p(r,t&&t.value)}),[r,p]);return(0,dt.jsx)("textarea",{id:r,name:r,className:"form-control",value:a||"",placeholder:o,required:i,disabled:s,readOnly:l,autoFocus:c,rows:n.rows,onBlur:h,onFocus:m,onChange:f,"aria-describedby":Zj(r)})}OP.defaultProps={autofocus:!1,options:{}};const RP=OP;function MP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{...e})}function NP(t){const{onChange:r,options:n,registry:o}=t,a=Vj("BaseInputTemplate",o,n),i=(0,e.useCallback)((e=>r(e?`${e}:00`:void 0)),[r]);return(0,dt.jsx)(a,{type:"time",...t,onChange:i})}function IP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"url",...e})}function TP(e){const{options:t,registry:r}=e,n=Vj("BaseInputTemplate",r,t);return(0,dt.jsx)(n,{type:"number",...e})}const AP=function(){return{AltDateWidget:uP,AltDateTimeWidget:dP,CheckboxWidget:pP,CheckboxesWidget:fP,ColorWidget:hP,DateWidget:mP,DateTimeWidget:gP,EmailWidget:vP,FileWidget:kP,HiddenWidget:CP,PasswordWidget:jP,RadioWidget:$P,RangeWidget:EP,SelectWidget:PP,TextWidget:MP,TextareaWidget:RP,TimeWidget:NP,UpDownWidget:TP,URLWidget:IP}};class DP extends e.Component{formElement;constructor(t){if(super(t),!t.validator)throw new Error("A validator is required for Form functionality to work");this.state=this.getStateFromProps(t,t.formData),this.props.onChange&&!qw(this.state.formData,this.props.formData)&&this.props.onChange(this.state),this.formElement=(0,e.createRef)()}getSnapshotBeforeUpdate(e,t){if(!qw(this.props,e)){const r=function(e,t){const r=xb(e),n=xb(t);return e===t||!r&&!n?[]:r&&!n?bw(e):!r&&n?bw(t):[...bw(m$(e,((e,r)=>!qw(e,uS(t,r))))),...y$(bw(t),bw(e))]}(this.props.formData,e.formData),n=!qw(e.schema,this.props.schema),o=r.length>0||!qw(e.formData,this.props.formData),a=this.getStateFromProps(this.props,this.props.formData,n||o?void 0:this.state.retrievedSchema,n,r);return{nextState:a,shouldUpdate:!qw(a,t)}}return{shouldUpdate:!1}}componentDidUpdate(e,t,r){if(r.shouldUpdate){const{nextState:e}=r;qw(e.formData,this.props.formData)||qw(e.formData,t.formData)||!this.props.onChange||this.props.onChange(e),this.setState(e)}}getStateFromProps(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const a=this.state||{},i="schema"in e?e.schema:this.props.schema,s=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},l="undefined"!==typeof t,c="liveValidate"in e?e.liveValidate:this.props.liveValidate,u=l&&!e.noValidate&&c,d=i,p="experimental_defaultFormStateBehavior"in e?e.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,f="experimental_customMergeAllOf"in e?e.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let h=a.schemaUtils;h&&!h.doesSchemaUtilsDiffer(e.validator,d,p,f)||(h=function(e,t){return new Rj(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},arguments.length>3?arguments[3]:void 0)}(e.validator,d,p,f));const m=h.getDefaultFormState(i,t),g=this.updateRetrievedSchema(r??h.retrieveSchema(i,m));let v,y,b=a.schemaValidationErrors,x=a.schemaValidationErrorSchema;if(u){const e=this.validate(m,i,h,g);v=e.errors,y=void 0===r?e.errorSchema:uj(this.state?.errorSchema,e.errorSchema,"preventDuplicates"),b=v,x=y}else{const t=e.noValidate||n?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};if(v=t.errors,y=t.errorSchema,o.length>0){const e=o.reduce(((e,t)=>(e[t]=void 0,e)),{});y=x=uj(t.errorSchema,e,"preventDuplicates")}}if(e.extraErrors){const t=p$({errorSchema:y,errors:v},e.extraErrors);y=t.errorSchema,v=t.errors}const w=h.toIdSchema(g,s["ui:rootFieldId"],m,e.idPrefix,e.idSeparator);return{schemaUtils:h,schema:i,uiSchema:s,idSchema:w,formData:m,edit:l,errors:v,errorSchema:y,schemaValidationErrors:b,schemaValidationErrorSchema:x,retrievedSchema:g}}shouldComponentUpdate(e,t){return function(e,t,r){const{props:n,state:o}=e;return!qw(n,t)||!qw(o,r)}(this,e,t)}getPreviousCustomValidateErrors(){const{customValidate:e,uiSchema:t}=this.props,r=this.state.formData;let n={};if("function"===typeof e){n=u$(e(r,wb(r),t))}return n}validate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.schema,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;const o=r||this.state.schemaUtils,{customValidate:a,transformErrors:i,uiSchema:s}=this.props,l=n??o.retrieveSchema(t,e);return o.getValidator().validateFormData(e,l,a,i,s)}renderErrors(e){const{errors:t,errorSchema:r,schema:n,uiSchema:o}=this.state,{formContext:a}=this.props,i=Vj("ErrorListTemplate",e,Yy(o));return t&&t.length?(0,dt.jsx)(i,{errors:t,errorSchema:r||{},schema:n,uiSchema:o,formContext:a,registry:e}):null}getUsedFormData=(e,t)=>{if(0===t.length&&"object"!==typeof e)return e;const r=S$(e,t);return Array.isArray(e)?Object.keys(r).map((e=>r[e])):r};getFieldNames=(e,t)=>{const r=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[[]];return Object.keys(e).forEach((a=>{if("object"===typeof e[a]){const t=o.map((e=>[...e,a]));e[a][Gy]&&""!==e[a][By]?n.push(e[a][By]):r(e[a],n,t)}else a===By&&""!==e[a]&&o.forEach((e=>{const r=uS(t,e);("object"!==typeof r||pS(r)||Array.isArray(r)&&r.every((e=>"object"!==typeof e)))&&n.push(e)}))})),n};return r(e)};omitExtraData=e=>{const{schema:t,schemaUtils:r}=this.state,n=r.retrieveSchema(t,e),o=r.toPathSchema(n,"",e),a=this.getFieldNames(o,e);return this.getUsedFormData(e,a)};filterErrorsBasedOnSchema(e,t,r){const{retrievedSchema:n,schemaUtils:o}=this.state,a=t??n,i=o.toPathSchema(a,"",r),s=this.getFieldNames(i,r),l=S$(e,s);"object"!==t?.type&&"array"!==t?.type&&(l.__errors=e.__errors);const c=this.getPreviousCustomValidateErrors(),u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return x$(e,((r,n)=>{const o=t[n];lj(r)||Array.isArray(r)&&0===r.length?delete e[n]:Ey(r)&&Ey(o)&&Array.isArray(o?.__errors)?e[n]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return 0===e.length?e:e.filter((e=>!t.includes(e)))}(r.__errors,o.__errors):"object"!==typeof r||Array.isArray(r.__errors)||u(r,t[n])})),e};return u(l,c)}onChange=(e,t,r)=>{const{extraErrors:n,omitExtraData:o,liveOmit:a,noValidate:i,liveValidate:s,onChange:l}=this.props,{schemaUtils:c,schema:u}=this.state;let d=this.state.retrievedSchema;if(Ey(e)||Array.isArray(e)){const t=this.getStateFromProps(this.props,e);e=t.formData,d=t.retrievedSchema}const p=!i&&s;let f={formData:e,schema:u},h=e;if(!0===o&&!0===a&&(h=this.omitExtraData(e),f={formData:h}),p){const e=this.validate(h,u,c,d);let r=e.errors,o=e.errorSchema;const a=r,i=o;if(n){const t=p$(e,n);o=t.errorSchema,r=t.errors}if(t){o=uj(o,this.filterErrorsBasedOnSchema(t,d,h),"preventDuplicates")}f={formData:h,errors:r,errorSchema:o,schemaValidationErrors:a,schemaValidationErrorSchema:i}}else if(!i&&t){const e=n?uj(t,n,"preventDuplicates"):t;f={formData:h,errorSchema:e,errors:a$(e)}}this.setState(f,(()=>l&&l({...this.state,...f},r)))};updateRetrievedSchema(e){return qw(e,this.state?.retrievedSchema)?this.state.retrievedSchema:e}reset=()=>{const{onChange:e}=this.props,t={formData:this.getStateFromProps(this.props,void 0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{}};this.setState(t,(()=>e&&e({...this.state,...t})))};onBlur=(e,t)=>{const{onBlur:r}=this.props;r&&r(e,t)};onFocus=(e,t)=>{const{onFocus:r}=this.props;r&&r(e,t)};onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:t,extraErrors:r,noValidate:n,onSubmit:o}=this.props;let{formData:a}=this.state;if(!0===t&&(a=this.omitExtraData(a)),n||this.validateFormWithFormData(a)){const t=r||{},n=r?a$(r):[];this.setState({formData:a,errors:n,errorSchema:t,schemaValidationErrors:[],schemaValidationErrorSchema:{}},(()=>{o&&o({...this.state,formData:a,status:"submitted"},e)}))}};getRegistry(){const{translateString:e,uiSchema:t={}}=this.props,{schemaUtils:r}=this.state,{fields:n,templates:o,widgets:a,formContext:i,translateString:s}={fields:A_(),templates:lP(),widgets:AP(),rootSchema:{},formContext:{},translateString:Ij};return{fields:{...n,...this.props.fields},templates:{...o,...this.props.templates,ButtonTemplates:{...o.ButtonTemplates,...this.props.templates?.ButtonTemplates}},widgets:{...a,...this.props.widgets},rootSchema:this.props.schema,formContext:this.props.formContext||i,schemaUtils:r,translateString:e||s,globalUiOptions:t["ui:globalOptions"]}}submit=()=>{if(this.formElement.current){const e=new CustomEvent("submit",{cancelable:!0});e.preventDefault(),this.formElement.current.dispatchEvent(e),this.formElement.current.requestSubmit()}};focusOnError(e){const{idPrefix:t="root",idSeparator:r="_"}=this.props,{property:n}=e,o=i$(n);""===o[0]?o[0]=t:o.unshift(t);const a=o.join(r);let i=this.formElement.current.elements[a];i||(i=this.formElement.current.querySelector(`input[id^="${a}"`)),i&&i.length&&(i=i[0]),i&&i.focus()}validateFormWithFormData=e=>{const{extraErrors:t,extraErrorsBlockSubmit:r,focusOnFirstError:n,onError:o}=this.props,{errors:a}=this.state,i=this.validate(e);let s=i.errors,l=i.errorSchema;const c=s,u=l,d=s.length>0||t&&r;if(d){if(t){const e=p$(i,t);l=e.errorSchema,s=e.errors}n&&("function"===typeof n?n(s[0]):this.focusOnError(s[0])),this.setState({errors:s,errorSchema:l,schemaValidationErrors:c,schemaValidationErrorSchema:u},(()=>{o?o(s):console.error("Form validation failed",s)}))}else a.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!d};validateForm(){const{omitExtraData:e}=this.props;let{formData:t}=this.state;return!0===e&&(t=this.omitExtraData(t)),this.validateFormWithFormData(t)}render(){const{children:e,id:t,idPrefix:r,idSeparator:n,className:o="",tagName:a,name:i,method:s,target:l,action:c,autoComplete:u,enctype:d,acceptcharset:p,acceptCharset:f,noHtml5Validate:h=!1,disabled:m,readonly:g,formContext:v,showErrorList:y="top",_internalFormWrapper:b}=this.props,{schema:x,uiSchema:w,formData:S,errorSchema:k,idSchema:C}=this.state,j=this.getRegistry(),{SchemaField:$}=j.fields,{SubmitButton:E}=j.templates.ButtonTemplates,_=b?a:void 0,P=b||a||"form";let{[Uy]:O={}}=Yy(w);m&&(O={...O,props:{...O.props,disabled:!0}});const R={[Jy]:{[Uy]:O}};return(0,dt.jsxs)(P,{className:o||"rjsf",id:t,name:i,method:s,target:l,action:c,autoComplete:u,encType:d,acceptCharset:f||p,noValidate:h,onSubmit:this.onSubmit,as:_,ref:this.formElement,children:["top"===y&&this.renderErrors(j),(0,dt.jsx)($,{name:"",schema:x,uiSchema:w,errorSchema:k,idSchema:C,idPrefix:r,idSeparator:n,formContext:v,formData:S,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:j,disabled:m,readonly:g}),e||(0,dt.jsx)(E,{uiSchema:R,registry:j}),"bottom"===y&&this.renderErrors(j)]})}}const FP=DP;var zP=r(3081),LP=r.n(zP),BP=r(483),WP=r.n(BP);const VP={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},HP=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,UP=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function qP(e,t,r,n,o,a,i){const{validationError:s}=t;let l=function(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((t=>{var r;const{instancePath:n,keyword:o,params:a,schemaPath:i,parentSchema:s,...l}=t;let{message:c=""}=l,u=n.replace(/\//g,"."),d=`${u} ${c}`.trim();const p=[...(null===(r=a.deps)||void 0===r?void 0:r.split(", "))||[],a.missingProperty,a.property].filter((e=>e));if(p.length>0)p.forEach((t=>{let r=Yy(uS(e,`${(u?`${u}.${t}`:t).replace(/^\./,"")}`)).title;if(void 0===r){const n=i.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([t]);r=Yy(uS(e,n)).title}if(r)c=c.replace(`'${t}'`,`'${r}'`);else{const e=uS(s,[Vy,t,"title"]);e&&(c=c.replace(`'${t}'`,`'${e}'`))}})),d=c;else{const t=Yy(uS(e,`${u.replace(/^\./,"")}`)).title;if(t)d=`'${t}' ${c}`.trim();else{const e=null===s||void 0===s?void 0:s.title;e&&(d=`'${e}' ${c}`.trim())}}return"missingProperty"in a&&(u=u?`${u}.${a.missingProperty}`:a.missingProperty),{name:o,property:u,message:c,params:a,stack:d,schemaPath:i}}))}(t.errors,i);s&&(l=[...l,{stack:s.message}]),"function"===typeof a&&(l=a(l,i));let c=function(e){const t=new c$;return e.length&&e.forEach((e=>{const{property:r,message:n}=e,o="."===r?[]:i$(r);o.length>0&&""===o[0]&&o.splice(0,1),n&&t.addErrors(n,o)})),t.ErrorSchema}(l);if(s&&(c={...c,$schema:{__errors:[s.message]}}),"function"!==typeof o)return{errors:l,errorSchema:c};const u=Sj(e,n,r,n,!0);return p$({errors:l,errorSchema:c},u$(o(u,wb(u),i)))}class GP{constructor(e,t){const{additionalMetaSchemas:r,customFormats:n,ajvOptionsOverrides:o,ajvFormatOptions:a,AjvClass:i}=e;this.ajv=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;const o=new(arguments.length>4&&void 0!==arguments[4]?arguments[4]:LP())({...VP,...r});return n?WP()(o,n):!1!==n&&WP()(o),o.addFormat("data-url",UP),o.addFormat("color",HP),o.addKeyword(Py),o.addKeyword(Gy),Array.isArray(e)&&o.addMetaSchema(e),Ab(t)&&Object.keys(t).forEach((e=>{o.addFormat(e,t[e])})),o}(r,n,o,a,i),this.localizer=t}reset(){this.ajv.removeSchema()}toErrorList(e){return a$(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])}rawValidation(e,t){var r,n;let o,a,i;e[Fy]&&(a=this.ajv.getSchema(e[Fy]));try{void 0===a&&(a=this.ajv.compile(e)),a(t)}catch(s){o=s}return a&&("function"===typeof this.localizer&&((null!==(r=a.errors)&&void 0!==r?r:[]).forEach((e=>{var t;["missingProperty","property"].forEach((t=>{var r;(null===(r=e.params)||void 0===r?void 0:r[t])&&(e.params[t]=`'${e.params[t]}'`)})),(null===(t=e.params)||void 0===t?void 0:t.deps)&&(e.params.deps=e.params.deps.split(", ").map((e=>`'${e}'`)).join(", "))})),this.localizer(a.errors),(null!==(n=a.errors)&&void 0!==n?n:[]).forEach((e=>{var t;["missingProperty","property"].forEach((t=>{var r;(null===(r=e.params)||void 0===r?void 0:r[t])&&(e.params[t]=e.params[t].slice(1,-1))})),(null===(t=e.params)||void 0===t?void 0:t.deps)&&(e.params.deps=e.params.deps.split(", ").map((e=>e.slice(1,-1))).join(", "))}))),i=a.errors||void 0,a.errors=null),{errors:i,validationError:o}}validateFormData(e,t,r,n,o){return qP(this,this.rawValidation(t,e),e,t,r,n,o)}handleSchemaUpdate(e){var t,r;const n=null!==(t=e[Fy])&&void 0!==t?t:Ky;void 0===this.ajv.getSchema(n)?this.ajv.addSchema(e,n):qw(e,null===(r=this.ajv.getSchema(n))||void 0===r?void 0:r.schema)||(this.ajv.removeSchema(n),this.ajv.addSchema(e,n))}isValid(e,t,r){var n;try{this.handleSchemaUpdate(r);const o=f$(e),a=null!==(n=o[Fy])&&void 0!==n?n:function(e){const t=new Set;return JSON.stringify(e,((e,r)=>(t.add(e),r))),function(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t.toString(16)}(JSON.stringify(e,Array.from(t).sort()))}(o);let i;i=this.ajv.getSchema(a),void 0===i&&(i=this.ajv.addSchema(o,a).getSchema(a)||this.ajv.compile(o));return i(t)}catch(Ya){return console.warn("Error encountered compiling schema:",Ya),!1}}}const KP=function(){return new GP(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}(),QP=!1,JP={fontSize:"16px",fontWeight:"bold",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"},YP={fontSize:"12px",fontWeight:"normal",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"},XP={fontSize:"14px",fontWeight:"normal",color:"var(--secondary-color)",backgroundColor:"var(--div-bg-color)"},ZP={fontSize:"16px",fontWeight:"bold",backgroundColor:"var(--div-bg-color)"},eO={padding:"0px",margin:"0px"},tO={},rO={},nO={},oO={};let aO=[],iO=[];const sO=t=>{let{open:r,onClose:n,plugin:o}=t;const{sendMessage:a,addListener:i,removeListener:s,getUniqueId:l}=(0,e.useContext)(Qh),c=(0,e.useRef)(l()),[u,d]=(0,e.useState)(o.configJson),[p,f]=(0,e.useState)(o.schemaJson),[h,m]=(0,e.useState)({"ui:submitButtonOptions":{submitText:"Confirm"},"ui:globalOptions":{orderable:!0}}),[g,v]=(0,e.useState)("");(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&(e.id===c.current&&"/api/select/devices"===e.method&&(e.response&&(aO=e.response),e.error&&console.error("ConfigPluginDialog received /api/select/devices error:",e.error)),e.id===c.current&&"/api/select/entities"===e.method&&(e.response&&(iO=e.response),e.error&&console.error("ConfigPluginDialog received /api/select/entities error:",e.error)))};return i(e),void 0!==u&&void 0!==p&&(Object.keys(p.properties).forEach((e=>{Object.keys(p.properties[e]).forEach((t=>{t.startsWith("ui:")&&(h[e]={},h[e][t]=p.properties[e][t],delete p.properties[e][t])}))})),m(h)),void 0!==o.name&&void 0!==o.configJson&&void 0!==o.schemaJson&&(d(o.configJson),f(o.schemaJson),a({id:c.current,method:"/api/select/devices",src:"Frontend",dst:"Matterbridge",params:{plugin:o.name}}),a({id:c.current,method:"/api/select/entities",src:"Frontend",dst:"Matterbridge",params:{plugin:o.name}})),()=>{s(e)}}),[i,u,o,s,p,a,h]);const y=e=>{let{formData:t}=e;d(t),o.configJson=t,o.restartRequired=!0;const r=JSON.stringify(t,null,2);Bf("saveconfig",t.name,r),n()};return r&&p&&u?(0,dt.jsxs)(mh,{open:r,onClose:n,maxWidth:"800px",children:[(0,dt.jsx)(xh,{gap:"20px",children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h3",{children:"Matterbridge plugin configuration"})]})}),(0,dt.jsx)(Ch,{style:{padding:"0px",margin:"0px",width:"800px",height:"600px",overflow:"auto"},children:(0,dt.jsx)(FP,{schema:p,formData:u,uiSchema:h,validator:KP,templates:{FieldTemplate:function(e){const{children:t,description:r,displayLabel:n,errors:o,help:a,hidden:i,id:s,label:l,registry:c,uiSchema:u}=e,d=Vj("WrapIfAdditionalTemplate",c,Yy(u));return i?(0,dt.jsx)("div",{style:{display:"none"},children:t}):(0,dt.jsx)(Uf,{sx:{display:"flex",flexDirection:"column",flexGrow:1,padding:0,margin:0,border:"none"},children:(0,dt.jsxs)(d,{...e,children:[!0===n&&r,t,o,a]})})},BaseInputTemplate:function(e){const{id:t,name:r,schema:n,uiSchema:o,value:a,options:i,label:s,type:l,placeholder:c,required:u,disabled:d,readonly:p,autofocus:f,onChange:h,onChangeOverride:m,onBlur:g,onFocus:v,rawErrors:y,hideError:b,registry:x,formContext:w}=e;return(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px"},children:(0,dt.jsx)(fv,{id:t,name:t,label:c&&""!==c?s:void 0,variant:"outlined",placeholder:c&&""!==c?c:s,required:u,disabled:d||p,autoFocus:f,value:a||0===a?a:"",type:l,autoComplete:"password"===l?"current-password":r,onChange:m||(e=>{let{target:{value:t}}=e;return h(""===t?i.emptyValue:t)}),onBlur:e=>{let{target:r}=e;return g(t,r&&r.value)},onFocus:e=>{let{target:r}=e;return v(t,r&&r.value)},fullWidth:!0})})},TitleFieldTemplate:function(e){const{required:t,title:r}=e;return r?(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginTop:"5px"},children:(0,dt.jsxs)(vf,{sx:JP,children:["Title ",r," ",t&&(0,dt.jsx)("mark",{children:"***"})]})}):null},DescriptionFieldTemplate:function(e){const{description:t}=e;return t?(0,dt.jsx)(vf,{sx:YP,children:t}):null},FieldHelpTemplate:function(e){const{help:t,idSchema:r}=e;return t?(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginTop:"5px"},children:(0,dt.jsx)(vf,{sx:XP,children:t})}):null},FieldErrorTemplate:function(e){const{errors:t}=e;return t?(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginTop:"5px"},children:t.map(((e,t)=>(0,dt.jsxs)(vf,{color:"error",variant:"body2",sx:{marginLeft:1},children:["This field ",e]},t)))}):null},ErrorListTemplate:function(e){const{errors:t}=e;return t?(0,dt.jsxs)(Uf,{sx:{padding:"10px",margin:"10px",border:"1px solid grey"},children:[(0,dt.jsx)(vf,{color:"error",sx:ZP,children:"Please fix the following errors:"}),(0,dt.jsx)(Dd,{children:t.map(((e,t)=>(0,dt.jsxs)(hy,{children:[(0,dt.jsx)(of,{children:(0,dt.jsx)(Cy,{color:"error"})}),(0,dt.jsx)(xf,{primary:e.stack})]},t)))})]}):null},WrapIfAdditionalTemplate:function(e){const{id:t,label:r,onKeyChange:n,onDropPropertyClick:o,disabled:a,schema:i,children:s,registry:l,readonly:c,required:u}=e,{templates:d}=l,{RemoveButton:p}=d.ButtonTemplates;return Py in i?(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",flexGrow:1,padding:0,margin:0,border:"none"},children:[(0,dt.jsx)(fv,{id:`${t}-key`,name:`${t}-key`,required:u,disabled:a||c,defaultValue:r,onBlur:c?void 0:e=>{let{target:t}=e;return n(t&&t.value)},type:"text",variant:"outlined",sx:{width:"250px",minWidth:"250px",maxWidth:"250px",marginRight:"20px"}}),(0,dt.jsx)(Uf,{sx:{flex:1},children:s}),(0,dt.jsx)(p,{disabled:a||c,onClick:o(r)})]}):(0,dt.jsx)(Uf,{sx:{display:"flex",flexDirection:"column",flexGrow:1,padding:0,margin:0,border:"none"},children:s})},ArrayFieldTitleTemplate:function(e){return console.log("ArrayFieldTitleTemplate:",e),null},ArrayFieldDescriptionTemplate:function(e){return console.log("ArrayFieldDescriptionTemplate:",e),null},ArrayFieldItemTemplate:function(e){return console.log("ArrayFieldItemTemplate:",e),null},ArrayFieldTemplate:function(t){const{canAdd:r,className:n,disabled:o,formContext:a,formData:i,idSchema:s,items:l,onAddClick:c,rawErrors:u,readonly:d,registry:p,required:f,schema:h,title:m,uiSchema:g}=t,[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)(!1),[w,S]=(0,e.useState)(!1),[k,C]=(0,e.useState)(""),j=e=>{C(e.target.value)},$=()=>{y(!v)},E=()=>{x(!b)},_=()=>{S(!w)};return(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"5px 10px 5px 10px",border:"1px solid grey"},children:[m&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"0px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[m&&(0,dt.jsx)(vf,{sx:JP,children:m}),r&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"0px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.selectFrom&&(0,dt.jsx)(Uu,{title:"Add a device from the list",children:(0,dt.jsx)(Rd,{onClick:$,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),h.selectEntityFrom&&(0,dt.jsx)(Uu,{title:"Add an entity from the list",children:(0,dt.jsx)(Rd,{onClick:E,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),h.selectDeviceEntityFrom&&(0,dt.jsx)(Uu,{title:"Add a device entity from the list",children:(0,dt.jsx)(Rd,{onClick:_,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),(0,dt.jsx)(Uu,{title:"Add a new item",children:(0,dt.jsx)(Rd,{onClick:c,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(mv,{})})})]})]}),h.description&&(0,dt.jsx)(vf,{sx:YP,children:h.description}),t.items.map((e=>(0,dt.jsxs)(Uf,{sx:{margin:"2px 0px",padding:"0px",display:"flex",alignItems:"center"},children:[(0,dt.jsx)(Uf,{sx:{flexGrow:1,marginRight:"10px"},children:e.children}),(0,dt.jsx)(Rd,{disabled:!e.hasMoveUp,onClick:e.onReorderClick(e.index,e.index-1),size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(Sy,{})}),(0,dt.jsx)(Rd,{disabled:!e.hasMoveDown,onClick:e.onReorderClick(e.index,e.index+1),size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(ky,{})}),(0,dt.jsx)(Rd,{onClick:e.onDropIndexClick(e.index),size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(ty,{})})]},e.index))),(0,dt.jsxs)(mh,{open:v,onClose:$,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsx)(xh,{children:"Select a device"}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",marginBottom:"10px"},children:[(0,dt.jsx)(vf,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{fullWidth:!0,variant:"outlined",value:k,onChange:j,placeholder:"Enter serial or name"})]}),(0,dt.jsx)(Dd,{dense:!0,children:aO.filter((e=>e.serial.toLowerCase().includes(k.toLowerCase())||e.name.toLowerCase().includes(k.toLowerCase()))).map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{y(!1),"serial"===h.selectFrom?h.items.default=e.serial:"name"===h.selectFrom&&(h.items.default=e.name),c()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.serial,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))})]}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:$,children:"Close"})})]}),(0,dt.jsxs)(mh,{open:b,onClose:E,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsx)(xh,{children:"Select an entity"}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",marginBottom:"10px"},children:[(0,dt.jsx)(vf,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{fullWidth:!0,variant:"outlined",value:k,onChange:j,placeholder:"Enter name or description"})]}),(0,dt.jsx)(Dd,{dense:!0,children:iO.filter((e=>e.name.toLowerCase().includes(k.toLowerCase())||e.description.toLowerCase().includes(k.toLowerCase()))).map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{x(!1),"name"===h.selectEntityFrom?h.items.default=e.name:"description"===h.selectEntityFrom&&(h.items.default=e.description),c()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),"component"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(jy,{style:rO})}),"matter"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)($y,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.description,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))})]}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:E,children:"Close"})})]}),(0,dt.jsxs)(mh,{open:w,onClose:_,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsxs)(xh,{children:["Select an entity for ",m]}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)(Dd,{dense:!0,children:aO.filter((e=>e.serial===m||e.name===m)).map((e=>{var t;return null===(t=e.entities)||void 0===t?void 0:t.map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{S(!1),"name"===h.selectDeviceEntityFrom?h.items.default=e.name:"description"===h.selectDeviceEntityFrom&&(h.items.default=e.description),c()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),"component"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(jy,{style:rO})}),"matter"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)($y,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.description,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))}))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:_,children:"Close"})})]})]})},ObjectFieldTemplate:function(t){const{onAddClick:r,schema:n,properties:o,title:a,description:i}=t,[s,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(""),d=()=>{l(!s)},p=!n.additionalProperties;return p||""===g||o.forEach((e=>{if("newKey"===e.name&&"newKey"===e.content.key&&"newKey"===e.content.props.name&&e.content.props.onKeyChange&&""!==g){QP;const t=g;v(""),e.content.props.onKeyChange(t)}})),(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:p?"10px":"5px 10px 0px 10px",border:p?"none":"1px solid grey"},children:[n.title&&p&&(0,dt.jsx)(Uf,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px",margin:"0px",marginBottom:"10px"},children:(0,dt.jsx)(vf,{sx:JP,children:n.title})}),a&&!p&&(0,dt.jsxs)(Uf,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px",margin:"0px"},children:[(0,dt.jsx)(vf,{sx:JP,children:a}),(0,dt.jsxs)(Uf,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px",margin:"0px"},children:[n.selectFrom&&(0,dt.jsx)(Uu,{title:"Add a device from the list",children:(0,dt.jsx)(Rd,{onClick:d,size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(yy,{})})}),(0,dt.jsx)(Uu,{title:"Add a new item",children:(0,dt.jsx)(Rd,{onClick:()=>{r(n)()},size:"small",color:"primary",sx:eO,children:(0,dt.jsx)(mv,{})})})]})]}),n.description&&(0,dt.jsx)(Uf,{sx:{padding:"0px",margin:"0px",marginBottom:"10px"},children:(0,dt.jsx)(vf,{sx:YP,children:n.description})}),o.map((e=>{let{content:t,name:r,hidden:o}=e;return!o&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",marginBottom:"10px",padding:["object","array","boolean"].includes(n.properties[r].type)?"0px":"5px 10px 5px 10px",border:["object","array","boolean"].includes(n.properties[r].type)?"none":"1px solid grey"},children:[!["object","array","boolean"].includes(n.properties[r].type)&&(0,dt.jsx)(vf,{sx:JP,children:r}),(0,dt.jsx)(Uf,{sx:{flexGrow:1,padding:"0px",margin:"0px"},children:t})]},r)})),(0,dt.jsxs)(mh,{open:s,onClose:d,PaperProps:{sx:{maxHeight:"50vh",maxWidth:"50vw",overflow:"auto"}},children:[(0,dt.jsx)(xh,{children:"Select a device"}),(0,dt.jsxs)(Ch,{children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px",marginBottom:"10px"},children:[(0,dt.jsx)(vf,{variant:"subtitle1",sx:{whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{fullWidth:!0,variant:"outlined",value:c,onChange:e=>{u(e.target.value)},placeholder:"Enter serial or name"})]}),(0,dt.jsx)(Dd,{dense:!0,children:aO.filter((e=>e.serial.toLowerCase().includes(c.toLowerCase())||e.name.toLowerCase().includes(c.toLowerCase()))).map(((e,t)=>(0,dt.jsxs)(vy,{onClick:()=>(e=>{l(!1);let t="";"serial"===n.selectFrom?t=e.serial:"name"===n.selectFrom&&(t=e.name),v(t),r(n)()})(e),sx:tO,children:["wifi"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(by,{style:rO})}),"ble"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(xy,{style:rO})}),"hub"===e.icon&&(0,dt.jsx)(of,{children:(0,dt.jsx)(wy,{style:rO})}),(0,dt.jsx)(xf,{primary:e.name,secondary:e.serial,primaryTypographyProps:{style:nO},secondaryTypographyProps:{style:oO}})]},t)))})]}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:d,children:"Close"})})]})]})},ButtonTemplates:{SubmitButton:function(e){const{uiSchema:t}=e,{submitText:r,norender:o}=Wj(t);return o?null:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"10px",padding:"0px",gap:"20px"},children:[(0,dt.jsx)(Ah,{type:"submit",variant:"contained",color:"primary",children:r}),(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:n,children:"Cancel"})]})},RemoveButton:function(e){const{className:t,disabled:r,onClick:n,registry:o,style:a,uiSchema:i,...s}=e;return(0,dt.jsx)(Uu,{title:"Remove the item",children:(0,dt.jsx)(Rd,{disabled:r,size:"small",color:"primary",onClick:n,children:(0,dt.jsx)(ty,{})})})},AddButton:function(e){const{className:t,disabled:r,onClick:n,registry:o,uiSchema:a,...i}=e;return(0,dt.jsx)(Uu,{title:"Add an item",children:(0,dt.jsx)(Rd,{size:"small",color:"primary",onClick:n,children:(0,dt.jsx)(mv,{})})})},MoveUpButton:function(e){const{disabled:t,onClick:r,registry:n,style:o,uiSchema:a,...i}=e;return(0,dt.jsx)(Uu,{title:"Move up the item",children:(0,dt.jsx)(Rd,{size:"small",color:"primary",onClick:r,children:(0,dt.jsx)(Sy,{})})})},MoveDownButton:function(e){const{disabled:t,onClick:r,registry:n,style:o,uiSchema:a,...i}=e;return(0,dt.jsx)(Uu,{title:"Move down the item",children:(0,dt.jsx)(Rd,{size:"small",color:"primary",onClick:r,children:(0,dt.jsx)(ky,{})})})}}},widgets:{CheckboxWidget:function(t){const{id:r,name:i,value:s,schema:l,readonly:d,onChange:p}=t,[f,h]=(0,e.useState)(void 0),m=()=>{a({id:c.current,method:"/api/action",src:"Frontend",dst:"Matterbridge",params:{plugin:o.name,action:i,value:f,id:r}}),!0===l.buttonClose?n():!0===l.buttonSave&&y({formData:u})};return l.buttonText&&l.description?(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"10px",border:"1px solid grey",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,dt.jsx)(vf,{sx:YP,children:l.description}),(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:()=>m(),children:l.buttonText})]}):l.buttonField&&l.description?(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"10px",gap:"20px",border:"1px solid grey",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,dt.jsx)(vf,{sx:YP,children:l.description}),(0,dt.jsx)(fv,{id:i+"-input",name:i,label:l.textLabel,placeholder:l.textPlaceholder,onChange:e=>(e=>{h(e&&""!==e?e:void 0)})(e.target.value),sx:{width:"250px",minWidth:"250px",maxWidth:"250px"}}),(0,dt.jsx)(Ah,{id:i+"-button",variant:"contained",color:"primary",disabled:void 0===f,onClick:()=>m(),children:l.buttonField})]}):(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"5px 10px",border:"1px solid grey"},children:[i&&(0,dt.jsxs)(Uf,{sx:{margin:"0px",padding:"0px",gap:"10px",display:"flex",justifyContent:"flex-start",alignItems:"center"},children:[(0,dt.jsx)(vf,{sx:JP,children:i}),(0,dt.jsx)(Kv,{checked:s,readOnly:d,onChange:()=>p(!s),sx:{padding:"0px",margin:"0px"}})]}),l.description&&(0,dt.jsx)(vf,{sx:YP,children:l.description})]})},SelectWidget:function(e){let{schema:t,id:r,name:n,options:o,label:a,hideLabel:i,required:s,disabled:l,placeholder:c,readonly:u,value:d,multiple:p,autofocus:f,onChange:h,onBlur:m,onFocus:g,errorSchema:v,rawErrors:y=[],registry:b,uiSchema:x,hideError:w,formContext:S,...k}=e;const{enumOptions:C,enumDisabled:j,emptyValue:$}=o;p="undefined"!==typeof p&&!!p;const E=p?[]:"",_="undefined"===typeof d||p&&d.length<1||!p&&d===E,P=Dj(d,C,p),{InputLabelProps:O,SelectProps:R,autocomplete:M,...N}=k,I=!p&&void 0===t.default;return(0,dt.jsxs)(fv,{id:r,name:r,value:_||"undefined"===typeof P?E:P,required:s,disabled:l||u,autoFocus:f,autoComplete:M,placeholder:c,error:y.length>0,onChange:e=>{let{target:{value:t}}=e;return h(Tj(t,C,$))},onBlur:e=>{let{target:t}=e;return m(r,Tj(t&&t.value,C,$))},onFocus:e=>{let{target:t}=e;return g(r,Tj(t&&t.value,C,$))},...N,select:!0,InputLabelProps:{...O,shrink:!_},SelectProps:{...R,multiple:p},"aria-describedby":Zj(r),children:[I&&(0,dt.jsx)(tf,{value:"",children:c}),Array.isArray(C)&&C.map(((e,t)=>{let{value:r,label:n}=e;const o=Array.isArray(j)&&-1!==j.indexOf(r);return(0,dt.jsx)(tf,{value:String(t),disabled:o,children:n},t)}))]})}},onSubmit:y})})]}):null};function lO(t){let{data:r,columns:n,columnVisibility:o}=t;const a=e.useMemo((()=>n.filter((e=>o[e.accessor]))),[n,o]),{getTableProps:i,getTableBodyProps:s,headerGroups:l,rows:c,prepareRow:u}=(0,yv.useTable)({columns:a,data:r},yv.useSortBy);return(0,dt.jsxs)("table",{...i(),style:{border:"none",borderCollapse:"collapse"},children:[(0,dt.jsx)("thead",{style:{border:"none",borderCollapse:"collapse"},children:l.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),style:{border:"none",borderCollapse:"collapse"},children:e.headers.map((e=>(0,dt.jsx)("th",{...e.getHeaderProps(void 0),style:{border:"none",borderCollapse:"collapse",cursor:e.noSort?"default":"pointer"},children:e.render("Header")})))})))}),(0,dt.jsx)("tbody",{...s(),style:{border:"none",borderCollapse:"collapse"},children:c.map(((e,t)=>(u(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),style:{border:"none",borderCollapse:"collapse"},children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),style:{border:"none",borderCollapse:"collapse"},children:e.render("Cell")})))},t))))})]})}function cO(t){let{selectPlugin:r}=t;const{online:n,logMessage:o,sendMessage:a,addListener:i,removeListener:s,getUniqueId:l}=(0,e.useContext)(Qh),{showConfirmCancelDialog:c}=(0,e.useContext)(Fh),u=(0,e.useRef)(l()),[d,p]=(0,e.useState)(null),[f,h]=(0,e.useState)(null),[m,g]=(0,e.useState)([]),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)({name:!0,description:!0,version:!0,author:!0,type:!0,addedDevices:!0,actions:!0,status:!0}),w=[{Header:"Name",accessor:"name",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(Uu,{title:"Open the plugin homepage",children:(0,dt.jsx)("span",{style:{cursor:"pointer"},onClick:()=>O(t.original),children:t.original.name})})}},{Header:"Description",accessor:"description",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(Uu,{title:"Open the plugin homepage",children:(0,dt.jsx)("span",{style:{cursor:"pointer"},onClick:()=>O(t.original),children:t.original.description})})}},{Header:"Version",accessor:"version",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(dt.Fragment,{children:void 0===t.original.latestVersion||t.original.latestVersion===t.original.version||f&&f.readOnly?(0,dt.jsx)(Uu,{title:"Plugin version",children:t.original.version}):(0,dt.jsx)(Uu,{title:"New plugin version available, click to install",children:(0,dt.jsxs)("span",{className:"status-warning",onClick:()=>E(t.original),children:["Update v.",t.original.version," to v.",t.original.latestVersion]})})})}},{Header:"Author",accessor:"author",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(dt.Fragment,{children:t.original.author?t.original.author.replace("https://github.com/",""):"Unknown"})}},{Header:"Type",accessor:"type",Cell:e=>{let{row:t}=e;return(0,dt.jsx)(dt.Fragment,{children:t.original.type?t.original.type.replace("Platform",""):"Unknown"})}},{Header:"Devices",accessor:"addedDevices"},{Header:"Actions",accessor:"actions",Cell:e=>{let{row:t}=e;return(0,dt.jsxs)("div",{style:{margin:"0px",padding:"0px",gap:"4px",display:"flex",flexDirection:"row"},children:[f&&"childbridge"===f.bridgeMode&&!t.original.error&&t.original.enabled&&(0,dt.jsx)(Uu,{title:"Shows the QRCode or the fabrics",children:(0,dt.jsx)(Rd,{style:{margin:"0",padding:"0"},onClick:()=>r(t.original),size:"small",children:(0,dt.jsx)(ry,{})})}),(0,dt.jsx)(Uu,{title:"Plugin config",children:(0,dt.jsx)(Rd,{disabled:!0===t.original.restartRequired||!0===(null===f||void 0===f?void 0:f.restartRequired),style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>F(t.original),size:"small",children:(0,dt.jsx)(Qv,{})})}),f&&!f.readOnly&&(0,dt.jsx)(Uu,{title:"Remove the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>{C("Remove plugin","Are you sure? This will remove also all the devices and configuration in the controller.","remove",t.original)},size:"small",children:(0,dt.jsx)(ty,{})})}),t.original.enabled?(0,dt.jsx)(Uu,{title:"Disable the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>{C("Disable plugin","Are you sure? This will remove also all the devices and configuration in the controller.","disable",t.original)},size:"small",children:(0,dt.jsx)(ey,{})})}):(0,dt.jsx)(dt.Fragment,{}),t.original.enabled?(0,dt.jsx)(dt.Fragment,{}):(0,dt.jsx)(Uu,{title:"Enable the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>P(t.original),size:"small",children:(0,dt.jsx)(Zv,{})})}),(0,dt.jsx)(Uu,{title:"Open the plugin help",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>M(t.original),size:"small",children:(0,dt.jsx)(Yv,{})})}),(0,dt.jsx)(Uu,{title:"Open the plugin version history",children:(0,dt.jsx)(Rd,{style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},onClick:()=>N(t.original),size:"small",children:(0,dt.jsx)(Xv,{})})}),f&&!f.readOnly&&(0,dt.jsx)(Uu,{title:"Sponsor the plugin",children:(0,dt.jsx)(Rd,{style:{margin:"0",padding:"0",width:"19px",height:"19px",color:"#b6409c"},onClick:()=>R(t.original),size:"small",children:(0,dt.jsx)(Jv,{})})})]})}},{Header:"Status",accessor:"status",Cell:e=>{let{row:t}=e;return(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 auto",gap:"5px"},children:t.original.error?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:!1,enabledText:"Error",disabledText:"Error",tooltipText:"The plugin is in error state. Check the log!"})}):(0,dt.jsx)(dt.Fragment,{children:!1===t.original.enabled?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:t.original.enabled,enabledText:"Enabled",disabledText:"Disabled",tooltipText:"Whether the plugin is enable or disabled"})}):(0,dt.jsx)(dt.Fragment,{children:t.original.loaded&&t.original.started&&t.original.configured&&t.original.paired?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:t.original.loaded,enabledText:"Running",tooltipText:"Whether the plugin is running"})}):(0,dt.jsx)(dt.Fragment,{children:t.original.loaded&&t.original.started&&t.original.configured?(0,dt.jsx)(dt.Fragment,{children:(0,dt.jsx)(ny,{status:t.original.loaded,enabledText:"Running",tooltipText:"Whether the plugin is running"})}):(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(ny,{status:t.original.enabled,enabledText:"Enabled",disabledText:"Disabled",tooltipText:"Whether the plugin is enable or disabled"}),(0,dt.jsx)(ny,{status:t.original.loaded,enabledText:"Loaded",tooltipText:"Whether the plugin has been loaded"}),(0,dt.jsx)(ny,{status:t.original.started,enabledText:"Started",tooltipText:"Whether the plugin started"}),(0,dt.jsx)(ny,{status:t.original.configured,enabledText:"Configured",tooltipText:"Whether the plugin has been configured"}),f&&"childbridge"===f.bridgeMode?(0,dt.jsx)(ny,{status:t.original.paired,enabledText:"Paired",tooltipText:"Whether the plugin has been paired"}):(0,dt.jsx)(dt.Fragment,{})]})})})})})}}];(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&"plugins"===e.params.changed&&(tM&&console.log("HomePlugins received refresh_required for",e.params.changed),a({id:u.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}})),"restart_required"===e.method&&(tM&&console.log("HomePlugins received restart_required"),a({id:u.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}})),e.id===u.current&&"/api/settings"===e.method&&(tM&&console.log(`HomePlugins (id: ${e.id}) received settings:`,e.response),p(e.response.systemInformation),h(e.response.matterbridgeInformation)),e.id===u.current&&"/api/plugins"===e.method&&(tM&&console.log(`HomePlugins (id: ${e.id}) received ${e.response.length} plugins:`,e.response),g(e.response)))};return i(e),tM&&console.log("HomePlugins added WebSocket listener id:",u.current),()=>{s(e),tM&&console.log("HomePlugins removed WebSocket listener")}}),[i,s,a]),(0,e.useEffect)((()=>{n&&(tM&&console.log("HomePlugins sending api requests"),a({id:u.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),a({id:u.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}))}),[n,a]),(0,e.useEffect)((()=>{const e=localStorage.getItem("homePluginsColumnVisibility");e&&x(JSON.parse(e))}),[]);const S=()=>{y(!v)},k=(0,e.useRef)(null),C=(e,t,r,n)=>{tM&&console.log(`handleActionWithConfirmCancel ${r} ${n.name}`),k.current=n,c(e,t,r,j,$)},j=e=>{tM&&console.log(`handleConfirm action confirmed ${e} ${k.current.name}`),"remove"===e&&k.current?_(k.current):"disable"===e&&k.current&&P(k.current),k.current=null},$=e=>{tM&&console.log(`handleCancel action canceled ${e} ${k.current.name}`),k.current=null},E=e=>{tM&&console.log("handleUpdatePlugin plugin:",e.name),o("Plugins",`Updating plugin: ${e.name}`),Bf("installplugin",e.name)},_=e=>{tM&&console.log("handleRemovePlugin plugin:",e.name),o("Plugins",`Removing plugin: ${e.name}`),Bf("removeplugin",e.name)},P=e=>{tM&&console.log("handleEnableDisablePlugin plugin:",e.name,"enabled:",e.enabled),!0===e.enabled?(e.enabled=!1,o("Plugins",`Disabling plugin: ${e.name}`),Bf("disableplugin",e.name)):(e.enabled=!0,o("Plugins",`Enabling plugin: ${e.name}`),Bf("enableplugin",e.name))},O=e=>{tM&&console.log(`handleHomepagePlugin plugin: ${e.name} homepage: ${e.homepage}`),e.homepage&&window.open(e.homepage,"_blank")},R=e=>{tM&&console.log("handleSponsorPlugin plugin:",e.name,"funding:",e.funding),e.funding&&window.open(e.funding,"_blank")},M=e=>{tM&&console.log("handleHelpPlugin plugin:",e.name,"help:",e.help),e.help&&window.open(e.help,"_blank")},N=e=>{tM&&console.log("handleChangelogPlugin plugin:",e.name,"changelog:",e.changelog),e.changelog&&window.open(e.changelog,"_blank")},[I,T]=(0,e.useState)({}),[A,D]=(0,e.useState)(!1),F=e=>{tM&&console.log("handleConfigPlugin plugin:",e.name),a({id:u.current,method:"/api/select/devices",src:"Frontend",dst:"Matterbridge",params:{plugin:e.name}}),a({id:u.current,method:"/api/select/entities",src:"Frontend",dst:"Matterbridge",params:{plugin:e.name}}),T(e),z()},z=()=>{D(!0)};return tM&&console.log("HomePlugins rendering..."),n?(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",width:"100%",flex:"0 0 auto",overflow:"hidden"},children:[(0,dt.jsx)(sO,{open:A,onClose:()=>{D(!1)},plugin:I}),(0,dt.jsxs)(mh,{open:v,onClose:S,children:[(0,dt.jsx)(xh,{children:"Configure Plugins Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:w.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["description","actions","status"].includes(e.accessor),checked:b[e.accessor],onChange:()=>{return t=e.accessor,void x((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("homePluginsColumnVisibility",JSON.stringify(r)),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:S,children:"Close"})})]}),(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("p",{style:{margin:"0px",padding:"0px"},children:"Plugins"}),(0,dt.jsx)(Rd,{onClick:S,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0px",padding:"0px",gap:"0",overflow:"auto"},children:(0,dt.jsx)(lO,{data:m,columns:w,columnVisibility:b})})]}):(0,dt.jsx)(tm,{})}var uO=r(3651),dO=r.n(uO),pO="M19 17H22L18 21L14 17H17V3H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z",fO="M19 7H22L18 3L14 7H17V21H19M2 17H12V19H2M6 5V7H2V5M2 11H9V13H2V11Z";function hO(t){let{data:r,columns:n,columnVisibility:o}=t;const a=e.useMemo((()=>{const e=localStorage.getItem("homeDevicesColumnsSortBy");return e?JSON.parse(e):[{id:"name",desc:!1}]}),[n]),i=e.useMemo((()=>n.filter((e=>o[e.accessor]))),[o,n]),{getTableProps:s,getTableBodyProps:l,headerGroups:c,rows:u,prepareRow:d,state:{sortBy:p}}=(0,yv.useTable)({columns:i,data:r,initialState:{sortBy:a}},yv.useSortBy);return e.useEffect((()=>{localStorage.setItem("homeDevicesColumnsSortBy",JSON.stringify(p))}),[p]),(0,dt.jsxs)("table",{...s(),style:{border:"none",borderCollapse:"collapse"},children:[(0,dt.jsx)("thead",{style:{border:"none",borderCollapse:"collapse"},children:c.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),style:{border:"none",borderCollapse:"collapse"},children:e.headers.map((e=>(0,dt.jsxs)("th",{...e.getHeaderProps(e.noSort?void 0:e.getSortByToggleProps()),style:{border:"none",borderCollapse:"collapse",cursor:e.noSort?"default":"pointer"},children:[e.render("Header"),!e.noSort&&(0,dt.jsx)("span",{style:{margin:"0px",marginLeft:"5px",padding:"0px"},children:e.isSorted?e.isSortedDesc?(0,dt.jsx)(dO(),{path:fO,size:"15px"}):(0,dt.jsx)(dO(),{path:pO,size:"15px"}):null})]})))})))}),(0,dt.jsx)("tbody",{...l(),style:{border:"none",borderCollapse:"collapse"},children:u.map(((e,t)=>(d(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),style:{border:"none",borderCollapse:"collapse"},children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),style:{border:"none",borderCollapse:"collapse"},children:e.render("Cell")})))},t))))})]})}function mO(){const{online:t,sendMessage:r,addListener:n,removeListener:o,getUniqueId:a}=(0,e.useContext)(Qh),[i,s]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!0),[u,d]=(0,e.useState)(null),[p,f]=(0,e.useState)(null),[h,m]=(0,e.useState)([]),[g,v]=(0,e.useState)([]),[y,b]=(0,e.useState)([]),[x,w]=(0,e.useState)([]),[S,k]=(0,e.useState)(!1),[C,j]=(0,e.useState)({pluginName:!0,name:!0,serial:!0,reachable:!0,configUrl:!1,actions:!0}),$=(0,e.useRef)(a()),E=[{Header:"Plugin",accessor:"pluginName"},{Header:"Name",accessor:"name"},{Header:"Serial",accessor:"serial"},{Header:"Availability",accessor:"reachable",Cell:e=>{let{row:t}=e;return!0===t.original.reachable?"Online":!1===t.original.reachable?(0,dt.jsx)("span",{style:{color:"red"},children:"Offline"}):""},sortType:(e,t)=>(!0===e.original.reachable?1:!1===e.original.reachable?0:-1)-(!0===t.original.reachable?1:!1===t.original.reachable?0:-1)},{Header:"Url",accessor:"configUrl"},{Header:"Actions",accessor:"actions",noSort:!0,Cell:e=>{let{row:t}=e;return(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row"},children:[t.original.configUrl?(0,dt.jsx)(Uu,{title:"Open the configuration page",children:(0,dt.jsx)(Rd,{onClick:()=>window.open(t.original.configUrl,"_blank"),"aria-label":"Open config url",sx:{margin:0,padding:0},children:(0,dt.jsx)(Qv,{fontSize:"small"})})}):(0,dt.jsx)("div",{style:{width:"20px",height:"20px"}}),void 0!==t.original.selected?(0,dt.jsx)(Uu,{title:"Select/unselect the device",children:(0,dt.jsx)(Kv,{checked:t.original.selected,onChange:e=>P(e,t.original),sx:{margin:"0",marginLeft:"8px",padding:"0"},size:"small"})}):(0,dt.jsx)("div",{style:{width:"20px",height:"20px"}})]})}}];(0,e.useEffect)((()=>{const e=e=>{if("Matterbridge"===e.src&&"Frontend"===e.dst){var t,n,o;if("refresh_required"===e.method&&"sessions"!==e.params.changed&&"matterbridgeLatestVersion"!==e.params.changed&&"reachability"!==e.params.changed&&(tM&&console.log(`HomeDevices received refresh_required: changed=${e.params.changed}`),r({id:$.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}})),"restart_required"===e.method&&(tM&&console.log("HomeDevices received restart_required"),s(!0)),"state_update"===e.method&&e.params.plugin&&e.params.serialNumber&&e.params.cluster.includes("BasicInformationServer")&&"reachable"===e.params.attribute&&(tM&&console.log(`HomeDevices updating device reachability for plugin ${e.params.plugin} serial ${e.params.serialNumber} value ${e.params.value}`),v((t=>t.map((t=>t.pluginName===e.params.plugin&&t.serial===e.params.serialNumber?{...t,reachable:e.params.value}:t))))),e.id===$.current&&"/api/settings"===e.method&&(tM&&console.log(`HomeDevices (id: ${e.id}) received settings:`,e.response),d(e.response.systemInformation),f(e.response.matterbridgeInformation),s(e.response.matterbridgeInformation.restartRequired)),e.id===$.current&&"/api/plugins"===e.method)if(tM&&console.log(`HomeDevices (id: ${e.id}) received ${null===(t=e.response)||void 0===t?void 0:t.length} plugins:`,e.response),e.response){let t=!0;for(const r of e.response)!0===r.enabled&&(!0===r.loaded&&!0===r.started&&!0!==r.error||(t=!1));if(!t)return;c(!1),m(e.response),v([]),b([]),r({id:$.current,method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}}),tM&&console.log("HomeDevices sent /api/devices");for(const n of e.response)!0===n.enabled&&!0===n.loaded&&!0===n.started&&!0!==n.error&&(r({id:$.current,method:"/api/select/devices",src:"Frontend",dst:"Matterbridge",params:{plugin:n.name}}),tM&&console.log(`HomeDevices sent /api/select/devices for plugin: ${n.name}`))}if(e.id===$.current&&"/api/devices"===e.method)if(tM&&console.log(`HomeDevices (id: ${e.id}) received ${null===(n=e.response)||void 0===n?void 0:n.length} devices:`,e.response),e.response){for(const t of e.response){0===h.length&&console.error("HomeDevices: /api/devices with plugins lenght 0");const e=h.find((e=>e.name===t.pluginName));e||console.error(`HomeDevices: device ${t.deviceName} has no plugin ${t.pluginName}`),!0===(null===e||void 0===e?void 0:e.hasBlackList)?t.selected=!0:t.selected=void 0}v(e.response)}if(e.id===$.current&&"/api/select/devices"===e.method)tM&&console.log(`HomeDevices (id: ${e.id}) received ${null===(o=e.response)||void 0===o?void 0:o.length} selectDevices for plugin ${e.plugin}:`,e.response),e.response&&b((t=>[...t.filter((t=>t.pluginName!==e.plugin)),...e.response.map((e=>({...e,selected:!1})))]))}};return n(e),tM&&console.log(`HomeDevices added WebSocket listener id ${$.current}`),()=>{o(e),tM&&console.log("HomeDevices removed WebSocket listener")}}),[h,n,o,r]),(0,e.useEffect)((()=>{tM&&console.log("HomeDevices mixing devices and selectDevices");const e=[];for(const t of g)e.push(t);for(const t of y)g.find((e=>e.pluginName===t.pluginName&&e.serial.includes(t.serial)))||e.push(t);w(e)}),[h,g,y,w]),(0,e.useEffect)((()=>{t&&(tM&&console.log("HomeDevices sending api requests"),r({id:$.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({id:$.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}))}),[t,r]);const _=()=>{k(!S)},P=(e,t)=>{tM&&console.log(`handleCheckboxChange: checkbox changed to ${e.target.checked} for device ${t.name} serial ${t.serial}`),w((r=>r.map((r=>r.serial===t.serial?{...r,selected:e.target.checked}:r)))),e.target.checked?r({id:$.current,method:"/api/command",src:"Frontend",dst:"Matterbridge",params:{command:"selectdevice",plugin:t.pluginName,serial:t.serial,name:t.name}}):r({id:$.current,method:"/api/command",src:"Frontend",dst:"Matterbridge",params:{command:"unselectdevice",plugin:t.pluginName,serial:t.serial,name:t.name}})};return(0,e.useEffect)((()=>{const e=localStorage.getItem("homeDevicesColumnVisibility");e&&(j(JSON.parse(e)),tM&&console.log("HomeDevices effect: loaded column visibility from localStorage"))}),[]),tM&&console.log("HomeDevices rendering..."),t?(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",width:"100%",flex:"1 1 auto",overflow:"hidden"},children:[(0,dt.jsxs)(mh,{open:S,onClose:_,children:[(0,dt.jsx)(xh,{children:"Configure Devices Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:E.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["name","actions"].includes(e.accessor),checked:C[e.accessor],onChange:()=>{return t=e.accessor,void j((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("homeDevicesColumnVisibility",JSON.stringify(r)),tM&&console.log("HomeDevices effect: saved column visibility to localStorage"),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:_,children:"Close"})})]}),(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("p",{style:{margin:"0px",padding:"0px"},children:"Devices"}),(0,dt.jsx)(Rd,{onClick:_,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0px",padding:"0px",gap:"0",overflow:"auto"},children:(0,dt.jsx)(hO,{data:x,columns:E,columnVisibility:C})}),(0,dt.jsxs)("div",{className:"MbfWindowFooter",style:{margin:"0",padding:"0px",paddingLeft:"10px",paddingRight:"10px",borderTop:"1px solid var(--table-border-color)",display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[l&&(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{margin:"0",padding:"2px",fontWeight:"normal",fontSize:"14px",color:"var(--secondary-color)"},children:"Waiting for the plugins to fully load..."}),!l&&(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{margin:"0",padding:"5px",fontWeight:"normal",fontSize:"14px",color:"var(--secondary-color)"},children:["Registered devices: ",g.length.toString()]}),i&&(0,dt.jsx)("p",{className:"MbfWindowFooterText",style:{margin:"0",padding:"2px",fontWeight:"normal",fontSize:"14px",color:"var(--secondary-color)"},children:"Restart required"})]})]}):(0,dt.jsx)(tm,{})}const gO=function(){var t;const[r,n]=(0,e.useState)(null),[o,a]=(0,e.useState)(null),[i,s]=(0,e.useState)(void 0),[l]=(0,e.useState)("false"!==localStorage.getItem("homePagePlugins")),[c,u]=(0,e.useState)(null!==(t=localStorage.getItem("homePageMode"))&&void 0!==t?t:"logs"),[d,p]=(0,e.useState)(!1),{addListener:f,removeListener:h,online:m,sendMessage:g,logFilterLevel:v,logFilterSearch:y,autoScroll:b,getUniqueId:x}=(0,e.useContext)(Qh),w=(0,e.useRef)(x()),S=(0,e.useCallback)((e=>{tM&&console.log("handleSelectPlugin plugin:",e.name),s(i?void 0:e)}),[i]);return(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&"matterbridgeLatestVersion"!==e.params.changed&&"reachability"!==e.params.changed&&(tM&&console.log(`Home received refresh_required: changed=${e.params.changed}`),g({id:w.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}})),e.id===w.current&&"/api/settings"===e.method&&(tM&&console.log("Home received settings:",e.response),n(e.response.systemInformation),a(e.response.matterbridgeInformation),localStorage.getItem("matterbridgeVersion")&&e.response.matterbridgeInformation.matterbridgeVersion!==localStorage.getItem("matterbridgeVersion")&&(localStorage.setItem("matterbridgeVersion",e.response.matterbridgeInformation.matterbridgeVersion),p(!0)),e.response.matterbridgeInformation.shellyBoard&&(localStorage.getItem("homePageMode")||(localStorage.setItem("homePageMode","devices"),u("devices")))))};return f(e),tM&&console.log(`Home added WebSocket listener id ${w.current}`),()=>{h(e),tM&&console.log("Home removed WebSocket listener")}}),[f,h,g]),(0,e.useEffect)((()=>{m&&(tM&&console.log("Home received online"),g({id:w.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))}),[m,g]),tM&&console.log("Home rendering..."),m&&r&&o?(0,dt.jsxs)("div",{className:"MbfPageDiv",style:{flexDirection:"row"},children:[(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"302px",minWidth:"302px",gap:"20px"},children:[(0,dt.jsx)(Pm,{matterbridgeInfo:o,plugin:i}),(0,dt.jsx)(nm,{systemInfo:r,compact:!0})]}),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",gap:"20px"},children:[d&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto",width:"100%",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Update"})}),(0,dt.jsxs)("div",{className:"MbfWindowBody",style:{flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("h4",{style:{margin:0},children:"Matterbridge has been updated. You are viewing an outdated web UI. Please refresh the page now."}),(0,dt.jsx)(Ah,{onClick:()=>window.location.reload(),endIcon:(0,dt.jsx)(Xh,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px"},children:"Refresh"})]})]}),l&&!o.readOnly&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto",width:"100%",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Install plugins"})}),(0,dt.jsx)(vv,{})]}),l&&(0,dt.jsx)(cO,{selectPlugin:S}),"devices"===c&&(0,dt.jsx)(mO,{}),"logs"===c&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"1 1 auto",width:"100%",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",style:{flexShrink:0},children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",justifyContent:"space-between"},children:["Logs",(0,dt.jsxs)("span",{style:{fontWeight:"normal",fontSize:"12px",marginTop:"2px"},children:['Filter: logger level "',v,'" and search "',y,'" Scroll: ',b?"auto":"manual"]})]})}),(0,dt.jsx)("div",{style:{flex:"1 1 auto",margin:"0px",padding:"10px",overflow:"auto"},children:(0,dt.jsx)(em,{})})]})]})]}):(0,dt.jsx)(tm,{})},vO=Pf((0,dt.jsx)("path",{d:"M19 7H9c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m0 2v2H9V9zm-6 6v-2h2v2zm2 2v2h-2v-2zm-4-2H9v-2h2zm6-2h2v2h-2zm-8 4h2v2H9zm8 2v-2h2v2zM6 17H5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2v1h-2V5H5v10h1z"}),"TableView"),yO=Pf((0,dt.jsx)("path",{d:"M14.67 5v6.5H9.33V5zm1 6.5H21V5h-5.33zm-1 7.5v-6.5H9.33V19zm1-6.5V19H21v-6.5zm-7.34 0H3V19h5.33zm0-1V5H3v6.5z"}),"ViewModule"),bO=Pf((0,dt.jsx)("path",{d:"M17 5v16c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1V5c0-.55.45-1 1-1h2V2h4v2h2c.55 0 1 .45 1 1m-2 1H9v6h6z"}),"Battery4Bar"),xO=Pf([(0,dt.jsx)("path",{d:"M21 14c0-.55-.45-1-1-1h-2v2h2c.55 0 1-.45 1-1m-1 3h-2v2h2c.55 0 1-.45 1-1s-.45-1-1-1m-8-3h-2v4h2c0 1.1.9 2 2 2h3v-8h-3c-1.1 0-2 .9-2 2"},"0"),(0,dt.jsx)("path",{d:"M5 13c0-1.1.9-2 2-2h1.5c1.93 0 3.5-1.57 3.5-3.5S10.43 4 8.5 4H5c-.55 0-1 .45-1 1s.45 1 1 1h3.5c.83 0 1.5.67 1.5 1.5S9.33 9 8.5 9H7c-2.21 0-4 1.79-4 4s1.79 4 4 4h2v-2H7c-1.1 0-2-.9-2-2"},"1")],"ElectricalServices"),wO=Pf((0,dt.jsx)("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff"),SO=Pf((0,dt.jsx)("path",{d:"M14 6v15H3v-2h2V3h9v1h5v15h2v2h-4V6zm-4 5v2h2v-2z"}),"MeetingRoom"),kO=Pf((0,dt.jsx)("path",{d:"M19 19V5c0-1.1-.9-2-2-2H7c-1.1 0-2 .9-2 2v14H3v2h18v-2zm-4-6h-2v-2h2z"}),"DoorFront"),CO=Pf((0,dt.jsx)("path",{d:"M12 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3m0 1c-1.84 0-3.56.5-5.03 1.37-.61.35-.97 1.02-.97 1.72V17h12v-1.91c0-.7-.36-1.36-.97-1.72C15.56 12.5 13.84 12 12 12m9.23-3.85 1.85-.77c-1.22-2.91-3.55-5.25-6.46-6.46l-.77 1.85c2.42 1.02 4.36 2.96 5.38 5.38M8.15 2.77 7.38.92C4.47 2.14 2.14 4.47.92 7.38l1.85.77c1.02-2.42 2.96-4.36 5.38-5.38M2.77 15.85l-1.85.77c1.22 2.91 3.55 5.25 6.46 6.46l.77-1.85c-2.42-1.02-4.36-2.96-5.38-5.38m13.08 5.38.77 1.85c2.91-1.22 5.25-3.55 6.46-6.46l-1.85-.77c-1.02 2.42-2.96 4.36-5.38 5.38"}),"SensorOccupied"),jO=Pf((0,dt.jsx)("path",{d:"M8.14 10.96c-.09.33-.14.68-.14 1.04 0 1.1.45 2.1 1.17 2.83l-1.42 1.42C6.67 15.16 6 13.66 6 12c0-.93.21-1.8.58-2.59L5.11 7.94C4.4 9.13 4 10.52 4 12c0 2.21.9 4.21 2.35 5.65l-1.42 1.42C3.12 17.26 2 14.76 2 12c0-2.04.61-3.93 1.66-5.51L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41zm9.28 3.63c.37-.79.58-1.66.58-2.59 0-1.66-.67-3.16-1.76-4.24l-1.42 1.42C15.55 9.9 16 10.9 16 12c0 .36-.05.71-.14 1.04zM20 12c0 1.48-.4 2.87-1.11 4.06l1.45 1.45C21.39 15.93 22 14.04 22 12c0-2.76-1.12-5.26-2.93-7.07l-1.42 1.42C19.1 7.79 20 9.79 20 12"}),"SensorsOff"),$O=Pf((0,dt.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightMode"),EO=Pf((0,dt.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.61 5.64 5.36 8.04 2.35 8.36 0 10.9 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4h2c0-2.76-1.86-5.08-4.4-5.78C8.61 6.88 10.2 6 12 6c3.03 0 5.5 2.47 5.5 5.5v.5H19c1.65 0 3 1.35 3 3s-1.35 3-3 3"}),"FilterDrama"),_O=Pf((0,dt.jsx)("path",{d:"M15 13V5c0-1.66-1.34-3-3-3S9 3.34 9 5v8c-1.21.91-2 2.37-2 4 0 2.76 2.24 5 5 5s5-2.24 5-5c0-1.63-.79-3.09-2-4m-4-2V5c0-.55.45-1 1-1s1 .45 1 1v1h-1v1h1v2h-1v1h1v1z"}),"Thermostat"),PO=Pf((0,dt.jsx)("path",{d:"M12 2c-5.33 4.55-8 8.48-8 11.8 0 4.98 3.8 8.2 8 8.2s8-3.22 8-8.2c0-3.32-2.67-7.25-8-11.8M7.83 14c.37 0 .67.26.74.62.41 2.22 2.28 2.98 3.64 2.87.43-.02.79.32.79.75 0 .4-.32.73-.72.75-2.13.13-4.62-1.09-5.19-4.12-.08-.45.28-.87.74-.87"}),"WaterDrop"),OO=Pf((0,dt.jsx)("path",{d:"M16 4h-1V2h-2v2h-2V2H9v2H8C5.79 4 4 5.79 4 8v10c0 2.21 1.79 4 4 4h8c2.21 0 4-1.79 4-4V8c0-2.21-1.79-4-4-4m-4 14c-1.38 0-2.5-1.1-2.5-2.46 0-1.09.43-1.39 2.5-3.79 2.05 2.38 2.5 2.7 2.5 3.79C14.5 16.9 13.38 18 12 18m4-8H8V8h8z"}),"GasMeter"),RO=Pf((0,dt.jsx)("path",{d:"M9 21c0 .5.4 1 1 1h4c.6 0 1-.5 1-1v-1H9zm3-19C8.1 2 5 5.1 5 9c0 2.4 1.2 4.5 3 5.7V17c0 .5.4 1 1 1h6c.6 0 1-.5 1-1v-2.3c1.8-1.3 3-3.4 3-5.7 0-3.9-3.1-7-7-7"}),"Lightbulb"),MO=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9 12c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1v3c0 .55-.45 1-1 1m5 6h-4v-2c0-1.1.9-2 2-2s2 .9 2 2zm2-7c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1s1 .45 1 1z"}),"Outlet"),NO=Pf((0,dt.jsx)("path",{d:"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5m0 8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3"}),"ToggleOn"),IO=Pf((0,dt.jsx)("path",{d:"M20 19V3H4v16H2v2h20v-2zM16 9h2v2h-2zm-2 2H6V9h8zm4-4h-2V5h2zm-4-2v2H6V5zM6 19v-6h8v1.82c-.45.32-.75.84-.75 1.43 0 .97.78 1.75 1.75 1.75s1.75-.78 1.75-1.75c0-.59-.3-1.12-.75-1.43V13h2v6z"}),"Blinds"),TO=Pf((0,dt.jsx)("path",{d:"M11 12V6c0-1.66-1.34-3-3-3S5 4.34 5 6v6c-1.21.91-2 2.37-2 4 0 1.12.38 2.14 1 2.97V19h.02c.91 1.21 2.35 2 3.98 2s3.06-.79 3.98-2H12v-.03c.62-.83 1-1.85 1-2.97 0-1.63-.79-3.09-2-4m-6 4c0-.94.45-1.84 1.2-2.4L7 13V6c0-.55.45-1 1-1s1 .45 1 1v7l.8.6c.75.57 1.2 1.46 1.2 2.4zM18.62 4h-1.61l-3.38 9h1.56l.81-2.3h3.63l.8 2.3H22zm-2.15 5.39 1.31-3.72h.08l1.31 3.72z"}),"ThermostatAuto"),AO=Pf((0,dt.jsx)("path",{d:"M16.01 7 16 3h-2v4h-4V3H8v4h-.01C7 6.99 6 7.99 6 8.99v5.49L9.5 18v3h5v-3l3.5-3.51v-5.5c0-1-1-2-1.99-1.99"}),"Power"),DO=Pf((0,dt.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"}),"Lock"),FO=Pf((0,dt.jsx)("path",{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12z"}),"LockOpen"),zO=Pf([(0,dt.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"},"0"),(0,dt.jsx)("path",{d:"M22 7.47V5.35C20.05 4.77 16.56 4 12 4c-2.15 0-4.11.86-5.54 2.24.13-.85.4-2.4 1.01-4.24H5.35C4.77 3.95 4 7.44 4 12c0 2.15.86 4.11 2.24 5.54-.85-.14-2.4-.4-4.24-1.01v2.12C3.95 19.23 7.44 20 12 20c2.15 0 4.11-.86 5.54-2.24-.14.85-.4 2.4-1.01 4.24h2.12c.58-1.95 1.35-5.44 1.35-10 0-2.15-.86-4.11-2.24-5.54.85.13 2.4.4 4.24 1.01M12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"},"1")],"Cyclone"),LO=Pf((0,dt.jsx)("path",{d:"M14.5 17c0 1.65-1.35 3-3 3s-3-1.35-3-3h2c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1H2v-2h9.5c1.65 0 3 1.35 3 3M19 6.5C19 4.57 17.43 3 15.5 3S12 4.57 12 6.5h2c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S16.33 8 15.5 8H2v2h13.5c1.93 0 3.5-1.57 3.5-3.5m-.5 4.5H2v2h16.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5v2c1.93 0 3.5-1.57 3.5-3.5S20.43 11 18.5 11"}),"Air"),BO=Pf([(0,dt.jsx)("path",{d:"M12 16c1.01 0 1.91-.39 2.62-1H9.38c.71.61 1.61 1 2.62 1m-3.44-2h6.89c.26-.45.44-.96.51-1.5h-7.9c.06.54.23 1.05.5 1.5M12 8c-1.01 0-1.91.39-2.62 1h5.24c-.71-.61-1.61-1-2.62-1m-3.44 2c-.26.45-.44.96-.51 1.5h7.9c-.07-.54-.24-1.05-.51-1.5z"},"0"),(0,dt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 15c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"},"1")],"Hvac"),WO=Pf((0,dt.jsx)("path",{d:"M22 11h-4.17l3.24-3.24-1.41-1.42L15 11h-2V9l4.66-4.66-1.42-1.41L13 6.17V2h-2v4.17L7.76 2.93 6.34 4.34 11 9v2H9L4.34 6.34 2.93 7.76 6.17 11H2v2h4.17l-3.24 3.24 1.41 1.42L9 13h2v2l-4.66 4.66 1.42 1.41L11 17.83V22h2v-4.17l3.24 3.24 1.42-1.41L13 15v-2h2l4.66 4.66 1.41-1.42L17.83 13H22z"}),"AcUnit"),VO=Pf((0,dt.jsx)("path",{d:"M17.92 7.02C17.45 4.18 14.97 2 12 2 9.82 2 7.83 3.18 6.78 5.06 4.09 5.41 2 7.74 2 10.5 2 13.53 4.47 16 7.5 16h10c2.48 0 4.5-2.02 4.5-4.5 0-2.34-1.79-4.27-4.08-4.48M14.8 17l-2.9 3.32 2 1L11.55 24h2.65l2.9-3.32-2-1L17.45 17zm-6 0-2.9 3.32 2 1L5.55 24H8.2l2.9-3.32-2-1L11.45 17z"}),"Thunderstorm"),HO=Pf((0,dt.jsx)("path",{d:"M21.98 14H22zM5.35 13c1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.4.98 3.31 1v-2c-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1v2c1.9 0 2.17-1 3.35-1m13.32 2c-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.1 1-3.34 1s-1.38-1-3.33-1-2.1 1-3.34 1v2c1.95 0 2.11-1 3.34-1 1.24 0 1.38 1 3.33 1s2.1-1 3.34-1c1.19 0 1.42 1 3.33 1 1.94 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1v-2c-1.24 0-1.38-1-3.33-1M5.35 9c1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.4.98 3.31 1V8c-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1C3.38 7 3.24 8 2 8v2c1.9 0 2.17-1 3.35-1"}),"Water"),UO=Pf([(0,dt.jsx)("path",{d:"m12 12.9-2.13 2.09c-.56.56-.87 1.29-.87 2.07C9 18.68 10.35 20 12 20s3-1.32 3-2.94c0-.78-.31-1.52-.87-2.07z"},"0"),(0,dt.jsx)("path",{d:"m16 6-.44.55C14.38 8.02 12 7.19 12 5.3V2S4 6 4 13c0 2.92 1.56 5.47 3.89 6.86-.56-.79-.89-1.76-.89-2.8 0-1.32.52-2.56 1.47-3.5L12 10.1l3.53 3.47c.95.93 1.47 2.17 1.47 3.5 0 1.02-.31 1.96-.85 2.75 1.89-1.15 3.29-3.06 3.71-5.3.66-3.55-1.07-6.9-3.86-8.52"},"1")],"LocalFireDepartment"),qO=Pf((0,dt.jsx)("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity"),GO=Pf((0,dt.jsx)("path",{d:"M19.5 6c-1.31 0-2.37 1.01-2.48 2.3-1.88-.5-2.84-1.8-5.02-1.8-2.19 0-3.14 1.3-5.02 1.8C6.87 7.02 5.81 6 4.5 6 3.12 6 2 7.12 2 8.5V9c0 6 3.6 7.81 6.52 7.98C9.53 17.62 10.72 18 12 18s2.47-.38 3.48-1.02C18.4 16.81 22 15 22 9v-.5C22 7.12 20.88 6 19.5 6m-16 3v-.5c0-.55.45-1 1-1s1 .45 1 1v3c0 1.28.38 2.47 1.01 3.48C4.99 14.27 3.5 12.65 3.5 9m17 0c0 3.65-1.49 5.27-3.01 5.98.64-1.01 1.01-2.2 1.01-3.48v-3c0-.55.45-1 1-1s1 .45 1 1zm-9.81 1.48c-.44.26-.96.56-1.69.76V10.2c.48-.17.84-.38 1.18-.58C10.72 9.3 11.23 9 12 9s1.27.3 1.8.62c.34.2.71.42 1.2.59v1.04c-.75-.21-1.26-.51-1.71-.78-.46-.27-.8-.47-1.29-.47s-.84.2-1.31.48"}),"Masks"),KO=Pf((0,dt.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonChecked"),QO=Pf((0,dt.jsx)("path",{d:"M22 7h-9v2h9zm0 8h-9v2h9zM5.54 11 2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"Checklist"),JO={display:"flex",gap:"2px",justifyContent:"space-evenly",width:"100%",height:"40px"},YO={margin:"0",padding:"0",fontSize:"36px",fontWeight:"medium",color:"var(--primary-color)"},XO={margin:"0",padding:"0",fontSize:"20px",fontWeight:"medium",color:"var(--div-text-color)",textAlign:"center"},ZO={margin:"0",padding:"0",fontSize:"16px",fontWeight:"medium",color:"var(--div-text-color)",textAlign:"center"},eR={display:"flex",gap:"2px",justifyContent:"center",width:"100%",height:"18px",margin:"0",padding:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},tR={margin:"0",padding:"0",fontSize:"12px",fontWeight:"normal",color:"var(--div-text-color)"},rR={display:"flex",justifyContent:"center",width:"100%",height:"52px",margin:"0",padding:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},nR={margin:"0",padding:"0",fontSize:"14px",fontWeight:"bold",color:"var(--div-text-color)"},oR={display:"flex",gap:"4px",justifyContent:"center",width:"100%",height:"15px",margin:"0",padding:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},aR={margin:"0",padding:"0px 4px",borderRadius:"5px",textAlign:"center",fontSize:"12px",fontWeight:"normal",color:"var(--secondary-color)"},iR=[256,257,268],sR=[266,267],lR=[259,260,261],cR=[256,257,268,266,267,259,260,261];function uR(t){let{icon:r,iconColor:n,cluster:o,value:a,unit:i}=t;return tM&&console.log(`Render cluster "${o.clusterName}.${o.attributeName}" value(${typeof a}-${isNaN(a)}) "${a}" unit "${i}"`),(0,dt.jsxs)(Uf,{sx:JO,children:[r&&e.cloneElement(r,{key:`${o.clusterId}-${o.attributeId}-icon`,sx:{...YO,color:null!==n&&void 0!==n?n:"var(--primary-color)"}}),(0,dt.jsxs)(Uf,{sx:{...JO,gap:"4px",alignContent:"center",alignItems:"end",justifyContent:"center"},children:[(0,dt.jsx)(vf,{sx:XO,children:null===a||void 0===a||"number"===typeof a&&isNaN(a)||"NaN"===a?"---":a},`${o.clusterId}-${o.attributeId}-value`),i&&(0,dt.jsx)(vf,{sx:ZO,children:i},`${o.clusterId}-${o.attributeId}-unit`)]},`${o.clusterId}-${o.attributeId}-valueunitbox`)]},`${o.clusterId}-${o.attributeId}-box`)}function dR(e){let{device:t,endpoint:r,id:n,deviceType:o,clusters:a}=e;const i=["Unknown","Good","Fair","Moderate","Poor","VeryPoor","Ext.Poor"];let s="";return tM&&console.log(`Device "${t.name}" endpoint "${r}" id "${n}" deviceType "0x${o.toString(16).padStart(4,"0")}" clusters (${null===a||void 0===a?void 0:a.length}):`,a),17===o&&a.filter((e=>"PowerSource"===e.clusterName&&"batVoltage"===e.attributeName)).map((e=>s=`${e.attributeLocalValue} mV`)),cR.includes(o)&&a.filter((e=>"LevelControl"===e.clusterName&&"currentLevel"===e.attributeName)).map((e=>s=`Level ${e.attributeValue}`)),514===o&&a.filter((e=>"WindowCovering"===e.clusterName&&"currentPositionLiftPercent100ths"===e.attributeName)).map((e=>s=`Position ${e.attributeValue/100}%`)),769===o&&a.filter((e=>"Thermostat"===e.clusterName&&"occupiedHeatingSetpoint"===e.attributeName)).map((e=>s=`Heat ${e.attributeValue/100}\xb0C `)),769===o&&a.filter((e=>"Thermostat"===e.clusterName&&"occupiedCoolingSetpoint"===e.attributeName)).map((e=>s+=`Cool ${e.attributeValue/100}\xb0C`)),118===o&&a.filter((e=>"SmokeCoAlarm"===e.clusterName&&"coState"===e.attributeName)).map((e=>s=""+(0===e.attributeLocalValue?"No CO detected":"CO alarm!"))),1296===o&&a.filter((e=>"ElectricalPowerMeasurement"===e.clusterName&&"voltage"===e.attributeName)).map((e=>s=e.attributeLocalValue/1e3+" V, ")),1296===o&&a.filter((e=>"ElectricalPowerMeasurement"===e.clusterName&&"activeCurrent"===e.attributeName)).map((e=>s+=e.attributeLocalValue/1e3+" A, ")),1296===o&&a.filter((e=>"ElectricalPowerMeasurement"===e.clusterName&&"activePower"===e.attributeName)).map((e=>s+=e.attributeLocalValue/1e3+" W")),(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0px",padding:"5px",width:"150px",height:"150px",borderColor:"var(--div-bg-color)",borderRadius:"5px",justifyContent:"space-between"},children:[19===o&&a.filter((e=>"BridgedDeviceBasicInformation"===e.clusterName&&"reachable"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:!0===e.attributeLocalValue?(0,dt.jsx)(by,{}):(0,dt.jsx)(wO,{}),iconColor:!0===e.attributeLocalValue?"green":"red",cluster:e,value:!0===e.attributeLocalValue?"Online":"Offline"}))),17===o&&a.filter((e=>"PowerSource"===e.clusterName&&"batPercentRemaining"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(bO,{}),cluster:e,value:e.attributeValue/2,unit:"%"}))),17===o&&a.filter((e=>"PowerSource"===e.clusterName&&"wiredCurrentType"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(xO,{}),cluster:e,value:0===e.attributeLocalValue?"AC":"DC"}))),iR.includes(o)&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(RO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),sR.includes(o)&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(MO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),lR.includes(o)&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(NO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),514===o&&a.filter((e=>"WindowCovering"===e.clusterName&&"currentPositionLiftPercent100ths"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(IO,{}),cluster:e,value:e.attributeLocalValue/100,unit:"%"}))),769===o&&a.filter((e=>"Thermostat"===e.clusterName&&"localTemperature"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(TO,{}),cluster:e,value:(null!==(t=e.attributeLocalValue)&&void 0!==t?t:0)/100,unit:"\xb0C"})})),10===o&&a.filter((e=>"DoorLock"===e.clusterName&&"lockState"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:"1"===e.attributeValue?(0,dt.jsx)(DO,{}):(0,dt.jsx)(FO,{}),cluster:e,value:"1"===e.attributeValue?"Locked":"Unlocked"}))),43===o&&a.filter((e=>"FanControl"===e.clusterName&&"percentCurrent"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(LO,{}),cluster:e,value:e.attributeValue,unit:"%"}))),15===o&&a.filter((e=>"Switch"===e.clusterName&&"currentPosition"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(KO,{}),cluster:e,value:e.attributeValue,unit:"pos"}))),39===o&&a.filter((e=>"ModeSelect"===e.clusterName&&"currentMode"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(QO,{}),cluster:e,value:e.attributeValue,unit:"mode"}))),771===o&&a.filter((e=>"OnOff"===e.clusterName&&"onOff"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(zO,{}),cluster:e,value:!0===e.attributeLocalValue?"On":"Off"}))),45===o&&a.filter((e=>"FanControl"===e.clusterName&&"percentCurrent"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(BO,{}),cluster:e,value:e.attributeValue,unit:"%"}))),114===o&&a.filter((e=>"Thermostat"===e.clusterName&&"localTemperature"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(BO,{}),cluster:e,value:(null!==(t=e.attributeLocalValue)&&void 0!==t?t:0)/100,unit:"\xb0C"})})),67===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(HO,{}),cluster:e,value:!0===e.attributeLocalValue?"Leak":"No leak"}))),65===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(WO,{}),cluster:e,value:!0===e.attributeLocalValue?"Freeze":"No freeze"}))),68===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(VO,{}),cluster:e,value:!0===e.attributeLocalValue?"Rain":"No rain"}))),118===o&&a.filter((e=>"SmokeCoAlarm"===e.clusterName&&"smokeState"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(UO,{}),cluster:e,value:0===e.attributeLocalValue?"No smoke":"Smoke"}))),66===o&&a.filter((e=>"ValveConfigurationAndControl"===e.clusterName&&"currentState"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(qO,{}),cluster:e,value:0===e.attributeLocalValue?"Closed":"Opened"}))),44===o&&a.filter((e=>"AirQuality"===e.clusterName&&"airQuality"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(GO,{}),cluster:e,value:i[null!==(t=e.attributeLocalValue)&&void 0!==t?t:0]})})),770===o&&a.filter((e=>"TemperatureMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(_O,{}),cluster:e,value:e.attributeLocalValue/100,unit:"\xb0C"}))),775===o&&a.filter((e=>"RelativeHumidityMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(PO,{}),cluster:e,value:e.attributeLocalValue/100,unit:"%"}))),774===o&&a.filter((e=>"FlowMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(OO,{}),cluster:e,value:e.attributeLocalValue,unit:"l/h"}))),773===o&&a.filter((e=>"PressureMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)(EO,{}),cluster:e,value:e.attributeLocalValue,unit:"hPa"}))),21===o&&a.filter((e=>"BooleanState"===e.clusterName&&"stateValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:"true"===e.attributeValue?(0,dt.jsx)(kO,{}):(0,dt.jsx)(SO,{}),cluster:e,value:"true"===e.attributeValue?"Closed":"Opened"}))),263===o&&a.filter((e=>"OccupancySensing"===e.clusterName&&"occupancy"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:"{ occupied: true }"===e.attributeValue?(0,dt.jsx)(CO,{}):(0,dt.jsx)(jO,{}),cluster:e,value:"{ occupied: true }"===e.attributeValue?"Occupied":"Unocc."}))),262===o&&a.filter((e=>"IlluminanceMeasurement"===e.clusterName&&"measuredValue"===e.attributeName)).map((e=>(0,dt.jsx)(uR,{icon:(0,dt.jsx)($O,{}),cluster:e,value:Math.round(Math.pow(10,e.attributeValue/1e4)),unit:"lx"}))),1296===o&&a.filter((e=>"ElectricalEnergyMeasurement"===e.clusterName&&"cumulativeEnergyImported"===e.attributeName)).map((e=>{var t;return(0,dt.jsx)(uR,{icon:(0,dt.jsx)(AO,{}),cluster:e,value:Math.round((null===(t=e.attributeLocalValue)||void 0===t?void 0:t.energy)/1e6),unit:"kwh"})})),(0,dt.jsx)(Uf,{sx:eR,children:(0,dt.jsx)(vf,{sx:tR,children:s})}),(0,dt.jsx)(Uf,{sx:rR,children:(0,dt.jsx)(vf,{sx:nR,children:t.name})}),(0,dt.jsxs)(Uf,{sx:oR,children:[tM&&(0,dt.jsx)(vf,{sx:aR,children:r}),(0,dt.jsx)(vf,{sx:aR,children:n}),tM&&(0,dt.jsxs)(vf,{sx:aR,children:["0x",o.toString(16).padStart(4,"0")]})]})]})}function pR(t){let{filter:r}=t;const{online:n,sendMessage:o,addListener:a,removeListener:i}=(0,e.useContext)(Qh),[s,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)({}),[d,p]=(0,e.useState)([]),[f,h]=(0,e.useState)([]),[m,g]=(0,e.useState)({}),[v,y]=(0,e.useState)({}),[b,x]=(0,e.useState)({}),[w,S]=(0,e.useState)(f),k=()=>{l(!s)};return(0,e.useEffect)((()=>{const e=e=>{if("Matterbridge"===e.src&&"Frontend"===e.dst){if("refresh_required"===e.method&&(tM&&console.log("DevicesIcons received refresh_required and sending api requests"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),"/api/settings"===e.method&&e.response&&(tM&&console.log("DevicesIcons received settings:",e.response),u(e.response)),"/api/plugins"===e.method&&e.response&&(tM&&console.log("DevicesIcons received plugins:",e.response),p(e.response)),"/api/devices"===e.method&&e.response){tM&&console.log(`DevicesIcons received ${e.response.length} devices:`,e.response),h(e.response);for(let t of e.response)tM&&console.log("DevicesIcons sending /api/clusters"),o({method:"/api/clusters",src:"Frontend",dst:"Matterbridge",params:{plugin:t.pluginName,endpoint:t.endpoint}})}if("/api/clusters"===e.method&&e.response){if(tM&&console.log(`DevicesIcons received for device "${e.deviceName}" serial "${e.serialNumber}" deviceType ${e.deviceTypes.join(" ")} clusters (${e.response.length}):`,e.response),0===e.response.length)return;const t=e.serialNumber;m[t]=[],v[t]=e.deviceTypes,b[t]=[];for(let r of e.response)m[t].find((e=>e.endpoint===r.endpoint))||m[t].push({endpoint:r.endpoint,id:r.id,deviceTypes:r.deviceTypes}),["FixedLabel","Descriptor","Identify","Groups","PowerTopology"].includes(r.clusterName)||b[t].push(r);g({...m}),y({...v}),x({...b}),tM&&console.log(`DevicesIcons endpoints for "${t}":`,m[t]),tM&&console.log(`DevicesIcons deviceTypes for "${t}":`,v[t]),tM&&console.log(`DevicesIcons clusters for "${t}":`,b[t])}}};return a(e),tM&&console.log("DevicesIcons useEffect webSocket mounted"),()=>{i(e),tM&&console.log("DevicesIcons useEffect webSocket unmounted")}}),[a,i,o]),(0,e.useEffect)((()=>(tM&&console.log("DevicesIcons useEffect online mounting"),n&&(tM&&console.log("DevicesIcons useEffect online sending api requests"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),o({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),tM&&console.log("DevicesIcons useEffect online mounted"),()=>{tM&&console.log("DevicesIcons useEffect online unmounted")})),[n,o]),(0,e.useEffect)((()=>{if(""===r)return void S(f);const e=f.filter((e=>e.name.toLowerCase().includes(r)||e.serial.toLowerCase().includes(r)));S(e)}),[f,r]),tM&&console.log("DevicesIcons rendering..."),(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsxs)(mh,{open:s,onClose:k,PaperProps:{style:{color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",border:"2px solid var(--primary-color)",borderRadius:"var(--div-border-radius)",boxShadow:"2px 2px 5px var(--div-shadow-color)"}},children:[(0,dt.jsx)(xh,{children:"Configure accessories"}),(0,dt.jsx)(Ch,{}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:k,children:"Close"})})]}),(0,dt.jsx)("div",{style:{display:"flex",flexWrap:"wrap",paddingBottom:"5px",gap:"20px",width:"100%",overflow:"auto"},children:w.map((e=>m[e.serial]&&m[e.serial].map((t=>t.deviceTypes.map((r=>(0,dt.jsx)(dR,{device:e,endpoint:t.endpoint,id:t.id,deviceType:r,clusters:b[e.serial].filter((e=>e.endpoint===t.endpoint))})))))))})]})}const fR=[{Header:"Plugin name",accessor:"pluginName"},{Header:"Device type",accessor:"type"},{Header:"Endpoint",accessor:"endpoint"},{Header:"Name",accessor:"name"},{Header:"Serial number",accessor:"serial"},{Header:"Unique ID",accessor:"uniqueId"},{Header:"Url",accessor:"configUrl"},{Header:"Config",accessor:"configButton",noSort:!0,Cell:e=>{let{row:t}=e;return t.original.configUrl?(0,dt.jsx)(Rd,{onClick:()=>window.open(t.original.configUrl,"_blank"),"aria-label":"Open Config",sx:{margin:0,padding:0},children:(0,dt.jsx)(Qv,{fontSize:"small"})}):null}},{Header:"Cluster",accessor:"cluster"}],hR=[{Header:"Endpoint",accessor:"endpoint"},{Header:"Id",accessor:"id"},{Header:"Device Types",accessor:"deviceTypes",Cell:e=>{let{value:t}=e;return Array.isArray(t)?t.map((e=>`0x${e.toString(16).padStart(4,"0")}`)).join(", "):t}},{Header:"Cluster Name",accessor:"clusterName"},{Header:"Cluster ID",accessor:"clusterId"},{Header:"Attribute Name",accessor:"attributeName"},{Header:"Attribute ID",accessor:"attributeId"},{Header:"Attribute Value",accessor:"attributeValue",Cell:e=>{let{value:t}=e;return(0,dt.jsx)(Uu,{title:t,componentsProps:{tooltip:{sx:{fontSize:"14px",fontWeight:"normal",color:"#ffffff",backgroundColor:"var(--primary-color)"}}},children:(0,dt.jsx)("div",{style:{maxWidth:"500px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})})}}];function mR(t){let{data:r,columnVisibility:n,setPlugin:o,setEndpoint:a,setDeviceName:i}=t;const[s,l]=(0,e.useState)(null),c=e.useMemo((()=>fR.filter((e=>n[e.accessor]))),[n]),{getTableProps:u,getTableBodyProps:d,headerGroups:p,rows:f,prepareRow:h}=(0,yv.useTable)({columns:c,data:r},yv.useSortBy);return(0,dt.jsxs)("table",{...u(),style:{margin:"-1px",border:"1px solid var(--table-border-color)"},children:[(0,dt.jsx)("thead",{children:p.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),children:e.headers.map((e=>(0,dt.jsxs)("th",{...e.getHeaderProps(e.noSort?void 0:e.getSortByToggleProps()),children:[e.render("Header"),!e.noSort&&(0,dt.jsx)("span",{style:{margin:"0px",marginLeft:"5px",padding:"0px"},children:e.isSorted?e.isSortedDesc?(0,dt.jsx)(dO(),{path:fO,size:"15px"}):(0,dt.jsx)(dO(),{path:pO,size:"15px"}):null})]})))})))}),(0,dt.jsx)("tbody",{...d(),children:f.map(((e,t)=>(h(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),onClick:()=>(e=>{const t=f[e];if(e===s)return l(null),o(null),a(null),i(null),void(tM&&console.log("Device unclicked:",e,"selectedDeviceIndex:",s));l(e),o(t.original.pluginName),a(t.original.endpoint),i(t.original.name),tM&&console.log("Device clicked:",e,"selectedDeviceIndex:",s,"pluginName:",r[e].pluginName,"endpoint:",r[e].endpoint)})(t),style:{backgroundColor:s===t?"var(--table-selected-bg-color)":"",cursor:"pointer"},children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),children:e.render("Cell")})))},t))))})]})}function gR(t){let{data:r,columnVisibility:n}=t;const o=e.useMemo((()=>hR.filter((e=>n[e.accessor]))),[n]),{getTableProps:a,getTableBodyProps:i,headerGroups:s,rows:l,prepareRow:c}=(0,yv.useTable)({columns:o,data:r},yv.useSortBy);return(0,dt.jsxs)("table",{...a(),style:{margin:"-1px"},children:[(0,dt.jsx)("thead",{children:s.map((e=>(0,dt.jsx)("tr",{...e.getHeaderGroupProps(),children:e.headers.map((e=>(0,dt.jsx)("th",{...e.getHeaderProps(),children:e.render("Header")})))})))}),(0,dt.jsx)("tbody",{...i(),children:l.map(((e,t)=>(c(e),(0,dt.jsx)("tr",{className:t%2===0?"table-content-even":"table-content-odd",...e.getRowProps(),children:e.cells.map((e=>(0,dt.jsx)("td",{...e.getCellProps(),children:e.render("Cell")})))},t))))})]})}const vR=function(){const{online:t,sendMessage:r,addListener:n,removeListener:o}=(0,e.useContext)(Qh),[a,i]=(0,e.useState)([]),[s,l]=(0,e.useState)([]),[c,u]=(0,e.useState)(null),[d,p]=(0,e.useState)(null),[f,h]=(0,e.useState)(null),[m,g]=(0,e.useState)(0),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)({pluginName:!0,type:!0,endpoint:!0,name:!0,serial:!0,uniqueId:!1,configUrl:!1,configButton:!0,cluster:!0}),[w,S]=(0,e.useState)(!1),[k,C]=(0,e.useState)({endpoint:!0,id:!0,deviceTypes:!0,clusterName:!0,clusterId:!0,attributeName:!0,attributeId:!0,attributeValue:!0}),[j,$]=(0,e.useState)(""),[E,_]=(0,e.useState)(a),[P,O]=(0,e.useState)("table");(0,e.useEffect)((()=>{const e=e=>{if(tM&&console.log("Devices received WebSocket Message:",e),"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&(tM&&console.log("Devices received refresh_required"),r({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),"/api/devices"===e.method&&(tM&&console.log(`Devices received ${e.response.length} devices:`,e.response),i(e.response)),"/api/clusters"===e.method)){tM&&console.log(`Devices received ${e.response.length} clusters:`,e.response),l(e.response);const t={};for(const r of e.response)tM&&console.log("Cluster:",r.endpoint),t[r.endpoint]?t[r.endpoint]++:t[r.endpoint]=1;g(Object.keys(t).length)}};return n(e),tM&&console.log("Devices added WebSocket listener"),()=>{o(e),tM&&console.log("Devices removed WebSocket listener")}}),[n,o,r]),(0,e.useEffect)((()=>{t&&(tM&&console.log("Devices sending api requests"),r({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}}))}),[t,r]),(0,e.useEffect)((()=>{c&&d&&(tM&&console.log("Devices sending /api/clusters"),r({method:"/api/clusters",src:"Frontend",dst:"Matterbridge",params:{plugin:c,endpoint:d}}))}),[c,d,r]);const R=()=>{y(!v)};(0,e.useEffect)((()=>{const e=localStorage.getItem("devicesColumnVisibility");e&&x(JSON.parse(e))}),[]);const M=()=>{S(!w)};(0,e.useEffect)((()=>{const e=localStorage.getItem("clustersColumnVisibility");e&&C(JSON.parse(e))}),[]);const N=e=>{O(e),localStorage.setItem("devicesViewMode",e)};return(0,e.useEffect)((()=>{if(""===j)return void _(a);const e=a.filter((e=>e.name.toLowerCase().includes(j)||e.serial.toLowerCase().includes(j)));_(e)}),[a,j]),(0,e.useEffect)((()=>{const e=localStorage.getItem("devicesFilter");e&&$(e)}),[]),(0,e.useEffect)((()=>{const e=localStorage.getItem("devicesViewMode");e&&O(e)}),[]),tM&&console.log("Devices rendering..."),t?(0,dt.jsxs)("div",{className:"MbfPageDiv",children:[(0,dt.jsxs)("div",{className:"MbfWindowBodyRow",style:{justifyContent:"space-between",padding:0,gap:"20px",width:"100%",height:"45px",minHeight:"45px",maxHeight:"45px"},children:[(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[(0,dt.jsx)(vf,{sx:{fontSize:"16px",fontWeight:"normal",color:"var(--div-text-color)",marginLeft:"5px",whiteSpace:"nowrap"},children:"Filter by:"}),(0,dt.jsx)(fv,{variant:"outlined",value:j,onChange:e=>{$(e.target.value.toLowerCase()),localStorage.setItem("devicesFilter",e.target.value.toLowerCase())},placeholder:"Enter the device name or serial number",sx:{width:"320px"},InputProps:{style:{backgroundColor:"var(--main-bg-color)"}}})]}),(0,dt.jsxs)(Uf,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[(0,dt.jsx)(vf,{sx:{fontSize:"16px",fontWeight:"normal",color:"var(--div-text-color)",marginLeft:"5px",whiteSpace:"nowrap"},children:"View mode:"}),(0,dt.jsx)(Rd,{onClick:()=>N("table"),"aria-label":"Table View",disabled:"table"===P,children:(0,dt.jsx)(Uu,{title:"Table View",children:(0,dt.jsx)(vO,{style:{color:"table"===P?"var(--main-icon-color)":"var(--primary-color)"}})})}),(0,dt.jsx)(Rd,{onClick:()=>N("icon"),"aria-label":"Icon View",disabled:"icon"===P,children:(0,dt.jsx)(Uu,{title:"Icon View (beta)",children:(0,dt.jsx)(yO,{style:{color:"icon"===P?"var(--main-icon-color)":"var(--primary-color)"}})})})]})]}),(0,dt.jsxs)(mh,{open:v,onClose:R,children:[(0,dt.jsx)(xh,{children:"Configure Devices Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:fR.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["pluginName","name","configButton"].includes(e.accessor),checked:b[e.accessor],onChange:()=>{return t=e.accessor,void x((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("devicesColumnVisibility",JSON.stringify(r)),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:R,children:"Close"})})]}),"table"===P&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",maxHeight:""+(c&&d?"50%":"100%"),width:"100%",flex:"1 1 auto",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsx)("p",{style:{margin:"0px",padding:"0px"},children:"Registered devices"}),(0,dt.jsx)(Rd,{onClick:R,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0",padding:"0",gap:"0"},children:(0,dt.jsx)(mR,{data:E,columnVisibility:b,setPlugin:u,setEndpoint:p,setDeviceName:h})}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{height:"",padding:"0",borderTop:"1px solid var(--table-border-color)"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{paddingLeft:"10px",fontWeight:"normal",textAlign:"left"},children:["Total devices: ",E.length.toString()]})})]}),(0,dt.jsxs)(mh,{open:w,onClose:M,children:[(0,dt.jsx)(xh,{children:"Configure Clusters Columns"}),(0,dt.jsx)(Ch,{children:(0,dt.jsx)($v,{children:hR.map((e=>(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{disabled:["clusterName","attributeName","attributeValue"].includes(e.accessor),checked:k[e.accessor],onChange:()=>{return t=e.accessor,void C((e=>{const r={...e,[t]:!e[t]};return localStorage.setItem("clustersColumnVisibility",JSON.stringify(r)),r}));var t}}),label:e.Header},e.accessor)))})}),(0,dt.jsx)(Sv,{children:(0,dt.jsx)(Ah,{onClick:M,children:"Close"})})]}),"table"===P&&c&&d&&(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{margin:"0",padding:"0",gap:"0",height:"50%",maxHeight:"50%",width:"100%",flex:"1 1 auto",overflow:"hidden"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsxs)("div",{className:"MbfWindowHeaderText",style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,dt.jsxs)("p",{style:{margin:"0px",padding:"0px"},children:['Clusters for device "',f,'" on endpoint ',d]}),(0,dt.jsx)(Rd,{onClick:M,"aria-label":"Configure Columns",style:{margin:"0px",padding:"0px",width:"19px",height:"19px"},children:(0,dt.jsx)(Uu,{title:"Configure columns",children:(0,dt.jsx)(Qv,{style:{color:"var(--header-text-color)",fontSize:"19px"}})})})]})}),(0,dt.jsx)("div",{className:"MbfWindowBodyColumn",style:{margin:"0",padding:"0",gap:"0"},children:(0,dt.jsx)(gR,{data:s,columnVisibility:k})}),(0,dt.jsx)("div",{className:"MbfWindowFooter",style:{height:"",padding:"0",borderTop:"1px solid var(--table-border-color)"},children:(0,dt.jsxs)("p",{className:"MbfWindowFooterText",style:{paddingLeft:"10px",fontWeight:"normal",textAlign:"left"},children:["Total child endpoints: ",m-1]})})]}),"icon"===P&&(0,dt.jsx)(pR,{filter:j,devices:E})]}):(0,dt.jsx)(tm,{})},yR=Pf((0,dt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),bR=Pf((0,dt.jsx)("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),xR=dl("span",{shouldForwardProp:cl})({position:"relative",display:"flex"}),wR=dl(yR)({transform:"scale(1)"}),SR=dl(bR)(gl((e=>{let{theme:t}=e;return{left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}}]}})));const kR=function(e){const{checked:t=!1,classes:r={},fontSize:n}=e,o={...e,checked:t};return(0,dt.jsxs)(xR,{className:r.root,ownerState:o,children:[(0,dt.jsx)(wR,{fontSize:n,className:r.background,ownerState:o}),(0,dt.jsx)(SR,{fontSize:n,className:r.dot,ownerState:o})]})},CR=cp;const jR=e.createContext(void 0);function $R(e){return vu("MuiRadio",e)}const ER=yu("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),_R=dl(Dv,{shouldForwardProp:e=>cl(e)||"classes"===e,name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"medium"!==r.size&&t[`size${yl(r.size)}`],t[`color${yl(r.color)}`]]}})(gl((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,[`&.${ER.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:No(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),...Object.entries(t.palette).filter(qu()).map((e=>{let[r]=e;return{props:{color:r,disabled:!1},style:{[`&.${ER.checked}`]:{color:(t.vars||t).palette[r].main}}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}})));const PR=(0,dt.jsx)(kR,{checked:!0}),OR=(0,dt.jsx)(kR,{}),RR=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiRadio"}),{checked:o,checkedIcon:a=PR,color:i="primary",icon:s=OR,name:l,onChange:c,size:u="medium",className:d,disabled:p,disableRipple:f=!1,slots:h={},slotProps:m={},inputProps:g,...v}=n,y=Am();let b=p;y&&"undefined"===typeof b&&(b=y.disabled),b??=!1;const x={...n,disabled:b,disableRipple:f,color:i,size:u},w=(e=>{const{classes:t,color:r,size:n}=e,o={root:["root",`color${yl(r)}`,"medium"!==n&&`size${yl(n)}`]};return{...t,...zs(o,$R,t)}})(x),S=e.useContext(jR);let k=o;const C=CR(c,S&&S.onChange);let j=l;S&&("undefined"===typeof k&&(k=function(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}(S.value,n.value)),"undefined"===typeof j&&(j=S.name));const $=m.input??g,[E,_]=Iu("root",{ref:r,elementType:_R,className:Ns(w.root,d),shouldForwardComponentProp:!0,externalForwardedProps:{slots:h,slotProps:m,...v},getSlotProps:e=>({...e,onChange:function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.onChange?.(t,...n),C(t,...n)}}),ownerState:x,additionalProps:{type:"radio",icon:e.cloneElement(s,{fontSize:s.props.fontSize??u}),checkedIcon:e.cloneElement(a,{fontSize:a.props.fontSize??u}),disabled:b,name:j,checked:k,slots:h,slotProps:{input:"function"===typeof $?$(x):$}}});return(0,dt.jsx)(E,{..._,classes:w})})),MR=RR;function NR(e){return vu("MuiRadioGroup",e)}yu("MuiRadioGroup",["root","row","error"]);const IR=e.forwardRef((function(t,r){const{actions:n,children:o,className:a,defaultValue:i,name:s,onChange:l,value:c,...u}=t,d=e.useRef(null),p=(e=>{const{classes:t,row:r,error:n}=e;return zs({root:["root",r&&"row",n&&"error"]},NR,t)})(t),[f,h]=Nu({controlled:c,default:i,name:"RadioGroup"});e.useImperativeHandle(n,(()=>({focus:()=>{let e=d.current.querySelector("input:not(:disabled):checked");e||(e=d.current.querySelector("input:not(:disabled)")),e&&e.focus()}})),[]);const m=Al(r,d),g=Mu(s),v=e.useMemo((()=>({name:g,onChange(e){h(e.target.value),l&&l(e,e.target.value)},value:f})),[g,l,h,f]);return(0,dt.jsx)(jR.Provider,{value:v,children:(0,dt.jsx)($v,{role:"radiogroup",ref:m,className:Ns(p.root,a),...u,children:o})})})),TR=IR;const AR=e.createContext();function DR(e){return vu("MuiGrid",e)}const FR=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],zR=yu("MuiGrid",["root","container","item","zeroMinWidth",...[0,1,2,3,4,5,6,7,8,9,10].map((e=>`spacing-xs-${e}`)),...["column-reverse","column","row-reverse","row"].map((e=>`direction-xs-${e}`)),...["nowrap","wrap-reverse","wrap"].map((e=>`wrap-xs-${e}`)),...FR.map((e=>`grid-xs-${e}`)),...FR.map((e=>`grid-sm-${e}`)),...FR.map((e=>`grid-md-${e}`)),...FR.map((e=>`grid-lg-${e}`)),...FR.map((e=>`grid-xl-${e}`))]),LR=zR;function BR(e){let{breakpoints:t,values:r}=e,n="";Object.keys(r).forEach((e=>{""===n&&0!==r[e]&&(n=e)}));const o=Object.keys(t).sort(((e,r)=>t[e]-t[r]));return o.slice(0,o.indexOf(n))}const WR=dl("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e,{container:n,direction:o,item:a,spacing:i,wrap:s,zeroMinWidth:l,breakpoints:c}=r;let u=[];n&&(u=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||e<=0)return[];if("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e)return[r[`spacing-xs-${String(e)}`]];const n=[];return t.forEach((t=>{const o=e[t];Number(o)>0&&n.push(r[`spacing-${t}-${String(o)}`])})),n}(i,c,t));const d=[];return c.forEach((e=>{const n=r[e];n&&d.push(t[`grid-${e}-${String(n)}`])})),[t.root,n&&t.container,a&&t.item,l&&t.zeroMinWidth,...u,"row"!==o&&t[`direction-xs-${String(o)}`],"wrap"!==s&&t[`wrap-xs-${String(s)}`],...d]}})((e=>{let{ownerState:t}=e;return{boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},..."wrap"!==t.wrap&&{flexWrap:t.wrap}}}),(function(e){let{theme:t,ownerState:r}=e;return pn({theme:t},mn({values:r.direction,breakpoints:t.breakpoints.values}),(e=>{const t={flexDirection:e};return e.startsWith("column")&&(t[`& > .${LR.item}`]={maxWidth:"none"}),t}))}),(function(e){let{theme:t,ownerState:r}=e;const{container:n,rowSpacing:o}=r;let a={};if(n&&0!==o){const e=mn({values:o,breakpoints:t.breakpoints.values});let r;"object"===typeof e&&(r=BR({breakpoints:t.breakpoints.values,values:e})),a=pn({theme:t},e,((e,n)=>{const o=t.spacing(e);return"0px"!==o?{marginTop:`calc(-1 * ${o})`,[`& > .${LR.item}`]:{paddingTop:o}}:r?.includes(n)?{}:{marginTop:0,[`& > .${LR.item}`]:{paddingTop:0}}}))}return a}),(function(e){let{theme:t,ownerState:r}=e;const{container:n,columnSpacing:o}=r;let a={};if(n&&0!==o){const e=mn({values:o,breakpoints:t.breakpoints.values});let r;"object"===typeof e&&(r=BR({breakpoints:t.breakpoints.values,values:e})),a=pn({theme:t},e,((e,n)=>{const o=t.spacing(e);if("0px"!==o){return{width:`calc(100% + ${o})`,marginLeft:`calc(-1 * ${o})`,[`& > .${LR.item}`]:{paddingLeft:o}}}return r?.includes(n)?{}:{width:"100%",marginLeft:0,[`& > .${LR.item}`]:{paddingLeft:0}}}))}return a}),(function(e){let t,{theme:r,ownerState:n}=e;return r.breakpoints.keys.reduce(((e,o)=>{let a={};if(n[o]&&(t=n[o]),!t)return e;if(!0===t)a={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if("auto"===t)a={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const i=mn({values:n.columns,breakpoints:r.breakpoints.values}),s="object"===typeof i?i[o]:i;if(void 0===s||null===s)return e;const l=Math.round(t/s*1e8)/1e6+"%";let c={};if(n.container&&n.item&&0!==n.columnSpacing){const e=r.spacing(n.columnSpacing);if("0px"!==e){const t=`calc(${l} + ${e})`;c={flexBasis:t,maxWidth:t}}}a={flexBasis:l,flexGrow:0,maxWidth:l,...c}}return 0===r.breakpoints.values[o]?Object.assign(e,a):e[r.breakpoints.up(o)]=a,e}),{})}));const VR=e=>{const{classes:t,container:r,direction:n,item:o,spacing:a,wrap:i,zeroMinWidth:s,breakpoints:l}=e;let c=[];r&&(c=function(e,t){if(!e||e<=0)return[];if("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e)return[`spacing-xs-${String(e)}`];const r=[];return t.forEach((t=>{const n=e[t];if(Number(n)>0){const e=`spacing-${t}-${String(n)}`;r.push(e)}})),r}(a,l));const u=[];l.forEach((t=>{const r=e[t];r&&u.push(`grid-${t}-${String(r)}`)}));return zs({root:["root",r&&"container",o&&"item",s&&"zeroMinWidth",...c,"row"!==n&&`direction-xs-${String(n)}`,"wrap"!==i&&`wrap-xs-${String(i)}`,...u]},DR,t)},HR=e.forwardRef((function(t,r){const n=vl({props:t,name:"MuiGrid"}),{breakpoints:o}=hl(),a=cf(n),{className:i,columns:s,columnSpacing:l,component:c="div",container:u=!1,direction:d="row",item:p=!1,rowSpacing:f,spacing:h=0,wrap:m="wrap",zeroMinWidth:g=!1,...v}=a,y=f||h,b=l||h,x=e.useContext(AR),w=u?s||12:x,S={},k={...v};o.keys.forEach((e=>{null!=v[e]&&(S[e]=v[e],delete k[e])}));const C={...a,columns:w,container:u,direction:d,item:p,rowSpacing:y,columnSpacing:b,wrap:m,zeroMinWidth:g,spacing:h,...S,breakpoints:o.keys},j=VR(C);return(0,dt.jsx)(AR.Provider,{value:w,children:(0,dt.jsx)(WR,{ownerState:C,className:Ns(j.root,i),as:c,ref:r,...k})})}));const UR=HR,qR=t=>{let{open:r,ip:n,onClose:o,onSave:a}=t;const i=n?n.split(".").slice(0,3).join(".")+".1":"",[s,l]=(0,e.useState)("dhcp"),[c,u]=(0,e.useState)({ip:null!==n&&void 0!==n?n:"",subnet:"255.255.255.0",gateway:i,dns:i}),d=e=>t=>{u({...c,[e]:t.target.value})};return(0,dt.jsxs)(mh,{open:r,onClose:(e,t)=>{"backdropClick"!==t&&"escapeKeyDown"!==t&&o()},maxWidth:"sm",style:{maxWidth:"550px",margin:"auto"},children:[(0,dt.jsx)(xh,{gap:"20px",children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h4",{style:{margin:0},children:"Network Configuration"})]})}),(0,dt.jsxs)(Ch,{dividers:!0,children:[(0,dt.jsxs)(Rg,{component:"fieldset",fullWidth:!0,children:[(0,dt.jsx)(Sg,{component:"legend",children:"Select IP Configuration"}),(0,dt.jsxs)(TR,{row:!0,value:s,onChange:e=>l(e.target.value),children:[(0,dt.jsx)(Mv,{value:"dhcp",control:(0,dt.jsx)(MR,{}),label:"DHCP"}),(0,dt.jsx)(Mv,{value:"static",control:(0,dt.jsx)(MR,{}),label:"Static"})]})]}),"static"===s&&(0,dt.jsxs)(UR,{container:!0,spacing:2,sx:{mt:2},children:[(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"IP Address",fullWidth:!0,value:c.ip,onChange:d("ip")})}),(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"Subnet Mask",fullWidth:!0,value:c.subnet,onChange:d("subnet")})}),(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"Gateway",fullWidth:!0,value:c.gateway,onChange:d("gateway")})}),(0,dt.jsx)(UR,{item:!0,xs:12,sm:6,children:(0,dt.jsx)(fv,{label:"DNS Server",fullWidth:!0,value:c.dns,onChange:d("dns")})})]})]}),(0,dt.jsxs)(Sv,{children:[(0,dt.jsx)(Ah,{onClick:()=>{o()},children:"Cancel"}),(0,dt.jsx)(Ah,{variant:"contained",onClick:()=>{const e="static"===s?{type:s,...c}:{type:s};a(e),o()},children:"Save"})]})]})},GR=t=>{let{open:r,onClose:n,onSave:o}=t;const[a,i]=(0,e.useState)(""),[s,l]=(0,e.useState)(""),c=a.length>0&&a===s;return(0,dt.jsxs)(mh,{open:r,onClose:(e,t)=>{"backdropClick"!==t&&"escapeKeyDown"!==t&&n()},maxWidth:"sm",style:{maxWidth:"500px",margin:"auto"},disableEscapeKeyDown:!0,children:[(0,dt.jsx)(xh,{children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"32px",width:"32px"}}),(0,dt.jsx)("h4",{style:{margin:0},children:"Change Password"})]})}),(0,dt.jsx)(Ch,{dividers:!0,children:(0,dt.jsx)(Rg,{component:"fieldset",fullWidth:!0,sx:{margin:0,padding:0,gap:"20px"},children:(0,dt.jsxs)(UR,{container:!0,spacing:2,sx:{mt:2},children:[(0,dt.jsx)(UR,{item:!0,xs:12,children:(0,dt.jsx)(fv,{type:"password",autoComplete:"new-password",label:"New Password",size:"small",variant:"outlined",fullWidth:!0,value:a,onChange:e=>{i(e.target.value)}})}),(0,dt.jsx)(UR,{item:!0,xs:12,children:(0,dt.jsx)(fv,{type:"password",autoComplete:"new-password",label:"Confirm Password",size:"small",variant:"outlined",fullWidth:!0,value:s,onChange:e=>{l(e.target.value)},error:""!==s&&a!==s,helperText:""!==s&&a!==s?"Passwords do not match":""})})]})})}),(0,dt.jsxs)(Sv,{children:[(0,dt.jsx)(Ah,{onClick:()=>{n()},children:"Cancel"}),(0,dt.jsx)(Ah,{variant:"contained",onClick:()=>{c&&(o(a),n())},disabled:!c,children:"Change"}),(0,dt.jsx)(Ah,{variant:"contained",onClick:()=>{o(""),n()},children:"Reset"})]})]})};function KR(t){var r;let{matterbridgeInfo:n,systemInfo:o}=t;const[a,i]=(0,e.useState)("bridge"),[s,l]=(0,e.useState)("Info"),[c,u]=(0,e.useState)(!1),[d,p]=(0,e.useState)("dark"),[f,h]=(0,e.useState)("false"!==localStorage.getItem("homePagePlugins")),[m,g]=(0,e.useState)(null!==(r=localStorage.getItem("homePageMode"))&&void 0!==r?r:"logs"),{sendMessage:v}=(0,e.useContext)(Qh),[y,b]=(0,e.useState)(!1),[x,w]=(0,e.useState)(!1);(0,e.useEffect)((()=>{void 0!==n.bridgeMode&&(i("bridge"===n.bridgeMode?"bridge":"childbridge"),l(n.loggerLevel.charAt(0).toUpperCase()+n.loggerLevel.slice(1)),u(n.fileLogger))}),[n]),(0,e.useEffect)((()=>{const e=localStorage.getItem("frontendTheme");e&&p(e)}),[]);return(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Matterbridge settings"})}),(0,dt.jsx)(qR,{open:y,ip:o.ipv4Address,onClose:()=>b(!1),onSave:e=>{tM&&console.log("handleSaveNetConfig called with config:",e),v({method:"/api/shellynetconfig",src:"Frontend",dst:"Matterbridge",params:e})}}),(0,dt.jsx)(GR,{open:x,onClose:()=>w(!1),onSave:e=>{tM&&console.log("handleSaveChangePassword called with password:",e),Bf("setpassword","*"+e+"*")}}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px",flex:"0 0 auto"},children:(0,dt.jsxs)(Uf,{sx:{gap:"10px",margin:"0px",padding:"10px",width:"400px",backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)"},children:[(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"matterbridgeInfo-mode",children:"Matterbridge mode:"}),(0,dt.jsxs)(TR,{row:!0,name:"mode-buttons-group",value:a,onChange:e=>{tM&&console.log("handleChangeBridgeMode called with value:",e.target.value),i(e.target.value),Bf("setbridgemode",e.target.value)},children:[(0,dt.jsx)(Mv,{value:"bridge",control:(0,dt.jsx)(MR,{}),label:"Bridge",disabled:!0===n.readOnly}),(0,dt.jsx)(Mv,{value:"childbridge",control:(0,dt.jsx)(MR,{}),label:"Childbridge",disabled:!0===n.readOnly})]})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"mblogger-level-label",children:"Logger level:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"mblogger-level-label",id:"mblogger-level",value:s,onChange:e=>{tM&&console.log("handleChangeMbLoggerLevel called with value:",e.target.value),l(e.target.value),Bf("setmbloglevel",e.target.value)},children:[(0,dt.jsx)(tf,{value:"Debug",children:"Debug"}),(0,dt.jsx)(tf,{value:"Info",children:"Info"}),(0,dt.jsx)(tf,{value:"Notice",children:"Notice"}),(0,dt.jsx)(tf,{value:"Warn",children:"Warn"}),(0,dt.jsx)(tf,{value:"Error",children:"Error"}),(0,dt.jsx)(tf,{value:"Fatal",children:"Fatal"})]}),(0,dt.jsx)(Mv,{style:{padding:"0px",margin:"0px"},control:(0,dt.jsx)(Kv,{checked:c,onChange:e=>{tM&&console.log("handleLogOnFileMbChange called with value:",e.target.checked),u(e.target.checked),Bf("setmblogfile",e.target.checked?"true":"false")},name:"logOnFileMb"}),label:"Log on file:",labelPlacement:"start"})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"5px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"frontend-theme-label",children:"Frontend theme:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"frontend-theme-label",id:"frontend-theme",value:d,onChange:e=>{const t=e.target.value;tM&&console.log("handleChangeTheme called with value:",t),p(t),localStorage.setItem("frontendTheme",t),document.body.setAttribute("frontend-theme",t)},children:[(0,dt.jsx)(tf,{value:"classic",children:"Classic"}),(0,dt.jsx)(tf,{value:"light",children:"Light"}),(0,dt.jsx)(tf,{value:"dark",children:"Dark"})]})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"5px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"frontend-home-plugin-label",children:"Home page plugins:"}),(0,dt.jsx)(Kv,{checked:f,onChange:e=>{const t=e.target.checked;tM&&console.log("handleChangeHomePagePlugins called with value:",t),h(t),localStorage.setItem("homePagePlugins",t?"true":"false")},name:"showPlugins"})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"5px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"frontend-home-label",children:"Home page bottom panel:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"frontend-home-label",id:"frontend-home",value:m,onChange:e=>{const t=e.target.value;tM&&console.log("handleChangeHomePageMode called with value:",t),g(t),localStorage.setItem("homePageMode",t)},children:[(0,dt.jsx)(tf,{value:"logs",children:"Logs"}),(0,dt.jsx)(tf,{value:"devices",children:"Devices"})]})]}),(0,dt.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"20px"},children:(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:()=>w(!0),children:"Change password"})}),n.shellyBoard&&(0,dt.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"15px",marginTop:"20px"},children:(0,dt.jsx)(Ah,{variant:"contained",color:"primary",onClick:()=>b(!0),children:"Configure IP"})})]})})]})}function QR(t){let{matterbridgeInfo:r}=t;const[n,o]=(0,e.useState)("Info"),[a,i]=(0,e.useState)(!1),[s,l]=(0,e.useState)(""),[c,u]=(0,e.useState)(""),[d,p]=(0,e.useState)(""),[f,h]=(0,e.useState)(),[m,g]=(0,e.useState)(),[v,y]=(0,e.useState)(),{showSnackbarMessage:b}=(0,e.useContext)(Fh);(0,e.useEffect)((()=>{void 0!==r.bridgeMode&&(o(["Debug","Info","Notice","Warn","Error","Fatal"][r.matterLoggerLevel]),i(r.matterFileLogger),l(r.mattermdnsinterface),u(r.matteripv4address),p(r.matteripv6address),h(r.matterPort),g(r.matterDiscriminator),y(r.matterPasscode))}),[r]);return(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Matter settings"})}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px",flex:"0 0 auto"},children:(0,dt.jsxs)(Uf,{sx:{gap:"10px",margin:"0px",padding:"10px",width:"400px",backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)"},children:[(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},id:"mjdebug-info",children:"Logger level:"}),(0,dt.jsxs)(lv,{style:{height:"30px"},labelId:"select-mjlevel",id:"mjdebug-level",value:n,onChange:e=>{tM&&console.log("handleChangeMjLoggerLevel called with value:",e.target.value),o(e.target.value),Bf("setmjloglevel",e.target.value)},children:[(0,dt.jsx)(tf,{value:"Debug",children:"Debug"}),(0,dt.jsx)(tf,{value:"Info",children:"Info"}),(0,dt.jsx)(tf,{value:"Notice",children:"Notice"}),(0,dt.jsx)(tf,{value:"Warn",children:"Warn"}),(0,dt.jsx)(tf,{value:"Error",children:"Error"}),(0,dt.jsx)(tf,{value:"Fatal",children:"Fatal"})]}),(0,dt.jsx)(Mv,{style:{padding:"0px",margin:"0px"},control:(0,dt.jsx)(Kv,{checked:a,onChange:e=>{tM&&console.log("handleLogOnFileMjChange called with value:",e.target.checked),i(e.target.checked),Bf("setmjlogfile",e.target.checked?"true":"false")},name:"logOnFileMj"}),label:"Log on file:",labelPlacement:"start"})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Mdns interface:"}),(0,dt.jsx)(fv,{value:s,onChange:e=>{tM&&console.log("handleChangeMdnsInterface called with value:",e.target.value),l(e.target.value),Bf("setmdnsinterface","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Ipv4 address:"}),(0,dt.jsx)(fv,{value:c,onChange:e=>{tM&&console.log("handleChangeIpv4Address called with value:",e.target.value),u(e.target.value),Bf("setipv4address","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Ipv6 address:"}),(0,dt.jsx)(fv,{value:d,onChange:e=>{tM&&console.log("handleChangeIpv6Address called with value:",e.target.value),p(e.target.value),Bf("setipv6address","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Commissioning port:"}),(0,dt.jsx)(fv,{value:f,onChange:e=>{tM&&console.log("handleChangeMatterPort called with value:",e.target.value),h(e.target.value),Bf("setmatterport","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Commissioning discriminator:"}),(0,dt.jsx)(fv,{value:m,onChange:e=>{tM&&console.log("handleChangeMatterDiscriminator called with value:",e.target.value),g(e.target.value),Bf("setmatterdiscriminator","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]}),(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)(Sg,{style:{padding:"0px",margin:"0px"},children:"Commissioning passcode:"}),(0,dt.jsx)(fv,{value:v,onChange:e=>{tM&&console.log("handleChangemMatterPasscode called with value:",e.target.value),y(e.target.value),Bf("setmatterpasscode","json",JSON.stringify({value:e.target.value})),b("Restart Matterbridge to apply changes",5)},size:"small",variant:"outlined",style:{height:"30px",flexGrow:1},InputProps:{readOnly:!0===r.readOnly,style:{height:"30px",padding:"0"}}})]})]})})]})}function JR(e){let{matterbridgeInfo:t}=e;return(0,dt.jsxs)("div",{className:"MbfWindowDiv",style:{flex:"0 0 auto"},children:[(0,dt.jsx)("div",{className:"MbfWindowHeader",children:(0,dt.jsx)("p",{className:"MbfWindowHeaderText",children:"Matterbridge info"})}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"10px",flex:"0 0 auto"},children:(0,dt.jsxs)(Uf,{sx:{gap:"10px",margin:"0px",padding:"10px",width:"400px",backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)"},children:[" ",(0,dt.jsx)(YR,{value:t.matterbridgeVersion,label:"Current Version"}),(0,dt.jsx)(YR,{value:t.matterbridgeLatestVersion,label:"Latest Version"}),(0,dt.jsx)(YR,{value:t.homeDirectory,label:"Home Directory"}),(0,dt.jsx)(YR,{value:t.rootDirectory,label:"Root Directory"}),(0,dt.jsx)(YR,{value:t.matterbridgeDirectory,label:"Matterbridge Storage Directory"}),(0,dt.jsx)(YR,{value:t.matterbridgePluginDirectory,label:"Matterbridge Plugin Directory"}),(0,dt.jsx)(YR,{value:t.globalModulesDirectory,label:"Global Module Directory"})]})})]})}function YR(e){let{value:t,label:r}=e;return(0,dt.jsx)(fv,{focused:!0,value:t,size:"small",label:r,variant:"standard",sx:{width:"400px"},InputProps:{readOnly:!0,sx:{color:"var(--div-text-color)","&:before":{borderBottomColor:"var(--main-label-color)"},"&:after":{borderBottomColor:"var(--main-label-color)"}}},InputLabelProps:{sx:{marginTop:"3px",color:"var(--main-label-color)","&.Mui-focused":{color:"var(--main-label-color)"}}}})}const XR=function(){const{online:t,addListener:r,removeListener:n,sendMessage:o}=(0,e.useContext)(Qh),[a,i]=(0,e.useState)(null),[s,l]=(0,e.useState)(null);return(0,e.useEffect)((()=>{const e=e=>{"Matterbridge"===e.src&&"Frontend"===e.dst&&("refresh_required"===e.method&&(tM&&console.log("Settings received refresh_required"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}})),"/api/settings"===e.method&&(tM&&console.log("Settings received /api/settings:",e.response),i(e.response.matterbridgeInformation),l(e.response.systemInformation)))};return r(e),tM&&console.log("Settings added WebSocket listener"),()=>{n(e),tM&&console.log("Settings removed WebSocket listener")}}),[r,n,o]),(0,e.useEffect)((()=>{t&&(tM&&console.log("Settings received online"),o({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}))}),[t,o]),a?(tM&&console.log("Settings rendering..."),t?(0,dt.jsx)("div",{className:"MbfPageDiv",children:(0,dt.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"20px",width:"100%"},children:[(0,dt.jsx)(KR,{matterbridgeInfo:a,systemInfo:s}),(0,dt.jsx)(QR,{matterbridgeInfo:a}),(0,dt.jsx)(JR,{matterbridgeInfo:a})]})}):(0,dt.jsx)(tm,{})):null};const ZR=function(){const{online:t,sendMessage:r,addListener:n,removeListener:o,getUniqueId:a}=(0,e.useContext)(Qh),{showSnackbarMessage:i}=(0,e.useContext)(Fh),[s,l]=(0,e.useState)(null),[c,u]=(0,e.useState)([]),[d,p]=(0,e.useState)([]),[f,h]=(0,e.useState)([]),[m,g]=(0,e.useState)(null),[v,y]=(0,e.useState)(null),[b,x]=(0,e.useState)(null),w=(0,e.useRef)(null);return w.current||(w.current=a(),tM&&console.log("Test uniqueId:",w)),(0,e.useEffect)((()=>{tM&&console.log("Test useEffect WebSocketMessage mounting");const e=e=>{if("Matterbridge"===e.src&&"Frontend"===e.dst){if("restart_required"===e.method&&(tM&&console.log("Test received restart_required"),i("Restart required",0)),"refresh_required"===e.method&&(tM&&console.log("Test received refresh_required"),i("Refresh required",0),r({id:w.current,method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({id:w.current,method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),r({id:w.current,method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}})),"memory_update"===e.method&&(tM&&console.log("Test received memory_update",e),y(e.params)),"cpu_update"===e.method&&(tM&&console.log("Test received cpu_update",e),g(e.params)),"uptime_update"===e.method&&(tM&&console.log("Test received uptime_update",e),x(e.params)),"/api/settings"===e.method&&e.response&&(tM&&console.log("Test received /api/settings:",e.response),i("Test received /api/settings"),l(e.response)),"/api/plugins"===e.method&&e.response&&(tM&&console.log(`Test received ${e.response.length} plugins:`,e.response),i("Test received /api/plugins"),u(e.response)),"/api/devices"===e.method&&e.response){tM&&console.log(`Test received ${e.response.length} devices:`,e.response),i("Test received /api/devices"),p(e.response);for(let t of e.response)tM&&console.log("Test sending /api/clusters for device:",t.pluginName,t.name,t.endpoint),r({method:"/api/clusters",src:"Frontend",dst:"Matterbridge",params:{plugin:t.pluginName,endpoint:t.endpoint}})}"/api/clusters"===e.method&&(tM&&console.log(`Test received ${e.response.length} clusters for device ${e.deviceName} endpoint ${e.endpoint}:`,e),i("Test received /api/clusters"),h(e.response))}else tM&&console.log("Test received WebSocketMessage:",e.method,e.src,e.dst,e.response)};return n(e),tM&&console.log("Test useEffect WebSocketMessage mounted"),()=>{tM&&console.log("Test useEffect WebSocketMessage unmounting"),o(e),tM&&console.log("Test useEffect WebSocketMessage unmounted")}}),[n,o,r,i]),(0,e.useEffect)((()=>(tM&&console.log("Test useEffect online mounting"),t&&(tM&&console.log("Test useEffect online received online"),r({method:"/api/settings",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/plugins",src:"Frontend",dst:"Matterbridge",params:{}}),r({method:"/api/devices",src:"Frontend",dst:"Matterbridge",params:{}}),i("Test useEffect online received online (info)",30,"info"),i("Test useEffect online received online (warning)",30,"warning"),i("Test useEffect online received online (error)",30,"error"),i("Test useEffect online received online (success)",30,"success")),tM&&console.log("Test useEffect online mounted"),()=>{tM&&console.log("Test useEffect online unmounted")})),[t,r,i]),tM&&console.log("Test rendering..."),t?(0,dt.jsx)("div",{className:"MbfPageDiv",style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"20px",width:"100%"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"256px",width:"256px",margin:"10px"}}),(0,dt.jsx)("p",{children:"Welcome to the Test page of the Matterbridge frontend"})]})}):(0,dt.jsx)(tm,{})};const eM=function(){var t,r;const[n,o]=(0,e.useState)(null!==(t=localStorage.getItem("logFilterLevel"))&&void 0!==t?t:"info"),[a,i]=(0,e.useState)(null!==(r=localStorage.getItem("logFilterSearch"))&&void 0!==r?r:"*"),[s,l]=(0,e.useState)("false"!==localStorage.getItem("logAutoScroll")),{setMessages:c,setLogFilters:u,online:d,setAutoScroll:p}=(0,e.useContext)(Qh);return tM&&console.log("Logs rendering..."),d?(0,dt.jsxs)("div",{className:"MbfPageDiv",children:[(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",margin:"0px",padding:"0px",gap:"10px"},children:[(0,dt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[(0,dt.jsx)($g,{id:"select-level",style:{color:"var(--div-text-color)"},children:"Filter log by level:"}),(0,dt.jsxs)(lv,{style:{height:"30px",backgroundColor:"var(--main-bg-color)"},labelId:"select-level",id:"debug-level",value:n,onChange:e=>{o(e.target.value),u(e.target.value,a),localStorage.setItem("logFilterLevel",e.target.value),tM&&console.log("handleChangeLevel called with value:",e.target.value)},children:[(0,dt.jsx)(tf,{value:"debug",children:"Debug"}),(0,dt.jsx)(tf,{value:"info",children:"Info"}),(0,dt.jsx)(tf,{value:"notice",children:"Notice"}),(0,dt.jsx)(tf,{value:"warn",children:"Warn"}),(0,dt.jsx)(tf,{value:"error",children:"Error"}),(0,dt.jsx)(tf,{value:"fatal",children:"Fatal"})]}),(0,dt.jsx)($g,{id:"search",style:{color:"var(--div-text-color)"},children:"Filter log by text:"}),(0,dt.jsx)(fv,{style:{width:"300px"},size:"small",id:"logsearch",variant:"outlined",value:a,onChange:e=>{i(e.target.value),u(n,e.target.value),localStorage.setItem("logFilterSearch",e.target.value),tM&&console.log("handleChangeSearch called with value:",e.target.value)},InputProps:{style:{height:"30px",padding:"0 0px",backgroundColor:"var(--main-bg-color)"}}}),(0,dt.jsx)(Mv,{control:(0,dt.jsx)(Kv,{checked:s,onChange:e=>{l(e.target.checked),p(e.target.checked),localStorage.setItem("logAutoScroll",e.target.value?"true":"false"),tM&&console.log("handleAutoScrollChange called with value:",e.target.checked)}}),label:"Auto scroll",style:{color:"var(--div-text-color)"}})]}),(0,dt.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:(0,dt.jsx)(Uu,{title:"Clear the logs",children:(0,dt.jsx)(Ah,{onClick:()=>{tM&&console.log("handleClearLogsClick called"),c([])},endIcon:(0,dt.jsx)(ty,{}),style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",height:"30px"},children:"Clear"})})})]}),(0,dt.jsx)("div",{style:{flex:"1",overflow:"auto",margin:"0px",padding:"0px"},children:(0,dt.jsx)(em,{})})]}):(0,dt.jsx)(tm,{})};var tM=!1;const rM=()=>{tM=!tM},nM=(0,e.createContext)();function oM(t){let{children:r}=t;const[n,o]=(0,e.useState)(!1),[a,i]=(0,e.useState)("");return(0,dt.jsx)(nM.Provider,{value:{loggedIn:n,logIn:async e=>{try{const t=await fetch("./api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok){const{valid:r}=await t.json();r?o(!0):""!==e&&i("Incorrect password!")}else console.error("Failed to log in:",t.statusText)}catch(t){console.error("Failed to log in:",t)}},errorMessage:a},children:r})}function aM(){const[t,r]=(0,e.useState)(""),{loggedIn:n,logIn:o,errorMessage:a}=(0,e.useContext)(nM),[i,s]=(0,e.useState)("#1976d2"),l=e=>{e.preventDefault(),o(t)},c={display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",backgroundColor:"var(--main-bg-color)"},u={display:"flex",flexDirection:"column",maxWidth:"400px",margin:"0 auto",padding:"20px",gap:"20px",border:"1px solid var(--div-border-color)",borderRadius:"var(--div-border-radius)",boxShadow:"2px 2px 5px var(--div-shadow-color)",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"},d={margin:"10px 0",padding:"3px 3px",fontSize:"14px",width:"230px",border:"1px solid var(--main-label-color)",color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)"};(0,e.useEffect)((()=>{tM&&console.log("Setting frontend theme");const e=localStorage.getItem("frontendTheme");tM&&console.log("Saved theme:",e),e?document.body.setAttribute("frontend-theme",e):document.body.setAttribute("frontend-theme","dark");const t=function(e,t){const r=getComputedStyle(document.body).getPropertyValue(e).trim();return r||console.error("getCssVariable: undefined",r),r||t}("--primary-color","#1976d2");tM&&console.log("Primary color from CSS:",t),s(t)}),[]);const p=window.location.pathname.includes("/matterbridge/")?"/matterbridge":window.location.href.includes("/api/hassio_ingress/")?window.location.pathname:"/";console.log(`Loading App.js with href="${window.location.href}" and pathname="${window.location.pathname}" >>> baseName="${p}"`);const f=function(e){return Ba({palette:{primary:{main:e},action:{disabled:"var(--main-label-color)"},text:{disabled:"var(--main-label-color)"}},components:{MuiTypography:{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},MuiDialog:{styleOverrides:{paper:{color:"var(--div-text-color)",backgroundColor:"var(--div-bg-color)",border:"2px solid var(--div-border-color)",borderRadius:"var(--div-border-radius)",boxShadow:"2px 2px 5px var(--div-shadow-color)"}}},MuiTooltip:{defaultProps:{placement:"top-start",arrow:!0}},MuiButton:{styleOverrides:{root:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)","&:hover":{backgroundColor:"var(--main-button-bg-color)"},"&.Mui-disabled":{color:"var(--main-button-color)",backgroundColor:"var(--main-grey-color)"}},contained:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},outlined:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)"},text:{color:"var(--main-button-color)"}},defaultProps:{variant:"contained",size:"small"}},MuiIconButton:{styleOverrides:{root:{color:"var(--main-icon-color)","&:hover .MuiSvgIcon-root":{color:"var(--primary-color)"}}}},MuiCheckbox:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-checked":{color:"var(--primary-color)"}}}},MuiTextField:{defaultProps:{size:"small",variant:"outlined",fullWidth:!0}},MuiOutlinedInput:{styleOverrides:{root:{backgroundColor:"var(--div-bg-color)","& .MuiOutlinedInput-notchedOutline":{borderColor:"var(--main-label-color)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"var(--main-text-color)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"var(--primary-color)"},padding:"0px"},input:{color:"var(--div-text-color)",padding:"4px 8px"}}},MuiInputLabel:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-focused":{color:"var(--primary-color)"}}}},MuiFormLabel:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-focused":{color:"var(--main-label-color)"}}}},MuiFormControl:{styleOverrides:{root:{color:"var(--main-grey-color)"}}},MuiRadio:{styleOverrides:{root:{color:"var(--main-label-color)","&.Mui-checked":{color:"var(--primary-color)"}}}},MuiSelect:{styleOverrides:{root:{backgroundColor:"var(--div-bg-color)",color:"var(--div-text-color)",height:"30px","&:hover":{borderColor:"var(--main-text-color)"},"&.Mui-focused":{borderColor:"var(--primary-color)"}}}},MuiMenu:{styleOverrides:{paper:{backgroundColor:"var(--main-menu-bg-color)",padding:"0px",margin:"0px"},list:{padding:"0px"}}},MuiMenuItem:{styleOverrides:{root:{color:"var(--main-menu-color)",backgroundColor:"var(--main-menu-bg-color)","&:hover":{backgroundColor:"var(--main-menu-hover-color)"},"&.Mui-selected":{color:"var(--main-menu-color)",backgroundColor:"var(--main-menu-bg-color)"},"&.Mui-selected:hover":{backgroundColor:"var(--main-menu-hover-color)"}}}},MuiListItemButton:{styleOverrides:{root:{cursor:"pointer","&:hover":{backgroundColor:"var(--main-bg-color)"}}}},MuiListItemIcon:{styleOverrides:{root:{color:"var(--div-text-color)"}}},MuiListItemText:{styleOverrides:{primary:{fontSize:"16px",fontWeight:"bold",color:"var(--div-text-color)"},secondary:{fontSize:"14px",fontWeight:"normal",color:"var(--div-text-color)"}}}}})}(i);return o(""),n?(0,dt.jsx)(Ga,{theme:f,children:(0,dt.jsx)(Os,{dense:!0,maxSnack:10,preventDuplicate:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:(0,dt.jsx)(zh,{children:(0,dt.jsx)(Jh,{children:(0,dt.jsx)(Xe,{basename:p,future:{v7_relativeSplatPath:!0,v7_startTransition:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0},children:(0,dt.jsxs)("div",{className:"MbfScreen",children:[(0,dt.jsx)(Yh,{}),(0,dt.jsxs)(ye,{children:[(0,dt.jsx)(ge,{path:"/",element:(0,dt.jsx)(gO,{})}),(0,dt.jsx)(ge,{path:"/devices",element:(0,dt.jsx)(vR,{})}),(0,dt.jsx)(ge,{path:"/log",element:(0,dt.jsx)(eM,{})}),(0,dt.jsx)(ge,{path:"/settings",element:(0,dt.jsx)(XR,{})}),(0,dt.jsx)(ge,{path:"/test",element:(0,dt.jsx)(ZR,{})}),(0,dt.jsx)(ge,{path:"*",element:(0,dt.jsx)(me,{to:"/"})})]})]})})})})})}):(0,dt.jsx)("div",{style:c,children:(0,dt.jsxs)("form",{onSubmit:l,style:u,children:[(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"20px"},children:[(0,dt.jsx)("img",{src:"matterbridge.svg",alt:"Matterbridge Logo",style:{height:"64px",width:"64px"}}),(0,dt.jsx)("h3",{style:{color:"var(--div-text-color)"},children:"Welcome to Matterbridge"})]}),(0,dt.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"20px"},children:[(0,dt.jsx)("input",{type:"password",value:t,onChange:e=>r(e.target.value),style:d,placeholder:"password",autocomplete:"current-password"}),(0,dt.jsx)("button",{type:"submit",style:{color:"var(--main-button-color)",backgroundColor:"var(--main-button-bg-color)",borderColor:"var(--div-bg-color)"},children:"Log in"})]}),(0,dt.jsx)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",margin:0,height:"30px"},children:a&&(0,dt.jsx)("p",{style:{color:"red"},children:a})})]})})}const iM=function(){return(0,dt.jsx)(oM,{children:(0,dt.jsx)(aM,{})})},sM=e=>{e&&e instanceof Function&&r.e(453).then(r.bind(r,6453)).then((t=>{let{getCLS:r,getFID:n,getFCP:o,getLCP:a,getTTFB:i}=t;r(e),n(e),o(e),a(e),i(e)}))};n.createRoot(document.getElementById("root")).render((0,dt.jsx)(e.StrictMode,{children:(0,dt.jsx)(iM,{})})),sM()})()})();
|
|
115
|
+
//# sourceMappingURL=main.e11d6bb4.js.map
|