@riddix/hamh 2.1.0-alpha.431 → 2.1.0-alpha.432

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.
@@ -251,7 +251,7 @@ export default theme;`}function MN(e){return typeof e=="number"?`${(e*100).toFix
251
251
  || ${T} === "boolean" || ${D} === null`).assign(I,(0,r._)`[${D}]`)}}}function h({gen:C,parentData:w,parentDataProperty:A},E){C.if((0,r._)`${w} !== undefined`,()=>C.assign((0,r._)`${w}[${A}]`,E))}function g(C,w,A,E=o.Correct){const D=E===o.Correct?r.operators.EQ:r.operators.NEQ;let O;switch(C){case"null":return(0,r._)`${w} ${D} null`;case"array":O=(0,r._)`Array.isArray(${w})`;break;case"object":O=(0,r._)`${w} && typeof ${w} == "object" && !Array.isArray(${w})`;break;case"integer":O=T((0,r._)`!(${w} % 1) && !isNaN(${w})`);break;case"number":O=T();break;default:return(0,r._)`typeof ${w} ${D} ${C}`}return E===o.Correct?O:(0,r.not)(O);function T(I=r.nil){return(0,r.and)((0,r._)`typeof ${w} == "number"`,I,A?(0,r._)`isFinite(${w})`:r.nil)}}uo.checkDataType=g;function y(C,w,A,E){if(C.length===1)return g(C[0],w,A,E);let D;const O=(0,i.toHash)(C);if(O.array&&O.object){const T=(0,r._)`typeof ${w} != "object"`;D=O.null?T:(0,r._)`!${w} || ${T}`,delete O.null,delete O.array,delete O.object}else D=r.nil;O.number&&delete O.integer;for(const T in O)D=(0,r.and)(D,g(T,w,A,E));return D}uo.checkDataTypes=y;const b={message:({schema:C})=>`must be ${C}`,params:({schema:C,schemaValue:w})=>typeof C=="string"?(0,r._)`{type: ${C}}`:(0,r._)`{type: ${w}}`};function v(C){const w=S(C);(0,n.reportError)(w,b)}uo.reportTypeError=v;function S(C){const{gen:w,data:A,schema:E}=C,D=(0,i.schemaRefOrVal)(C,E,"type");return{gen:w,keyword:"type",data:A,schema:E.type,schemaCode:D,schemaValue:D,parentSchema:E,params:{},it:C}}return uo}var S1={},MH;function zRe(){if(MH)return S1;MH=1,Object.defineProperty(S1,"__esModule",{value:!0}),S1.assignDefaults=void 0;const e=pn(),t=qn();function n(i,o){const{properties:s,items:a}=i.schema;if(o==="object"&&s)for(const l in s)r(i,l,s[l].default);else o==="array"&&Array.isArray(a)&&a.forEach((l,c)=>r(i,c,l.default))}S1.assignDefaults=n;function r(i,o,s){const{gen:a,compositeRule:l,data:c,opts:u}=i;if(s===void 0)return;const f=(0,e._)`${c}${(0,e.getProperty)(o)}`;if(l){(0,t.checkStrictMode)(i,`default is ignored for: ${f}`);return}let h=(0,e._)`${f} === undefined`;u.useDefaults==="empty"&&(h=(0,e._)`${h} || ${f} === null || ${f} === ""`),a.if(h,(0,e._)`${f} = ${(0,e.stringify)(s)}`)}return S1}var $a={},lr={},RH;function cl(){if(RH)return lr;RH=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.validateUnion=lr.validateArray=lr.usePattern=lr.callValidateCode=lr.schemaProperties=lr.allSchemaProperties=lr.noPropertyInData=lr.propertyInData=lr.isOwnProperty=lr.hasPropFunc=lr.reportMissingProp=lr.checkMissingProp=lr.checkReportMissingProp=void 0;const e=pn(),t=qn(),n=Sf(),r=qn();function i(C,w){const{gen:A,data:E,it:D}=C;A.if(u(A,E,w,D.opts.ownProperties),()=>{C.setParams({missingProperty:(0,e._)`${w}`},!0),C.error()})}lr.checkReportMissingProp=i;function o({gen:C,data:w,it:{opts:A}},E,D){return(0,e.or)(...E.map(O=>(0,e.and)(u(C,w,O,A.ownProperties),(0,e._)`${D} = ${O}`)))}lr.checkMissingProp=o;function s(C,w){C.setParams({missingProperty:w},!0),C.error()}lr.reportMissingProp=s;function a(C){return C.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}lr.hasPropFunc=a;function l(C,w,A){return(0,e._)`${a(C)}.call(${w}, ${A})`}lr.isOwnProperty=l;function c(C,w,A,E){const D=(0,e._)`${w}${(0,e.getProperty)(A)} !== undefined`;return E?(0,e._)`${D} && ${l(C,w,A)}`:D}lr.propertyInData=c;function u(C,w,A,E){const D=(0,e._)`${w}${(0,e.getProperty)(A)} === undefined`;return E?(0,e.or)(D,(0,e.not)(l(C,w,A))):D}lr.noPropertyInData=u;function f(C){return C?Object.keys(C).filter(w=>w!=="__proto__"):[]}lr.allSchemaProperties=f;function h(C,w){return f(w).filter(A=>!(0,t.alwaysValidSchema)(C,w[A]))}lr.schemaProperties=h;function g({schemaCode:C,data:w,it:{gen:A,topSchemaRef:E,schemaPath:D,errorPath:O},it:T},I,N,$){const R=$?(0,e._)`${C}, ${w}, ${E}${D}`:w,F=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,O)],[n.default.parentData,T.parentData],[n.default.parentDataProperty,T.parentDataProperty],[n.default.rootData,n.default.rootData]];T.opts.dynamicRef&&F.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const j=(0,e._)`${R}, ${A.object(...F)}`;return N!==e.nil?(0,e._)`${I}.call(${N}, ${j})`:(0,e._)`${I}(${j})`}lr.callValidateCode=g;const y=(0,e._)`new RegExp`;function b({gen:C,it:{opts:w}},A){const E=w.unicodeRegExp?"u":"",{regExp:D}=w.code,O=D(A,E);return C.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,e._)`${D.code==="new RegExp"?y:(0,r.useFunc)(C,D)}(${A}, ${E})`})}lr.usePattern=b;function v(C){const{gen:w,data:A,keyword:E,it:D}=C,O=w.name("valid");if(D.allErrors){const I=w.let("valid",!0);return T(()=>w.assign(I,!1)),I}return w.var(O,!0),T(()=>w.break()),O;function T(I){const N=w.const("len",(0,e._)`${A}.length`);w.forRange("i",0,N,$=>{C.subschema({keyword:E,dataProp:$,dataPropType:t.Type.Num},O),w.if((0,e.not)(O),I)})}}lr.validateArray=v;function S(C){const{gen:w,schema:A,keyword:E,it:D}=C;if(!Array.isArray(A))throw new Error("ajv implementation error");if(A.some(N=>(0,t.alwaysValidSchema)(D,N))&&!D.opts.unevaluated)return;const T=w.let("valid",!1),I=w.name("_valid");w.block(()=>A.forEach((N,$)=>{const R=C.subschema({keyword:E,schemaProp:$,compositeRule:!0},I);w.assign(T,(0,e._)`${T} || ${I}`),C.mergeValidEvaluated(R,I)||w.if((0,e.not)(T))})),C.result(T,()=>C.reset(),()=>C.error(!0))}return lr.validateUnion=S,lr}var IH;function HRe(){if(IH)return $a;IH=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.validateKeywordUsage=$a.validSchemaType=$a.funcKeywordCode=$a.macroKeywordCode=void 0;const e=pn(),t=Sf(),n=cl(),r=Ww();function i(h,g){const{gen:y,keyword:b,schema:v,parentSchema:S,it:C}=h,w=g.macro.call(C.self,v,S,C),A=c(y,b,w);C.opts.validateSchema!==!1&&C.self.validateSchema(w,!0);const E=y.name("valid");h.subschema({schema:w,schemaPath:e.nil,errSchemaPath:`${C.errSchemaPath}/${b}`,topSchemaRef:A,compositeRule:!0},E),h.pass(E,()=>h.error(!0))}$a.macroKeywordCode=i;function o(h,g){var y;const{gen:b,keyword:v,schema:S,parentSchema:C,$data:w,it:A}=h;l(A,g);const E=!w&&g.compile?g.compile.call(A.self,S,C,A):g.validate,D=c(b,v,E),O=b.let("valid");h.block$data(O,T),h.ok((y=g.valid)!==null&&y!==void 0?y:O);function T(){if(g.errors===!1)$(),g.modifying&&s(h),R(()=>h.error());else{const F=g.async?I():N();g.modifying&&s(h),R(()=>a(h,F))}}function I(){const F=b.let("ruleErrs",null);return b.try(()=>$((0,e._)`await `),j=>b.assign(O,!1).if((0,e._)`${j} instanceof ${A.ValidationError}`,()=>b.assign(F,(0,e._)`${j}.errors`),()=>b.throw(j))),F}function N(){const F=(0,e._)`${D}.errors`;return b.assign(F,null),$(e.nil),F}function $(F=g.async?(0,e._)`await `:e.nil){const j=A.opts.passContext?t.default.this:t.default.self,z=!("compile"in g&&!w||g.schema===!1);b.assign(O,(0,e._)`${F}${(0,n.callValidateCode)(h,D,j,z)}`,g.modifying)}function R(F){var j;b.if((0,e.not)((j=g.valid)!==null&&j!==void 0?j:O),F)}}$a.funcKeywordCode=o;function s(h){const{gen:g,data:y,it:b}=h;g.if(b.parentData,()=>g.assign(y,(0,e._)`${b.parentData}[${b.parentDataProperty}]`))}function a(h,g){const{gen:y}=h;y.if((0,e._)`Array.isArray(${g})`,()=>{y.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(h)},()=>h.error())}function l({schemaEnv:h},g){if(g.async&&!h.$async)throw new Error("async keyword in sync schema")}function c(h,g,y){if(y===void 0)throw new Error(`keyword "${g}" failed to compile`);return h.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}function u(h,g,y=!1){return!g.length||g.some(b=>b==="array"?Array.isArray(h):b==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==b||y&&typeof h>"u")}$a.validSchemaType=u;function f({schema:h,opts:g,self:y,errSchemaPath:b},v,S){if(Array.isArray(v.keyword)?!v.keyword.includes(S):v.keyword!==S)throw new Error("ajv implementation error");const C=v.dependencies;if(C?.some(w=>!Object.prototype.hasOwnProperty.call(h,w)))throw new Error(`parent schema must have dependencies of ${S}: ${C.join(",")}`);if(v.validateSchema&&!v.validateSchema(h[S])){const A=`keyword "${S}" value is invalid at path "${b}": `+y.errorsText(v.validateSchema.errors);if(g.validateSchema==="log")y.logger.error(A);else throw new Error(A)}}return $a.validateKeywordUsage=f,$a}var Yc={},PH;function URe(){if(PH)return Yc;PH=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.extendSubschemaMode=Yc.extendSubschemaData=Yc.getSubschema=void 0;const e=pn(),t=qn();function n(o,{keyword:s,schemaProp:a,schema:l,schemaPath:c,errSchemaPath:u,topSchemaRef:f}){if(s!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){const h=o.schema[s];return a===void 0?{schema:h,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${o.errSchemaPath}/${s}`}:{schema:h[a],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(s)}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${s}/${(0,t.escapeFragment)(a)}`}}if(l!==void 0){if(c===void 0||u===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:c,topSchemaRef:f,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}Yc.getSubschema=n;function r(o,s,{dataProp:a,dataPropType:l,data:c,dataTypes:u,propertyName:f}){if(c!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=s;if(a!==void 0){const{errorPath:y,dataPathArr:b,opts:v}=s,S=h.let("data",(0,e._)`${s.data}${(0,e.getProperty)(a)}`,!0);g(S),o.errorPath=(0,e.str)`${y}${(0,t.getErrorPath)(a,l,v.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${a}`,o.dataPathArr=[...b,o.parentDataProperty]}if(c!==void 0){const y=c instanceof e.Name?c:h.let("data",c,!0);g(y),f!==void 0&&(o.propertyName=f)}u&&(o.dataTypes=u);function g(y){o.data=y,o.dataLevel=s.dataLevel+1,o.dataTypes=[],s.definedProperties=new Set,o.parentData=s.data,o.dataNames=[...s.dataNames,y]}}Yc.extendSubschemaData=r;function i(o,{jtdDiscriminator:s,jtdMetadata:a,compositeRule:l,createErrors:c,allErrors:u}){l!==void 0&&(o.compositeRule=l),c!==void 0&&(o.createErrors=c),u!==void 0&&(o.allErrors=u),o.jtdDiscriminator=s,o.jtdMetadata=a}return Yc.extendSubschemaMode=i,Yc}var To={},EE,jH;function SM(){return jH||(jH=1,EE=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n}),EE}var AE={exports:{}},$H;function VRe(){if($H)return AE.exports;$H=1;var e=AE.exports=function(r,i,o){typeof i=="function"&&(o=i,i={}),o=i.cb||o;var s=typeof o=="function"?o:o.pre||function(){},a=o.post||function(){};t(i,s,a,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,i,o,s,a,l,c,u,f,h){if(s&&typeof s=="object"&&!Array.isArray(s)){i(s,a,l,c,u,f,h);for(var g in s){var y=s[g];if(Array.isArray(y)){if(g in e.arrayKeywords)for(var b=0;b<y.length;b++)t(r,i,o,y[b],a+"/"+g+"/"+b,l,a,g,s,b)}else if(g in e.propsKeywords){if(y&&typeof y=="object")for(var v in y)t(r,i,o,y[v],a+"/"+g+"/"+n(v),l,a,g,s,v)}else(g in e.keywords||r.allKeys&&!(g in e.skipKeywords))&&t(r,i,o,y,a+"/"+g,l,a,g,s)}o(s,a,l,c,u,f,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return AE.exports}var LH;function qw(){if(LH)return To;LH=1,Object.defineProperty(To,"__esModule",{value:!0}),To.getSchemaRefs=To.resolveUrl=To.normalizeId=To._getFullPath=To.getFullPath=To.inlineRef=void 0;const e=qn(),t=SM(),n=VRe(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(b,v=!0){return typeof b=="boolean"?!0:v===!0?!s(b):v?a(b)<=v:!1}To.inlineRef=i;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(b){for(const v in b){if(o.has(v))return!0;const S=b[v];if(Array.isArray(S)&&S.some(s)||typeof S=="object"&&s(S))return!0}return!1}function a(b){let v=0;for(const S in b){if(S==="$ref")return 1/0;if(v++,!r.has(S)&&(typeof b[S]=="object"&&(0,e.eachItem)(b[S],C=>v+=a(C)),v===1/0))return 1/0}return v}function l(b,v="",S){S!==!1&&(v=f(v));const C=b.parse(v);return c(b,C)}To.getFullPath=l;function c(b,v){return b.serialize(v).split("#")[0]+"#"}To._getFullPath=c;const u=/#\/?$/;function f(b){return b?b.replace(u,""):""}To.normalizeId=f;function h(b,v,S){return S=f(S),b.resolve(v,S)}To.resolveUrl=h;const g=/^[a-z_][-a-z0-9._]*$/i;function y(b,v){if(typeof b=="boolean")return{};const{schemaId:S,uriResolver:C}=this.opts,w=f(b[S]||v),A={"":w},E=l(C,w,!1),D={},O=new Set;return n(b,{allKeys:!0},(N,$,R,F)=>{if(F===void 0)return;const j=E+$;let z=A[F];typeof N[S]=="string"&&(z=L.call(this,N[S])),q.call(this,N.$anchor),q.call(this,N.$dynamicAnchor),A[$]=z;function L(V){const U=this.opts.uriResolver.resolve;if(V=f(z?U(z,V):V),O.has(V))throw I(V);O.add(V);let K=this.refs[V];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?T(N,K.schema,V):V!==f(j)&&(V[0]==="#"?(T(N,D[V],V),D[V]=N):this.refs[V]=j),V}function q(V){if(typeof V=="string"){if(!g.test(V))throw new Error(`invalid anchor "${V}"`);L.call(this,`#${V}`)}}}),D;function T(N,$,R){if($!==void 0&&!t(N,$))throw I(R)}function I(N){return new Error(`reference "${N}" resolves to more than one schema`)}}return To.getSchemaRefs=y,To}var NH;function Gw(){if(NH)return Gc;NH=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.getData=Gc.KeywordCxt=Gc.validateFunctionCode=void 0;const e=BRe(),t=c6(),n=Eee(),r=c6(),i=zRe(),o=HRe(),s=URe(),a=pn(),l=Sf(),c=qw(),u=qn(),f=Ww();function h(te){if(E(te)&&(O(te),A(te))){v(te);return}g(te,()=>(0,e.topBoolOrEmptySchema)(te))}Gc.validateFunctionCode=h;function g({gen:te,validateName:Z,schema:re,schemaEnv:oe,opts:fe},be){fe.code.es5?te.func(Z,(0,a._)`${l.default.data}, ${l.default.valCxt}`,oe.$async,()=>{te.code((0,a._)`"use strict"; ${C(re,fe)}`),b(te,fe),te.code(be)}):te.func(Z,(0,a._)`${l.default.data}, ${y(fe)}`,oe.$async,()=>te.code(C(re,fe)).code(be))}function y(te){return(0,a._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${te.dynamicRef?(0,a._)`, ${l.default.dynamicAnchors}={}`:a.nil}}={}`}function b(te,Z){te.if(l.default.valCxt,()=>{te.var(l.default.instancePath,(0,a._)`${l.default.valCxt}.${l.default.instancePath}`),te.var(l.default.parentData,(0,a._)`${l.default.valCxt}.${l.default.parentData}`),te.var(l.default.parentDataProperty,(0,a._)`${l.default.valCxt}.${l.default.parentDataProperty}`),te.var(l.default.rootData,(0,a._)`${l.default.valCxt}.${l.default.rootData}`),Z.dynamicRef&&te.var(l.default.dynamicAnchors,(0,a._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{te.var(l.default.instancePath,(0,a._)`""`),te.var(l.default.parentData,(0,a._)`undefined`),te.var(l.default.parentDataProperty,(0,a._)`undefined`),te.var(l.default.rootData,l.default.data),Z.dynamicRef&&te.var(l.default.dynamicAnchors,(0,a._)`{}`)})}function v(te){const{schema:Z,opts:re,gen:oe}=te;g(te,()=>{re.$comment&&Z.$comment&&F(te),N(te),oe.let(l.default.vErrors,null),oe.let(l.default.errors,0),re.unevaluated&&S(te),T(te),j(te)})}function S(te){const{gen:Z,validateName:re}=te;te.evaluated=Z.const("evaluated",(0,a._)`${re}.evaluated`),Z.if((0,a._)`${te.evaluated}.dynamicProps`,()=>Z.assign((0,a._)`${te.evaluated}.props`,(0,a._)`undefined`)),Z.if((0,a._)`${te.evaluated}.dynamicItems`,()=>Z.assign((0,a._)`${te.evaluated}.items`,(0,a._)`undefined`))}function C(te,Z){const re=typeof te=="object"&&te[Z.schemaId];return re&&(Z.code.source||Z.code.process)?(0,a._)`/*# sourceURL=${re} */`:a.nil}function w(te,Z){if(E(te)&&(O(te),A(te))){D(te,Z);return}(0,e.boolOrEmptySchema)(te,Z)}function A({schema:te,self:Z}){if(typeof te=="boolean")return!te;for(const re in te)if(Z.RULES.all[re])return!0;return!1}function E(te){return typeof te.schema!="boolean"}function D(te,Z){const{schema:re,gen:oe,opts:fe}=te;fe.$comment&&re.$comment&&F(te),$(te),R(te);const be=oe.const("_errs",l.default.errors);T(te,be),oe.var(Z,(0,a._)`${be} === ${l.default.errors}`)}function O(te){(0,u.checkUnknownRules)(te),I(te)}function T(te,Z){if(te.opts.jtd)return L(te,[],!1,Z);const re=(0,t.getSchemaTypes)(te.schema),oe=(0,t.coerceAndCheckDataType)(te,re);L(te,re,!oe,Z)}function I(te){const{schema:Z,errSchemaPath:re,opts:oe,self:fe}=te;Z.$ref&&oe.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(Z,fe.RULES)&&fe.logger.warn(`$ref: keywords ignored in schema at path "${re}"`)}function N(te){const{schema:Z,opts:re}=te;Z.default!==void 0&&re.useDefaults&&re.strictSchema&&(0,u.checkStrictMode)(te,"default is ignored in the schema root")}function $(te){const Z=te.schema[te.opts.schemaId];Z&&(te.baseId=(0,c.resolveUrl)(te.opts.uriResolver,te.baseId,Z))}function R(te){if(te.schema.$async&&!te.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:te,schemaEnv:Z,schema:re,errSchemaPath:oe,opts:fe}){const be=re.$comment;if(fe.$comment===!0)te.code((0,a._)`${l.default.self}.logger.log(${be})`);else if(typeof fe.$comment=="function"){const De=(0,a.str)`${oe}/$comment`,Oe=te.scopeValue("root",{ref:Z.root});te.code((0,a._)`${l.default.self}.opts.$comment(${be}, ${De}, ${Oe}.schema)`)}}function j(te){const{gen:Z,schemaEnv:re,validateName:oe,ValidationError:fe,opts:be}=te;re.$async?Z.if((0,a._)`${l.default.errors} === 0`,()=>Z.return(l.default.data),()=>Z.throw((0,a._)`new ${fe}(${l.default.vErrors})`)):(Z.assign((0,a._)`${oe}.errors`,l.default.vErrors),be.unevaluated&&z(te),Z.return((0,a._)`${l.default.errors} === 0`))}function z({gen:te,evaluated:Z,props:re,items:oe}){re instanceof a.Name&&te.assign((0,a._)`${Z}.props`,re),oe instanceof a.Name&&te.assign((0,a._)`${Z}.items`,oe)}function L(te,Z,re,oe){const{gen:fe,schema:be,data:De,allErrors:Oe,opts:Ke,self:xe}=te,{RULES:Le}=xe;if(be.$ref&&(Ke.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(be,Le))){fe.block(()=>ne(te,"$ref",Le.all.$ref.definition));return}Ke.jtd||V(te,Z),fe.block(()=>{for(const ht of Le.rules)Me(ht);Me(Le.post)});function Me(ht){(0,n.shouldUseGroup)(be,ht)&&(ht.type?(fe.if((0,r.checkDataType)(ht.type,De,Ke.strictNumbers)),q(te,ht),Z.length===1&&Z[0]===ht.type&&re&&(fe.else(),(0,r.reportTypeError)(te)),fe.endIf()):q(te,ht),Oe||fe.if((0,a._)`${l.default.errors} === ${oe||0}`))}}function q(te,Z){const{gen:re,schema:oe,opts:{useDefaults:fe}}=te;fe&&(0,i.assignDefaults)(te,Z.type),re.block(()=>{for(const be of Z.rules)(0,n.shouldUseRule)(oe,be)&&ne(te,be.keyword,be.definition,Z.type)})}function V(te,Z){te.schemaEnv.meta||!te.opts.strictTypes||(U(te,Z),te.opts.allowUnionTypes||K(te,Z),B(te,te.dataTypes))}function U(te,Z){if(Z.length){if(!te.dataTypes.length){te.dataTypes=Z;return}Z.forEach(re=>{X(te.dataTypes,re)||Y(te,`type "${re}" not allowed by context "${te.dataTypes.join(",")}"`)}),H(te,Z)}}function K(te,Z){Z.length>1&&!(Z.length===2&&Z.includes("null"))&&Y(te,"use allowUnionTypes to allow union type keyword")}function B(te,Z){const re=te.self.RULES.all;for(const oe in re){const fe=re[oe];if(typeof fe=="object"&&(0,n.shouldUseRule)(te.schema,fe)){const{type:be}=fe.definition;be.length&&!be.some(De=>W(Z,De))&&Y(te,`missing type "${be.join(",")}" for keyword "${oe}"`)}}}function W(te,Z){return te.includes(Z)||Z==="number"&&te.includes("integer")}function X(te,Z){return te.includes(Z)||Z==="integer"&&te.includes("number")}function H(te,Z){const re=[];for(const oe of te.dataTypes)X(Z,oe)?re.push(oe):Z.includes("integer")&&oe==="number"&&re.push("integer");te.dataTypes=re}function Y(te,Z){const re=te.schemaEnv.baseId+te.errSchemaPath;Z+=` at "${re}" (strictTypes)`,(0,u.checkStrictMode)(te,Z,te.opts.strictTypes)}class J{constructor(Z,re,oe){if((0,o.validateKeywordUsage)(Z,re,oe),this.gen=Z.gen,this.allErrors=Z.allErrors,this.keyword=oe,this.data=Z.data,this.schema=Z.schema[oe],this.$data=re.$data&&Z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(Z,this.schema,oe,this.$data),this.schemaType=re.schemaType,this.parentSchema=Z.schema,this.params={},this.it=Z,this.def=re,this.$data)this.schemaCode=Z.gen.const("vSchema",ue(this.$data,Z));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,re.schemaType,re.allowUndefined))throw new Error(`${oe} value must be ${JSON.stringify(re.schemaType)}`);("code"in re?re.trackErrors:re.errors!==!1)&&(this.errsCount=Z.gen.const("_errs",l.default.errors))}result(Z,re,oe){this.failResult((0,a.not)(Z),re,oe)}failResult(Z,re,oe){this.gen.if(Z),oe?oe():this.error(),re?(this.gen.else(),re(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(Z,re){this.failResult((0,a.not)(Z),void 0,re)}fail(Z){if(Z===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(Z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(Z){if(!this.$data)return this.fail(Z);const{schemaCode:re}=this;this.fail((0,a._)`${re} !== undefined && (${(0,a.or)(this.invalid$data(),Z)})`)}error(Z,re,oe){if(re){this.setParams(re),this._error(Z,oe),this.setParams({});return}this._error(Z,oe)}_error(Z,re){(Z?f.reportExtraError:f.reportError)(this,this.def.error,re)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(Z){this.allErrors||this.gen.if(Z)}setParams(Z,re){re?Object.assign(this.params,Z):this.params=Z}block$data(Z,re,oe=a.nil){this.gen.block(()=>{this.check$data(Z,oe),re()})}check$data(Z=a.nil,re=a.nil){if(!this.$data)return;const{gen:oe,schemaCode:fe,schemaType:be,def:De}=this;oe.if((0,a.or)((0,a._)`${fe} === undefined`,re)),Z!==a.nil&&oe.assign(Z,!0),(be.length||De.validateSchema)&&(oe.elseIf(this.invalid$data()),this.$dataError(),Z!==a.nil&&oe.assign(Z,!1)),oe.else()}invalid$data(){const{gen:Z,schemaCode:re,schemaType:oe,def:fe,it:be}=this;return(0,a.or)(De(),Oe());function De(){if(oe.length){if(!(re instanceof a.Name))throw new Error("ajv implementation error");const Ke=Array.isArray(oe)?oe:[oe];return(0,a._)`${(0,r.checkDataTypes)(Ke,re,be.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function Oe(){if(fe.validateSchema){const Ke=Z.scopeValue("validate$data",{ref:fe.validateSchema});return(0,a._)`!${Ke}(${re})`}return a.nil}}subschema(Z,re){const oe=(0,s.getSubschema)(this.it,Z);(0,s.extendSubschemaData)(oe,this.it,Z),(0,s.extendSubschemaMode)(oe,Z);const fe={...this.it,...oe,items:void 0,props:void 0};return w(fe,re),fe}mergeEvaluated(Z,re){const{it:oe,gen:fe}=this;oe.opts.unevaluated&&(oe.props!==!0&&Z.props!==void 0&&(oe.props=u.mergeEvaluated.props(fe,Z.props,oe.props,re)),oe.items!==!0&&Z.items!==void 0&&(oe.items=u.mergeEvaluated.items(fe,Z.items,oe.items,re)))}mergeValidEvaluated(Z,re){const{it:oe,gen:fe}=this;if(oe.opts.unevaluated&&(oe.props!==!0||oe.items!==!0))return fe.if(re,()=>this.mergeEvaluated(Z,a.Name)),!0}}Gc.KeywordCxt=J;function ne(te,Z,re,oe){const fe=new J(te,re,Z);"code"in re?re.code(fe,oe):fe.$data&&re.validate?(0,o.funcKeywordCode)(fe,re):"macro"in re?(0,o.macroKeywordCode)(fe,re):(re.compile||re.validate)&&(0,o.funcKeywordCode)(fe,re)}const ee=/^\/(?:[^~]|~0|~1)*$/,se=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ue(te,{dataLevel:Z,dataNames:re,dataPathArr:oe}){let fe,be;if(te==="")return l.default.rootData;if(te[0]==="/"){if(!ee.test(te))throw new Error(`Invalid JSON-pointer: ${te}`);fe=te,be=l.default.rootData}else{const xe=se.exec(te);if(!xe)throw new Error(`Invalid JSON-pointer: ${te}`);const Le=+xe[1];if(fe=xe[2],fe==="#"){if(Le>=Z)throw new Error(Ke("property/index",Le));return oe[Z-Le]}if(Le>Z)throw new Error(Ke("data",Le));if(be=re[Z-Le],!fe)return be}let De=be;const Oe=fe.split("/");for(const xe of Oe)xe&&(be=(0,a._)`${be}${(0,a.getProperty)((0,u.unescapeJsonPointer)(xe))}`,De=(0,a._)`${De} && ${be}`);return De;function Ke(xe,Le){return`Cannot access ${xe} ${Le} levels up, current level is ${Z}`}}return Gc.getData=ue,Gc}var Hx={},FH;function wM(){if(FH)return Hx;FH=1,Object.defineProperty(Hx,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Hx.default=e,Hx}var Ux={},BH;function Kw(){if(BH)return Ux;BH=1,Object.defineProperty(Ux,"__esModule",{value:!0});const e=qw();class t extends Error{constructor(r,i,o,s){super(s||`can't resolve reference ${o} from id ${i}`),this.missingRef=(0,e.resolveUrl)(r,i,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Ux.default=t,Ux}var Ss={},zH;function CM(){if(zH)return Ss;zH=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.resolveSchema=Ss.getCompilingSchema=Ss.resolveRef=Ss.compileSchema=Ss.SchemaEnv=void 0;const e=pn(),t=wM(),n=Sf(),r=qw(),i=qn(),o=Gw();class s{constructor(S){var C;this.refs={},this.dynamicAnchors={};let w;typeof S.schema=="object"&&(w=S.schema),this.schema=S.schema,this.schemaId=S.schemaId,this.root=S.root||this,this.baseId=(C=S.baseId)!==null&&C!==void 0?C:(0,r.normalizeId)(w?.[S.schemaId||"$id"]),this.schemaPath=S.schemaPath,this.localRefs=S.localRefs,this.meta=S.meta,this.$async=w?.$async,this.refs={}}}Ss.SchemaEnv=s;function a(v){const S=u.call(this,v);if(S)return S;const C=(0,r.getFullPath)(this.opts.uriResolver,v.root.baseId),{es5:w,lines:A}=this.opts.code,{ownProperties:E}=this.opts,D=new e.CodeGen(this.scope,{es5:w,lines:A,ownProperties:E});let O;v.$async&&(O=D.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const T=D.scopeName("validate");v.validateName=T;const I={gen:D,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:D.scopeValue("schema",this.opts.code.source===!0?{ref:v.schema,code:(0,e.stringify)(v.schema)}:{ref:v.schema}),validateName:T,ValidationError:O,schema:v.schema,schemaEnv:v,rootId:C,baseId:v.baseId||C,schemaPath:e.nil,errSchemaPath:v.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let N;try{this._compilations.add(v),(0,o.validateFunctionCode)(I),D.optimize(this.opts.code.optimize);const $=D.toString();N=`${D.scopeRefs(n.default.scope)}return ${$}`,this.opts.code.process&&(N=this.opts.code.process(N,v));const F=new Function(`${n.default.self}`,`${n.default.scope}`,N)(this,this.scope.get());if(this.scope.value(T,{ref:F}),F.errors=null,F.schema=v.schema,F.schemaEnv=v,v.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:T,validateCode:$,scopeValues:D._values}),this.opts.unevaluated){const{props:j,items:z}=I;F.evaluated={props:j instanceof e.Name?void 0:j,items:z instanceof e.Name?void 0:z,dynamicProps:j instanceof e.Name,dynamicItems:z instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return v.validate=F,v}catch($){throw delete v.validate,delete v.validateName,N&&this.logger.error("Error compiling schema, function code:",N),$}finally{this._compilations.delete(v)}}Ss.compileSchema=a;function l(v,S,C){var w;C=(0,r.resolveUrl)(this.opts.uriResolver,S,C);const A=v.refs[C];if(A)return A;let E=h.call(this,v,C);if(E===void 0){const D=(w=v.localRefs)===null||w===void 0?void 0:w[C],{schemaId:O}=this.opts;D&&(E=new s({schema:D,schemaId:O,root:v,baseId:S}))}if(E!==void 0)return v.refs[C]=c.call(this,E)}Ss.resolveRef=l;function c(v){return(0,r.inlineRef)(v.schema,this.opts.inlineRefs)?v.schema:v.validate?v:a.call(this,v)}function u(v){for(const S of this._compilations)if(f(S,v))return S}Ss.getCompilingSchema=u;function f(v,S){return v.schema===S.schema&&v.root===S.root&&v.baseId===S.baseId}function h(v,S){let C;for(;typeof(C=this.refs[S])=="string";)S=C;return C||this.schemas[S]||g.call(this,v,S)}function g(v,S){const C=this.opts.uriResolver.parse(S),w=(0,r._getFullPath)(this.opts.uriResolver,C);let A=(0,r.getFullPath)(this.opts.uriResolver,v.baseId,void 0);if(Object.keys(v.schema).length>0&&w===A)return b.call(this,C,v);const E=(0,r.normalizeId)(w),D=this.refs[E]||this.schemas[E];if(typeof D=="string"){const O=g.call(this,v,D);return typeof O?.schema!="object"?void 0:b.call(this,C,O)}if(typeof D?.schema=="object"){if(D.validate||a.call(this,D),E===(0,r.normalizeId)(S)){const{schema:O}=D,{schemaId:T}=this.opts,I=O[T];return I&&(A=(0,r.resolveUrl)(this.opts.uriResolver,A,I)),new s({schema:O,schemaId:T,root:v,baseId:A})}return b.call(this,C,D)}}Ss.resolveSchema=g;const y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function b(v,{baseId:S,schema:C,root:w}){var A;if(((A=v.fragment)===null||A===void 0?void 0:A[0])!=="/")return;for(const O of v.fragment.slice(1).split("/")){if(typeof C=="boolean")return;const T=C[(0,i.unescapeFragment)(O)];if(T===void 0)return;C=T;const I=typeof C=="object"&&C[this.opts.schemaId];!y.has(O)&&I&&(S=(0,r.resolveUrl)(this.opts.uriResolver,S,I))}let E;if(typeof C!="boolean"&&C.$ref&&!(0,i.schemaHasRulesButRef)(C,this.RULES)){const O=(0,r.resolveUrl)(this.opts.uriResolver,S,C.$ref);E=g.call(this,w,O)}const{schemaId:D}=this.opts;if(E=E||new s({schema:C,schemaId:D,root:w,baseId:S}),E.schema!==E.root.schema)return E}return Ss}const WRe="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",qRe="Meta-schema for $data reference (JSON AnySchema extension proposal)",GRe="object",KRe=["$data"],YRe={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},XRe=!1,ZRe={$id:WRe,description:qRe,type:GRe,required:KRe,properties:YRe,additionalProperties:XRe};var Vx={},HH;function JRe(){if(HH)return Vx;HH=1,Object.defineProperty(Vx,"__esModule",{value:!0});const e=AQ();return e.code='require("ajv/dist/runtime/uri").default',Vx.default=e,Vx}var UH;function QRe(){return UH||(UH=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Gw();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=pn();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=wM(),i=Kw(),o=Cee(),s=CM(),a=pn(),l=qw(),c=c6(),u=qn(),f=ZRe,h=JRe(),g=(K,B)=>new RegExp(K,B);g.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},S={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},C=200;function w(K){var B,W,X,H,Y,J,ne,ee,se,ue,te,Z,re,oe,fe,be,De,Oe,Ke,xe,Le,Me,ht,mt,ze;const Pe=K.strict,He=(B=K.code)===null||B===void 0?void 0:B.optimize,Je=He===!0||He===void 0?1:He||0,nt=(X=(W=K.code)===null||W===void 0?void 0:W.regExp)!==null&&X!==void 0?X:g,ot=(H=K.uriResolver)!==null&&H!==void 0?H:h.default;return{strictSchema:(J=(Y=K.strictSchema)!==null&&Y!==void 0?Y:Pe)!==null&&J!==void 0?J:!0,strictNumbers:(ee=(ne=K.strictNumbers)!==null&&ne!==void 0?ne:Pe)!==null&&ee!==void 0?ee:!0,strictTypes:(ue=(se=K.strictTypes)!==null&&se!==void 0?se:Pe)!==null&&ue!==void 0?ue:"log",strictTuples:(Z=(te=K.strictTuples)!==null&&te!==void 0?te:Pe)!==null&&Z!==void 0?Z:"log",strictRequired:(oe=(re=K.strictRequired)!==null&&re!==void 0?re:Pe)!==null&&oe!==void 0?oe:!1,code:K.code?{...K.code,optimize:Je,regExp:nt}:{optimize:Je,regExp:nt},loopRequired:(fe=K.loopRequired)!==null&&fe!==void 0?fe:C,loopEnum:(be=K.loopEnum)!==null&&be!==void 0?be:C,meta:(De=K.meta)!==null&&De!==void 0?De:!0,messages:(Oe=K.messages)!==null&&Oe!==void 0?Oe:!0,inlineRefs:(Ke=K.inlineRefs)!==null&&Ke!==void 0?Ke:!0,schemaId:(xe=K.schemaId)!==null&&xe!==void 0?xe:"$id",addUsedSchema:(Le=K.addUsedSchema)!==null&&Le!==void 0?Le:!0,validateSchema:(Me=K.validateSchema)!==null&&Me!==void 0?Me:!0,validateFormats:(ht=K.validateFormats)!==null&&ht!==void 0?ht:!0,unicodeRegExp:(mt=K.unicodeRegExp)!==null&&mt!==void 0?mt:!0,int32range:(ze=K.int32range)!==null&&ze!==void 0?ze:!0,uriResolver:ot}}class A{constructor(B={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,B=this.opts={...B,...w(B)};const{es5:W,lines:X}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:b,es5:W,lines:X}),this.logger=R(B.logger);const H=B.validateFormats;B.validateFormats=!1,this.RULES=(0,o.getRules)(),E.call(this,v,B,"NOT SUPPORTED"),E.call(this,S,B,"DEPRECATED","warn"),this._metaOpts=N.call(this),B.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),B.keywords&&I.call(this,B.keywords),typeof B.meta=="object"&&this.addMetaSchema(B.meta),O.call(this),B.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:B,meta:W,schemaId:X}=this.opts;let H=f;X==="id"&&(H={...f},H.id=H.$id,delete H.$id),W&&B&&this.addMetaSchema(H,H[X],!1)}defaultMeta(){const{meta:B,schemaId:W}=this.opts;return this.opts.defaultMeta=typeof B=="object"?B[W]||B:void 0}validate(B,W){let X;if(typeof B=="string"){if(X=this.getSchema(B),!X)throw new Error(`no schema with key or ref "${B}"`)}else X=this.compile(B);const H=X(W);return"$async"in X||(this.errors=X.errors),H}compile(B,W){const X=this._addSchema(B,W);return X.validate||this._compileSchemaEnv(X)}compileAsync(B,W){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:X}=this.opts;return H.call(this,B,W);async function H(ue,te){await Y.call(this,ue.$schema);const Z=this._addSchema(ue,te);return Z.validate||J.call(this,Z)}async function Y(ue){ue&&!this.getSchema(ue)&&await H.call(this,{$ref:ue},!0)}async function J(ue){try{return this._compileSchemaEnv(ue)}catch(te){if(!(te instanceof i.default))throw te;return ne.call(this,te),await ee.call(this,te.missingSchema),J.call(this,ue)}}function ne({missingSchema:ue,missingRef:te}){if(this.refs[ue])throw new Error(`AnySchema ${ue} is loaded but ${te} cannot be resolved`)}async function ee(ue){const te=await se.call(this,ue);this.refs[ue]||await Y.call(this,te.$schema),this.refs[ue]||this.addSchema(te,ue,W)}async function se(ue){const te=this._loading[ue];if(te)return te;try{return await(this._loading[ue]=X(ue))}finally{delete this._loading[ue]}}}addSchema(B,W,X,H=this.opts.validateSchema){if(Array.isArray(B)){for(const J of B)this.addSchema(J,void 0,X,H);return this}let Y;if(typeof B=="object"){const{schemaId:J}=this.opts;if(Y=B[J],Y!==void 0&&typeof Y!="string")throw new Error(`schema ${J} must be string`)}return W=(0,l.normalizeId)(W||Y),this._checkUnique(W),this.schemas[W]=this._addSchema(B,X,W,H,!0),this}addMetaSchema(B,W,X=this.opts.validateSchema){return this.addSchema(B,W,!0,X),this}validateSchema(B,W){if(typeof B=="boolean")return!0;let X;if(X=B.$schema,X!==void 0&&typeof X!="string")throw new Error("$schema must be a string");if(X=X||this.opts.defaultMeta||this.defaultMeta(),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const H=this.validate(X,B);if(!H&&W){const Y="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(Y);else throw new Error(Y)}return H}getSchema(B){let W;for(;typeof(W=D.call(this,B))=="string";)B=W;if(W===void 0){const{schemaId:X}=this.opts,H=new s.SchemaEnv({schema:{},schemaId:X});if(W=s.resolveSchema.call(this,H,B),!W)return;this.refs[B]=W}return W.validate||this._compileSchemaEnv(W)}removeSchema(B){if(B instanceof RegExp)return this._removeAllSchemas(this.schemas,B),this._removeAllSchemas(this.refs,B),this;switch(typeof B){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const W=D.call(this,B);return typeof W=="object"&&this._cache.delete(W.schema),delete this.schemas[B],delete this.refs[B],this}case"object":{const W=B;this._cache.delete(W);let X=B[this.opts.schemaId];return X&&(X=(0,l.normalizeId)(X),delete this.schemas[X],delete this.refs[X]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(B){for(const W of B)this.addKeyword(W);return this}addKeyword(B,W){let X;if(typeof B=="string")X=B,typeof W=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),W.keyword=X);else if(typeof B=="object"&&W===void 0){if(W=B,X=W.keyword,Array.isArray(X)&&!X.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(j.call(this,X,W),!W)return(0,u.eachItem)(X,Y=>z.call(this,Y)),this;q.call(this,W);const H={...W,type:(0,c.getJSONTypes)(W.type),schemaType:(0,c.getJSONTypes)(W.schemaType)};return(0,u.eachItem)(X,H.type.length===0?Y=>z.call(this,Y,H):Y=>H.type.forEach(J=>z.call(this,Y,H,J))),this}getKeyword(B){const W=this.RULES.all[B];return typeof W=="object"?W.definition:!!W}removeKeyword(B){const{RULES:W}=this;delete W.keywords[B],delete W.all[B];for(const X of W.rules){const H=X.rules.findIndex(Y=>Y.keyword===B);H>=0&&X.rules.splice(H,1)}return this}addFormat(B,W){return typeof W=="string"&&(W=new RegExp(W)),this.formats[B]=W,this}errorsText(B=this.errors,{separator:W=", ",dataVar:X="data"}={}){return!B||B.length===0?"No errors":B.map(H=>`${X}${H.instancePath} ${H.message}`).reduce((H,Y)=>H+W+Y)}$dataMetaSchema(B,W){const X=this.RULES.all;B=JSON.parse(JSON.stringify(B));for(const H of W){const Y=H.split("/").slice(1);let J=B;for(const ne of Y)J=J[ne];for(const ne in X){const ee=X[ne];if(typeof ee!="object")continue;const{$data:se}=ee.definition,ue=J[ne];se&&ue&&(J[ne]=U(ue))}}return B}_removeAllSchemas(B,W){for(const X in B){const H=B[X];(!W||W.test(X))&&(typeof H=="string"?delete B[X]:H&&!H.meta&&(this._cache.delete(H.schema),delete B[X]))}}_addSchema(B,W,X,H=this.opts.validateSchema,Y=this.opts.addUsedSchema){let J;const{schemaId:ne}=this.opts;if(typeof B=="object")J=B[ne];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof B!="boolean")throw new Error("schema must be object or boolean")}let ee=this._cache.get(B);if(ee!==void 0)return ee;X=(0,l.normalizeId)(J||X);const se=l.getSchemaRefs.call(this,B,X);return ee=new s.SchemaEnv({schema:B,schemaId:ne,meta:W,baseId:X,localRefs:se}),this._cache.set(ee.schema,ee),Y&&!X.startsWith("#")&&(X&&this._checkUnique(X),this.refs[X]=ee),H&&this.validateSchema(B,!0),ee}_checkUnique(B){if(this.schemas[B]||this.refs[B])throw new Error(`schema with key or id "${B}" already exists`)}_compileSchemaEnv(B){if(B.meta?this._compileMetaSchema(B):s.compileSchema.call(this,B),!B.validate)throw new Error("ajv implementation error");return B.validate}_compileMetaSchema(B){const W=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,B)}finally{this.opts=W}}}A.ValidationError=r.default,A.MissingRefError=i.default,e.default=A;function E(K,B,W,X="error"){for(const H in K){const Y=H;Y in B&&this.logger[X](`${W}: option ${H}. ${K[Y]}`)}}function D(K){return K=(0,l.normalizeId)(K),this.schemas[K]||this.refs[K]}function O(){const K=this.opts.schemas;if(K)if(Array.isArray(K))this.addSchema(K);else for(const B in K)this.addSchema(K[B],B)}function T(){for(const K in this.opts.formats){const B=this.opts.formats[K];B&&this.addFormat(K,B)}}function I(K){if(Array.isArray(K)){this.addVocabulary(K);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const B in K){const W=K[B];W.keyword||(W.keyword=B),this.addKeyword(W)}}function N(){const K={...this.opts};for(const B of y)delete K[B];return K}const $={log(){},warn(){},error(){}};function R(K){if(K===!1)return $;if(K===void 0)return console;if(K.log&&K.warn&&K.error)return K;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function j(K,B){const{RULES:W}=this;if((0,u.eachItem)(K,X=>{if(W.keywords[X])throw new Error(`Keyword ${X} is already defined`);if(!F.test(X))throw new Error(`Keyword ${X} has invalid name`)}),!!B&&B.$data&&!("code"in B||"validate"in B))throw new Error('$data keyword must have "code" or "validate" function')}function z(K,B,W){var X;const H=B?.post;if(W&&H)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:Y}=this;let J=H?Y.post:Y.rules.find(({type:ee})=>ee===W);if(J||(J={type:W,rules:[]},Y.rules.push(J)),Y.keywords[K]=!0,!B)return;const ne={keyword:K,definition:{...B,type:(0,c.getJSONTypes)(B.type),schemaType:(0,c.getJSONTypes)(B.schemaType)}};B.before?L.call(this,J,ne,B.before):J.rules.push(ne),Y.all[K]=ne,(X=B.implements)===null||X===void 0||X.forEach(ee=>this.addKeyword(ee))}function L(K,B,W){const X=K.rules.findIndex(H=>H.keyword===W);X>=0?K.rules.splice(X,0,B):(K.rules.push(B),this.logger.warn(`rule ${W} is not defined`))}function q(K){let{metaSchema:B}=K;B!==void 0&&(K.$data&&this.opts.$data&&(B=U(B)),K.validateSchema=this.compile(B,!0))}const V={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function U(K){return{anyOf:[K,V]}}})(vE)),vE}var Wx={},qx={},Gx={},VH;function eIe(){if(VH)return Gx;VH=1,Object.defineProperty(Gx,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Gx.default=e,Gx}var ld={},WH;function tIe(){if(WH)return ld;WH=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.callRef=ld.getValidate=void 0;const e=Kw(),t=cl(),n=pn(),r=Sf(),i=CM(),o=qn(),s={keyword:"$ref",schemaType:"string",code(c){const{gen:u,schema:f,it:h}=c,{baseId:g,schemaEnv:y,validateName:b,opts:v,self:S}=h,{root:C}=y;if((f==="#"||f==="#/")&&g===C.baseId)return A();const w=i.resolveRef.call(S,C,g,f);if(w===void 0)throw new e.default(h.opts.uriResolver,g,f);if(w instanceof i.SchemaEnv)return E(w);return D(w);function A(){if(y===C)return l(c,b,y,y.$async);const O=u.scopeValue("root",{ref:C});return l(c,(0,n._)`${O}.validate`,C,C.$async)}function E(O){const T=a(c,O);l(c,T,O,O.$async)}function D(O){const T=u.scopeValue("schema",v.code.source===!0?{ref:O,code:(0,n.stringify)(O)}:{ref:O}),I=u.name("valid"),N=c.subschema({schema:O,dataTypes:[],schemaPath:n.nil,topSchemaRef:T,errSchemaPath:f},I);c.mergeEvaluated(N),c.ok(I)}}};function a(c,u){const{gen:f}=c;return u.validate?f.scopeValue("validate",{ref:u.validate}):(0,n._)`${f.scopeValue("wrapper",{ref:u})}.validate`}ld.getValidate=a;function l(c,u,f,h){const{gen:g,it:y}=c,{allErrors:b,schemaEnv:v,opts:S}=y,C=S.passContext?r.default.this:n.nil;h?w():A();function w(){if(!v.$async)throw new Error("async schema referenced by sync schema");const O=g.let("valid");g.try(()=>{g.code((0,n._)`await ${(0,t.callValidateCode)(c,u,C)}`),D(u),b||g.assign(O,!0)},T=>{g.if((0,n._)`!(${T} instanceof ${y.ValidationError})`,()=>g.throw(T)),E(T),b||g.assign(O,!1)}),c.ok(O)}function A(){c.result((0,t.callValidateCode)(c,u,C),()=>D(u),()=>E(u))}function E(O){const T=(0,n._)`${O}.errors`;g.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${T} : ${r.default.vErrors}.concat(${T})`),g.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function D(O){var T;if(!y.opts.unevaluated)return;const I=(T=f?.validate)===null||T===void 0?void 0:T.evaluated;if(y.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(y.props=o.mergeEvaluated.props(g,I.props,y.props));else{const N=g.var("props",(0,n._)`${O}.evaluated.props`);y.props=o.mergeEvaluated.props(g,N,y.props,n.Name)}if(y.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(y.items=o.mergeEvaluated.items(g,I.items,y.items));else{const N=g.var("items",(0,n._)`${O}.evaluated.items`);y.items=o.mergeEvaluated.items(g,N,y.items,n.Name)}}}return ld.callRef=l,ld.default=s,ld}var qH;function nIe(){if(qH)return qx;qH=1,Object.defineProperty(qx,"__esModule",{value:!0});const e=eIe(),t=tIe(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return qx.default=n,qx}var Kx={},Yx={},GH;function rIe(){if(GH)return Yx;GH=1,Object.defineProperty(Yx,"__esModule",{value:!0});const e=pn(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:o,schemaCode:s})=>(0,e.str)`must be ${n[o].okStr} ${s}`,params:({keyword:o,schemaCode:s})=>(0,e._)`{comparison: ${n[o].okStr}, limit: ${s}}`},i={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(o){const{keyword:s,data:a,schemaCode:l}=o;o.fail$data((0,e._)`${a} ${n[s].fail} ${l} || isNaN(${a})`)}};return Yx.default=i,Yx}var Xx={},KH;function iIe(){if(KH)return Xx;KH=1,Object.defineProperty(Xx,"__esModule",{value:!0});const e=pn(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:i,data:o,schemaCode:s,it:a}=r,l=a.opts.multipleOfPrecision,c=i.let("res"),u=l?(0,e._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${l}`:(0,e._)`${c} !== parseInt(${c})`;r.fail$data((0,e._)`(${s} === 0 || (${c} = ${o}/${s}, ${u}))`)}};return Xx.default=n,Xx}var Zx={},Jx={},YH;function oIe(){if(YH)return Jx;YH=1,Object.defineProperty(Jx,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,i=0,o;for(;i<n;)r++,o=t.charCodeAt(i++),o>=55296&&o<=56319&&i<n&&(o=t.charCodeAt(i),(o&64512)===56320&&i++);return r}return Jx.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Jx}var XH;function sIe(){if(XH)return Zx;XH=1,Object.defineProperty(Zx,"__esModule",{value:!0});const e=pn(),t=qn(),n=oIe(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:s}){const a=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${s} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:s,data:a,schemaCode:l,it:c}=o,u=s==="maxLength"?e.operators.GT:e.operators.LT,f=c.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(o.gen,n.default)}(${a})`;o.fail$data((0,e._)`${f} ${u} ${l}`)}};return Zx.default=i,Zx}var Qx={},ZH;function aIe(){if(ZH)return Qx;ZH=1,Object.defineProperty(Qx,"__esModule",{value:!0});const e=cl(),t=qn(),n=pn(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,n.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,n._)`{pattern: ${o}}`},code(o){const{gen:s,data:a,$data:l,schema:c,schemaCode:u,it:f}=o,h=f.opts.unicodeRegExp?"u":"";if(l){const{regExp:g}=f.opts.code,y=g.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(s,g),b=s.let("valid");s.try(()=>s.assign(b,(0,n._)`${y}(${u}, ${h}).test(${a})`),()=>s.assign(b,!1)),o.fail$data((0,n._)`!${b}`)}else{const g=(0,e.usePattern)(o,c);o.fail$data((0,n._)`!${g}.test(${a})`)}}};return Qx.default=i,Qx}var e3={},JH;function lIe(){if(JH)return e3;JH=1,Object.defineProperty(e3,"__esModule",{value:!0});const e=pn(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const o=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:o,schemaCode:s}=r,a=i==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${o}).length ${a} ${s}`)}};return e3.default=n,e3}var t3={},QH;function cIe(){if(QH)return t3;QH=1,Object.defineProperty(t3,"__esModule",{value:!0});const e=cl(),t=pn(),n=qn(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:s,schema:a,schemaCode:l,data:c,$data:u,it:f}=o,{opts:h}=f;if(!u&&a.length===0)return;const g=a.length>=h.loopRequired;if(f.allErrors?y():b(),h.strictRequired){const C=o.parentSchema.properties,{definedProperties:w}=o.it;for(const A of a)if(C?.[A]===void 0&&!w.has(A)){const E=f.schemaEnv.baseId+f.errSchemaPath,D=`required property "${A}" is not defined at "${E}" (strictRequired)`;(0,n.checkStrictMode)(f,D,f.opts.strictRequired)}}function y(){if(g||u)o.block$data(t.nil,v);else for(const C of a)(0,e.checkReportMissingProp)(o,C)}function b(){const C=s.let("missing");if(g||u){const w=s.let("valid",!0);o.block$data(w,()=>S(C,w)),o.ok(w)}else s.if((0,e.checkMissingProp)(o,a,C)),(0,e.reportMissingProp)(o,C),s.else()}function v(){s.forOf("prop",l,C=>{o.setParams({missingProperty:C}),s.if((0,e.noPropertyInData)(s,c,C,h.ownProperties),()=>o.error())})}function S(C,w){o.setParams({missingProperty:C}),s.forOf(C,l,()=>{s.assign(w,(0,e.propertyInData)(s,c,C,h.ownProperties)),s.if((0,t.not)(w),()=>{o.error(),s.break()})},t.nil)}}};return t3.default=i,t3}var n3={},eU;function uIe(){if(eU)return n3;eU=1,Object.defineProperty(n3,"__esModule",{value:!0});const e=pn(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const o=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${i} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:o,schemaCode:s}=r,a=i==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${o}.length ${a} ${s}`)}};return n3.default=n,n3}var r3={},i3={},tU;function EM(){if(tU)return i3;tU=1,Object.defineProperty(i3,"__esModule",{value:!0});const e=SM();return e.code='require("ajv/dist/runtime/equal").default',i3.default=e,i3}var nU;function dIe(){if(nU)return r3;nU=1,Object.defineProperty(r3,"__esModule",{value:!0});const e=c6(),t=pn(),n=qn(),r=EM(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:s,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${s} are identical)`,params:({params:{i:s,j:a}})=>(0,t._)`{i: ${s}, j: ${a}}`},code(s){const{gen:a,data:l,$data:c,schema:u,parentSchema:f,schemaCode:h,it:g}=s;if(!c&&!u)return;const y=a.let("valid"),b=f.items?(0,e.getSchemaTypes)(f.items):[];s.block$data(y,v,(0,t._)`${h} === false`),s.ok(y);function v(){const A=a.let("i",(0,t._)`${l}.length`),E=a.let("j");s.setParams({i:A,j:E}),a.assign(y,!0),a.if((0,t._)`${A} > 1`,()=>(S()?C:w)(A,E))}function S(){return b.length>0&&!b.some(A=>A==="object"||A==="array")}function C(A,E){const D=a.name("item"),O=(0,e.checkDataTypes)(b,D,g.opts.strictNumbers,e.DataType.Wrong),T=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${A}--;`,()=>{a.let(D,(0,t._)`${l}[${A}]`),a.if(O,(0,t._)`continue`),b.length>1&&a.if((0,t._)`typeof ${D} == "string"`,(0,t._)`${D} += "_"`),a.if((0,t._)`typeof ${T}[${D}] == "number"`,()=>{a.assign(E,(0,t._)`${T}[${D}]`),s.error(),a.assign(y,!1).break()}).code((0,t._)`${T}[${D}] = ${A}`)})}function w(A,E){const D=(0,n.useFunc)(a,r.default),O=a.name("outer");a.label(O).for((0,t._)`;${A}--;`,()=>a.for((0,t._)`${E} = ${A}; ${E}--;`,()=>a.if((0,t._)`${D}(${l}[${A}], ${l}[${E}])`,()=>{s.error(),a.assign(y,!1).break(O)})))}}};return r3.default=o,r3}var o3={},rU;function fIe(){if(rU)return o3;rU=1,Object.defineProperty(o3,"__esModule",{value:!0});const e=pn(),t=qn(),n=EM(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:s,data:a,$data:l,schemaCode:c,schema:u}=o;l||u&&typeof u=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(s,n.default)}(${a}, ${c})`):o.fail((0,e._)`${u} !== ${a}`)}};return o3.default=i,o3}var s3={},iU;function hIe(){if(iU)return s3;iU=1,Object.defineProperty(s3,"__esModule",{value:!0});const e=pn(),t=qn(),n=EM(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:s,data:a,$data:l,schema:c,schemaCode:u,it:f}=o;if(!l&&c.length===0)throw new Error("enum must have non-empty array");const h=c.length>=f.opts.loopEnum;let g;const y=()=>g??(g=(0,t.useFunc)(s,n.default));let b;if(h||l)b=s.let("valid"),o.block$data(b,v);else{if(!Array.isArray(c))throw new Error("ajv implementation error");const C=s.const("vSchema",u);b=(0,e.or)(...c.map((w,A)=>S(C,A)))}o.pass(b);function v(){s.assign(b,!1),s.forOf("v",u,C=>s.if((0,e._)`${y()}(${a}, ${C})`,()=>s.assign(b,!0).break()))}function S(C,w){const A=c[w];return typeof A=="object"&&A!==null?(0,e._)`${y()}(${a}, ${C}[${w}])`:(0,e._)`${a} === ${A}`}}};return s3.default=i,s3}var oU;function pIe(){if(oU)return Kx;oU=1,Object.defineProperty(Kx,"__esModule",{value:!0});const e=rIe(),t=iIe(),n=sIe(),r=aIe(),i=lIe(),o=cIe(),s=uIe(),a=dIe(),l=fIe(),c=hIe(),u=[e.default,t.default,n.default,r.default,i.default,o.default,s.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,c.default];return Kx.default=u,Kx}var a3={},Jp={},sU;function Aee(){if(sU)return Jp;sU=1,Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.validateAdditionalItems=void 0;const e=pn(),t=qn(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:s,it:a}=o,{items:l}=s;if(!Array.isArray(l)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(o,l)}};function i(o,s){const{gen:a,schema:l,data:c,keyword:u,it:f}=o;f.items=!0;const h=a.const("len",(0,e._)`${c}.length`);if(l===!1)o.setParams({len:s.length}),o.pass((0,e._)`${h} <= ${s.length}`);else if(typeof l=="object"&&!(0,t.alwaysValidSchema)(f,l)){const y=a.var("valid",(0,e._)`${h} <= ${s.length}`);a.if((0,e.not)(y),()=>g(y)),o.ok(y)}function g(y){a.forRange("i",s.length,h,b=>{o.subschema({keyword:u,dataProp:b,dataPropType:t.Type.Num},y),f.allErrors||a.if((0,e.not)(y),()=>a.break())})}}return Jp.validateAdditionalItems=i,Jp.default=r,Jp}var l3={},Qp={},aU;function kee(){if(aU)return Qp;aU=1,Object.defineProperty(Qp,"__esModule",{value:!0}),Qp.validateTuple=void 0;const e=pn(),t=qn(),n=cl(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:s,it:a}=o;if(Array.isArray(s))return i(o,"additionalItems",s);a.items=!0,!(0,t.alwaysValidSchema)(a,s)&&o.ok((0,n.validateArray)(o))}};function i(o,s,a=o.schema){const{gen:l,parentSchema:c,data:u,keyword:f,it:h}=o;b(c),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.items=t.mergeEvaluated.items(l,a.length,h.items));const g=l.name("valid"),y=l.const("len",(0,e._)`${u}.length`);a.forEach((v,S)=>{(0,t.alwaysValidSchema)(h,v)||(l.if((0,e._)`${y} > ${S}`,()=>o.subschema({keyword:f,schemaProp:S,dataProp:S},g)),o.ok(g))});function b(v){const{opts:S,errSchemaPath:C}=h,w=a.length,A=w===v.minItems&&(w===v.maxItems||v[s]===!1);if(S.strictTuples&&!A){const E=`"${f}" is ${w}-tuple, but minItems or maxItems/${s} are not specified or different at path "${C}"`;(0,t.checkStrictMode)(h,E,S.strictTuples)}}}return Qp.validateTuple=i,Qp.default=r,Qp}var lU;function mIe(){if(lU)return l3;lU=1,Object.defineProperty(l3,"__esModule",{value:!0});const e=kee(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return l3.default=t,l3}var c3={},cU;function gIe(){if(cU)return c3;cU=1,Object.defineProperty(c3,"__esModule",{value:!0});const e=pn(),t=qn(),n=cl(),r=Aee(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{schema:a,parentSchema:l,it:c}=s,{prefixItems:u}=l;c.items=!0,!(0,t.alwaysValidSchema)(c,a)&&(u?(0,r.validateAdditionalItems)(s,u):s.ok((0,n.validateArray)(s)))}};return c3.default=o,c3}var u3={},uU;function yIe(){if(uU)return u3;uU=1,Object.defineProperty(u3,"__esModule",{value:!0});const e=pn(),t=qn(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:o}})=>o===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${o} valid item(s)`,params:({params:{min:i,max:o}})=>o===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${o}}`},code(i){const{gen:o,schema:s,parentSchema:a,data:l,it:c}=i;let u,f;const{minContains:h,maxContains:g}=a;c.opts.next?(u=h===void 0?1:h,f=g):u=1;const y=o.const("len",(0,e._)`${l}.length`);if(i.setParams({min:u,max:f}),f===void 0&&u===0){(0,t.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(f!==void 0&&u>f){(0,t.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(c,s)){let w=(0,e._)`${y} >= ${u}`;f!==void 0&&(w=(0,e._)`${w} && ${y} <= ${f}`),i.pass(w);return}c.items=!0;const b=o.name("valid");f===void 0&&u===1?S(b,()=>o.if(b,()=>o.break())):u===0?(o.let(b,!0),f!==void 0&&o.if((0,e._)`${l}.length > 0`,v)):(o.let(b,!1),v()),i.result(b,()=>i.reset());function v(){const w=o.name("_valid"),A=o.let("count",0);S(w,()=>o.if(w,()=>C(A)))}function S(w,A){o.forRange("i",0,y,E=>{i.subschema({keyword:"contains",dataProp:E,dataPropType:t.Type.Num,compositeRule:!0},w),A()})}function C(w){o.code((0,e._)`${w}++`),f===void 0?o.if((0,e._)`${w} >= ${u}`,()=>o.assign(b,!0).break()):(o.if((0,e._)`${w} > ${f}`,()=>o.assign(b,!1).break()),u===1?o.assign(b,!0):o.if((0,e._)`${w} >= ${u}`,()=>o.assign(b,!0)))}}};return u3.default=r,u3}var kE={},dU;function bIe(){return dU||(dU=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=pn(),n=qn(),r=cl();e.error={message:({params:{property:l,depsCount:c,deps:u}})=>{const f=c===1?"property":"properties";return(0,t.str)`must have ${f} ${u} when property ${l} is present`},params:({params:{property:l,depsCount:c,deps:u,missingProperty:f}})=>(0,t._)`{property: ${l},
252
252
  missingProperty: ${f},
253
253
  depsCount: ${c},
254
- deps: ${u}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[c,u]=o(l);s(l,c),a(l,u)}};function o({schema:l}){const c={},u={};for(const f in l){if(f==="__proto__")continue;const h=Array.isArray(l[f])?c:u;h[f]=l[f]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:f,it:h}=l;if(Object.keys(c).length===0)return;const g=u.let("missing");for(const y in c){const b=c[y];if(b.length===0)continue;const v=(0,r.propertyInData)(u,f,y,h.opts.ownProperties);l.setParams({property:y,depsCount:b.length,deps:b.join(", ")}),h.allErrors?u.if(v,()=>{for(const S of b)(0,r.checkReportMissingProp)(l,S)}):(u.if((0,t._)`${v} && (${(0,r.checkMissingProp)(l,b,g)})`),(0,r.reportMissingProp)(l,g),u.else())}}e.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:u,data:f,keyword:h,it:g}=l,y=u.name("valid");for(const b in c)(0,n.alwaysValidSchema)(g,c[b])||(u.if((0,r.propertyInData)(u,f,b,g.opts.ownProperties),()=>{const v=l.subschema({keyword:h,schemaProp:b},y);l.mergeValidEvaluated(v,y)},()=>u.var(y,!0)),l.ok(y))}e.validateSchemaDeps=a,e.default=i})(kE)),kE}var d3={},fU;function vIe(){if(fU)return d3;fU=1,Object.defineProperty(d3,"__esModule",{value:!0});const e=pn(),t=qn(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:o,schema:s,data:a,it:l}=i;if((0,t.alwaysValidSchema)(l,s))return;const c=o.name("valid");o.forIn("key",a,u=>{i.setParams({propertyName:u}),i.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),o.if((0,e.not)(c),()=>{i.error(!0),l.allErrors||o.break()})}),i.ok(c)}};return d3.default=r,d3}var f3={},hU;function _ee(){if(hU)return f3;hU=1,Object.defineProperty(f3,"__esModule",{value:!0});const e=cl(),t=pn(),n=Sf(),r=qn(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,t._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:a,schema:l,parentSchema:c,data:u,errsCount:f,it:h}=s;if(!f)throw new Error("ajv implementation error");const{allErrors:g,opts:y}=h;if(h.props=!0,y.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,l))return;const b=(0,e.allSchemaProperties)(c.properties),v=(0,e.allSchemaProperties)(c.patternProperties);S(),s.ok((0,t._)`${f} === ${n.default.errors}`);function S(){a.forIn("key",u,D=>{!b.length&&!v.length?A(D):a.if(C(D),()=>A(D))})}function C(D){let O;if(b.length>8){const T=(0,r.schemaRefOrVal)(h,c.properties,"properties");O=(0,e.isOwnProperty)(a,T,D)}else b.length?O=(0,t.or)(...b.map(T=>(0,t._)`${D} === ${T}`)):O=t.nil;return v.length&&(O=(0,t.or)(O,...v.map(T=>(0,t._)`${(0,e.usePattern)(s,T)}.test(${D})`))),(0,t.not)(O)}function w(D){a.code((0,t._)`delete ${u}[${D}]`)}function A(D){if(y.removeAdditional==="all"||y.removeAdditional&&l===!1){w(D);return}if(l===!1){s.setParams({additionalProperty:D}),s.error(),g||a.break();return}if(typeof l=="object"&&!(0,r.alwaysValidSchema)(h,l)){const O=a.name("valid");y.removeAdditional==="failing"?(E(D,O,!1),a.if((0,t.not)(O),()=>{s.reset(),w(D)})):(E(D,O),g||a.if((0,t.not)(O),()=>a.break()))}}function E(D,O,T){const I={keyword:"additionalProperties",dataProp:D,dataPropType:r.Type.Str};T===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,O)}}};return f3.default=o,f3}var h3={},pU;function xIe(){if(pU)return h3;pU=1,Object.defineProperty(h3,"__esModule",{value:!0});const e=Gw(),t=cl(),n=qn(),r=_ee(),i={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:s,schema:a,parentSchema:l,data:c,it:u}=o;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(u,r.default,"additionalProperties"));const f=(0,t.allSchemaProperties)(a);for(const v of f)u.definedProperties.add(v);u.opts.unevaluated&&f.length&&u.props!==!0&&(u.props=n.mergeEvaluated.props(s,(0,n.toHash)(f),u.props));const h=f.filter(v=>!(0,n.alwaysValidSchema)(u,a[v]));if(h.length===0)return;const g=s.name("valid");for(const v of h)y(v)?b(v):(s.if((0,t.propertyInData)(s,c,v,u.opts.ownProperties)),b(v),u.allErrors||s.else().var(g,!0),s.endIf()),o.it.definedProperties.add(v),o.ok(g);function y(v){return u.opts.useDefaults&&!u.compositeRule&&a[v].default!==void 0}function b(v){o.subschema({keyword:"properties",schemaProp:v,dataProp:v},g)}}};return h3.default=i,h3}var p3={},mU;function SIe(){if(mU)return p3;mU=1,Object.defineProperty(p3,"__esModule",{value:!0});const e=cl(),t=pn(),n=qn(),r=qn(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:s,schema:a,data:l,parentSchema:c,it:u}=o,{opts:f}=u,h=(0,e.allSchemaProperties)(a),g=h.filter(A=>(0,n.alwaysValidSchema)(u,a[A]));if(h.length===0||g.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const y=f.strictSchema&&!f.allowMatchingProperties&&c.properties,b=s.name("valid");u.props!==!0&&!(u.props instanceof t.Name)&&(u.props=(0,r.evaluatedPropsToName)(s,u.props));const{props:v}=u;S();function S(){for(const A of h)y&&C(A),u.allErrors?w(A):(s.var(b,!0),w(A),s.if(b))}function C(A){for(const E in y)new RegExp(A).test(E)&&(0,n.checkStrictMode)(u,`property ${E} matches pattern ${A} (use allowMatchingProperties)`)}function w(A){s.forIn("key",l,E=>{s.if((0,t._)`${(0,e.usePattern)(o,A)}.test(${E})`,()=>{const D=g.includes(A);D||o.subschema({keyword:"patternProperties",schemaProp:A,dataProp:E,dataPropType:r.Type.Str},b),u.opts.unevaluated&&v!==!0?s.assign((0,t._)`${v}[${E}]`,!0):!D&&!u.allErrors&&s.if((0,t.not)(b),()=>s.break())})})}}};return p3.default=i,p3}var m3={},gU;function wIe(){if(gU)return m3;gU=1,Object.defineProperty(m3,"__esModule",{value:!0});const e=qn(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:i,it:o}=n;if((0,e.alwaysValidSchema)(o,i)){n.fail();return}const s=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),n.failResult(s,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return m3.default=t,m3}var g3={},yU;function CIe(){if(yU)return g3;yU=1,Object.defineProperty(g3,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cl().validateUnion,error:{message:"must match a schema in anyOf"}};return g3.default=t,g3}var y3={},bU;function EIe(){if(bU)return y3;bU=1,Object.defineProperty(y3,"__esModule",{value:!0});const e=pn(),t=qn(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:o,schema:s,parentSchema:a,it:l}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");if(l.opts.discriminator&&a.discriminator)return;const c=s,u=o.let("valid",!1),f=o.let("passing",null),h=o.name("_valid");i.setParams({passing:f}),o.block(g),i.result(u,()=>i.reset(),()=>i.error(!0));function g(){c.forEach((y,b)=>{let v;(0,t.alwaysValidSchema)(l,y)?o.var(h,!0):v=i.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},h),b>0&&o.if((0,e._)`${h} && ${u}`).assign(u,!1).assign(f,(0,e._)`[${f}, ${b}]`).else(),o.if(h,()=>{o.assign(u,!0),o.assign(f,b),v&&i.mergeEvaluated(v,e.Name)})})}}};return y3.default=r,y3}var b3={},vU;function AIe(){if(vU)return b3;vU=1,Object.defineProperty(b3,"__esModule",{value:!0});const e=qn(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:i,it:o}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");const s=r.name("valid");i.forEach((a,l)=>{if((0,e.alwaysValidSchema)(o,a))return;const c=n.subschema({keyword:"allOf",schemaProp:l},s);n.ok(s),n.mergeEvaluated(c)})}};return b3.default=t,b3}var v3={},xU;function kIe(){if(xU)return v3;xU=1,Object.defineProperty(v3,"__esModule",{value:!0});const e=pn(),t=qn(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:s,parentSchema:a,it:l}=o;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(l,'"if" without "then" and "else" is ignored');const c=i(l,"then"),u=i(l,"else");if(!c&&!u)return;const f=s.let("valid",!0),h=s.name("_valid");if(g(),o.reset(),c&&u){const b=s.let("ifClause");o.setParams({ifClause:b}),s.if(h,y("then",b),y("else",b))}else c?s.if(h,y("then")):s.if((0,e.not)(h),y("else"));o.pass(f,()=>o.error(!0));function g(){const b=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);o.mergeEvaluated(b)}function y(b,v){return()=>{const S=o.subschema({keyword:b},h);s.assign(f,h),o.mergeValidEvaluated(S,f),v?s.assign(v,(0,e._)`${b}`):o.setParams({ifClause:b})}}}};function i(o,s){const a=o.schema[s];return a!==void 0&&!(0,t.alwaysValidSchema)(o,a)}return v3.default=r,v3}var x3={},SU;function _Ie(){if(SU)return x3;SU=1,Object.defineProperty(x3,"__esModule",{value:!0});const e=qn(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:i}){r.if===void 0&&(0,e.checkStrictMode)(i,`"${n}" without "if" is ignored`)}};return x3.default=t,x3}var wU;function DIe(){if(wU)return a3;wU=1,Object.defineProperty(a3,"__esModule",{value:!0});const e=Aee(),t=mIe(),n=kee(),r=gIe(),i=yIe(),o=bIe(),s=vIe(),a=_ee(),l=xIe(),c=SIe(),u=wIe(),f=CIe(),h=EIe(),g=AIe(),y=kIe(),b=_Ie();function v(S=!1){const C=[u.default,f.default,h.default,g.default,y.default,b.default,s.default,a.default,o.default,l.default,c.default];return S?C.push(t.default,r.default):C.push(e.default,n.default),C.push(i.default),C}return a3.default=v,a3}var S3={},w3={},CU;function OIe(){if(CU)return w3;CU=1,Object.defineProperty(w3,"__esModule",{value:!0});const e=pn(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,i){const{gen:o,data:s,$data:a,schema:l,schemaCode:c,it:u}=r,{opts:f,errSchemaPath:h,schemaEnv:g,self:y}=u;if(!f.validateFormats)return;a?b():v();function b(){const S=o.scopeValue("formats",{ref:y.formats,code:f.code.formats}),C=o.const("fDef",(0,e._)`${S}[${c}]`),w=o.let("fType"),A=o.let("format");o.if((0,e._)`typeof ${C} == "object" && !(${C} instanceof RegExp)`,()=>o.assign(w,(0,e._)`${C}.type || "string"`).assign(A,(0,e._)`${C}.validate`),()=>o.assign(w,(0,e._)`"string"`).assign(A,C)),r.fail$data((0,e.or)(E(),D()));function E(){return f.strictSchema===!1?e.nil:(0,e._)`${c} && !${A}`}function D(){const O=g.$async?(0,e._)`(${C}.async ? await ${A}(${s}) : ${A}(${s}))`:(0,e._)`${A}(${s})`,T=(0,e._)`(typeof ${A} == "function" ? ${O} : ${A}.test(${s}))`;return(0,e._)`${A} && ${A} !== true && ${w} === ${i} && !${T}`}}function v(){const S=y.formats[l];if(!S){E();return}if(S===!0)return;const[C,w,A]=D(S);C===i&&r.pass(O());function E(){if(f.strictSchema===!1){y.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${l}" ignored in schema at path "${h}"`}}function D(T){const I=T instanceof RegExp?(0,e.regexpCode)(T):f.code.formats?(0,e._)`${f.code.formats}${(0,e.getProperty)(l)}`:void 0,N=o.scopeValue("formats",{key:l,ref:T,code:I});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,e._)`${N}.validate`]:["string",T,N]}function O(){if(typeof S=="object"&&!(S instanceof RegExp)&&S.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${A}(${s})`}return typeof w=="function"?(0,e._)`${A}(${s})`:(0,e._)`${A}.test(${s})`}}}};return w3.default=n,w3}var EU;function TIe(){if(EU)return S3;EU=1,Object.defineProperty(S3,"__esModule",{value:!0});const t=[OIe().default];return S3.default=t,S3}var Yf={},AU;function MIe(){return AU||(AU=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.contentVocabulary=Yf.metadataVocabulary=void 0,Yf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Yf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Yf}var kU;function RIe(){if(kU)return Wx;kU=1,Object.defineProperty(Wx,"__esModule",{value:!0});const e=nIe(),t=pIe(),n=DIe(),r=TIe(),i=MIe(),o=[e.default,t.default,(0,n.default)(),r.default,i.metadataVocabulary,i.contentVocabulary];return Wx.default=o,Wx}var C3={},w1={},_U;function IIe(){if(_U)return w1;_U=1,Object.defineProperty(w1,"__esModule",{value:!0}),w1.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(w1.DiscrError=e={})),w1}var DU;function PIe(){if(DU)return C3;DU=1,Object.defineProperty(C3,"__esModule",{value:!0});const e=pn(),t=IIe(),n=CM(),r=Kw(),i=qn(),s={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:l}})=>a===t.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:a,tag:l,tagName:c}})=>(0,e._)`{error: ${a}, tag: ${c}, tagValue: ${l}}`},code(a){const{gen:l,data:c,schema:u,parentSchema:f,it:h}=a,{oneOf:g}=f;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const y=u.propertyName;if(typeof y!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const b=l.let("valid",!1),v=l.const("tag",(0,e._)`${c}${(0,e.getProperty)(y)}`);l.if((0,e._)`typeof ${v} == "string"`,()=>S(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:v,tagName:y})),a.ok(b);function S(){const A=w();l.if(!1);for(const E in A)l.elseIf((0,e._)`${v} === ${E}`),l.assign(b,C(A[E]));l.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:v,tagName:y}),l.endIf()}function C(A){const E=l.name("valid"),D=a.subschema({keyword:"oneOf",schemaProp:A},E);return a.mergeEvaluated(D,e.Name),E}function w(){var A;const E={},D=T(f);let O=!0;for(let $=0;$<g.length;$++){let R=g[$];if(R?.$ref&&!(0,i.schemaHasRulesButRef)(R,h.self.RULES)){const j=R.$ref;if(R=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,j),R instanceof n.SchemaEnv&&(R=R.schema),R===void 0)throw new r.default(h.opts.uriResolver,h.baseId,j)}const F=(A=R?.properties)===null||A===void 0?void 0:A[y];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${y}"`);O=O&&(D||T(R)),I(F,$)}if(!O)throw new Error(`discriminator: "${y}" must be required`);return E;function T({required:$}){return Array.isArray($)&&$.includes(y)}function I($,R){if($.const)N($.const,R);else if($.enum)for(const F of $.enum)N(F,R);else throw new Error(`discriminator: "properties/${y}" must have "const" or "enum"`)}function N($,R){if(typeof $!="string"||$ in E)throw new Error(`discriminator: "${y}" values must be unique strings`);E[$]=R}}}};return C3.default=s,C3}const jIe="http://json-schema.org/draft-07/schema#",$Ie="http://json-schema.org/draft-07/schema#",LIe="Core schema meta-schema",NIe={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},FIe=["object","boolean"],BIe={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},zIe={$schema:jIe,$id:$Ie,title:LIe,definitions:NIe,type:FIe,properties:BIe,default:!0};var OU;function Dee(){return OU||(OU=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=QRe(),r=RIe(),i=PIe(),o=zIe,s=["/properties"],a="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const y=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(y,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=Gw();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=pn();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=wM();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=Kw();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(Bx,Bx.exports)),Bx.exports}var HIe=Dee();const Oee=us(HIe);var E3={exports:{}},_E={},TU;function UIe(){return TU||(TU=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(I,N){return{validate:I,compare:N}}e.fullFormats={date:t(o,s),time:t(l,c),"date-time":t(f,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:b,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:T,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:S,int32:{type:"number",validate:A},int64:{type:"number",validate:E},float:{type:"number",validate:D},double:{type:"number",validate:D},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(I){return I%4===0&&(I%100!==0||I%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(I){const N=r.exec(I);if(!N)return!1;const $=+N[1],R=+N[2],F=+N[3];return R>=1&&R<=12&&F>=1&&F<=(R===2&&n($)?29:i[R])}function s(I,N){if(I&&N)return I>N?1:I<N?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(I,N){const $=a.exec(I);if(!$)return!1;const R=+$[1],F=+$[2],j=+$[3],z=$[5];return(R<=23&&F<=59&&j<=59||R===23&&F===59&&j===60)&&(!N||z!=="")}function c(I,N){if(!(I&&N))return;const $=a.exec(I),R=a.exec(N);if($&&R)return I=$[1]+$[2]+$[3]+($[4]||""),N=R[1]+R[2]+R[3]+(R[4]||""),I>N?1:I<N?-1:0}const u=/t|\s/i;function f(I){const N=I.split(u);return N.length===2&&o(N[0])&&l(N[1],!0)}function h(I,N){if(!(I&&N))return;const[$,R]=I.split(u),[F,j]=N.split(u),z=s($,F);if(z!==void 0)return z||c(R,j)}const g=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function b(I){return g.test(I)&&y.test(I)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function S(I){return v.lastIndex=0,v.test(I)}const C=-2147483648,w=2**31-1;function A(I){return Number.isInteger(I)&&I<=w&&I>=C}function E(I){return Number.isInteger(I)}function D(){return!0}const O=/[^\\]\\Z/;function T(I){if(O.test(I))return!1;try{return new RegExp(I),!0}catch{return!1}}})(_E)),_E}var DE={},MU;function VIe(){return MU||(MU=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Dee(),n=pn(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:({keyword:a,schemaCode:l})=>n.str`should be ${i[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>n._`{comparison: ${i[a].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(a){const{gen:l,data:c,schemaCode:u,keyword:f,it:h}=a,{opts:g,self:y}=h;if(!g.validateFormats)return;const b=new t.KeywordCxt(h,y.RULES.all.format.definition,"format");b.$data?v():S();function v(){const w=l.scopeValue("formats",{ref:y.formats,code:g.code.formats}),A=l.const("fmt",n._`${w}[${b.schemaCode}]`);a.fail$data(n.or(n._`typeof ${A} != "object"`,n._`${A} instanceof RegExp`,n._`typeof ${A}.compare != "function"`,C(A)))}function S(){const w=b.schema,A=y.formats[w];if(!A||A===!0)return;if(typeof A!="object"||A instanceof RegExp||typeof A.compare!="function")throw new Error(`"${f}": format "${w}" does not define "compare" function`);const E=l.scopeValue("formats",{key:w,ref:A,code:g.code.formats?n._`${g.code.formats}${n.getProperty(w)}`:void 0});a.fail$data(C(E))}function C(w){return n._`${w}.compare(${c}, ${u}) ${i[f].fail} 0`}},dependencies:["format"]};const s=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=s})(DE)),DE}var RU;function WIe(){return RU||(RU=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=UIe(),r=VIe(),i=pn(),o=new i.Name("fullFormats"),s=new i.Name("fastFormats"),a=(c,u={keywords:!0})=>{if(Array.isArray(u))return l(c,u,n.fullFormats,o),c;const[f,h]=u.mode==="fast"?[n.fastFormats,s]:[n.fullFormats,o],g=u.formats||n.formatNames;return l(c,g,f,h),u.keywords&&r.default(c),c};a.get=(c,u="full")=>{const h=(u==="fast"?n.fastFormats:n.fullFormats)[c];if(!h)throw new Error(`Unknown format "${c}"`);return h};function l(c,u,f,h){var g,y;(g=(y=c.opts.code).formats)!==null&&g!==void 0||(y.formats=i._`require("ajv-formats/dist/formats").${h}`);for(const b of u)c.addFormat(b,f[b])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(E3,E3.exports)),E3.exports}var qIe=WIe();const IU=us(qIe),GIe={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},KIe=/^(#?([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*\)))$/,YIe=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function XIe(e,t,n={},r,i=Oee,o){let s=new i({...GIe,...n});return r?IU(s,r):r!==!1&&IU(s),s.addFormat("data-url",YIe),s.addFormat("color",KIe),s.addKeyword(fu),s.addKeyword(jT),Array.isArray(e)&&s.addMetaSchema(e),Bn(t)&&Object.keys(t).forEach(a=>{s.addFormat(a,t[a])}),o&&(s=o(s)),s}function ZIe(e=[],t){return e.map(r=>{var i;const{instancePath:o,keyword:s,params:a,schemaPath:l,parentSchema:c,...u}=r;let{message:f=""}=u,h=o.replace(/\//g,"."),g=`${h} ${f}`.trim(),y="";const b=[...((i=a.deps)===null||i===void 0?void 0:i.split(", "))||[],a.missingProperty,a.property].filter(v=>v);if(b.length>0)b.forEach(v=>{const S=h?`${h}.${v}`:v;let C=$t(We(t,`${S.replace(/^\./,"")}`)).title;if(C===void 0){const w=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([v]);C=$t(We(t,w)).title}if(C)f=f.replace(`'${v}'`,`'${C}'`),y=C;else{const w=We(c,[Un,v,"title"]);w&&(f=f.replace(`'${v}'`,`'${w}'`),y=w)}}),g=f;else{const v=$t(We(t,`${h.replace(/^\./,"")}`)).title;if(v)g=`'${v}' ${f}`.trim(),y=v;else{const S=c?.title;S&&(g=`'${S}' ${f}`.trim(),y=S)}}return"missingProperty"in a&&(h=h?`${h}.${a.missingProperty}`:a.missingProperty),{name:s,property:h,message:f,params:a,stack:g,schemaPath:l,title:y}}).reduce((r,i)=>{const{message:o,schemaPath:s}=i,a=s?.indexOf(`/${Pn}/`),l=s?.indexOf(`/${nn}/`);let c;return a&&a>=0?c=s?.substring(0,a):l&&l>=0&&(c=s?.substring(0,l)),c&&r.find(f=>{var h;return f.message===o&&((h=f.schemaPath)===null||h===void 0?void 0:h.startsWith(c))})||r.push(i),r},[])}function JIe(e,t,n,r,i,o,s){const{validationError:a}=t;let l=ZIe(t.errors,s);a&&(l=[...l,{stack:a.message}]),typeof o=="function"&&(l=o(l,s));let c=AOe(l);if(a&&(c={...c,$schema:{__errors:[a.message]}}),typeof i!="function")return{errors:l,errorSchema:c};const u=FQ(e,r,n,r,!0),f=i(u,Qk(u),s,c),h=ree(f);return Z5({errors:l,errorSchema:c},h)}class QIe{constructor(t,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:o,ajvFormatOptions:s,AjvClass:a,extenderFn:l}=t;this.ajv=XIe(r,i,o,s,a,l),this.localizer=n}reset(){this.ajv.removeSchema()}rawValidation(t,n){var r,i;let o,s;try{t[pr]&&(s=this.ajv.getSchema(t[pr])),s===void 0&&(s=this.ajv.compile(t)),s(n)}catch(l){o=l}let a;return s&&(typeof this.localizer=="function"&&(((r=s.errors)!==null&&r!==void 0?r:[]).forEach(l=>{var c;["missingProperty","property"].forEach(u=>{var f;!((f=l.params)===null||f===void 0)&&f[u]&&(l.params[u]=`'${l.params[u]}'`)}),!((c=l.params)===null||c===void 0)&&c.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>`'${u}'`).join(", "))}),this.localizer(s.errors),((i=s.errors)!==null&&i!==void 0?i:[]).forEach(l=>{var c;["missingProperty","property"].forEach(u=>{var f;!((f=l.params)===null||f===void 0)&&f[u]&&(l.params[u]=l.params[u].slice(1,-1))}),!((c=l.params)===null||c===void 0)&&c.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>u.slice(1,-1)).join(", "))})),a=s.errors||void 0,s.errors=null),{errors:a,validationError:o}}validateFormData(t,n,r,i,o){const s=this.rawValidation(n,t);return JIe(this,s,t,n,r,i,o)}handleSchemaUpdate(t){var n,r;const i=(n=t[pr])!==null&&n!==void 0?n:MJ;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(t,i):_r(t,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(t,i))}isValid(t,n,r){var i;try{this.handleSchemaUpdate(r);const o=pM(t),s=(i=o[pr])!==null&&i!==void 0?i:yOe(o);let a;return a=this.ajv.getSchema(s),a===void 0&&(a=this.ajv.addSchema(o,s).getSchema(s)||this.ajv.compile(o)),a(n)}catch(o){return console.warn("Error encountered compiling schema:",o),!1}}}function ePe(e={},t){return new QIe(e,t)}const tPe=ePe();function nPe({uiSchema:e,registry:t,...n}){const{translateString:r}=t;return m.jsx(_n,{title:r(un.AddItemButton),...n,color:"primary",children:m.jsx(fc,{})})}function rPe(e){const{children:t,buttonsProps:n,hasDescription:r,hasToolbar:i,uiSchema:o,registry:s}=e,a=$t(o),l=Bt("ArrayFieldItemButtonsTemplate",s,a),c={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold",minWidth:0};return m.jsxs(dt,{container:!0,alignItems:"center",children:[m.jsx(dt,{size:{xs:8,sm:9,md:10,lg:11,xl:11.25},style:{overflow:"auto"},children:m.jsx(ce,{mb:2,children:m.jsx(Ur,{elevation:2,children:m.jsx(ce,{p:2,children:t})})})}),i&&m.jsx(dt,{sx:{mt:r?-5:-1.5},children:m.jsx(l,{...n,style:c})})]})}function iPe(e){const{canAdd:t,disabled:n,fieldPathId:r,uiSchema:i,items:o,optionalDataControl:s,onAddClick:a,readonly:l,registry:c,required:u,schema:f,title:h}=e,g=$t(i),y=Bt("ArrayFieldDescriptionTemplate",c,g),b=Bt("ArrayFieldTitleTemplate",c,g),v=!l&&!n,{ButtonTemplates:{AddButton:S}}=c.templates;return m.jsx(Ur,{elevation:2,children:m.jsxs(ce,{p:2,children:[m.jsx(b,{fieldPathId:r,title:g.title||h,schema:f,uiSchema:i,required:u,registry:c,optionalDataControl:v?s:void 0}),m.jsx(y,{fieldPathId:r,description:g.description||f.description,schema:f,uiSchema:i,registry:c}),v?void 0:s,o,t&&m.jsx(dt,{container:!0,justifyContent:"flex-end",children:m.jsx(dt,{children:m.jsx(ce,{mt:2,children:m.jsx(S,{id:Kl(r,"add"),className:"rjsf-array-item-add",onClick:a,disabled:n||l,uiSchema:i,registry:c})})})})]})})}function oPe(e){return Qe("MuiInputAdornment",e)}const PU=tt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var jU;const sPe=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${ye(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},aPe=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=e,a={root:["root",n&&"disablePointerEvents",i&&`position${ye(i)}`,s,r&&"hiddenLabel",o&&`size${ye(o)}`]};return et(a,oPe,t)},lPe=me("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:sPe})(Ge(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${PU.positionStart}&:not(.${PU.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),AM=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,h=ll()||{};let g=u;u&&h.variant,h&&!g&&(g=h.variant);const y={...r,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:a,position:c,variant:g},b=aPe(y);return m.jsx(fw.Provider,{value:null,children:m.jsx(lPe,{as:s,ownerState:y,className:Te(b.root,o),ref:n,...f,children:typeof i=="string"&&!l?m.jsx(ie,{color:"textSecondary",children:i}):m.jsxs(_.Fragment,{children:[c==="start"?jU||(jU=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,i]})})})}),cPe=["date","datetime-local","file","time"];function uPe(e){const{id:t,name:n,htmlName:r,placeholder:i,required:o,readonly:s,disabled:a,type:l,label:c,hideLabel:u,hideError:f,value:h,onChange:g,onChangeOverride:y,onBlur:b,onFocus:v,autofocus:S,options:C,schema:w,uiSchema:A,rawErrors:E=[],errorSchema:D,registry:O,InputLabelProps:T,InputProps:I,slotProps:N,...$}=e,{ClearButton:R}=O.templates.ButtonTemplates,{step:F,min:j,max:z,accept:L,...q}=JQ(w,l,C),V={...N?.htmlInput,step:F,min:j,max:z,accept:L,...w.examples?{list:Bw(t)}:void 0},U=({target:{value:Y}})=>g(Y===""?C.emptyValue:Y),K=({target:Y})=>b(t,Y&&Y.value),B=({target:Y})=>v(t,Y&&Y.value),W=cPe.includes(l)?{...N?.inputLabel,...T,shrink:!0}:{...N?.inputLabel,...T},X=_.useCallback(Y=>{var J;Y.preventDefault(),Y.stopPropagation(),g((J=C.emptyValue)!==null&&J!==void 0?J:"")},[g,C.emptyValue]),H={...I,...N?.input};if(C.allowClearTextInputs&&h&&!s&&!a){const Y=m.jsx(AM,{position:"end",children:m.jsx(R,{registry:O,onClick:X})});H.endAdornment=H.endAdornment?m.jsxs(m.Fragment,{children:[H.endAdornment,Y]}):Y}return m.jsxs(m.Fragment,{children:[m.jsx(Lr,{id:t,name:r||t,placeholder:i,label:sp(c||void 0,u,void 0),autoFocus:S,required:o,disabled:a||s,slotProps:{...N,input:H,htmlInput:V,inputLabel:W},...q,value:h||h===0?h:"",error:E.length>0,onChange:y||U,onBlur:K,onFocus:B,...$,"aria-describedby":Us(t,!!w.examples)}),m.jsx(bee,{id:t,schema:w})]})}function dPe(e){const{id:t,description:n,registry:r,uiSchema:i}=e;return n?m.jsx(ie,{id:t,variant:"subtitle2",style:{marginTop:"5px"},children:m.jsx(vM,{description:n,registry:r,uiSchema:i})}):null}function fPe({errors:e,registry:t}){const{translateString:n}=t;return m.jsx(Ur,{elevation:2,children:m.jsxs(ce,{mb:2,p:2,children:[m.jsx(ie,{variant:"h6",children:n(un.ErrorsLabel)}),m.jsx(bc,{dense:!0,children:e.map((r,i)=>m.jsxs(yf,{children:[m.jsx(Ul,{children:m.jsx(vf,{color:"error"})}),m.jsx(Va,{primary:r.stack})]},i))})]})})}function Xm(e){const{icon:t,color:n,uiSchema:r,registry:i,...o}=e;return m.jsx(_n,{...o,size:"small",color:n,children:t})}function hPe(e){const{registry:{translateString:t}}=e;return m.jsx(Xm,{title:t(un.CopyButton),...e,icon:m.jsx(Ah,{fontSize:"small"})})}function pPe(e){const{registry:{translateString:t}}=e;return m.jsx(Xm,{title:t(un.MoveDownButton),...e,icon:m.jsx(vT,{fontSize:"small"})})}function mPe(e){const{registry:{translateString:t}}=e;return m.jsx(Xm,{title:t(un.MoveUpButton),...e,icon:m.jsx(xT,{fontSize:"small"})})}function Tee(e){const{iconType:t,...n}=e,{registry:{translateString:r}}=n;return m.jsx(Xm,{title:r(un.RemoveButton),...n,color:"error",icon:m.jsx(oZ,{fontSize:t==="default"?void 0:"small"})})}function gPe(e){const{iconType:t,...n}=e,{registry:{translateString:r}}=n;return m.jsx(Xm,{title:r(un.ClearButton),...n,icon:m.jsx(VCe,{fontSize:t==="default"?void 0:"small"})})}function yPe(e){const{errors:t=[],fieldPathId:n}=e;if(t.length===0)return null;const r=uM(n);return m.jsx(bc,{id:r,dense:!0,disablePadding:!0,children:t.map((i,o)=>m.jsx(yf,{disableGutters:!0,children:m.jsx(bw,{component:"div",id:`${r}-${o}`,children:i})},o))})}function bPe(e){const{fieldPathId:t,help:n,uiSchema:r,registry:i}=e;return n?m.jsx(bw,{component:"div",id:dM(t),style:{marginTop:"5px"},children:m.jsx(xM,{help:n,registry:i,uiSchema:r})}):null}function vPe(e){const{id:t,children:n,classNames:r,style:i,disabled:o,displayLabel:s,hidden:a,label:l,onKeyRename:c,onKeyRenameBlur:u,onRemoveProperty:f,readonly:h,required:g,rawErrors:y=[],errors:b,help:v,description:S,rawDescription:C,schema:w,uiSchema:A,registry:E}=e,D=$t(A),O=Bt("WrapIfAdditionalTemplate",E,D);if(a)return m.jsx("div",{style:{display:"none"},children:n});const T=D.widget==="checkbox";return m.jsx(O,{classNames:r,style:i,disabled:o,id:t,label:l,displayLabel:s,rawDescription:C,onKeyRename:c,onKeyRenameBlur:u,onRemoveProperty:f,readonly:h,required:g,schema:w,uiSchema:A,registry:E,children:m.jsxs(pa,{fullWidth:!0,error:!!y.length,required:g,children:[n,s&&!T&&C?m.jsx(ie,{variant:"caption",color:"textSecondary",children:S}):null,b,v]})})}function xPe(e){const{children:t,column:n,...r}=e;return m.jsx(dt,{container:!n,...r,children:t})}function SPe(e){const{optionSchemaField:t,selector:n}=e;return m.jsxs(ce,{sx:{mb:2},children:[m.jsx(pa,{fullWidth:!0,sx:{mb:2},children:n}),t]})}function wPe(e){const{description:t,title:n,properties:r,required:i,disabled:o,readonly:s,uiSchema:a,fieldPathId:l,schema:c,formData:u,optionalDataControl:f,onAddProperty:h,registry:g}=e,y=$t(a),b=Bt("TitleFieldTemplate",g,y),v=Bt("DescriptionFieldTemplate",g,y),S=!s&&!o,{ButtonTemplates:{AddButton:C}}=g.templates;return m.jsxs(m.Fragment,{children:[n&&m.jsx(b,{id:zw(l),title:n,required:i,schema:c,uiSchema:a,registry:g,optionalDataControl:S?f:void 0}),t&&m.jsx(v,{id:op(l),description:t,schema:c,uiSchema:a,registry:g}),m.jsxs(dt,{container:!0,spacing:2,style:{marginTop:"10px"},children:[S?void 0:f,r.map((w,A)=>w.hidden?w.content:m.jsx(dt,{size:{xs:12},style:{marginBottom:"10px"},children:w.content},A))]}),RJ(c,a,u)&&m.jsx(dt,{container:!0,justifyContent:"flex-end",children:m.jsx(dt,{children:m.jsx(C,{id:Kl(l,"add"),className:"rjsf-object-property-expand",onClick:h,disabled:o||s,uiSchema:a,registry:g})})})]})}function CPe(e){const{id:t,registry:n,label:r,onAddClick:i,onRemoveClick:o}=e;return i?m.jsx(Xm,{id:t,registry:n,className:"rjsf-add-optional-data",onClick:i,title:r,icon:m.jsx(fc,{fontSize:"small"})}):o?m.jsx(Tee,{id:t,registry:n,className:"rjsf-remove-optional-data",onClick:o,title:r}):m.jsx("em",{id:t,children:r})}function EPe({uiSchema:e}){const{submitText:t,norender:n,props:r={}}=QQ(e);return n?null:m.jsx(ce,{marginTop:3,children:m.jsx(kt,{type:"submit",variant:"contained",color:"primary",...r,children:t})})}function APe({id:e,title:t,optionalDataControl:n}){let r=m.jsx(ie,{variant:"h5",children:t});return n&&(r=m.jsxs(dt,{container:!0,spacing:0,children:[m.jsx(dt,{size:"grow",children:r}),m.jsx(dt,{justifyContent:"flex-end",children:n})]})),m.jsxs(ce,{id:e,mb:1,mt:1,children:[r,m.jsx(gi,{})]})}function kPe(e){const{children:t,classNames:n,style:r,disabled:i,id:o,label:s,displayLabel:a,onKeyRenameBlur:l,onRemoveProperty:c,readonly:u,required:f,schema:h,uiSchema:g,registry:y}=e,{templates:b,translateString:v}=y,{RemoveButton:S}=b.ButtonTemplates,C=v(un.KeyLabel,[s]),w=fu in h,A={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return w?m.jsxs(dt,{container:!0,alignItems:"flex-start",spacing:2,className:n,style:r,children:[m.jsx(dt,{size:5.5,children:m.jsx(Lr,{fullWidth:!0,required:f,label:a?C:void 0,defaultValue:s,disabled:i||u,id:`${o}-key`,name:`${o}-key`,onBlur:u?void 0:l,type:"text"})}),m.jsx(dt,{size:5.5,children:t}),m.jsx(dt,{sx:{mt:1.5},children:m.jsx(S,{id:Kl(o,"remove"),className:"rjsf-object-property-remove",iconType:"default",style:A,disabled:i||u,onClick:c,uiSchema:g,registry:y})})]},`${o}-key`):m.jsx("div",{className:n,style:r,children:t})}function Mee(){return{ArrayFieldItemTemplate:rPe,ArrayFieldTemplate:iPe,BaseInputTemplate:uPe,ButtonTemplates:{AddButton:nPe,CopyButton:hPe,MoveDownButton:pPe,MoveUpButton:mPe,RemoveButton:Tee,SubmitButton:EPe,ClearButton:gPe},DescriptionFieldTemplate:dPe,ErrorListTemplate:fPe,FieldErrorTemplate:yPe,FieldHelpTemplate:bPe,FieldTemplate:vPe,GridTemplate:xPe,MultiSchemaFieldTemplate:SPe,ObjectFieldTemplate:wPe,OptionalDataControlsTemplate:CPe,TitleFieldTemplate:APe,WrapIfAdditionalTemplate:kPe}}function _Pe(e){var t;const{schema:n,id:r,htmlName:i,value:o,disabled:s,readonly:a,label:l="",hideLabel:c,autofocus:u,onChange:f,onBlur:h,onFocus:g,registry:y,options:b,uiSchema:v}=e,S=Bt("DescriptionFieldTemplate",y,b),C=py(n),w=(O,T)=>f(T),A=()=>h(r,o),E=()=>g(r,o),D=(t=b.description)!==null&&t!==void 0?t:n.description;return m.jsxs(m.Fragment,{children:[!c&&D&&m.jsx(S,{id:op(r),description:D,schema:n,uiSchema:v,registry:y}),m.jsx(Ls,{control:m.jsx(Wl,{id:r,name:i||r,checked:typeof o>"u"?!1:!!o,required:C,disabled:s||a,autoFocus:u,onChange:w,onBlur:A,onFocus:E,"aria-describedby":Us(r)}),label:sp(l,c,!1)})]})}function DPe(e){return Qe("MuiFormGroup",e)}tt("MuiFormGroup",["root","row","error"]);const OPe=e=>{const{classes:t,row:n,error:r}=e;return et({root:["root",n&&"row",r&&"error"]},DPe,t)},TPe=me("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),Ree=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=ll(),l=xf({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=OPe(c);return m.jsx(TPe,{className:Te(u.root,i),ownerState:c,ref:n,...s})});function MPe({label:e,hideLabel:t,id:n,htmlName:r,disabled:i,options:o,value:s,autofocus:a,readonly:l,required:c,onChange:u,onBlur:f,onFocus:h}){const{enumOptions:g,enumDisabled:y,inline:b,emptyValue:v}=o,S=Array.isArray(s)?s:[s],C=E=>({target:{checked:D}})=>{u(D?YQ(E,S,g):KQ(E,S,g))},w=({target:E})=>f(n,no(E&&E.value,g,v)),A=({target:E})=>h(n,no(E&&E.value,g,v));return m.jsxs(m.Fragment,{children:[sp(m.jsx(hw,{required:c,htmlFor:n,children:e||void 0}),t),m.jsx(Ree,{id:n,row:!!b,children:Array.isArray(g)&&g.map((E,D)=>{const O=Fw(E.value,S),T=Array.isArray(y)&&y.indexOf(E.value)!==-1,I=m.jsx(Wl,{id:Hw(n,D),name:r||n,checked:O,disabled:i||T||l,autoFocus:a&&D===0,onChange:C(D),onBlur:w,onFocus:A,"aria-describedby":Us(n)});return m.jsx(Ls,{control:I,label:E.label},D)})})]})}const RPe=_e(m.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"})),IPe=_e(m.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"})),PPe=me("span",{name:"MuiRadioButtonIcon",shouldForwardProp:io})({position:"relative",display:"flex"}),jPe=me(RPe,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),$Pe=me(IPe,{name:"MuiRadioButtonIcon"})(Ge(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function Iee(e){const{checked:t=!1,classes:n={},fontSize:r}=e,i={...e,checked:t};return m.jsxs(PPe,{className:n.root,ownerState:i,children:[m.jsx(jPe,{fontSize:r,className:n.background,ownerState:i}),m.jsx($Pe,{fontSize:r,className:n.dot,ownerState:i})]})}const Pee=_.createContext(void 0);function LPe(){return _.useContext(Pee)}function NPe(e){return Qe("MuiRadio",e)}const $U=tt("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),FPe=e=>{const{classes:t,color:n,size:r}=e,i={root:["root",`color${ye(n)}`,r!=="medium"&&`size${ye(r)}`]};return{...t,...et(i,NPe,t)}},BPe=me(uT,{shouldForwardProp:e=>io(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size!=="medium"&&t[`size${ye(n.size)}`],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${$U.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${$U.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function zPe(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const HPe=m.jsx(Iee,{checked:!0}),UPe=m.jsx(Iee,{}),VPe=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiRadio"}),{checked:i,checkedIcon:o=HPe,color:s="primary",icon:a=UPe,name:l,onChange:c,size:u="medium",className:f,disabled:h,disableRipple:g=!1,slots:y={},slotProps:b={},inputProps:v,...S}=r,C=ll();let w=h;C&&typeof w>"u"&&(w=C.disabled),w??=!1;const A={...r,disabled:w,disableRipple:g,color:s,size:u},E=FPe(A),D=LPe();let O=i;const T=mk(c,D&&D.onChange);let I=l;D&&(typeof O>"u"&&(O=zPe(D.value,r.value)),typeof I>"u"&&(I=D.name));const N=b.input??v,[$,R]=lt("root",{ref:n,elementType:BPe,className:Te(E.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:y,slotProps:b,...S},getSlotProps:F=>({...F,onChange:(j,...z)=>{F.onChange?.(j,...z),T(j,...z)}}),ownerState:A,additionalProps:{type:"radio",icon:_.cloneElement(a,{fontSize:a.props.fontSize??u}),checkedIcon:_.cloneElement(o,{fontSize:o.props.fontSize??u}),disabled:w,name:I,checked:O,slots:y,slotProps:{input:typeof N=="function"?N(A):N}}});return m.jsx($,{...R,classes:E})});function WPe(e){return Qe("MuiRadioGroup",e)}tt("MuiRadioGroup",["root","row","error"]);const qPe=e=>{const{classes:t,row:n,error:r}=e;return et({root:["root",n&&"row",r&&"error"]},WPe,t)},GPe=_.forwardRef(function(t,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=t,f=_.useRef(null),h=qPe(t),[g,y]=Ya({controlled:c,default:s,name:"RadioGroup"});_.useImperativeHandle(r,()=>({focus:()=>{let C=f.current.querySelector("input:not(:disabled):checked");C||(C=f.current.querySelector("input:not(:disabled)")),C&&C.focus()}}),[]);const b=Tr(n,f),v=Ou(a),S=_.useMemo(()=>({name:v,onChange(C){y(C.target.value),l&&l(C,C.target.value)},value:g}),[v,l,y,g]);return m.jsx(Pee.Provider,{value:S,children:m.jsx(Ree,{role:"radiogroup",ref:b,className:Te(h.root,o),...u,children:i})})});function KPe({id:e,htmlName:t,options:n,value:r,required:i,disabled:o,readonly:s,label:a,hideLabel:l,onChange:c,onBlur:u,onFocus:f}){var h;const{enumOptions:g,enumDisabled:y,emptyValue:b}=n,v=(E,D)=>c(no(D,g,b)),S=({target:E})=>u(e,no(E&&E.value,g,b)),C=({target:E})=>f(e,no(E&&E.value,g,b)),w=n?n.inline:!1,A=(h=aM(r,g))!==null&&h!==void 0?h:null;return m.jsxs(m.Fragment,{children:[sp(m.jsx(hw,{required:i,htmlFor:e,children:a||void 0}),l),m.jsx(GPe,{id:e,name:t||e,value:A,row:w,onChange:v,onBlur:S,onFocus:C,"aria-describedby":Us(e),children:Array.isArray(g)&&g.map((E,D)=>{const O=Array.isArray(y)&&y.indexOf(E.value)!==-1;return m.jsx(Ls,{control:m.jsx(VPe,{name:t||e,id:Hw(e,D),color:"primary"}),label:E.label,value:String(D),disabled:o||O||s},D)})})]})}const YPe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function XPe(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const ZPe=2;function e0(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function jee(e,t){return e-t}function LU(e,t){const{index:n}=e.reduce((r,i,o)=>{const s=Math.abs(t-i);return r===null||s<r.distance||s===r.distance?{distance:s,index:o}:r},null)??{};return n}function A3(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let r=0;r<n.changedTouches.length;r+=1){const i=n.changedTouches[r];if(i.identifier===t.current)return{x:i.clientX,y:i.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function u6(e,t,n){return(e-t)*100/(n-t)}function JPe(e,t,n){return(n-t)*e+t}function QPe(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function eje(e,t,n){const r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(QPe(t)))}function NU({values:e,newValue:t,index:n}){const r=e.slice();return r[n]=t,r.sort(jee)}function k3({sliderRef:e,activeIndex:t,setActive:n}){const r=Di(e.current);(!e.current?.contains(r.activeElement)||Number(r?.activeElement?.getAttribute("data-index"))!==t)&&e.current?.querySelector(`[type="range"][data-index="${t}"]`).focus(),n&&n(t)}function _3(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?XPe(e,t):!1}const tje={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},nje=e=>e;let D3;function FU(){return D3===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?D3=CSS.supports("touch-action","none"):D3=!0),D3}function rje(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:h="horizontal",rootRef:g,scale:y=nje,step:b=1,shiftStep:v=10,tabIndex:S,value:C}=e,w=_.useRef(void 0),[A,E]=_.useState(-1),[D,O]=_.useState(-1),[T,I]=_.useState(!1),N=_.useRef(0),$=_.useRef(null),[R,F]=Ya({controlled:C,default:n??l,name:"Slider"}),j=u&&((ze,Pe,He)=>{const Je=ze.nativeEvent||ze,nt=new Je.constructor(Je.type,Je);Object.defineProperty(nt,"target",{writable:!0,value:{value:Pe,name:c}}),$.current=Pe,u(nt,Pe,He)}),z=Array.isArray(R);let L=z?R.slice().sort(jee):[R];L=L.map(ze=>ze==null?l:l0(ze,l,a));const q=s===!0&&b!==null?[...Array(Math.floor((a-l)/b)+1)].map((ze,Pe)=>({value:l+b*Pe})):s||[],V=q.map(ze=>ze.value),[U,K]=_.useState(-1),B=_.useRef(null),W=Tr(g,B),X=ze=>Pe=>{const He=Number(Pe.currentTarget.getAttribute("data-index"));Gd(Pe.target)&&K(He),O(He),ze?.onFocus?.(Pe)},H=ze=>Pe=>{Gd(Pe.target)||K(-1),O(-1),ze?.onBlur?.(Pe)},Y=(ze,Pe)=>{const He=Number(ze.currentTarget.getAttribute("data-index")),Je=L[He],nt=V.indexOf(Je);let ot=Pe;if(q&&b==null){const Xe=V[V.length-1];ot>=Xe?ot=Xe:ot<=V[0]?ot=V[0]:ot=ot<Je?V[nt-1]:V[nt+1]}if(ot=l0(ot,l,a),z){i&&(ot=l0(ot,L[He-1]||-1/0,L[He+1]||1/0));const Xe=ot;ot=NU({values:L,newValue:ot,index:He});let Lt=He;i||(Lt=ot.indexOf(Xe)),k3({sliderRef:B,activeIndex:Lt})}F(ot),K(He),j&&!_3(ot,R)&&j(ze,ot,He),f&&f(ze,$.current??ot)},J=ze=>Pe=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(Pe.key)){Pe.preventDefault();const He=Number(Pe.currentTarget.getAttribute("data-index")),Je=L[He];let nt=null;if(b!=null){const ot=Pe.shiftKey?v:b;switch(Pe.key){case"ArrowUp":nt=e0(Je,ot,1,l,a);break;case"ArrowRight":nt=e0(Je,ot,o?-1:1,l,a);break;case"ArrowDown":nt=e0(Je,ot,-1,l,a);break;case"ArrowLeft":nt=e0(Je,ot,o?1:-1,l,a);break;case"PageUp":nt=e0(Je,v,1,l,a);break;case"PageDown":nt=e0(Je,v,-1,l,a);break;case"Home":nt=l;break;case"End":nt=a;break}}else if(q){const ot=V[V.length-1],Xe=V.indexOf(Je),Lt=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],Nt=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];Lt.includes(Pe.key)?Xe===0?nt=V[0]:nt=V[Xe-1]:Nt.includes(Pe.key)&&(Xe===V.length-1?nt=ot:nt=V[Xe+1])}nt!=null&&Y(Pe,nt)}ze?.onKeyDown?.(Pe)};Ho(()=>{r&&B.current.contains(document.activeElement)&&document.activeElement?.blur()},[r]),r&&A!==-1&&E(-1),r&&U!==-1&&K(-1);const ne=ze=>Pe=>{ze.onChange?.(Pe),Y(Pe,Pe.target.valueAsNumber)},ee=_.useRef(void 0);let se=h;o&&h==="horizontal"&&(se+="-reverse");const ue=({finger:ze,move:Pe=!1})=>{const{current:He}=B,{width:Je,height:nt,bottom:ot,left:Xe}=He.getBoundingClientRect();let Lt;se.startsWith("vertical")?Lt=(ot-ze.y)/nt:Lt=(ze.x-Xe)/Je,se.includes("-reverse")&&(Lt=1-Lt);let Nt;if(Nt=JPe(Lt,l,a),b)Nt=eje(Nt,b,l);else{const Xn=LU(V,Nt);Nt=V[Xn]}Nt=l0(Nt,l,a);let Ot=0;if(z){Pe?Ot=ee.current:Ot=LU(L,Nt),i&&(Nt=l0(Nt,L[Ot-1]||-1/0,L[Ot+1]||1/0));const Xn=Nt;Nt=NU({values:L,newValue:Nt,index:Ot}),i&&Pe||(Ot=Nt.indexOf(Xn),ee.current=Ot)}return{newValue:Nt,activeIndex:Ot}},te=Ni(ze=>{const Pe=A3(ze,w);if(!Pe)return;if(N.current+=1,ze.type==="mousemove"&&ze.buttons===0){Z(ze);return}const{newValue:He,activeIndex:Je}=ue({finger:Pe,move:!0});k3({sliderRef:B,activeIndex:Je,setActive:E}),F(He),!T&&N.current>ZPe&&I(!0),j&&!_3(He,R)&&j(ze,He,Je)}),Z=Ni(ze=>{const Pe=A3(ze,w);if(I(!1),!Pe)return;const{newValue:He}=ue({finger:Pe,move:!0});E(-1),ze.type==="touchend"&&O(-1),f&&f(ze,$.current??He),w.current=void 0,oe()}),re=Ni(ze=>{if(r)return;FU()||ze.preventDefault();const Pe=ze.changedTouches[0];Pe!=null&&(w.current=Pe.identifier);const He=A3(ze,w);if(He!==!1){const{newValue:nt,activeIndex:ot}=ue({finger:He});k3({sliderRef:B,activeIndex:ot,setActive:E}),F(nt),j&&!_3(nt,R)&&j(ze,nt,ot)}N.current=0;const Je=Di(B.current);Je.addEventListener("touchmove",te,{passive:!0}),Je.addEventListener("touchend",Z,{passive:!0})}),oe=_.useCallback(()=>{const ze=Di(B.current);ze.removeEventListener("mousemove",te),ze.removeEventListener("mouseup",Z),ze.removeEventListener("touchmove",te),ze.removeEventListener("touchend",Z)},[Z,te]);_.useEffect(()=>{const{current:ze}=B;return ze.addEventListener("touchstart",re,{passive:FU()}),()=>{ze.removeEventListener("touchstart",re),oe()}},[oe,re]),_.useEffect(()=>{r&&oe()},[r,oe]);const fe=ze=>Pe=>{if(ze.onMouseDown?.(Pe),r||Pe.defaultPrevented||Pe.button!==0)return;Pe.preventDefault();const He=A3(Pe,w);if(He!==!1){const{newValue:nt,activeIndex:ot}=ue({finger:He});k3({sliderRef:B,activeIndex:ot,setActive:E}),F(nt),j&&!_3(nt,R)&&j(Pe,nt,ot)}N.current=0;const Je=Di(B.current);Je.addEventListener("mousemove",te,{passive:!0}),Je.addEventListener("mouseup",Z)},be=u6(z?L[0]:l,l,a),De=u6(L[L.length-1],l,a)-be,Oe=(ze={})=>{const Pe=Yi(ze),He={onMouseDown:fe(Pe||{})},Je={...Pe,...He};return{...ze,ref:W,...Je}},Ke=ze=>Pe=>{ze.onMouseOver?.(Pe);const He=Number(Pe.currentTarget.getAttribute("data-index"));O(He)},xe=ze=>Pe=>{ze.onMouseLeave?.(Pe),O(-1)},Le=(ze={})=>{const Pe=Yi(ze),He={onMouseOver:Ke(Pe||{}),onMouseLeave:xe(Pe||{})};return{...ze,...Pe,...He}},Me=ze=>({pointerEvents:A!==-1&&A!==ze?"none":void 0});let ht;return h==="vertical"&&(ht=o?"vertical-rl":"vertical-lr"),{active:A,axis:se,axisProps:tje,dragging:T,focusedThumbIndex:U,getHiddenInputProps:(ze={})=>{const Pe=Yi(ze),He={onChange:ne(Pe||{}),onFocus:X(Pe||{}),onBlur:H(Pe||{}),onKeyDown:J(Pe||{})},Je={...Pe,...He};return{tabIndex:S,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":y(a),"aria-valuemin":y(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:r,...ze,...Je,style:{...YPe,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:ht}}},getRootProps:Oe,getThumbProps:Le,marks:q,open:D,range:z,rootRef:W,trackLeap:De,trackOffset:be,values:L,getThumbStyle:Me}}const ije=e=>!e||!ic(e);function oje(e){return Qe("MuiSlider",e)}const aa=tt("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),sje=e=>{const{open:t}=e;return{offset:Te(t&&aa.valueLabelOpen),circle:aa.valueLabelCircle,label:aa.valueLabelLabel}};function aje(e){const{children:t,className:n,value:r}=e,i=sje(e);return t?_.cloneElement(t,{className:t.props.className},m.jsxs(_.Fragment,{children:[t.props.children,m.jsx("span",{className:Te(i.offset,n),"aria-hidden":!0,children:m.jsx("span",{className:i.circle,children:m.jsx("span",{className:i.label,children:r})})})]})):null}function BU(e){return e}const lje=me("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${ye(n.color)}`],n.size!=="medium"&&t[`size${ye(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Ge(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${aa.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${aa.dragging}`]:{[`& .${aa.thumb}, & .${aa.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),cje=me("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),uje=me("span",{name:"MuiSlider",slot:"Track"})(Ge(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),dje=me("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${ye(n.color)}`],n.size!=="medium"&&t[`thumbSize${ye(n.size)}`]]}})(Ge(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${aa.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${aa.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${aa.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),fje=me(aje,{name:"MuiSlider",slot:"ValueLabel"})(Ge(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${aa.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${aa.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),hje=me("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>GS(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Ge(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),pje=me("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>GS(e)&&e!=="markLabelActive"})(Ge(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),mje=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=e,c={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${ye(a)}`,l&&`size${ye(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${ye(l)}`,a&&`thumbColor${ye(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return et(c,oje,s)},gje=({children:e})=>e,yje=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiSlider"}),i=mf(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:h,className:g,disableSwap:y=!1,disabled:b=!1,getAriaLabel:v,getAriaValueText:S,marks:C=!1,max:w=100,min:A=0,name:E,onChange:D,onChangeCommitted:O,orientation:T="horizontal",shiftStep:I=10,size:N="medium",step:$=1,scale:R=BU,slotProps:F,slots:j,tabIndex:z,track:L="normal",value:q,valueLabelDisplay:V="off",valueLabelFormat:U=BU,...K}=r,B={...r,isRtl:i,max:w,min:A,classes:h,disabled:b,disableSwap:y,orientation:T,marks:C,color:f,size:N,step:$,shiftStep:I,scale:R,track:L,valueLabelDisplay:V,valueLabelFormat:U},{axisProps:W,getRootProps:X,getHiddenInputProps:H,getThumbProps:Y,open:J,active:ne,axis:ee,focusedThumbIndex:se,range:ue,dragging:te,marks:Z,values:re,trackOffset:oe,trackLeap:fe,getThumbStyle:be}=rje({...B,rootRef:n});B.marked=Z.length>0&&Z.some(Dt=>Dt.label),B.dragging=te,B.focusedThumbIndex=se;const De=mje(B),Oe=j?.root??c.Root??lje,Ke=j?.rail??c.Rail??cje,xe=j?.track??c.Track??uje,Le=j?.thumb??c.Thumb??dje,Me=j?.valueLabel??c.ValueLabel??fje,ht=j?.mark??c.Mark??hje,mt=j?.markLabel??c.MarkLabel??pje,ze=j?.input??c.Input??"input",Pe=F?.root??u.root,He=F?.rail??u.rail,Je=F?.track??u.track,nt=F?.thumb??u.thumb,ot=F?.valueLabel??u.valueLabel,Xe=F?.mark??u.mark,Lt=F?.markLabel??u.markLabel,Nt=F?.input??u.input,Ot=Yr({elementType:Oe,getSlotProps:X,externalSlotProps:Pe,externalForwardedProps:K,additionalProps:{...ije(Oe)&&{as:l}},ownerState:{...B,...Pe?.ownerState},className:[De.root,g]}),Xn=Yr({elementType:Ke,externalSlotProps:He,ownerState:B,className:De.rail}),rn=Yr({elementType:xe,externalSlotProps:Je,additionalProps:{style:{...W[ee].offset(oe),...W[ee].leap(fe)}},ownerState:{...B,...Je?.ownerState},className:De.track}),at=Yr({elementType:Le,getSlotProps:Y,externalSlotProps:nt,ownerState:{...B,...nt?.ownerState},className:De.thumb}),Ht=Yr({elementType:Me,externalSlotProps:ot,ownerState:{...B,...ot?.ownerState},className:De.valueLabel}),Dn=Yr({elementType:ht,externalSlotProps:Xe,ownerState:B,className:De.mark}),Gn=Yr({elementType:mt,externalSlotProps:Lt,ownerState:B,className:De.markLabel}),yr=Yr({elementType:ze,getSlotProps:H,externalSlotProps:Nt,ownerState:B});return m.jsxs(Oe,{...Ot,children:[m.jsx(Ke,{...Xn}),m.jsx(xe,{...rn}),Z.filter(Dt=>Dt.value>=A&&Dt.value<=w).map((Dt,jt)=>{const Jt=u6(Dt.value,A,w),jn=W[ee].offset(Jt);let on;return L===!1?on=re.includes(Dt.value):on=L==="normal"&&(ue?Dt.value>=re[0]&&Dt.value<=re[re.length-1]:Dt.value<=re[0])||L==="inverted"&&(ue?Dt.value<=re[0]||Dt.value>=re[re.length-1]:Dt.value>=re[0]),m.jsxs(_.Fragment,{children:[m.jsx(ht,{"data-index":jt,...Dn,...!ic(ht)&&{markActive:on},style:{...jn,...Dn.style},className:Te(Dn.className,on&&De.markActive)}),Dt.label!=null?m.jsx(mt,{"aria-hidden":!0,"data-index":jt,...Gn,...!ic(mt)&&{markLabelActive:on},style:{...jn,...Gn.style},className:Te(De.markLabel,Gn.className,on&&De.markLabelActive),children:Dt.label}):null]},jt)}),re.map((Dt,jt)=>{const Jt=u6(Dt,A,w),jn=W[ee].offset(Jt),on=V==="off"?gje:Me;return m.jsx(on,{...!ic(on)&&{valueLabelFormat:U,valueLabelDisplay:V,value:typeof U=="function"?U(R(Dt),jt):U,index:jt,open:J===jt||ne===jt||V==="on",disabled:b},...Ht,children:m.jsx(Le,{"data-index":jt,...at,className:Te(De.thumb,at.className,ne===jt&&De.active,se===jt&&De.focusVisible),style:{...jn,...be(jt),...at.style},children:m.jsx(ze,{"data-index":jt,"aria-label":v?v(jt):o,"aria-valuenow":R(Dt),"aria-labelledby":a,"aria-valuetext":S?S(R(Dt),jt):s,value:re[jt],...yr})})},jt)})]})});function bje(e){const{value:t,readonly:n,disabled:r,onBlur:i,onFocus:o,options:s,schema:a,onChange:l,required:c,label:u,hideLabel:f,id:h}=e,g={value:t,label:u,id:h,name:h,...ZQ(a)},y=(S,C)=>{l(C??s.emptyValue)},b=({target:S})=>i(h,S&&S.value),v=({target:S})=>o(h,S&&S.value);return m.jsxs(m.Fragment,{children:[sp(m.jsx(hw,{required:c,htmlFor:h,children:u||void 0}),f),m.jsx(yje,{disabled:r||n,onChange:y,onBlur:b,onFocus:v,valueLabelDisplay:"auto",...g,"aria-describedby":Us(h)})]})}function vje({schema:e,id:t,name:n,htmlName:r,options:i,label:o,hideLabel:s,required:a,disabled:l,placeholder:c,readonly:u,value:f,multiple:h,autofocus:g,onChange:y,onBlur:b,onFocus:v,errorSchema:S,rawErrors:C=[],registry:w,uiSchema:A,hideError:E,...D}){const{enumOptions:O,enumDisabled:T,emptyValue:I}=i;h=typeof h>"u"?!1:!!h;const N=h?[]:"",$=typeof f>"u"||h&&f.length<1||!h&&f===N,R=({target:{value:B}})=>y(no(B,O,I)),F=({target:B})=>b(t,no(B&&B.value,O,I)),j=({target:B})=>v(t,no(B&&B.value,O,I)),z=aM(f,O,h),{InputLabelProps:L,SelectProps:q,autocomplete:V,...U}=D,K=!h&&e.default===void 0;return m.jsxs(Lr,{id:t,name:r||t,label:sp(o||void 0,s,void 0),value:!$&&typeof z<"u"?z:N,required:a,disabled:l||u,autoFocus:g,autoComplete:V,placeholder:c,error:C.length>0,onChange:R,onBlur:F,onFocus:j,...U,select:!0,InputLabelProps:{...L,shrink:!$},SelectProps:{...q,multiple:h},"aria-describedby":Us(t),children:[K&&m.jsx(er,{value:"",children:c}),Array.isArray(O)&&O.map(({value:B,label:W},X)=>{const H=Array.isArray(T)&&T.indexOf(B)!==-1;return m.jsx(er,{value:String(X),disabled:H,children:W},X)})]})}function xje(e){const{options:t,registry:n}=e,r=Bt("BaseInputTemplate",n,t);let i=5;return(typeof t.rows=="string"||typeof t.rows=="number")&&(i=t.rows),m.jsx(r,{...e,multiline:!0,rows:i})}function Sje(){return{CheckboxWidget:_Pe,CheckboxesWidget:MPe,RadioWidget:KPe,RangeWidget:bje,SelectWidget:vje,TextareaWidget:xje}}function $ee(){return{templates:Mee(),widgets:Sje()}}const wje=$ee();function Cje(){return wee($ee())}Cje();const Eje=wee(wje),Aje=e=>{const t=(i,o)=>{e.onChange(i,o.length===0)},n=e.customValidate,r=_.useCallback((i,o)=>((n?.(i)??[]).forEach(a=>{if(!a.message)return;const l=a.instancePath.split("/");let c=o;for(const u of l)u!==""&&(c=c[u]??c);c.addError(a.message)}),o),[n]);return m.jsx(Eje,{schema:e.schema,uiSchema:e.uiSchema,validator:tPe,formData:e.value,liveValidate:"onChange",customValidate:r,showErrorList:!1,onChange:i=>t(i.formData,i.errors),templates:e.templates,fields:e.fields})},Lee=1024;let kje=0,OE=class{constructor(t,n){this.from=t,this.to=n}};class xn{constructor(t={}){this.id=kje++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=ls.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}xn.closedBy=new xn({deserialize:e=>e.split(" ")});xn.openedBy=new xn({deserialize:e=>e.split(" ")});xn.group=new xn({deserialize:e=>e.split(" ")});xn.isolate=new xn({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});xn.contextHash=new xn({perNode:!0});xn.lookAhead=new xn({perNode:!0});xn.mounted=new xn({perNode:!0});class yy{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[xn.mounted.id]}}const _je=Object.create(null);class ls{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):_je,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new ls(t.name||"",n,t.id,r);if(t.props){for(let o of t.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(xn.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(xn.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}ls.none=new ls("",Object.create(null),0,8);class kM{constructor(t){this.types=t;for(let n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let n=[];for(let r of this.types){let i=null;for(let o of t){let s=o(r);if(s){i||(i=Object.assign({},r.props));let a=s[1],l=s[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}n.push(i?new ls(r.name,i,r.id,r.flags):r)}return new kM(n)}}const O3=new WeakMap,zU=new WeakMap;var ai;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(ai||(ai={}));class mi{constructor(t,n,r,i,o){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let t=yy.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(t=0){return new p_(this.topNode,t)}cursorAt(t,n=0,r=0){let i=O3.get(this)||this.topNode,o=new p_(i);return o.moveTo(t,n),O3.set(this,o._tree),o}get topNode(){return new ma(this,0,0,null)}resolve(t,n=0){let r=f2(O3.get(this)||this.topNode,t,n,!1);return O3.set(this,r),r}resolveInner(t,n=0){let r=f2(zU.get(this)||this.topNode,t,n,!0);return zU.set(this,r),r}resolveStack(t,n=0){return Tje(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:o=this.length}=t,s=t.mode||0,a=(s&ai.IncludeAnonymous)>0;for(let l=this.cursor(s|ai.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:OM(ls.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new mi(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new mi(ls.none,n,r,i)))}static build(t){return Mje(t)}}mi.empty=new mi(ls.none,[],[],0);class _M{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new _M(this.buffer,this.index)}}class tf{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return ls.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),t+=4,r==t)return o;let s=[];for(;t<r;)s.push(this.childString(t)),t=this.buffer[t+3];return o+"("+s.join(",")+")"}findChild(t,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=t;l!=n&&!(Nee(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(t,n,r){let i=this.buffer,o=new Uint16Array(n-t),s=0;for(let a=t,l=0;a<n;){o[l++]=i[a++],o[l++]=i[a++]-r;let c=o[l++]=i[a++]-r;o[l++]=i[a++]-t,s=Math.max(s,c)}return new tf(o,s,this.set)}}function Nee(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function f2(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let s=!r&&e instanceof ma&&e.index<0?null:e.parent;if(!s)return e;e=s}let o=r?0:ai.IgnoreOverlays;if(r)for(let s=e,a=s.parent;a;s=a,a=s.parent)s instanceof ma&&s.index<0&&((i=a.enter(t,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(e=a);for(;;){let s=e.enter(t,n,o);if(!s)return e;e=s}}class Fee{cursor(t=0){return new p_(this,t)}getChild(t,n=null,r=null){let i=HU(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return HU(this,t,n,r)}resolve(t,n=0){return f2(this,t,n,!1)}resolveInner(t,n=0){return f2(this,t,n,!0)}matchContext(t){return h_(this.parent,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class ma extends Fee{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;t!=c;t+=n){let u=a[t],f=l[t]+s.from,h;if(!(!(o&ai.EnterBracketed&&u instanceof mi&&(h=yy.get(u))&&!h.overlay&&h.bracketed&&r>=f&&r<=f+u.length)&&!Nee(i,r,f,f+u.length))){if(u instanceof tf){if(o&ai.ExcludeBuffers)continue;let g=u.findChild(0,u.buffer.length,n,r-f,i);if(g>-1)return new Rd(new Dje(s,u,t,f),null,g)}else if(o&ai.IncludeAnonymous||!u.type.isAnonymous||DM(u)){let g;if(!(o&ai.IgnoreMounts)&&(g=yy.get(u))&&!g.overlay)return new ma(g.tree,f,t,s);let y=new ma(u,f,t,s);return o&ai.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?u.children.length-1:0,n,r,i,o)}}}if(o&ai.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?t=s.index+n:t=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&ai.IgnoreOverlays)&&(i=yy.get(this._tree))&&i.overlay){let o=t-this.from,s=r&ai.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((n>0||s?a<=o:a<o)&&(n<0||s?l>=o:l>o))return new ma(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function HU(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function h_(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class Dje{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Rd extends Fee{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new Rd(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&ai.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new Rd(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Rd(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Rd(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];t.push(r.slice(i,o,s)),n.push(0)}return new mi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Bee(e){if(!e.length)return null;let t=0,n=e[0];for(let o=1;o<e.length;o++){let s=e[o];(s.from>n.from||s.to<n.to)&&(n=s,t=o)}let r=n instanceof ma&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Oje(i,n)}class Oje{constructor(t,n){this.heads=t,this.node=n}get next(){return Bee(this.heads)}}function Tje(e,t,n){let r=e.resolveInner(t,n),i=null;for(let o=r instanceof ma?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(t,n)),o=s}else{let s=yy.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let a=new ma(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(f2(a,t,n,!1))}}return i?Bee(i):r}class p_{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~ai.EnterBracketed,t instanceof ma)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof ma?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&ai.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ai.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&ai.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+t,s=t<0?-1:r._tree.children.length;o!=s;o+=t){let a=r._tree.children[o];if(this.mode&ai.IncludeAnonymous||a instanceof tf||!a.type.isAnonymous||DM(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new Rd(this.buffer,n,this.stack[i]);return this.bufferNode=new Rd(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return h_(this.node.parent,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return h_(this._tree,t,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function DM(e){return e.children.some(t=>t instanceof tf||!t.type.isAnonymous||DM(t))}function Mje(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=Lee,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new _M(n,n.length):n,l=r.types,c=0,u=0;function f(E,D,O,T,I,N){let{id:$,start:R,end:F,size:j}=a,z=u,L=c;if(j<0)if(a.next(),j==-1){let B=o[$];O.push(B),T.push(R-E);return}else if(j==-3){c=$;return}else if(j==-4){u=$;return}else throw new RangeError(`Unrecognized record size: ${j}`);let q=l[$],V,U,K=R-E;if(F-R<=i&&(U=v(a.pos-D,I))){let B=new Uint16Array(U.size-U.skip),W=a.pos-U.size,X=B.length;for(;a.pos>W;)X=S(U.start,B,X);V=new tf(B,F-U.start,r),K=U.start-E}else{let B=a.pos-j;a.next();let W=[],X=[],H=$>=s?$:-1,Y=0,J=F;for(;a.pos>B;)H>=0&&a.id==H&&a.size>=0?(a.end<=J-i&&(y(W,X,R,Y,a.end,J,H,z,L),Y=W.length,J=a.end),a.next()):N>2500?h(R,B,W,X):f(R,B,W,X,H,N+1);if(H>=0&&Y>0&&Y<W.length&&y(W,X,R,Y,R,J,H,z,L),W.reverse(),X.reverse(),H>-1&&Y>0){let ne=g(q,L);V=OM(q,W,X,0,W.length,0,F-R,ne,ne)}else V=b(q,W,X,F-R,z-F,L)}O.push(V),T.push(K)}function h(E,D,O,T){let I=[],N=0,$=-1;for(;a.pos>D;){let{id:R,start:F,end:j,size:z}=a;if(z>4)a.next();else{if($>-1&&F<$)break;$<0&&($=j-i),I.push(R,F,j),N++,a.next()}}if(N){let R=new Uint16Array(N*4),F=I[I.length-2];for(let j=I.length-3,z=0;j>=0;j-=3)R[z++]=I[j],R[z++]=I[j+1]-F,R[z++]=I[j+2]-F,R[z++]=z;O.push(new tf(R,I[2]-F,r)),T.push(F-E)}}function g(E,D){return(O,T,I)=>{let N=0,$=O.length-1,R,F;if($>=0&&(R=O[$])instanceof mi){if(!$&&R.type==E&&R.length==I)return R;(F=R.prop(xn.lookAhead))&&(N=T[$]+R.length+F)}return b(E,O,T,I,N,D)}}function y(E,D,O,T,I,N,$,R,F){let j=[],z=[];for(;E.length>T;)j.push(E.pop()),z.push(D.pop()+O-I);E.push(b(r.types[$],j,z,N-I,R-N,F)),D.push(I-O)}function b(E,D,O,T,I,N,$){if(N){let R=[xn.contextHash,N];$=$?[R].concat($):[R]}if(I>25){let R=[xn.lookAhead,I];$=$?[R].concat($):[R]}return new mi(E,D,O,T,$)}function v(E,D){let O=a.fork(),T=0,I=0,N=0,$=O.end-i,R={size:0,start:0,skip:0};e:for(let F=O.pos-E;O.pos>F;){let j=O.size;if(O.id==D&&j>=0){R.size=T,R.start=I,R.skip=N,N+=4,T+=4,O.next();continue}let z=O.pos-j;if(j<0||z<F||O.start<$)break;let L=O.id>=s?4:0,q=O.start;for(O.next();O.pos>z;){if(O.size<0)if(O.size==-3||O.size==-4)L+=4;else break e;else O.id>=s&&(L+=4);O.next()}I=q,T+=j,N+=L}return(D<0||T==E)&&(R.size=T,R.start=I,R.skip=N),R.size>4?R:void 0}function S(E,D,O){let{id:T,start:I,end:N,size:$}=a;if(a.next(),$>=0&&T<s){let R=O;if($>4){let F=a.pos-($-4);for(;a.pos>F;)O=S(E,D,O)}D[--O]=R,D[--O]=N-E,D[--O]=I-E,D[--O]=T}else $==-3?c=T:$==-4&&(u=T);return O}let C=[],w=[];for(;a.pos>0;)f(e.start||0,e.bufferStart||0,C,w,-1,0);let A=(t=e.length)!==null&&t!==void 0?t:C.length?w[0]+C[0].length:0;return new mi(l[e.topID],C.reverse(),w.reverse(),A)}const UU=new WeakMap;function Q5(e,t){if(!e.isAnonymous||t instanceof tf||t.type!=e)return 1;let n=UU.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof mi)){n=1;break}n+=Q5(e,r)}UU.set(t,n)}return n}function OM(e,t,n,r,i,o,s,a,l){let c=0;for(let y=r;y<i;y++)c+=Q5(e,t[y]);let u=Math.ceil(c*1.5/8),f=[],h=[];function g(y,b,v,S,C){for(let w=v;w<S;){let A=w,E=b[w],D=Q5(e,y[w]);for(w++;w<S;w++){let O=Q5(e,y[w]);if(D+O>=u)break;D+=O}if(w==A+1){if(D>u){let O=y[A];g(O.children,O.positions,0,O.children.length,b[A]+C);continue}f.push(y[A])}else{let O=b[w-1]+y[w-1].length-E;f.push(OM(e,y,b,A,w,E,O,null,l))}h.push(E+C-o)}}return g(t,n,r,i,0),(a||l)(f,h,s)}class kh{constructor(t,n,r,i,o=!1,s=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new kh(0,t.length,t,0,!1,r)];for(let o of n)o.to>t.length&&i.push(o);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],o=1,s=t.length?t[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let h=s;if(l>=h.from||f<=h.to||c){let g=Math.max(h.from,l)-c,y=Math.min(h.to,f)-c;h=g>=y?null:new kh(g,y,h.tree,h.offset+c,a>0,!!u)}if(h&&i.push(h),s.to>f)break;s=o<t.length?t[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}let zee=class{startParse(t,n,r){return typeof t=="string"&&(t=new Rje(t)),r=r?r.length?r.map(i=>new OE(i.from,i.to)):[new OE(0,0)]:[new OE(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let o=i.advance();if(o)return o}}};class Rje{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new xn({perNode:!0});var VU={};class d6{constructor(t,n,r,i,o,s,a,l,c,u=0,f){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new d6(t,[],n,r,r,0,[],0,i?new WU(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=o.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(t&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=l?this.stack[l-1]:0,h=this.bufferBase+this.buffer.length-f;if(i<o.minRepeatTerm||t&131072){let g=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,g,h+4,!0)}if(t&262144)this.state=this.stack[l];else{let g=this.stack[l-3];this.state=o.getGoto(g,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(t,n,r,i=4,o=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(t,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let o=t,{parser:s}=this.p;this.pos=i;let a=s.stateFlag(o,1);!a&&(i>r||n<=s.maxNode)&&(this.reducePos=i),this.pushState(o,a?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new d6(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new Ije(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,t)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((a,l)=>l&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:t}=this.p,n=t.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!t.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||t.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),t.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&t.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=t.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(n)))}reduceContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(n)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let n=new WU(this.curContext.tracker,t);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class WU{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class Ije{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class f6{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new f6(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new f6(this.stack,this.pos,this.index)}}function T3(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let s=e.charCodeAt(r++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class e4{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const qU=new e4;class Pje{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=qU,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,o=this.pos+t;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let n of this.ranges)if(n.to>t)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+t,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(t,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=r}acceptTokenTo(t,n){this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),n=this.pos+t.length;this.chunk=n>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=qU,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,n){if(t>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class B0{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;jje(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}B0.prototype.contextual=B0.prototype.fallback=B0.prototype.extend=!1;B0.prototype.fallback=B0.prototype.extend=!1;function jje(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;(a&e[s])!=0;){let c=e[s+1];for(let g=s+3;g<c;g+=2)if((e[g+1]&a)>0){let y=e[g];if(l.allows(y)&&(t.token.value==-1||t.token.value==y||$je(y,t.token.value,i,o))){t.acceptToken(y);break}}let u=t.next,f=0,h=e[s+2];if(t.next<0&&h>f&&e[c+h*3-3]==65535){s=e[c+h*3-1];continue e}for(;f<h;){let g=f+h>>1,y=c+g+(g<<1),b=e[y],v=e[y+1]||65536;if(u<b)h=g;else if(u>=v)f=g+1;else{s=e[y+2],t.advance();continue e}}break}}function GU(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function $je(e,t,n,r){let i=GU(n,r,t);return i<0||GU(n,r,e)<i}const ws=typeof process<"u"&&VU&&/\bparse\b/.test(VU.LOG);let TE=null;function KU(e,t,n){let r=e.cursor(ai.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class Lje{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?KU(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?KU(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>t)return this.nextStart=s,null;if(o instanceof mi){if(s==t){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(xn.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class Nje{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new e4)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:o}=i,s=i.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if((1<<c&s)==0)continue;let u=o[c],f=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||f.start!=t.pos||f.mask!=s||f.context!=a)&&(this.updateCachedToken(f,u,t),f.mask=s,f.context=a),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!u.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return l&&t.setLookAhead(l),!r&&t.pos==this.stream.end&&(r=new e4,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new e4,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==t.value){let a=o.specializers[s](this.stream.read(t.start,t.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?t.value=a>>1:t.extended=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==t)return i;return this.actions[i++]=t,this.actions[i++]=n,this.actions[i++]=r,i}addActions(t,n,r,i){let{state:o}=t,{parser:s}=t.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(o,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=nu(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(nu(a,c+2),n,r,i));break}a[c]==n&&(i=this.putAction(nu(a,c+1),n,r,i))}return i}}class Fje{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Pje(n,i),this.tokens=new Nje(t,this.stream),this.topTerm=t.top[1];let{from:o}=i[0];this.stacks=[d6.start(this,t.top[0],o)],this.fragments=r.length&&this.stream.end-o>t.bufferLength*4?new Lje(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<t.length;s++){let a=t[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,t))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&zje(i);if(s)return ws&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw ws&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return ws&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&(r.sort((s,a)=>a.score-s.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,n,r){let i=t.pos,{parser:o}=this,s=ws?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let c=t.curContext&&t.curContext.tracker.strict,u=c?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(xn.contextHash)||0)==u))return t.useNode(f,h),ws&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof mi)||f.children.length==0||f.positions[0]>0)break;let g=f.children[0];if(g instanceof mi&&f.positions[0]==0)f=g;else break}}let a=o.stateSlot(t.state,4);if(a>0)return t.reduce(a),ws&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let c=0;c<l.length;){let u=l[c++],f=l[c++],h=l[c++],g=c==l.length||!r,y=g?t:t.split(),b=this.tokens.mainToken;if(y.apply(u,f,b?b.start:y.pos,h),ws&&console.log(s+this.stackID(y)+` (via ${(u&65536)==0?"shift":`reduce of ${o.getName(u&65535)}`} for ${o.getName(f)} @ ${i}${y==t?"":", split"})`),g)return!0;y.pos>i?n.push(y):r.push(y)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return YU(t,n),!0}}runRecovery(t,n,r){let i=null,o=!1;for(let s=0;s<t.length;s++){let a=t[s],l=n[s<<1],c=n[(s<<1)+1],u=ws?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),ws&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),h=u;for(let g=0;g<10&&f.forceReduce()&&(ws&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));g++)ws&&(h=this.stackID(f)+" -> ");for(let g of a.recoverByInsert(l))ws&&console.log(u+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),ws&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),YU(a,r)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(t){return t.close(),mi.build({buffer:f6.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let n=(TE||(TE=new WeakMap)).get(t);return n||TE.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function YU(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class Bje{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}class h6 extends zee{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<t.repeatNodeCount;a++)n.push("");let r=Object.keys(t.topRules).map(a=>t.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function o(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(t.nodeProps)for(let a of t.nodeProps){let l=a[0];typeof l=="string"&&(l=xn[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let h=-u;h>0;h--)o(a[c++],l,f);c++}}}this.nodeSet=new kM(n.map((a,l)=>ls.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(l)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Lee;let s=T3(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(XU),this.states=T3(t.states,Uint32Array),this.data=T3(t.stateData),this.goto=T3(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(a=>typeof a=="number"?new B0(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new Fje(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o<c;o++)if(i[o]==t)return l;if(a)return-1}}hasAction(t,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(t,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=nu(r,o+2)];else{if(r[o+1]==2)return nu(r,o+2);break}if(s==n||s==0)return nu(r,o+1)}return 0}stateSlot(t,n){return this.states[t*6+n]}stateFlag(t,n){return(this.stateSlot(t,0)&n)>0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let o=this.stateSlot(t,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=nu(this.data,o+2);else break;i=n(nu(this.data,o+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=nu(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(h6.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(o=>o.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=t.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=XU(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let o of t.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new Bje(t,r,i)}static deserialize(t){return new h6(t)}}function nu(e,t){return e[t]|e[t+1]<<16}function zje(e){let t=null;for(let n of e){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function XU(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}let Hje=0;class oa{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=Hje++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof oa&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new oa(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(t){let n=new p6(t);return r=>r.modified.indexOf(n)>-1?r:p6.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Uje=0;class p6{constructor(t){this.name=t,this.instances=[],this.id=Uje++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(a=>a.base==t&&Vje(n,a.modified));if(r)return r;let i=[],o=new oa(t.name,i,t,n);for(let a of n)a.instances.push(o);let s=Wje(n);for(let a of t.set)if(!a.modified.length)for(let l of s)i.push(p6.get(a,l));return o}}function Vje(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function Wje(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function Hee(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let g=i[f++];if(f==i.length&&g=="!"){s=0;break}if(g!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new h2(r,s,l>0?o.slice(0,l):null);t[c]=u.sort(t[c])}}return Uee.add(t)}const Uee=new xn({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new h2(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});let h2=class{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}};h2.empty=new h2([],2,null);function Vee(e,t){let n=Object.create(null);for(let o of e)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=t||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function qje(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function Gje(e,t,n,r=0,i=e.length){let o=new Kje(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}class Kje{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,o){let{type:s,from:a,to:l}=t;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(g=>!g.scope||g.scope(s)));let c=i,u=Yje(t)||h2.empty,f=qje(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let h=t.tree&&t.tree.prop(xn.mounted);if(h&&h.overlay){let g=t.node.enter(h.overlay[0].from+a,1),y=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,S=a;;v++){let C=v<h.overlay.length?h.overlay[v]:null,w=C?C.from+a:l,A=Math.max(n,S),E=Math.min(r,w);if(A<E&&b)for(;t.from<E&&(this.highlightRange(t,A,E,i,o),this.startSpan(Math.min(E,t.to),c),!(t.to>=w||!t.nextSibling())););if(!C||w>r)break;S=C.to+a,S>n&&(this.highlightRange(g.cursor(),Math.max(n,C.from+a),Math.min(r,S),"",y),this.startSpan(Math.min(r,S),c))}b&&t.parent()}else if(t.firstChild()){h&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,o),this.startSpan(Math.min(r,t.to),c)}while(t.nextSibling());t.parent()}}}function Yje(e){let t=e.type.prop(Uee);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const ct=oa.define,M3=ct(),gd=ct(),ZU=ct(gd),JU=ct(gd),yd=ct(),R3=ct(yd),ME=ct(yd),kl=ct(),Xf=ct(kl),wl=ct(),Cl=ct(),m_=ct(),C1=ct(m_),I3=ct(),ae={comment:M3,lineComment:ct(M3),blockComment:ct(M3),docComment:ct(M3),name:gd,variableName:ct(gd),typeName:ZU,tagName:ct(ZU),propertyName:JU,attributeName:ct(JU),className:ct(gd),labelName:ct(gd),namespace:ct(gd),macroName:ct(gd),literal:yd,string:R3,docString:ct(R3),character:ct(R3),attributeValue:ct(R3),number:ME,integer:ct(ME),float:ct(ME),bool:ct(yd),regexp:ct(yd),escape:ct(yd),color:ct(yd),url:ct(yd),keyword:wl,self:ct(wl),null:ct(wl),atom:ct(wl),unit:ct(wl),modifier:ct(wl),operatorKeyword:ct(wl),controlKeyword:ct(wl),definitionKeyword:ct(wl),moduleKeyword:ct(wl),operator:Cl,derefOperator:ct(Cl),arithmeticOperator:ct(Cl),logicOperator:ct(Cl),bitwiseOperator:ct(Cl),compareOperator:ct(Cl),updateOperator:ct(Cl),definitionOperator:ct(Cl),typeOperator:ct(Cl),controlOperator:ct(Cl),punctuation:m_,separator:ct(m_),bracket:C1,angleBracket:ct(C1),squareBracket:ct(C1),paren:ct(C1),brace:ct(C1),content:kl,heading:Xf,heading1:ct(Xf),heading2:ct(Xf),heading3:ct(Xf),heading4:ct(Xf),heading5:ct(Xf),heading6:ct(Xf),contentSeparator:ct(kl),list:ct(kl),quote:ct(kl),emphasis:ct(kl),strong:ct(kl),link:ct(kl),monospace:ct(kl),strikethrough:ct(kl),inserted:ct(),deleted:ct(),changed:ct(),invalid:ct(),meta:I3,documentMeta:ct(I3),annotation:ct(I3),processingInstruction:ct(I3),definition:oa.defineModifier("definition"),constant:oa.defineModifier("constant"),function:oa.defineModifier("function"),standard:oa.defineModifier("standard"),local:oa.defineModifier("local"),special:oa.defineModifier("special")};for(let e in ae){let t=ae[e];t instanceof oa&&(t.name=e)}Vee([{tag:ae.link,class:"tok-link"},{tag:ae.heading,class:"tok-heading"},{tag:ae.emphasis,class:"tok-emphasis"},{tag:ae.strong,class:"tok-strong"},{tag:ae.keyword,class:"tok-keyword"},{tag:ae.atom,class:"tok-atom"},{tag:ae.bool,class:"tok-bool"},{tag:ae.url,class:"tok-url"},{tag:ae.labelName,class:"tok-labelName"},{tag:ae.inserted,class:"tok-inserted"},{tag:ae.deleted,class:"tok-deleted"},{tag:ae.literal,class:"tok-literal"},{tag:ae.string,class:"tok-string"},{tag:ae.number,class:"tok-number"},{tag:[ae.regexp,ae.escape,ae.special(ae.string)],class:"tok-string2"},{tag:ae.variableName,class:"tok-variableName"},{tag:ae.local(ae.variableName),class:"tok-variableName tok-local"},{tag:ae.definition(ae.variableName),class:"tok-variableName tok-definition"},{tag:ae.special(ae.variableName),class:"tok-variableName2"},{tag:ae.definition(ae.propertyName),class:"tok-propertyName tok-definition"},{tag:ae.typeName,class:"tok-typeName"},{tag:ae.namespace,class:"tok-namespace"},{tag:ae.className,class:"tok-className"},{tag:ae.macroName,class:"tok-macroName"},{tag:ae.propertyName,class:"tok-propertyName"},{tag:ae.operator,class:"tok-operator"},{tag:ae.comment,class:"tok-comment"},{tag:ae.meta,class:"tok-meta"},{tag:ae.invalid,class:"tok-invalid"},{tag:ae.punctuation,class:"tok-punctuation"}]);const Xje=Hee({String:ae.string,Number:ae.number,"True False":ae.bool,PropertyName:ae.propertyName,Null:ae.null,", :":ae.separator,"[ ]":ae.squareBracket,"{ }":ae.brace}),Zje=h6.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Xje],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let g_=[],Wee=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?Wee:g_).push(n=n+e[t])})();function Jje(e){if(e<768)return!1;for(let t=0,n=g_.length;;){let r=t+n>>1;if(e<g_[r])n=r;else if(e>=Wee[r])t=r+1;else return!0;if(t==n)return!1}}function QU(e){return e>=127462&&e<=127487}const eV=8205;function Qje(e,t,n=!0,r=!0){return(n?qee:e$e)(e,t,r)}function qee(e,t,n){if(t==e.length)return t;t&&Gee(e.charCodeAt(t))&&Kee(e.charCodeAt(t-1))&&t--;let r=RE(e,t);for(t+=tV(r);t<e.length;){let i=RE(e,t);if(r==eV||i==eV||n&&Jje(i))t+=tV(i),r=i;else if(QU(i)){let o=0,s=t-2;for(;s>=0&&QU(RE(e,s));)o++,s-=2;if(o%2==0)break;t+=2}else break}return t}function e$e(e,t,n){for(;t>0;){let r=qee(e,t-2,n);if(r<t)return r;t--}return 0}function RE(e,t){let n=e.charCodeAt(t);if(!Kee(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Gee(r)?(n-55296<<10)+(r-56320)+65536:n}function Gee(e){return e>=56320&&e<57344}function Kee(e){return e>=55296&&e<56320}function tV(e){return e<65536?1:2}class Vn{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=ym(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Nl.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=ym(this,t,n);let r=[];return this.decompose(t,n,r,0),Nl.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new by(this),o=new by(t);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(t=1){return new by(this,t)}iterRange(t,n=this.length){return new Yee(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Xee(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Vn.empty:t.length<=32?new fi(t):Nl.from(fi.split(t,[]))}}class fi extends Vn{constructor(t,n=t$e(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=t)return new n$e(i,a,r,s);i=a+1,r++}}decompose(t,n,r,i){let o=t<=0&&n>=this.length?this:new fi(nV(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let s=r.pop(),a=t4(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new fi(a,s.length+o.length));else{let l=a.length>>1;r.push(new fi(a.slice(0,l)),new fi(a.slice(l)))}}else r.push(o)}replace(t,n,r){if(!(r instanceof fi))return super.replace(t,n,r);[t,n]=ym(this,t,n);let i=t4(this.text,t4(r.text,nV(this.text,0,t)),n),o=this.length+r.length-(n-t);return i.length<=32?new fi(i,o):Nl.from(fi.split(i,[]),o)}sliceString(t,n=this.length,r=`
254
+ deps: ${u}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[c,u]=o(l);s(l,c),a(l,u)}};function o({schema:l}){const c={},u={};for(const f in l){if(f==="__proto__")continue;const h=Array.isArray(l[f])?c:u;h[f]=l[f]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:f,it:h}=l;if(Object.keys(c).length===0)return;const g=u.let("missing");for(const y in c){const b=c[y];if(b.length===0)continue;const v=(0,r.propertyInData)(u,f,y,h.opts.ownProperties);l.setParams({property:y,depsCount:b.length,deps:b.join(", ")}),h.allErrors?u.if(v,()=>{for(const S of b)(0,r.checkReportMissingProp)(l,S)}):(u.if((0,t._)`${v} && (${(0,r.checkMissingProp)(l,b,g)})`),(0,r.reportMissingProp)(l,g),u.else())}}e.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:u,data:f,keyword:h,it:g}=l,y=u.name("valid");for(const b in c)(0,n.alwaysValidSchema)(g,c[b])||(u.if((0,r.propertyInData)(u,f,b,g.opts.ownProperties),()=>{const v=l.subschema({keyword:h,schemaProp:b},y);l.mergeValidEvaluated(v,y)},()=>u.var(y,!0)),l.ok(y))}e.validateSchemaDeps=a,e.default=i})(kE)),kE}var d3={},fU;function vIe(){if(fU)return d3;fU=1,Object.defineProperty(d3,"__esModule",{value:!0});const e=pn(),t=qn(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:o,schema:s,data:a,it:l}=i;if((0,t.alwaysValidSchema)(l,s))return;const c=o.name("valid");o.forIn("key",a,u=>{i.setParams({propertyName:u}),i.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},c),o.if((0,e.not)(c),()=>{i.error(!0),l.allErrors||o.break()})}),i.ok(c)}};return d3.default=r,d3}var f3={},hU;function _ee(){if(hU)return f3;hU=1,Object.defineProperty(f3,"__esModule",{value:!0});const e=cl(),t=pn(),n=Sf(),r=qn(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,t._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:a,schema:l,parentSchema:c,data:u,errsCount:f,it:h}=s;if(!f)throw new Error("ajv implementation error");const{allErrors:g,opts:y}=h;if(h.props=!0,y.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,l))return;const b=(0,e.allSchemaProperties)(c.properties),v=(0,e.allSchemaProperties)(c.patternProperties);S(),s.ok((0,t._)`${f} === ${n.default.errors}`);function S(){a.forIn("key",u,D=>{!b.length&&!v.length?A(D):a.if(C(D),()=>A(D))})}function C(D){let O;if(b.length>8){const T=(0,r.schemaRefOrVal)(h,c.properties,"properties");O=(0,e.isOwnProperty)(a,T,D)}else b.length?O=(0,t.or)(...b.map(T=>(0,t._)`${D} === ${T}`)):O=t.nil;return v.length&&(O=(0,t.or)(O,...v.map(T=>(0,t._)`${(0,e.usePattern)(s,T)}.test(${D})`))),(0,t.not)(O)}function w(D){a.code((0,t._)`delete ${u}[${D}]`)}function A(D){if(y.removeAdditional==="all"||y.removeAdditional&&l===!1){w(D);return}if(l===!1){s.setParams({additionalProperty:D}),s.error(),g||a.break();return}if(typeof l=="object"&&!(0,r.alwaysValidSchema)(h,l)){const O=a.name("valid");y.removeAdditional==="failing"?(E(D,O,!1),a.if((0,t.not)(O),()=>{s.reset(),w(D)})):(E(D,O),g||a.if((0,t.not)(O),()=>a.break()))}}function E(D,O,T){const I={keyword:"additionalProperties",dataProp:D,dataPropType:r.Type.Str};T===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(I,O)}}};return f3.default=o,f3}var h3={},pU;function xIe(){if(pU)return h3;pU=1,Object.defineProperty(h3,"__esModule",{value:!0});const e=Gw(),t=cl(),n=qn(),r=_ee(),i={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:s,schema:a,parentSchema:l,data:c,it:u}=o;u.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(u,r.default,"additionalProperties"));const f=(0,t.allSchemaProperties)(a);for(const v of f)u.definedProperties.add(v);u.opts.unevaluated&&f.length&&u.props!==!0&&(u.props=n.mergeEvaluated.props(s,(0,n.toHash)(f),u.props));const h=f.filter(v=>!(0,n.alwaysValidSchema)(u,a[v]));if(h.length===0)return;const g=s.name("valid");for(const v of h)y(v)?b(v):(s.if((0,t.propertyInData)(s,c,v,u.opts.ownProperties)),b(v),u.allErrors||s.else().var(g,!0),s.endIf()),o.it.definedProperties.add(v),o.ok(g);function y(v){return u.opts.useDefaults&&!u.compositeRule&&a[v].default!==void 0}function b(v){o.subschema({keyword:"properties",schemaProp:v,dataProp:v},g)}}};return h3.default=i,h3}var p3={},mU;function SIe(){if(mU)return p3;mU=1,Object.defineProperty(p3,"__esModule",{value:!0});const e=cl(),t=pn(),n=qn(),r=qn(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:s,schema:a,data:l,parentSchema:c,it:u}=o,{opts:f}=u,h=(0,e.allSchemaProperties)(a),g=h.filter(A=>(0,n.alwaysValidSchema)(u,a[A]));if(h.length===0||g.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const y=f.strictSchema&&!f.allowMatchingProperties&&c.properties,b=s.name("valid");u.props!==!0&&!(u.props instanceof t.Name)&&(u.props=(0,r.evaluatedPropsToName)(s,u.props));const{props:v}=u;S();function S(){for(const A of h)y&&C(A),u.allErrors?w(A):(s.var(b,!0),w(A),s.if(b))}function C(A){for(const E in y)new RegExp(A).test(E)&&(0,n.checkStrictMode)(u,`property ${E} matches pattern ${A} (use allowMatchingProperties)`)}function w(A){s.forIn("key",l,E=>{s.if((0,t._)`${(0,e.usePattern)(o,A)}.test(${E})`,()=>{const D=g.includes(A);D||o.subschema({keyword:"patternProperties",schemaProp:A,dataProp:E,dataPropType:r.Type.Str},b),u.opts.unevaluated&&v!==!0?s.assign((0,t._)`${v}[${E}]`,!0):!D&&!u.allErrors&&s.if((0,t.not)(b),()=>s.break())})})}}};return p3.default=i,p3}var m3={},gU;function wIe(){if(gU)return m3;gU=1,Object.defineProperty(m3,"__esModule",{value:!0});const e=qn(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:i,it:o}=n;if((0,e.alwaysValidSchema)(o,i)){n.fail();return}const s=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),n.failResult(s,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return m3.default=t,m3}var g3={},yU;function CIe(){if(yU)return g3;yU=1,Object.defineProperty(g3,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cl().validateUnion,error:{message:"must match a schema in anyOf"}};return g3.default=t,g3}var y3={},bU;function EIe(){if(bU)return y3;bU=1,Object.defineProperty(y3,"__esModule",{value:!0});const e=pn(),t=qn(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:o,schema:s,parentSchema:a,it:l}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");if(l.opts.discriminator&&a.discriminator)return;const c=s,u=o.let("valid",!1),f=o.let("passing",null),h=o.name("_valid");i.setParams({passing:f}),o.block(g),i.result(u,()=>i.reset(),()=>i.error(!0));function g(){c.forEach((y,b)=>{let v;(0,t.alwaysValidSchema)(l,y)?o.var(h,!0):v=i.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},h),b>0&&o.if((0,e._)`${h} && ${u}`).assign(u,!1).assign(f,(0,e._)`[${f}, ${b}]`).else(),o.if(h,()=>{o.assign(u,!0),o.assign(f,b),v&&i.mergeEvaluated(v,e.Name)})})}}};return y3.default=r,y3}var b3={},vU;function AIe(){if(vU)return b3;vU=1,Object.defineProperty(b3,"__esModule",{value:!0});const e=qn(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:i,it:o}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");const s=r.name("valid");i.forEach((a,l)=>{if((0,e.alwaysValidSchema)(o,a))return;const c=n.subschema({keyword:"allOf",schemaProp:l},s);n.ok(s),n.mergeEvaluated(c)})}};return b3.default=t,b3}var v3={},xU;function kIe(){if(xU)return v3;xU=1,Object.defineProperty(v3,"__esModule",{value:!0});const e=pn(),t=qn(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:s,parentSchema:a,it:l}=o;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(l,'"if" without "then" and "else" is ignored');const c=i(l,"then"),u=i(l,"else");if(!c&&!u)return;const f=s.let("valid",!0),h=s.name("_valid");if(g(),o.reset(),c&&u){const b=s.let("ifClause");o.setParams({ifClause:b}),s.if(h,y("then",b),y("else",b))}else c?s.if(h,y("then")):s.if((0,e.not)(h),y("else"));o.pass(f,()=>o.error(!0));function g(){const b=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);o.mergeEvaluated(b)}function y(b,v){return()=>{const S=o.subschema({keyword:b},h);s.assign(f,h),o.mergeValidEvaluated(S,f),v?s.assign(v,(0,e._)`${b}`):o.setParams({ifClause:b})}}}};function i(o,s){const a=o.schema[s];return a!==void 0&&!(0,t.alwaysValidSchema)(o,a)}return v3.default=r,v3}var x3={},SU;function _Ie(){if(SU)return x3;SU=1,Object.defineProperty(x3,"__esModule",{value:!0});const e=qn(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:i}){r.if===void 0&&(0,e.checkStrictMode)(i,`"${n}" without "if" is ignored`)}};return x3.default=t,x3}var wU;function DIe(){if(wU)return a3;wU=1,Object.defineProperty(a3,"__esModule",{value:!0});const e=Aee(),t=mIe(),n=kee(),r=gIe(),i=yIe(),o=bIe(),s=vIe(),a=_ee(),l=xIe(),c=SIe(),u=wIe(),f=CIe(),h=EIe(),g=AIe(),y=kIe(),b=_Ie();function v(S=!1){const C=[u.default,f.default,h.default,g.default,y.default,b.default,s.default,a.default,o.default,l.default,c.default];return S?C.push(t.default,r.default):C.push(e.default,n.default),C.push(i.default),C}return a3.default=v,a3}var S3={},w3={},CU;function OIe(){if(CU)return w3;CU=1,Object.defineProperty(w3,"__esModule",{value:!0});const e=pn(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,i){const{gen:o,data:s,$data:a,schema:l,schemaCode:c,it:u}=r,{opts:f,errSchemaPath:h,schemaEnv:g,self:y}=u;if(!f.validateFormats)return;a?b():v();function b(){const S=o.scopeValue("formats",{ref:y.formats,code:f.code.formats}),C=o.const("fDef",(0,e._)`${S}[${c}]`),w=o.let("fType"),A=o.let("format");o.if((0,e._)`typeof ${C} == "object" && !(${C} instanceof RegExp)`,()=>o.assign(w,(0,e._)`${C}.type || "string"`).assign(A,(0,e._)`${C}.validate`),()=>o.assign(w,(0,e._)`"string"`).assign(A,C)),r.fail$data((0,e.or)(E(),D()));function E(){return f.strictSchema===!1?e.nil:(0,e._)`${c} && !${A}`}function D(){const O=g.$async?(0,e._)`(${C}.async ? await ${A}(${s}) : ${A}(${s}))`:(0,e._)`${A}(${s})`,T=(0,e._)`(typeof ${A} == "function" ? ${O} : ${A}.test(${s}))`;return(0,e._)`${A} && ${A} !== true && ${w} === ${i} && !${T}`}}function v(){const S=y.formats[l];if(!S){E();return}if(S===!0)return;const[C,w,A]=D(S);C===i&&r.pass(O());function E(){if(f.strictSchema===!1){y.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${l}" ignored in schema at path "${h}"`}}function D(T){const I=T instanceof RegExp?(0,e.regexpCode)(T):f.code.formats?(0,e._)`${f.code.formats}${(0,e.getProperty)(l)}`:void 0,N=o.scopeValue("formats",{key:l,ref:T,code:I});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,e._)`${N}.validate`]:["string",T,N]}function O(){if(typeof S=="object"&&!(S instanceof RegExp)&&S.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${A}(${s})`}return typeof w=="function"?(0,e._)`${A}(${s})`:(0,e._)`${A}.test(${s})`}}}};return w3.default=n,w3}var EU;function TIe(){if(EU)return S3;EU=1,Object.defineProperty(S3,"__esModule",{value:!0});const t=[OIe().default];return S3.default=t,S3}var Yf={},AU;function MIe(){return AU||(AU=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.contentVocabulary=Yf.metadataVocabulary=void 0,Yf.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Yf.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Yf}var kU;function RIe(){if(kU)return Wx;kU=1,Object.defineProperty(Wx,"__esModule",{value:!0});const e=nIe(),t=pIe(),n=DIe(),r=TIe(),i=MIe(),o=[e.default,t.default,(0,n.default)(),r.default,i.metadataVocabulary,i.contentVocabulary];return Wx.default=o,Wx}var C3={},w1={},_U;function IIe(){if(_U)return w1;_U=1,Object.defineProperty(w1,"__esModule",{value:!0}),w1.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(w1.DiscrError=e={})),w1}var DU;function PIe(){if(DU)return C3;DU=1,Object.defineProperty(C3,"__esModule",{value:!0});const e=pn(),t=IIe(),n=CM(),r=Kw(),i=qn(),s={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:l}})=>a===t.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:a,tag:l,tagName:c}})=>(0,e._)`{error: ${a}, tag: ${c}, tagValue: ${l}}`},code(a){const{gen:l,data:c,schema:u,parentSchema:f,it:h}=a,{oneOf:g}=f;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const y=u.propertyName;if(typeof y!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const b=l.let("valid",!1),v=l.const("tag",(0,e._)`${c}${(0,e.getProperty)(y)}`);l.if((0,e._)`typeof ${v} == "string"`,()=>S(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:v,tagName:y})),a.ok(b);function S(){const A=w();l.if(!1);for(const E in A)l.elseIf((0,e._)`${v} === ${E}`),l.assign(b,C(A[E]));l.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:v,tagName:y}),l.endIf()}function C(A){const E=l.name("valid"),D=a.subschema({keyword:"oneOf",schemaProp:A},E);return a.mergeEvaluated(D,e.Name),E}function w(){var A;const E={},D=T(f);let O=!0;for(let $=0;$<g.length;$++){let R=g[$];if(R?.$ref&&!(0,i.schemaHasRulesButRef)(R,h.self.RULES)){const j=R.$ref;if(R=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,j),R instanceof n.SchemaEnv&&(R=R.schema),R===void 0)throw new r.default(h.opts.uriResolver,h.baseId,j)}const F=(A=R?.properties)===null||A===void 0?void 0:A[y];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${y}"`);O=O&&(D||T(R)),I(F,$)}if(!O)throw new Error(`discriminator: "${y}" must be required`);return E;function T({required:$}){return Array.isArray($)&&$.includes(y)}function I($,R){if($.const)N($.const,R);else if($.enum)for(const F of $.enum)N(F,R);else throw new Error(`discriminator: "properties/${y}" must have "const" or "enum"`)}function N($,R){if(typeof $!="string"||$ in E)throw new Error(`discriminator: "${y}" values must be unique strings`);E[$]=R}}}};return C3.default=s,C3}const jIe="http://json-schema.org/draft-07/schema#",$Ie="http://json-schema.org/draft-07/schema#",LIe="Core schema meta-schema",NIe={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},FIe=["object","boolean"],BIe={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},zIe={$schema:jIe,$id:$Ie,title:LIe,definitions:NIe,type:FIe,properties:BIe,default:!0};var OU;function Dee(){return OU||(OU=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=QRe(),r=RIe(),i=PIe(),o=zIe,s=["/properties"],a="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const y=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(y,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=Gw();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=pn();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=wM();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=Kw();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(Bx,Bx.exports)),Bx.exports}var HIe=Dee();const Oee=us(HIe);var E3={exports:{}},_E={},TU;function UIe(){return TU||(TU=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(I,N){return{validate:I,compare:N}}e.fullFormats={date:t(o,s),time:t(l,c),"date-time":t(f,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:b,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:T,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:S,int32:{type:"number",validate:A},int64:{type:"number",validate:E},float:{type:"number",validate:D},double:{type:"number",validate:D},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(I){return I%4===0&&(I%100!==0||I%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(I){const N=r.exec(I);if(!N)return!1;const $=+N[1],R=+N[2],F=+N[3];return R>=1&&R<=12&&F>=1&&F<=(R===2&&n($)?29:i[R])}function s(I,N){if(I&&N)return I>N?1:I<N?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(I,N){const $=a.exec(I);if(!$)return!1;const R=+$[1],F=+$[2],j=+$[3],z=$[5];return(R<=23&&F<=59&&j<=59||R===23&&F===59&&j===60)&&(!N||z!=="")}function c(I,N){if(!(I&&N))return;const $=a.exec(I),R=a.exec(N);if($&&R)return I=$[1]+$[2]+$[3]+($[4]||""),N=R[1]+R[2]+R[3]+(R[4]||""),I>N?1:I<N?-1:0}const u=/t|\s/i;function f(I){const N=I.split(u);return N.length===2&&o(N[0])&&l(N[1],!0)}function h(I,N){if(!(I&&N))return;const[$,R]=I.split(u),[F,j]=N.split(u),z=s($,F);if(z!==void 0)return z||c(R,j)}const g=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function b(I){return g.test(I)&&y.test(I)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function S(I){return v.lastIndex=0,v.test(I)}const C=-2147483648,w=2**31-1;function A(I){return Number.isInteger(I)&&I<=w&&I>=C}function E(I){return Number.isInteger(I)}function D(){return!0}const O=/[^\\]\\Z/;function T(I){if(O.test(I))return!1;try{return new RegExp(I),!0}catch{return!1}}})(_E)),_E}var DE={},MU;function VIe(){return MU||(MU=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Dee(),n=pn(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:({keyword:a,schemaCode:l})=>n.str`should be ${i[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>n._`{comparison: ${i[a].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(a){const{gen:l,data:c,schemaCode:u,keyword:f,it:h}=a,{opts:g,self:y}=h;if(!g.validateFormats)return;const b=new t.KeywordCxt(h,y.RULES.all.format.definition,"format");b.$data?v():S();function v(){const w=l.scopeValue("formats",{ref:y.formats,code:g.code.formats}),A=l.const("fmt",n._`${w}[${b.schemaCode}]`);a.fail$data(n.or(n._`typeof ${A} != "object"`,n._`${A} instanceof RegExp`,n._`typeof ${A}.compare != "function"`,C(A)))}function S(){const w=b.schema,A=y.formats[w];if(!A||A===!0)return;if(typeof A!="object"||A instanceof RegExp||typeof A.compare!="function")throw new Error(`"${f}": format "${w}" does not define "compare" function`);const E=l.scopeValue("formats",{key:w,ref:A,code:g.code.formats?n._`${g.code.formats}${n.getProperty(w)}`:void 0});a.fail$data(C(E))}function C(w){return n._`${w}.compare(${c}, ${u}) ${i[f].fail} 0`}},dependencies:["format"]};const s=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=s})(DE)),DE}var RU;function WIe(){return RU||(RU=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=UIe(),r=VIe(),i=pn(),o=new i.Name("fullFormats"),s=new i.Name("fastFormats"),a=(c,u={keywords:!0})=>{if(Array.isArray(u))return l(c,u,n.fullFormats,o),c;const[f,h]=u.mode==="fast"?[n.fastFormats,s]:[n.fullFormats,o],g=u.formats||n.formatNames;return l(c,g,f,h),u.keywords&&r.default(c),c};a.get=(c,u="full")=>{const h=(u==="fast"?n.fastFormats:n.fullFormats)[c];if(!h)throw new Error(`Unknown format "${c}"`);return h};function l(c,u,f,h){var g,y;(g=(y=c.opts.code).formats)!==null&&g!==void 0||(y.formats=i._`require("ajv-formats/dist/formats").${h}`);for(const b of u)c.addFormat(b,f[b])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(E3,E3.exports)),E3.exports}var qIe=WIe();const IU=us(qIe),GIe={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},KIe=/^(#?([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*\)))$/,YIe=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function XIe(e,t,n={},r,i=Oee,o){let s=new i({...GIe,...n});return r?IU(s,r):r!==!1&&IU(s),s.addFormat("data-url",YIe),s.addFormat("color",KIe),s.addKeyword(fu),s.addKeyword(jT),Array.isArray(e)&&s.addMetaSchema(e),Bn(t)&&Object.keys(t).forEach(a=>{s.addFormat(a,t[a])}),o&&(s=o(s)),s}function ZIe(e=[],t){return e.map(r=>{var i;const{instancePath:o,keyword:s,params:a,schemaPath:l,parentSchema:c,...u}=r;let{message:f=""}=u,h=o.replace(/\//g,"."),g=`${h} ${f}`.trim(),y="";const b=[...((i=a.deps)===null||i===void 0?void 0:i.split(", "))||[],a.missingProperty,a.property].filter(v=>v);if(b.length>0)b.forEach(v=>{const S=h?`${h}.${v}`:v;let C=$t(We(t,`${S.replace(/^\./,"")}`)).title;if(C===void 0){const w=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([v]);C=$t(We(t,w)).title}if(C)f=f.replace(`'${v}'`,`'${C}'`),y=C;else{const w=We(c,[Un,v,"title"]);w&&(f=f.replace(`'${v}'`,`'${w}'`),y=w)}}),g=f;else{const v=$t(We(t,`${h.replace(/^\./,"")}`)).title;if(v)g=`'${v}' ${f}`.trim(),y=v;else{const S=c?.title;S&&(g=`'${S}' ${f}`.trim(),y=S)}}return"missingProperty"in a&&(h=h?`${h}.${a.missingProperty}`:a.missingProperty),{name:s,property:h,message:f,params:a,stack:g,schemaPath:l,title:y}}).reduce((r,i)=>{const{message:o,schemaPath:s}=i,a=s?.indexOf(`/${Pn}/`),l=s?.indexOf(`/${nn}/`);let c;return a&&a>=0?c=s?.substring(0,a):l&&l>=0&&(c=s?.substring(0,l)),c&&r.find(f=>{var h;return f.message===o&&((h=f.schemaPath)===null||h===void 0?void 0:h.startsWith(c))})||r.push(i),r},[])}function JIe(e,t,n,r,i,o,s){const{validationError:a}=t;let l=ZIe(t.errors,s);a&&(l=[...l,{stack:a.message}]),typeof o=="function"&&(l=o(l,s));let c=AOe(l);if(a&&(c={...c,$schema:{__errors:[a.message]}}),typeof i!="function")return{errors:l,errorSchema:c};const u=FQ(e,r,n,r,!0),f=i(u,Qk(u),s,c),h=ree(f);return Z5({errors:l,errorSchema:c},h)}class QIe{constructor(t,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:o,ajvFormatOptions:s,AjvClass:a,extenderFn:l}=t;this.ajv=XIe(r,i,o,s,a,l),this.localizer=n}reset(){this.ajv.removeSchema()}rawValidation(t,n){var r,i;let o,s;try{t[pr]&&(s=this.ajv.getSchema(t[pr])),s===void 0&&(s=this.ajv.compile(t)),s(n)}catch(l){o=l}let a;return s&&(typeof this.localizer=="function"&&(((r=s.errors)!==null&&r!==void 0?r:[]).forEach(l=>{var c;["missingProperty","property"].forEach(u=>{var f;!((f=l.params)===null||f===void 0)&&f[u]&&(l.params[u]=`'${l.params[u]}'`)}),!((c=l.params)===null||c===void 0)&&c.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>`'${u}'`).join(", "))}),this.localizer(s.errors),((i=s.errors)!==null&&i!==void 0?i:[]).forEach(l=>{var c;["missingProperty","property"].forEach(u=>{var f;!((f=l.params)===null||f===void 0)&&f[u]&&(l.params[u]=l.params[u].slice(1,-1))}),!((c=l.params)===null||c===void 0)&&c.deps&&(l.params.deps=l.params.deps.split(", ").map(u=>u.slice(1,-1)).join(", "))})),a=s.errors||void 0,s.errors=null),{errors:a,validationError:o}}validateFormData(t,n,r,i,o){const s=this.rawValidation(n,t);return JIe(this,s,t,n,r,i,o)}handleSchemaUpdate(t){var n,r;const i=(n=t[pr])!==null&&n!==void 0?n:MJ;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(t,i):_r(t,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(t,i))}isValid(t,n,r){var i;try{this.handleSchemaUpdate(r);const o=pM(t),s=(i=o[pr])!==null&&i!==void 0?i:yOe(o);let a;return a=this.ajv.getSchema(s),a===void 0&&(a=this.ajv.addSchema(o,s).getSchema(s)||this.ajv.compile(o)),a(n)}catch(o){return console.warn("Error encountered compiling schema:",o),!1}}}function ePe(e={},t){return new QIe(e,t)}const tPe=ePe();function nPe({uiSchema:e,registry:t,...n}){const{translateString:r}=t;return m.jsx(_n,{title:r(un.AddItemButton),...n,color:"primary",children:m.jsx(fc,{})})}function rPe(e){const{children:t,buttonsProps:n,hasDescription:r,hasToolbar:i,uiSchema:o,registry:s}=e,a=$t(o),l=Bt("ArrayFieldItemButtonsTemplate",s,a),c={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold",minWidth:0};return m.jsxs(dt,{container:!0,alignItems:"center",children:[m.jsx(dt,{size:{xs:8,sm:9,md:10,lg:11,xl:11.25},style:{overflow:"auto"},children:m.jsx(ce,{mb:2,children:m.jsx(Ur,{elevation:2,children:m.jsx(ce,{p:2,children:t})})})}),i&&m.jsx(dt,{sx:{mt:r?-5:-1.5},children:m.jsx(l,{...n,style:c})})]})}function iPe(e){const{canAdd:t,disabled:n,fieldPathId:r,uiSchema:i,items:o,optionalDataControl:s,onAddClick:a,readonly:l,registry:c,required:u,schema:f,title:h}=e,g=$t(i),y=Bt("ArrayFieldDescriptionTemplate",c,g),b=Bt("ArrayFieldTitleTemplate",c,g),v=!l&&!n,{ButtonTemplates:{AddButton:S}}=c.templates;return m.jsx(Ur,{elevation:2,children:m.jsxs(ce,{p:2,children:[m.jsx(b,{fieldPathId:r,title:g.title||h,schema:f,uiSchema:i,required:u,registry:c,optionalDataControl:v?s:void 0}),m.jsx(y,{fieldPathId:r,description:g.description||f.description,schema:f,uiSchema:i,registry:c}),v?void 0:s,o,t&&m.jsx(dt,{container:!0,justifyContent:"flex-end",children:m.jsx(dt,{children:m.jsx(ce,{mt:2,children:m.jsx(S,{id:Kl(r,"add"),className:"rjsf-array-item-add",onClick:a,disabled:n||l,uiSchema:i,registry:c})})})})]})})}function oPe(e){return Qe("MuiInputAdornment",e)}const PU=tt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var jU;const sPe=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${ye(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},aPe=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=e,a={root:["root",n&&"disablePointerEvents",i&&`position${ye(i)}`,s,r&&"hiddenLabel",o&&`size${ye(o)}`]};return et(a,oPe,t)},lPe=me("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:sPe})(Ge(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${PU.positionStart}&:not(.${PU.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),AM=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,h=ll()||{};let g=u;u&&h.variant,h&&!g&&(g=h.variant);const y={...r,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:a,position:c,variant:g},b=aPe(y);return m.jsx(fw.Provider,{value:null,children:m.jsx(lPe,{as:s,ownerState:y,className:Te(b.root,o),ref:n,...f,children:typeof i=="string"&&!l?m.jsx(ie,{color:"textSecondary",children:i}):m.jsxs(_.Fragment,{children:[c==="start"?jU||(jU=m.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,i]})})})}),cPe=["date","datetime-local","file","time"];function uPe(e){const{id:t,name:n,htmlName:r,placeholder:i,required:o,readonly:s,disabled:a,type:l,label:c,hideLabel:u,hideError:f,value:h,onChange:g,onChangeOverride:y,onBlur:b,onFocus:v,autofocus:S,options:C,schema:w,uiSchema:A,rawErrors:E=[],errorSchema:D,registry:O,InputLabelProps:T,InputProps:I,slotProps:N,...$}=e,{ClearButton:R}=O.templates.ButtonTemplates,{step:F,min:j,max:z,accept:L,...q}=JQ(w,l,C),V={...N?.htmlInput,step:F,min:j,max:z,accept:L,...w.examples?{list:Bw(t)}:void 0},U=({target:{value:Y}})=>g(Y===""?C.emptyValue:Y),K=({target:Y})=>b(t,Y&&Y.value),B=({target:Y})=>v(t,Y&&Y.value),W=cPe.includes(l)?{...N?.inputLabel,...T,shrink:!0}:{...N?.inputLabel,...T},X=_.useCallback(Y=>{var J;Y.preventDefault(),Y.stopPropagation(),g((J=C.emptyValue)!==null&&J!==void 0?J:"")},[g,C.emptyValue]),H={...I,...N?.input};if(C.allowClearTextInputs&&h&&!s&&!a){const Y=m.jsx(AM,{position:"end",children:m.jsx(R,{registry:O,onClick:X})});H.endAdornment=H.endAdornment?m.jsxs(m.Fragment,{children:[H.endAdornment,Y]}):Y}return m.jsxs(m.Fragment,{children:[m.jsx(Lr,{id:t,name:r||t,placeholder:i,label:sp(c||void 0,u,void 0),autoFocus:S,required:o,disabled:a||s,slotProps:{...N,input:H,htmlInput:V,inputLabel:W},...q,value:h||h===0?h:"",error:E.length>0,onChange:y||U,onBlur:K,onFocus:B,...$,"aria-describedby":Us(t,!!w.examples)}),m.jsx(bee,{id:t,schema:w})]})}function dPe(e){const{id:t,description:n,registry:r,uiSchema:i}=e;return n?m.jsx(ie,{id:t,variant:"subtitle2",style:{marginTop:"5px"},children:m.jsx(vM,{description:n,registry:r,uiSchema:i})}):null}function fPe({errors:e,registry:t}){const{translateString:n}=t;return m.jsx(Ur,{elevation:2,children:m.jsxs(ce,{mb:2,p:2,children:[m.jsx(ie,{variant:"h6",children:n(un.ErrorsLabel)}),m.jsx(bc,{dense:!0,children:e.map((r,i)=>m.jsxs(yf,{children:[m.jsx(Ul,{children:m.jsx(vf,{color:"error"})}),m.jsx(Va,{primary:r.stack})]},i))})]})})}function Xm(e){const{icon:t,color:n,uiSchema:r,registry:i,...o}=e;return m.jsx(_n,{...o,size:"small",color:n,children:t})}function hPe(e){const{registry:{translateString:t}}=e;return m.jsx(Xm,{title:t(un.CopyButton),...e,icon:m.jsx(Ah,{fontSize:"small"})})}function pPe(e){const{registry:{translateString:t}}=e;return m.jsx(Xm,{title:t(un.MoveDownButton),...e,icon:m.jsx(vT,{fontSize:"small"})})}function mPe(e){const{registry:{translateString:t}}=e;return m.jsx(Xm,{title:t(un.MoveUpButton),...e,icon:m.jsx(xT,{fontSize:"small"})})}function Tee(e){const{iconType:t,...n}=e,{registry:{translateString:r}}=n;return m.jsx(Xm,{title:r(un.RemoveButton),...n,color:"error",icon:m.jsx(oZ,{fontSize:t==="default"?void 0:"small"})})}function gPe(e){const{iconType:t,...n}=e,{registry:{translateString:r}}=n;return m.jsx(Xm,{title:r(un.ClearButton),...n,icon:m.jsx(VCe,{fontSize:t==="default"?void 0:"small"})})}function yPe(e){const{errors:t=[],fieldPathId:n}=e;if(t.length===0)return null;const r=uM(n);return m.jsx(bc,{id:r,dense:!0,disablePadding:!0,children:t.map((i,o)=>m.jsx(yf,{disableGutters:!0,children:m.jsx(bw,{component:"div",id:`${r}-${o}`,children:i})},o))})}function bPe(e){const{fieldPathId:t,help:n,uiSchema:r,registry:i}=e;return n?m.jsx(bw,{component:"div",id:dM(t),style:{marginTop:"5px"},children:m.jsx(xM,{help:n,registry:i,uiSchema:r})}):null}function vPe(e){const{id:t,children:n,classNames:r,style:i,disabled:o,displayLabel:s,hidden:a,label:l,onKeyRename:c,onKeyRenameBlur:u,onRemoveProperty:f,readonly:h,required:g,rawErrors:y=[],errors:b,help:v,description:S,rawDescription:C,schema:w,uiSchema:A,registry:E}=e,D=$t(A),O=Bt("WrapIfAdditionalTemplate",E,D);if(a)return m.jsx("div",{style:{display:"none"},children:n});const T=D.widget==="checkbox";return m.jsx(O,{classNames:r,style:i,disabled:o,id:t,label:l,displayLabel:s,rawDescription:C,onKeyRename:c,onKeyRenameBlur:u,onRemoveProperty:f,readonly:h,required:g,schema:w,uiSchema:A,registry:E,children:m.jsxs(pa,{fullWidth:!0,error:!!y.length,required:g,children:[n,s&&!T&&C?m.jsx(ie,{variant:"caption",color:"textSecondary",children:S}):null,b,v]})})}function xPe(e){const{children:t,column:n,...r}=e;return m.jsx(dt,{container:!n,...r,children:t})}function SPe(e){const{optionSchemaField:t,selector:n}=e;return m.jsxs(ce,{sx:{mb:2},children:[m.jsx(pa,{fullWidth:!0,sx:{mb:2},children:n}),t]})}function wPe(e){const{description:t,title:n,properties:r,required:i,disabled:o,readonly:s,uiSchema:a,fieldPathId:l,schema:c,formData:u,optionalDataControl:f,onAddProperty:h,registry:g}=e,y=$t(a),b=Bt("TitleFieldTemplate",g,y),v=Bt("DescriptionFieldTemplate",g,y),S=!s&&!o,{ButtonTemplates:{AddButton:C}}=g.templates;return m.jsxs(m.Fragment,{children:[n&&m.jsx(b,{id:zw(l),title:n,required:i,schema:c,uiSchema:a,registry:g,optionalDataControl:S?f:void 0}),t&&m.jsx(v,{id:op(l),description:t,schema:c,uiSchema:a,registry:g}),m.jsxs(dt,{container:!0,spacing:2,style:{marginTop:"10px"},children:[S?void 0:f,r.map((w,A)=>w.hidden?w.content:m.jsx(dt,{size:{xs:12},style:{marginBottom:"10px"},children:w.content},A))]}),RJ(c,a,u)&&m.jsx(dt,{container:!0,justifyContent:"flex-end",children:m.jsx(dt,{children:m.jsx(C,{id:Kl(l,"add"),className:"rjsf-object-property-expand",onClick:h,disabled:o||s,uiSchema:a,registry:g})})})]})}function CPe(e){const{id:t,registry:n,label:r,onAddClick:i,onRemoveClick:o}=e;return i?m.jsx(Xm,{id:t,registry:n,className:"rjsf-add-optional-data",onClick:i,title:r,icon:m.jsx(fc,{fontSize:"small"})}):o?m.jsx(Tee,{id:t,registry:n,className:"rjsf-remove-optional-data",onClick:o,title:r}):m.jsx("em",{id:t,children:r})}function EPe({uiSchema:e}){const{submitText:t,norender:n,props:r={}}=QQ(e);return n?null:m.jsx(ce,{marginTop:3,children:m.jsx(kt,{type:"submit",variant:"contained",color:"primary",...r,children:t})})}function APe({id:e,title:t,optionalDataControl:n}){let r=m.jsx(ie,{variant:"h5",children:t});return n&&(r=m.jsxs(dt,{container:!0,spacing:0,children:[m.jsx(dt,{size:"grow",children:r}),m.jsx(dt,{justifyContent:"flex-end",children:n})]})),m.jsxs(ce,{id:e,mb:1,mt:1,children:[r,m.jsx(gi,{})]})}function kPe(e){const{children:t,classNames:n,style:r,disabled:i,id:o,label:s,displayLabel:a,onKeyRenameBlur:l,onRemoveProperty:c,readonly:u,required:f,schema:h,uiSchema:g,registry:y}=e,{templates:b,translateString:v}=y,{RemoveButton:S}=b.ButtonTemplates,C=v(un.KeyLabel,[s]),w=fu in h,A={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"};return w?m.jsxs(dt,{container:!0,alignItems:"flex-start",spacing:2,className:n,style:r,children:[m.jsx(dt,{size:5.5,children:m.jsx(Lr,{fullWidth:!0,required:f,label:a?C:void 0,defaultValue:s,disabled:i||u,id:`${o}-key`,name:`${o}-key`,onBlur:u?void 0:l,type:"text"})}),m.jsx(dt,{size:5.5,children:t}),m.jsx(dt,{sx:{mt:1.5},children:m.jsx(S,{id:Kl(o,"remove"),className:"rjsf-object-property-remove",iconType:"default",style:A,disabled:i||u,onClick:c,uiSchema:g,registry:y})})]},`${o}-key`):m.jsx("div",{className:n,style:r,children:t})}function Mee(){return{ArrayFieldItemTemplate:rPe,ArrayFieldTemplate:iPe,BaseInputTemplate:uPe,ButtonTemplates:{AddButton:nPe,CopyButton:hPe,MoveDownButton:pPe,MoveUpButton:mPe,RemoveButton:Tee,SubmitButton:EPe,ClearButton:gPe},DescriptionFieldTemplate:dPe,ErrorListTemplate:fPe,FieldErrorTemplate:yPe,FieldHelpTemplate:bPe,FieldTemplate:vPe,GridTemplate:xPe,MultiSchemaFieldTemplate:SPe,ObjectFieldTemplate:wPe,OptionalDataControlsTemplate:CPe,TitleFieldTemplate:APe,WrapIfAdditionalTemplate:kPe}}function _Pe(e){var t;const{schema:n,id:r,htmlName:i,value:o,disabled:s,readonly:a,label:l="",hideLabel:c,autofocus:u,onChange:f,onBlur:h,onFocus:g,registry:y,options:b,uiSchema:v}=e,S=Bt("DescriptionFieldTemplate",y,b),C=py(n),w=(O,T)=>f(T),A=()=>h(r,o),E=()=>g(r,o),D=(t=b.description)!==null&&t!==void 0?t:n.description;return m.jsxs(m.Fragment,{children:[!c&&D&&m.jsx(S,{id:op(r),description:D,schema:n,uiSchema:v,registry:y}),m.jsx(Ls,{control:m.jsx(Wl,{id:r,name:i||r,checked:typeof o>"u"?!1:!!o,required:C,disabled:s||a,autoFocus:u,onChange:w,onBlur:A,onFocus:E,"aria-describedby":Us(r)}),label:sp(l,c,!1)})]})}function DPe(e){return Qe("MuiFormGroup",e)}tt("MuiFormGroup",["root","row","error"]);const OPe=e=>{const{classes:t,row:n,error:r}=e;return et({root:["root",n&&"row",r&&"error"]},DPe,t)},TPe=me("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),Ree=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=ll(),l=xf({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=OPe(c);return m.jsx(TPe,{className:Te(u.root,i),ownerState:c,ref:n,...s})});function MPe({label:e,hideLabel:t,id:n,htmlName:r,disabled:i,options:o,value:s,autofocus:a,readonly:l,required:c,onChange:u,onBlur:f,onFocus:h}){const{enumOptions:g,enumDisabled:y,inline:b,emptyValue:v}=o,S=Array.isArray(s)?s:[s],C=E=>({target:{checked:D}})=>{u(D?YQ(E,S,g):KQ(E,S,g))},w=({target:E})=>f(n,no(E&&E.value,g,v)),A=({target:E})=>h(n,no(E&&E.value,g,v));return m.jsxs(m.Fragment,{children:[sp(m.jsx(hw,{required:c,htmlFor:n,children:e||void 0}),t),m.jsx(Ree,{id:n,row:!!b,children:Array.isArray(g)&&g.map((E,D)=>{const O=Fw(E.value,S),T=Array.isArray(y)&&y.indexOf(E.value)!==-1,I=m.jsx(Wl,{id:Hw(n,D),name:r||n,checked:O,disabled:i||T||l,autoFocus:a&&D===0,onChange:C(D),onBlur:w,onFocus:A,"aria-describedby":Us(n)});return m.jsx(Ls,{control:I,label:E.label},D)})})]})}const RPe=_e(m.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"})),IPe=_e(m.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"})),PPe=me("span",{name:"MuiRadioButtonIcon",shouldForwardProp:io})({position:"relative",display:"flex"}),jPe=me(RPe,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),$Pe=me(IPe,{name:"MuiRadioButtonIcon"})(Ge(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function Iee(e){const{checked:t=!1,classes:n={},fontSize:r}=e,i={...e,checked:t};return m.jsxs(PPe,{className:n.root,ownerState:i,children:[m.jsx(jPe,{fontSize:r,className:n.background,ownerState:i}),m.jsx($Pe,{fontSize:r,className:n.dot,ownerState:i})]})}const Pee=_.createContext(void 0);function LPe(){return _.useContext(Pee)}function NPe(e){return Qe("MuiRadio",e)}const $U=tt("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),FPe=e=>{const{classes:t,color:n,size:r}=e,i={root:["root",`color${ye(n)}`,r!=="medium"&&`size${ye(r)}`]};return{...t,...et(i,NPe,t)}},BPe=me(uT,{shouldForwardProp:e=>io(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size!=="medium"&&t[`size${ye(n.size)}`],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${$U.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${$U.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function zPe(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const HPe=m.jsx(Iee,{checked:!0}),UPe=m.jsx(Iee,{}),VPe=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiRadio"}),{checked:i,checkedIcon:o=HPe,color:s="primary",icon:a=UPe,name:l,onChange:c,size:u="medium",className:f,disabled:h,disableRipple:g=!1,slots:y={},slotProps:b={},inputProps:v,...S}=r,C=ll();let w=h;C&&typeof w>"u"&&(w=C.disabled),w??=!1;const A={...r,disabled:w,disableRipple:g,color:s,size:u},E=FPe(A),D=LPe();let O=i;const T=mk(c,D&&D.onChange);let I=l;D&&(typeof O>"u"&&(O=zPe(D.value,r.value)),typeof I>"u"&&(I=D.name));const N=b.input??v,[$,R]=lt("root",{ref:n,elementType:BPe,className:Te(E.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:y,slotProps:b,...S},getSlotProps:F=>({...F,onChange:(j,...z)=>{F.onChange?.(j,...z),T(j,...z)}}),ownerState:A,additionalProps:{type:"radio",icon:_.cloneElement(a,{fontSize:a.props.fontSize??u}),checkedIcon:_.cloneElement(o,{fontSize:o.props.fontSize??u}),disabled:w,name:I,checked:O,slots:y,slotProps:{input:typeof N=="function"?N(A):N}}});return m.jsx($,{...R,classes:E})});function WPe(e){return Qe("MuiRadioGroup",e)}tt("MuiRadioGroup",["root","row","error"]);const qPe=e=>{const{classes:t,row:n,error:r}=e;return et({root:["root",n&&"row",r&&"error"]},WPe,t)},GPe=_.forwardRef(function(t,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=t,f=_.useRef(null),h=qPe(t),[g,y]=Ya({controlled:c,default:s,name:"RadioGroup"});_.useImperativeHandle(r,()=>({focus:()=>{let C=f.current.querySelector("input:not(:disabled):checked");C||(C=f.current.querySelector("input:not(:disabled)")),C&&C.focus()}}),[]);const b=Tr(n,f),v=Ou(a),S=_.useMemo(()=>({name:v,onChange(C){y(C.target.value),l&&l(C,C.target.value)},value:g}),[v,l,y,g]);return m.jsx(Pee.Provider,{value:S,children:m.jsx(Ree,{role:"radiogroup",ref:b,className:Te(h.root,o),...u,children:i})})});function KPe({id:e,htmlName:t,options:n,value:r,required:i,disabled:o,readonly:s,label:a,hideLabel:l,onChange:c,onBlur:u,onFocus:f}){var h;const{enumOptions:g,enumDisabled:y,emptyValue:b}=n,v=(E,D)=>c(no(D,g,b)),S=({target:E})=>u(e,no(E&&E.value,g,b)),C=({target:E})=>f(e,no(E&&E.value,g,b)),w=n?n.inline:!1,A=(h=aM(r,g))!==null&&h!==void 0?h:null;return m.jsxs(m.Fragment,{children:[sp(m.jsx(hw,{required:i,htmlFor:e,children:a||void 0}),l),m.jsx(GPe,{id:e,name:t||e,value:A,row:w,onChange:v,onBlur:S,onFocus:C,"aria-describedby":Us(e),children:Array.isArray(g)&&g.map((E,D)=>{const O=Array.isArray(y)&&y.indexOf(E.value)!==-1;return m.jsx(Ls,{control:m.jsx(VPe,{name:t||e,id:Hw(e,D),color:"primary"}),label:E.label,value:String(D),disabled:o||O||s},D)})})]})}const YPe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function XPe(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const ZPe=2;function e0(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function jee(e,t){return e-t}function LU(e,t){const{index:n}=e.reduce((r,i,o)=>{const s=Math.abs(t-i);return r===null||s<r.distance||s===r.distance?{distance:s,index:o}:r},null)??{};return n}function A3(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let r=0;r<n.changedTouches.length;r+=1){const i=n.changedTouches[r];if(i.identifier===t.current)return{x:i.clientX,y:i.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function u6(e,t,n){return(e-t)*100/(n-t)}function JPe(e,t,n){return(n-t)*e+t}function QPe(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function eje(e,t,n){const r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(QPe(t)))}function NU({values:e,newValue:t,index:n}){const r=e.slice();return r[n]=t,r.sort(jee)}function k3({sliderRef:e,activeIndex:t,setActive:n}){const r=Di(e.current);(!e.current?.contains(r.activeElement)||Number(r?.activeElement?.getAttribute("data-index"))!==t)&&e.current?.querySelector(`[type="range"][data-index="${t}"]`).focus(),n&&n(t)}function _3(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?XPe(e,t):!1}const tje={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},nje=e=>e;let D3;function FU(){return D3===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?D3=CSS.supports("touch-action","none"):D3=!0),D3}function rje(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:h="horizontal",rootRef:g,scale:y=nje,step:b=1,shiftStep:v=10,tabIndex:S,value:C}=e,w=_.useRef(void 0),[A,E]=_.useState(-1),[D,O]=_.useState(-1),[T,I]=_.useState(!1),N=_.useRef(0),$=_.useRef(null),[R,F]=Ya({controlled:C,default:n??l,name:"Slider"}),j=u&&((ze,Pe,He)=>{const Je=ze.nativeEvent||ze,nt=new Je.constructor(Je.type,Je);Object.defineProperty(nt,"target",{writable:!0,value:{value:Pe,name:c}}),$.current=Pe,u(nt,Pe,He)}),z=Array.isArray(R);let L=z?R.slice().sort(jee):[R];L=L.map(ze=>ze==null?l:l0(ze,l,a));const q=s===!0&&b!==null?[...Array(Math.floor((a-l)/b)+1)].map((ze,Pe)=>({value:l+b*Pe})):s||[],V=q.map(ze=>ze.value),[U,K]=_.useState(-1),B=_.useRef(null),W=Tr(g,B),X=ze=>Pe=>{const He=Number(Pe.currentTarget.getAttribute("data-index"));Gd(Pe.target)&&K(He),O(He),ze?.onFocus?.(Pe)},H=ze=>Pe=>{Gd(Pe.target)||K(-1),O(-1),ze?.onBlur?.(Pe)},Y=(ze,Pe)=>{const He=Number(ze.currentTarget.getAttribute("data-index")),Je=L[He],nt=V.indexOf(Je);let ot=Pe;if(q&&b==null){const Xe=V[V.length-1];ot>=Xe?ot=Xe:ot<=V[0]?ot=V[0]:ot=ot<Je?V[nt-1]:V[nt+1]}if(ot=l0(ot,l,a),z){i&&(ot=l0(ot,L[He-1]||-1/0,L[He+1]||1/0));const Xe=ot;ot=NU({values:L,newValue:ot,index:He});let Lt=He;i||(Lt=ot.indexOf(Xe)),k3({sliderRef:B,activeIndex:Lt})}F(ot),K(He),j&&!_3(ot,R)&&j(ze,ot,He),f&&f(ze,$.current??ot)},J=ze=>Pe=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(Pe.key)){Pe.preventDefault();const He=Number(Pe.currentTarget.getAttribute("data-index")),Je=L[He];let nt=null;if(b!=null){const ot=Pe.shiftKey?v:b;switch(Pe.key){case"ArrowUp":nt=e0(Je,ot,1,l,a);break;case"ArrowRight":nt=e0(Je,ot,o?-1:1,l,a);break;case"ArrowDown":nt=e0(Je,ot,-1,l,a);break;case"ArrowLeft":nt=e0(Je,ot,o?1:-1,l,a);break;case"PageUp":nt=e0(Je,v,1,l,a);break;case"PageDown":nt=e0(Je,v,-1,l,a);break;case"Home":nt=l;break;case"End":nt=a;break}}else if(q){const ot=V[V.length-1],Xe=V.indexOf(Je),Lt=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],Nt=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];Lt.includes(Pe.key)?Xe===0?nt=V[0]:nt=V[Xe-1]:Nt.includes(Pe.key)&&(Xe===V.length-1?nt=ot:nt=V[Xe+1])}nt!=null&&Y(Pe,nt)}ze?.onKeyDown?.(Pe)};Ho(()=>{r&&B.current.contains(document.activeElement)&&document.activeElement?.blur()},[r]),r&&A!==-1&&E(-1),r&&U!==-1&&K(-1);const ne=ze=>Pe=>{ze.onChange?.(Pe),Y(Pe,Pe.target.valueAsNumber)},ee=_.useRef(void 0);let se=h;o&&h==="horizontal"&&(se+="-reverse");const ue=({finger:ze,move:Pe=!1})=>{const{current:He}=B,{width:Je,height:nt,bottom:ot,left:Xe}=He.getBoundingClientRect();let Lt;se.startsWith("vertical")?Lt=(ot-ze.y)/nt:Lt=(ze.x-Xe)/Je,se.includes("-reverse")&&(Lt=1-Lt);let Nt;if(Nt=JPe(Lt,l,a),b)Nt=eje(Nt,b,l);else{const Xn=LU(V,Nt);Nt=V[Xn]}Nt=l0(Nt,l,a);let Ot=0;if(z){Pe?Ot=ee.current:Ot=LU(L,Nt),i&&(Nt=l0(Nt,L[Ot-1]||-1/0,L[Ot+1]||1/0));const Xn=Nt;Nt=NU({values:L,newValue:Nt,index:Ot}),i&&Pe||(Ot=Nt.indexOf(Xn),ee.current=Ot)}return{newValue:Nt,activeIndex:Ot}},te=Ni(ze=>{const Pe=A3(ze,w);if(!Pe)return;if(N.current+=1,ze.type==="mousemove"&&ze.buttons===0){Z(ze);return}const{newValue:He,activeIndex:Je}=ue({finger:Pe,move:!0});k3({sliderRef:B,activeIndex:Je,setActive:E}),F(He),!T&&N.current>ZPe&&I(!0),j&&!_3(He,R)&&j(ze,He,Je)}),Z=Ni(ze=>{const Pe=A3(ze,w);if(I(!1),!Pe)return;const{newValue:He}=ue({finger:Pe,move:!0});E(-1),ze.type==="touchend"&&O(-1),f&&f(ze,$.current??He),w.current=void 0,oe()}),re=Ni(ze=>{if(r)return;FU()||ze.preventDefault();const Pe=ze.changedTouches[0];Pe!=null&&(w.current=Pe.identifier);const He=A3(ze,w);if(He!==!1){const{newValue:nt,activeIndex:ot}=ue({finger:He});k3({sliderRef:B,activeIndex:ot,setActive:E}),F(nt),j&&!_3(nt,R)&&j(ze,nt,ot)}N.current=0;const Je=Di(B.current);Je.addEventListener("touchmove",te,{passive:!0}),Je.addEventListener("touchend",Z,{passive:!0})}),oe=_.useCallback(()=>{const ze=Di(B.current);ze.removeEventListener("mousemove",te),ze.removeEventListener("mouseup",Z),ze.removeEventListener("touchmove",te),ze.removeEventListener("touchend",Z)},[Z,te]);_.useEffect(()=>{const{current:ze}=B;return ze.addEventListener("touchstart",re,{passive:FU()}),()=>{ze.removeEventListener("touchstart",re),oe()}},[oe,re]),_.useEffect(()=>{r&&oe()},[r,oe]);const fe=ze=>Pe=>{if(ze.onMouseDown?.(Pe),r||Pe.defaultPrevented||Pe.button!==0)return;Pe.preventDefault();const He=A3(Pe,w);if(He!==!1){const{newValue:nt,activeIndex:ot}=ue({finger:He});k3({sliderRef:B,activeIndex:ot,setActive:E}),F(nt),j&&!_3(nt,R)&&j(Pe,nt,ot)}N.current=0;const Je=Di(B.current);Je.addEventListener("mousemove",te,{passive:!0}),Je.addEventListener("mouseup",Z)},be=u6(z?L[0]:l,l,a),De=u6(L[L.length-1],l,a)-be,Oe=(ze={})=>{const Pe=Yi(ze),He={onMouseDown:fe(Pe||{})},Je={...Pe,...He};return{...ze,ref:W,...Je}},Ke=ze=>Pe=>{ze.onMouseOver?.(Pe);const He=Number(Pe.currentTarget.getAttribute("data-index"));O(He)},xe=ze=>Pe=>{ze.onMouseLeave?.(Pe),O(-1)},Le=(ze={})=>{const Pe=Yi(ze),He={onMouseOver:Ke(Pe||{}),onMouseLeave:xe(Pe||{})};return{...ze,...Pe,...He}},Me=ze=>({pointerEvents:A!==-1&&A!==ze?"none":void 0});let ht;return h==="vertical"&&(ht=o?"vertical-rl":"vertical-lr"),{active:A,axis:se,axisProps:tje,dragging:T,focusedThumbIndex:U,getHiddenInputProps:(ze={})=>{const Pe=Yi(ze),He={onChange:ne(Pe||{}),onFocus:X(Pe||{}),onBlur:H(Pe||{}),onKeyDown:J(Pe||{})},Je={...Pe,...He};return{tabIndex:S,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":y(a),"aria-valuemin":y(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:r,...ze,...Je,style:{...YPe,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:ht}}},getRootProps:Oe,getThumbProps:Le,marks:q,open:D,range:z,rootRef:W,trackLeap:De,trackOffset:be,values:L,getThumbStyle:Me}}const ije=e=>!e||!ic(e);function oje(e){return Qe("MuiSlider",e)}const aa=tt("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),sje=e=>{const{open:t}=e;return{offset:Te(t&&aa.valueLabelOpen),circle:aa.valueLabelCircle,label:aa.valueLabelLabel}};function aje(e){const{children:t,className:n,value:r}=e,i=sje(e);return t?_.cloneElement(t,{className:t.props.className},m.jsxs(_.Fragment,{children:[t.props.children,m.jsx("span",{className:Te(i.offset,n),"aria-hidden":!0,children:m.jsx("span",{className:i.circle,children:m.jsx("span",{className:i.label,children:r})})})]})):null}function BU(e){return e}const lje=me("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${ye(n.color)}`],n.size!=="medium"&&t[`size${ye(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Ge(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${aa.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${aa.dragging}`]:{[`& .${aa.thumb}, & .${aa.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),cje=me("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),uje=me("span",{name:"MuiSlider",slot:"Track"})(Ge(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),dje=me("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${ye(n.color)}`],n.size!=="medium"&&t[`thumbSize${ye(n.size)}`]]}})(Ge(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${aa.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(Fn()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${aa.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${aa.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),fje=me(aje,{name:"MuiSlider",slot:"ValueLabel"})(Ge(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${aa.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${aa.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),hje=me("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>GS(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Ge(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),pje=me("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>GS(e)&&e!=="markLabelActive"})(Ge(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),mje=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=e,c={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${ye(a)}`,l&&`size${ye(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${ye(l)}`,a&&`thumbColor${ye(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return et(c,oje,s)},gje=({children:e})=>e,yje=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiSlider"}),i=mf(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:h,className:g,disableSwap:y=!1,disabled:b=!1,getAriaLabel:v,getAriaValueText:S,marks:C=!1,max:w=100,min:A=0,name:E,onChange:D,onChangeCommitted:O,orientation:T="horizontal",shiftStep:I=10,size:N="medium",step:$=1,scale:R=BU,slotProps:F,slots:j,tabIndex:z,track:L="normal",value:q,valueLabelDisplay:V="off",valueLabelFormat:U=BU,...K}=r,B={...r,isRtl:i,max:w,min:A,classes:h,disabled:b,disableSwap:y,orientation:T,marks:C,color:f,size:N,step:$,shiftStep:I,scale:R,track:L,valueLabelDisplay:V,valueLabelFormat:U},{axisProps:W,getRootProps:X,getHiddenInputProps:H,getThumbProps:Y,open:J,active:ne,axis:ee,focusedThumbIndex:se,range:ue,dragging:te,marks:Z,values:re,trackOffset:oe,trackLeap:fe,getThumbStyle:be}=rje({...B,rootRef:n});B.marked=Z.length>0&&Z.some(Dt=>Dt.label),B.dragging=te,B.focusedThumbIndex=se;const De=mje(B),Oe=j?.root??c.Root??lje,Ke=j?.rail??c.Rail??cje,xe=j?.track??c.Track??uje,Le=j?.thumb??c.Thumb??dje,Me=j?.valueLabel??c.ValueLabel??fje,ht=j?.mark??c.Mark??hje,mt=j?.markLabel??c.MarkLabel??pje,ze=j?.input??c.Input??"input",Pe=F?.root??u.root,He=F?.rail??u.rail,Je=F?.track??u.track,nt=F?.thumb??u.thumb,ot=F?.valueLabel??u.valueLabel,Xe=F?.mark??u.mark,Lt=F?.markLabel??u.markLabel,Nt=F?.input??u.input,Ot=Yr({elementType:Oe,getSlotProps:X,externalSlotProps:Pe,externalForwardedProps:K,additionalProps:{...ije(Oe)&&{as:l}},ownerState:{...B,...Pe?.ownerState},className:[De.root,g]}),Xn=Yr({elementType:Ke,externalSlotProps:He,ownerState:B,className:De.rail}),rn=Yr({elementType:xe,externalSlotProps:Je,additionalProps:{style:{...W[ee].offset(oe),...W[ee].leap(fe)}},ownerState:{...B,...Je?.ownerState},className:De.track}),at=Yr({elementType:Le,getSlotProps:Y,externalSlotProps:nt,ownerState:{...B,...nt?.ownerState},className:De.thumb}),Ht=Yr({elementType:Me,externalSlotProps:ot,ownerState:{...B,...ot?.ownerState},className:De.valueLabel}),Dn=Yr({elementType:ht,externalSlotProps:Xe,ownerState:B,className:De.mark}),Gn=Yr({elementType:mt,externalSlotProps:Lt,ownerState:B,className:De.markLabel}),yr=Yr({elementType:ze,getSlotProps:H,externalSlotProps:Nt,ownerState:B});return m.jsxs(Oe,{...Ot,children:[m.jsx(Ke,{...Xn}),m.jsx(xe,{...rn}),Z.filter(Dt=>Dt.value>=A&&Dt.value<=w).map((Dt,jt)=>{const Jt=u6(Dt.value,A,w),jn=W[ee].offset(Jt);let on;return L===!1?on=re.includes(Dt.value):on=L==="normal"&&(ue?Dt.value>=re[0]&&Dt.value<=re[re.length-1]:Dt.value<=re[0])||L==="inverted"&&(ue?Dt.value<=re[0]||Dt.value>=re[re.length-1]:Dt.value>=re[0]),m.jsxs(_.Fragment,{children:[m.jsx(ht,{"data-index":jt,...Dn,...!ic(ht)&&{markActive:on},style:{...jn,...Dn.style},className:Te(Dn.className,on&&De.markActive)}),Dt.label!=null?m.jsx(mt,{"aria-hidden":!0,"data-index":jt,...Gn,...!ic(mt)&&{markLabelActive:on},style:{...jn,...Gn.style},className:Te(De.markLabel,Gn.className,on&&De.markLabelActive),children:Dt.label}):null]},jt)}),re.map((Dt,jt)=>{const Jt=u6(Dt,A,w),jn=W[ee].offset(Jt),on=V==="off"?gje:Me;return m.jsx(on,{...!ic(on)&&{valueLabelFormat:U,valueLabelDisplay:V,value:typeof U=="function"?U(R(Dt),jt):U,index:jt,open:J===jt||ne===jt||V==="on",disabled:b},...Ht,children:m.jsx(Le,{"data-index":jt,...at,className:Te(De.thumb,at.className,ne===jt&&De.active,se===jt&&De.focusVisible),style:{...jn,...be(jt),...at.style},children:m.jsx(ze,{"data-index":jt,"aria-label":v?v(jt):o,"aria-valuenow":R(Dt),"aria-labelledby":a,"aria-valuetext":S?S(R(Dt),jt):s,value:re[jt],...yr})})},jt)})]})});function bje(e){const{value:t,readonly:n,disabled:r,onBlur:i,onFocus:o,options:s,schema:a,onChange:l,required:c,label:u,hideLabel:f,id:h}=e,g={value:t,label:u,id:h,name:h,...ZQ(a)},y=(S,C)=>{l(C??s.emptyValue)},b=({target:S})=>i(h,S&&S.value),v=({target:S})=>o(h,S&&S.value);return m.jsxs(m.Fragment,{children:[sp(m.jsx(hw,{required:c,htmlFor:h,children:u||void 0}),f),m.jsx(yje,{disabled:r||n,onChange:y,onBlur:b,onFocus:v,valueLabelDisplay:"auto",...g,"aria-describedby":Us(h)})]})}function vje({schema:e,id:t,name:n,htmlName:r,options:i,label:o,hideLabel:s,required:a,disabled:l,placeholder:c,readonly:u,value:f,multiple:h,autofocus:g,onChange:y,onBlur:b,onFocus:v,errorSchema:S,rawErrors:C=[],registry:w,uiSchema:A,hideError:E,...D}){const{enumOptions:O,enumDisabled:T,emptyValue:I}=i;h=typeof h>"u"?!1:!!h;const N=h?[]:"",$=typeof f>"u"||h&&f.length<1||!h&&f===N,R=({target:{value:B}})=>y(no(B,O,I)),F=({target:B})=>b(t,no(B&&B.value,O,I)),j=({target:B})=>v(t,no(B&&B.value,O,I)),z=aM(f,O,h),{InputLabelProps:L,SelectProps:q,autocomplete:V,...U}=D,K=!h&&e.default===void 0;return m.jsxs(Lr,{id:t,name:r||t,label:sp(o||void 0,s,void 0),value:!$&&typeof z<"u"?z:N,required:a,disabled:l||u,autoFocus:g,autoComplete:V,placeholder:c,error:C.length>0,onChange:R,onBlur:F,onFocus:j,...U,select:!0,InputLabelProps:{...L,shrink:!$},SelectProps:{...q,multiple:h},"aria-describedby":Us(t),children:[K&&m.jsx(er,{value:"",children:c}),Array.isArray(O)&&O.map(({value:B,label:W},X)=>{const H=Array.isArray(T)&&T.indexOf(B)!==-1;return m.jsx(er,{value:String(X),disabled:H,children:W},X)})]})}function xje(e){const{options:t,registry:n}=e,r=Bt("BaseInputTemplate",n,t);let i=5;return(typeof t.rows=="string"||typeof t.rows=="number")&&(i=t.rows),m.jsx(r,{...e,multiline:!0,rows:i})}function Sje(){return{CheckboxWidget:_Pe,CheckboxesWidget:MPe,RadioWidget:KPe,RangeWidget:bje,SelectWidget:vje,TextareaWidget:xje}}function $ee(){return{templates:Mee(),widgets:Sje()}}const wje=$ee();function Cje(){return wee($ee())}Cje();const Eje=wee(wje),Aje=e=>{const t=(i,o)=>{const s=e.customValidate?.(i)??[];e.onChange(i,s.length===0)},n=e.customValidate,r=_.useCallback((i,o)=>((n?.(i)??[]).forEach(a=>{if(!a.message)return;const l=a.instancePath.split("/");let c=o;for(const u of l)u!==""&&(c=c[u]??c);c.addError(a.message)}),o),[n]);return m.jsx(Eje,{schema:e.schema,uiSchema:e.uiSchema,validator:tPe,formData:e.value,liveValidate:"onChange",customValidate:r,showErrorList:!1,onChange:i=>t(i.formData,i.errors),templates:e.templates,fields:e.fields})},Lee=1024;let kje=0,OE=class{constructor(t,n){this.from=t,this.to=n}};class xn{constructor(t={}){this.id=kje++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=ls.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}xn.closedBy=new xn({deserialize:e=>e.split(" ")});xn.openedBy=new xn({deserialize:e=>e.split(" ")});xn.group=new xn({deserialize:e=>e.split(" ")});xn.isolate=new xn({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});xn.contextHash=new xn({perNode:!0});xn.lookAhead=new xn({perNode:!0});xn.mounted=new xn({perNode:!0});class yy{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[xn.mounted.id]}}const _je=Object.create(null);class ls{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):_je,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new ls(t.name||"",n,t.id,r);if(t.props){for(let o of t.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(xn.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(xn.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}ls.none=new ls("",Object.create(null),0,8);class kM{constructor(t){this.types=t;for(let n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let n=[];for(let r of this.types){let i=null;for(let o of t){let s=o(r);if(s){i||(i=Object.assign({},r.props));let a=s[1],l=s[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}n.push(i?new ls(r.name,i,r.id,r.flags):r)}return new kM(n)}}const O3=new WeakMap,zU=new WeakMap;var ai;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(ai||(ai={}));class mi{constructor(t,n,r,i,o){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let t=yy.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(t=0){return new p_(this.topNode,t)}cursorAt(t,n=0,r=0){let i=O3.get(this)||this.topNode,o=new p_(i);return o.moveTo(t,n),O3.set(this,o._tree),o}get topNode(){return new ma(this,0,0,null)}resolve(t,n=0){let r=f2(O3.get(this)||this.topNode,t,n,!1);return O3.set(this,r),r}resolveInner(t,n=0){let r=f2(zU.get(this)||this.topNode,t,n,!0);return zU.set(this,r),r}resolveStack(t,n=0){return Tje(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:o=this.length}=t,s=t.mode||0,a=(s&ai.IncludeAnonymous)>0;for(let l=this.cursor(s|ai.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:OM(ls.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new mi(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new mi(ls.none,n,r,i)))}static build(t){return Mje(t)}}mi.empty=new mi(ls.none,[],[],0);class _M{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new _M(this.buffer,this.index)}}class tf{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return ls.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),t+=4,r==t)return o;let s=[];for(;t<r;)s.push(this.childString(t)),t=this.buffer[t+3];return o+"("+s.join(",")+")"}findChild(t,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=t;l!=n&&!(Nee(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(t,n,r){let i=this.buffer,o=new Uint16Array(n-t),s=0;for(let a=t,l=0;a<n;){o[l++]=i[a++],o[l++]=i[a++]-r;let c=o[l++]=i[a++]-r;o[l++]=i[a++]-t,s=Math.max(s,c)}return new tf(o,s,this.set)}}function Nee(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function f2(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let s=!r&&e instanceof ma&&e.index<0?null:e.parent;if(!s)return e;e=s}let o=r?0:ai.IgnoreOverlays;if(r)for(let s=e,a=s.parent;a;s=a,a=s.parent)s instanceof ma&&s.index<0&&((i=a.enter(t,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(e=a);for(;;){let s=e.enter(t,n,o);if(!s)return e;e=s}}class Fee{cursor(t=0){return new p_(this,t)}getChild(t,n=null,r=null){let i=HU(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return HU(this,t,n,r)}resolve(t,n=0){return f2(this,t,n,!1)}resolveInner(t,n=0){return f2(this,t,n,!0)}matchContext(t){return h_(this.parent,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class ma extends Fee{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;t!=c;t+=n){let u=a[t],f=l[t]+s.from,h;if(!(!(o&ai.EnterBracketed&&u instanceof mi&&(h=yy.get(u))&&!h.overlay&&h.bracketed&&r>=f&&r<=f+u.length)&&!Nee(i,r,f,f+u.length))){if(u instanceof tf){if(o&ai.ExcludeBuffers)continue;let g=u.findChild(0,u.buffer.length,n,r-f,i);if(g>-1)return new Rd(new Dje(s,u,t,f),null,g)}else if(o&ai.IncludeAnonymous||!u.type.isAnonymous||DM(u)){let g;if(!(o&ai.IgnoreMounts)&&(g=yy.get(u))&&!g.overlay)return new ma(g.tree,f,t,s);let y=new ma(u,f,t,s);return o&ai.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?u.children.length-1:0,n,r,i,o)}}}if(o&ai.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?t=s.index+n:t=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&ai.IgnoreOverlays)&&(i=yy.get(this._tree))&&i.overlay){let o=t-this.from,s=r&ai.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((n>0||s?a<=o:a<o)&&(n<0||s?l>=o:l>o))return new ma(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function HU(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function h_(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class Dje{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Rd extends Fee{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new Rd(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&ai.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new Rd(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Rd(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Rd(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];t.push(r.slice(i,o,s)),n.push(0)}return new mi(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Bee(e){if(!e.length)return null;let t=0,n=e[0];for(let o=1;o<e.length;o++){let s=e[o];(s.from>n.from||s.to<n.to)&&(n=s,t=o)}let r=n instanceof ma&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Oje(i,n)}class Oje{constructor(t,n){this.heads=t,this.node=n}get next(){return Bee(this.heads)}}function Tje(e,t,n){let r=e.resolveInner(t,n),i=null;for(let o=r instanceof ma?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(t,n)),o=s}else{let s=yy.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let a=new ma(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(f2(a,t,n,!1))}}return i?Bee(i):r}class p_{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~ai.EnterBracketed,t instanceof ma)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof ma?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&ai.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ai.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&ai.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+t,s=t<0?-1:r._tree.children.length;o!=s;o+=t){let a=r._tree.children[o];if(this.mode&ai.IncludeAnonymous||a instanceof tf||!a.type.isAnonymous||DM(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new Rd(this.buffer,n,this.stack[i]);return this.bufferNode=new Rd(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return h_(this.node.parent,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return h_(this._tree,t,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function DM(e){return e.children.some(t=>t instanceof tf||!t.type.isAnonymous||DM(t))}function Mje(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=Lee,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new _M(n,n.length):n,l=r.types,c=0,u=0;function f(E,D,O,T,I,N){let{id:$,start:R,end:F,size:j}=a,z=u,L=c;if(j<0)if(a.next(),j==-1){let B=o[$];O.push(B),T.push(R-E);return}else if(j==-3){c=$;return}else if(j==-4){u=$;return}else throw new RangeError(`Unrecognized record size: ${j}`);let q=l[$],V,U,K=R-E;if(F-R<=i&&(U=v(a.pos-D,I))){let B=new Uint16Array(U.size-U.skip),W=a.pos-U.size,X=B.length;for(;a.pos>W;)X=S(U.start,B,X);V=new tf(B,F-U.start,r),K=U.start-E}else{let B=a.pos-j;a.next();let W=[],X=[],H=$>=s?$:-1,Y=0,J=F;for(;a.pos>B;)H>=0&&a.id==H&&a.size>=0?(a.end<=J-i&&(y(W,X,R,Y,a.end,J,H,z,L),Y=W.length,J=a.end),a.next()):N>2500?h(R,B,W,X):f(R,B,W,X,H,N+1);if(H>=0&&Y>0&&Y<W.length&&y(W,X,R,Y,R,J,H,z,L),W.reverse(),X.reverse(),H>-1&&Y>0){let ne=g(q,L);V=OM(q,W,X,0,W.length,0,F-R,ne,ne)}else V=b(q,W,X,F-R,z-F,L)}O.push(V),T.push(K)}function h(E,D,O,T){let I=[],N=0,$=-1;for(;a.pos>D;){let{id:R,start:F,end:j,size:z}=a;if(z>4)a.next();else{if($>-1&&F<$)break;$<0&&($=j-i),I.push(R,F,j),N++,a.next()}}if(N){let R=new Uint16Array(N*4),F=I[I.length-2];for(let j=I.length-3,z=0;j>=0;j-=3)R[z++]=I[j],R[z++]=I[j+1]-F,R[z++]=I[j+2]-F,R[z++]=z;O.push(new tf(R,I[2]-F,r)),T.push(F-E)}}function g(E,D){return(O,T,I)=>{let N=0,$=O.length-1,R,F;if($>=0&&(R=O[$])instanceof mi){if(!$&&R.type==E&&R.length==I)return R;(F=R.prop(xn.lookAhead))&&(N=T[$]+R.length+F)}return b(E,O,T,I,N,D)}}function y(E,D,O,T,I,N,$,R,F){let j=[],z=[];for(;E.length>T;)j.push(E.pop()),z.push(D.pop()+O-I);E.push(b(r.types[$],j,z,N-I,R-N,F)),D.push(I-O)}function b(E,D,O,T,I,N,$){if(N){let R=[xn.contextHash,N];$=$?[R].concat($):[R]}if(I>25){let R=[xn.lookAhead,I];$=$?[R].concat($):[R]}return new mi(E,D,O,T,$)}function v(E,D){let O=a.fork(),T=0,I=0,N=0,$=O.end-i,R={size:0,start:0,skip:0};e:for(let F=O.pos-E;O.pos>F;){let j=O.size;if(O.id==D&&j>=0){R.size=T,R.start=I,R.skip=N,N+=4,T+=4,O.next();continue}let z=O.pos-j;if(j<0||z<F||O.start<$)break;let L=O.id>=s?4:0,q=O.start;for(O.next();O.pos>z;){if(O.size<0)if(O.size==-3||O.size==-4)L+=4;else break e;else O.id>=s&&(L+=4);O.next()}I=q,T+=j,N+=L}return(D<0||T==E)&&(R.size=T,R.start=I,R.skip=N),R.size>4?R:void 0}function S(E,D,O){let{id:T,start:I,end:N,size:$}=a;if(a.next(),$>=0&&T<s){let R=O;if($>4){let F=a.pos-($-4);for(;a.pos>F;)O=S(E,D,O)}D[--O]=R,D[--O]=N-E,D[--O]=I-E,D[--O]=T}else $==-3?c=T:$==-4&&(u=T);return O}let C=[],w=[];for(;a.pos>0;)f(e.start||0,e.bufferStart||0,C,w,-1,0);let A=(t=e.length)!==null&&t!==void 0?t:C.length?w[0]+C[0].length:0;return new mi(l[e.topID],C.reverse(),w.reverse(),A)}const UU=new WeakMap;function Q5(e,t){if(!e.isAnonymous||t instanceof tf||t.type!=e)return 1;let n=UU.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof mi)){n=1;break}n+=Q5(e,r)}UU.set(t,n)}return n}function OM(e,t,n,r,i,o,s,a,l){let c=0;for(let y=r;y<i;y++)c+=Q5(e,t[y]);let u=Math.ceil(c*1.5/8),f=[],h=[];function g(y,b,v,S,C){for(let w=v;w<S;){let A=w,E=b[w],D=Q5(e,y[w]);for(w++;w<S;w++){let O=Q5(e,y[w]);if(D+O>=u)break;D+=O}if(w==A+1){if(D>u){let O=y[A];g(O.children,O.positions,0,O.children.length,b[A]+C);continue}f.push(y[A])}else{let O=b[w-1]+y[w-1].length-E;f.push(OM(e,y,b,A,w,E,O,null,l))}h.push(E+C-o)}}return g(t,n,r,i,0),(a||l)(f,h,s)}class kh{constructor(t,n,r,i,o=!1,s=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new kh(0,t.length,t,0,!1,r)];for(let o of n)o.to>t.length&&i.push(o);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],o=1,s=t.length?t[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let h=s;if(l>=h.from||f<=h.to||c){let g=Math.max(h.from,l)-c,y=Math.min(h.to,f)-c;h=g>=y?null:new kh(g,y,h.tree,h.offset+c,a>0,!!u)}if(h&&i.push(h),s.to>f)break;s=o<t.length?t[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}let zee=class{startParse(t,n,r){return typeof t=="string"&&(t=new Rje(t)),r=r?r.length?r.map(i=>new OE(i.from,i.to)):[new OE(0,0)]:[new OE(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let o=i.advance();if(o)return o}}};class Rje{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new xn({perNode:!0});var VU={};class d6{constructor(t,n,r,i,o,s,a,l,c,u=0,f){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new d6(t,[],n,r,r,0,[],0,i?new WU(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=o.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(t&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=l?this.stack[l-1]:0,h=this.bufferBase+this.buffer.length-f;if(i<o.minRepeatTerm||t&131072){let g=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,g,h+4,!0)}if(t&262144)this.state=this.stack[l];else{let g=this.stack[l-3];this.state=o.getGoto(g,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(t,n,r,i=4,o=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(t,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let o=t,{parser:s}=this.p;this.pos=i;let a=s.stateFlag(o,1);!a&&(i>r||n<=s.maxNode)&&(this.reducePos=i),this.pushState(o,a?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new d6(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new Ije(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,t)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((a,l)=>l&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:t}=this.p,n=t.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!t.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||t.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),t.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&t.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=t.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(n)))}reduceContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(n)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let n=new WU(this.curContext.tracker,t);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class WU{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class Ije{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class f6{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new f6(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new f6(this.stack,this.pos,this.index)}}function T3(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let s=e.charCodeAt(r++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class e4{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const qU=new e4;class Pje{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=qU,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,o=this.pos+t;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let n of this.ranges)if(n.to>t)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+t,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(t,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=r}acceptTokenTo(t,n){this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),n=this.pos+t.length;this.chunk=n>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=qU,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,n){if(t>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class B0{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;jje(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}B0.prototype.contextual=B0.prototype.fallback=B0.prototype.extend=!1;B0.prototype.fallback=B0.prototype.extend=!1;function jje(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;(a&e[s])!=0;){let c=e[s+1];for(let g=s+3;g<c;g+=2)if((e[g+1]&a)>0){let y=e[g];if(l.allows(y)&&(t.token.value==-1||t.token.value==y||$je(y,t.token.value,i,o))){t.acceptToken(y);break}}let u=t.next,f=0,h=e[s+2];if(t.next<0&&h>f&&e[c+h*3-3]==65535){s=e[c+h*3-1];continue e}for(;f<h;){let g=f+h>>1,y=c+g+(g<<1),b=e[y],v=e[y+1]||65536;if(u<b)h=g;else if(u>=v)f=g+1;else{s=e[y+2],t.advance();continue e}}break}}function GU(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function $je(e,t,n,r){let i=GU(n,r,t);return i<0||GU(n,r,e)<i}const ws=typeof process<"u"&&VU&&/\bparse\b/.test(VU.LOG);let TE=null;function KU(e,t,n){let r=e.cursor(ai.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class Lje{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?KU(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?KU(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>t)return this.nextStart=s,null;if(o instanceof mi){if(s==t){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(xn.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class Nje{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new e4)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:o}=i,s=i.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if((1<<c&s)==0)continue;let u=o[c],f=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||f.start!=t.pos||f.mask!=s||f.context!=a)&&(this.updateCachedToken(f,u,t),f.mask=s,f.context=a),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!u.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return l&&t.setLookAhead(l),!r&&t.pos==this.stream.end&&(r=new e4,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new e4,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==t.value){let a=o.specializers[s](this.stream.read(t.start,t.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?t.value=a>>1:t.extended=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==t)return i;return this.actions[i++]=t,this.actions[i++]=n,this.actions[i++]=r,i}addActions(t,n,r,i){let{state:o}=t,{parser:s}=t.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(o,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=nu(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(nu(a,c+2),n,r,i));break}a[c]==n&&(i=this.putAction(nu(a,c+1),n,r,i))}return i}}class Fje{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Pje(n,i),this.tokens=new Nje(t,this.stream),this.topTerm=t.top[1];let{from:o}=i[0];this.stacks=[d6.start(this,t.top[0],o)],this.fragments=r.length&&this.stream.end-o>t.bufferLength*4?new Lje(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<t.length;s++){let a=t[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,t))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&zje(i);if(s)return ws&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw ws&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return ws&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&(r.sort((s,a)=>a.score-s.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,n,r){let i=t.pos,{parser:o}=this,s=ws?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let c=t.curContext&&t.curContext.tracker.strict,u=c?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(xn.contextHash)||0)==u))return t.useNode(f,h),ws&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof mi)||f.children.length==0||f.positions[0]>0)break;let g=f.children[0];if(g instanceof mi&&f.positions[0]==0)f=g;else break}}let a=o.stateSlot(t.state,4);if(a>0)return t.reduce(a),ws&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let c=0;c<l.length;){let u=l[c++],f=l[c++],h=l[c++],g=c==l.length||!r,y=g?t:t.split(),b=this.tokens.mainToken;if(y.apply(u,f,b?b.start:y.pos,h),ws&&console.log(s+this.stackID(y)+` (via ${(u&65536)==0?"shift":`reduce of ${o.getName(u&65535)}`} for ${o.getName(f)} @ ${i}${y==t?"":", split"})`),g)return!0;y.pos>i?n.push(y):r.push(y)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return YU(t,n),!0}}runRecovery(t,n,r){let i=null,o=!1;for(let s=0;s<t.length;s++){let a=t[s],l=n[s<<1],c=n[(s<<1)+1],u=ws?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),ws&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),h=u;for(let g=0;g<10&&f.forceReduce()&&(ws&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));g++)ws&&(h=this.stackID(f)+" -> ");for(let g of a.recoverByInsert(l))ws&&console.log(u+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),ws&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),YU(a,r)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(t){return t.close(),mi.build({buffer:f6.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let n=(TE||(TE=new WeakMap)).get(t);return n||TE.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function YU(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class Bje{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}class h6 extends zee{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<t.repeatNodeCount;a++)n.push("");let r=Object.keys(t.topRules).map(a=>t.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function o(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(t.nodeProps)for(let a of t.nodeProps){let l=a[0];typeof l=="string"&&(l=xn[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let h=-u;h>0;h--)o(a[c++],l,f);c++}}}this.nodeSet=new kM(n.map((a,l)=>ls.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(l)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=Lee;let s=T3(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(XU),this.states=T3(t.states,Uint32Array),this.data=T3(t.stateData),this.goto=T3(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(a=>typeof a=="number"?new B0(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new Fje(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o<c;o++)if(i[o]==t)return l;if(a)return-1}}hasAction(t,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(t,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=nu(r,o+2)];else{if(r[o+1]==2)return nu(r,o+2);break}if(s==n||s==0)return nu(r,o+1)}return 0}stateSlot(t,n){return this.states[t*6+n]}stateFlag(t,n){return(this.stateSlot(t,0)&n)>0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let o=this.stateSlot(t,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=nu(this.data,o+2);else break;i=n(nu(this.data,o+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=nu(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(h6.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(o=>o.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=t.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=XU(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let o of t.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new Bje(t,r,i)}static deserialize(t){return new h6(t)}}function nu(e,t){return e[t]|e[t+1]<<16}function zje(e){let t=null;for(let n of e){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function XU(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}let Hje=0;class oa{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=Hje++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof oa&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new oa(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(t){let n=new p6(t);return r=>r.modified.indexOf(n)>-1?r:p6.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Uje=0;class p6{constructor(t){this.name=t,this.instances=[],this.id=Uje++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(a=>a.base==t&&Vje(n,a.modified));if(r)return r;let i=[],o=new oa(t.name,i,t,n);for(let a of n)a.instances.push(o);let s=Wje(n);for(let a of t.set)if(!a.modified.length)for(let l of s)i.push(p6.get(a,l));return o}}function Vje(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function Wje(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function Hee(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let g=i[f++];if(f==i.length&&g=="!"){s=0;break}if(g!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new h2(r,s,l>0?o.slice(0,l):null);t[c]=u.sort(t[c])}}return Uee.add(t)}const Uee=new xn({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new h2(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});let h2=class{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}};h2.empty=new h2([],2,null);function Vee(e,t){let n=Object.create(null);for(let o of e)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=t||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function qje(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function Gje(e,t,n,r=0,i=e.length){let o=new Kje(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}class Kje{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,o){let{type:s,from:a,to:l}=t;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(g=>!g.scope||g.scope(s)));let c=i,u=Yje(t)||h2.empty,f=qje(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let h=t.tree&&t.tree.prop(xn.mounted);if(h&&h.overlay){let g=t.node.enter(h.overlay[0].from+a,1),y=this.highlighters.filter(v=>!v.scope||v.scope(h.tree.type)),b=t.firstChild();for(let v=0,S=a;;v++){let C=v<h.overlay.length?h.overlay[v]:null,w=C?C.from+a:l,A=Math.max(n,S),E=Math.min(r,w);if(A<E&&b)for(;t.from<E&&(this.highlightRange(t,A,E,i,o),this.startSpan(Math.min(E,t.to),c),!(t.to>=w||!t.nextSibling())););if(!C||w>r)break;S=C.to+a,S>n&&(this.highlightRange(g.cursor(),Math.max(n,C.from+a),Math.min(r,S),"",y),this.startSpan(Math.min(r,S),c))}b&&t.parent()}else if(t.firstChild()){h&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,o),this.startSpan(Math.min(r,t.to),c)}while(t.nextSibling());t.parent()}}}function Yje(e){let t=e.type.prop(Uee);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const ct=oa.define,M3=ct(),gd=ct(),ZU=ct(gd),JU=ct(gd),yd=ct(),R3=ct(yd),ME=ct(yd),kl=ct(),Xf=ct(kl),wl=ct(),Cl=ct(),m_=ct(),C1=ct(m_),I3=ct(),ae={comment:M3,lineComment:ct(M3),blockComment:ct(M3),docComment:ct(M3),name:gd,variableName:ct(gd),typeName:ZU,tagName:ct(ZU),propertyName:JU,attributeName:ct(JU),className:ct(gd),labelName:ct(gd),namespace:ct(gd),macroName:ct(gd),literal:yd,string:R3,docString:ct(R3),character:ct(R3),attributeValue:ct(R3),number:ME,integer:ct(ME),float:ct(ME),bool:ct(yd),regexp:ct(yd),escape:ct(yd),color:ct(yd),url:ct(yd),keyword:wl,self:ct(wl),null:ct(wl),atom:ct(wl),unit:ct(wl),modifier:ct(wl),operatorKeyword:ct(wl),controlKeyword:ct(wl),definitionKeyword:ct(wl),moduleKeyword:ct(wl),operator:Cl,derefOperator:ct(Cl),arithmeticOperator:ct(Cl),logicOperator:ct(Cl),bitwiseOperator:ct(Cl),compareOperator:ct(Cl),updateOperator:ct(Cl),definitionOperator:ct(Cl),typeOperator:ct(Cl),controlOperator:ct(Cl),punctuation:m_,separator:ct(m_),bracket:C1,angleBracket:ct(C1),squareBracket:ct(C1),paren:ct(C1),brace:ct(C1),content:kl,heading:Xf,heading1:ct(Xf),heading2:ct(Xf),heading3:ct(Xf),heading4:ct(Xf),heading5:ct(Xf),heading6:ct(Xf),contentSeparator:ct(kl),list:ct(kl),quote:ct(kl),emphasis:ct(kl),strong:ct(kl),link:ct(kl),monospace:ct(kl),strikethrough:ct(kl),inserted:ct(),deleted:ct(),changed:ct(),invalid:ct(),meta:I3,documentMeta:ct(I3),annotation:ct(I3),processingInstruction:ct(I3),definition:oa.defineModifier("definition"),constant:oa.defineModifier("constant"),function:oa.defineModifier("function"),standard:oa.defineModifier("standard"),local:oa.defineModifier("local"),special:oa.defineModifier("special")};for(let e in ae){let t=ae[e];t instanceof oa&&(t.name=e)}Vee([{tag:ae.link,class:"tok-link"},{tag:ae.heading,class:"tok-heading"},{tag:ae.emphasis,class:"tok-emphasis"},{tag:ae.strong,class:"tok-strong"},{tag:ae.keyword,class:"tok-keyword"},{tag:ae.atom,class:"tok-atom"},{tag:ae.bool,class:"tok-bool"},{tag:ae.url,class:"tok-url"},{tag:ae.labelName,class:"tok-labelName"},{tag:ae.inserted,class:"tok-inserted"},{tag:ae.deleted,class:"tok-deleted"},{tag:ae.literal,class:"tok-literal"},{tag:ae.string,class:"tok-string"},{tag:ae.number,class:"tok-number"},{tag:[ae.regexp,ae.escape,ae.special(ae.string)],class:"tok-string2"},{tag:ae.variableName,class:"tok-variableName"},{tag:ae.local(ae.variableName),class:"tok-variableName tok-local"},{tag:ae.definition(ae.variableName),class:"tok-variableName tok-definition"},{tag:ae.special(ae.variableName),class:"tok-variableName2"},{tag:ae.definition(ae.propertyName),class:"tok-propertyName tok-definition"},{tag:ae.typeName,class:"tok-typeName"},{tag:ae.namespace,class:"tok-namespace"},{tag:ae.className,class:"tok-className"},{tag:ae.macroName,class:"tok-macroName"},{tag:ae.propertyName,class:"tok-propertyName"},{tag:ae.operator,class:"tok-operator"},{tag:ae.comment,class:"tok-comment"},{tag:ae.meta,class:"tok-meta"},{tag:ae.invalid,class:"tok-invalid"},{tag:ae.punctuation,class:"tok-punctuation"}]);const Xje=Hee({String:ae.string,Number:ae.number,"True False":ae.bool,PropertyName:ae.propertyName,Null:ae.null,", :":ae.separator,"[ ]":ae.squareBracket,"{ }":ae.brace}),Zje=h6.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[Xje],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let g_=[],Wee=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?Wee:g_).push(n=n+e[t])})();function Jje(e){if(e<768)return!1;for(let t=0,n=g_.length;;){let r=t+n>>1;if(e<g_[r])n=r;else if(e>=Wee[r])t=r+1;else return!0;if(t==n)return!1}}function QU(e){return e>=127462&&e<=127487}const eV=8205;function Qje(e,t,n=!0,r=!0){return(n?qee:e$e)(e,t,r)}function qee(e,t,n){if(t==e.length)return t;t&&Gee(e.charCodeAt(t))&&Kee(e.charCodeAt(t-1))&&t--;let r=RE(e,t);for(t+=tV(r);t<e.length;){let i=RE(e,t);if(r==eV||i==eV||n&&Jje(i))t+=tV(i),r=i;else if(QU(i)){let o=0,s=t-2;for(;s>=0&&QU(RE(e,s));)o++,s-=2;if(o%2==0)break;t+=2}else break}return t}function e$e(e,t,n){for(;t>0;){let r=qee(e,t-2,n);if(r<t)return r;t--}return 0}function RE(e,t){let n=e.charCodeAt(t);if(!Kee(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Gee(r)?(n-55296<<10)+(r-56320)+65536:n}function Gee(e){return e>=56320&&e<57344}function Kee(e){return e>=55296&&e<56320}function tV(e){return e<65536?1:2}class Vn{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=ym(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Nl.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=ym(this,t,n);let r=[];return this.decompose(t,n,r,0),Nl.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new by(this),o=new by(t);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(t=1){return new by(this,t)}iterRange(t,n=this.length){return new Yee(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Xee(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Vn.empty:t.length<=32?new fi(t):Nl.from(fi.split(t,[]))}}class fi extends Vn{constructor(t,n=t$e(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=t)return new n$e(i,a,r,s);i=a+1,r++}}decompose(t,n,r,i){let o=t<=0&&n>=this.length?this:new fi(nV(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let s=r.pop(),a=t4(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new fi(a,s.length+o.length));else{let l=a.length>>1;r.push(new fi(a.slice(0,l)),new fi(a.slice(l)))}}else r.push(o)}replace(t,n,r){if(!(r instanceof fi))return super.replace(t,n,r);[t,n]=ym(this,t,n);let i=t4(this.text,t4(r.text,nV(this.text,0,t)),n),o=this.length+r.length-(n-t);return i.length<=32?new fi(i,o):Nl.from(fi.split(i,[]),o)}sliceString(t,n=this.length,r=`
255
255
  `){[t,n]=ym(this,t,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>t&&s&&(i+=r),t<l&&n>o&&(i+=a.slice(Math.max(0,t-o),n-o)),o=l+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let o of t)r.push(o),i+=o.length+1,r.length==32&&(n.push(new fi(r,i)),r=[],i=-1);return i>-1&&n.push(new fi(r,i)),n}}class Nl extends Vn{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=t)return s.lineInner(t,n,r,i);i=a+1,r=l+1}}decompose(t,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(t<=l&&n>=s){let c=i&((s<=t?1:0)|(l>=n?2:0));s>=t&&l<=n&&!c?r.push(a):a.decompose(t-s,n-s,r,c)}s=l+1}}replace(t,n,r){if([t,n]=ym(this,t,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(t>=o&&n<=a){let l=s.replace(t-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Nl(u,this.length-(n-t)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=`
256
256
  `){[t,n]=ym(this,t,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let a=this.children[o],l=s+a.length;s>t&&o&&(i+=r),t<l&&n>s&&(i+=a.sliceString(t-s,n-s,r)),s=l+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Nl))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=t.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let g of t)r+=g.lines;if(r<32){let g=[];for(let y of t)y.flatten(g);return new fi(g,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(g){let y;if(g.lines>o&&g instanceof Nl)for(let b of g.children)f(b);else g.lines>s&&(l>s||!l)?(h(),a.push(g)):g instanceof fi&&l&&(y=u[u.length-1])instanceof fi&&g.lines+y.lines<=32?(l+=g.lines,c+=g.length+1,u[u.length-1]=new fi(y.text.concat(g.text),y.length+1+g.length)):(l+g.lines>i&&h(),l+=g.lines,c+=g.length+1,u.push(g))}function h(){l!=0&&(a.push(u.length==1?u[0]:Nl.from(u,c)),c=-1,l=u.length=0)}for(let g of t)f(g);return h(),a.length==1?a[0]:new Nl(a,n)}}Vn.empty=new fi([""],0);function t$e(e){let t=-1;for(let n of e)t+=n.length+1;return t}function t4(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o<e.length&&i<=r;o++){let a=e[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(t[t.length-1]+=a,s=!1):t.push(a)),i=l+1}return t}function nV(e,t,n){return t4(e,[""],t,n)}class by{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof fi?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof fi?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=`
257
257
  `,this;t--}else if(i instanceof fi){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=i.children[s+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof fi?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Yee{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new by(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Xee{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Vn.prototype[Symbol.iterator]=function(){return this.iter()},by.prototype[Symbol.iterator]=Yee.prototype[Symbol.iterator]=Xee.prototype[Symbol.iterator]=function(){return this});class n$e{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function ym(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Qi(e,t,n=!0,r=!0){return Qje(e,t,n,r)}function r$e(e){return e>=56320&&e<57344}function i$e(e){return e>=55296&&e<56320}function Qo(e,t){let n=e.charCodeAt(t);if(!i$e(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return r$e(r)?(n-55296<<10)+(r-56320)+65536:n}function TM(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Fl(e){return e<65536?1:2}const y_=/\r\n?|\n/;var yo=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(yo||(yo={}));class ac{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];t+=r<0?this.sections[n]:r}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(t(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(t,n=!1){b_(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new ac(t)}composeDesc(t){return this.empty?t:t.empty?this:Zee(this,t)}mapDesc(t,n=!1){return t.empty?this:v_(this,t,n)}mapPos(t,n=-1,r=yo.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=i+a;if(l<0){if(c>t)return o+(t-i);o+=a}else{if(r!=yo.Simple&&c>=t&&(r==yo.TrackDel&&i<t&&c>t||r==yo.TrackBefore&&i<t||r==yo.TrackAfter&&c>t))return null;if(c>t||c==t&&n<0&&!a)return t==i||n<0?o:o+l;o+=l}i=c}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return o}touchesRange(t,n=t){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],a=i+o;if(s>=0&&i<=n&&a>=t)return i<t&&a>n?"cover":!0;i=a}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];t+=(t?" ":"")+r+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ac(t)}static create(t){return new ac(t)}}class $i extends ac{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return b_(this,(n,r,i,o,s)=>t=t.replace(i,i+(r-n),s),!1),t}mapDesc(t,n=!1){return v_(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length<l;)r.push(Vn.empty);r.push(s?t.slice(o,o+s):Vn.empty)}o+=s}return new $i(n,r)}compose(t){return this.empty?t:t.empty?this:Zee(this,t,!0)}map(t,n=!1){return t.empty?this:v_(this,t,n,!0)}iterChanges(t,n=!1){b_(this,t,n)}get desc(){return ac.create(this.sections)}filter(t){let n=[],r=[],i=[],o=new p2(this);e:for(let s=0,a=0;;){let l=s==t.length?1e9:t[s++];for(;a<l||a==l&&o.len==0;){if(o.done)break e;let u=Math.min(o.len,l-a);Ao(i,u,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;Ao(n,u,f),f>0&&Id(r,n,o.text),o.forward(u),a+=u}let c=t[s++];for(;a<c;){if(o.done)break e;let u=Math.min(o.len,c-a);Ao(n,u,-1),Ao(i,u,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(u),a+=u}}return{changes:new $i(n,r),filtered:ac.create(i)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?t.push(r):i==0?t.push([r]):t.push([r].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;s<n&&Ao(i,n-s,-1);let f=new $i(i,o);a=a?a.compose(f.map(a)):f,i=[],o=[],s=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof $i){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:f,to:h=f,insert:g}=u;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let y=g?typeof g=="string"?Vn.of(g.split(r||y_)):g:Vn.empty,b=y.length;if(f==h&&b==0)return;f<s&&l(),f>s&&Ao(i,f-s,-1),Ao(i,h-f,b),Id(o,i,y),s=h}}return c(t),l(!a),a}static empty(t){return new $i(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<t.length;i++){let o=t[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(Vn.empty);r[i]=Vn.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new $i(n,r)}static createSet(t,n){return new $i(t,n)}}function Ao(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Id(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Vn.empty);e.push(n)}}function b_(e,t,n){let r=e.inserted;for(let i=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)i+=a,o+=a;else{let c=i,u=o,f=Vn.empty;for(;c+=a,u+=l,l&&r&&(f=f.append(r[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,c,o,u,f),i=c,o=u}}}function v_(e,t,n,r=!1){let i=[],o=r?[]:null,s=new p2(e),a=new p2(t);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Ao(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(Ao(i,a.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=u&&(Ao(i,0,s.ins),o&&Id(o,i,s.text),l=s.i),s.forward(u),c-=u}a.next()}else if(s.ins>=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;Ao(i,c,l<s.i?s.ins:0),o&&l<s.i&&Id(o,i,s.text),l=s.i,s.forward(s.len-u)}else{if(s.done&&a.done)return o?$i.createSet(i,o):ac.create(i);throw new Error("Mismatched change set lengths")}}}function Zee(e,t,n=!1){let r=[],i=n?[]:null,o=new p2(e),s=new p2(t);for(let a=!1;;){if(o.done&&s.done)return i?$i.createSet(r,i):ac.create(r);if(o.ins==0)Ao(r,o.len,0,a),o.next();else if(s.len==0&&!s.done)Ao(r,0,s.ins,a),i&&Id(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,s.len),c=r.length;if(o.ins==-1){let u=s.ins==-1?-1:s.off?0:s.ins;Ao(r,l,u,a),i&&u&&Id(i,r,s.text)}else s.ins==-1?(Ao(r,o.off?0:o.len,l,a),i&&Id(i,r,o.textBit(l))):(Ao(r,o.off?0:o.len,s.off?0:s.ins,a),i&&!s.off&&Id(i,r,s.text));a=(o.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class p2{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length?Vn.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Vn.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ph{constructor(t,n,r){this.from=t,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new ph(r,i,this.flags)}extend(t,n=t){if(t<=this.anchor&&n>=this.anchor)return $e.range(t,n);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return $e.range(this.anchor,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return $e.range(t.anchor,t.head)}static create(t,n,r){return new ph(t,n,r)}}class $e{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:$e.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(t.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new $e([this.main],0)}addRange(t,n=!0){return $e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,$e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new $e(t.ranges.map(n=>ph.fromJSON(n)),t.main)}static single(t,n=t){return new $e([$e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<t.length;i++){let o=t[i];if(o.empty?o.from<=r:o.from<r)return $e.normalized(t.slice(),n);r=o.to}return new $e(t,n)}static cursor(t,n=0,r,i){return ph.create(t,t,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(t,n,r,i){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<t?ph.create(n,t,48|o):ph.create(t,n,(n>t?8:0)|o)}static normalized(t,n=0){let r=t[n];t.sort((i,o)=>i.from-o.from),n=t.indexOf(r);for(let i=1;i<t.length;i++){let o=t[i],s=t[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let a=s.from,l=Math.max(o.to,s.to);i<=n&&n--,t.splice(--i,2,o.anchor>o.head?$e.range(l,a):$e.range(a,l))}}return new $e(t,n)}}function Jee(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let MM=0;class bt{constructor(t,n,r,i,o){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=MM++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(t={}){return new bt(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:RM),!!t.static,t.enables)}of(t){return new n4([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new n4(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new n4(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function RM(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class n4{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=MM++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=t[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:(((n=t[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(t[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,h){if(l&&h.docChanged||c&&(h.docChanged||h.selection)||x_(f,u)){let g=r(f);if(a?!rV(g,f.values[s],i):!i(g,f.values[s]))return f.values[s]=g,1}return 0},reconfigure:(f,h)=>{let g,y=h.config.address[o];if(y!=null){let b=g6(h,y);if(this.dependencies.every(v=>v instanceof bt?h.facet(v)===f.facet(v):v instanceof Bi?h.field(v,!1)==f.field(v,!1):!0)||(a?rV(g=r(f),b,i):i(g=r(f),b)))return f.values[s]=b,0}else g=r(f);return f.values[s]=g,1}}}}function rV(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function x_(e,t){let n=!1;for(let r of t)vy(e,r)&1&&(n=!0);return n}function o$e(e,t,n){let r=n.map(l=>e[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=e[t.id]>>1;function a(l){let c=[];for(let u=0;u<r.length;u++){let f=g6(l,r[u]);if(i[u]==2)for(let h of f)c.push(h);else c.push(f)}return t.combine(c)}return{create(l){for(let c of r)vy(l,c);return l.values[s]=a(l),1},update(l,c){if(!x_(l,o))return 0;let u=a(l);return t.compare(u,l.values[s])?0:(l.values[s]=u,1)},reconfigure(l,c){let u=x_(l,r),f=c.config.facets[t.id],h=c.facet(t);if(f&&!u&&RM(n,f))return l.values[s]=h,0;let g=a(l);return t.compare(g,h)?(l.values[s]=h,0):(l.values[s]=g,1)}}}const P3=bt.define({static:!0});class Bi{constructor(t,n,r,i,o){this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(t){let n=new Bi(MM++,t.create,t.update,t.compare||((r,i)=>r===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(P3).find(r=>r.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let o=r.facet(P3),s=i.facet(P3),a;return(a=o.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,P3.of({field:this,create:t})]}get extension(){return this}}const lh={lowest:4,low:3,default:2,high:1,highest:0};function E1(e){return t=>new Qee(t,e)}const wf={highest:E1(lh.highest),high:E1(lh.high),default:E1(lh.default),low:E1(lh.low),lowest:E1(lh.lowest)};class Qee{constructor(t,n){this.inner=t,this.prec=n}}class Yw{of(t){return new S_(this,t)}reconfigure(t){return Yw.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class S_{constructor(t,n){this.compartment=t,this.inner=n}}class m6{constructor(t,n,r,i,o,s){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,r){let i=[],o=Object.create(null),s=new Map;for(let h of s$e(t,n,s))h instanceof Bi?i.push(h):(o[h.facet.id]||(o[h.facet.id]=[])).push(h);let a=Object.create(null),l=[],c=[];for(let h of i)a[h.id]=c.length<<1,c.push(g=>h.slot(g));let u=r?.config.facets;for(let h in o){let g=o[h],y=g[0].facet,b=u&&u[h]||[];if(g.every(v=>v.type==0))if(a[y.id]=l.length<<1|1,RM(b,g))l.push(r.facet(y));else{let v=y.combine(g.map(S=>S.value));l.push(r&&y.compare(v,r.facet(y))?r.facet(y):v)}else{for(let v of g)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(S=>v.dynamicSlot(S)));a[y.id]=c.length<<1,c.push(v=>o$e(v,y,g))}}let f=c.map(h=>h(a));return new m6(t,s,f,a,l,o)}}function s$e(e,t,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof S_&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof S_){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof Qee)o(s.inner,s.prec);else if(s instanceof Bi)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof n4)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,lh.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(e,lh.default),r.reduce((s,a)=>s.concat(a))}function vy(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function g6(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const ete=bt.define(),w_=bt.define({combine:e=>e.some(t=>t),static:!0}),tte=bt.define({combine:e=>e.length?e[0]:void 0,static:!0}),nte=bt.define(),rte=bt.define(),ite=bt.define(),ote=bt.define({combine:e=>e.length?e[0]:!1});class xc{constructor(t,n){this.type=t,this.value=n}static define(){return new a$e}}class a$e{of(t){return new xc(this,t)}}class l$e{constructor(t){this.map=t}of(t){return new Ut(this,t)}}class Ut{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Ut(this.type,n)}is(t){return this.type==t}static define(t={}){return new l$e(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let o=i.map(n);o&&r.push(o)}return r}}Ut.reconfigure=Ut.define();Ut.appendConfig=Ut.define();class ki{constructor(t,n,r,i,o,s){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&Jee(r,n.newLength),o.some(a=>a.type==ki.time)||(this.annotations=o.concat(ki.time.of(Date.now())))}static create(t,n,r,i,o,s){return new ki(t,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(ki.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}ki.time=xc.define();ki.userEvent=xc.define();ki.addToHistory=xc.define();ki.remote=xc.define();function c$e(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],s=e[r++];else if(i<t.length)o=t[i++],s=t[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function ste(e,t,n){var r;let i,o,s;return n?(i=t.changes,o=$i.empty(t.changes.length),s=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(i)),{changes:s,selection:t.selection?t.selection.map(o):(r=e.selection)===null||r===void 0?void 0:r.map(i),effects:Ut.mapEffects(e.effects,i).concat(Ut.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function C_(e,t,n){let r=t.selection,i=z0(t.annotations);return t.userEvent&&(i=i.concat(ki.userEvent.of(t.userEvent))),{changes:t.changes instanceof $i?t.changes:$i.of(t.changes||[],n,e.facet(tte)),selection:r&&(r instanceof $e?r:$e.single(r.anchor,r.head)),effects:z0(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function ate(e,t,n){let r=C_(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let o=1;o<t.length;o++){t[o].filter===!1&&(n=!1);let s=!!t[o].sequential;r=ste(r,C_(e,t[o],s?r.changes.newLength:e.doc.length),s)}let i=ki.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return d$e(n?u$e(i):i)}function u$e(e){let t=e.startState,n=!0;for(let i of t.facet(nte)){let o=i(e);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:c$e(n,o))}if(n!==!0){let i,o;if(n===!1)o=e.changes.invertedDesc,i=$i.empty(t.doc.length);else{let s=e.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}e=ki.create(t,i,e.selection&&e.selection.map(o),Ut.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(rte);for(let i=r.length-1;i>=0;i--){let o=r[i](e);o instanceof ki?e=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ki?e=o[0]:e=ate(t,z0(o),!1)}return e}function d$e(e){let t=e.startState,n=t.facet(ite),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=ste(r,C_(t,o,e.changes.newLength),!0))}return r==e?e:ki.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const f$e=[];function z0(e){return e==null?f$e:Array.isArray(e)?e:[e]}var Hr=(function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e})(Hr||(Hr={}));const h$e=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let E_;try{E_=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function p$e(e){if(E_)return E_.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||h$e.test(n)))return!0}return!1}function m$e(e){return t=>{if(!/\S/.test(t))return Hr.Space;if(p$e(t))return Hr.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return Hr.Word;return Hr.Other}}class Nn{constructor(t,n,r,i,o,s){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)vy(this,a<<1);this.computeSlot=null}field(t,n=!0){let r=this.config.address[t.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return vy(this,r),g6(this,r)}update(...t){return ate(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let a of t.effects)a.is(Yw.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(Ut.reconfigure)?(n=null,r=a.value):a.is(Ut.appendConfig)&&(n=null,r=z0(r).concat(a.value));let o;n?o=t.startState.values.slice():(n=m6.resolve(r,i,this),o=new Nn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=t.startState.facet(w_)?t.newSelection:t.newSelection.asSingle();new Nn(n,t.newDoc,s,o,(a,l)=>l.update(a,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:$e.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=z0(r.effects);for(let a=1;a<n.ranges.length;a++){let l=t(n.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let h=0;h<a;h++)o[h]=o[h].map(u);let f=i.mapDesc(c,!0);o.push(l.range.map(f)),i=i.compose(u),s=Ut.mapEffects(s,u).concat(Ut.mapEffects(z0(l.effects),f))}return{changes:i,selection:$e.create(o,n.mainIndex),effects:s}}changes(t=[]){return t instanceof $i?t:$i.of(t,this.doc.length,this.facet(Nn.lineSeparator))}toText(t){return Vn.of(t.split(this.facet(Nn.lineSeparator)||y_))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(vy(this,n),g6(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let r in t){let i=t[r];i instanceof Bi&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}static fromJSON(t,n={},r){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(t,o)){let s=r[o],a=t[o];i.push(s.init(l=>s.spec.fromJSON(a,l)))}}return Nn.create({doc:t.doc,selection:$e.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=m6.resolve(t.extensions||[],new Map),r=t.doc instanceof Vn?t.doc:Vn.of((t.doc||"").split(n.staticFacet(Nn.lineSeparator)||y_)),i=t.selection?t.selection instanceof $e?t.selection:$e.single(t.selection.anchor,t.selection.head):$e.single(0);return Jee(i,r.length),n.staticFacet(w_)||(i=i.asSingle()),new Nn(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Nn.tabSize)}get lineBreak(){return this.facet(Nn.lineSeparator)||`
@@ -496,4 +496,4 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
496
496
  To pick up a draggable item, press the space bar.
497
497
  While dragging, use the arrow keys to move the item.
498
498
  Press space again to drop the item in its new position, or press escape to cancel.
499
- `},Gat={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Kat(e){let{announcements:t=Gat,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=qat}=e;const{announce:o,announcement:s}=Uat(),a=av("DndLiveRegion"),[l,c]=_.useState(!1);if(_.useEffect(()=>{c(!0)},[]),Vat(_.useMemo(()=>({onDragStart(f){let{active:h}=f;o(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&o(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;o(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;o(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;o(t.onDragCancel({active:h,over:g}))}}),[o,t])),!l)return null;const u=qt.createElement(qt.Fragment,null,qt.createElement(zat,{id:r,value:i.draggable}),qt.createElement(Hat,{id:a,announcement:s}));return n?Dd.createPortal(u,n):u}var Li;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Li||(Li={}));function CS(){}function kK(e,t){return _.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Yat(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const sl=Object.freeze({x:0,y:0});function Cle(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ele(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Xat(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function _K(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Ale(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function DK(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Zat=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=DK(t,t.left,t.top),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=Cle(DK(l),i);o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(Ele)},Jat=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=_K(t),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=_K(l),u=i.reduce((h,g,y)=>h+Cle(c[y],g),0),f=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:f}})}}return o.sort(Ele)};function Qat(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,c=e.width*e.height,u=s*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const elt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:s}=o,a=n.get(s);if(a){const l=Qat(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Xat)};function tlt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function kle(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:sl}function nlt(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const rlt=nlt(1);function ilt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function olt(e,t,n){const r=ilt(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const slt={ignoreTransform:!1};function pg(e,t){t===void 0&&(t=slt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=fs(e).getComputedStyle(e);c&&(n=olt(n,c,u))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function OK(e){return pg(e,{ignoreTransform:!0})}function alt(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function llt(e,t){return t===void 0&&(t=fs(e).getComputedStyle(e)),t.position==="fixed"}function clt(e,t){t===void 0&&(t=fs(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function qC(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(xI(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!ov(i)||xle(i)||n.includes(i))return n;const o=fs(e).getComputedStyle(i);return i!==e&&clt(i,o)&&n.push(i),llt(i,o)?n:r(i.parentNode)}return e?r(e):n}function _le(e){const[t]=qC(e,1);return t??null}function XA(e){return!WC||!e?null:fg(e)?e:vI(e)?xI(e)||e===hg(e).scrollingElement?window:ov(e)?e:null:null}function Dle(e){return fg(e)?e.scrollX:e.scrollLeft}function Ole(e){return fg(e)?e.scrollY:e.scrollTop}function XD(e){return{x:Dle(e),y:Ole(e)}}var Xi;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Xi||(Xi={}));function Tle(e){return!WC||!e?!1:e===document.scrollingElement}function Mle(e){const t={x:0,y:0},n=Tle(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const ult={x:.2,y:.2};function dlt(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=ult);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=Mle(e),g={x:0,y:0},y={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+b.height?(g.y=Xi.Backward,y.y=r*Math.abs((t.top+b.height-o)/b.height)):!u&&l>=t.bottom-b.height&&(g.y=Xi.Forward,y.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!h&&a>=t.right-b.width?(g.x=Xi.Forward,y.x=r*Math.abs((t.right-b.width-a)/b.width)):!f&&s<=t.left+b.width&&(g.x=Xi.Backward,y.x=r*Math.abs((t.left+b.width-s)/b.width)),{direction:g,speed:y}}function flt(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Rle(e){return e.reduce((t,n)=>nm(t,XD(n)),sl)}function hlt(e){return e.reduce((t,n)=>t+Dle(n),0)}function plt(e){return e.reduce((t,n)=>t+Ole(n),0)}function mlt(e,t){if(t===void 0&&(t=pg),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);_le(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const glt=[["x",["left","right"],hlt],["y",["top","bottom"],plt]];class CI{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=qC(n),i=Rle(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of glt)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[o]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Iy{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function ylt(e){const{EventTarget:t}=fs(e);return e instanceof t?e:hg(e)}function ZA(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var na;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(na||(na={}));function TK(e){e.preventDefault()}function blt(e){e.stopPropagation()}var Ln;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ln||(Ln={}));const Ile={start:[Ln.Space,Ln.Enter],cancel:[Ln.Esc],end:[Ln.Space,Ln.Enter,Ln.Tab]},vlt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ln.Right:return{...n,x:n.x+25};case Ln.Left:return{...n,x:n.x-25};case Ln.Down:return{...n,y:n.y+25};case Ln.Up:return{...n,y:n.y-25}}};class EI{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Iy(hg(n)),this.windowListeners=new Iy(fs(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(na.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&mlt(r),n(sl)}handleKeyDown(t){if(wI(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Ile,coordinateGetter:s=vlt,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:sl;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=nb(f,u),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(const b of y){const v=t.code,{isTop:S,isRight:C,isLeft:w,isBottom:A,maxScroll:E,minScroll:D}=Mle(b),O=flt(b),T={x:Math.min(v===Ln.Right?O.right-O.width/2:O.right,Math.max(v===Ln.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(v===Ln.Down?O.bottom-O.height/2:O.bottom,Math.max(v===Ln.Down?O.top:O.top+O.height/2,f.y))},I=v===Ln.Right&&!C||v===Ln.Left&&!w,N=v===Ln.Down&&!A||v===Ln.Up&&!S;if(I&&T.x!==f.x){const $=b.scrollLeft+h.x,R=v===Ln.Right&&$<=E.x||v===Ln.Left&&$>=D.x;if(R&&!h.y){b.scrollTo({left:$,behavior:a});return}R?g.x=b.scrollLeft-$:g.x=v===Ln.Right?b.scrollLeft-E.x:b.scrollLeft-D.x,g.x&&b.scrollBy({left:-g.x,behavior:a});break}else if(N&&T.y!==f.y){const $=b.scrollTop+h.y,R=v===Ln.Down&&$<=E.y||v===Ln.Up&&$>=D.y;if(R&&!h.x){b.scrollTo({top:$,behavior:a});return}R?g.y=b.scrollTop-$:g.y=v===Ln.Down?b.scrollTop-E.y:b.scrollTop-D.y,g.y&&b.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,nm(nb(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}EI.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Ile,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function MK(e){return!!(e&&"distance"in e)}function RK(e){return!!(e&&"delay"in e)}class AI{constructor(t,n,r){var i;r===void 0&&(r=ylt(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:s}=o;this.props=t,this.events=n,this.document=hg(s),this.documentListeners=new Iy(this.document),this.listeners=new Iy(r),this.windowListeners=new Iy(fs(s)),this.initialCoordinates=(i=YD(o))!=null?i:sl,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.DragStart,TK),this.windowListeners.add(na.VisibilityChange,this.handleCancel),this.windowListeners.add(na.ContextMenu,TK),this.documentListeners.add(na.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(RK(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(MK(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(na.Click,blt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(na.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(n=YD(t))!=null?n:sl,c=nb(i,l);if(!r&&a){if(MK(a)){if(a.tolerance!=null&&ZA(c,a.tolerance))return this.handleCancel();if(ZA(c,a.distance))return this.handleStart()}if(RK(a)&&ZA(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ln.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xlt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class kI extends AI{constructor(t){const{event:n}=t,r=hg(n.target);super(t,xlt,r)}}kI.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Slt={move:{name:"mousemove"},end:{name:"mouseup"}};var ZD;(function(e){e[e.RightClick=2]="RightClick"})(ZD||(ZD={}));class wlt extends AI{constructor(t){super(t,Slt,hg(t.event.target))}}wlt.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===ZD.RightClick?!1:(r?.({event:n}),!0)}}];const JA={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Clt extends AI{constructor(t){super(t,JA)}static setup(){return window.addEventListener(JA.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(JA.move.name,t)};function t(){}}}Clt.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Py;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Py||(Py={}));var ES;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ES||(ES={}));function Elt(e){let{acceleration:t,activator:n=Py.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=ES.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const g=klt({delta:f,disabled:!o}),[y,b]=$at(),v=_.useRef({x:0,y:0}),S=_.useRef({x:0,y:0}),C=_.useMemo(()=>{switch(n){case Py.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Py.DraggableRect:return i}},[n,i,l]),w=_.useRef(null),A=_.useCallback(()=>{const D=w.current;if(!D)return;const O=v.current.x*S.current.x,T=v.current.y*S.current.y;D.scrollBy(O,T)},[]),E=_.useMemo(()=>a===ES.TreeOrder?[...c].reverse():c,[a,c]);_.useEffect(()=>{if(!o||!c.length||!C){b();return}for(const D of E){if(r?.(D)===!1)continue;const O=c.indexOf(D),T=u[O];if(!T)continue;const{direction:I,speed:N}=dlt(D,T,C,t,h);for(const $ of["x","y"])g[$][I[$]]||(N[$]=0,I[$]=0);if(N.x>0||N.y>0){b(),w.current=D,y(A,s),v.current=N,S.current=I;return}}v.current={x:0,y:0},S.current={x:0,y:0},b()},[t,A,r,b,o,s,JSON.stringify(C),JSON.stringify(g),y,c,E,u,JSON.stringify(h)])}const Alt={x:{[Xi.Backward]:!1,[Xi.Forward]:!1},y:{[Xi.Backward]:!1,[Xi.Forward]:!1}};function klt(e){let{delta:t,disabled:n}=e;const r=KD(t);return sv(i=>{if(n||!r||!i)return Alt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Xi.Backward]:i.x[Xi.Backward]||o.x===-1,[Xi.Forward]:i.x[Xi.Forward]||o.x===1},y:{[Xi.Backward]:i.y[Xi.Backward]||o.y===-1,[Xi.Forward]:i.y[Xi.Forward]||o.y===1}}},[n,t,r])}function _lt(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return sv(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function Dlt(e,t){return _.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...o]},[]),[e,t])}var ib;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ib||(ib={}));var JD;(function(e){e.Optimized="optimized"})(JD||(JD={}));const IK=new Map;function Olt(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=_.useState(null),{frequency:a,measure:l,strategy:c}=i,u=_.useRef(e),f=v(),h=tb(f),g=_.useCallback(function(S){S===void 0&&(S=[]),!h.current&&s(C=>C===null?S:C.concat(S.filter(w=>!C.includes(w))))},[h]),y=_.useRef(null),b=sv(S=>{if(f&&!n)return IK;if(!S||S===IK||u.current!==e||o!=null){const C=new Map;for(let w of e){if(!w)continue;if(o&&o.length>0&&!o.includes(w.id)&&w.rect.current){C.set(w.id,w.rect.current);continue}const A=w.node.current,E=A?new CI(l(A),A):null;w.rect.current=E,E&&C.set(w.id,E)}return C}return S},[e,o,n,f,l]);return _.useEffect(()=>{u.current=e},[e]),_.useEffect(()=>{f||g()},[n,f]),_.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),_.useEffect(()=>{f||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},a))},[a,f,g,...r]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:o!=null};function v(){switch(c){case ib.Always:return!1;case ib.BeforeDragging:return n;default:return!n}}}function Ple(e,t){return sv(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Tlt(e,t){return Ple(e,t)}function Mlt(e){let{callback:t,disabled:n}=e;const r=SI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function GC(e){let{callback:t,disabled:n}=e;const r=SI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function Rlt(e){return new CI(pg(e),e)}function PK(e,t,n){t===void 0&&(t=Rlt);const[r,i]=_.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=Mlt({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=GC({callback:o});return yc(()=>{o(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function Ilt(e){const t=Ple(e);return kle(e,t)}const jK=[];function Plt(e){const t=_.useRef(e),n=sv(r=>e?r&&r!==jK&&e&&t.current&&e.parentNode===t.current.parentNode?r:qC(e):jK,[e]);return _.useEffect(()=>{t.current=e},[e]),n}function jlt(e){const[t,n]=_.useState(null),r=_.useRef(e),i=_.useCallback(o=>{const s=XA(o.target);s&&n(a=>a?(a.set(s,XD(s)),new Map(a)):null)},[]);return _.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=XA(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,XD(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const c=XA(l);c?.removeEventListener("scroll",i)})}},[i,e]),_.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>nm(o,s),sl):Rle(e):sl,[e,t])}function $K(e,t){t===void 0&&(t=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},t),_.useEffect(()=>{const r=e!==sl;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?nb(e,n.current):sl}function $lt(e){_.useEffect(()=>{if(!WC)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Llt(e,t){return _.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function jle(e){return _.useMemo(()=>e?alt(e):null,[e])}const LK=[];function Nlt(e,t){t===void 0&&(t=pg);const[n]=e,r=jle(n?fs(n):null),[i,o]=_.useState(LK);function s(){o(()=>e.length?e.map(l=>Tle(l)?r:new CI(t(l),l)):LK)}const a=GC({callback:s});return yc(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),i}function Flt(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ov(t)?t:e}function Blt(e){let{measure:t}=e;const[n,r]=_.useState(null),i=_.useCallback(c=>{for(const{target:u}of c)if(ov(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),o=GC({callback:i}),s=_.useCallback(c=>{const u=Flt(c);o?.disconnect(),u&&o?.observe(u),r(u?t(u):null)},[t,o]),[a,l]=wS(s);return _.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const zlt=[{sensor:kI,options:{}},{sensor:EI,options:{}}],Hlt={current:{}},k4={draggable:{measure:OK},droppable:{measure:OK,strategy:ib.WhileDragging,frequency:JD.Optimized},dragOverlay:{measure:pg}};class jy extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Ult={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jy,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:CS},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:k4,measureDroppableContainers:CS,windowRect:null,measuringScheduled:!1},Vlt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:CS,draggableNodes:new Map,over:null,measureDroppableContainers:CS},KC=_.createContext(Vlt),$le=_.createContext(Ult);function Wlt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jy}}}function qlt(e,t){switch(t.type){case Li.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Li.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Li.DragEnd:case Li.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Li.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new jy(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Li.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new jy(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Li.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new jy(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Glt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=_.useContext(KC),o=KD(r),s=KD(n?.id);return _.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!wI(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=Fat(u);if(f){f.focus();break}}})}},[r,t,i,s,o]),null}function Klt(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function Ylt(e){return _.useMemo(()=>({draggable:{...k4.draggable,...e?.draggable},droppable:{...k4.droppable,...e?.droppable},dragOverlay:{...k4.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Xlt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=_.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;yc(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=kle(u,r);if(s||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=_le(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const Lle=_.createContext({...sl,scaleX:1,scaleY:1});var xd;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(xd||(xd={}));const Zlt=_.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=zlt,collisionDetection:f=elt,measuring:h,modifiers:g,...y}=t;const b=_.useReducer(qlt,void 0,Wlt),[v,S]=b,[C,w]=Wat(),[A,E]=_.useState(xd.Uninitialized),D=A===xd.Initialized,{draggable:{active:O,nodes:T,translate:I},droppable:{containers:N}}=v,$=O!=null?T.get(O):null,R=_.useRef({initial:null,translated:null}),F=_.useMemo(()=>{var Dt;return O!=null?{id:O,data:(Dt=$?.data)!=null?Dt:Hlt,rect:R}:null},[O,$]),j=_.useRef(null),[z,L]=_.useState(null),[q,V]=_.useState(null),U=tb(y,Object.values(y)),K=av("DndDescribedBy",s),B=_.useMemo(()=>N.getEnabled(),[N]),W=Ylt(h),{droppableRects:X,measureDroppableContainers:H,measuringScheduled:Y}=Olt(B,{dragging:D,dependencies:[I.x,I.y],config:W.droppable}),J=_lt(T,O),ne=_.useMemo(()=>q?YD(q):null,[q]),ee=yr(),se=Tlt(J,W.draggable.measure);Xlt({activeNode:O!=null?T.get(O):null,config:ee.layoutShiftCompensation,initialRect:se,measure:W.draggable.measure});const ue=PK(J,W.draggable.measure,se),te=PK(J?J.parentElement:null),Z=_.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=N.getNodeFor((n=Z.current.over)==null?void 0:n.id),oe=Blt({measure:W.dragOverlay.measure}),fe=(r=oe.nodeRef.current)!=null?r:J,be=D?(i=oe.rect)!=null?i:ue:null,De=!!(oe.nodeRef.current&&oe.rect),Oe=Ilt(De?null:ue),Ke=jle(fe?fs(fe):null),xe=Plt(D?re??J:null),Le=Nlt(xe),Me=Klt(g,{transform:{x:I.x-Oe.x,y:I.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:q,active:F,activeNodeRect:ue,containerNodeRect:te,draggingNodeRect:be,over:Z.current.over,overlayNodeRect:oe.rect,scrollableAncestors:xe,scrollableAncestorRects:Le,windowRect:Ke}),ht=ne?nm(ne,I):null,mt=jlt(xe),ze=$K(mt),Pe=$K(mt,[ue]),He=nm(Me,ze),Je=be?rlt(be,Me):null,nt=F&&Je?f({active:F,collisionRect:Je,droppableRects:X,droppableContainers:B,pointerCoordinates:ht}):null,ot=Ale(nt,"id"),[Xe,Lt]=_.useState(null),Nt=De?Me:nm(Me,Pe),Ot=tlt(Nt,(o=Xe?.rect)!=null?o:null,ue),Xn=_.useRef(null),rn=_.useCallback((Dt,jt)=>{let{sensor:Jt,options:jn}=jt;if(j.current==null)return;const on=T.get(j.current);if(!on)return;const St=Dt.nativeEvent,mn=new Jt({active:j.current,activeNode:on,event:St,options:jn,context:Z,onAbort(br){if(!T.get(br))return;const{onDragAbort:le}=U.current,pe={id:br};le?.(pe),C({type:"onDragAbort",event:pe})},onPending(br,ei,le,pe){if(!T.get(br))return;const{onDragPending:Fe}=U.current,Ue={id:br,constraint:ei,initialCoordinates:le,offset:pe};Fe?.(Ue),C({type:"onDragPending",event:Ue})},onStart(br){const ei=j.current;if(ei==null)return;const le=T.get(ei);if(!le)return;const{onDragStart:pe}=U.current,Se={activatorEvent:St,active:{id:ei,data:le.data,rect:R}};Dd.unstable_batchedUpdates(()=>{pe?.(Se),E(xd.Initializing),S({type:Li.DragStart,initialCoordinates:br,active:ei}),C({type:"onDragStart",event:Se}),L(Xn.current),V(St)})},onMove(br){S({type:Li.DragMove,coordinates:br})},onEnd:Qr(Li.DragEnd),onCancel:Qr(Li.DragCancel)});Xn.current=mn;function Qr(br){return async function(){const{active:le,collisions:pe,over:Se,scrollAdjustedTranslate:Fe}=Z.current;let Ue=null;if(le&&Fe){const{cancelDrop:yt}=U.current;Ue={activatorEvent:St,active:le,collisions:pe,delta:Fe,over:Se},br===Li.DragEnd&&typeof yt=="function"&&await Promise.resolve(yt(Ue))&&(br=Li.DragCancel)}j.current=null,Dd.unstable_batchedUpdates(()=>{S({type:br}),E(xd.Uninitialized),Lt(null),L(null),V(null),Xn.current=null;const yt=br===Li.DragEnd?"onDragEnd":"onDragCancel";if(Ue){const rt=U.current[yt];rt?.(Ue),C({type:yt,event:Ue})}})}}},[T]),at=_.useCallback((Dt,jt)=>(Jt,jn)=>{const on=Jt.nativeEvent,St=T.get(jn);if(j.current!==null||!St||on.dndKit||on.defaultPrevented)return;const mn={active:St};Dt(Jt,jt.options,mn)===!0&&(on.dndKit={capturedBy:jt.sensor},j.current=jn,rn(Jt,jt))},[T,rn]),Ht=Dlt(u,at);$lt(u),yc(()=>{ue&&A===xd.Initializing&&E(xd.Initialized)},[ue,A]),_.useEffect(()=>{const{onDragMove:Dt}=U.current,{active:jt,activatorEvent:Jt,collisions:jn,over:on}=Z.current;if(!jt||!Jt)return;const St={active:jt,activatorEvent:Jt,collisions:jn,delta:{x:He.x,y:He.y},over:on};Dd.unstable_batchedUpdates(()=>{Dt?.(St),C({type:"onDragMove",event:St})})},[He.x,He.y]),_.useEffect(()=>{const{active:Dt,activatorEvent:jt,collisions:Jt,droppableContainers:jn,scrollAdjustedTranslate:on}=Z.current;if(!Dt||j.current==null||!jt||!on)return;const{onDragOver:St}=U.current,mn=jn.get(ot),Qr=mn&&mn.rect.current?{id:mn.id,rect:mn.rect.current,data:mn.data,disabled:mn.disabled}:null,br={active:Dt,activatorEvent:jt,collisions:Jt,delta:{x:on.x,y:on.y},over:Qr};Dd.unstable_batchedUpdates(()=>{Lt(Qr),St?.(br),C({type:"onDragOver",event:br})})},[ot]),yc(()=>{Z.current={activatorEvent:q,active:F,activeNode:J,collisionRect:Je,collisions:nt,droppableRects:X,draggableNodes:T,draggingNode:fe,draggingNodeRect:be,droppableContainers:N,over:Xe,scrollableAncestors:xe,scrollAdjustedTranslate:He},R.current={initial:be,translated:Je}},[F,J,nt,Je,T,fe,be,X,N,Xe,xe,He]),Elt({...ee,delta:I,draggingRect:Je,pointerCoordinates:ht,scrollableAncestors:xe,scrollableAncestorRects:Le});const Dn=_.useMemo(()=>({active:F,activeNode:J,activeNodeRect:ue,activatorEvent:q,collisions:nt,containerNodeRect:te,dragOverlay:oe,draggableNodes:T,droppableContainers:N,droppableRects:X,over:Xe,measureDroppableContainers:H,scrollableAncestors:xe,scrollableAncestorRects:Le,measuringConfiguration:W,measuringScheduled:Y,windowRect:Ke}),[F,J,ue,q,nt,te,oe,T,N,X,Xe,H,xe,Le,W,Y,Ke]),Gn=_.useMemo(()=>({activatorEvent:q,activators:Ht,active:F,activeNodeRect:ue,ariaDescribedById:{draggable:K},dispatch:S,draggableNodes:T,over:Xe,measureDroppableContainers:H}),[q,Ht,F,ue,S,K,T,Xe,H]);return qt.createElement(wle.Provider,{value:w},qt.createElement(KC.Provider,{value:Gn},qt.createElement($le.Provider,{value:Dn},qt.createElement(Lle.Provider,{value:Ot},c)),qt.createElement(Glt,{disabled:a?.restoreFocus===!1})),qt.createElement(Kat,{...a,hiddenTextDescribedById:K}));function yr(){const Dt=z?.autoScrollEnabled===!1,jt=typeof l=="object"?l.enabled===!1:l===!1,Jt=D&&!Dt&&!jt;return typeof l=="object"?{...l,enabled:Jt}:{enabled:Jt}}}),Jlt=_.createContext(null),NK="button",Qlt="Draggable";function ect(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=av(Qlt),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=_.useContext(KC),{role:g=NK,roleDescription:y="draggable",tabIndex:b=0}=i??{},v=l?.id===t,S=_.useContext(v?Lle:Jlt),[C,w]=wS(),[A,E]=wS(),D=Llt(s,t),O=tb(n);yc(()=>(f.set(t,{id:t,key:o,node:C,activatorNode:A,data:O}),()=>{const I=f.get(t);I&&I.key===o&&f.delete(t)}),[f,t]);const T=_.useMemo(()=>({role:g,tabIndex:b,"aria-disabled":r,"aria-pressed":v&&g===NK?!0:void 0,"aria-roledescription":y,"aria-describedby":u.draggable}),[r,g,b,v,y,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:v,listeners:r?void 0:D,node:C,over:h,setNodeRef:w,setActivatorNodeRef:E,transform:S}}function tct(){return _.useContext($le)}const nct="Droppable",rct={timeout:25};function ict(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=av(nct),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=_.useContext(KC),u=_.useRef({disabled:n}),f=_.useRef(!1),h=_.useRef(null),g=_.useRef(null),{disabled:y,updateMeasurementsFor:b,timeout:v}={...rct,...i},S=tb(b??r),C=_.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(S.current)?S.current:[S.current]),g.current=null},v)},[v]),w=GC({callback:C,disabled:y||!s}),A=_.useCallback((T,I)=>{w&&(I&&(w.unobserve(I),f.current=!1),T&&w.observe(T))},[w]),[E,D]=wS(A),O=tb(t);return _.useEffect(()=>{!w||!E.current||(w.disconnect(),f.current=!1,w.observe(E.current))},[E,w]),_.useEffect(()=>(a({type:Li.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:h,data:O}}),()=>a({type:Li.UnregisterDroppable,key:o,id:r})),[r]),_.useEffect(()=>{n!==u.current.disabled&&(a({type:Li.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:h,isOver:l?.id===r,node:E,over:l,setNodeRef:D}}function _I(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function oct(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function A5(e){return e!==null&&e>=0}function sct(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function act(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Nle=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=_I(t,r,n),s=t[i],a=o[i];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},k5={scaleX:1,scaleY:1},lct=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:s}=e;const a=(t=o[n])!=null?t:r;if(!a)return null;if(i===n){const c=o[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...k5}:null}const l=cct(o,i,n);return i>n&&i<=s?{x:0,y:-a.height-l,...k5}:i<n&&i>=s?{x:0,y:a.height+l,...k5}:{x:0,y:0,...k5}};function cct(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const Fle="Sortable",Ble=qt.createContext({activeIndex:-1,containerId:Fle,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Nle,disabled:{draggable:!1,droppable:!1}});function uct(e){let{children:t,id:n,items:r,strategy:i=Nle,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=tct(),f=av(Fle,n),h=a.rect!==null,g=_.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),y=s!=null,b=s?g.indexOf(s.id):-1,v=c?g.indexOf(c.id):-1,S=_.useRef(g),C=!sct(g,S.current),w=v!==-1&&b===-1||C,A=act(o);yc(()=>{C&&y&&u(g)},[C,g,y,u]),_.useEffect(()=>{S.current=g},[g]);const E=_.useMemo(()=>({activeIndex:b,containerId:f,disabled:A,disableTransforms:w,items:g,overIndex:v,useDragOverlay:h,sortedRects:oct(g,l),strategy:i}),[b,f,A.draggable,A.droppable,w,g,v,l,h,i]);return qt.createElement(Ble.Provider,{value:E},t)}const dct=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return _I(n,r,i).indexOf(t)},fct=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==o&&i===s?!1:n?!0:s!==i&&t===l},hct={duration:200,easing:"ease"},zle="transform",pct=rb.Transition.toString({property:zle,duration:0,easing:"linear"}),mct={roleDescription:"sortable"};function gct(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,s]=_.useState(null),a=_.useRef(n);return yc(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const c=pg(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,i]),_.useEffect(()=>{o&&s(null)},[o]),o}function yct(e){let{animateLayoutChanges:t=fct,attributes:n,disabled:r,data:i,getNewIndex:o=dct,id:s,strategy:a,resizeObserverConfig:l,transition:c=hct}=e;const{items:u,containerId:f,activeIndex:h,disabled:g,disableTransforms:y,sortedRects:b,overIndex:v,useDragOverlay:S,strategy:C}=_.useContext(Ble),w=bct(r,g),A=u.indexOf(s),E=_.useMemo(()=>({sortable:{containerId:f,index:A,items:u},...i}),[f,i,A,u]),D=_.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:O,node:T,isOver:I,setNodeRef:N}=ict({id:s,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...l}}),{active:$,activatorEvent:R,activeNodeRect:F,attributes:j,setNodeRef:z,listeners:L,isDragging:q,over:V,setActivatorNodeRef:U,transform:K}=ect({id:s,data:E,attributes:{...mct,...n},disabled:w.draggable}),B=jat(N,z),W=!!$,X=W&&!y&&A5(h)&&A5(v),H=!S&&q,Y=H&&X?K:null,ne=X?Y??(a??C)({rects:b,activeNodeRect:F,activeIndex:h,overIndex:v,index:A}):null,ee=A5(h)&&A5(v)?o({id:s,items:u,activeIndex:h,overIndex:v}):A,se=$?.id,ue=_.useRef({activeId:se,items:u,newIndex:ee,containerId:f}),te=u!==ue.current.items,Z=t({active:$,containerId:f,isDragging:q,isSorting:W,id:s,index:A,items:u,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:c,wasDragging:ue.current.activeId!=null}),re=gct({disabled:!Z,index:A,node:T,rect:O});return _.useEffect(()=>{W&&ue.current.newIndex!==ee&&(ue.current.newIndex=ee),f!==ue.current.containerId&&(ue.current.containerId=f),u!==ue.current.items&&(ue.current.items=u)},[W,ee,f,u]),_.useEffect(()=>{if(se===ue.current.activeId)return;if(se!=null&&ue.current.activeId==null){ue.current.activeId=se;return}const fe=setTimeout(()=>{ue.current.activeId=se},50);return()=>clearTimeout(fe)},[se]),{active:$,activeIndex:h,attributes:j,data:E,rect:O,index:A,newIndex:ee,items:u,isOver:I,isSorting:W,isDragging:q,listeners:L,node:T,overIndex:v,over:V,setNodeRef:B,setActivatorNodeRef:U,setDroppableNodeRef:N,setDraggableNodeRef:z,transform:re??ne,transition:oe()};function oe(){if(re||te&&ue.current.newIndex===A)return pct;if(!(H&&!wI(R)||!c)&&(W||Z))return rb.Transition.toString({...c,property:zle})}}function bct(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function AS(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const vct=[Ln.Down,Ln.Right,Ln.Up,Ln.Left],xct=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(vct.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=i.get(f.id);if(h)switch(e.code){case Ln.Down:r.top<h.top&&l.push(f);break;case Ln.Up:r.top>h.top&&l.push(f);break;case Ln.Left:r.left>h.left&&l.push(f);break;case Ln.Right:r.left<h.left&&l.push(f);break}});const c=Jat({collisionRect:r,droppableRects:i,droppableContainers:l});let u=Ale(c,"id");if(u===s?.id&&c.length>1&&(u=c[1].id),u!=null){const f=o.get(n.id),h=o.get(u),g=h?i.get(h.id):null,y=h?.node.current;if(y&&g&&f&&h){const v=qC(y).some((D,O)=>a[O]!==D),S=Hle(f,h),C=Sct(f,h),w=v||!S?{x:0,y:0}:{x:C?r.width-g.width:0,y:C?r.height-g.height:0},A={x:g.left,y:g.top};return w.x&&w.y?A:nb(A,w)}}}};function Hle(e,t){return!AS(e)||!AS(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Sct(e,t){return!AS(e)||!AS(t)||!Hle(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const wct=({bridge:e,index:t})=>{const{attributes:n,listeners:r,setNodeRef:i,transform:o,transition:s,isDragging:a}=yct({id:e.id}),[l,c]=_.useState(!1);_.useEffect(()=>{_w(e.id).then(c)},[e.id]);const u={transform:rb.Transform.toString(o),transition:s,opacity:a?.5:1};return m.jsx(tr,{ref:i,style:u,variant:"outlined",sx:{cursor:"grab","&:active":{cursor:"grabbing"},bgcolor:a?"action.selected":"background.paper",width:"fit-content"},children:m.jsxs(gr,{sx:{display:"flex",alignItems:"center",gap:1.5,py:1,"&:last-child":{pb:1}},children:[m.jsx(ce,{...n,...r,sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:m.jsx(QCe,{})}),m.jsx(Et,{label:t+1,size:"small",color:"primary",sx:{minWidth:32,fontWeight:"bold"}}),l?m.jsx(ce,{component:"img",src:t2(e.id),alt:e.name,sx:{width:40,height:40,borderRadius:"50%",objectFit:"cover",boxShadow:2}}):m.jsx(rl,{sx:{bgcolor:MT(e),width:40,height:40,boxShadow:2},children:(()=>{const f=TT(e);return m.jsx(f,{sx:{fontSize:24}})})()}),m.jsxs(ce,{sx:{flex:1},children:[m.jsx(ie,{variant:"subtitle1",fontWeight:500,children:e.name}),m.jsxs(ie,{variant:"caption",color:"text.secondary",children:["Port: ",e.port," • Priority: ",e.priority??100]})]})]})})},Cct=()=>{const e=Tu(),{content:t,isLoading:n}=Vm(),r=SCe(),[i,o]=_.useState([]),[s,a]=_.useState(!1);_.useEffect(()=>{if(t){const h=[...t].sort((g,y)=>{const b=g.priority??100,v=y.priority??100;return b-v});o(h),a(!1)}},[t]);const l=Yat(kK(kI),kK(EI,{coordinateGetter:xct})),c=_.useCallback(h=>{const{active:g,over:y}=h;y&&g.id!==y.id&&(o(b=>{const v=b.findIndex(C=>C.id===g.id),S=b.findIndex(C=>C.id===y.id);return _I(b,v,S)}),a(!0))},[]),u=_.useCallback(async()=>{const h=i.map((g,y)=>({id:g.id,priority:(y+1)*10}));try{await r(h),e.show({message:"Startup order saved successfully",severity:"success"}),a(!1)}catch(g){e.show({message:g instanceof Error?g.message:"Failed to save startup order",severity:"error"})}},[i,r,e]),f=_.useMemo(()=>i.map(h=>h.id),[i]);return n?m.jsx(ie,{children:"Loading..."}):m.jsxs(zt,{spacing:3,children:[m.jsx(lw,{items:[{name:"Bridges",to:Pt.bridges},{name:"Startup Order",to:Pt.startup}]}),m.jsxs(ce,{display:"flex",alignItems:"center",gap:2,children:[m.jsx(yb,{color:"primary",fontSize:"large"}),m.jsxs(ce,{children:[m.jsx(ie,{variant:"h5",fontWeight:600,children:"Startup Order"}),m.jsx(ie,{variant:"body2",color:"text.secondary",children:"Drag and drop bridges to set the startup order. Lower positions start first."})]})]}),s&&m.jsx(vn,{severity:"info",action:m.jsx(kt,{color:"inherit",size:"small",startIcon:m.jsx(n6,{}),onClick:u,children:"Save Changes"}),children:"You have unsaved changes to the startup order."}),m.jsx(Zlt,{sensors:l,collisionDetection:Zat,onDragEnd:c,children:m.jsx(uct,{items:f,strategy:lct,children:m.jsx(zt,{spacing:1,children:i.map((h,g)=>m.jsx(wct,{bridge:h,index:g},h.id))})})}),i.length===0&&m.jsx(ie,{color:"text.secondary",textAlign:"center",py:4,children:"No bridges configured yet."}),s&&i.length>0&&m.jsx(ce,{display:"flex",justifyContent:"flex-end",children:m.jsx(kt,{variant:"contained",startIcon:m.jsx(n6,{}),onClick:u,children:"Save Startup Order"})})]})},QA="https://riddix.github.io/home-assistant-matter-hub",Pt={dashboard:"/",bridges:"/bridges",bridge:e=>`/bridges/${e}`,createBridge:"/bridges/create",editBridge:e=>`/bridges/${e}/edit`,devices:"/devices",networkMap:"/network-map",health:"/health",labels:"/labels",lockCredentials:"/lock-credentials",settings:"/settings",startup:"/startup",githubRepository:"https://github.com/riddix/home-assistant-matter-hub/",documentation:QA,faq:{multiFabric:`${QA}/connect-multiple-fabrics`,bridgeConfig:`${QA}/bridge-configuration`}},Ect=[{path:"",element:m.jsx(_2e,{}),children:[{path:"",element:m.jsx(u9e,{})},{path:Pt.bridges,element:m.jsx(a9e,{})},{path:Pt.createBridge,element:m.jsx(JQe,{})},{path:Pt.bridge(":bridgeId"),element:m.jsx(ICe,{})},{path:Pt.editBridge(":bridgeId"),element:m.jsx(QQe,{})},{path:Pt.devices,element:m.jsx(D9e,{})},{path:Pt.networkMap,element:m.jsx(Tat,{})},{path:Pt.health,element:m.jsx(aet,{})},{path:Pt.labels,element:m.jsx(fet,{})},{path:Pt.lockCredentials,element:m.jsx(bet,{})},{path:Pt.settings,element:m.jsx(Pat,{})},{path:Pt.startup,element:m.jsx(Cct,{})},{path:"*",element:m.jsx(vet,{})}]}],Act={items:{isInitialized:!1,isLoading:!1}},kct=FO(Act,e=>{e.addCase(Bo.pending,t=>{t.items.isLoading=!0}).addCase(Bo.rejected,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=void 0,t.items.error=n.error}).addCase(Bo.fulfilled,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(zX.fulfilled,(t,n)=>{t.items.content?.push(n.payload)}).addCase(UX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(VX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(HX.fulfilled,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.meta.arg);r!==-1&&t.items.content.splice(r,1)}}).addCase(WX,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(qX,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.payload.id);r!==-1?t.items.content[r]=n.payload:t.items.content.push(n.payload)}})}),_ct={byBridge:{}},Dct=FO(_ct,e=>{e.addCase(du.pending,(t,n)=>{t.byBridge[n.meta.arg]=ek(t.byBridge[n.meta.arg],n)}).addCase(du.rejected,(t,n)=>{t.byBridge[n.meta.arg]=ek(t.byBridge[n.meta.arg],n)}).addCase(du.fulfilled,(t,n)=>{t.byBridge[n.meta.arg]=ek(t.byBridge[n.meta.arg],n)})}),Oct={isInitialized:!1,isLoading:!1,content:void 0,error:void 0},ek=FO(Oct,e=>{e.addCase(du.pending,t=>{t.isLoading=!0}).addCase(du.rejected,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=void 0,t.error=n.error}).addCase(du.fulfilled,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=n.payload,t.error=void 0})}),Tct=l2e({reducer:{bridges:kct,devices:Dct}}),DI=Wme({createStyledComponent:me("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${ye(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>it({props:e,name:"MuiContainer"})});function Mct(e){return Qe("MuiToolbar",e)}tt("MuiToolbar",["root","gutters","regular","dense"]);const Rct=e=>{const{classes:t,disableGutters:n,variant:r}=e;return et({root:["root",!n&&"gutters",r]},Mct,t)},Ict=me("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Ge(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),Ule=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=Rct(c);return m.jsx(Ict,{as:o,className:Te(u.root,i),ref:n,ownerState:c,...l})});class Pct extends _.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught:",t,n.componentStack)}render(){return this.state.hasError?m.jsxs(ce,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",gap:2,p:4,children:[m.jsx(KO,{color:"error",sx:{fontSize:64}}),m.jsx(ie,{variant:"h5",fontWeight:600,children:"Something went wrong"}),m.jsx(ie,{variant:"body2",color:"text.secondary",textAlign:"center",maxWidth:480,children:this.state.error?.message??"An unexpected error occurred."}),m.jsx(kt,{variant:"contained",onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},children:"Reload Page"})]}):this.props.children}}const jct=[{name:"GitHub",url:Pt.githubRepository},{name:"Documentation",url:Pt.documentation}],$ct=()=>m.jsxs(DI,{sx:{mt:16,mb:4},children:[m.jsx(gi,{sx:{mt:4,mb:4}}),m.jsx(dt,{container:!0,spacing:2,justifyContent:"center",children:jct.map((e,t)=>m.jsx(dt,{size:{xs:12,sm:"auto"},children:m.jsx(kt,{fullWidth:!0,size:"small",variant:"outlined",component:aw,href:e.url,target:"_blank",children:e.name})},t.toString()))})]});function Lct(e){return Qe("MuiAppBar",e)}tt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Nct=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${ye(t)}`,`position${ye(n)}`]};return et(i,Lct,r)},FK=(e,t)=>e?`${e.replace(")","")}, ${t})`:t,Fct=me(Ur,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${ye(n.position)}`],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit",color:"var(--AppBar-color)"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(Fn(["contrastText"])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:t=>t.enableColorOnDark===!0&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>t.enableColorOnDark===!1&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?FK(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?FK(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}))),Bct=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=Nct(c);return m.jsx(Fct,{square:!0,component:"header",ownerState:c,elevation:4,className:Te(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function zct(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=tl(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const c=o.getComputedStyle(t);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:e==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function Hct(e){return typeof e=="function"?e():e}function _5(e,t,n){const r=Hct(n),i=zct(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const Uct=_.forwardRef(function(t,n){const r=ro(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:h,onEnter:g,onEntered:y,onEntering:b,onExit:v,onExited:S,onExiting:C,style:w,timeout:A=o,TransitionComponent:E=Ta,...D}=t,O=_.useRef(null),T=Tr(gf(l),O,n),I=V=>U=>{V&&(U===void 0?V(O.current):V(O.current,U))},N=I((V,U)=>{_5(u,V,c),IO(V),g&&g(V,U)}),$=I((V,U)=>{const K=Kd({timeout:A,style:w,easing:f},{mode:"enter"});V.style.webkitTransition=r.transitions.create("-webkit-transform",{...K}),V.style.transition=r.transitions.create("transform",{...K}),V.style.webkitTransform="none",V.style.transform="none",b&&b(V,U)}),R=I(y),F=I(C),j=I(V=>{const U=Kd({timeout:A,style:w,easing:f},{mode:"exit"});V.style.webkitTransition=r.transitions.create("-webkit-transform",U),V.style.transition=r.transitions.create("transform",U),_5(u,V,c),v&&v(V)}),z=I(V=>{V.style.webkitTransition="",V.style.transition="",S&&S(V)}),L=V=>{s&&s(O.current,V)},q=_.useCallback(()=>{O.current&&_5(u,O.current,c)},[u,c]);return _.useEffect(()=>{if(h||u==="down"||u==="right")return;const V=OO(()=>{O.current&&_5(u,O.current,c)}),U=tl(O.current);return U.addEventListener("resize",V),()=>{V.clear(),U.removeEventListener("resize",V)}},[u,h,c]),_.useEffect(()=>{h||q()},[h,q]),m.jsx(E,{nodeRef:O,onEnter:N,onEntered:R,onEntering:$,onExit:j,onExited:z,onExiting:F,addEndListener:L,appear:a,in:h,timeout:A,...D,children:(V,{ownerState:U,...K})=>_.cloneElement(l,{ref:T,style:{visibility:V==="exited"&&!h?"hidden":void 0,...w,...l.props.style},...K})})});function Vct(e){return Qe("MuiDrawer",e)}tt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const Vle=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,n.variant==="temporary"&&t.modal]},Wct=e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${ye(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${ye(n)}`,r!=="temporary"&&`paperAnchorDocked${ye(n)}`]};return et(i,Vct,t)},qct=me(ZO,{name:"MuiDrawer",slot:"Root",overridesResolver:Vle})(Ge(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Gct=me("div",{shouldForwardProp:io,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Vle})({flex:"0 0 auto"}),Kct=me(Ur,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${ye(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${ye(n.anchor)}`]]}})(Ge(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),Wle={left:"right",right:"left",top:"down",bottom:"up"};function Yct(e){return["left","right"].includes(e)}function Xct({direction:e},t){return e==="rtl"&&Yct(t)?Wle[t]:t}const Zct=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiDrawer"}),i=ro(),o=mf(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:l,children:c,className:u,elevation:f=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:g,...y}={},onClose:b,open:v=!1,PaperProps:S={},SlideProps:C,TransitionComponent:w,transitionDuration:A=s,variant:E="temporary",slots:D={},slotProps:O={},...T}=r,I=_.useRef(!1);_.useEffect(()=>{I.current=!0},[]);const N=Xct({direction:o?"rtl":"ltr"},a),R={...r,anchor:a,elevation:f,open:v,variant:E,...T},F=Wct(R),j={slots:{transition:w,...D},slotProps:{paper:S,transition:C,...O,backdrop:TO(O.backdrop||{...l,...g},{transitionDuration:A})}},[z,L]=lt("root",{ref:n,elementType:qct,className:Te(F.root,F.modal,u),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...j,...T,...y},additionalProps:{open:v,onClose:b,hideBackdrop:h,slots:{backdrop:j.slots.backdrop},slotProps:{backdrop:j.slotProps.backdrop}}}),[q,V]=lt("paper",{elementType:Kct,shouldForwardComponentProp:!0,className:Te(F.paper,S.className),ownerState:R,externalForwardedProps:j,additionalProps:{elevation:E==="temporary"?f:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[U,K]=lt("docked",{elementType:Gct,ref:n,className:Te(F.root,F.docked,u),ownerState:R,externalForwardedProps:j,additionalProps:T}),[B,W]=lt("transition",{elementType:Uct,ownerState:R,externalForwardedProps:j,additionalProps:{in:v,direction:Wle[N],timeout:A,appear:I.current}}),X=m.jsx(q,{...V,children:c});if(E==="permanent")return m.jsx(U,{...K,children:X});const H=m.jsx(B,{...W,children:X});return E==="persistent"?m.jsx(U,{...K,children:H}):m.jsx(z,{...L,children:H})}),Jct=XY({themeId:da}),Qct={error:vf,warn:iw,info:YO,debug:Aw},eut=({open:e,onClose:t})=>{const n=ro(),r=_.useMemo(()=>({error:n.palette.error.main,warn:n.palette.warning.main,info:n.palette.info.main,debug:n.palette.secondary.main}),[n]),[i,o]=_.useState([]),[s,a]=_.useState(!0),[l,c]=_.useState("error,warn,info".split(",")),[u,f]=_.useState(""),[h,g]=_.useState(!0),y=_.useCallback(async()=>{try{const w=new URLSearchParams({level:l.join(","),limit:"500",...u&&{search:u}}),A=await fetch(`api/logs?${w}`);if(A.ok){const E=await A.json();o(E.entries)}}catch(w){console.error("Failed to fetch logs:",w)}finally{a(!1)}},[l,u]);_.useEffect(()=>{e&&y()},[e,y]),_.useEffect(()=>{if(!h||!e)return;const w=setInterval(y,5e3);return()=>clearInterval(w)},[h,e,y]);const b=w=>{c(Array.isArray(w.target.value)?w.target.value:[w.target.value])},v=w=>{f(w.target.value)},S=async()=>{try{await fetch("api/logs",{method:"DELETE"}),o([])}catch(w){console.error("Failed to clear logs:",w)}},C=w=>{const A=Qct[w]||YO;return m.jsx(A,{sx:{fontSize:16,color:r[w]}})};return m.jsxs(vu,{open:e,onClose:t,maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Su,{sx:{display:"flex",alignItems:"center",gap:1},children:[m.jsx(Aw,{}),"System Logs",m.jsx(ce,{sx:{flexGrow:1}}),m.jsx(cn,{title:"Auto Refresh",children:m.jsx(Et,{label:h?"Auto":"Manual",color:h?"success":"default",size:"small",onClick:()=>g(!h),sx:{cursor:"pointer"}})}),m.jsx(_n,{onClick:t,children:m.jsx(qCe,{})})]}),m.jsxs(xu,{children:[m.jsx(zt,{spacing:2,sx:{mb:2},children:m.jsxs(zt,{direction:"row",spacing:2,alignItems:"center",children:[m.jsxs(pa,{size:"small",sx:{minWidth:200},children:[m.jsx(sc,{children:"Log Level"}),m.jsxs(sa,{value:l,label:"Log Level",onChange:b,multiple:!0,renderValue:w=>m.jsx(ce,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(Array.isArray(w)?w:[w]).map(A=>m.jsx(Et,{label:A.toUpperCase(),size:"small",sx:{backgroundColor:r[A],color:"white"}},A))}),children:[m.jsx(er,{value:"error",children:"Error"}),m.jsx(er,{value:"warn",children:"Warning"}),m.jsx(er,{value:"info",children:"Info"}),m.jsx(er,{value:"debug",children:"Debug"})]})]}),m.jsx(Lr,{size:"small",placeholder:"Search logs...",value:u,onChange:v,sx:{flexGrow:1}}),m.jsx(kt,{variant:"outlined",onClick:y,children:"Refresh"}),m.jsx(kt,{variant:"outlined",color:"error",onClick:S,children:"Clear"})]})}),m.jsx(ce,{sx:{height:400,overflow:"auto",backgroundColor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1},children:s?m.jsx(ce,{sx:{display:"flex",justifyContent:"center",p:4},children:m.jsx(ie,{children:"Loading logs..."})}):i.length===0?m.jsx(ce,{sx:{display:"flex",justifyContent:"center",p:4},children:m.jsx(ie,{color:"text.secondary",children:"No logs found"})}):m.jsx(zt,{spacing:1,children:i.map((w,A)=>m.jsxs(ce,{sx:{p:1,borderRadius:1,backgroundColor:"action.hover",fontFamily:"monospace",fontSize:"0.875rem",wordBreak:"break-all"},children:[m.jsxs(ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[C(w.level),m.jsx(ie,{variant:"caption",color:"text.secondary",children:new Date(w.timestamp).toLocaleString()}),m.jsx(Et,{label:w.level.toUpperCase(),size:"small",sx:{backgroundColor:r[w.level],color:n.palette.getContrastText(r[w.level]??n.palette.grey[500]),fontSize:"0.7rem",height:20}})]}),m.jsx(ie,{sx:{ml:3},children:w.message}),w.context&&m.jsx(ie,{sx:{ml:3,color:"text.secondary",fontSize:"0.8rem"},children:JSON.stringify(w.context,null,2)})]},`${w.timestamp}-${w.level}-${A}`))})})]}),m.jsx(Xd,{children:m.jsx(kt,{onClick:t,children:"Close"})})]})};function BK(){const{isConnected:e}=A2e(),[t,n]=_.useState(null),[r,i]=_.useState(!1);_.useEffect(()=>{const y=async()=>{try{const v=await fetch("api/health");if(v.ok){const S=await v.json();n(S),i(!1)}else i(!0)}catch{i(!0)}};y();const b=setInterval(y,3e4);return()=>clearInterval(b)},[]);const o=y=>{const b=Math.floor(y/3600),v=Math.floor(y%3600/60);return b>0?`${b}h ${v}m`:`${v}m`},s=t?.status==="healthy"&&!r,a=t?.services?.bridges,l=a&&a.total>0&&a.running===a.total,c=a&&a.total===0,u=t?m.jsxs(ce,{sx:{p:.5},children:[m.jsxs("div",{children:[m.jsx("strong",{children:"Version:"})," ",t.version??"Unknown"]}),m.jsxs("div",{children:[m.jsx("strong",{children:"Uptime:"})," ",o(t.uptime??0)]}),t.services?.bridges&&m.jsxs("div",{children:[m.jsx("strong",{children:"Bridges:"})," ",t.services.bridges.running??0,"/",t.services.bridges.total??0," running",(t.services.bridges.stopped??0)>0&&` (${t.services.bridges.stopped} stopped)`]}),t.services?.homeAssistant&&m.jsxs("div",{children:[m.jsx("strong",{children:"Home Assistant:"})," ",t.services.homeAssistant.connected?"Connected":"Disconnected"]}),m.jsxs("div",{children:[m.jsx("strong",{children:"WebSocket:"})," ",e?"Connected":"Disconnected"]})]}):"Loading health status...",f=()=>r||!s?m.jsx(vf,{fontSize:"small"}):l?m.jsx(Mu,{fontSize:"small"}):m.jsx(dw,{fontSize:"small"}),h=()=>r||!s?"error":!l||!e?"warning":"success",g=()=>r?"Error":s?e?c?"No Bridges":l?"Online":"Starting":"Offline":"Unhealthy";return m.jsx(cn,{title:u,arrow:!0,children:m.jsx(Et,{icon:f(),label:g(),color:h(),size:"small",variant:"filled",sx:{borderRadius:1,fontWeight:600,"& .MuiChip-icon":{color:"inherit"}}})})}const tut=e=>_.createElement("svg",{viewBox:"0 0 91 89",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{style:{display:"inline"}},_.createElement("path",{style:{fill:"#18bcf2",fillOpacity:1,strokeWidth:.266194},d:"m 49.149143,1.473171 38.513568,38.536435 c 0,0 1.248354,1.186052 2.207681,3.092371 0.959329,1.906323 1.10864,4.600698 1.10864,4.600698 v 36.786372 c 0,0 -0.01549,1.748506 -1.49842,3.050572 -1.482931,1.302064 -3.333077,1.362947 -3.333077,1.362947 l -81.325658,7.7e-5 c 0,0 -1.7523855,-0.0091 -3.17112,-1.352526 C -0.07808495,85.913164 0.05953025,84.487808 0.05953025,84.487808 V 47.704546 c 0,0 -0.0018381,-2.218618 0.95921785,-4.315832 0.9610554,-2.097209 2.3010618,-3.355005 2.3010618,-3.355005 L 41.545959,1.4719546 c 0,0 1.465224,-1.46837077 3.753488,-1.46837077 2.288268,0 3.849696,1.46958717 3.849696,1.46958717 z"}),_.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:.175841},d:"m 31.689717,32.051124 c 2.813363,2.331095 6.157331,3.89845 9.721813,4.556421 V 17.180647 l 3.873694,-2.282955 3.870527,2.282955 V 36.60772 c 3.565364,-0.658847 6.910387,-2.226204 9.725159,-4.556417 l 7.032345,4.154609 c -11.437354,11.557779 -29.852321,11.557779 -41.290025,0 z m 8.546732,49.60988 C 44.314996,65.760441 35.09933,49.470196 19.574984,45.139543 v 8.312381 c 3.383916,1.32244 6.386113,3.496288 8.728705,6.320026 L 11.83076,69.485301 v 4.56907 l 3.873697,2.270836 16.469936,-9.713534 c 1.224356,3.48294 1.56683,7.225375 0.996449,10.879778 z M 70.977694,45.139543 c -15.515726,4.34014 -24.72189,20.626696 -20.643519,36.521461 l 7.047658,-4.15742 c -0.569325,-3.654411 -0.2265,-7.3965 0.996449,-10.87979 l 16.457611,9.701233 3.870711,-2.283125 v -4.55677 L 62.233673,59.77195 c 2.342772,-2.822684 5.34497,-4.996533 8.728708,-6.320026 z"}))),nut="home-assistant-matter-hub",rut={name:nut};function iut(){const[e,t]=_.useState("2.1.0-alpha.431");return _.useEffect(()=>{fetch("api/health").then(n=>n.ok?n.json():null).then(n=>{n?.version&&t(n.version)}).catch(()=>{})},[]),_.useMemo(()=>({name:rut.name,version:e}),[e])}const out=e=>{const t=iut();return m.jsxs(ce,{component:Du,to:Pt.dashboard,sx:{display:"flex",alignItems:"center",justifyContent:e.large?"flex-start":"center",flexGrow:1,textDecoration:"none",color:"inherit"},children:[m.jsx(tut,{style:{height:"40px"}}),m.jsx(ie,{variant:"inherit",component:"span",sx:{mr:1,ml:1},children:t.name.split("-").map(ye).join("-")}),e.large&&m.jsx(ie,{variant:"caption",component:"span",children:t.version})]})},sut=()=>{const e=Jct("(min-width:600px)"),{mode:t,setMode:n}=KS(),[r,i]=_.useState(!1),[o,s]=_.useState(!1),a=hf(),l=()=>{n(t==="dark"?"light":"dark")},c=[{label:"Dashboard",icon:m.jsx(CT,{}),to:Pt.dashboard},{label:"Bridges",icon:m.jsx(t6,{}),to:Pt.bridges},{label:"All Devices",icon:m.jsx(Fs,{}),to:Pt.devices},{label:"Network Map",icon:m.jsx(bT,{}),to:Pt.networkMap},{label:"Startup Order",icon:m.jsx(yb,{}),to:Pt.startup},{label:"Lock Credentials",icon:m.jsx(uu,{}),to:Pt.lockCredentials},{label:"Filter Reference",icon:m.jsx(ET,{}),to:Pt.labels},{label:"Settings",icon:m.jsx(wb,{}),to:Pt.settings},{label:t==="dark"?"Light Mode":"Dark Mode",icon:t==="dark"?m.jsx(a8e,{}):m.jsx(YCe,{}),onClick:l},{label:"System Logs",icon:m.jsx(Aw,{}),onClick:()=>i(!0)},{label:"Health Dashboard",icon:m.jsx(QO,{}),to:Pt.health}],u=f=>{s(!1),f.onClick?f.onClick():f.to&&a(f.to)};return m.jsxs(ce,{children:[m.jsx(Bct,{sx:{height:"72px"},children:m.jsx(Ule,{sx:{paddingLeft:"0 !important",paddingRight:"0 !important"},children:m.jsxs(DI,{sx:{padding:2,height:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[m.jsx(out,{large:e}),e?m.jsxs(ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.map(f=>f.to?m.jsx(cn,{title:f.label,children:m.jsx(_n,{component:Du,to:f.to,sx:{color:"inherit"},children:f.icon})},f.label):m.jsx(cn,{title:f.label,children:m.jsx(_n,{onClick:f.onClick,sx:{color:"inherit"},children:f.icon})},f.label)),m.jsx(BK,{})]}):m.jsxs(ce,{sx:{display:"flex",alignItems:"center",gap:.5},children:[m.jsx(BK,{}),m.jsx(_n,{onClick:()=>s(!0),sx:{color:"inherit"},children:m.jsx(l8e,{})})]})]})})}),m.jsx(Zct,{anchor:"right",open:o,onClose:()=>s(!1),children:m.jsx(bc,{sx:{width:250},children:c.map(f=>m.jsxs(obe,{onClick:()=>u(f),children:[m.jsx(Ul,{children:f.icon}),m.jsx(Va,{primary:f.label})]},f.label))})}),m.jsx(eut,{open:r,onClose:()=>i(!1)})]})},aut=()=>m.jsxs(ce,{children:[m.jsx(sut,{}),m.jsx(Ule,{}),m.jsx(DI,{sx:{p:2},children:m.jsx(Pct,{children:m.jsx(yY,{})})}),m.jsx($ct,{})]}),lut=WS({colorSchemes:{light:{palette:{primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2"},background:{default:"#f5f5f5",paper:"#ffffff"}}},dark:{palette:{primary:{main:"#90caf9",light:"#e3f2fd",dark:"#42a5f5"},secondary:{main:"#ce93d8",light:"#f3e5f5",dark:"#ab47bc"},background:{default:"#121212",paper:"#1e1e1e"}}}},typography:{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',h1:{fontSize:"2.5rem",fontWeight:500},h2:{fontSize:"2rem",fontWeight:500},h3:{fontSize:"1.75rem",fontWeight:500},h4:{fontSize:"1.5rem",fontWeight:500},h5:{fontSize:"1.25rem",fontWeight:500},h6:{fontSize:"1rem",fontWeight:500}},shape:{borderRadius:8},components:{MuiCard:{styleOverrides:{root:{transition:"transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 20px rgba(0,0,0,0.12)"}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500}}},MuiChip:{styleOverrides:{root:{fontWeight:500}}},MuiAppBar:{styleOverrides:{root:{backgroundImage:"none"}}}}});let _4=document.getElementsByTagName("base")[0]?.href?.replace(/\/$/,"");_4?.startsWith("http")&&(_4=new URL(_4).pathname);const cut=Hhe([{path:"/",element:m.jsx(aut,{}),children:Ect}],{basename:_4});sde.createRoot(document.getElementById("root")).render(m.jsx(_.StrictMode,{children:m.jsx(Cde,{store:Tct,children:m.jsxs(n1e,{theme:lut,children:[m.jsx(Zge,{}),m.jsx(dX,{styles:{".rjsf-field-array > .MuiFormControl-root > .MuiPaper-root > .MuiBox-root > .MuiGrid-root > .MuiGrid-root:has(> .MuiBox-root > .MuiPaper-root > .MuiBox-root > .rjsf-field)":{overflow:"initial !important",flexGrow:1}}}),m.jsx(k2e,{children:m.jsx(yye,{children:m.jsx(epe,{router:cut})})})]})})}));
499
+ `},Gat={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Kat(e){let{announcements:t=Gat,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=qat}=e;const{announce:o,announcement:s}=Uat(),a=av("DndLiveRegion"),[l,c]=_.useState(!1);if(_.useEffect(()=>{c(!0)},[]),Vat(_.useMemo(()=>({onDragStart(f){let{active:h}=f;o(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&o(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;o(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;o(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;o(t.onDragCancel({active:h,over:g}))}}),[o,t])),!l)return null;const u=qt.createElement(qt.Fragment,null,qt.createElement(zat,{id:r,value:i.draggable}),qt.createElement(Hat,{id:a,announcement:s}));return n?Dd.createPortal(u,n):u}var Li;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Li||(Li={}));function CS(){}function kK(e,t){return _.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Yat(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const sl=Object.freeze({x:0,y:0});function Cle(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ele(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Xat(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function _K(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Ale(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function DK(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Zat=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=DK(t,t.left,t.top),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=Cle(DK(l),i);o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(Ele)},Jat=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=_K(t),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=_K(l),u=i.reduce((h,g,y)=>h+Cle(c[y],g),0),f=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:f}})}}return o.sort(Ele)};function Qat(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,c=e.width*e.height,u=s*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const elt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:s}=o,a=n.get(s);if(a){const l=Qat(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Xat)};function tlt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function kle(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:sl}function nlt(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const rlt=nlt(1);function ilt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function olt(e,t,n){const r=ilt(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const slt={ignoreTransform:!1};function pg(e,t){t===void 0&&(t=slt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=fs(e).getComputedStyle(e);c&&(n=olt(n,c,u))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function OK(e){return pg(e,{ignoreTransform:!0})}function alt(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function llt(e,t){return t===void 0&&(t=fs(e).getComputedStyle(e)),t.position==="fixed"}function clt(e,t){t===void 0&&(t=fs(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function qC(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(xI(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!ov(i)||xle(i)||n.includes(i))return n;const o=fs(e).getComputedStyle(i);return i!==e&&clt(i,o)&&n.push(i),llt(i,o)?n:r(i.parentNode)}return e?r(e):n}function _le(e){const[t]=qC(e,1);return t??null}function XA(e){return!WC||!e?null:fg(e)?e:vI(e)?xI(e)||e===hg(e).scrollingElement?window:ov(e)?e:null:null}function Dle(e){return fg(e)?e.scrollX:e.scrollLeft}function Ole(e){return fg(e)?e.scrollY:e.scrollTop}function XD(e){return{x:Dle(e),y:Ole(e)}}var Xi;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Xi||(Xi={}));function Tle(e){return!WC||!e?!1:e===document.scrollingElement}function Mle(e){const t={x:0,y:0},n=Tle(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const ult={x:.2,y:.2};function dlt(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=ult);const{isTop:c,isBottom:u,isLeft:f,isRight:h}=Mle(e),g={x:0,y:0},y={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+b.height?(g.y=Xi.Backward,y.y=r*Math.abs((t.top+b.height-o)/b.height)):!u&&l>=t.bottom-b.height&&(g.y=Xi.Forward,y.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!h&&a>=t.right-b.width?(g.x=Xi.Forward,y.x=r*Math.abs((t.right-b.width-a)/b.width)):!f&&s<=t.left+b.width&&(g.x=Xi.Backward,y.x=r*Math.abs((t.left+b.width-s)/b.width)),{direction:g,speed:y}}function flt(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Rle(e){return e.reduce((t,n)=>nm(t,XD(n)),sl)}function hlt(e){return e.reduce((t,n)=>t+Dle(n),0)}function plt(e){return e.reduce((t,n)=>t+Ole(n),0)}function mlt(e,t){if(t===void 0&&(t=pg),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);_le(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const glt=[["x",["left","right"],hlt],["y",["top","bottom"],plt]];class CI{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=qC(n),i=Rle(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of glt)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[o]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Iy{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function ylt(e){const{EventTarget:t}=fs(e);return e instanceof t?e:hg(e)}function ZA(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var na;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(na||(na={}));function TK(e){e.preventDefault()}function blt(e){e.stopPropagation()}var Ln;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ln||(Ln={}));const Ile={start:[Ln.Space,Ln.Enter],cancel:[Ln.Esc],end:[Ln.Space,Ln.Enter,Ln.Tab]},vlt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ln.Right:return{...n,x:n.x+25};case Ln.Left:return{...n,x:n.x-25};case Ln.Down:return{...n,y:n.y+25};case Ln.Up:return{...n,y:n.y-25}}};class EI{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Iy(hg(n)),this.windowListeners=new Iy(fs(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(na.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&mlt(r),n(sl)}handleKeyDown(t){if(wI(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Ile,coordinateGetter:s=vlt,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:sl;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:n,context:r.current,currentCoordinates:u});if(f){const h=nb(f,u),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(const b of y){const v=t.code,{isTop:S,isRight:C,isLeft:w,isBottom:A,maxScroll:E,minScroll:D}=Mle(b),O=flt(b),T={x:Math.min(v===Ln.Right?O.right-O.width/2:O.right,Math.max(v===Ln.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(v===Ln.Down?O.bottom-O.height/2:O.bottom,Math.max(v===Ln.Down?O.top:O.top+O.height/2,f.y))},I=v===Ln.Right&&!C||v===Ln.Left&&!w,N=v===Ln.Down&&!A||v===Ln.Up&&!S;if(I&&T.x!==f.x){const $=b.scrollLeft+h.x,R=v===Ln.Right&&$<=E.x||v===Ln.Left&&$>=D.x;if(R&&!h.y){b.scrollTo({left:$,behavior:a});return}R?g.x=b.scrollLeft-$:g.x=v===Ln.Right?b.scrollLeft-E.x:b.scrollLeft-D.x,g.x&&b.scrollBy({left:-g.x,behavior:a});break}else if(N&&T.y!==f.y){const $=b.scrollTop+h.y,R=v===Ln.Down&&$<=E.y||v===Ln.Up&&$>=D.y;if(R&&!h.x){b.scrollTo({top:$,behavior:a});return}R?g.y=b.scrollTop-$:g.y=v===Ln.Down?b.scrollTop-E.y:b.scrollTop-D.y,g.y&&b.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,nm(nb(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}EI.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Ile,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function MK(e){return!!(e&&"distance"in e)}function RK(e){return!!(e&&"delay"in e)}class AI{constructor(t,n,r){var i;r===void 0&&(r=ylt(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:s}=o;this.props=t,this.events=n,this.document=hg(s),this.documentListeners=new Iy(this.document),this.listeners=new Iy(r),this.windowListeners=new Iy(fs(s)),this.initialCoordinates=(i=YD(o))!=null?i:sl,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.DragStart,TK),this.windowListeners.add(na.VisibilityChange,this.handleCancel),this.windowListeners.add(na.ContextMenu,TK),this.documentListeners.add(na.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(RK(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(MK(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(na.Click,blt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(na.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(n=YD(t))!=null?n:sl,c=nb(i,l);if(!r&&a){if(MK(a)){if(a.tolerance!=null&&ZA(c,a.tolerance))return this.handleCancel();if(ZA(c,a.distance))return this.handleStart()}if(RK(a)&&ZA(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ln.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xlt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class kI extends AI{constructor(t){const{event:n}=t,r=hg(n.target);super(t,xlt,r)}}kI.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Slt={move:{name:"mousemove"},end:{name:"mouseup"}};var ZD;(function(e){e[e.RightClick=2]="RightClick"})(ZD||(ZD={}));class wlt extends AI{constructor(t){super(t,Slt,hg(t.event.target))}}wlt.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===ZD.RightClick?!1:(r?.({event:n}),!0)}}];const JA={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Clt extends AI{constructor(t){super(t,JA)}static setup(){return window.addEventListener(JA.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(JA.move.name,t)};function t(){}}}Clt.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Py;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Py||(Py={}));var ES;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ES||(ES={}));function Elt(e){let{acceleration:t,activator:n=Py.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=ES.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:h}=e;const g=klt({delta:f,disabled:!o}),[y,b]=$at(),v=_.useRef({x:0,y:0}),S=_.useRef({x:0,y:0}),C=_.useMemo(()=>{switch(n){case Py.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Py.DraggableRect:return i}},[n,i,l]),w=_.useRef(null),A=_.useCallback(()=>{const D=w.current;if(!D)return;const O=v.current.x*S.current.x,T=v.current.y*S.current.y;D.scrollBy(O,T)},[]),E=_.useMemo(()=>a===ES.TreeOrder?[...c].reverse():c,[a,c]);_.useEffect(()=>{if(!o||!c.length||!C){b();return}for(const D of E){if(r?.(D)===!1)continue;const O=c.indexOf(D),T=u[O];if(!T)continue;const{direction:I,speed:N}=dlt(D,T,C,t,h);for(const $ of["x","y"])g[$][I[$]]||(N[$]=0,I[$]=0);if(N.x>0||N.y>0){b(),w.current=D,y(A,s),v.current=N,S.current=I;return}}v.current={x:0,y:0},S.current={x:0,y:0},b()},[t,A,r,b,o,s,JSON.stringify(C),JSON.stringify(g),y,c,E,u,JSON.stringify(h)])}const Alt={x:{[Xi.Backward]:!1,[Xi.Forward]:!1},y:{[Xi.Backward]:!1,[Xi.Forward]:!1}};function klt(e){let{delta:t,disabled:n}=e;const r=KD(t);return sv(i=>{if(n||!r||!i)return Alt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Xi.Backward]:i.x[Xi.Backward]||o.x===-1,[Xi.Forward]:i.x[Xi.Forward]||o.x===1},y:{[Xi.Backward]:i.y[Xi.Backward]||o.y===-1,[Xi.Forward]:i.y[Xi.Forward]||o.y===1}}},[n,t,r])}function _lt(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return sv(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function Dlt(e,t){return _.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...o]},[]),[e,t])}var ib;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ib||(ib={}));var JD;(function(e){e.Optimized="optimized"})(JD||(JD={}));const IK=new Map;function Olt(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=_.useState(null),{frequency:a,measure:l,strategy:c}=i,u=_.useRef(e),f=v(),h=tb(f),g=_.useCallback(function(S){S===void 0&&(S=[]),!h.current&&s(C=>C===null?S:C.concat(S.filter(w=>!C.includes(w))))},[h]),y=_.useRef(null),b=sv(S=>{if(f&&!n)return IK;if(!S||S===IK||u.current!==e||o!=null){const C=new Map;for(let w of e){if(!w)continue;if(o&&o.length>0&&!o.includes(w.id)&&w.rect.current){C.set(w.id,w.rect.current);continue}const A=w.node.current,E=A?new CI(l(A),A):null;w.rect.current=E,E&&C.set(w.id,E)}return C}return S},[e,o,n,f,l]);return _.useEffect(()=>{u.current=e},[e]),_.useEffect(()=>{f||g()},[n,f]),_.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),_.useEffect(()=>{f||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},a))},[a,f,g,...r]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:o!=null};function v(){switch(c){case ib.Always:return!1;case ib.BeforeDragging:return n;default:return!n}}}function Ple(e,t){return sv(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Tlt(e,t){return Ple(e,t)}function Mlt(e){let{callback:t,disabled:n}=e;const r=SI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function GC(e){let{callback:t,disabled:n}=e;const r=SI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function Rlt(e){return new CI(pg(e),e)}function PK(e,t,n){t===void 0&&(t=Rlt);const[r,i]=_.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=Mlt({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=GC({callback:o});return yc(()=>{o(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function Ilt(e){const t=Ple(e);return kle(e,t)}const jK=[];function Plt(e){const t=_.useRef(e),n=sv(r=>e?r&&r!==jK&&e&&t.current&&e.parentNode===t.current.parentNode?r:qC(e):jK,[e]);return _.useEffect(()=>{t.current=e},[e]),n}function jlt(e){const[t,n]=_.useState(null),r=_.useRef(e),i=_.useCallback(o=>{const s=XA(o.target);s&&n(a=>a?(a.set(s,XD(s)),new Map(a)):null)},[]);return _.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=XA(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,XD(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const c=XA(l);c?.removeEventListener("scroll",i)})}},[i,e]),_.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>nm(o,s),sl):Rle(e):sl,[e,t])}function $K(e,t){t===void 0&&(t=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},t),_.useEffect(()=>{const r=e!==sl;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?nb(e,n.current):sl}function $lt(e){_.useEffect(()=>{if(!WC)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function Llt(e,t){return _.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function jle(e){return _.useMemo(()=>e?alt(e):null,[e])}const LK=[];function Nlt(e,t){t===void 0&&(t=pg);const[n]=e,r=jle(n?fs(n):null),[i,o]=_.useState(LK);function s(){o(()=>e.length?e.map(l=>Tle(l)?r:new CI(t(l),l)):LK)}const a=GC({callback:s});return yc(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),i}function Flt(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ov(t)?t:e}function Blt(e){let{measure:t}=e;const[n,r]=_.useState(null),i=_.useCallback(c=>{for(const{target:u}of c)if(ov(u)){r(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),o=GC({callback:i}),s=_.useCallback(c=>{const u=Flt(c);o?.disconnect(),u&&o?.observe(u),r(u?t(u):null)},[t,o]),[a,l]=wS(s);return _.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const zlt=[{sensor:kI,options:{}},{sensor:EI,options:{}}],Hlt={current:{}},k4={draggable:{measure:OK},droppable:{measure:OK,strategy:ib.WhileDragging,frequency:JD.Optimized},dragOverlay:{measure:pg}};class jy extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Ult={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jy,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:CS},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:k4,measureDroppableContainers:CS,windowRect:null,measuringScheduled:!1},Vlt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:CS,draggableNodes:new Map,over:null,measureDroppableContainers:CS},KC=_.createContext(Vlt),$le=_.createContext(Ult);function Wlt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jy}}}function qlt(e,t){switch(t.type){case Li.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Li.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Li.DragEnd:case Li.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Li.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new jy(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Li.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new jy(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Li.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new jy(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Glt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=_.useContext(KC),o=KD(r),s=KD(n?.id);return _.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!wI(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=Fat(u);if(f){f.focus();break}}})}},[r,t,i,s,o]),null}function Klt(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function Ylt(e){return _.useMemo(()=>({draggable:{...k4.draggable,...e?.draggable},droppable:{...k4.droppable,...e?.droppable},dragOverlay:{...k4.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Xlt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=_.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;yc(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=kle(u,r);if(s||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=_le(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const Lle=_.createContext({...sl,scaleX:1,scaleY:1});var xd;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(xd||(xd={}));const Zlt=_.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=zlt,collisionDetection:f=elt,measuring:h,modifiers:g,...y}=t;const b=_.useReducer(qlt,void 0,Wlt),[v,S]=b,[C,w]=Wat(),[A,E]=_.useState(xd.Uninitialized),D=A===xd.Initialized,{draggable:{active:O,nodes:T,translate:I},droppable:{containers:N}}=v,$=O!=null?T.get(O):null,R=_.useRef({initial:null,translated:null}),F=_.useMemo(()=>{var Dt;return O!=null?{id:O,data:(Dt=$?.data)!=null?Dt:Hlt,rect:R}:null},[O,$]),j=_.useRef(null),[z,L]=_.useState(null),[q,V]=_.useState(null),U=tb(y,Object.values(y)),K=av("DndDescribedBy",s),B=_.useMemo(()=>N.getEnabled(),[N]),W=Ylt(h),{droppableRects:X,measureDroppableContainers:H,measuringScheduled:Y}=Olt(B,{dragging:D,dependencies:[I.x,I.y],config:W.droppable}),J=_lt(T,O),ne=_.useMemo(()=>q?YD(q):null,[q]),ee=yr(),se=Tlt(J,W.draggable.measure);Xlt({activeNode:O!=null?T.get(O):null,config:ee.layoutShiftCompensation,initialRect:se,measure:W.draggable.measure});const ue=PK(J,W.draggable.measure,se),te=PK(J?J.parentElement:null),Z=_.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=N.getNodeFor((n=Z.current.over)==null?void 0:n.id),oe=Blt({measure:W.dragOverlay.measure}),fe=(r=oe.nodeRef.current)!=null?r:J,be=D?(i=oe.rect)!=null?i:ue:null,De=!!(oe.nodeRef.current&&oe.rect),Oe=Ilt(De?null:ue),Ke=jle(fe?fs(fe):null),xe=Plt(D?re??J:null),Le=Nlt(xe),Me=Klt(g,{transform:{x:I.x-Oe.x,y:I.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:q,active:F,activeNodeRect:ue,containerNodeRect:te,draggingNodeRect:be,over:Z.current.over,overlayNodeRect:oe.rect,scrollableAncestors:xe,scrollableAncestorRects:Le,windowRect:Ke}),ht=ne?nm(ne,I):null,mt=jlt(xe),ze=$K(mt),Pe=$K(mt,[ue]),He=nm(Me,ze),Je=be?rlt(be,Me):null,nt=F&&Je?f({active:F,collisionRect:Je,droppableRects:X,droppableContainers:B,pointerCoordinates:ht}):null,ot=Ale(nt,"id"),[Xe,Lt]=_.useState(null),Nt=De?Me:nm(Me,Pe),Ot=tlt(Nt,(o=Xe?.rect)!=null?o:null,ue),Xn=_.useRef(null),rn=_.useCallback((Dt,jt)=>{let{sensor:Jt,options:jn}=jt;if(j.current==null)return;const on=T.get(j.current);if(!on)return;const St=Dt.nativeEvent,mn=new Jt({active:j.current,activeNode:on,event:St,options:jn,context:Z,onAbort(br){if(!T.get(br))return;const{onDragAbort:le}=U.current,pe={id:br};le?.(pe),C({type:"onDragAbort",event:pe})},onPending(br,ei,le,pe){if(!T.get(br))return;const{onDragPending:Fe}=U.current,Ue={id:br,constraint:ei,initialCoordinates:le,offset:pe};Fe?.(Ue),C({type:"onDragPending",event:Ue})},onStart(br){const ei=j.current;if(ei==null)return;const le=T.get(ei);if(!le)return;const{onDragStart:pe}=U.current,Se={activatorEvent:St,active:{id:ei,data:le.data,rect:R}};Dd.unstable_batchedUpdates(()=>{pe?.(Se),E(xd.Initializing),S({type:Li.DragStart,initialCoordinates:br,active:ei}),C({type:"onDragStart",event:Se}),L(Xn.current),V(St)})},onMove(br){S({type:Li.DragMove,coordinates:br})},onEnd:Qr(Li.DragEnd),onCancel:Qr(Li.DragCancel)});Xn.current=mn;function Qr(br){return async function(){const{active:le,collisions:pe,over:Se,scrollAdjustedTranslate:Fe}=Z.current;let Ue=null;if(le&&Fe){const{cancelDrop:yt}=U.current;Ue={activatorEvent:St,active:le,collisions:pe,delta:Fe,over:Se},br===Li.DragEnd&&typeof yt=="function"&&await Promise.resolve(yt(Ue))&&(br=Li.DragCancel)}j.current=null,Dd.unstable_batchedUpdates(()=>{S({type:br}),E(xd.Uninitialized),Lt(null),L(null),V(null),Xn.current=null;const yt=br===Li.DragEnd?"onDragEnd":"onDragCancel";if(Ue){const rt=U.current[yt];rt?.(Ue),C({type:yt,event:Ue})}})}}},[T]),at=_.useCallback((Dt,jt)=>(Jt,jn)=>{const on=Jt.nativeEvent,St=T.get(jn);if(j.current!==null||!St||on.dndKit||on.defaultPrevented)return;const mn={active:St};Dt(Jt,jt.options,mn)===!0&&(on.dndKit={capturedBy:jt.sensor},j.current=jn,rn(Jt,jt))},[T,rn]),Ht=Dlt(u,at);$lt(u),yc(()=>{ue&&A===xd.Initializing&&E(xd.Initialized)},[ue,A]),_.useEffect(()=>{const{onDragMove:Dt}=U.current,{active:jt,activatorEvent:Jt,collisions:jn,over:on}=Z.current;if(!jt||!Jt)return;const St={active:jt,activatorEvent:Jt,collisions:jn,delta:{x:He.x,y:He.y},over:on};Dd.unstable_batchedUpdates(()=>{Dt?.(St),C({type:"onDragMove",event:St})})},[He.x,He.y]),_.useEffect(()=>{const{active:Dt,activatorEvent:jt,collisions:Jt,droppableContainers:jn,scrollAdjustedTranslate:on}=Z.current;if(!Dt||j.current==null||!jt||!on)return;const{onDragOver:St}=U.current,mn=jn.get(ot),Qr=mn&&mn.rect.current?{id:mn.id,rect:mn.rect.current,data:mn.data,disabled:mn.disabled}:null,br={active:Dt,activatorEvent:jt,collisions:Jt,delta:{x:on.x,y:on.y},over:Qr};Dd.unstable_batchedUpdates(()=>{Lt(Qr),St?.(br),C({type:"onDragOver",event:br})})},[ot]),yc(()=>{Z.current={activatorEvent:q,active:F,activeNode:J,collisionRect:Je,collisions:nt,droppableRects:X,draggableNodes:T,draggingNode:fe,draggingNodeRect:be,droppableContainers:N,over:Xe,scrollableAncestors:xe,scrollAdjustedTranslate:He},R.current={initial:be,translated:Je}},[F,J,nt,Je,T,fe,be,X,N,Xe,xe,He]),Elt({...ee,delta:I,draggingRect:Je,pointerCoordinates:ht,scrollableAncestors:xe,scrollableAncestorRects:Le});const Dn=_.useMemo(()=>({active:F,activeNode:J,activeNodeRect:ue,activatorEvent:q,collisions:nt,containerNodeRect:te,dragOverlay:oe,draggableNodes:T,droppableContainers:N,droppableRects:X,over:Xe,measureDroppableContainers:H,scrollableAncestors:xe,scrollableAncestorRects:Le,measuringConfiguration:W,measuringScheduled:Y,windowRect:Ke}),[F,J,ue,q,nt,te,oe,T,N,X,Xe,H,xe,Le,W,Y,Ke]),Gn=_.useMemo(()=>({activatorEvent:q,activators:Ht,active:F,activeNodeRect:ue,ariaDescribedById:{draggable:K},dispatch:S,draggableNodes:T,over:Xe,measureDroppableContainers:H}),[q,Ht,F,ue,S,K,T,Xe,H]);return qt.createElement(wle.Provider,{value:w},qt.createElement(KC.Provider,{value:Gn},qt.createElement($le.Provider,{value:Dn},qt.createElement(Lle.Provider,{value:Ot},c)),qt.createElement(Glt,{disabled:a?.restoreFocus===!1})),qt.createElement(Kat,{...a,hiddenTextDescribedById:K}));function yr(){const Dt=z?.autoScrollEnabled===!1,jt=typeof l=="object"?l.enabled===!1:l===!1,Jt=D&&!Dt&&!jt;return typeof l=="object"?{...l,enabled:Jt}:{enabled:Jt}}}),Jlt=_.createContext(null),NK="button",Qlt="Draggable";function ect(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=av(Qlt),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=_.useContext(KC),{role:g=NK,roleDescription:y="draggable",tabIndex:b=0}=i??{},v=l?.id===t,S=_.useContext(v?Lle:Jlt),[C,w]=wS(),[A,E]=wS(),D=Llt(s,t),O=tb(n);yc(()=>(f.set(t,{id:t,key:o,node:C,activatorNode:A,data:O}),()=>{const I=f.get(t);I&&I.key===o&&f.delete(t)}),[f,t]);const T=_.useMemo(()=>({role:g,tabIndex:b,"aria-disabled":r,"aria-pressed":v&&g===NK?!0:void 0,"aria-roledescription":y,"aria-describedby":u.draggable}),[r,g,b,v,y,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:v,listeners:r?void 0:D,node:C,over:h,setNodeRef:w,setActivatorNodeRef:E,transform:S}}function tct(){return _.useContext($le)}const nct="Droppable",rct={timeout:25};function ict(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=av(nct),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=_.useContext(KC),u=_.useRef({disabled:n}),f=_.useRef(!1),h=_.useRef(null),g=_.useRef(null),{disabled:y,updateMeasurementsFor:b,timeout:v}={...rct,...i},S=tb(b??r),C=_.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(S.current)?S.current:[S.current]),g.current=null},v)},[v]),w=GC({callback:C,disabled:y||!s}),A=_.useCallback((T,I)=>{w&&(I&&(w.unobserve(I),f.current=!1),T&&w.observe(T))},[w]),[E,D]=wS(A),O=tb(t);return _.useEffect(()=>{!w||!E.current||(w.disconnect(),f.current=!1,w.observe(E.current))},[E,w]),_.useEffect(()=>(a({type:Li.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:h,data:O}}),()=>a({type:Li.UnregisterDroppable,key:o,id:r})),[r]),_.useEffect(()=>{n!==u.current.disabled&&(a({type:Li.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:h,isOver:l?.id===r,node:E,over:l,setNodeRef:D}}function _I(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function oct(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function A5(e){return e!==null&&e>=0}function sct(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function act(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Nle=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=_I(t,r,n),s=t[i],a=o[i];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},k5={scaleX:1,scaleY:1},lct=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:s}=e;const a=(t=o[n])!=null?t:r;if(!a)return null;if(i===n){const c=o[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...k5}:null}const l=cct(o,i,n);return i>n&&i<=s?{x:0,y:-a.height-l,...k5}:i<n&&i>=s?{x:0,y:a.height+l,...k5}:{x:0,y:0,...k5}};function cct(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const Fle="Sortable",Ble=qt.createContext({activeIndex:-1,containerId:Fle,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Nle,disabled:{draggable:!1,droppable:!1}});function uct(e){let{children:t,id:n,items:r,strategy:i=Nle,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=tct(),f=av(Fle,n),h=a.rect!==null,g=_.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),y=s!=null,b=s?g.indexOf(s.id):-1,v=c?g.indexOf(c.id):-1,S=_.useRef(g),C=!sct(g,S.current),w=v!==-1&&b===-1||C,A=act(o);yc(()=>{C&&y&&u(g)},[C,g,y,u]),_.useEffect(()=>{S.current=g},[g]);const E=_.useMemo(()=>({activeIndex:b,containerId:f,disabled:A,disableTransforms:w,items:g,overIndex:v,useDragOverlay:h,sortedRects:oct(g,l),strategy:i}),[b,f,A.draggable,A.droppable,w,g,v,l,h,i]);return qt.createElement(Ble.Provider,{value:E},t)}const dct=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return _I(n,r,i).indexOf(t)},fct=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==o&&i===s?!1:n?!0:s!==i&&t===l},hct={duration:200,easing:"ease"},zle="transform",pct=rb.Transition.toString({property:zle,duration:0,easing:"linear"}),mct={roleDescription:"sortable"};function gct(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,s]=_.useState(null),a=_.useRef(n);return yc(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const c=pg(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,i]),_.useEffect(()=>{o&&s(null)},[o]),o}function yct(e){let{animateLayoutChanges:t=fct,attributes:n,disabled:r,data:i,getNewIndex:o=dct,id:s,strategy:a,resizeObserverConfig:l,transition:c=hct}=e;const{items:u,containerId:f,activeIndex:h,disabled:g,disableTransforms:y,sortedRects:b,overIndex:v,useDragOverlay:S,strategy:C}=_.useContext(Ble),w=bct(r,g),A=u.indexOf(s),E=_.useMemo(()=>({sortable:{containerId:f,index:A,items:u},...i}),[f,i,A,u]),D=_.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:O,node:T,isOver:I,setNodeRef:N}=ict({id:s,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...l}}),{active:$,activatorEvent:R,activeNodeRect:F,attributes:j,setNodeRef:z,listeners:L,isDragging:q,over:V,setActivatorNodeRef:U,transform:K}=ect({id:s,data:E,attributes:{...mct,...n},disabled:w.draggable}),B=jat(N,z),W=!!$,X=W&&!y&&A5(h)&&A5(v),H=!S&&q,Y=H&&X?K:null,ne=X?Y??(a??C)({rects:b,activeNodeRect:F,activeIndex:h,overIndex:v,index:A}):null,ee=A5(h)&&A5(v)?o({id:s,items:u,activeIndex:h,overIndex:v}):A,se=$?.id,ue=_.useRef({activeId:se,items:u,newIndex:ee,containerId:f}),te=u!==ue.current.items,Z=t({active:$,containerId:f,isDragging:q,isSorting:W,id:s,index:A,items:u,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:c,wasDragging:ue.current.activeId!=null}),re=gct({disabled:!Z,index:A,node:T,rect:O});return _.useEffect(()=>{W&&ue.current.newIndex!==ee&&(ue.current.newIndex=ee),f!==ue.current.containerId&&(ue.current.containerId=f),u!==ue.current.items&&(ue.current.items=u)},[W,ee,f,u]),_.useEffect(()=>{if(se===ue.current.activeId)return;if(se!=null&&ue.current.activeId==null){ue.current.activeId=se;return}const fe=setTimeout(()=>{ue.current.activeId=se},50);return()=>clearTimeout(fe)},[se]),{active:$,activeIndex:h,attributes:j,data:E,rect:O,index:A,newIndex:ee,items:u,isOver:I,isSorting:W,isDragging:q,listeners:L,node:T,overIndex:v,over:V,setNodeRef:B,setActivatorNodeRef:U,setDroppableNodeRef:N,setDraggableNodeRef:z,transform:re??ne,transition:oe()};function oe(){if(re||te&&ue.current.newIndex===A)return pct;if(!(H&&!wI(R)||!c)&&(W||Z))return rb.Transition.toString({...c,property:zle})}}function bct(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function AS(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const vct=[Ln.Down,Ln.Right,Ln.Up,Ln.Left],xct=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(vct.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=i.get(f.id);if(h)switch(e.code){case Ln.Down:r.top<h.top&&l.push(f);break;case Ln.Up:r.top>h.top&&l.push(f);break;case Ln.Left:r.left>h.left&&l.push(f);break;case Ln.Right:r.left<h.left&&l.push(f);break}});const c=Jat({collisionRect:r,droppableRects:i,droppableContainers:l});let u=Ale(c,"id");if(u===s?.id&&c.length>1&&(u=c[1].id),u!=null){const f=o.get(n.id),h=o.get(u),g=h?i.get(h.id):null,y=h?.node.current;if(y&&g&&f&&h){const v=qC(y).some((D,O)=>a[O]!==D),S=Hle(f,h),C=Sct(f,h),w=v||!S?{x:0,y:0}:{x:C?r.width-g.width:0,y:C?r.height-g.height:0},A={x:g.left,y:g.top};return w.x&&w.y?A:nb(A,w)}}}};function Hle(e,t){return!AS(e)||!AS(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Sct(e,t){return!AS(e)||!AS(t)||!Hle(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const wct=({bridge:e,index:t})=>{const{attributes:n,listeners:r,setNodeRef:i,transform:o,transition:s,isDragging:a}=yct({id:e.id}),[l,c]=_.useState(!1);_.useEffect(()=>{_w(e.id).then(c)},[e.id]);const u={transform:rb.Transform.toString(o),transition:s,opacity:a?.5:1};return m.jsx(tr,{ref:i,style:u,variant:"outlined",sx:{cursor:"grab","&:active":{cursor:"grabbing"},bgcolor:a?"action.selected":"background.paper",width:"fit-content"},children:m.jsxs(gr,{sx:{display:"flex",alignItems:"center",gap:1.5,py:1,"&:last-child":{pb:1}},children:[m.jsx(ce,{...n,...r,sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:m.jsx(QCe,{})}),m.jsx(Et,{label:t+1,size:"small",color:"primary",sx:{minWidth:32,fontWeight:"bold"}}),l?m.jsx(ce,{component:"img",src:t2(e.id),alt:e.name,sx:{width:40,height:40,borderRadius:"50%",objectFit:"cover",boxShadow:2}}):m.jsx(rl,{sx:{bgcolor:MT(e),width:40,height:40,boxShadow:2},children:(()=>{const f=TT(e);return m.jsx(f,{sx:{fontSize:24}})})()}),m.jsxs(ce,{sx:{flex:1},children:[m.jsx(ie,{variant:"subtitle1",fontWeight:500,children:e.name}),m.jsxs(ie,{variant:"caption",color:"text.secondary",children:["Port: ",e.port," • Priority: ",e.priority??100]})]})]})})},Cct=()=>{const e=Tu(),{content:t,isLoading:n}=Vm(),r=SCe(),[i,o]=_.useState([]),[s,a]=_.useState(!1);_.useEffect(()=>{if(t){const h=[...t].sort((g,y)=>{const b=g.priority??100,v=y.priority??100;return b-v});o(h),a(!1)}},[t]);const l=Yat(kK(kI),kK(EI,{coordinateGetter:xct})),c=_.useCallback(h=>{const{active:g,over:y}=h;y&&g.id!==y.id&&(o(b=>{const v=b.findIndex(C=>C.id===g.id),S=b.findIndex(C=>C.id===y.id);return _I(b,v,S)}),a(!0))},[]),u=_.useCallback(async()=>{const h=i.map((g,y)=>({id:g.id,priority:(y+1)*10}));try{await r(h),e.show({message:"Startup order saved successfully",severity:"success"}),a(!1)}catch(g){e.show({message:g instanceof Error?g.message:"Failed to save startup order",severity:"error"})}},[i,r,e]),f=_.useMemo(()=>i.map(h=>h.id),[i]);return n?m.jsx(ie,{children:"Loading..."}):m.jsxs(zt,{spacing:3,children:[m.jsx(lw,{items:[{name:"Bridges",to:Pt.bridges},{name:"Startup Order",to:Pt.startup}]}),m.jsxs(ce,{display:"flex",alignItems:"center",gap:2,children:[m.jsx(yb,{color:"primary",fontSize:"large"}),m.jsxs(ce,{children:[m.jsx(ie,{variant:"h5",fontWeight:600,children:"Startup Order"}),m.jsx(ie,{variant:"body2",color:"text.secondary",children:"Drag and drop bridges to set the startup order. Lower positions start first."})]})]}),s&&m.jsx(vn,{severity:"info",action:m.jsx(kt,{color:"inherit",size:"small",startIcon:m.jsx(n6,{}),onClick:u,children:"Save Changes"}),children:"You have unsaved changes to the startup order."}),m.jsx(Zlt,{sensors:l,collisionDetection:Zat,onDragEnd:c,children:m.jsx(uct,{items:f,strategy:lct,children:m.jsx(zt,{spacing:1,children:i.map((h,g)=>m.jsx(wct,{bridge:h,index:g},h.id))})})}),i.length===0&&m.jsx(ie,{color:"text.secondary",textAlign:"center",py:4,children:"No bridges configured yet."}),s&&i.length>0&&m.jsx(ce,{display:"flex",justifyContent:"flex-end",children:m.jsx(kt,{variant:"contained",startIcon:m.jsx(n6,{}),onClick:u,children:"Save Startup Order"})})]})},QA="https://riddix.github.io/home-assistant-matter-hub",Pt={dashboard:"/",bridges:"/bridges",bridge:e=>`/bridges/${e}`,createBridge:"/bridges/create",editBridge:e=>`/bridges/${e}/edit`,devices:"/devices",networkMap:"/network-map",health:"/health",labels:"/labels",lockCredentials:"/lock-credentials",settings:"/settings",startup:"/startup",githubRepository:"https://github.com/riddix/home-assistant-matter-hub/",documentation:QA,faq:{multiFabric:`${QA}/connect-multiple-fabrics`,bridgeConfig:`${QA}/bridge-configuration`}},Ect=[{path:"",element:m.jsx(_2e,{}),children:[{path:"",element:m.jsx(u9e,{})},{path:Pt.bridges,element:m.jsx(a9e,{})},{path:Pt.createBridge,element:m.jsx(JQe,{})},{path:Pt.bridge(":bridgeId"),element:m.jsx(ICe,{})},{path:Pt.editBridge(":bridgeId"),element:m.jsx(QQe,{})},{path:Pt.devices,element:m.jsx(D9e,{})},{path:Pt.networkMap,element:m.jsx(Tat,{})},{path:Pt.health,element:m.jsx(aet,{})},{path:Pt.labels,element:m.jsx(fet,{})},{path:Pt.lockCredentials,element:m.jsx(bet,{})},{path:Pt.settings,element:m.jsx(Pat,{})},{path:Pt.startup,element:m.jsx(Cct,{})},{path:"*",element:m.jsx(vet,{})}]}],Act={items:{isInitialized:!1,isLoading:!1}},kct=FO(Act,e=>{e.addCase(Bo.pending,t=>{t.items.isLoading=!0}).addCase(Bo.rejected,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=void 0,t.items.error=n.error}).addCase(Bo.fulfilled,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(zX.fulfilled,(t,n)=>{t.items.content?.push(n.payload)}).addCase(UX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(VX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(HX.fulfilled,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.meta.arg);r!==-1&&t.items.content.splice(r,1)}}).addCase(WX,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(qX,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.payload.id);r!==-1?t.items.content[r]=n.payload:t.items.content.push(n.payload)}})}),_ct={byBridge:{}},Dct=FO(_ct,e=>{e.addCase(du.pending,(t,n)=>{t.byBridge[n.meta.arg]=ek(t.byBridge[n.meta.arg],n)}).addCase(du.rejected,(t,n)=>{t.byBridge[n.meta.arg]=ek(t.byBridge[n.meta.arg],n)}).addCase(du.fulfilled,(t,n)=>{t.byBridge[n.meta.arg]=ek(t.byBridge[n.meta.arg],n)})}),Oct={isInitialized:!1,isLoading:!1,content:void 0,error:void 0},ek=FO(Oct,e=>{e.addCase(du.pending,t=>{t.isLoading=!0}).addCase(du.rejected,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=void 0,t.error=n.error}).addCase(du.fulfilled,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=n.payload,t.error=void 0})}),Tct=l2e({reducer:{bridges:kct,devices:Dct}}),DI=Wme({createStyledComponent:me("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${ye(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>it({props:e,name:"MuiContainer"})});function Mct(e){return Qe("MuiToolbar",e)}tt("MuiToolbar",["root","gutters","regular","dense"]);const Rct=e=>{const{classes:t,disableGutters:n,variant:r}=e;return et({root:["root",!n&&"gutters",r]},Mct,t)},Ict=me("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Ge(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),Ule=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=Rct(c);return m.jsx(Ict,{as:o,className:Te(u.root,i),ref:n,ownerState:c,...l})});class Pct extends _.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught:",t,n.componentStack)}render(){return this.state.hasError?m.jsxs(ce,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",gap:2,p:4,children:[m.jsx(KO,{color:"error",sx:{fontSize:64}}),m.jsx(ie,{variant:"h5",fontWeight:600,children:"Something went wrong"}),m.jsx(ie,{variant:"body2",color:"text.secondary",textAlign:"center",maxWidth:480,children:this.state.error?.message??"An unexpected error occurred."}),m.jsx(kt,{variant:"contained",onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},children:"Reload Page"})]}):this.props.children}}const jct=[{name:"GitHub",url:Pt.githubRepository},{name:"Documentation",url:Pt.documentation}],$ct=()=>m.jsxs(DI,{sx:{mt:16,mb:4},children:[m.jsx(gi,{sx:{mt:4,mb:4}}),m.jsx(dt,{container:!0,spacing:2,justifyContent:"center",children:jct.map((e,t)=>m.jsx(dt,{size:{xs:12,sm:"auto"},children:m.jsx(kt,{fullWidth:!0,size:"small",variant:"outlined",component:aw,href:e.url,target:"_blank",children:e.name})},t.toString()))})]});function Lct(e){return Qe("MuiAppBar",e)}tt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Nct=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${ye(t)}`,`position${ye(n)}`]};return et(i,Lct,r)},FK=(e,t)=>e?`${e.replace(")","")}, ${t})`:t,Fct=me(Ur,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${ye(n.position)}`],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit",color:"var(--AppBar-color)"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(Fn(["contrastText"])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:t=>t.enableColorOnDark===!0&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>t.enableColorOnDark===!1&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?FK(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?FK(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}))),Bct=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=Nct(c);return m.jsx(Fct,{square:!0,component:"header",ownerState:c,elevation:4,className:Te(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function zct(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=tl(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const c=o.getComputedStyle(t);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:e==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function Hct(e){return typeof e=="function"?e():e}function _5(e,t,n){const r=Hct(n),i=zct(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const Uct=_.forwardRef(function(t,n){const r=ro(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:h,onEnter:g,onEntered:y,onEntering:b,onExit:v,onExited:S,onExiting:C,style:w,timeout:A=o,TransitionComponent:E=Ta,...D}=t,O=_.useRef(null),T=Tr(gf(l),O,n),I=V=>U=>{V&&(U===void 0?V(O.current):V(O.current,U))},N=I((V,U)=>{_5(u,V,c),IO(V),g&&g(V,U)}),$=I((V,U)=>{const K=Kd({timeout:A,style:w,easing:f},{mode:"enter"});V.style.webkitTransition=r.transitions.create("-webkit-transform",{...K}),V.style.transition=r.transitions.create("transform",{...K}),V.style.webkitTransform="none",V.style.transform="none",b&&b(V,U)}),R=I(y),F=I(C),j=I(V=>{const U=Kd({timeout:A,style:w,easing:f},{mode:"exit"});V.style.webkitTransition=r.transitions.create("-webkit-transform",U),V.style.transition=r.transitions.create("transform",U),_5(u,V,c),v&&v(V)}),z=I(V=>{V.style.webkitTransition="",V.style.transition="",S&&S(V)}),L=V=>{s&&s(O.current,V)},q=_.useCallback(()=>{O.current&&_5(u,O.current,c)},[u,c]);return _.useEffect(()=>{if(h||u==="down"||u==="right")return;const V=OO(()=>{O.current&&_5(u,O.current,c)}),U=tl(O.current);return U.addEventListener("resize",V),()=>{V.clear(),U.removeEventListener("resize",V)}},[u,h,c]),_.useEffect(()=>{h||q()},[h,q]),m.jsx(E,{nodeRef:O,onEnter:N,onEntered:R,onEntering:$,onExit:j,onExited:z,onExiting:F,addEndListener:L,appear:a,in:h,timeout:A,...D,children:(V,{ownerState:U,...K})=>_.cloneElement(l,{ref:T,style:{visibility:V==="exited"&&!h?"hidden":void 0,...w,...l.props.style},...K})})});function Vct(e){return Qe("MuiDrawer",e)}tt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const Vle=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,n.variant==="temporary"&&t.modal]},Wct=e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${ye(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${ye(n)}`,r!=="temporary"&&`paperAnchorDocked${ye(n)}`]};return et(i,Vct,t)},qct=me(ZO,{name:"MuiDrawer",slot:"Root",overridesResolver:Vle})(Ge(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Gct=me("div",{shouldForwardProp:io,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:Vle})({flex:"0 0 auto"}),Kct=me(Ur,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${ye(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${ye(n.anchor)}`]]}})(Ge(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),Wle={left:"right",right:"left",top:"down",bottom:"up"};function Yct(e){return["left","right"].includes(e)}function Xct({direction:e},t){return e==="rtl"&&Yct(t)?Wle[t]:t}const Zct=_.forwardRef(function(t,n){const r=it({props:t,name:"MuiDrawer"}),i=ro(),o=mf(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:l,children:c,className:u,elevation:f=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:g,...y}={},onClose:b,open:v=!1,PaperProps:S={},SlideProps:C,TransitionComponent:w,transitionDuration:A=s,variant:E="temporary",slots:D={},slotProps:O={},...T}=r,I=_.useRef(!1);_.useEffect(()=>{I.current=!0},[]);const N=Xct({direction:o?"rtl":"ltr"},a),R={...r,anchor:a,elevation:f,open:v,variant:E,...T},F=Wct(R),j={slots:{transition:w,...D},slotProps:{paper:S,transition:C,...O,backdrop:TO(O.backdrop||{...l,...g},{transitionDuration:A})}},[z,L]=lt("root",{ref:n,elementType:qct,className:Te(F.root,F.modal,u),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...j,...T,...y},additionalProps:{open:v,onClose:b,hideBackdrop:h,slots:{backdrop:j.slots.backdrop},slotProps:{backdrop:j.slotProps.backdrop}}}),[q,V]=lt("paper",{elementType:Kct,shouldForwardComponentProp:!0,className:Te(F.paper,S.className),ownerState:R,externalForwardedProps:j,additionalProps:{elevation:E==="temporary"?f:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[U,K]=lt("docked",{elementType:Gct,ref:n,className:Te(F.root,F.docked,u),ownerState:R,externalForwardedProps:j,additionalProps:T}),[B,W]=lt("transition",{elementType:Uct,ownerState:R,externalForwardedProps:j,additionalProps:{in:v,direction:Wle[N],timeout:A,appear:I.current}}),X=m.jsx(q,{...V,children:c});if(E==="permanent")return m.jsx(U,{...K,children:X});const H=m.jsx(B,{...W,children:X});return E==="persistent"?m.jsx(U,{...K,children:H}):m.jsx(z,{...L,children:H})}),Jct=XY({themeId:da}),Qct={error:vf,warn:iw,info:YO,debug:Aw},eut=({open:e,onClose:t})=>{const n=ro(),r=_.useMemo(()=>({error:n.palette.error.main,warn:n.palette.warning.main,info:n.palette.info.main,debug:n.palette.secondary.main}),[n]),[i,o]=_.useState([]),[s,a]=_.useState(!0),[l,c]=_.useState("error,warn,info".split(",")),[u,f]=_.useState(""),[h,g]=_.useState(!0),y=_.useCallback(async()=>{try{const w=new URLSearchParams({level:l.join(","),limit:"500",...u&&{search:u}}),A=await fetch(`api/logs?${w}`);if(A.ok){const E=await A.json();o(E.entries)}}catch(w){console.error("Failed to fetch logs:",w)}finally{a(!1)}},[l,u]);_.useEffect(()=>{e&&y()},[e,y]),_.useEffect(()=>{if(!h||!e)return;const w=setInterval(y,5e3);return()=>clearInterval(w)},[h,e,y]);const b=w=>{c(Array.isArray(w.target.value)?w.target.value:[w.target.value])},v=w=>{f(w.target.value)},S=async()=>{try{await fetch("api/logs",{method:"DELETE"}),o([])}catch(w){console.error("Failed to clear logs:",w)}},C=w=>{const A=Qct[w]||YO;return m.jsx(A,{sx:{fontSize:16,color:r[w]}})};return m.jsxs(vu,{open:e,onClose:t,maxWidth:"lg",fullWidth:!0,children:[m.jsxs(Su,{sx:{display:"flex",alignItems:"center",gap:1},children:[m.jsx(Aw,{}),"System Logs",m.jsx(ce,{sx:{flexGrow:1}}),m.jsx(cn,{title:"Auto Refresh",children:m.jsx(Et,{label:h?"Auto":"Manual",color:h?"success":"default",size:"small",onClick:()=>g(!h),sx:{cursor:"pointer"}})}),m.jsx(_n,{onClick:t,children:m.jsx(qCe,{})})]}),m.jsxs(xu,{children:[m.jsx(zt,{spacing:2,sx:{mb:2},children:m.jsxs(zt,{direction:"row",spacing:2,alignItems:"center",children:[m.jsxs(pa,{size:"small",sx:{minWidth:200},children:[m.jsx(sc,{children:"Log Level"}),m.jsxs(sa,{value:l,label:"Log Level",onChange:b,multiple:!0,renderValue:w=>m.jsx(ce,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(Array.isArray(w)?w:[w]).map(A=>m.jsx(Et,{label:A.toUpperCase(),size:"small",sx:{backgroundColor:r[A],color:"white"}},A))}),children:[m.jsx(er,{value:"error",children:"Error"}),m.jsx(er,{value:"warn",children:"Warning"}),m.jsx(er,{value:"info",children:"Info"}),m.jsx(er,{value:"debug",children:"Debug"})]})]}),m.jsx(Lr,{size:"small",placeholder:"Search logs...",value:u,onChange:v,sx:{flexGrow:1}}),m.jsx(kt,{variant:"outlined",onClick:y,children:"Refresh"}),m.jsx(kt,{variant:"outlined",color:"error",onClick:S,children:"Clear"})]})}),m.jsx(ce,{sx:{height:400,overflow:"auto",backgroundColor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1},children:s?m.jsx(ce,{sx:{display:"flex",justifyContent:"center",p:4},children:m.jsx(ie,{children:"Loading logs..."})}):i.length===0?m.jsx(ce,{sx:{display:"flex",justifyContent:"center",p:4},children:m.jsx(ie,{color:"text.secondary",children:"No logs found"})}):m.jsx(zt,{spacing:1,children:i.map((w,A)=>m.jsxs(ce,{sx:{p:1,borderRadius:1,backgroundColor:"action.hover",fontFamily:"monospace",fontSize:"0.875rem",wordBreak:"break-all"},children:[m.jsxs(ce,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[C(w.level),m.jsx(ie,{variant:"caption",color:"text.secondary",children:new Date(w.timestamp).toLocaleString()}),m.jsx(Et,{label:w.level.toUpperCase(),size:"small",sx:{backgroundColor:r[w.level],color:n.palette.getContrastText(r[w.level]??n.palette.grey[500]),fontSize:"0.7rem",height:20}})]}),m.jsx(ie,{sx:{ml:3},children:w.message}),w.context&&m.jsx(ie,{sx:{ml:3,color:"text.secondary",fontSize:"0.8rem"},children:JSON.stringify(w.context,null,2)})]},`${w.timestamp}-${w.level}-${A}`))})})]}),m.jsx(Xd,{children:m.jsx(kt,{onClick:t,children:"Close"})})]})};function BK(){const{isConnected:e}=A2e(),[t,n]=_.useState(null),[r,i]=_.useState(!1);_.useEffect(()=>{const y=async()=>{try{const v=await fetch("api/health");if(v.ok){const S=await v.json();n(S),i(!1)}else i(!0)}catch{i(!0)}};y();const b=setInterval(y,3e4);return()=>clearInterval(b)},[]);const o=y=>{const b=Math.floor(y/3600),v=Math.floor(y%3600/60);return b>0?`${b}h ${v}m`:`${v}m`},s=t?.status==="healthy"&&!r,a=t?.services?.bridges,l=a&&a.total>0&&a.running===a.total,c=a&&a.total===0,u=t?m.jsxs(ce,{sx:{p:.5},children:[m.jsxs("div",{children:[m.jsx("strong",{children:"Version:"})," ",t.version??"Unknown"]}),m.jsxs("div",{children:[m.jsx("strong",{children:"Uptime:"})," ",o(t.uptime??0)]}),t.services?.bridges&&m.jsxs("div",{children:[m.jsx("strong",{children:"Bridges:"})," ",t.services.bridges.running??0,"/",t.services.bridges.total??0," running",(t.services.bridges.stopped??0)>0&&` (${t.services.bridges.stopped} stopped)`]}),t.services?.homeAssistant&&m.jsxs("div",{children:[m.jsx("strong",{children:"Home Assistant:"})," ",t.services.homeAssistant.connected?"Connected":"Disconnected"]}),m.jsxs("div",{children:[m.jsx("strong",{children:"WebSocket:"})," ",e?"Connected":"Disconnected"]})]}):"Loading health status...",f=()=>r||!s?m.jsx(vf,{fontSize:"small"}):l?m.jsx(Mu,{fontSize:"small"}):m.jsx(dw,{fontSize:"small"}),h=()=>r||!s?"error":!l||!e?"warning":"success",g=()=>r?"Error":s?e?c?"No Bridges":l?"Online":"Starting":"Offline":"Unhealthy";return m.jsx(cn,{title:u,arrow:!0,children:m.jsx(Et,{icon:f(),label:g(),color:h(),size:"small",variant:"filled",sx:{borderRadius:1,fontWeight:600,"& .MuiChip-icon":{color:"inherit"}}})})}const tut=e=>_.createElement("svg",{viewBox:"0 0 91 89",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{style:{display:"inline"}},_.createElement("path",{style:{fill:"#18bcf2",fillOpacity:1,strokeWidth:.266194},d:"m 49.149143,1.473171 38.513568,38.536435 c 0,0 1.248354,1.186052 2.207681,3.092371 0.959329,1.906323 1.10864,4.600698 1.10864,4.600698 v 36.786372 c 0,0 -0.01549,1.748506 -1.49842,3.050572 -1.482931,1.302064 -3.333077,1.362947 -3.333077,1.362947 l -81.325658,7.7e-5 c 0,0 -1.7523855,-0.0091 -3.17112,-1.352526 C -0.07808495,85.913164 0.05953025,84.487808 0.05953025,84.487808 V 47.704546 c 0,0 -0.0018381,-2.218618 0.95921785,-4.315832 0.9610554,-2.097209 2.3010618,-3.355005 2.3010618,-3.355005 L 41.545959,1.4719546 c 0,0 1.465224,-1.46837077 3.753488,-1.46837077 2.288268,0 3.849696,1.46958717 3.849696,1.46958717 z"}),_.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:.175841},d:"m 31.689717,32.051124 c 2.813363,2.331095 6.157331,3.89845 9.721813,4.556421 V 17.180647 l 3.873694,-2.282955 3.870527,2.282955 V 36.60772 c 3.565364,-0.658847 6.910387,-2.226204 9.725159,-4.556417 l 7.032345,4.154609 c -11.437354,11.557779 -29.852321,11.557779 -41.290025,0 z m 8.546732,49.60988 C 44.314996,65.760441 35.09933,49.470196 19.574984,45.139543 v 8.312381 c 3.383916,1.32244 6.386113,3.496288 8.728705,6.320026 L 11.83076,69.485301 v 4.56907 l 3.873697,2.270836 16.469936,-9.713534 c 1.224356,3.48294 1.56683,7.225375 0.996449,10.879778 z M 70.977694,45.139543 c -15.515726,4.34014 -24.72189,20.626696 -20.643519,36.521461 l 7.047658,-4.15742 c -0.569325,-3.654411 -0.2265,-7.3965 0.996449,-10.87979 l 16.457611,9.701233 3.870711,-2.283125 v -4.55677 L 62.233673,59.77195 c 2.342772,-2.822684 5.34497,-4.996533 8.728708,-6.320026 z"}))),nut="home-assistant-matter-hub",rut={name:nut};function iut(){const[e,t]=_.useState("2.1.0-alpha.432");return _.useEffect(()=>{fetch("api/health").then(n=>n.ok?n.json():null).then(n=>{n?.version&&t(n.version)}).catch(()=>{})},[]),_.useMemo(()=>({name:rut.name,version:e}),[e])}const out=e=>{const t=iut();return m.jsxs(ce,{component:Du,to:Pt.dashboard,sx:{display:"flex",alignItems:"center",justifyContent:e.large?"flex-start":"center",flexGrow:1,textDecoration:"none",color:"inherit"},children:[m.jsx(tut,{style:{height:"40px"}}),m.jsx(ie,{variant:"inherit",component:"span",sx:{mr:1,ml:1},children:t.name.split("-").map(ye).join("-")}),e.large&&m.jsx(ie,{variant:"caption",component:"span",children:t.version})]})},sut=()=>{const e=Jct("(min-width:600px)"),{mode:t,setMode:n}=KS(),[r,i]=_.useState(!1),[o,s]=_.useState(!1),a=hf(),l=()=>{n(t==="dark"?"light":"dark")},c=[{label:"Dashboard",icon:m.jsx(CT,{}),to:Pt.dashboard},{label:"Bridges",icon:m.jsx(t6,{}),to:Pt.bridges},{label:"All Devices",icon:m.jsx(Fs,{}),to:Pt.devices},{label:"Network Map",icon:m.jsx(bT,{}),to:Pt.networkMap},{label:"Startup Order",icon:m.jsx(yb,{}),to:Pt.startup},{label:"Lock Credentials",icon:m.jsx(uu,{}),to:Pt.lockCredentials},{label:"Filter Reference",icon:m.jsx(ET,{}),to:Pt.labels},{label:"Settings",icon:m.jsx(wb,{}),to:Pt.settings},{label:t==="dark"?"Light Mode":"Dark Mode",icon:t==="dark"?m.jsx(a8e,{}):m.jsx(YCe,{}),onClick:l},{label:"System Logs",icon:m.jsx(Aw,{}),onClick:()=>i(!0)},{label:"Health Dashboard",icon:m.jsx(QO,{}),to:Pt.health}],u=f=>{s(!1),f.onClick?f.onClick():f.to&&a(f.to)};return m.jsxs(ce,{children:[m.jsx(Bct,{sx:{height:"72px"},children:m.jsx(Ule,{sx:{paddingLeft:"0 !important",paddingRight:"0 !important"},children:m.jsxs(DI,{sx:{padding:2,height:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[m.jsx(out,{large:e}),e?m.jsxs(ce,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.map(f=>f.to?m.jsx(cn,{title:f.label,children:m.jsx(_n,{component:Du,to:f.to,sx:{color:"inherit"},children:f.icon})},f.label):m.jsx(cn,{title:f.label,children:m.jsx(_n,{onClick:f.onClick,sx:{color:"inherit"},children:f.icon})},f.label)),m.jsx(BK,{})]}):m.jsxs(ce,{sx:{display:"flex",alignItems:"center",gap:.5},children:[m.jsx(BK,{}),m.jsx(_n,{onClick:()=>s(!0),sx:{color:"inherit"},children:m.jsx(l8e,{})})]})]})})}),m.jsx(Zct,{anchor:"right",open:o,onClose:()=>s(!1),children:m.jsx(bc,{sx:{width:250},children:c.map(f=>m.jsxs(obe,{onClick:()=>u(f),children:[m.jsx(Ul,{children:f.icon}),m.jsx(Va,{primary:f.label})]},f.label))})}),m.jsx(eut,{open:r,onClose:()=>i(!1)})]})},aut=()=>m.jsxs(ce,{children:[m.jsx(sut,{}),m.jsx(Ule,{}),m.jsx(DI,{sx:{p:2},children:m.jsx(Pct,{children:m.jsx(yY,{})})}),m.jsx($ct,{})]}),lut=WS({colorSchemes:{light:{palette:{primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2"},background:{default:"#f5f5f5",paper:"#ffffff"}}},dark:{palette:{primary:{main:"#90caf9",light:"#e3f2fd",dark:"#42a5f5"},secondary:{main:"#ce93d8",light:"#f3e5f5",dark:"#ab47bc"},background:{default:"#121212",paper:"#1e1e1e"}}}},typography:{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',h1:{fontSize:"2.5rem",fontWeight:500},h2:{fontSize:"2rem",fontWeight:500},h3:{fontSize:"1.75rem",fontWeight:500},h4:{fontSize:"1.5rem",fontWeight:500},h5:{fontSize:"1.25rem",fontWeight:500},h6:{fontSize:"1rem",fontWeight:500}},shape:{borderRadius:8},components:{MuiCard:{styleOverrides:{root:{transition:"transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 20px rgba(0,0,0,0.12)"}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500}}},MuiChip:{styleOverrides:{root:{fontWeight:500}}},MuiAppBar:{styleOverrides:{root:{backgroundImage:"none"}}}}});let _4=document.getElementsByTagName("base")[0]?.href?.replace(/\/$/,"");_4?.startsWith("http")&&(_4=new URL(_4).pathname);const cut=Hhe([{path:"/",element:m.jsx(aut,{}),children:Ect}],{basename:_4});sde.createRoot(document.getElementById("root")).render(m.jsx(_.StrictMode,{children:m.jsx(Cde,{store:Tct,children:m.jsxs(n1e,{theme:lut,children:[m.jsx(Zge,{}),m.jsx(dX,{styles:{".rjsf-field-array > .MuiFormControl-root > .MuiPaper-root > .MuiBox-root > .MuiGrid-root > .MuiGrid-root:has(> .MuiBox-root > .MuiPaper-root > .MuiBox-root > .rjsf-field)":{overflow:"initial !important",flexGrow:1}}}),m.jsx(k2e,{children:m.jsx(yye,{children:m.jsx(epe,{router:cut})})})]})})}));