maidr 3.18.3 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maidr.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(Ar){typeof define=="function"&&define.amd?define(Ar):Ar()})(function(){"use strict";var Qoe=Object.defineProperty;var foe=(Ar,S4,H1)=>S4 in Ar?Qoe(Ar,S4,{enumerable:!0,configurable:!0,writable:!0,value:H1}):Ar[S4]=H1;var ae=(Ar,S4,H1)=>foe(Ar,typeof S4!="symbol"?S4+"":S4,H1);function Ar(e,t){for(var n=0;n<t.length;n++){const l=t[n];if(typeof l!="string"&&!Array.isArray(l)){for(const o in l)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(l,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>l[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var S4=(e=>(e.CLICK="click",e.DOM_LOADED="DOMContentLoaded",e.FOCUS_IN="focusin",e.FOCUS_OUT="focusout",e.SELECTION_CHANGE="selectionchange",e))(S4||{}),H1=(e=>(e.BRAILLE="BRAILLE",e.CHAT="CHAT",e.HELP="HELP",e.FIGURE_LABEL="FIGURE_LABEL",e.SUBPLOT="SUBPLOT",e.TRACE="TRACE",e.TRACE_LABEL="TRACE_LABEL",e.REVIEW="REVIEW",e.SETTINGS="SETTINGS",e))(H1||{});class Ms{constructor(){ae(this,"listeners");ae(this,"event",t=>(this.listeners.add(t),{dispose:()=>this.listeners.delete(t)}));this.listeners=new Set}dispose(){this.listeners.clear()}fire(t){for(const n of this.listeners)n(t)}}class xe{constructor(){}}ae(xe,"ARTICLE","article"),ae(xe,"DIV","div"),ae(xe,"FIGURE","figure"),ae(xe,"IMAGE","img"),ae(xe,"INPUT","input"),ae(xe,"TEXT_AREA","textarea"),ae(xe,"BRAILLE_TEXT_AREA","maidr-braille-textarea"),ae(xe,"MAIDR_ARTICLE","maidr-article"),ae(xe,"MAIDR_FIGURE","maidr-figure"),ae(xe,"MAIDR_HIGHLIGHT","maidr-highlight"),ae(xe,"REACT_CONTAINER","maidr-react-container"),ae(xe,"REVIEW_INPUT","maidr-review-input"),ae(xe,"TEXT_CONTAINER","maidr-text-container"),ae(xe,"ARIA_LABEL","aria-label"),ae(xe,"CIRCLE_X","cx"),ae(xe,"CIRCLE_Y","cy"),ae(xe,"D","d"),ae(xe,"FILL","fill"),ae(xe,"POINTS","points"),ae(xe,"RADIUS","r"),ae(xe,"ROLE","role"),ae(xe,"STROKE","stroke"),ae(xe,"STROKE_WIDTH","stroke-width"),ae(xe,"TITLE","title"),ae(xe,"VISIBILITY","visibility"),ae(xe,"X1","x1"),ae(xe,"X2","x2"),ae(xe,"Y1","y1"),ae(xe,"Y2","y2"),ae(xe,"MAIDR_SUBPLOT","subplot"),ae(xe,"AFTER_END","afterend"),ae(xe,"APPLICATION","application"),ae(xe,"ARE"," are "),ae(xe,"CIRCLE","circle"),ae(xe,"CLOSE_BRACKET","]"),ae(xe,"COMMA",","),ae(xe,"COMMA_SPACE",", "),ae(xe,"EMPTY",""),ae(xe,"HIDDEN","hidden"),ae(xe,"IS"," is "),ae(xe,"LINE","line"),ae(xe,"MAIDR_DATA","maidr-data"),ae(xe,"MAIDR_HIGHLIGHT_COLOR","#BADA55"),ae(xe,"NEW_LINE",`
2
- `),ae(xe,"OPEN_BRACKET","["),ae(xe,"POLYLINE","polyline"),ae(xe,"SPACE"," "),ae(xe,"THROUGH"," through "),ae(xe,"TRANSPARENT","transparent"),ae(xe,"VISIBLE","visible"),ae(xe,"X","x"),ae(xe,"Y","y"),ae(xe,"HIGHLIGHT_BASE_COLOR",{r:255,g:255,b:255}),ae(xe,"HIGHLIGHT_CONTRAST_RATIO",3),ae(xe,"HIGHLIGHT_COLOR_RATIO",.6),ae(xe,"HIGHLIGHT_MAX_COLOR",255);let pv=class{constructor(){ae(this,"items");this.items=new Array}push(t){this.items.push(t)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}removeLast(t,n=1){const l=this.items.lastIndexOf(t);return l!==-1?(this.items.splice(l,n),!0):!1}isEmpty(){return this.items.length===0}size(){return this.items.length}clear(){this.items.length=0}};const mv=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function yv(e,t,n,l){e.addEventListener?e.addEventListener(t,n,l):e.attachEvent&&e.attachEvent("on".concat(t),n)}function _c(e,t,n,l){e.removeEventListener?e.removeEventListener(t,n,l):e.detachEvent&&e.detachEvent("on".concat(t),n)}function WH(e,t){const n=t.slice(0,t.length-1);for(let l=0;l<n.length;l++)n[l]=e[n[l].toLowerCase()];return n}function YH(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function HI(e,t){const n=e.length>=t.length?e:t,l=e.length>=t.length?t:e;let o=!0;for(let a=0;a<n.length;a++)l.indexOf(n[a])===-1&&(o=!1);return o}const Oc={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":mv?173:189,"=":mv?61:187,";":mv?59:186,"'":222,"[":219,"]":221,"\\":220},c5={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Cc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},_3={16:!1,18:!1,17:!1,91:!1},b2={};for(let e=1;e<20;e++)Oc["f".concat(e)]=111+e;let p2=[],wc=null,KH="all";const wi=new Map,Vc=e=>Oc[e.toLowerCase()]||c5[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),SI=e=>Object.keys(Oc).find(t=>Oc[t]===e),EI=e=>Object.keys(c5).find(t=>c5[t]===e);function JH(e){KH=e||"all"}function Dc(){return KH||"all"}function MI(){return p2.slice(0)}function AI(){return p2.map(e=>SI(e)||EI(e)||String.fromCharCode(e))}function _I(){const e=[];return Object.keys(b2).forEach(t=>{b2[t].forEach(n=>{let{key:l,scope:o,mods:a,shortcut:i}=n;e.push({scope:o,shortcut:i,mods:a,keys:l.split("+").map(s=>Vc(s))})})}),e}function OI(e){const t=e.target||e.srcElement,{tagName:n}=t;let l=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(l=!1),l}function CI(e){return typeof e=="string"&&(e=Vc(e)),p2.indexOf(e)!==-1}function wI(e,t){let n,l;e||(e=Dc());for(const o in b2)if(Object.prototype.hasOwnProperty.call(b2,o))for(n=b2[o],l=0;l<n.length;)n[l].scope===e?n.splice(l,1).forEach(i=>{let{element:s}=i;return gv(s)}):l++;Dc()===e&&JH(t||"all")}function VI(e){let t=e.keyCode||e.which||e.charCode;const n=p2.indexOf(t);if(n>=0&&p2.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&p2.splice(0,p2.length),(t===93||t===224)&&(t=91),t in _3){_3[t]=!1;for(const l in c5)c5[l]===t&&(q3[l]=!1)}}function eS(e){if(typeof e>"u")Object.keys(b2).forEach(o=>{Array.isArray(b2[o])&&b2[o].forEach(a=>Ep(a)),delete b2[o]}),gv(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&Ep(o)});else if(typeof e=="object")e.key&&Ep(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];let[o,a]=n;typeof o=="function"&&(a=o,o=""),Ep({key:e,scope:o,method:a,splitKey:"+"})}}const Ep=e=>{let{key:t,scope:n,method:l,splitKey:o="+"}=e;YH(t).forEach(i=>{const s=i.split(o),c=s.length,u=s[c-1],Q=u==="*"?"*":Vc(u);if(!b2[Q])return;n||(n=Dc());const f=c>1?WH(c5,s):[],h=[];b2[Q]=b2[Q].filter(p=>{const v=(l?p.method===l:!0)&&p.scope===n&&HI(p.mods,f);return v&&h.push(p.element),!v}),h.forEach(p=>gv(p))})};function tS(e,t,n,l){if(t.element!==l)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const a in _3)Object.prototype.hasOwnProperty.call(_3,a)&&(!_3[a]&&t.mods.indexOf(+a)>-1||_3[a]&&t.mods.indexOf(+a)===-1)&&(o=!1);(t.mods.length===0&&!_3[16]&&!_3[18]&&!_3[17]&&!_3[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(p2),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function nS(e,t){const n=b2["*"];let l=e.keyCode||e.which||e.charCode;if(!q3.filter.call(this,e))return;if((l===93||l===224)&&(l=91),p2.indexOf(l)===-1&&l!==229&&p2.push(l),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const c=Cc[s];e[s]&&p2.indexOf(c)===-1?p2.push(c):!e[s]&&p2.indexOf(c)>-1?p2.splice(p2.indexOf(c),1):s==="metaKey"&&e[s]&&(p2=p2.filter(u=>u in Cc||u===l))}),l in _3){_3[l]=!0;for(const s in c5)if(Object.prototype.hasOwnProperty.call(c5,s)){const c=Cc[c5[s]];q3[s]=e[c]}if(!n)return}for(const s in _3)Object.prototype.hasOwnProperty.call(_3,s)&&(_3[s]=e[Cc[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(p2.indexOf(17)===-1&&p2.push(17),p2.indexOf(18)===-1&&p2.push(18),_3[17]=!0,_3[18]=!0);const o=Dc();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&tS(e,n[s],o,t);if(!(l in b2))return;const a=b2[l],i=a.length;for(let s=0;s<i;s++)if((e.type==="keydown"&&a[s].keydown||e.type==="keyup"&&a[s].keyup)&&a[s].key){const c=a[s],{splitKey:u}=c,Q=c.key.split(u),f=[];for(let h=0;h<Q.length;h++)f.push(Vc(Q[h]));f.sort().join("")===p2.sort().join("")&&tS(e,c,o,t)}}function q3(e,t,n){p2=[];const l=YH(e);let o=[],a="all",i=document,s=0,c=!1,u=!0,Q="+",f=!1,h=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(i=t.element),t.keyup&&(c=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(Q=t.splitKey),t.single===!0&&(h=!0)),typeof t=="string"&&(a=t),h&&eS(e,a);s<l.length;s++)e=l[s].split(Q),o=[],e.length>1&&(o=WH(c5,e)),e=e[e.length-1],e=e==="*"?"*":Vc(e),e in b2||(b2[e]=[]),b2[e].push({keyup:c,keydown:u,scope:a,mods:o,shortcut:l[s],method:n,key:l[s],splitKey:Q,element:i});if(typeof i<"u"&&window){if(!wi.has(i)){const p=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return nS(v,i)},g=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;nS(v,i),VI(v)};wi.set(i,{keydownListener:p,keyupListenr:g,capture:f}),yv(i,"keydown",p,f),yv(i,"keyup",g,f)}if(!wc){const p=()=>{p2=[]};wc={listener:p,capture:f},yv(window,"focus",p,f)}}}function DI(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(b2).forEach(n=>{b2[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function gv(e){const t=Object.values(b2).flat();if(t.findIndex(l=>{let{element:o}=l;return o===e})<0){const{keydownListener:l,keyupListenr:o,capture:a}=wi.get(e)||{};l&&o&&(_c(e,"keyup",o,a),_c(e,"keydown",l,a),wi.delete(e))}if((t.length<=0||wi.size<=0)&&(Object.keys(wi).forEach(o=>{const{keydownListener:a,keyupListenr:i,capture:s}=wi.get(o)||{};a&&i&&(_c(o,"keyup",i,s),_c(o,"keydown",a,s),wi.delete(o))}),wi.clear(),Object.keys(b2).forEach(o=>delete b2[o]),wc)){const{listener:o,capture:a}=wc;_c(window,"focus",o,a),wc=null}}const vv={getPressedKeyString:AI,setScope:JH,getScope:Dc,deleteScope:wI,getPressedKeyCodes:MI,getAllKeyCodes:_I,isPressed:CI,filter:OI,trigger:DI,unbind:eS,keyMap:Oc,modifier:c5,modifierMap:Cc};for(const e in vv)Object.prototype.hasOwnProperty.call(vv,e)&&(q3[e]=vv[e]);if(typeof window<"u"){const e=window.hotkeys;q3.noConflict=t=>(t&&window.hotkeys===q3&&(window.hotkeys=e),q3),window.hotkeys=q3}class RI{constructor(t){ae(this,"id");ae(this,"instructionContext");ae(this,"plotContext");ae(this,"scopeContext");this.id=t.id,this.plotContext=new pv,this.scopeContext=new pv;const n=t.state;if(n.empty||n.size!==1){this.instructionContext=t,this.plotContext.push(t),this.scopeContext.push(H1.SUBPLOT);return}this.scopeContext.push(H1.TRACE);const l=t.activeSubplot.state;if(l.empty||l.size!==1){this.instructionContext=t.activeSubplot,this.plotContext.push(t.activeSubplot),this.plotContext.push(t.activeSubplot.activeTrace);return}this.instructionContext=t.activeSubplot.activeTrace,this.plotContext.push(t.activeSubplot.activeTrace)}dispose(){this.plotContext.clear(),this.scopeContext.clear()}get active(){return this.plotContext.peek()}get state(){return this.active.state}toggleScope(t){this.scopeContext.removeLast(t)||this.scopeContext.push(t),q3.setScope(this.scope)}get scope(){return this.scopeContext.peek()}isMovable(t){return this.active.isMovable(t)}moveOnce(t){this.active.moveOnce(t)}moveToExtreme(t){this.active.moveToExtreme(t)}moveToIndex(t,n){this.active.moveToIndex(t,n)}stepTrace(t){if(this.plotContext.size()>1){this.plotContext.pop();const n=this.active,o=n.activeTrace.getCurrentXValue();n.moveOnce(t);const a=n.activeTrace;this.plotContext.push(a),a.moveToXValue(o)}}enterSubplot(){if(this.active.state.type==="figure"){const n=this.active;this.plotContext.push(n.activeSubplot),this.active.notifyStateUpdate(),this.plotContext.push(n.activeSubplot.activeTrace),this.toggleScope(H1.TRACE)}}exitSubplot(){this.plotContext.size()>2&&(this.plotContext.pop(),this.plotContext.pop(),this.active.notifyStateUpdate(),this.toggleScope(H1.TRACE))}getInstruction(t){const n=this.instructionContext.state;if(n.empty)return`No ${n.type} info available`;const l=t?"Click to activate.":xe.EMPTY;switch(n.type){case"figure":return`This is a maidr figure containing ${n.size} subplots. ${l} Use arrow keys to navigate subplots and press 'ENTER'.`;case"subplot":return`This is a maidr plot containing ${n.size} layers, and this is layer 1 of ${n.size}: ${n.trace.traceType} plot. ${l} Use Arrows to navigate data points. Toggle B for Braille, T for Text, S for Sonification, and R for Review mode.`;case"trace":return`This is a maidr plot of type: ${n.plotType}. ${l} Use Arrows to navigate data points. Toggle B for Braille, T for Text, S for Sonification, and R for Review mode.`}}}var B2=(e=>(e.VERTICAL="vert",e.HORIZONTAL="horz",e))(B2||{}),P2=(e=>(e.BAR="bar",e.BOX="box",e.CANDLESTICK="candlestick",e.DODGED="dodged_bar",e.HEATMAP="heat",e.HISTOGRAM="hist",e.LINE="line",e.NORMALIZED="stacked_normalized_bar",e.SCATTER="point",e.SMOOTH="smooth",e.STACKED="stacked_bar",e))(P2||{});function kI(e){return e!==null&&typeof e=="object"&&"x"in e}function NI(e){return typeof e=="string"||typeof e=="number"}function BI(e){return e!==null&&typeof e=="object"&&"x"in e}class rS{computeIndexAndSegment(t,n,l,o){return l===B2.HORIZONTAL?{pointIndex:t,segmentType:o[n]}:{pointIndex:n,segmentType:o[t]}}computeVisualCoordinates(t,n,l){return l===B2.HORIZONTAL?{row:t,col:n}:{row:n,col:t}}extractXValueFromPoints(t,n,l){if(Array.isArray(t)&&t.length===1&&Array.isArray(t[0])){const o=t[0][l];return this.extractXFromPoint(o)}if(Array.isArray(t)&&Array.isArray(t[n])&&t[n][l]){const o=t[n][l];return this.extractXFromPoint(o)}return null}extractXValueFromValues(t,n,l){if(this.isValidPosition(t,n,l)){const o=t[n][l];return this.extractXFromValue(o)}return null}moveToXValueInPoints(t,n,l){if(Array.isArray(t)&&t.length===1&&Array.isArray(t[0])){const c=this.findPointIndexByX(t[0],n);if(c!==-1)return l(0,c),!0;{const u=this.findNearestPointIndexByX(t[0],n);if(u!==-1){const Q=_r(t[0][u]);if(typeof n=="number"&&typeof Q=="number")return l(0,u),!0;if(typeof n=="string"&&typeof Q=="string")return l(0,u),!0}}}let o=-1,a=-1,i=Number.POSITIVE_INFINITY,s=null;if(Array.isArray(t))for(let c=0;c<t.length;c++){const u=t[c];if(Array.isArray(u)){const Q=this.findPointIndexByX(u,n);if(Q!==-1)return l(c,Q),!0;const f=this.findNearestPointIndexByX(u,n);if(f!==-1){const h=_r(u[f]);let p=Number.POSITIVE_INFINITY;typeof n=="number"&&typeof h=="number"?(p=Math.abs(h-n),p<i&&(i=p,o=c,a=f,s="numeric")):typeof n=="string"&&typeof h=="string"?o===-1&&(o=c,a=f,s="categorical"):o===-1&&(o=c,a=f,s="generic")}}}if(o!==-1&&a!==-1){const c=t[o];if(Array.isArray(c)&&_r(c[a]),s!==null)return l(o,a),!0}return!1}moveToXValueInValues(t,n,l){let o=-1,a=-1,i=Number.POSITIVE_INFINITY,s=null;for(let c=0;c<t.length;c++)for(let u=0;u<t[c].length;u++){const Q=t[c][u],f=this.extractXFromValue(Q);if(f===n)return l(c,u),!0;if(typeof n=="number"&&typeof f=="number"){const h=Math.abs(f-n);h<i&&(i=h,o=c,a=u,s="numeric")}else typeof n=="string"&&typeof f=="string"?o===-1&&(o=c,a=u,s="categorical"):o===-1&&(o=c,a=u,s="generic")}return o!==-1&&a!==-1?(this.extractXFromValue(t[o][a]),l(o,a),!0):!1}extractXFromPoint(t){return BI(t)?t.x:null}extractXFromValue(t){return kI(t)?t.x:NI(t)?t:null}findPointIndexByX(t,n){return t.findIndex(l=>l.x===n)}isValidPosition(t,n,l){return n>=0&&n<t.length&&l>=0&&l<t[n].length}findNearestPointIndexByX(t,n){if(typeof n=="number"){let l=-1,o=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){const i=_r(t[a]);if(typeof i=="number"){const s=Math.abs(i-n);s<o&&(o=s,l=a)}else if(typeof i=="string"){const s=Number(i);if(!Number.isNaN(s)){const c=Math.abs(s-n);c<o&&(o=c,l=a)}}}if(l!==-1)return _r(t[l]),l}else if(typeof n=="string"){for(let o=0;o<t.length;o++)if(_r(t[o])===n)return o;const l=Number(n);if(!Number.isNaN(l)){let o=-1,a=Number.POSITIVE_INFINITY;for(let i=0;i<t.length;i++){const s=_r(t[i]);if(typeof s=="number"){const c=Math.abs(s-l);c<a&&(a=c,o=i)}else if(typeof s=="string"){const c=Number(s);if(!Number.isNaN(c)){const u=Math.abs(c-l);u<a&&(a=u,o=i)}}}if(o!==-1)return _r(t[o]),o}for(let o=0;o<t.length;o++)if(typeof _r(t[o])=="string")return o}return t.length>0?(_r(t[0]),0):-1}dispose(){}}function PI(e){return e&&typeof e=="object"&&"x"in e&&"y"in e}function II(e){return e&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}function jI(e){return e&&typeof e=="object"&&"xMin"in e&&"xMax"in e}function FI(e){return e&&typeof e=="object"&&"x"in e&&"y"in e}function zI(e){return e&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}function qI(e){return e&&typeof e=="object"&&"value"in e}function _r(e){return e?PI(e)||II(e)||FI(e)||zI(e)||jI(e)?e.x:qI(e)?e.value:null:null}const $I="unavailable",UI="X",GI="Y",ZI="unavailable";class Lv{constructor(){ae(this,"observers");ae(this,"isInitialEntry");ae(this,"isOutOfBounds");ae(this,"row");ae(this,"col");this.observers=new Array,this.isInitialEntry=!0,this.isOutOfBounds=!1,this.row=0,this.col=0}dispose(){for(const t of this.observers)this.removeObserver(t);this.observers.length=0}moveOnce(t){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(t)){this.notifyOutOfBounds();return}switch(t){case"UPWARD":this.row+=1;break;case"DOWNWARD":this.row-=1;break;case"FORWARD":this.col+=1;break;case"BACKWARD":this.col-=1;break}this.notifyStateUpdate()}getSafeIndices(){var o;const t=this.values,n=this.row>=0&&this.row<t.length?this.row:0,l=this.col>=0&&this.col<(((o=t[n])==null?void 0:o.length)||0)?this.col:0;return{row:n,col:l}}moveToExtreme(t){var n;switch(this.isInitialEntry&&this.handleInitialEntry(),t){case"UPWARD":this.row=this.values.length-1;break;case"DOWNWARD":this.row=0;break;case"FORWARD":{const{row:l}=this.getSafeIndices();this.col=(n=this.values[l])!=null&&n.length?this.values[l].length-1:0;break}case"BACKWARD":this.col=0;break}this.notifyStateUpdate()}moveToIndex(t,n){this.isMovable([t,n])&&(this.row=t,this.col=n,this.isInitialEntry=!1,this.notifyStateUpdate())}isMovable(t){var n,l;if(Array.isArray(t)){const[o,a]=t,{row:i}=this.getSafeIndices();return o>=0&&o<this.values.length&&a>=0&&a<(((n=this.values[i])==null?void 0:n.length)||0)}switch(t){case"UPWARD":return this.row<this.values.length-1;case"DOWNWARD":return this.row>0;case"FORWARD":{const{row:o}=this.getSafeIndices();return this.col<(((l=this.values[o])==null?void 0:l.length)||0)-1}case"BACKWARD":return this.col>0}}handleInitialEntry(){var n;this.isInitialEntry=!1,this.row=Math.max(0,Math.min(this.row,this.values.length-1));const{row:t}=this.getSafeIndices();this.col=Math.max(0,Math.min(this.col,(((n=this.values[t])==null?void 0:n.length)||0)-1))}addObserver(t){this.observers.push(t)}removeObserver(t){this.observers=this.observers.filter(n=>n!==t)}notifyStateUpdate(){const t=this.state;for(const n of this.observers)n.update(t)}notifyOutOfBounds(){this.isOutOfBounds=!0,this.notifyStateUpdate(),this.isOutOfBounds=!1}}class As extends Lv{constructor(n){var l,o,a;super();ae(this,"id");ae(this,"type");ae(this,"title");ae(this,"xAxis");ae(this,"yAxis");ae(this,"fill");ae(this,"navigationService");this.navigationService=new rS,this.id=n.id,this.type=n.type,this.title=n.title??$I,this.xAxis=((l=n.axes)==null?void 0:l.x)??UI,this.yAxis=((o=n.axes)==null?void 0:o.y)??GI,this.fill=((a=n.axes)==null?void 0:a.fill)??ZI}dispose(){this.values.length=0,this.highlightValues&&(this.highlightValues.forEach(n=>n.forEach(l=>{(Array.isArray(l)?l:[l]).forEach(a=>a.remove())})),this.highlightValues.length=0),super.dispose()}get state(){var n;if(this.isOutOfBounds){const{row:l,col:o}=this.getSafeIndices(),a=this.values;return{empty:!0,type:"trace",traceType:this.type,audio:{size:((n=a[l])==null?void 0:n.length)||0,index:o}}}return{empty:!1,type:"trace",traceType:this.type,plotType:this.type,title:this.title,xAxis:this.xAxis,yAxis:this.yAxis,fill:this.fill,hasMultiPoints:this.hasMultiPoints(),audio:this.audio(),braille:this.braille(),text:this.text(),autoplay:this.autoplay,highlight:this.highlight()}}highlight(){var n;if(this.highlightValues===null||this.isInitialEntry){const{row:l,col:o}=this.getSafeIndices(),a=this.values;return{empty:!0,type:"trace",traceType:this.type,audio:{size:((n=a[l])==null?void 0:n.length)||0,index:o}}}return{empty:!1,elements:this.highlightValues[this.row][this.col]}}getAudioGroupIndex(){return this.values&&this.values.length>1?{groupIndex:this.row}:{}}get autoplay(){var o;const{row:n}=this.getSafeIndices(),l=((o=this.values[n])==null?void 0:o.length)||0;return{UPWARD:this.values.length,DOWNWARD:this.values.length,FORWARD:l,BACKWARD:l}}hasMultiPoints(){return!1}getCurrentXValue(){if(this.hasPointsArray()){const n=this.getPointsArray();if(this.isValidPointsArray(n))return this.navigationService.extractXValueFromPoints(n,this.row,this.col)}if(this.hasValuesArray()){const n=this.values;if(this.isValidValuesArray(n))return this.navigationService.extractXValueFromValues(n,this.row,this.col)}return null}moveToXValue(n){if(this.hasPointsArray()){const l=this.getPointsArray();if(this.isValidPointsArray(l))return this.navigationService.moveToXValueInPoints(l,n,this.moveToIndex.bind(this))}if(this.hasValuesArray()){const l=this.values;if(this.isValidValuesArray(l))return this.navigationService.moveToXValueInValues(l,n,this.moveToIndex.bind(this))}return!1}hasPointsArray(){return"points"in this&&this.points!==void 0}hasValuesArray(){return"values"in this&&this.values!==void 0}getPointsArray(){return this.points}isValidPointsArray(n){return Array.isArray(n)&&n.length>0}isValidValuesArray(n){return Array.isArray(n)&&n.length>0}}class $3{constructor(){}static safeMin(t){return t.length===0?1/0:Math.min(...t)}static safeMax(t){return t.length===0?-1/0:Math.max(...t)}static minFrom2D(t){const n=t.flat();return this.safeMin(n)}static maxFrom2D(t){const n=t.flat();return this.safeMax(n)}static minMax(t){if(t.length===0)return{min:1/0,max:-1/0};let n=t[0],l=t[0];for(let o=1;o<t.length;o++){const a=t[o];a<n&&(n=a),a>l&&(l=a)}return{min:n,max:l}}static minMaxFrom2D(t){const n=t.flat();return this.minMax(n)}}class Mp{constructor(){}static parse(t){const n=t.replace(/\s/g,"").toLowerCase();if(/^#(?:[a-f0-9]{3}){1,2}$/.test(n)){let o=n.substring(1).split("");return o.length===3&&(o=[o[0],o[0],o[1],o[1],o[2],o[2]]),{r:Number.parseInt(o[0]+o[1],16),g:Number.parseInt(o[2]+o[3],16),b:Number.parseInt(o[4]+o[5],16)}}const l=n.match(/^rgba?\((\d+),(\d+),(\d+)(?:,\d*(?:\.\d*)?)?\)$/);return l?{r:Number.parseInt(l[1],10),g:Number.parseInt(l[2],10),b:Number.parseInt(l[3],10)}:null}static invert(t){return{r:255-t.r,g:255-t.g,b:255-t.b}}static getContrastRatio(t,n){const l=this.calculateLuminance(t),o=this.calculateLuminance(n);return(Math.max(l,o)+.05)/(Math.min(l,o)+.05)}static calculateLuminance(t){const[n,l,o]=[t.r,t.g,t.b].map(a=>{const i=a/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*n+.7152*l+.0722*o}static rgbToString(t){return`rgb(${t.r}, ${t.g}, ${t.b})`}}class C1{constructor(){}static async toBase64(t){try{const n=new XMLSerializer().serializeToString(t).replace(/>\s+</g,"> <").replace(/\s{2,}/g," ").trim(),o=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n).replace(/'/g,"%27").replace(/"/g,"%22")}`,a=await new Promise((c,u)=>{const Q=new Image;Q.onload=()=>c(Q),Q.onerror=()=>u(new Error("Failed to load SVG image")),Q.src=o}),i=document.createElement("canvas");[i.width,i.height]=[a.naturalWidth,a.naturalHeight];const s=i.getContext("2d");return s?(s.drawImage(a,0,0),i.toDataURL("image/jpeg",.92)):(console.error("Error converting SVG to Base 64: Canvas context unavailable"),"")}catch(n){return console.error("Error converting SVG to Base 64:",n instanceof Error?n.message:n),""}}static selectAllElements(t,n=!0){return Array.from(document.querySelectorAll(t)).map(l=>{if(!n)return l;const o=l.cloneNode(!0);return o.setAttribute(xe.VISIBILITY,xe.HIDDEN),l.insertAdjacentElement(xe.AFTER_END,o),o})}static selectElement(t,n=!0){const l=document.querySelector(t);if(!n)return l;const o=l==null?void 0:l.cloneNode(!0);return o==null||o.setAttribute(xe.VISIBILITY,xe.HIDDEN),l==null||l.insertAdjacentElement(xe.AFTER_END,o),o}static createEmptyElement(t="rect"){const n=document.createElementNS(this.SVG_NAMESPACE,t);return n.setAttribute(xe.FILL,xe.TRANSPARENT),n.setAttribute(xe.STROKE,xe.TRANSPARENT),n.setAttribute(xe.VISIBILITY,xe.HIDDEN),n}static createCircleElement(t,n,l){var u;const o=window.getComputedStyle(l),a=o.stroke||o.fill,i=o.strokeWidth||"2",s=Number.parseFloat(i)*2,c=document.createElementNS(this.SVG_NAMESPACE,xe.CIRCLE);return c.setAttribute(xe.CIRCLE_X,String(t)),c.setAttribute(xe.CIRCLE_Y,String(n)),c.setAttribute(xe.RADIUS,String(s)),c.setAttribute(xe.FILL,a),c.setAttribute(xe.STROKE,a),c.setAttribute(xe.STROKE_WIDTH,i),c.setAttribute(xe.VISIBILITY,xe.HIDDEN),(u=l.parentElement)==null||u.insertAdjacentElement(xe.AFTER_END,c),c}static createLineElement(t,n){const o=t.getBBox();let a,i,s,c;switch(n){case"top":[a,i,s,c]=[o.x,o.y,o.x+o.width,o.y];break;case"bottom":[a,i,s,c]=[o.x,o.y+o.height,o.x+o.width,o.y+o.height];break;case"left":[a,i,s,c]=[o.x,o.y,o.x,o.y+o.height];break;case"right":[a,i,s,c]=[o.x+o.width,o.y,o.x+o.width,o.y+o.height];break}const u=window.getComputedStyle(t),Q=document.createElementNS(this.SVG_NAMESPACE,xe.LINE);return Q.setAttribute(xe.X1,String(a)),Q.setAttribute(xe.Y1,String(i)),Q.setAttribute(xe.X2,String(s)),Q.setAttribute(xe.Y2,String(c)),Q.setAttribute(xe.STROKE,u.stroke),Q.setAttribute(xe.STROKE_WIDTH,u.strokeWidth||"2"),Q.setAttribute(xe.VISIBILITY,xe.HIDDEN),t.insertAdjacentElement(xe.AFTER_END,Q),Q}static createHighlightElement(t,n){const l=t.cloneNode(!0),o=t.tagName.toLowerCase(),a=o===xe.POLYLINE||o===xe.LINE,i=a?window.getComputedStyle(t).getPropertyValue(xe.STROKE):window.getComputedStyle(t).getPropertyValue(xe.FILL),s=this.getHighlightColor(i,n);if(l.setAttribute(xe.VISIBILITY,xe.VISIBLE),l.setAttribute(xe.STROKE,s),l.setAttribute(xe.FILL,s),l.style.fill=s,l.style.stroke=s,a){const c=window.getComputedStyle(l).getPropertyValue(xe.STROKE_WIDTH);l.setAttribute(xe.STROKE_WIDTH,`${c+2}`)}return t.insertAdjacentElement(xe.AFTER_END,l),l}static getHighlightColor(t,n){const l=Mp.parse(t);if(!l||!(Mp.getContrastRatio(l,xe.HIGHLIGHT_BASE_COLOR)<xe.HIGHLIGHT_CONTRAST_RATIO))return n;const i={...l};return l.r===l.g&&l.g===l.b?(i.r=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.r*xe.HIGHLIGHT_COLOR_RATIO)),i.g=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.g*xe.HIGHLIGHT_COLOR_RATIO)),i.b=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.b*xe.HIGHLIGHT_COLOR_RATIO))):l.r>=l.g&&l.r>=l.b?i.r=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.r*xe.HIGHLIGHT_COLOR_RATIO)):l.g>=l.r&&l.g>=l.b?i.g=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.g*xe.HIGHLIGHT_COLOR_RATIO)):i.b=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.b*xe.HIGHLIGHT_COLOR_RATIO)),Mp.rgbToString(i)}static getContrastingColorForElement(t){const n=window.getComputedStyle(t).fill||"rgb(255,255,255)",l=Mp.parse(n);return l?(.2126*l.r+.7152*l.g+.0722*l.b)/255>.5?"#000":"#fff":"#000"}static setSubplotHighlightCss(t,n){t.style.outline=`4px solid ${n}`,t.style.outlineOffset="3px",t.style.borderRadius="3px",t.style.overflow="visible"}static removeSubplotHighlightCss(t){t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"),t.style.removeProperty("border-radius"),t.style.removeProperty("overflow")}static setSubplotHighlightSvgWithAdaptiveColor(t,n,l){const o=t.querySelector("rect, path");let a="";if(o){a=window.getComputedStyle(o).getPropertyValue("fill"),(!a||a==="none"||a==="transparent"||a==="rgba(0, 0, 0, 0)")&&(l?a=window.getComputedStyle(l).getPropertyValue("fill"):a=n);const i=this.getHighlightColor(a,n);o.setAttribute("stroke",i),o.setAttribute("stroke-width","4")}}static removeSubplotHighlightSvg(t){const n=t.querySelector("rect, path");n&&(n.removeAttribute("stroke"),n.removeAttribute("stroke-width"))}}ae(C1,"SVG_NAMESPACE","http://www.w3.org/2000/svg");class xv extends As{constructor(n,l){super(n);ae(this,"points");ae(this,"barValues");ae(this,"highlightValues");ae(this,"orientation");ae(this,"min");ae(this,"max");this.points=l,this.orientation=n.orientation??B2.VERTICAL,this.barValues=l.map(o=>o.map(a=>this.orientation===B2.VERTICAL?Number(a.y):Number(a.x))),this.min=this.barValues.map(o=>$3.safeMin(o)),this.max=this.barValues.map(o=>$3.safeMax(o)),this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.points.length=0,this.min.length=0,this.max.length=0,super.dispose()}get values(){return this.barValues}audio(){const n=this.orientation===B2.VERTICAL,l=n?this.barValues[this.row].length:this.barValues.length,o=n?this.col:this.row,a=n?this.barValues[this.row][this.col]:this.barValues[this.col][this.row];return{min:$3.safeMin(this.min),max:$3.safeMax(this.max),size:l,index:o,value:a,...this.getAudioGroupIndex()}}braille(){return{empty:!1,id:this.id,values:this.barValues,min:this.min,max:this.max,row:this.row,col:this.col}}text(){const n=this.orientation===B2.VERTICAL,l=this.points[this.row][this.col],o=n?this.xAxis:this.yAxis,a=n?l.x:l.y,i=n?this.yAxis:this.xAxis,s=n?l.y:l.x;return{main:{label:o,value:a},cross:{label:i,value:s}}}mapToSvgElements(n){if(!n)return null;const l=[C1.selectAllElements(n)];if(l.length!==this.points.length)return null;for(let o=0;o<this.points.length;o++)if(l[o].length!==this.points[o].length)return null;return l}}class XI extends xv{constructor(t){super(t,[t.data])}}const WI="Lower outlier(s)",YI="Upper outlier(s)",KI="Minimum",JI="Maximum",ej="25%",tj="50%",nj="75%";class rj extends As{constructor(n){super(n);ae(this,"points");ae(this,"boxValues");ae(this,"highlightValues");ae(this,"orientation");ae(this,"sections");ae(this,"min");ae(this,"max");this.points=n.data,this.orientation=n.orientation??B2.VERTICAL,this.sections=[WI,KI,ej,tj,nj,JI,YI];const l=[a=>a.lowerOutliers,a=>a.min,a=>a.q1,a=>a.q2,a=>a.q3,a=>a.max,a=>a.upperOutliers];this.orientation===B2.HORIZONTAL?this.boxValues=this.points.map(a=>l.map(i=>i(a))):this.boxValues=l.map(a=>this.points.map(i=>a(i)));const o=this.boxValues.map(a=>a.flatMap(i=>Array.isArray(i)?i:[i]));this.min=$3.minFrom2D(o),this.max=$3.maxFrom2D(o),this.row=this.boxValues.length-1,this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.points.length=0,this.sections.length=0,super.dispose()}moveToIndex(n,l){const o=this.orientation===B2.HORIZONTAL;n=o?n:l,l=o?l:n,super.moveToIndex(n,l)}get values(){return this.boxValues}audio(){const n=this.boxValues[this.row][this.col],l=Array.isArray(n)?n.map(o=>o-this.min):n-this.min;return{min:this.min,max:this.max,value:n,size:this.max-this.min,index:l}}braille(){const n=this.orientation===B2.HORIZONTAL,l=n?this.row:this.col,o=n?this.col:this.row;return{empty:!1,id:this.id,values:this.points,min:this.min,max:this.max,row:l,col:o}}text(){const n=this.orientation===B2.HORIZONTAL,l=n?this.points[this.row]:this.points[this.col],o=n?this.yAxis:this.xAxis,a=n?this.sections[this.col]:this.sections[this.row],i=n?this.xAxis:this.yAxis,s=this.boxValues[this.row][this.col];return{main:{label:o,value:l.fill},cross:{label:i,value:s},section:a}}mapToSvgElements(n){if(!n||n.length!==this.points.length)return null;const l=this.orientation===B2.VERTICAL,o=new Array;if(l)for(let a=0;a<this.sections.length;a++)o.push(Array.from({length:n.length}));return n.forEach((a,i)=>{const s=a.lowerOutliers.flatMap(b=>C1.selectAllElements(b)),c=a.upperOutliers.flatMap(b=>C1.selectAllElements(b)),u=C1.selectElement(a.min)??C1.createEmptyElement(),Q=C1.selectElement(a.max)??C1.createEmptyElement(),f=C1.selectElement(a.iq)??C1.createEmptyElement(),h=C1.selectElement(a.q2)??C1.createEmptyElement(),[p,g]=l?[C1.createLineElement(f,"top"),C1.createLineElement(f,"bottom")]:[C1.createLineElement(f,"left"),C1.createLineElement(f,"right")],v=[s,u,p,h,g,Q,c];l?v.forEach((b,L)=>{o[L][i]=b}):o.push(v)}),o}}const ij="Trend";class aj extends As{constructor(n){super(n);ae(this,"candles");ae(this,"candleValues");ae(this,"orientation");ae(this,"sections",["open","high","low","close"]);ae(this,"currentSegmentType","open");ae(this,"currentPointIndex",0);ae(this,"sortedSegmentsByPoint");ae(this,"segmentPositionMaps");ae(this,"min");ae(this,"max");ae(this,"highlightValues");ae(this,"navigationService");this.navigationService=new rS;const l=n.data;this.candles=l.map(a=>({...a,trend:a.close>a.open?"Bull":a.close<a.open?"Bear":"Neutral"})),this.orientation=n.orientation??B2.VERTICAL,this.candleValues=this.sections.map(a=>this.candles.map(i=>i[a])),this.min=$3.minFrom2D(this.candleValues),this.max=$3.maxFrom2D(this.candleValues),this.sortedSegmentsByPoint=this.precomputeSortedSegments(),this.segmentPositionMaps=this.precomputePositionMaps(),this.currentPointIndex=0,this.currentSegmentType="open",this.orientation===B2.HORIZONTAL?this.col=0:this.row=0;const o=typeof n.selectors=="string"?n.selectors:"";this.highlightValues=this.mapToSvgElements(o)}precomputeSortedSegments(){return this.candles.map(n=>this.sections.map(o=>[o,n[o]]).sort((o,a)=>o[1]-a[1]).map(o=>o[0]))}precomputePositionMaps(){return this.sortedSegmentsByPoint.map(n=>{const l=new Map;return n.forEach((o,a)=>{l.set(o,a)}),l})}getSegmentPositionInSortedOrder(n,l){return this.segmentPositionMaps[n].get(l)??0}getSegmentTypeAtSortedPosition(n,l){return this.sortedSegmentsByPoint[n][l]??"open"}updateVisualSegmentPosition(){const n=this.getSegmentPositionInSortedOrder(this.currentPointIndex,this.currentSegmentType);this.orientation===B2.HORIZONTAL?this.col=n:this.row=n}updateVisualPointPosition(){this.orientation===B2.HORIZONTAL?this.row=this.currentPointIndex:this.col=this.currentPointIndex}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}switch(n){case"UPWARD":case"DOWNWARD":{const l=this.getSegmentPositionInSortedOrder(this.currentPointIndex,this.currentSegmentType),o=n==="UPWARD"?l+1:l-1;if(o>=0&&o<this.sections.length)this.currentSegmentType=this.getSegmentTypeAtSortedPosition(this.currentPointIndex,o),this.updateVisualSegmentPosition();else{this.notifyOutOfBounds();return}break}case"FORWARD":case"BACKWARD":{const l=n==="FORWARD"?this.currentPointIndex+1:this.currentPointIndex-1;if(l>=0&&l<this.candles.length)this.currentPointIndex=l,this.updateVisualPointPosition(),this.updateVisualSegmentPosition();else{this.notifyOutOfBounds();return}break}}this.notifyStateUpdate()}moveToExtreme(n){switch(this.isInitialEntry&&this.handleInitialEntry(),n){case"UPWARD":{const l=this.sortedSegmentsByPoint[this.currentPointIndex];this.currentSegmentType=l[l.length-1],this.updateVisualSegmentPosition();break}case"DOWNWARD":{const l=this.sortedSegmentsByPoint[this.currentPointIndex];this.currentSegmentType=l[0],this.updateVisualSegmentPosition();break}case"FORWARD":{this.currentPointIndex=this.candles.length-1,this.updateVisualPointPosition(),this.updateVisualSegmentPosition();break}case"BACKWARD":{this.currentPointIndex=0,this.updateVisualPointPosition(),this.updateVisualSegmentPosition();break}}this.notifyStateUpdate()}moveToIndex(n,l){this.isInitialEntry&&this.handleInitialEntry();const{pointIndex:o,segmentType:a}=this.navigationService.computeIndexAndSegment(n,l,this.orientation,this.sections);this.currentPointIndex=o,this.currentSegmentType=a,this.row=n,this.col=l,this.updateVisualSegmentPosition(),this.updateVisualPointPosition(),this.notifyStateUpdate()}isMovable(n){if(Array.isArray(n))return super.isMovable(n);if(this.isInitialEntry)return!0;switch(n){case"UPWARD":case"DOWNWARD":{const l=this.getSegmentPositionInSortedOrder(this.currentPointIndex,this.currentSegmentType),o=n==="UPWARD"?l+1:l-1;return o>=0&&o<this.sections.length}case"FORWARD":case"BACKWARD":{const l=n==="FORWARD"?this.currentPointIndex+1:this.currentPointIndex-1;return l>=0&&l<this.candles.length}}}dispose(){this.navigationService.dispose(),this.candles.length=0,super.dispose()}get values(){return this.candleValues}audio(){const n=this.candles[this.currentPointIndex][this.currentSegmentType];return{min:this.min,max:this.max,size:this.candles.length,index:this.currentPointIndex,value:n,trend:this.candles[this.currentPointIndex].trend}}braille(){const n=this.candles.map(l=>l.trend);return{empty:!1,id:this.id,values:this.candleValues,min:this.min,max:this.max,row:this.row,col:this.col,custom:n}}mapToSvgElements(n){if(!n)return null;const l=C1.selectAllElements(n),o=[];for(let a=0;a<this.sections.length;a++){o[a]=[];for(let i=0;i<this.candles.length;i++){const s=i<l.length?i:0;o[a][i]=l[s]}}return o}text(){const n=this.candles[this.currentPointIndex],l=n[this.currentSegmentType];return{main:{label:this.orientation===B2.HORIZONTAL?this.yAxis:this.xAxis,value:n.value},cross:{label:this.orientation===B2.HORIZONTAL?this.xAxis:this.yAxis,value:l},section:this.currentSegmentType,fill:{label:ij,value:n.trend}}}getCurrentTrend(){return this.candles[this.currentPointIndex].trend}getCurrentXValue(){return this.currentPointIndex>=0&&this.currentPointIndex<this.candles.length?this.candles[this.currentPointIndex].value:null}moveToXValue(n){const l=this.candles.findIndex(o=>o.value===n);return l!==-1?(this.currentPointIndex=l,this.currentSegmentType="open",this.updateVisualPointPosition(),this.updateVisualSegmentPosition(),this.notifyStateUpdate(),!0):!1}}class oj extends As{constructor(n){super(n);ae(this,"heatmapValues");ae(this,"highlightValues");ae(this,"x");ae(this,"y");ae(this,"min");ae(this,"max");const l=n.data;this.x=l.x,this.y=[...l.y].reverse(),this.heatmapValues=[...l.points].reverse();const{min:o,max:a}=$3.minMaxFrom2D(this.heatmapValues);this.min=o,this.max=a,this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.heatmapValues.length=0,this.x.length=0,this.y.length=0,super.dispose()}get values(){return this.heatmapValues}audio(){return{min:this.min,max:this.max,size:this.heatmapValues.length,index:this.col,value:this.heatmapValues[this.row][this.col]}}braille(){return{empty:!1,id:this.id,values:this.heatmapValues,min:this.min,max:this.max,row:this.row,col:this.col}}text(){return{main:{label:this.xAxis,value:this.x[this.col]},cross:{label:this.yAxis,value:this.y[this.row]},fill:{label:this.fill,value:String(this.heatmapValues[this.row][this.col])}}}mapToSvgElements(n){if(!n)return null;const l=this.heatmapValues.length,o=this.heatmapValues[0].length,a=C1.selectAllElements(n);if(a.length===0||a.length!==l*o)return null;const i=new Array;if(a[0]instanceof SVGPathElement)for(let s=0;s<l;s++){const c=l-1-s,u=new Array;for(let Q=0;Q<o;Q++){const f=c*o+Q;u.push(a[f])}i.push(u)}else if(a[0]instanceof SVGRectElement)for(let s=0;s<l;s++){const c=new Array;for(let u=0;u<o;u++){const Q=u*l+s;c.push(a[Q])}i.push(c)}return i}}class lj extends xv{constructor(t){super(t,[t.data])}text(){const t=this.orientation===B2.VERTICAL,n=this.points[this.row][this.col],l=t?n.xMin:n.yMin,o=t?n.xMax:n.yMax;return{...super.text(),range:{min:l,max:o}}}}const iS="Group",bv=/[ML]\s*(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)/g;class aS extends As{constructor(n){super(n);ae(this,"points");ae(this,"lineValues");ae(this,"highlightValues");ae(this,"min");ae(this,"max");ae(this,"previousRow",null);this.points=n.data,this.lineValues=this.points.map(l=>l.map(o=>Number(o.y))),this.min=this.lineValues.map(l=>$3.safeMin(l)),this.max=this.lineValues.map(l=>$3.safeMax(l)),this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.points.length=0,this.min.length=0,this.max.length=0,super.dispose()}get values(){return this.lineValues}audio(){return{min:this.min[this.row],max:this.max[this.row],size:this.points[this.row].length,index:this.col,value:this.points[this.row][this.col].y,...this.getAudioGroupIndex()}}braille(){return{empty:!1,id:this.id,values:this.lineValues,min:this.min,max:this.max,row:this.row,col:this.col}}text(){var a;const n=this.points[this.row][this.col],l=this.findIntersections();let o={};if(l.length>1){let i=l.map(s=>{var u;const c=s.groupIndex;return((u=this.points[c][0])==null?void 0:u.fill)||`l${c+1}`});if(this.previousRow!==null){const s=((a=this.points[this.previousRow][0])==null?void 0:a.fill)||`l${this.previousRow+1}`;i.includes(s)&&(i=[s,...i.filter(c=>c!==s)])}o={fill:{label:iS,value:`intersection at (${i.join(", ")})`}}}else o=n.fill?{fill:{label:iS,value:n.fill}}:{};return{main:{label:this.xAxis,value:this.points[this.row][this.col].x},cross:{label:this.yAxis,value:this.points[this.row][this.col].y},...o}}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.previousRow=null,this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}if(this.previousRow=this.row,n==="UPWARD"||n==="DOWNWARD"){const o=this.findLineByXAndYDirection(n),a=this.points[this.row][this.col].x;if(o!==null&&o!==this.row){const i=this.findColumnByXValue(o,a);if(i!==-1){this.row=o,this.col=i;const s=this.findIntersections();if(s.length>1){const u={...super.state,intersections:s};for(const Q of this.observers)Q.update(u)}else this.notifyStateUpdate();return}else{this.notifyOutOfBounds();return}}else{this.notifyOutOfBounds();return}}switch(n){case"FORWARD":this.col+=1;break;case"BACKWARD":this.col-=1;break}const l=this.findIntersections();if(l.length>1){const a={...super.state,intersections:l};for(const i of this.observers)i.update(a)}else this.notifyStateUpdate()}findIntersections(){const n=this.points[this.row][this.col].x,l=this.points[this.row][this.col].y,o=[];for(let a=0;a<this.points.length;a++){const i=this.points[a].findIndex(s=>s.x===n&&s.y===l);i!==-1&&o.push({min:this.min[a],max:this.max[a],size:this.points[a].length,index:i,value:l,groupIndex:a})}return o}isMovable(n){if(Array.isArray(n)){const[l,o]=n;return l>=0&&l<this.values.length&&o>=0&&o<this.values[l].length}switch(n){case"UPWARD":case"DOWNWARD":{const l=this.findLineByXAndYDirection(n);if(l===null)return!1;const o=this.points[this.row][this.col].x;return this.findColumnByXValue(l,o)!==-1}case"FORWARD":return this.col<this.values[this.row].length-1;case"BACKWARD":return this.col>0}}findLineByXAndYDirection(n){const l=this.points[this.row][this.col].x;let o=null,a=Number.POSITIVE_INFINITY;for(let i=0;i<this.points.length;i++){if(i===this.row)continue;const s=this.points[i].findIndex(f=>f.x===l);if(s===-1)continue;const c=this.points[i][s].y,u=n==="UPWARD"?c>this.points[this.row][this.col].y:c<this.points[this.row][this.col].y,Q=Math.abs(c-this.points[this.row][this.col].y);u&&Q<a&&(a=Q,o=i)}return o}findColumnByXValue(n,l){return this.points[n].findIndex(o=>o.x===l)}mapToSvgElements(n){if(!n||n.length!==this.lineValues.length)return null;const l=[];let o=!0;for(let a=0;a<n.length;a++){const i=C1.selectElement(n[a],!1);if(!i){l.push([]);continue}const s=[];if(i instanceof SVGPathElement){const Q=i.getAttribute(xe.D)||xe.EMPTY;bv.lastIndex=0;let f=bv.exec(Q);for(;f!==null;)s.push({x:Number.parseFloat(f[1]),y:Number.parseFloat(f[2])}),f=bv.exec(Q)}else if(i instanceof SVGPolylineElement){const f=(i.getAttribute(xe.POINTS)||xe.EMPTY).split(/\s+/).filter(Boolean);for(const h of f){const[p,g]=h.split(xe.COMMA);s.push({x:Number.parseFloat(p),y:Number.parseFloat(g)})}}if(s.length!==this.lineValues[a].length)if(s.length<this.lineValues[a].length)for(;s.length<this.lineValues[a].length;)s.push({x:Number.NaN,y:Number.NaN});else s.length>this.lineValues[a].length&&(s.length=this.lineValues[a].length);const c=[];let u=!1;for(const Q of s){if(Number.isNaN(Q.x)||Number.isNaN(Q.y)){u=!0;break}c.push(C1.createCircleElement(Q.x,Q.y,i))}if(u){l.push([]);continue}c.length>0&&(o=!1),l.push(c)}return o?null:l}get state(){const n=super.state;if(n.empty)return n;const l={...n,plotType:this.points.length>1?"multiline":"single line"},o=this.findIntersections();return o.length>1?{...l,intersections:o}:l}}class sj extends As{constructor(n){super(n);ae(this,"mode");ae(this,"xPoints");ae(this,"yPoints");ae(this,"xValues");ae(this,"yValues");ae(this,"highlightXValues");ae(this,"highlightYValues");ae(this,"minX");ae(this,"maxX");ae(this,"minY");ae(this,"maxY");this.mode="column";const l=n.data,o=[...l].sort((c,u)=>c.x-u.x||c.y-u.y);this.xPoints=new Array;let a=null;for(const c of o)(!a||a.x!==c.x)&&(a={x:c.x,y:[]},this.xPoints.push(a)),a.y.push(c.y);const i=[...l].sort((c,u)=>c.y-u.y||c.x-u.x);this.yPoints=new Array;let s=null;for(const c of i)(!s||s.y!==c.y)&&(s={y:c.y,x:[]},this.yPoints.push(s)),s.x.push(c.x);this.xValues=this.xPoints.map(c=>c.x),this.yValues=this.yPoints.map(c=>c.y),this.minX=$3.safeMin(this.xValues),this.maxX=$3.safeMax(this.xValues),this.minY=$3.safeMin(this.yValues),this.maxY=$3.safeMax(this.yValues),[this.highlightXValues,this.highlightYValues]=this.mapToSvgElements(n.selectors)}dispose(){this.xPoints.length=0,this.yPoints.length=0,this.xValues.length=0,this.yValues.length=0,this.highlightXValues&&(this.highlightXValues.forEach(n=>n.forEach(l=>l.remove())),this.highlightXValues.length=0),this.highlightYValues&&(this.highlightYValues.forEach(n=>n.forEach(l=>l.remove())),this.highlightYValues.length=0),super.dispose()}get values(){const n=[this.xValues,this.yValues];return this.mode==="column"?this.row!==0&&(this.row=0):(this.row<0||this.row>=this.yPoints.length)&&(this.row=0),n}get highlightValues(){return this.mode==="column"?this.highlightXValues:this.highlightYValues}getAudioGroupIndex(){return{}}audio(){if(this.mode==="column"){const n=this.xPoints[this.col];return{min:this.minY,max:this.maxY,size:n.y.length,index:this.col,value:n.y,...this.getAudioGroupIndex()}}else{const n=this.yPoints[this.row];return{min:this.minX,max:this.maxX,size:n.x.length,index:this.row,value:n.x,...this.getAudioGroupIndex()}}}braille(){return{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}}}text(){if(this.mode==="column"){const n=this.xPoints[this.col];return{main:{label:this.xAxis,value:n.x},cross:{label:this.yAxis,value:n.y}}}else{const n=this.yPoints[this.row];return{main:{label:this.yAxis,value:n.y},cross:{label:this.xAxis,value:n.x}}}}get autoplay(){return{UPWARD:this.yValues.length,DOWNWARD:this.yValues.length,FORWARD:this.xValues.length,BACKWARD:this.xValues.length}}highlight(){if(this.highlightValues===null)return{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}};const n=this.mode==="column"?this.col<this.highlightValues.length?this.highlightValues[this.col]:null:this.row<this.highlightValues.length?this.highlightValues[this.row]:null;return n?{empty:!1,elements:n}:{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}}}hasMultiPoints(){return!0}handleInitialEntry(){this.isInitialEntry=!1,this.row=0,this.col=0,this.mode="column"}toggleNavigation(){if(this.mode==="column"){const n=this.xPoints[this.col],l=n.y[Math.floor(n.y.length/2)],o=this.yValues.indexOf(l);o===-1||o>=this.yPoints.length?this.row=0:this.row=o,this.mode="row"}else{const n=this.yPoints[this.row],l=n.x[Math.floor(n.x.length/2)],o=this.xValues.indexOf(l);o===-1||o>=this.xPoints.length?this.col=0:this.col=o,this.mode="column",this.row=0}}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}if(this.mode==="column")switch(n){case"FORWARD":this.col++;break;case"BACKWARD":this.col--;break;case"UPWARD":case"DOWNWARD":{this.toggleNavigation();break}}else switch(n){case"UPWARD":this.row++;break;case"DOWNWARD":this.row--;break;case"FORWARD":case"BACKWARD":{this.toggleNavigation();break}}this.notifyStateUpdate()}moveToExtreme(n){if(this.isInitialEntry&&this.handleInitialEntry(),this.mode==="column")switch(n){case"UPWARD":this.toggleNavigation(),this.row=this.yPoints.length-1;break;case"DOWNWARD":this.toggleNavigation(),this.row=0;break;case"FORWARD":this.col=this.xPoints.length-1;break;case"BACKWARD":this.col=0;break}else switch(n){case"UPWARD":this.row=this.yPoints.length-1;break;case"DOWNWARD":this.row=0;break;case"FORWARD":this.toggleNavigation(),this.col=this.xPoints.length-1;break;case"BACKWARD":this.toggleNavigation(),this.col=0;break}this.notifyStateUpdate()}isMovable(n){if(Array.isArray(n))return!1;if(this.mode==="column")switch(n){case"FORWARD":return this.col<this.xPoints.length-1;case"BACKWARD":return this.col>0;case"UPWARD":case"DOWNWARD":return!0}else switch(n){case"UPWARD":return this.row<this.yPoints.length-1;case"DOWNWARD":return this.row>0;case"FORWARD":case"BACKWARD":return!0}}mapToSvgElements(n){if(!n)return[null,null];const l=C1.selectAllElements(n);if(l.length===0)return[null,null];const o=new Map,a=new Map;l.forEach(c=>{const u=Number.parseFloat(c.getAttribute("x")||""),Q=Number.parseFloat(c.getAttribute("y")||"");Number.isNaN(u)||(o.has(u)||o.set(u,[]),o.get(u).push(c)),Number.isNaN(Q)||(a.has(Q)||a.set(Q,[]),a.get(Q).push(c))});const i=Array.from(o.entries()).sort(([c],[u])=>c-u).map(([c,u])=>u),s=Array.from(a.entries()).sort(([c],[u])=>u-c).map(([c,u])=>u);return[i,s]}}const oS="Sum",uj="Level",cj="undefined";class Tj extends xv{constructor(t){super(t,t.data),this.createSummaryLevel()}createSummaryLevel(){const t=new Array,n=new Array;for(let a=0;a<this.barValues[0].length;a++){const i=this.barValues.reduce((c,u)=>c+u[a],0);t.push(i);const s=this.orientation===B2.VERTICAL?{x:this.points[0][a].x,y:i,fill:oS}:{x:i,y:this.points[0][a].y,fill:oS};n.push(s)}this.points.push(n),this.barValues.push(t);const{min:l,max:o}=$3.minMax(t);this.min.push(l),this.max.push(o)}text(){return{...super.text(),fill:{label:uj,value:this.points[this.row][this.col].fill??cj}}}highlight(){return this.highlightValues===null||this.row===this.barValues.length-1?{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}}:{empty:!1,elements:this.highlightValues[this.row][this.col]}}hasMultiPoints(){return!1}mapToSvgElements(t){if(!t)return new Array;const n=C1.selectAllElements(t);if(n.length===0)return new Array;const l=new Array;if(n[0]instanceof SVGPathElement)for(let o=0,a=0;o<this.barValues.length;o++){const i=new Array;for(let s=0;s<this.barValues[o].length;s++){if(a>=n.length)return new Array;this.barValues[o][s]===0?i.push(C1.createEmptyElement()):i.push(n[a++])}l.push(i)}else if(n[0]instanceof SVGRectElement){for(let o=0;o<this.barValues.length;o++)l.push(new Array);for(let o=0,a=0;o<this.barValues[0].length;o++)for(let i=this.barValues.length-1;i>=0;i--){if(a>=n.length)return new Array;this.barValues[i][o]===0?l[i].push(C1.createEmptyElement()):l[i].push(n[a++])}}return l}}class lS extends aS{constructor(t){super(t)}audio(){const t=this.lineValues[this.row],n=this.col,l=s=>t[Math.max(0,Math.min(s,t.length-1))],o=n>0?l(n-1):l(n),a=l(n),i=n<t.length-1?l(n+1):l(n);return{min:this.min[this.row],max:this.max[this.row],size:t.length,index:n,value:[o,a,i],isContinuous:!0,...this.getAudioGroupIndex()}}}class Qj extends lS{constructor(t){super(t)}mapToSvgElements(t){var o;if(!t||t.length!==this.lineValues.length)return null;const n=[];let l=!0;for(let a=0;a<t.length;a++){const i=C1.selectElement(t[a],!1);if(!i){n.push([]);continue}const s=(o=this.points)==null?void 0:o[a],c=[];for(const u of s)typeof u.svg_x=="number"&&typeof u.svg_y=="number"&&c.push(C1.createCircleElement(u.svg_x,u.svg_y,i));c.length>0&&(l=!1),n.push(c)}return l?null:n}}function fj(e){return typeof(e==null?void 0:e.svg_x)=="number"&&typeof(e==null?void 0:e.svg_y)=="number"}function dj(e){return Array.isArray(e.data)&&e.data.length>0&&Array.isArray(e.data[0])&&fj(e.data[0][0])?new Qj(e):new lS(e)}class hj{static create(t){switch(t.type){case P2.BAR:return new XI(t);case P2.BOX:return new rj(t);case P2.CANDLESTICK:return new aj(t);case P2.HEATMAP:return new oj(t);case P2.HISTOGRAM:return new lj(t);case P2.LINE:return new aS(t);case P2.SCATTER:return new sj(t);case P2.SMOOTH:return dj(t);case P2.DODGED:case P2.NORMALIZED:case P2.STACKED:return new Tj(t);default:throw new Error(`Invalid trace type: ${t.type}`)}}}const pj="MAIDR Plot",mj="unavailable",yj="unavailable";class gj extends Lv{constructor(n){super();ae(this,"id");ae(this,"title");ae(this,"subtitle");ae(this,"caption");ae(this,"subplots");ae(this,"size");this.id=n.id,this.title=n.title??pj,this.subtitle=n.subtitle??mj,this.caption=n.caption??yj;const l=n.subplots;this.subplots=l.map(o=>o.map(a=>new vj(a))),this.size=this.subplots.reduce((o,a)=>o+a.length,0)}dispose(){this.subplots.forEach(n=>n.forEach(l=>l.dispose())),this.subplots.length=0,super.dispose()}get values(){return this.subplots}get activeSubplot(){return this.subplots[this.row][this.col]}get state(){if(this.isOutOfBounds)return{empty:!0,type:"figure"};const n=this.col+1+this.subplots.slice(0,this.row).reduce((o,a)=>o+a.length,0),l=this.activeSubplot;return{empty:!1,type:"figure",title:this.title,subtitle:this.subtitle,caption:this.caption,size:this.size,index:n,subplot:l.getStateWithFigurePosition(this.row,this.col),traceTypes:l.traceTypes,highlight:this.highlight()}}highlight(){var l;if(document.querySelectorAll('g[id^="axes_"]').length<=1)return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}};try{const o=((l=this.subplots[0])==null?void 0:l.length)||1,a=this.row*o+this.col+1,i=`g[id="axes_${a}"]`,s=document.querySelector(i);if(s)return{empty:!1,elements:s};const c=document.querySelectorAll('g[id^="axes_"]');if(c.length>0&&a-1<c.length)return{empty:!1,elements:c[a-1]}}catch{return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}}}return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}}}}class vj extends Lv{constructor(n){super();ae(this,"traces");ae(this,"traceTypes");ae(this,"size");this.isInitialEntry=!1;const l=n.layers;this.size=l.length,this.traces=l.map(o=>[hj.create(o)]),this.traceTypes=this.traces.flat().map(o=>{const a=o.state;return a.empty?xe.EMPTY:a.traceType})}dispose(){this.traces.forEach(n=>n.forEach(l=>l.dispose())),this.traces.length=0,super.dispose()}get values(){return this.traces}get activeTrace(){return this.traces[this.row][this.col]}highlight(){return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}}}get state(){return this.isOutOfBounds?{empty:!0,type:"subplot"}:{empty:!1,type:"subplot",size:this.size,index:this.row+1,trace:this.activeTrace.state,highlight:this.highlight()}}getStateWithFigurePosition(n,l){return this.state}}const U3={SINE_BASIC:0,SQUARE_BASIC:1,SAWTOOTH_BASIC:2,TRIANGLE_BASIC:3,SAWTOOTH_DARK:4,SINE_HARMONIC:5,TRIANGLE_HARMONIC:6,SQUARE_HARMONIC:7,TRIANGLE_MELLOW:8,SINE_SUBTLE:9,SAWTOOTH_SOFT:10},Q9=class Q9{constructor(){ae(this,"basePalette");ae(this,"extendedPalette");this.basePalette=[{index:U3.SINE_BASIC,waveType:"sine",timbreModulation:{attack:.01,decay:.1,sustain:.8,release:.2}},{index:U3.SQUARE_BASIC,waveType:"square",timbreModulation:{attack:.005,decay:.05,sustain:.7,release:.15}},{index:U3.SAWTOOTH_BASIC,waveType:"sawtooth",timbreModulation:{attack:.02,decay:.08,sustain:.6,release:.25}},{index:U3.TRIANGLE_BASIC,waveType:"triangle",timbreModulation:{attack:.015,decay:.12,sustain:.9,release:.18}},{index:U3.SAWTOOTH_DARK,waveType:"sawtooth",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.2},{frequency:3,amplitude:.1},{frequency:5,amplitude:.05}]},timbreModulation:{attack:.005,decay:.3,sustain:.4,release:.5}},{index:U3.SINE_HARMONIC,waveType:"sine",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.15},{frequency:4,amplitude:.05}]},timbreModulation:{attack:.02,decay:.2,sustain:.6,release:.3}},{index:U3.TRIANGLE_HARMONIC,waveType:"triangle",harmonicMix:{fundamental:1,harmonics:[{frequency:3,amplitude:.2},{frequency:6,amplitude:.1}]},timbreModulation:{attack:.01,decay:.1,sustain:.8,release:.2}},{index:U3.SQUARE_HARMONIC,waveType:"square",harmonicMix:{fundamental:1,harmonics:[{frequency:3,amplitude:.1},{frequency:7,amplitude:.05}]},timbreModulation:{attack:.005,decay:.05,sustain:.5,release:.1}},{index:U3.TRIANGLE_MELLOW,waveType:"triangle",harmonicMix:{fundamental:1,harmonics:[{frequency:2.5,amplitude:.15},{frequency:4.5,amplitude:.08}]},timbreModulation:{attack:.01,decay:.4,sustain:.3,release:.5}},{index:U3.SINE_SUBTLE,waveType:"sine",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.1},{frequency:3,amplitude:.05}]},timbreModulation:{attack:.02,decay:.1,sustain:.9,release:.15}},{index:U3.SAWTOOTH_SOFT,waveType:"sawtooth",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.05},{frequency:6,amplitude:.02}]},timbreModulation:{attack:.005,decay:.4,sustain:.2,release:.6}}],this.validateBasePalette(),this.extendedPalette=new Map,this.generateExtendedPalette()}dispose(){this.extendedPalette.clear()}getPaletteEntry(t){if(t<this.basePalette.length)return this.basePalette[t];const n=this.extendedPalette.get(t);if(n)return n;const l=this.generateExtendedEntry(t);return this.extendedPalette.set(t,l),l}get basePaletteSize(){return this.basePalette.length}getCandlestickGroupIndex(t){switch(t){case"Bull":return U3.SINE_BASIC;case"Bear":return U3.SAWTOOTH_SOFT;case"Neutral":return U3.TRIANGLE_BASIC;default:return U3.SINE_BASIC}}generateExtendedPalette(){[{index:this.basePalette.length,waveType:"sine",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.3},{frequency:3,amplitude:.15}]},timbreModulation:{attack:.02,decay:.15,sustain:.7,release:.3}},{index:this.basePalette.length+1,waveType:"square",harmonicMix:{fundamental:1,harmonics:[{frequency:1.5,amplitude:.4},{frequency:2.5,amplitude:.2}]},timbreModulation:{attack:.01,decay:.08,sustain:.6,release:.4}},{index:this.basePalette.length+2,waveType:"sawtooth",harmonicMix:{fundamental:1,harmonics:[{frequency:1.25,amplitude:.35},{frequency:2,amplitude:.25},{frequency:3,amplitude:.1}]},timbreModulation:{attack:.03,decay:.2,sustain:.5,release:.35}},{index:this.basePalette.length+3,waveType:"triangle",harmonicMix:{fundamental:1,harmonics:[{frequency:.5,amplitude:.2},{frequency:4,amplitude:.15}]},timbreModulation:{attack:.025,decay:.18,sustain:.8,release:.25}}].forEach((n,l)=>{this.extendedPalette.set(this.basePalette.length+l,n)})}generateExtendedEntry(t){const n=t%this.basePalette.length,l=this.basePalette[n],o=Math.floor((t-this.basePalette.length)/this.basePalette.length),a=this.generateHarmonics(o),i=this.generateTimbreModulation(o,l.timbreModulation);return{index:t,waveType:l.waveType,harmonicMix:{fundamental:1,harmonics:a},timbreModulation:i}}generateHarmonics(t){const n=[],l=Q9.MIN_HARMONICS+t%Q9.HARMONIC_VARIATION;for(let o=0;o<l;o++){const a=1+(o+1)*(.5+t*.3%1),i=.4/(o+1)*(1-t*.1%.3);n.push({frequency:a,amplitude:i})}return n}generateTimbreModulation(t,n){const l=1+t*.2%.5;return{attack:Math.max(.005,Math.min(.05,n.attack*l)),decay:Math.max(.05,Math.min(.3,n.decay*l)),sustain:Math.max(.4,Math.min(.9,n.sustain+t*.1%.2)),release:Math.max(.1,Math.min(.5,n.release*l))}}validateBasePalette(){this.basePalette.forEach((t,n)=>{if(t.index!==n)throw new Error(`AudioPalette validation error: Entry at array position ${n} has index ${t.index}. Array position must match the index property to prevent audio palette mismatches.`)})}};ae(Q9,"MIN_HARMONICS",2),ae(Q9,"HARMONIC_VARIATION",3);let Hv=Q9;const Lj=100,xj=440,bj=880,Sv=.3,Ev=U3.SINE_BASIC;class Hj{constructor(t,n,l){ae(this,"notification");ae(this,"audioPalette");ae(this,"settings");ae(this,"isCombinedAudio");ae(this,"mode");ae(this,"activeAudioIds");ae(this,"audioContext");ae(this,"compressor");ae(this,"currentVolume");ae(this,"currentMinFrequency");ae(this,"currentMaxFrequency");this.notification=t,this.audioPalette=new Hv,this.settings=l,this.isCombinedAudio=!1,this.mode="on",this.updateMode(n),this.activeAudioIds=new Map,this.audioContext=new AudioContext,this.compressor=this.initCompressor();const o=this.settings.loadSettings();this.currentVolume=o.general.volume/100,this.currentMinFrequency=o.general.minFrequency,this.currentMaxFrequency=o.general.maxFrequency,this.settings.addObserver(this)}dispose(){this.stopAll(),this.audioPalette.dispose(),this.audioContext.state!=="closed"&&(this.compressor.disconnect(),this.audioContext.close()),this.settings.removeObserver(this)}update(t){"general"in t?this.onSettingsChange(t):this.onStateChange(t)}onSettingsChange(t){this.currentVolume=t.general.volume/100,this.currentMinFrequency=t.general.minFrequency,this.currentMaxFrequency=t.general.maxFrequency}onStateChange(t){if(this.updateMode(t),this.mode==="off"||t.type!=="trace")return;const n=t;if(n.empty){this.playEmptyTone(n.audio.size,n.audio.index);return}if(n.traceType==="line"&&!n.empty&&Array.isArray(n.intersections)&&n.intersections.length>1){this.stopAll(),this.playSimultaneousTones(n.intersections);return}const l=n.audio;let o=l.groupIndex;l.trend&&o===void 0&&(o=this.audioPalette.getCandlestickGroupIndex(l.trend));const i=o!==void 0?this.audioPalette.getPaletteEntry(o):void 0;if(l.isContinuous)this.playSmooth(l.value,l.min,l.max,l.size,Array.isArray(l.index)?l.index[0]:l.index,i);else if(Array.isArray(l.value)){const s=l.value;if(s.length===0){this.playZeroTone();return}let c=0;const u=this.mode==="on"?50:0,Q=new Array,f=()=>{if(c<s.length){const h=Array.isArray(l.index)?l.index[c]:l.index;this.playTone(l.min,l.max,s[c++],l.size,h,i),Q.push(setTimeout(f,u))}else this.stop(Q)};f()}else{const s=l.value;if(s===0)this.playZeroTone();else{const c=Array.isArray(l.index)?l.index[0]:l.index;this.playTone(l.min,l.max,s,l.size,c,i)}}}getVolume(){return Math.min(Math.max(this.currentVolume,0),1)}getFrequencyRange(){return{min:this.currentMinFrequency,max:this.currentMaxFrequency}}initCompressor(){const t=this.audioContext.createDynamicsCompressor();t.threshold.value=-50,t.knee.value=40,t.ratio.value=12,t.attack.value=0,t.release.value=.25;const n=this.audioContext.createGain();return n.gain.value=.5,t.connect(n),n.connect(this.audioContext.destination),t}updateMode(t){if(t.empty||t.type==="figure")return;const n=t.type==="subplot"?t.trace:t;n.empty||n.hasMultiPoints===this.isCombinedAudio||(this.isCombinedAudio=n.hasMultiPoints,this.mode!=="off"&&(this.isCombinedAudio?this.mode="combined":this.mode="on"))}playTone(t,n,l,o,a,i){const s={min:t,max:n},c=this.getFrequencyRange(),u=this.interpolate(l,s,c),Q={min:0,max:o},f={min:-1,max:1},h=this.clamp(this.interpolate(a,Q,f),-1,1);return this.playOscillator(u,h,i)}createOscillators(t,n){const l=[],o=this.audioContext.createOscillator();if(o.type=t.waveType,o.frequency.value=n,l.push(o),t.harmonicMix)for(const a of t.harmonicMix.harmonics){const i=this.audioContext.createOscillator();i.type=t.waveType,i.frequency.value=a.frequency*n,l.push(i)}return l}createGainNodes(t,n,l,o){const a=[],i=this.audioContext.currentTime,s=this.getVolume();for(let c=0;c<t.length;c++){const u=this.audioContext.createGain();let Q=s;if(c===0)n.harmonicMix&&(Q*=n.harmonicMix.fundamental);else{const h=n.harmonicMix.harmonics[c-1];Q*=h.amplitude}const f=this.createAdsrEnvelope(u,n,Q,i,o);f!==null&&u.gain.setValueCurveAtTime(f,i,o),a.push(u)}return a}playOscillator(t,n=0,l){const o=Sv,a=this.getVolume();l||(l=this.audioPalette.getPaletteEntry(0));const i=this.createOscillators(l,t),s=this.createGainNodes(i,l,a,o),c=this.audioContext.createStereoPanner();c.pan.value=n;const u=new PannerNode(this.audioContext,{distanceModel:"linear",positionX:0,positionY:0,positionZ:0,orientationX:0,orientationY:0,orientationZ:-1,refDistance:1,maxDistance:1e4,rolloffFactor:10,coneInnerAngle:40,coneOuterAngle:50,coneOuterGain:.4});for(let h=0;h<i.length;h++)i[h].connect(s[h]),s[h].connect(c);c.connect(u),u.connect(this.compressor),i.forEach(h=>h.start());const Q=h=>{u.disconnect(this.compressor),c.disconnect(u);for(let p=0;p<i.length;p++)s[p].disconnect(c),i[p].stop(),i[p].disconnect(s[p]);this.activeAudioIds.delete(h)},f=setTimeout(()=>Q(f),o*1e3*2);return this.activeAudioIds.set(f,i),f}createAdsrEnvelope(t,n,l,o,a){if(n!=null&&n.timbreModulation){const{attack:i,decay:s,sustain:c,release:u}=n.timbreModulation,Q=a*i,f=a*s,h=a*u,p=a-Q-f-h;return t.gain.setValueAtTime(1e-4*l,o),t.gain.linearRampToValueAtTime(l,o+Q),t.gain.linearRampToValueAtTime(c*l,o+Q+f),p>0&&t.gain.setValueAtTime(c*l,o+Q+f+p),t.gain.linearRampToValueAtTime(1e-4*l,o+a),null}else return[.5*l,l,.5*l,.5*l,.5*l,.1*l,1e-4*l]}playSmooth(t,n,l,o,a,i){const s=this.audioContext,c=s.currentTime,u=Sv,Q=this.getFrequencyRange(),f=this.getVolume(),h=(i==null?void 0:i.waveType)||"sine",p=t.map(O=>this.interpolate(O,{min:n,max:l},Q));p.length<2&&p.push(p[0]);const g=this.clamp(this.interpolate(a,{min:0,max:o-1},{min:-1,max:1}),-1,1),v=s.createOscillator();v.type=h,v.frequency.setValueCurveAtTime(p,c,u);const b=s.createGain(),L=this.createAdsrEnvelope(b,i,f,c,u);L!==null&&b.gain.setValueCurveAtTime(L,c,u);const S=s.createStereoPanner();S.pan.value=g,v.connect(b),b.connect(S),S.connect(this.compressor),v.start(c),v.stop(c+u);const _=setTimeout(()=>{v.disconnect(),b.disconnect(),S.disconnect(),this.activeAudioIds.delete(_)},u*1e3*2);this.activeAudioIds.set(_,[v])}playEmptyTone(t,n){const l=this.audioContext,o=l.currentTime,a=.2,i=this.getVolume(),s=[500,1e3,1500,2100,2700],c=[1,.6,.4,.2,.1],u=l.createGain();u.gain.setValueAtTime(.3*i,o),u.gain.exponentialRampToValueAtTime(.01*i,o+a),u.connect(this.compressor);const Q={min:0,max:t},f={min:-1,max:1},h=this.clamp(this.interpolate(n,Q,f),-1,1),p=[];for(let b=0;b<s.length;b++){const L=l.createOscillator(),S=l.createGain(),_=this.audioContext.createStereoPanner(),O=new PannerNode(this.audioContext,{distanceModel:"linear",positionX:0,positionY:0,positionZ:0,orientationX:0,orientationY:0,orientationZ:-1,refDistance:1,maxDistance:1e4,rolloffFactor:10,coneInnerAngle:40,coneOuterAngle:50,coneOuterGain:.4});L.frequency.value=s[b],L.type="sine",S.gain.setValueAtTime(c[b]*i,o),S.gain.exponentialRampToValueAtTime(.001*i,o+a),_.pan.value=h,L.connect(S),S.connect(_),_.connect(O),O.connect(u),L.start(o),L.stop(o+a),p.push(L)}const g=b=>{u.disconnect(),p.forEach(L=>{L.disconnect()}),this.activeAudioIds.delete(b)},v=setTimeout(()=>g(v),a*1e3*2);return this.activeAudioIds.set(v,p),v}playZeroTone(){return this.playOscillator(Lj,0,{index:Ev,waveType:"triangle"})}playWaitingTone(){return setInterval(()=>this.playOscillator(xj,0,{index:Ev,waveType:"sine"}),1e3)}playCompleteTone(){return this.playOscillator(bj,0,{index:Ev,waveType:"sine"})}interpolate(t,n,l){return n.min===0&&n.max===0?0:(t-n.min)/(n.max-n.min)*(l.max-l.min)+l.min}clamp(t,n,l){return Math.max(n,Math.min(t,l))}toggle(){switch(this.mode){case"off":this.mode=this.isCombinedAudio?"combined":"on";break;case"on":this.mode="off";break;case"combined":this.mode="on";break}const n=`Sound is ${this.isCombinedAudio&&this.mode==="on"?"separate":this.mode}`;this.notification.notify(n)}stop(t){(Array.isArray(t)?t:[t]).forEach(l=>{const o=this.activeAudioIds.get(l);if(!o){clearInterval(l);return}o.forEach(a=>{a==null||a.disconnect(),a==null||a.stop()}),clearTimeout(l),this.activeAudioIds.delete(l)})}stopAll(){this.activeAudioIds.entries().forEach(([t,n])=>{clearTimeout(t),n.forEach(l=>{l.disconnect(),l.stop()})}),this.activeAudioIds.clear()}playSimultaneousTones(t){const n=this.getVolume(),l=Sv,o=this.audioContext,a=o.currentTime,i=this.getFrequencyRange(),s=Array.isArray(t[0].value)?t[0].value[1]??t[0].value[0]:t[0].value,c=t[0].min,u=t[0].max,Q=this.interpolate(s,{min:c,max:u},i);t.forEach((f,h)=>{const p=Q,v=this.audioPalette.getPaletteEntry(h).waveType,b=o.createOscillator();b.type=v,b.frequency.value=p;const L=o.createGain();L.gain.setValueAtTime(n,a),L.gain.exponentialRampToValueAtTime(.01*n,a+l),b.connect(L),L.connect(this.compressor),b.start(a),b.stop(a+l);const S=setTimeout(()=>{b.disconnect(),L.disconnect()},l*1e3*2);this.activeAudioIds.set(S,[b])})}}const Sj=250,Ej=50,Mj=500,Aj=20;class _j{constructor(t,n,l){ae(this,"context");ae(this,"notification");ae(this,"settings");ae(this,"autoplayId");ae(this,"currentDirection");ae(this,"userSpeed");ae(this,"defaultSpeed");ae(this,"minSpeed");ae(this,"maxSpeed");ae(this,"autoplayRate");ae(this,"interval");ae(this,"currentDuration");ae(this,"onChangeEmitter");ae(this,"onChange");this.notification=n,this.context=t,this.settings=l,this.autoplayId=null,this.currentDirection=null,this.userSpeed=null,this.defaultSpeed=Sj,this.minSpeed=Ej,this.maxSpeed=Mj,this.autoplayRate=this.defaultSpeed,this.interval=Aj,this.currentDuration=this.settings.loadSettings().general.autoplayDuration,this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event,this.settings.addObserver(this)}dispose(){this.stop(),this.onChangeEmitter.dispose(),this.settings.removeObserver(this)}update(t){this.updateSettings(t)}updateSettings(t){this.currentDuration=t.general.autoplayDuration,this.currentDirection&&this.restart()}start(t,n){this.stop(),this.onChangeEmitter.fire({type:"start"}),this.autoplayRate=this.getAutoplayRate(t,n),this.currentDirection=t,this.autoplayId=setInterval(()=>{this.context.isMovable(t)?this.context.moveOnce(t):this.stop()},this.autoplayRate)}stop(){this.autoplayId&&clearInterval(this.autoplayId),this.autoplayId=null,this.currentDirection=null,this.onChangeEmitter.fire({type:"stop"})}restart(){this.autoplayId&&clearInterval(this.autoplayId),this.currentDirection&&this.start(this.currentDirection)}speedUp(){const t=this.userSpeed??this.autoplayRate;t-this.interval>this.minSpeed?(this.userSpeed=t-this.interval,this.autoplayRate=this.userSpeed,this.restart(),this.notification.notify("Speed up")):this.notification.notify("Max speed")}speedDown(){const t=this.userSpeed??this.autoplayRate;t+this.interval<=this.maxSpeed?(this.userSpeed=t+this.interval,this.autoplayRate=this.userSpeed,this.restart(),this.notification.notify("Speed down")):this.notification.notify("Min speed")}resetSpeed(){this.userSpeed=null,this.autoplayRate=this.defaultSpeed,this.restart(),this.notification.notify("Reset speed")}getAutoplayRate(t,n){if(this.userSpeed!==null)return this.userSpeed;if(n&&!n.empty){const l=Math.ceil(this.currentDuration/n.autoplay[t]);return this.defaultSpeed=l,this.minSpeed=Math.min(this.minSpeed,l),l}return this.defaultSpeed}}const sS=32;class Rc{encode(t){const n=new Array,l=new Array,o=new Array;for(let a=0;a<t.values.length;a++){l.push(new Array);const i=(t.max[a]-t.min[a])/4,s=t.min[a]+i,c=s+i,u=c+i;for(let Q=0;Q<t.values[a].length;Q++)t.values[a][Q]===0?n.push(" "):t.values[a][Q]<=s||t.values[a][Q]<=c?n.push("⠤"):t.values[a][Q]<=u?n.push("⠒"):n.push("⠉"),l[a].push(o.length),o.push({row:a,col:Q});n.push(xe.NEW_LINE),l[a].push(o.length),o.push({row:a,col:t.values[a].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}}class Oj{constructor(){ae(this,"GLOBAL_MIN","globalMin");ae(this,"GLOBAL_MAX","globalMax");ae(this,"BLANK","blank");ae(this,"LOWER_OUTLIER","lowerOutlier");ae(this,"UPPER_OUTLIER","upperOutlier");ae(this,"MIN","min");ae(this,"MAX","max");ae(this,"Q1","q1");ae(this,"Q2","q2");ae(this,"Q3","q3")}encode(t,n=sS){const l=new Array,o=new Array,a=new Array;for(let i=0;i<t.values.length;i++){const s=t.values[i],c=[{type:this.GLOBAL_MIN,value:t.min},...s.lowerOutliers.map(V=>({type:this.LOWER_OUTLIER,value:V})),{type:this.MIN,value:s.min},{type:this.Q1,value:s.q1},{type:this.Q2,value:s.q2},{type:this.Q3,value:s.q3},{type:this.MAX,value:s.max},...s.upperOutliers.map(V=>({type:this.UPPER_OUTLIER,value:V})),{type:this.GLOBAL_MAX,value:t.max}],u=new Array;let Q=!0;for(let V=0;V<c.length-1;V++){const k=c[V],B=c[V+1],R=Math.abs(Q?B.value-k.value:k.value-c[V-1].value);k.type===this.LOWER_OUTLIER||k.type===this.UPPER_OUTLIER?(u.push({type:k.type,length:0,numChars:1}),u.push({type:this.BLANK,length:R,numChars:0})):k.type===this.Q2?(Q=!1,u.push({type:this.Q2,length:0,numChars:2})):k.type===this.GLOBAL_MIN||k.type===this.GLOBAL_MAX?u.push({type:this.BLANK,length:R,numChars:0}):u.push({type:k.type,length:R,numChars:1})}let f=u.reduce((V,k)=>V+(k.numChars>0?k.numChars:0),0),[h,p,g,v]=[-1,-1,-1,-1];for(let V=0;V<u.length;V++)u[V].type===this.MIN&&u[V].length>0&&(h=V),u[V].type===this.MAX&&u[V].length>0&&(p=V),u[V].type===this.Q1&&(g=V),u[V].type===this.Q3&&(v=V);h!==-1&&p!==-1&&u[h].length!==u[p].length&&(u[h].length>u[p].length?(u[h].numChars++,f++):(u[p].numChars++,f++)),g!==-1&&v!==-1&&u[g].length!==u[v].length&&(u[g].length>u[v].length?(u[g].numChars++,f++):(u[v].numChars++,f++));const b=Math.max(0,n-f),L=u.reduce((V,k)=>V+(k.type!==this.Q2&&k.length>0?k.length:0),0);for(const V of u)if(V.type!==this.Q2&&V.length>0){const k=Math.round(V.length/L*b);V.numChars+=k}const S=u.reduce((V,k)=>V+k.numChars,0);let _=n-S,O=0;for(;_!==0;){const V=u[O%u.length];V.type!==this.BLANK&&V.type!==this.Q2&&V.length>0&&(V.numChars+=_>0?1:-1,_+=_>0?-1:1),O++}let E=-1;const A=[this.LOWER_OUTLIER,this.MIN,this.Q1,this.Q2,this.Q3,this.MAX,this.UPPER_OUTLIER];a.push(Array.from({length:A.length}).fill(-1));for(const V of u){V.type!==this.BLANK&&V.type!==this.GLOBAL_MIN&&V.type!==this.GLOBAL_MAX&&(E=A.indexOf(V.type),a[i][E]=l.length);for(let k=0;k<V.numChars;k++){let B="⠀";V.type===this.MIN||V.type===this.MAX?B="⠒":V.type===this.Q1||V.type===this.Q3?B="⠿":V.type===this.Q2?B=k===0?"⠸":"⠇":V.type===this.LOWER_OUTLIER||V.type===this.UPPER_OUTLIER?B="⠂":V.type===this.BLANK&&(B="⠀"),l.push(B),o.push({row:i,col:E})}}for(let V=0;V<3;V++)if(a[i][V]===-1){for(let k=V+1;k<=3;k++)if(a[i][k]!==-1){a[i][V]=a[i][k];break}}for(let V=6;V>3;V--)if(a[i][V]===-1){for(let k=V-1;k>=3;k--)if(a[i][k]!==-1){a[i][V]=a[i][k];break}}l.push(xe.NEW_LINE),o.push({row:i,col:E})}return{value:l.join(xe.EMPTY),cellToIndex:a,indexToCell:o}}}class Cj{encode(t){const n=new Array,l=new Array,o=new Array,a=(t.max-t.min)/3,i=t.min+a,s=i+a;for(let c=0;c<t.values.length;c++){l.push(new Array);for(let u=0;u<t.values[c].length;u++)t.values[c][u]===0?n.push(" "):t.values[c][u]<=i?n.push("⠤"):t.values[c][u]<=s?n.push("⠒"):n.push("⠉"),l[c].push(o.length),o.push({row:c,col:u});n.push(xe.NEW_LINE),l[c].push(o.length),o.push({row:c,col:t.values[c].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}}class uS{encode(t){const n=new Array,l=new Array,o=new Array;for(let a=0;a<t.values.length;a++){l.push(new Array);const{low:i,medium:s,mediumHigh:c,high:u}=this.getThresholds(a,t);for(let Q=0;Q<t.values[a].length;Q++){const f=t.values[a][Q],h=Q>0?t.values[a][Q-1]:null,p=this.getBrailleChar(f,h,i,s,u,c);n.push(p),l[a].push(o.length),o.push({row:a,col:Q})}n.push(xe.NEW_LINE),l[a].push(o.length),o.push({row:a,col:t.values[a].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}getBrailleChar(t,n,l,o,a,i){return i===void 0&&(i=a),t<=l&&n!==null&&n>l?n<=o?"⢄":n<=i?"⢆":"⢇":t<=l?"⣀":n!==null&&n<=l?t<=o?"⡠":t<=i?"⡰":"⡸":t<=o&&n!==null&&n>o?n<=i?"⠢":"⠣":t<=o?"⠤":n!==null&&n<=o?t<=i?"⠔":"⠜":t<=i&&n!==null&&n>i?"⠑":t<=i?"⠒":n!==null&&n<=i?"⠊":t<=a?"⠉":""}getBraille6Char(t,n,l,o,a){const i=f=>f<=l?"low":f<=o?"medium":(f<=a,"high"),s=i(t),c=n!==null?i(n):null,u={"low,medium":"⠢","low,high":"⠣","low,null":"⠤","low,low":"⠤","medium,low":"⠔","medium,high":"⠑","medium,null":"⠒","medium,medium":"⠒","high,low":"⠜","high,medium":"⠊","high,null":"⠉","high,high":"⠉"},Q=`${s},${c}`;return u[Q]||""}addDot8(t){if(!t||t.length===0)return"⢀";const o=t.charCodeAt(0)-10240|128;return String.fromCharCode(10240+o)}}class wj extends uS{getThresholds(t,n){const l=(n.max-n.min)/3,o=n.min+l,a=o+l,i=n.max;return{low:o,medium:a,high:i}}encode(t){var a;const n=new Array,l=new Array,o=new Array;for(let i=0;i<t.values.length;i++){l.push(new Array);const{low:s,medium:c,high:u}=this.getThresholds(i,t);for(let Q=0;Q<t.values[i].length;Q++){const f=t.values[i][Q],h=Q>0?t.values[i][Q-1]:null;let p=this.getBraille6Char(f,h,s,c,u);((a=t.custom)==null?void 0:a[Q])==="Bear"&&(p=this.addDot8(p)),n.push(p),l[i].push(o.length),o.push({row:i,col:Q})}n.push(xe.NEW_LINE),l[i].push(o.length),o.push({row:i,col:t.values[i].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}}class Vj extends uS{getThresholds(t,n){const l=(n.max[t]-n.min[t])/4,o=n.min[t]+l,a=o+l,i=a+l,s=n.max[t];return{low:o,medium:a,mediumHigh:i,high:s}}}class Dj{constructor(t,n,l){ae(this,"context");ae(this,"notification");ae(this,"display");ae(this,"enabled");ae(this,"cacheId");ae(this,"cache");ae(this,"encoders");ae(this,"onChangeEmitter");ae(this,"onChange");this.context=t,this.notification=n,this.display=l,this.enabled=!1,this.cacheId=xe.EMPTY,this.cache=null,this.encoders=new Map([[P2.BAR,new Rc],[P2.BOX,new Oj],[P2.CANDLESTICK,new wj],[P2.DODGED,new Rc],[P2.HEATMAP,new Cj],[P2.HISTOGRAM,new Rc],[P2.LINE,new Vj],[P2.NORMALIZED,new Rc],[P2.STACKED,new Rc]]),this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose(),this.cache=null,this.encoders.clear()}update(t){if(!this.enabled||t.empty)return;const n=t.type==="subplot"?t.trace:t;if(n.empty||n.braille.empty||!this.encoders.has(n.traceType))return;const l=n.braille;if(this.cacheId!==l.id||this.cache===null){const o=this.encoders.get(n.traceType);this.cache=o.encode(l,sS),this.cacheId=l.id}this.onChangeEmitter.fire({value:this.cache.value.trim(),index:this.cache.cellToIndex[l.row][l.col]})}moveToIndex(t){if(!this.enabled||this.cache===null||t<0||t>=this.cache.indexToCell.length)return;const{row:n,col:l}=this.cache.indexToCell[t];this.context.moveToIndex(n,l)}toggle(t){if(t.empty){this.notification.notify("No info for braille");return}if(t.braille.empty){const l=`Braille is not supported for plot type: ${t.braille.traceType}`;this.notification.notify(l);return}this.enabled=!this.enabled,this.update(t),this.display.toggleFocus(H1.BRAILLE);const n=`Braille is ${this.enabled?"on":"off"}`;this.notification.notify(n)}}var cS=(e=>(e[e.OK=200]="OK",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.SERVER_ERROR=500]="SERVER_ERROR",e))(cS||{});class TS{constructor(){}static async post(t,n,l){const o={...this.DEFAULT_HEADERS,...l};return this.request(t,"POST",o,n)}static async request(t,n,l,o){try{const a=await fetch(t,{method:n,headers:l,body:o});return a.ok?{success:!0,data:await a.json()}:{success:!1,error:{statusCode:a.status,message:`API Error: ${a.status} - ${a.statusText}`}}}catch(a){return console.error(`Error in API ${n} request to ${t}:`,a),{success:!1,error:{statusCode:cS.SERVER_ERROR,message:a instanceof Error?a.message:"Unknown error occurred"}}}}}ae(TS,"DEFAULT_HEADERS",{"Content-Type":"application/json"});const Rj=`You are an accessibility assistant specializing in describing statistical visualizations to blind users. Your role is to:
2
+ `),ae(xe,"OPEN_BRACKET","["),ae(xe,"POLYLINE","polyline"),ae(xe,"SPACE"," "),ae(xe,"THROUGH"," through "),ae(xe,"TRANSPARENT","transparent"),ae(xe,"VISIBLE","visible"),ae(xe,"X","x"),ae(xe,"Y","y"),ae(xe,"HIGHLIGHT_BASE_COLOR",{r:255,g:255,b:255}),ae(xe,"HIGHLIGHT_CONTRAST_RATIO",3),ae(xe,"HIGHLIGHT_COLOR_RATIO",.6),ae(xe,"HIGHLIGHT_MAX_COLOR",255);let pv=class{constructor(){ae(this,"items");this.items=new Array}push(t){this.items.push(t)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}removeLast(t,n=1){const l=this.items.lastIndexOf(t);return l!==-1?(this.items.splice(l,n),!0):!1}isEmpty(){return this.items.length===0}size(){return this.items.length}clear(){this.items.length=0}};const mv=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function yv(e,t,n,l){e.addEventListener?e.addEventListener(t,n,l):e.attachEvent&&e.attachEvent("on".concat(t),n)}function _c(e,t,n,l){e.removeEventListener?e.removeEventListener(t,n,l):e.detachEvent&&e.detachEvent("on".concat(t),n)}function WH(e,t){const n=t.slice(0,t.length-1);for(let l=0;l<n.length;l++)n[l]=e[n[l].toLowerCase()];return n}function YH(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let n=t.lastIndexOf("");for(;n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function HI(e,t){const n=e.length>=t.length?e:t,l=e.length>=t.length?t:e;let o=!0;for(let a=0;a<n.length;a++)l.indexOf(n[a])===-1&&(o=!1);return o}const Oc={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":mv?173:189,"=":mv?61:187,";":mv?59:186,"'":222,"[":219,"]":221,"\\":220},c5={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Cc={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},_3={16:!1,18:!1,17:!1,91:!1},b2={};for(let e=1;e<20;e++)Oc["f".concat(e)]=111+e;let p2=[],wc=null,KH="all";const wi=new Map,Vc=e=>Oc[e.toLowerCase()]||c5[e.toLowerCase()]||e.toUpperCase().charCodeAt(0),SI=e=>Object.keys(Oc).find(t=>Oc[t]===e),EI=e=>Object.keys(c5).find(t=>c5[t]===e);function JH(e){KH=e||"all"}function Dc(){return KH||"all"}function MI(){return p2.slice(0)}function AI(){return p2.map(e=>SI(e)||EI(e)||String.fromCharCode(e))}function _I(){const e=[];return Object.keys(b2).forEach(t=>{b2[t].forEach(n=>{let{key:l,scope:o,mods:a,shortcut:i}=n;e.push({scope:o,shortcut:i,mods:a,keys:l.split("+").map(s=>Vc(s))})})}),e}function OI(e){const t=e.target||e.srcElement,{tagName:n}=t;let l=!0;const o=n==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(o||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(l=!1),l}function CI(e){return typeof e=="string"&&(e=Vc(e)),p2.indexOf(e)!==-1}function wI(e,t){let n,l;e||(e=Dc());for(const o in b2)if(Object.prototype.hasOwnProperty.call(b2,o))for(n=b2[o],l=0;l<n.length;)n[l].scope===e?n.splice(l,1).forEach(i=>{let{element:s}=i;return gv(s)}):l++;Dc()===e&&JH(t||"all")}function VI(e){let t=e.keyCode||e.which||e.charCode;const n=p2.indexOf(t);if(n>=0&&p2.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&p2.splice(0,p2.length),(t===93||t===224)&&(t=91),t in _3){_3[t]=!1;for(const l in c5)c5[l]===t&&(q3[l]=!1)}}function eS(e){if(typeof e>"u")Object.keys(b2).forEach(o=>{Array.isArray(b2[o])&&b2[o].forEach(a=>Ep(a)),delete b2[o]}),gv(null);else if(Array.isArray(e))e.forEach(o=>{o.key&&Ep(o)});else if(typeof e=="object")e.key&&Ep(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];let[o,a]=n;typeof o=="function"&&(a=o,o=""),Ep({key:e,scope:o,method:a,splitKey:"+"})}}const Ep=e=>{let{key:t,scope:n,method:l,splitKey:o="+"}=e;YH(t).forEach(i=>{const s=i.split(o),c=s.length,u=s[c-1],Q=u==="*"?"*":Vc(u);if(!b2[Q])return;n||(n=Dc());const f=c>1?WH(c5,s):[],h=[];b2[Q]=b2[Q].filter(p=>{const v=(l?p.method===l:!0)&&p.scope===n&&HI(p.mods,f);return v&&h.push(p.element),!v}),h.forEach(p=>gv(p))})};function tS(e,t,n,l){if(t.element!==l)return;let o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(const a in _3)Object.prototype.hasOwnProperty.call(_3,a)&&(!_3[a]&&t.mods.indexOf(+a)>-1||_3[a]&&t.mods.indexOf(+a)===-1)&&(o=!1);(t.mods.length===0&&!_3[16]&&!_3[18]&&!_3[17]&&!_3[91]||o||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(p2),t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function nS(e,t){const n=b2["*"];let l=e.keyCode||e.which||e.charCode;if(!q3.filter.call(this,e))return;if((l===93||l===224)&&(l=91),p2.indexOf(l)===-1&&l!==229&&p2.push(l),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{const c=Cc[s];e[s]&&p2.indexOf(c)===-1?p2.push(c):!e[s]&&p2.indexOf(c)>-1?p2.splice(p2.indexOf(c),1):s==="metaKey"&&e[s]&&(p2=p2.filter(u=>u in Cc||u===l))}),l in _3){_3[l]=!0;for(const s in c5)if(Object.prototype.hasOwnProperty.call(c5,s)){const c=Cc[c5[s]];q3[s]=e[c]}if(!n)return}for(const s in _3)Object.prototype.hasOwnProperty.call(_3,s)&&(_3[s]=e[Cc[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(p2.indexOf(17)===-1&&p2.push(17),p2.indexOf(18)===-1&&p2.push(18),_3[17]=!0,_3[18]=!0);const o=Dc();if(n)for(let s=0;s<n.length;s++)n[s].scope===o&&(e.type==="keydown"&&n[s].keydown||e.type==="keyup"&&n[s].keyup)&&tS(e,n[s],o,t);if(!(l in b2))return;const a=b2[l],i=a.length;for(let s=0;s<i;s++)if((e.type==="keydown"&&a[s].keydown||e.type==="keyup"&&a[s].keyup)&&a[s].key){const c=a[s],{splitKey:u}=c,Q=c.key.split(u),f=[];for(let h=0;h<Q.length;h++)f.push(Vc(Q[h]));f.sort().join("")===p2.sort().join("")&&tS(e,c,o,t)}}function q3(e,t,n){p2=[];const l=YH(e);let o=[],a="all",i=document,s=0,c=!1,u=!0,Q="+",f=!1,h=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(a=t.scope),t.element&&(i=t.element),t.keyup&&(c=t.keyup),t.keydown!==void 0&&(u=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(Q=t.splitKey),t.single===!0&&(h=!0)),typeof t=="string"&&(a=t),h&&eS(e,a);s<l.length;s++)e=l[s].split(Q),o=[],e.length>1&&(o=WH(c5,e)),e=e[e.length-1],e=e==="*"?"*":Vc(e),e in b2||(b2[e]=[]),b2[e].push({keyup:c,keydown:u,scope:a,mods:o,shortcut:l[s],method:n,key:l[s],splitKey:Q,element:i});if(typeof i<"u"&&window){if(!wi.has(i)){const p=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return nS(v,i)},g=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;nS(v,i),VI(v)};wi.set(i,{keydownListener:p,keyupListenr:g,capture:f}),yv(i,"keydown",p,f),yv(i,"keyup",g,f)}if(!wc){const p=()=>{p2=[]};wc={listener:p,capture:f},yv(window,"focus",p,f)}}}function DI(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(b2).forEach(n=>{b2[n].filter(o=>o.scope===t&&o.shortcut===e).forEach(o=>{o&&o.method&&o.method()})})}function gv(e){const t=Object.values(b2).flat();if(t.findIndex(l=>{let{element:o}=l;return o===e})<0){const{keydownListener:l,keyupListenr:o,capture:a}=wi.get(e)||{};l&&o&&(_c(e,"keyup",o,a),_c(e,"keydown",l,a),wi.delete(e))}if((t.length<=0||wi.size<=0)&&(Object.keys(wi).forEach(o=>{const{keydownListener:a,keyupListenr:i,capture:s}=wi.get(o)||{};a&&i&&(_c(o,"keyup",i,s),_c(o,"keydown",a,s),wi.delete(o))}),wi.clear(),Object.keys(b2).forEach(o=>delete b2[o]),wc)){const{listener:o,capture:a}=wc;_c(window,"focus",o,a),wc=null}}const vv={getPressedKeyString:AI,setScope:JH,getScope:Dc,deleteScope:wI,getPressedKeyCodes:MI,getAllKeyCodes:_I,isPressed:CI,filter:OI,trigger:DI,unbind:eS,keyMap:Oc,modifier:c5,modifierMap:Cc};for(const e in vv)Object.prototype.hasOwnProperty.call(vv,e)&&(q3[e]=vv[e]);if(typeof window<"u"){const e=window.hotkeys;q3.noConflict=t=>(t&&window.hotkeys===q3&&(window.hotkeys=e),q3),window.hotkeys=q3}class RI{constructor(t){ae(this,"id");ae(this,"instructionContext");ae(this,"plotContext");ae(this,"scopeContext");ae(this,"figure");this.figure=t,this.id=t.id,this.plotContext=new pv,this.scopeContext=new pv;const n=t.state;if(n.empty||n.size!==1){this.instructionContext=t,this.plotContext.push(t),this.scopeContext.push(H1.SUBPLOT);return}this.scopeContext.push(H1.TRACE);const l=t.activeSubplot.state;if(l.empty||l.size!==1){this.instructionContext=t.activeSubplot,this.plotContext.push(t.activeSubplot),this.plotContext.push(t.activeSubplot.activeTrace);return}this.instructionContext=t.activeSubplot.activeTrace,this.plotContext.push(t.activeSubplot.activeTrace)}dispose(){this.plotContext.clear(),this.scopeContext.clear()}get active(){return this.plotContext.peek()}get state(){return this.active.state}toggleScope(t){this.scopeContext.removeLast(t)||this.scopeContext.push(t),q3.setScope(this.scope)}get scope(){return this.scopeContext.peek()}isMovable(t){return this.active.isMovable(t)}moveOnce(t){this.active.moveOnce(t)}moveToExtreme(t){this.active.moveToExtreme(t)}moveToIndex(t,n){this.active.moveToIndex(t,n)}stepTrace(t){if(this.plotContext.size()>1){this.plotContext.pop();const n=this.active,l=n.activeTrace,o=l.getCurrentXValue();n.moveOnce(t);const a=n.activeTrace;if(a.getId()===l.getId()){this.plotContext.push(l),l.notifyOutOfBounds();return}this.plotContext.push(a),a.moveToXValue(o)}else{const n=this.figure.subplots[0][0];this.active.notifyOutOfBounds(),n.notifyOutOfBounds()}}enterSubplot(){if(this.active.state.type==="figure"){const n=this.active;this.plotContext.push(n.activeSubplot),this.plotContext.push(n.activeSubplot.activeTrace),this.toggleScope(H1.TRACE)}}exitSubplot(){this.plotContext.size()>2&&(this.plotContext.pop(),this.plotContext.pop(),this.active.notifyStateUpdate(),this.toggleScope(H1.TRACE))}getInstruction(t){const n=this.instructionContext.state;if(n.empty)return`No ${n.type} info available`;const l=t?"Click to activate.":xe.EMPTY;switch(n.type){case"figure":return`This is a maidr figure containing ${n.size} subplots. ${l} Use arrow keys to navigate subplots and press 'ENTER'.`;case"subplot":return`This is a maidr plot containing ${n.size} layers, and this is layer 1 of ${n.size}: ${n.trace.traceType} plot. ${l} Use Arrows to navigate data points. Toggle B for Braille, T for Text, S for Sonification, and R for Review mode.`;case"trace":return`This is a maidr plot of type: ${n.plotType}. ${l} Use Arrows to navigate data points. Toggle B for Braille, T for Text, S for Sonification, and R for Review mode.`}}}var B2=(e=>(e.VERTICAL="vert",e.HORIZONTAL="horz",e))(B2||{}),P2=(e=>(e.BAR="bar",e.BOX="box",e.CANDLESTICK="candlestick",e.DODGED="dodged_bar",e.HEATMAP="heat",e.HISTOGRAM="hist",e.LINE="line",e.NORMALIZED="stacked_normalized_bar",e.SCATTER="point",e.SMOOTH="smooth",e.STACKED="stacked_bar",e))(P2||{});function kI(e){return e!==null&&typeof e=="object"&&"x"in e}function NI(e){return typeof e=="string"||typeof e=="number"}function BI(e){return e!==null&&typeof e=="object"&&"x"in e}class rS{computeIndexAndSegment(t,n,l,o){return l===B2.HORIZONTAL?{pointIndex:t,segmentType:o[n]}:{pointIndex:n,segmentType:o[t]}}computeVisualCoordinates(t,n,l){return l===B2.HORIZONTAL?{row:t,col:n}:{row:n,col:t}}extractXValueFromPoints(t,n,l){if(Array.isArray(t)&&t.length===1&&Array.isArray(t[0])){const o=t[0][l];return this.extractXFromPoint(o)}if(Array.isArray(t)&&Array.isArray(t[n])&&t[n][l]){const o=t[n][l];return this.extractXFromPoint(o)}return null}extractXValueFromValues(t,n,l){if(this.isValidPosition(t,n,l)){const o=t[n][l];return this.extractXFromValue(o)}return null}moveToXValueInPoints(t,n,l){if(Array.isArray(t)&&t.length===1&&Array.isArray(t[0])){const c=this.findPointIndexByX(t[0],n);if(c!==-1)return l(0,c),!0;{const u=this.findNearestPointIndexByX(t[0],n);if(u!==-1){const Q=_r(t[0][u]);if(typeof n=="number"&&typeof Q=="number")return l(0,u),!0;if(typeof n=="string"&&typeof Q=="string")return l(0,u),!0}}}let o=-1,a=-1,i=Number.POSITIVE_INFINITY,s=null;if(Array.isArray(t))for(let c=0;c<t.length;c++){const u=t[c];if(Array.isArray(u)){const Q=this.findPointIndexByX(u,n);if(Q!==-1)return l(c,Q),!0;const f=this.findNearestPointIndexByX(u,n);if(f!==-1){const h=_r(u[f]);let p=Number.POSITIVE_INFINITY;typeof n=="number"&&typeof h=="number"?(p=Math.abs(h-n),p<i&&(i=p,o=c,a=f,s="numeric")):typeof n=="string"&&typeof h=="string"?o===-1&&(o=c,a=f,s="categorical"):o===-1&&(o=c,a=f,s="generic")}}}if(o!==-1&&a!==-1){const c=t[o];if(Array.isArray(c)&&_r(c[a]),s!==null)return l(o,a),!0}return!1}moveToXValueInValues(t,n,l){let o=-1,a=-1,i=Number.POSITIVE_INFINITY,s=null;for(let c=0;c<t.length;c++)for(let u=0;u<t[c].length;u++){const Q=t[c][u],f=this.extractXFromValue(Q);if(f===n)return l(c,u),!0;if(typeof n=="number"&&typeof f=="number"){const h=Math.abs(f-n);h<i&&(i=h,o=c,a=u,s="numeric")}else typeof n=="string"&&typeof f=="string"?o===-1&&(o=c,a=u,s="categorical"):o===-1&&(o=c,a=u,s="generic")}return o!==-1&&a!==-1?(this.extractXFromValue(t[o][a]),l(o,a),!0):!1}extractXFromPoint(t){return BI(t)?t.x:null}extractXFromValue(t){return kI(t)?t.x:NI(t)?t:null}findPointIndexByX(t,n){return t.findIndex(l=>l.x===n)}isValidPosition(t,n,l){return n>=0&&n<t.length&&l>=0&&l<t[n].length}findNearestPointIndexByX(t,n){if(typeof n=="number"){let l=-1,o=Number.POSITIVE_INFINITY;for(let a=0;a<t.length;a++){const i=_r(t[a]);if(typeof i=="number"){const s=Math.abs(i-n);s<o&&(o=s,l=a)}else if(typeof i=="string"){const s=Number(i);if(!Number.isNaN(s)){const c=Math.abs(s-n);c<o&&(o=c,l=a)}}}if(l!==-1)return _r(t[l]),l}else if(typeof n=="string"){for(let o=0;o<t.length;o++)if(_r(t[o])===n)return o;const l=Number(n);if(!Number.isNaN(l)){let o=-1,a=Number.POSITIVE_INFINITY;for(let i=0;i<t.length;i++){const s=_r(t[i]);if(typeof s=="number"){const c=Math.abs(s-l);c<a&&(a=c,o=i)}else if(typeof s=="string"){const c=Number(s);if(!Number.isNaN(c)){const u=Math.abs(c-l);u<a&&(a=u,o=i)}}}if(o!==-1)return _r(t[o]),o}for(let o=0;o<t.length;o++)if(typeof _r(t[o])=="string")return o}return t.length>0?(_r(t[0]),0):-1}dispose(){}}function PI(e){return e&&typeof e=="object"&&"x"in e&&"y"in e}function II(e){return e&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}function jI(e){return e&&typeof e=="object"&&"xMin"in e&&"xMax"in e}function FI(e){return e&&typeof e=="object"&&"x"in e&&"y"in e}function zI(e){return e&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"}function qI(e){return e&&typeof e=="object"&&"value"in e}function _r(e){return e?PI(e)||II(e)||FI(e)||zI(e)||jI(e)?e.x:qI(e)?e.value:null:null}const $I="unavailable",UI="X",GI="Y",ZI="unavailable";class Lv{constructor(){ae(this,"observers");ae(this,"isInitialEntry");ae(this,"isOutOfBounds");ae(this,"row");ae(this,"col");this.observers=new Array,this.isInitialEntry=!0,this.isOutOfBounds=!1,this.row=0,this.col=0}dispose(){for(const t of this.observers)this.removeObserver(t);this.observers.length=0}moveOnce(t){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(t)){this.notifyOutOfBounds();return}switch(t){case"UPWARD":this.row+=1;break;case"DOWNWARD":this.row-=1;break;case"FORWARD":this.col+=1;break;case"BACKWARD":this.col-=1;break}this.notifyStateUpdate()}getSafeIndices(){var o;const t=this.values,n=this.row>=0&&this.row<t.length?this.row:0,l=this.col>=0&&this.col<(((o=t[n])==null?void 0:o.length)||0)?this.col:0;return{row:n,col:l}}moveToExtreme(t){var n;switch(this.isInitialEntry&&this.handleInitialEntry(),t){case"UPWARD":this.row=this.values.length-1;break;case"DOWNWARD":this.row=0;break;case"FORWARD":{const{row:l}=this.getSafeIndices();this.col=(n=this.values[l])!=null&&n.length?this.values[l].length-1:0;break}case"BACKWARD":this.col=0;break}this.notifyStateUpdate()}moveToIndex(t,n){this.isMovable([t,n])&&(this.row=t,this.col=n,this.isInitialEntry=!1,this.notifyStateUpdate())}isMovable(t){var n,l;if(Array.isArray(t)){const[o,a]=t,{row:i}=this.getSafeIndices();return o>=0&&o<this.values.length&&a>=0&&a<(((n=this.values[i])==null?void 0:n.length)||0)}switch(t){case"UPWARD":return this.row<this.values.length-1;case"DOWNWARD":return this.row>0;case"FORWARD":{const{row:o}=this.getSafeIndices();return this.col<(((l=this.values[o])==null?void 0:l.length)||0)-1}case"BACKWARD":return this.col>0}}handleInitialEntry(){var n;this.isInitialEntry=!1,this.row=Math.max(0,Math.min(this.row,this.values.length-1));const{row:t}=this.getSafeIndices();this.col=Math.max(0,Math.min(this.col,(((n=this.values[t])==null?void 0:n.length)||0)-1))}addObserver(t){this.observers.push(t)}removeObserver(t){this.observers=this.observers.filter(n=>n!==t)}notifyStateUpdate(){const t=this.state;for(const n of this.observers)n.update(t)}notifyOutOfBounds(){this.isOutOfBounds=!0,this.notifyStateUpdate(),this.isOutOfBounds=!1}}class As extends Lv{constructor(n){var l,o,a;super();ae(this,"id");ae(this,"type");ae(this,"title");ae(this,"xAxis");ae(this,"yAxis");ae(this,"fill");ae(this,"navigationService");this.navigationService=new rS,this.id=n.id,this.type=n.type,this.title=n.title??$I,this.xAxis=((l=n.axes)==null?void 0:l.x)??UI,this.yAxis=((o=n.axes)==null?void 0:o.y)??GI,this.fill=((a=n.axes)==null?void 0:a.fill)??ZI}dispose(){this.values.length=0,this.highlightValues&&(this.highlightValues.forEach(n=>n.forEach(l=>{(Array.isArray(l)?l:[l]).forEach(a=>a.remove())})),this.highlightValues.length=0),super.dispose()}get state(){var n;if(this.isOutOfBounds){const{row:l,col:o}=this.getSafeIndices(),a=this.values;return{empty:!0,type:"trace",traceType:this.type,audio:{size:((n=a[l])==null?void 0:n.length)||0,index:o}}}return{empty:!1,type:"trace",traceType:this.type,plotType:this.type,title:this.title,xAxis:this.xAxis,yAxis:this.yAxis,fill:this.fill,hasMultiPoints:this.hasMultiPoints(),audio:this.audio(),braille:this.braille(),text:this.text(),autoplay:this.autoplay,highlight:this.highlight()}}highlight(){var n;if(this.highlightValues===null||this.isInitialEntry){const{row:l,col:o}=this.getSafeIndices(),a=this.values;return{empty:!0,type:"trace",traceType:this.type,audio:{size:((n=a[l])==null?void 0:n.length)||0,index:o}}}return{empty:!1,elements:this.highlightValues[this.row][this.col]}}getAudioGroupIndex(){return this.values&&this.values.length>1?{groupIndex:this.row}:{}}get autoplay(){var o;const{row:n}=this.getSafeIndices(),l=((o=this.values[n])==null?void 0:o.length)||0;return{UPWARD:this.values.length,DOWNWARD:this.values.length,FORWARD:l,BACKWARD:l}}hasMultiPoints(){return!1}getCurrentXValue(){if(this.hasPointsArray()){const n=this.getPointsArray();if(this.isValidPointsArray(n))return this.navigationService.extractXValueFromPoints(n,this.row,this.col)}if(this.hasValuesArray()){const n=this.values;if(this.isValidValuesArray(n))return this.navigationService.extractXValueFromValues(n,this.row,this.col)}return null}moveToXValue(n){if(this.hasPointsArray()){const l=this.getPointsArray();if(this.isValidPointsArray(l))return this.navigationService.moveToXValueInPoints(l,n,this.moveToIndex.bind(this))}if(this.hasValuesArray()){const l=this.values;if(this.isValidValuesArray(l))return this.navigationService.moveToXValueInValues(l,n,this.moveToIndex.bind(this))}return!1}hasPointsArray(){return"points"in this&&this.points!==void 0}hasValuesArray(){return"values"in this&&this.values!==void 0}getPointsArray(){return this.points}isValidPointsArray(n){return Array.isArray(n)&&n.length>0}isValidValuesArray(n){return Array.isArray(n)&&n.length>0}getId(){return this.id}}class $3{constructor(){}static safeMin(t){return t.length===0?1/0:Math.min(...t)}static safeMax(t){return t.length===0?-1/0:Math.max(...t)}static minFrom2D(t){const n=t.flat();return this.safeMin(n)}static maxFrom2D(t){const n=t.flat();return this.safeMax(n)}static minMax(t){if(t.length===0)return{min:1/0,max:-1/0};let n=t[0],l=t[0];for(let o=1;o<t.length;o++){const a=t[o];a<n&&(n=a),a>l&&(l=a)}return{min:n,max:l}}static minMaxFrom2D(t){const n=t.flat();return this.minMax(n)}}class Mp{constructor(){}static parse(t){const n=t.replace(/\s/g,"").toLowerCase();if(/^#(?:[a-f0-9]{3}){1,2}$/.test(n)){let o=n.substring(1).split("");return o.length===3&&(o=[o[0],o[0],o[1],o[1],o[2],o[2]]),{r:Number.parseInt(o[0]+o[1],16),g:Number.parseInt(o[2]+o[3],16),b:Number.parseInt(o[4]+o[5],16)}}const l=n.match(/^rgba?\((\d+),(\d+),(\d+)(?:,\d*(?:\.\d*)?)?\)$/);return l?{r:Number.parseInt(l[1],10),g:Number.parseInt(l[2],10),b:Number.parseInt(l[3],10)}:null}static invert(t){return{r:255-t.r,g:255-t.g,b:255-t.b}}static getContrastRatio(t,n){const l=this.calculateLuminance(t),o=this.calculateLuminance(n);return(Math.max(l,o)+.05)/(Math.min(l,o)+.05)}static calculateLuminance(t){const[n,l,o]=[t.r,t.g,t.b].map(a=>{const i=a/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*n+.7152*l+.0722*o}static rgbToString(t){return`rgb(${t.r}, ${t.g}, ${t.b})`}}class C1{constructor(){}static async toBase64(t){try{const n=new XMLSerializer().serializeToString(t).replace(/>\s+</g,"> <").replace(/\s{2,}/g," ").trim(),o=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n).replace(/'/g,"%27").replace(/"/g,"%22")}`,a=await new Promise((c,u)=>{const Q=new Image;Q.onload=()=>c(Q),Q.onerror=()=>u(new Error("Failed to load SVG image")),Q.src=o}),i=document.createElement("canvas");[i.width,i.height]=[a.naturalWidth,a.naturalHeight];const s=i.getContext("2d");return s?(s.drawImage(a,0,0),i.toDataURL("image/jpeg",.92)):(console.error("Error converting SVG to Base 64: Canvas context unavailable"),"")}catch(n){return console.error("Error converting SVG to Base 64:",n instanceof Error?n.message:n),""}}static selectAllElements(t,n=!0){return Array.from(document.querySelectorAll(t)).map(l=>{if(!n)return l;const o=l.cloneNode(!0);return o.setAttribute(xe.VISIBILITY,xe.HIDDEN),l.insertAdjacentElement(xe.AFTER_END,o),o})}static selectElement(t,n=!0){const l=document.querySelector(t);if(!n)return l;const o=l==null?void 0:l.cloneNode(!0);return o==null||o.setAttribute(xe.VISIBILITY,xe.HIDDEN),l==null||l.insertAdjacentElement(xe.AFTER_END,o),o}static createEmptyElement(t="rect"){const n=document.createElementNS(this.SVG_NAMESPACE,t);return n.setAttribute(xe.FILL,xe.TRANSPARENT),n.setAttribute(xe.STROKE,xe.TRANSPARENT),n.setAttribute(xe.VISIBILITY,xe.HIDDEN),n}static createCircleElement(t,n,l){var u;const o=window.getComputedStyle(l),a=o.stroke||o.fill,i=o.strokeWidth||"2",s=Number.parseFloat(i)*2,c=document.createElementNS(this.SVG_NAMESPACE,xe.CIRCLE);return c.setAttribute(xe.CIRCLE_X,String(t)),c.setAttribute(xe.CIRCLE_Y,String(n)),c.setAttribute(xe.RADIUS,String(s)),c.setAttribute(xe.FILL,a),c.setAttribute(xe.STROKE,a),c.setAttribute(xe.STROKE_WIDTH,i),c.setAttribute(xe.VISIBILITY,xe.HIDDEN),(u=l.parentElement)==null||u.insertAdjacentElement(xe.AFTER_END,c),c}static createLineElement(t,n){const o=t.getBBox();let a,i,s,c;switch(n){case"top":[a,i,s,c]=[o.x,o.y,o.x+o.width,o.y];break;case"bottom":[a,i,s,c]=[o.x,o.y+o.height,o.x+o.width,o.y+o.height];break;case"left":[a,i,s,c]=[o.x,o.y,o.x,o.y+o.height];break;case"right":[a,i,s,c]=[o.x+o.width,o.y,o.x+o.width,o.y+o.height];break}const u=window.getComputedStyle(t),Q=document.createElementNS(this.SVG_NAMESPACE,xe.LINE);return Q.setAttribute(xe.X1,String(a)),Q.setAttribute(xe.Y1,String(i)),Q.setAttribute(xe.X2,String(s)),Q.setAttribute(xe.Y2,String(c)),Q.setAttribute(xe.STROKE,u.stroke),Q.setAttribute(xe.STROKE_WIDTH,u.strokeWidth||"2"),Q.setAttribute(xe.VISIBILITY,xe.HIDDEN),t.insertAdjacentElement(xe.AFTER_END,Q),Q}static createHighlightElement(t,n){const l=t.cloneNode(!0),o=t.tagName.toLowerCase(),a=o===xe.POLYLINE||o===xe.LINE,i=a?window.getComputedStyle(t).getPropertyValue(xe.STROKE):window.getComputedStyle(t).getPropertyValue(xe.FILL),s=this.getHighlightColor(i,n);if(l.setAttribute(xe.VISIBILITY,xe.VISIBLE),l.setAttribute(xe.STROKE,s),l.setAttribute(xe.FILL,s),l.style.fill=s,l.style.stroke=s,a){const c=window.getComputedStyle(l).getPropertyValue(xe.STROKE_WIDTH);l.setAttribute(xe.STROKE_WIDTH,`${c+2}`)}return t.insertAdjacentElement(xe.AFTER_END,l),l}static getHighlightColor(t,n){const l=Mp.parse(t);if(!l||!(Mp.getContrastRatio(l,xe.HIGHLIGHT_BASE_COLOR)<xe.HIGHLIGHT_CONTRAST_RATIO))return n;const i={...l};return l.r===l.g&&l.g===l.b?(i.r=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.r*xe.HIGHLIGHT_COLOR_RATIO)),i.g=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.g*xe.HIGHLIGHT_COLOR_RATIO)),i.b=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.b*xe.HIGHLIGHT_COLOR_RATIO))):l.r>=l.g&&l.r>=l.b?i.r=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.r*xe.HIGHLIGHT_COLOR_RATIO)):l.g>=l.r&&l.g>=l.b?i.g=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.g*xe.HIGHLIGHT_COLOR_RATIO)):i.b=Math.min(xe.HIGHLIGHT_MAX_COLOR,Math.floor(l.b*xe.HIGHLIGHT_COLOR_RATIO)),Mp.rgbToString(i)}static getContrastingColorForElement(t){const n=window.getComputedStyle(t).fill||"rgb(255,255,255)",l=Mp.parse(n);return l?(.2126*l.r+.7152*l.g+.0722*l.b)/255>.5?"#000":"#fff":"#000"}static setSubplotHighlightCss(t,n){t.style.outline=`4px solid ${n}`,t.style.outlineOffset="3px",t.style.borderRadius="3px",t.style.overflow="visible"}static removeSubplotHighlightCss(t){t.style.removeProperty("outline"),t.style.removeProperty("outline-offset"),t.style.removeProperty("border-radius"),t.style.removeProperty("overflow")}static setSubplotHighlightSvgWithAdaptiveColor(t,n,l){const o=t.querySelector("rect, path");let a="";if(o){a=window.getComputedStyle(o).getPropertyValue("fill"),(!a||a==="none"||a==="transparent"||a==="rgba(0, 0, 0, 0)")&&(l?a=window.getComputedStyle(l).getPropertyValue("fill"):a=n);const i=this.getHighlightColor(a,n);o.setAttribute("stroke",i),o.setAttribute("stroke-width","4")}}static removeSubplotHighlightSvg(t){const n=t.querySelector("rect, path");n&&(n.removeAttribute("stroke"),n.removeAttribute("stroke-width"))}}ae(C1,"SVG_NAMESPACE","http://www.w3.org/2000/svg");class xv extends As{constructor(n,l){super(n);ae(this,"points");ae(this,"barValues");ae(this,"highlightValues");ae(this,"orientation");ae(this,"min");ae(this,"max");this.points=l,this.orientation=n.orientation??B2.VERTICAL,this.barValues=l.map(o=>o.map(a=>this.orientation===B2.VERTICAL?Number(a.y):Number(a.x))),this.min=this.barValues.map(o=>$3.safeMin(o)),this.max=this.barValues.map(o=>$3.safeMax(o)),this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.points.length=0,this.min.length=0,this.max.length=0,super.dispose()}get values(){return this.barValues}audio(){const n=this.orientation===B2.VERTICAL,l=n?this.barValues[this.row].length:this.barValues.length,o=n?this.col:this.row,a=n?this.barValues[this.row][this.col]:this.barValues[this.col][this.row];return{min:$3.safeMin(this.min),max:$3.safeMax(this.max),size:l,index:o,value:a,...this.getAudioGroupIndex()}}braille(){return{empty:!1,id:this.id,values:this.barValues,min:this.min,max:this.max,row:this.row,col:this.col}}text(){const n=this.orientation===B2.VERTICAL,l=this.points[this.row][this.col],o=n?this.xAxis:this.yAxis,a=n?l.x:l.y,i=n?this.yAxis:this.xAxis,s=n?l.y:l.x;return{main:{label:o,value:a},cross:{label:i,value:s}}}mapToSvgElements(n){if(!n)return null;const l=[C1.selectAllElements(n)];if(l.length!==this.points.length)return null;for(let o=0;o<this.points.length;o++)if(l[o].length!==this.points[o].length)return null;return l}}class XI extends xv{constructor(t){super(t,[t.data])}}const WI="Lower outlier(s)",YI="Upper outlier(s)",KI="Minimum",JI="Maximum",ej="25%",tj="50%",nj="75%";class rj extends As{constructor(n){super(n);ae(this,"points");ae(this,"boxValues");ae(this,"highlightValues");ae(this,"orientation");ae(this,"sections");ae(this,"min");ae(this,"max");this.points=n.data,this.orientation=n.orientation??B2.VERTICAL,this.sections=[WI,KI,ej,tj,nj,JI,YI];const l=[a=>a.lowerOutliers,a=>a.min,a=>a.q1,a=>a.q2,a=>a.q3,a=>a.max,a=>a.upperOutliers];this.orientation===B2.HORIZONTAL?this.boxValues=this.points.map(a=>l.map(i=>i(a))):this.boxValues=l.map(a=>this.points.map(i=>a(i)));const o=this.boxValues.map(a=>a.flatMap(i=>Array.isArray(i)?i:[i]));this.min=$3.minFrom2D(o),this.max=$3.maxFrom2D(o),this.row=this.boxValues.length-1,this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.points.length=0,this.sections.length=0,super.dispose()}moveToIndex(n,l){const o=this.orientation===B2.HORIZONTAL;n=o?n:l,l=o?l:n,super.moveToIndex(n,l)}get values(){return this.boxValues}audio(){const n=this.boxValues[this.row][this.col],l=Array.isArray(n)?n.map(o=>o-this.min):n-this.min;return{min:this.min,max:this.max,value:n,size:this.max-this.min,index:l}}braille(){const n=this.orientation===B2.HORIZONTAL,l=n?this.row:this.col,o=n?this.col:this.row;return{empty:!1,id:this.id,values:this.points,min:this.min,max:this.max,row:l,col:o}}text(){const n=this.orientation===B2.HORIZONTAL,l=n?this.points[this.row]:this.points[this.col],o=n?this.yAxis:this.xAxis,a=n?this.sections[this.col]:this.sections[this.row],i=n?this.xAxis:this.yAxis,s=this.boxValues[this.row][this.col];return{main:{label:o,value:l.fill},cross:{label:i,value:s},section:a}}mapToSvgElements(n){if(!n||n.length!==this.points.length)return null;const l=this.orientation===B2.VERTICAL,o=new Array;if(l)for(let a=0;a<this.sections.length;a++)o.push(Array.from({length:n.length}));return n.forEach((a,i)=>{const s=a.lowerOutliers.flatMap(b=>C1.selectAllElements(b)),c=a.upperOutliers.flatMap(b=>C1.selectAllElements(b)),u=C1.selectElement(a.min)??C1.createEmptyElement(),Q=C1.selectElement(a.max)??C1.createEmptyElement(),f=C1.selectElement(a.iq)??C1.createEmptyElement(),h=C1.selectElement(a.q2)??C1.createEmptyElement(),[p,g]=l?[C1.createLineElement(f,"top"),C1.createLineElement(f,"bottom")]:[C1.createLineElement(f,"left"),C1.createLineElement(f,"right")],v=[s,u,p,h,g,Q,c];l?v.forEach((b,L)=>{o[L][i]=b}):o.push(v)}),o}}const ij="Trend";class aj extends As{constructor(n){super(n);ae(this,"candles");ae(this,"candleValues");ae(this,"orientation");ae(this,"sections",["open","high","low","close"]);ae(this,"currentSegmentType","open");ae(this,"currentPointIndex",0);ae(this,"sortedSegmentsByPoint");ae(this,"segmentPositionMaps");ae(this,"min");ae(this,"max");ae(this,"highlightValues");ae(this,"navigationService");this.navigationService=new rS;const l=n.data;this.candles=l.map(a=>({...a,trend:a.close>a.open?"Bull":a.close<a.open?"Bear":"Neutral"})),this.orientation=n.orientation??B2.VERTICAL,this.candleValues=this.sections.map(a=>this.candles.map(i=>i[a])),this.min=$3.minFrom2D(this.candleValues),this.max=$3.maxFrom2D(this.candleValues),this.sortedSegmentsByPoint=this.precomputeSortedSegments(),this.segmentPositionMaps=this.precomputePositionMaps(),this.currentPointIndex=0,this.currentSegmentType="open",this.orientation===B2.HORIZONTAL?this.col=0:this.row=0;const o=typeof n.selectors=="string"?n.selectors:"";this.highlightValues=this.mapToSvgElements(o)}precomputeSortedSegments(){return this.candles.map(n=>this.sections.map(o=>[o,n[o]]).sort((o,a)=>o[1]-a[1]).map(o=>o[0]))}precomputePositionMaps(){return this.sortedSegmentsByPoint.map(n=>{const l=new Map;return n.forEach((o,a)=>{l.set(o,a)}),l})}getSegmentPositionInSortedOrder(n,l){return this.segmentPositionMaps[n].get(l)??0}getSegmentTypeAtSortedPosition(n,l){return this.sortedSegmentsByPoint[n][l]??"open"}updateVisualSegmentPosition(){const n=this.getSegmentPositionInSortedOrder(this.currentPointIndex,this.currentSegmentType);this.orientation===B2.HORIZONTAL?this.col=n:this.row=n}updateVisualPointPosition(){this.orientation===B2.HORIZONTAL?this.row=this.currentPointIndex:this.col=this.currentPointIndex}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}switch(n){case"UPWARD":case"DOWNWARD":{const l=this.getSegmentPositionInSortedOrder(this.currentPointIndex,this.currentSegmentType),o=n==="UPWARD"?l+1:l-1;if(o>=0&&o<this.sections.length)this.currentSegmentType=this.getSegmentTypeAtSortedPosition(this.currentPointIndex,o),this.updateVisualSegmentPosition();else{this.notifyOutOfBounds();return}break}case"FORWARD":case"BACKWARD":{const l=n==="FORWARD"?this.currentPointIndex+1:this.currentPointIndex-1;if(l>=0&&l<this.candles.length)this.currentPointIndex=l,this.updateVisualPointPosition(),this.updateVisualSegmentPosition();else{this.notifyOutOfBounds();return}break}}this.notifyStateUpdate()}moveToExtreme(n){switch(this.isInitialEntry&&this.handleInitialEntry(),n){case"UPWARD":{const l=this.sortedSegmentsByPoint[this.currentPointIndex];this.currentSegmentType=l[l.length-1],this.updateVisualSegmentPosition();break}case"DOWNWARD":{const l=this.sortedSegmentsByPoint[this.currentPointIndex];this.currentSegmentType=l[0],this.updateVisualSegmentPosition();break}case"FORWARD":{this.currentPointIndex=this.candles.length-1,this.updateVisualPointPosition(),this.updateVisualSegmentPosition();break}case"BACKWARD":{this.currentPointIndex=0,this.updateVisualPointPosition(),this.updateVisualSegmentPosition();break}}this.notifyStateUpdate()}moveToIndex(n,l){this.isInitialEntry&&this.handleInitialEntry();const{pointIndex:o,segmentType:a}=this.navigationService.computeIndexAndSegment(n,l,this.orientation,this.sections);this.currentPointIndex=o,this.currentSegmentType=a,this.row=n,this.col=l,this.updateVisualSegmentPosition(),this.updateVisualPointPosition(),this.notifyStateUpdate()}isMovable(n){if(Array.isArray(n))return super.isMovable(n);if(this.isInitialEntry)return!0;switch(n){case"UPWARD":case"DOWNWARD":{const l=this.getSegmentPositionInSortedOrder(this.currentPointIndex,this.currentSegmentType),o=n==="UPWARD"?l+1:l-1;return o>=0&&o<this.sections.length}case"FORWARD":case"BACKWARD":{const l=n==="FORWARD"?this.currentPointIndex+1:this.currentPointIndex-1;return l>=0&&l<this.candles.length}}}dispose(){this.navigationService.dispose(),this.candles.length=0,super.dispose()}get values(){return this.candleValues}audio(){const n=this.candles[this.currentPointIndex][this.currentSegmentType];return{min:this.min,max:this.max,size:this.candles.length,index:this.currentPointIndex,value:n,trend:this.candles[this.currentPointIndex].trend}}braille(){const n=this.candles.map(l=>l.trend);return{empty:!1,id:this.id,values:this.candleValues,min:this.min,max:this.max,row:this.row,col:this.col,custom:n}}mapToSvgElements(n){if(!n)return null;const l=C1.selectAllElements(n),o=[];for(let a=0;a<this.sections.length;a++){o[a]=[];for(let i=0;i<this.candles.length;i++){const s=i<l.length?i:0;o[a][i]=l[s]}}return o}text(){const n=this.candles[this.currentPointIndex],l=n[this.currentSegmentType];return{main:{label:this.orientation===B2.HORIZONTAL?this.yAxis:this.xAxis,value:n.value},cross:{label:this.orientation===B2.HORIZONTAL?this.xAxis:this.yAxis,value:l},section:this.currentSegmentType,fill:{label:ij,value:n.trend}}}getCurrentTrend(){return this.candles[this.currentPointIndex].trend}getCurrentXValue(){return this.currentPointIndex>=0&&this.currentPointIndex<this.candles.length?this.candles[this.currentPointIndex].value:null}moveToXValue(n){const l=this.candles.findIndex(o=>o.value===n);return l!==-1?(this.currentPointIndex=l,this.currentSegmentType="open",this.updateVisualPointPosition(),this.updateVisualSegmentPosition(),this.notifyStateUpdate(),!0):!1}}class oj extends As{constructor(n){super(n);ae(this,"heatmapValues");ae(this,"highlightValues");ae(this,"x");ae(this,"y");ae(this,"min");ae(this,"max");const l=n.data;this.x=l.x,this.y=[...l.y].reverse(),this.heatmapValues=[...l.points].reverse();const{min:o,max:a}=$3.minMaxFrom2D(this.heatmapValues);this.min=o,this.max=a,this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.heatmapValues.length=0,this.x.length=0,this.y.length=0,super.dispose()}get values(){return this.heatmapValues}audio(){return{min:this.min,max:this.max,size:this.heatmapValues.length,index:this.col,value:this.heatmapValues[this.row][this.col]}}braille(){return{empty:!1,id:this.id,values:this.heatmapValues,min:this.min,max:this.max,row:this.row,col:this.col}}text(){return{main:{label:this.xAxis,value:this.x[this.col]},cross:{label:this.yAxis,value:this.y[this.row]},fill:{label:this.fill,value:String(this.heatmapValues[this.row][this.col])}}}mapToSvgElements(n){if(!n)return null;const l=this.heatmapValues.length,o=this.heatmapValues[0].length,a=C1.selectAllElements(n);if(a.length===0||a.length!==l*o)return null;const i=new Array;if(a[0]instanceof SVGPathElement)for(let s=0;s<l;s++){const c=l-1-s,u=new Array;for(let Q=0;Q<o;Q++){const f=c*o+Q;u.push(a[f])}i.push(u)}else if(a[0]instanceof SVGRectElement)for(let s=0;s<l;s++){const c=new Array;for(let u=0;u<o;u++){const Q=u*l+s;c.push(a[Q])}i.push(c)}return i}}class lj extends xv{constructor(t){super(t,[t.data])}text(){const t=this.orientation===B2.VERTICAL,n=this.points[this.row][this.col],l=t?n.xMin:n.yMin,o=t?n.xMax:n.yMax;return{...super.text(),range:{min:l,max:o}}}}const iS="Group",bv=/[ML]\s*(-?\d+(?:\.\d+)?)\s+(-?\d+(?:\.\d+)?)/g;class aS extends As{constructor(n){super(n);ae(this,"points");ae(this,"lineValues");ae(this,"highlightValues");ae(this,"min");ae(this,"max");ae(this,"previousRow",null);this.points=n.data,this.lineValues=this.points.map(l=>l.map(o=>Number(o.y))),this.min=this.lineValues.map(l=>$3.safeMin(l)),this.max=this.lineValues.map(l=>$3.safeMax(l)),this.highlightValues=this.mapToSvgElements(n.selectors)}dispose(){this.points.length=0,this.min.length=0,this.max.length=0,super.dispose()}get values(){return this.lineValues}audio(){return{min:this.min[this.row],max:this.max[this.row],size:this.points[this.row].length,index:this.col,value:this.points[this.row][this.col].y,...this.getAudioGroupIndex()}}braille(){return{empty:!1,id:this.id,values:this.lineValues,min:this.min,max:this.max,row:this.row,col:this.col}}text(){var a;const n=this.points[this.row][this.col],l=this.findIntersections();let o={};if(l.length>1){let i=l.map(s=>{var u;const c=s.groupIndex;return((u=this.points[c][0])==null?void 0:u.fill)||`l${c+1}`});if(this.previousRow!==null){const s=((a=this.points[this.previousRow][0])==null?void 0:a.fill)||`l${this.previousRow+1}`;i.includes(s)&&(i=[s,...i.filter(c=>c!==s)])}o={fill:{label:iS,value:`intersection at (${i.join(", ")})`}}}else o=n.fill?{fill:{label:iS,value:n.fill}}:{};return{main:{label:this.xAxis,value:this.points[this.row][this.col].x},cross:{label:this.yAxis,value:this.points[this.row][this.col].y},...o}}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.previousRow=null,this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}if(this.previousRow=this.row,n==="UPWARD"||n==="DOWNWARD"){const o=this.findLineByXAndYDirection(n),a=this.points[this.row][this.col].x;if(o!==null&&o!==this.row){const i=this.findColumnByXValue(o,a);if(i!==-1){this.row=o,this.col=i;const s=this.findIntersections();if(s.length>1){const u={...super.state,intersections:s};for(const Q of this.observers)Q.update(u)}else this.notifyStateUpdate();return}else{this.notifyOutOfBounds();return}}else{this.notifyOutOfBounds();return}}switch(n){case"FORWARD":this.col+=1;break;case"BACKWARD":this.col-=1;break}const l=this.findIntersections();if(l.length>1){const a={...super.state,intersections:l};for(const i of this.observers)i.update(a)}else this.notifyStateUpdate()}findIntersections(){const n=this.points[this.row][this.col].x,l=this.points[this.row][this.col].y,o=[];for(let a=0;a<this.points.length;a++){const i=this.points[a].findIndex(s=>s.x===n&&s.y===l);i!==-1&&o.push({min:this.min[a],max:this.max[a],size:this.points[a].length,index:i,value:l,groupIndex:a})}return o}isMovable(n){if(Array.isArray(n)){const[l,o]=n;return l>=0&&l<this.values.length&&o>=0&&o<this.values[l].length}switch(n){case"UPWARD":case"DOWNWARD":{const l=this.findLineByXAndYDirection(n);if(l===null)return!1;const o=this.points[this.row][this.col].x;return this.findColumnByXValue(l,o)!==-1}case"FORWARD":return this.col<this.values[this.row].length-1;case"BACKWARD":return this.col>0}}findLineByXAndYDirection(n){const l=this.points[this.row][this.col].x;let o=null,a=Number.POSITIVE_INFINITY;for(let i=0;i<this.points.length;i++){if(i===this.row)continue;const s=this.points[i].findIndex(f=>f.x===l);if(s===-1)continue;const c=this.points[i][s].y,u=n==="UPWARD"?c>this.points[this.row][this.col].y:c<this.points[this.row][this.col].y,Q=Math.abs(c-this.points[this.row][this.col].y);u&&Q<a&&(a=Q,o=i)}return o}findColumnByXValue(n,l){return this.points[n].findIndex(o=>o.x===l)}mapToSvgElements(n){if(!n||n.length!==this.lineValues.length)return null;const l=[];let o=!0;for(let a=0;a<n.length;a++){const i=C1.selectElement(n[a],!1);if(!i){l.push([]);continue}const s=[];if(i instanceof SVGPathElement){const Q=i.getAttribute(xe.D)||xe.EMPTY;bv.lastIndex=0;let f=bv.exec(Q);for(;f!==null;)s.push({x:Number.parseFloat(f[1]),y:Number.parseFloat(f[2])}),f=bv.exec(Q)}else if(i instanceof SVGPolylineElement){const f=(i.getAttribute(xe.POINTS)||xe.EMPTY).split(/\s+/).filter(Boolean);for(const h of f){const[p,g]=h.split(xe.COMMA);s.push({x:Number.parseFloat(p),y:Number.parseFloat(g)})}}if(s.length!==this.lineValues[a].length)if(s.length<this.lineValues[a].length)for(;s.length<this.lineValues[a].length;)s.push({x:Number.NaN,y:Number.NaN});else s.length>this.lineValues[a].length&&(s.length=this.lineValues[a].length);const c=[];let u=!1;for(const Q of s){if(Number.isNaN(Q.x)||Number.isNaN(Q.y)){u=!0;break}c.push(C1.createCircleElement(Q.x,Q.y,i))}if(u){l.push([]);continue}c.length>0&&(o=!1),l.push(c)}return o?null:l}get state(){const n=super.state;if(n.empty)return n;const l={...n,plotType:this.points.length>1?"multiline":"single line"},o=this.findIntersections();return o.length>1?{...l,intersections:o}:l}}class sj extends As{constructor(n){super(n);ae(this,"mode");ae(this,"xPoints");ae(this,"yPoints");ae(this,"xValues");ae(this,"yValues");ae(this,"highlightXValues");ae(this,"highlightYValues");ae(this,"minX");ae(this,"maxX");ae(this,"minY");ae(this,"maxY");this.mode="column";const l=n.data,o=[...l].sort((c,u)=>c.x-u.x||c.y-u.y);this.xPoints=new Array;let a=null;for(const c of o)(!a||a.x!==c.x)&&(a={x:c.x,y:[]},this.xPoints.push(a)),a.y.push(c.y);const i=[...l].sort((c,u)=>c.y-u.y||c.x-u.x);this.yPoints=new Array;let s=null;for(const c of i)(!s||s.y!==c.y)&&(s={y:c.y,x:[]},this.yPoints.push(s)),s.x.push(c.x);this.xValues=this.xPoints.map(c=>c.x),this.yValues=this.yPoints.map(c=>c.y),this.minX=$3.safeMin(this.xValues),this.maxX=$3.safeMax(this.xValues),this.minY=$3.safeMin(this.yValues),this.maxY=$3.safeMax(this.yValues),[this.highlightXValues,this.highlightYValues]=this.mapToSvgElements(n.selectors)}dispose(){this.xPoints.length=0,this.yPoints.length=0,this.xValues.length=0,this.yValues.length=0,this.highlightXValues&&(this.highlightXValues.forEach(n=>n.forEach(l=>l.remove())),this.highlightXValues.length=0),this.highlightYValues&&(this.highlightYValues.forEach(n=>n.forEach(l=>l.remove())),this.highlightYValues.length=0),super.dispose()}get values(){const n=[this.xValues,this.yValues];return this.mode==="column"?this.row!==0&&(this.row=0):(this.row<0||this.row>=this.yPoints.length)&&(this.row=0),n}get highlightValues(){return this.mode==="column"?this.highlightXValues:this.highlightYValues}getAudioGroupIndex(){return{}}audio(){if(this.mode==="column"){const n=this.xPoints[this.col];return{min:this.minY,max:this.maxY,size:n.y.length,index:this.col,value:n.y,...this.getAudioGroupIndex()}}else{const n=this.yPoints[this.row];return{min:this.minX,max:this.maxX,size:n.x.length,index:this.row,value:n.x,...this.getAudioGroupIndex()}}}braille(){return{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}}}text(){if(this.mode==="column"){const n=this.xPoints[this.col];return{main:{label:this.xAxis,value:n.x},cross:{label:this.yAxis,value:n.y}}}else{const n=this.yPoints[this.row];return{main:{label:this.yAxis,value:n.y},cross:{label:this.xAxis,value:n.x}}}}get autoplay(){return{UPWARD:this.yValues.length,DOWNWARD:this.yValues.length,FORWARD:this.xValues.length,BACKWARD:this.xValues.length}}highlight(){if(this.highlightValues===null)return{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}};const n=this.mode==="column"?this.col<this.highlightValues.length?this.highlightValues[this.col]:null:this.row<this.highlightValues.length?this.highlightValues[this.row]:null;return n?{empty:!1,elements:n}:{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}}}hasMultiPoints(){return!0}handleInitialEntry(){this.isInitialEntry=!1,this.row=0,this.col=0,this.mode="column"}toggleNavigation(){if(this.mode==="column"){const n=this.xPoints[this.col],l=n.y[Math.floor(n.y.length/2)],o=this.yValues.indexOf(l);o===-1||o>=this.yPoints.length?this.row=0:this.row=o,this.mode="row"}else{const n=this.yPoints[this.row],l=n.x[Math.floor(n.x.length/2)],o=this.xValues.indexOf(l);o===-1||o>=this.xPoints.length?this.col=0:this.col=o,this.mode="column",this.row=0}}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}if(this.mode==="column")switch(n){case"FORWARD":this.col++;break;case"BACKWARD":this.col--;break;case"UPWARD":case"DOWNWARD":{this.toggleNavigation();break}}else switch(n){case"UPWARD":this.row++;break;case"DOWNWARD":this.row--;break;case"FORWARD":case"BACKWARD":{this.toggleNavigation();break}}this.notifyStateUpdate()}moveToExtreme(n){if(this.isInitialEntry&&this.handleInitialEntry(),this.mode==="column")switch(n){case"UPWARD":this.toggleNavigation(),this.row=this.yPoints.length-1;break;case"DOWNWARD":this.toggleNavigation(),this.row=0;break;case"FORWARD":this.col=this.xPoints.length-1;break;case"BACKWARD":this.col=0;break}else switch(n){case"UPWARD":this.row=this.yPoints.length-1;break;case"DOWNWARD":this.row=0;break;case"FORWARD":this.toggleNavigation(),this.col=this.xPoints.length-1;break;case"BACKWARD":this.toggleNavigation(),this.col=0;break}this.notifyStateUpdate()}isMovable(n){if(Array.isArray(n))return!1;if(this.mode==="column")switch(n){case"FORWARD":return this.col<this.xPoints.length-1;case"BACKWARD":return this.col>0;case"UPWARD":case"DOWNWARD":return!0}else switch(n){case"UPWARD":return this.row<this.yPoints.length-1;case"DOWNWARD":return this.row>0;case"FORWARD":case"BACKWARD":return!0}}mapToSvgElements(n){if(!n)return[null,null];const l=C1.selectAllElements(n);if(l.length===0)return[null,null];const o=new Map,a=new Map;l.forEach(c=>{const u=Number.parseFloat(c.getAttribute("x")||""),Q=Number.parseFloat(c.getAttribute("y")||"");Number.isNaN(u)||(o.has(u)||o.set(u,[]),o.get(u).push(c)),Number.isNaN(Q)||(a.has(Q)||a.set(Q,[]),a.get(Q).push(c))});const i=Array.from(o.entries()).sort(([c],[u])=>c-u).map(([c,u])=>u),s=Array.from(a.entries()).sort(([c],[u])=>u-c).map(([c,u])=>u);return[i,s]}}const oS="Sum",uj="Level",cj="undefined";class Tj extends xv{constructor(t){super(t,t.data),this.createSummaryLevel()}createSummaryLevel(){const t=new Array,n=new Array;for(let a=0;a<this.barValues[0].length;a++){const i=this.barValues.reduce((c,u)=>c+u[a],0);t.push(i);const s=this.orientation===B2.VERTICAL?{x:this.points[0][a].x,y:i,fill:oS}:{x:i,y:this.points[0][a].y,fill:oS};n.push(s)}this.points.push(n),this.barValues.push(t);const{min:l,max:o}=$3.minMax(t);this.min.push(l),this.max.push(o)}text(){return{...super.text(),fill:{label:uj,value:this.points[this.row][this.col].fill??cj}}}highlight(){return this.highlightValues===null||this.row===this.barValues.length-1?{empty:!0,type:"trace",traceType:this.type,audio:{index:0,size:0,groupIndex:0}}:{empty:!1,elements:this.highlightValues[this.row][this.col]}}hasMultiPoints(){return!1}mapToSvgElements(t){if(!t)return new Array;const n=C1.selectAllElements(t);if(n.length===0)return new Array;const l=new Array;if(n[0]instanceof SVGPathElement)for(let o=0,a=0;o<this.barValues.length;o++){const i=new Array;for(let s=0;s<this.barValues[o].length;s++){if(a>=n.length)return new Array;this.barValues[o][s]===0?i.push(C1.createEmptyElement()):i.push(n[a++])}l.push(i)}else if(n[0]instanceof SVGRectElement){for(let o=0;o<this.barValues.length;o++)l.push(new Array);for(let o=0,a=0;o<this.barValues[0].length;o++)for(let i=this.barValues.length-1;i>=0;i--){if(a>=n.length)return new Array;this.barValues[i][o]===0?l[i].push(C1.createEmptyElement()):l[i].push(n[a++])}}return l}}class lS extends aS{constructor(t){super(t)}audio(){const t=this.lineValues[this.row],n=this.col,l=s=>t[Math.max(0,Math.min(s,t.length-1))],o=n>0?l(n-1):l(n),a=l(n),i=n<t.length-1?l(n+1):l(n);return{min:this.min[this.row],max:this.max[this.row],size:t.length,index:n,value:[o,a,i],isContinuous:!0,...this.getAudioGroupIndex()}}}class Qj extends lS{constructor(t){super(t)}mapToSvgElements(t){var o;if(!t||t.length!==this.lineValues.length)return null;const n=[];let l=!0;for(let a=0;a<t.length;a++){const i=C1.selectElement(t[a],!1);if(!i){n.push([]);continue}const s=(o=this.points)==null?void 0:o[a],c=[];for(const u of s)typeof u.svg_x=="number"&&typeof u.svg_y=="number"&&c.push(C1.createCircleElement(u.svg_x,u.svg_y,i));c.length>0&&(l=!1),n.push(c)}return l?null:n}}function fj(e){return typeof(e==null?void 0:e.svg_x)=="number"&&typeof(e==null?void 0:e.svg_y)=="number"}function dj(e){return Array.isArray(e.data)&&e.data.length>0&&Array.isArray(e.data[0])&&fj(e.data[0][0])?new Qj(e):new lS(e)}class hj{static create(t){switch(t.type){case P2.BAR:return new XI(t);case P2.BOX:return new rj(t);case P2.CANDLESTICK:return new aj(t);case P2.HEATMAP:return new oj(t);case P2.HISTOGRAM:return new lj(t);case P2.LINE:return new aS(t);case P2.SCATTER:return new sj(t);case P2.SMOOTH:return dj(t);case P2.DODGED:case P2.NORMALIZED:case P2.STACKED:return new Tj(t);default:throw new Error(`Invalid trace type: ${t.type}`)}}}const pj="MAIDR Plot",mj="unavailable",yj="unavailable";class gj extends Lv{constructor(n){super();ae(this,"id");ae(this,"title");ae(this,"subtitle");ae(this,"caption");ae(this,"subplots");ae(this,"size");this.id=n.id,this.title=n.title??pj,this.subtitle=n.subtitle??mj,this.caption=n.caption??yj;const l=n.subplots;this.subplots=l.map(o=>o.map(a=>new vj(a))),this.size=this.subplots.reduce((o,a)=>o+a.length,0)}dispose(){this.subplots.forEach(n=>n.forEach(l=>l.dispose())),this.subplots.length=0,super.dispose()}get values(){return this.subplots}get activeSubplot(){return this.subplots[this.row][this.col]}get state(){if(this.isOutOfBounds)return{empty:!0,type:"figure"};const n=this.col+1+this.subplots.slice(0,this.row).reduce((o,a)=>o+a.length,0),l=this.activeSubplot;return{empty:!1,type:"figure",title:this.title,subtitle:this.subtitle,caption:this.caption,size:this.size,index:n,subplot:l.getStateWithFigurePosition(this.row,this.col),traceTypes:l.traceTypes,highlight:this.highlight()}}highlight(){var l;if(document.querySelectorAll('g[id^="axes_"]').length<=1)return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}};try{const o=((l=this.subplots[0])==null?void 0:l.length)||1,a=this.row*o+this.col+1,i=`g[id="axes_${a}"]`,s=document.querySelector(i);if(s)return{empty:!1,elements:s};const c=document.querySelectorAll('g[id^="axes_"]');if(c.length>0&&a-1<c.length)return{empty:!1,elements:c[a-1]}}catch{return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}}}return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}}}isMovable(n){switch(n){case"UPWARD":return this.row<this.subplots.length-1;case"DOWNWARD":return this.row>0;case"FORWARD":return this.col<this.subplots[this.row].length-1;case"BACKWARD":return this.col>0;default:return!1}}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}switch(n){case"UPWARD":this.row+=1;break;case"DOWNWARD":this.row-=1;break;case"FORWARD":this.col+=1;break;case"BACKWARD":this.col-=1;break}this.notifyStateUpdate()}}class vj extends Lv{constructor(n){super();ae(this,"traces");ae(this,"traceTypes");ae(this,"size");this.isInitialEntry=!1;const l=n.layers;this.size=l.length,this.traces=l.map(o=>[hj.create(o)]),this.traceTypes=this.traces.flat().map(o=>{const a=o.state;return a.empty?xe.EMPTY:a.traceType})}dispose(){this.traces.forEach(n=>n.forEach(l=>l.dispose())),this.traces.length=0,super.dispose()}get values(){return this.traces}get activeTrace(){return this.traces[this.row][this.col]}highlight(){return{empty:!0,type:"trace",audio:{size:this.values[this.row].length,index:this.col}}}moveOnce(n){if(this.isInitialEntry){this.handleInitialEntry(),this.notifyStateUpdate();return}if(!this.isMovable(n)){this.notifyOutOfBounds();return}switch(n){case"UPWARD":this.row+=1;break;case"DOWNWARD":this.row-=1;break;case"FORWARD":this.col+=1;break;case"BACKWARD":this.col-=1;break}this.notifyStateUpdate()}get state(){return this.isOutOfBounds?{empty:!0,type:"subplot"}:{empty:!1,type:"subplot",size:this.size,index:this.row+1,trace:this.activeTrace.state,highlight:this.highlight()}}getStateWithFigurePosition(n,l){return this.state}}const U3={SINE_BASIC:0,SQUARE_BASIC:1,SAWTOOTH_BASIC:2,TRIANGLE_BASIC:3,SAWTOOTH_DARK:4,SINE_HARMONIC:5,TRIANGLE_HARMONIC:6,SQUARE_HARMONIC:7,TRIANGLE_MELLOW:8,SINE_SUBTLE:9,SAWTOOTH_SOFT:10},Q9=class Q9{constructor(){ae(this,"basePalette");ae(this,"extendedPalette");this.basePalette=[{index:U3.SINE_BASIC,waveType:"sine",timbreModulation:{attack:.01,decay:.1,sustain:.8,release:.2}},{index:U3.SQUARE_BASIC,waveType:"square",timbreModulation:{attack:.005,decay:.05,sustain:.7,release:.15}},{index:U3.SAWTOOTH_BASIC,waveType:"sawtooth",timbreModulation:{attack:.02,decay:.08,sustain:.6,release:.25}},{index:U3.TRIANGLE_BASIC,waveType:"triangle",timbreModulation:{attack:.015,decay:.12,sustain:.9,release:.18}},{index:U3.SAWTOOTH_DARK,waveType:"sawtooth",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.2},{frequency:3,amplitude:.1},{frequency:5,amplitude:.05}]},timbreModulation:{attack:.005,decay:.3,sustain:.4,release:.5}},{index:U3.SINE_HARMONIC,waveType:"sine",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.15},{frequency:4,amplitude:.05}]},timbreModulation:{attack:.02,decay:.2,sustain:.6,release:.3}},{index:U3.TRIANGLE_HARMONIC,waveType:"triangle",harmonicMix:{fundamental:1,harmonics:[{frequency:3,amplitude:.2},{frequency:6,amplitude:.1}]},timbreModulation:{attack:.01,decay:.1,sustain:.8,release:.2}},{index:U3.SQUARE_HARMONIC,waveType:"square",harmonicMix:{fundamental:1,harmonics:[{frequency:3,amplitude:.1},{frequency:7,amplitude:.05}]},timbreModulation:{attack:.005,decay:.05,sustain:.5,release:.1}},{index:U3.TRIANGLE_MELLOW,waveType:"triangle",harmonicMix:{fundamental:1,harmonics:[{frequency:2.5,amplitude:.15},{frequency:4.5,amplitude:.08}]},timbreModulation:{attack:.01,decay:.4,sustain:.3,release:.5}},{index:U3.SINE_SUBTLE,waveType:"sine",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.1},{frequency:3,amplitude:.05}]},timbreModulation:{attack:.02,decay:.1,sustain:.9,release:.15}},{index:U3.SAWTOOTH_SOFT,waveType:"sawtooth",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.05},{frequency:6,amplitude:.02}]},timbreModulation:{attack:.005,decay:.4,sustain:.2,release:.6}}],this.validateBasePalette(),this.extendedPalette=new Map,this.generateExtendedPalette()}dispose(){this.extendedPalette.clear()}getPaletteEntry(t){if(t<this.basePalette.length)return this.basePalette[t];const n=this.extendedPalette.get(t);if(n)return n;const l=this.generateExtendedEntry(t);return this.extendedPalette.set(t,l),l}get basePaletteSize(){return this.basePalette.length}getCandlestickGroupIndex(t){switch(t){case"Bull":return U3.SINE_BASIC;case"Bear":return U3.SAWTOOTH_SOFT;case"Neutral":return U3.TRIANGLE_BASIC;default:return U3.SINE_BASIC}}generateExtendedPalette(){[{index:this.basePalette.length,waveType:"sine",harmonicMix:{fundamental:1,harmonics:[{frequency:2,amplitude:.3},{frequency:3,amplitude:.15}]},timbreModulation:{attack:.02,decay:.15,sustain:.7,release:.3}},{index:this.basePalette.length+1,waveType:"square",harmonicMix:{fundamental:1,harmonics:[{frequency:1.5,amplitude:.4},{frequency:2.5,amplitude:.2}]},timbreModulation:{attack:.01,decay:.08,sustain:.6,release:.4}},{index:this.basePalette.length+2,waveType:"sawtooth",harmonicMix:{fundamental:1,harmonics:[{frequency:1.25,amplitude:.35},{frequency:2,amplitude:.25},{frequency:3,amplitude:.1}]},timbreModulation:{attack:.03,decay:.2,sustain:.5,release:.35}},{index:this.basePalette.length+3,waveType:"triangle",harmonicMix:{fundamental:1,harmonics:[{frequency:.5,amplitude:.2},{frequency:4,amplitude:.15}]},timbreModulation:{attack:.025,decay:.18,sustain:.8,release:.25}}].forEach((n,l)=>{this.extendedPalette.set(this.basePalette.length+l,n)})}generateExtendedEntry(t){const n=t%this.basePalette.length,l=this.basePalette[n],o=Math.floor((t-this.basePalette.length)/this.basePalette.length),a=this.generateHarmonics(o),i=this.generateTimbreModulation(o,l.timbreModulation);return{index:t,waveType:l.waveType,harmonicMix:{fundamental:1,harmonics:a},timbreModulation:i}}generateHarmonics(t){const n=[],l=Q9.MIN_HARMONICS+t%Q9.HARMONIC_VARIATION;for(let o=0;o<l;o++){const a=1+(o+1)*(.5+t*.3%1),i=.4/(o+1)*(1-t*.1%.3);n.push({frequency:a,amplitude:i})}return n}generateTimbreModulation(t,n){const l=1+t*.2%.5;return{attack:Math.max(.005,Math.min(.05,n.attack*l)),decay:Math.max(.05,Math.min(.3,n.decay*l)),sustain:Math.max(.4,Math.min(.9,n.sustain+t*.1%.2)),release:Math.max(.1,Math.min(.5,n.release*l))}}validateBasePalette(){this.basePalette.forEach((t,n)=>{if(t.index!==n)throw new Error(`AudioPalette validation error: Entry at array position ${n} has index ${t.index}. Array position must match the index property to prevent audio palette mismatches.`)})}};ae(Q9,"MIN_HARMONICS",2),ae(Q9,"HARMONIC_VARIATION",3);let Hv=Q9;const Lj=100,xj=440,bj=880,Sv=.3,Ev=U3.SINE_BASIC;class Hj{constructor(t,n,l){ae(this,"notification");ae(this,"audioPalette");ae(this,"settings");ae(this,"isCombinedAudio");ae(this,"mode");ae(this,"activeAudioIds");ae(this,"audioContext");ae(this,"compressor");ae(this,"currentVolume");ae(this,"currentMinFrequency");ae(this,"currentMaxFrequency");this.notification=t,this.audioPalette=new Hv,this.settings=l,this.isCombinedAudio=!1,this.mode="on",this.updateMode(n),this.activeAudioIds=new Map,this.audioContext=new AudioContext,this.compressor=this.initCompressor();const o=this.settings.loadSettings();this.currentVolume=o.general.volume/100,this.currentMinFrequency=o.general.minFrequency,this.currentMaxFrequency=o.general.maxFrequency,this.settings.addObserver(this)}dispose(){this.stopAll(),this.audioPalette.dispose(),this.audioContext.state!=="closed"&&(this.compressor.disconnect(),this.audioContext.close()),this.settings.removeObserver(this)}update(t){"general"in t?this.onSettingsChange(t):this.onStateChange(t)}onSettingsChange(t){this.currentVolume=t.general.volume/100,this.currentMinFrequency=t.general.minFrequency,this.currentMaxFrequency=t.general.maxFrequency}onStateChange(t){if(this.mode==="off")return;if(this.updateMode(t),t.empty){this.playBoundaryAudio();return}if(t.type==="figure")return;const n=t.type==="subplot"?t.trace:t;this.handleTraceState(n)}playBoundaryAudio(){this.stopAll(),this.playEmptyTone(1,0)}handleTraceState(t){if(this.mode==="off"||t.type!=="trace")return;if(t.empty){this.stopAll(),this.playEmptyTone(t.audio.size,t.audio.index);return}if(t.traceType==="line"&&!t.empty&&Array.isArray(t.intersections)&&t.intersections.length>1){this.stopAll(),this.playSimultaneousTones(t.intersections);return}const n=t.audio;let l=n.groupIndex;n.trend&&l===void 0&&(l=this.audioPalette.getCandlestickGroupIndex(n.trend));const a=l!==void 0?this.audioPalette.getPaletteEntry(l):void 0;if(n.isContinuous)this.playSmooth(n.value,n.min,n.max,n.size,Array.isArray(n.index)?n.index[0]:n.index,a);else if(Array.isArray(n.value)){const i=n.value;if(i.length===0){this.playZeroTone();return}let s=0;const c=this.mode==="on"?50:0,u=new Array,Q=()=>{if(s<i.length){const f=Array.isArray(n.index)?n.index[s]:n.index;this.playTone(n.min,n.max,i[s++],n.size,f,a),u.push(setTimeout(Q,c))}else this.stop(u)};Q()}else{const i=n.value;if(i===0)this.playZeroTone();else{const s=Array.isArray(n.index)?n.index[0]:n.index;this.playTone(n.min,n.max,i,n.size,s,a)}}}getVolume(){return Math.min(Math.max(this.currentVolume,0),1)}getFrequencyRange(){return{min:this.currentMinFrequency,max:this.currentMaxFrequency}}initCompressor(){const t=this.audioContext.createDynamicsCompressor();t.threshold.value=-50,t.knee.value=40,t.ratio.value=12,t.attack.value=0,t.release.value=.25;const n=this.audioContext.createGain();return n.gain.value=.5,t.connect(n),n.connect(this.audioContext.destination),t}updateMode(t){if(t.empty||t.type==="figure")return;const n=t.type==="subplot"?t.trace:t;n.empty||n.hasMultiPoints===this.isCombinedAudio||(this.isCombinedAudio=n.hasMultiPoints,this.mode!=="off"&&(this.isCombinedAudio?this.mode="combined":this.mode="on"))}playTone(t,n,l,o,a,i){const s={min:t,max:n},c=this.getFrequencyRange(),u=this.interpolate(l,s,c),Q={min:0,max:o},f={min:-1,max:1},h=this.clamp(this.interpolate(a,Q,f),-1,1);return this.playOscillator(u,h,i)}createOscillators(t,n){const l=[],o=this.audioContext.createOscillator();if(o.type=t.waveType,o.frequency.value=n,l.push(o),t.harmonicMix)for(const a of t.harmonicMix.harmonics){const i=this.audioContext.createOscillator();i.type=t.waveType,i.frequency.value=a.frequency*n,l.push(i)}return l}createGainNodes(t,n,l,o){const a=[],i=this.audioContext.currentTime,s=this.getVolume();for(let c=0;c<t.length;c++){const u=this.audioContext.createGain();let Q=s;if(c===0)n.harmonicMix&&(Q*=n.harmonicMix.fundamental);else{const h=n.harmonicMix.harmonics[c-1];Q*=h.amplitude}const f=this.createAdsrEnvelope(u,n,Q,i,o);f!==null&&u.gain.setValueCurveAtTime(f,i,o),a.push(u)}return a}playOscillator(t,n=0,l){const o=Sv,a=this.getVolume();l||(l=this.audioPalette.getPaletteEntry(0));const i=this.createOscillators(l,t),s=this.createGainNodes(i,l,a,o),c=this.audioContext.createStereoPanner();c.pan.value=n;const u=new PannerNode(this.audioContext,{distanceModel:"linear",positionX:0,positionY:0,positionZ:0,orientationX:0,orientationY:0,orientationZ:-1,refDistance:1,maxDistance:1e4,rolloffFactor:10,coneInnerAngle:40,coneOuterAngle:50,coneOuterGain:.4});for(let h=0;h<i.length;h++)i[h].connect(s[h]),s[h].connect(c);c.connect(u),u.connect(this.compressor),i.forEach(h=>h.start());const Q=h=>{u.disconnect(this.compressor),c.disconnect(u);for(let p=0;p<i.length;p++)s[p].disconnect(c),i[p].stop(),i[p].disconnect(s[p]);this.activeAudioIds.delete(h)},f=setTimeout(()=>Q(f),o*1e3*2);return this.activeAudioIds.set(f,i),f}createAdsrEnvelope(t,n,l,o,a){if(n!=null&&n.timbreModulation){const{attack:i,decay:s,sustain:c,release:u}=n.timbreModulation,Q=a*i,f=a*s,h=a*u,p=a-Q-f-h;return t.gain.setValueAtTime(1e-4*l,o),t.gain.linearRampToValueAtTime(l,o+Q),t.gain.linearRampToValueAtTime(c*l,o+Q+f),p>0&&t.gain.setValueAtTime(c*l,o+Q+f+p),t.gain.linearRampToValueAtTime(1e-4*l,o+a),null}else return[.5*l,l,.5*l,.5*l,.5*l,.1*l,1e-4*l]}playSmooth(t,n,l,o,a,i){const s=this.audioContext,c=s.currentTime,u=Sv,Q=this.getFrequencyRange(),f=this.getVolume(),h=(i==null?void 0:i.waveType)||"sine",p=t.map(O=>this.interpolate(O,{min:n,max:l},Q));p.length<2&&p.push(p[0]);const g=this.clamp(this.interpolate(a,{min:0,max:o-1},{min:-1,max:1}),-1,1),v=s.createOscillator();v.type=h,v.frequency.setValueCurveAtTime(p,c,u);const b=s.createGain(),L=this.createAdsrEnvelope(b,i,f,c,u);L!==null&&b.gain.setValueCurveAtTime(L,c,u);const S=s.createStereoPanner();S.pan.value=g,v.connect(b),b.connect(S),S.connect(this.compressor),v.start(c),v.stop(c+u);const _=setTimeout(()=>{v.disconnect(),b.disconnect(),S.disconnect(),this.activeAudioIds.delete(_)},u*1e3*2);this.activeAudioIds.set(_,[v])}playEmptyTone(t,n){const l=this.audioContext,o=l.currentTime,a=.2,i=this.getVolume(),s=[500,1e3,1500,2100,2700],c=[1,.6,.4,.2,.1],u=l.createGain();u.gain.setValueAtTime(.3*i,o),u.gain.exponentialRampToValueAtTime(.01*i,o+a),u.connect(this.compressor);const Q={min:0,max:t},f={min:-1,max:1},h=this.clamp(this.interpolate(n,Q,f),-1,1),p=[];for(let b=0;b<s.length;b++){const L=l.createOscillator(),S=l.createGain(),_=this.audioContext.createStereoPanner(),O=new PannerNode(this.audioContext,{distanceModel:"linear",positionX:0,positionY:0,positionZ:0,orientationX:0,orientationY:0,orientationZ:-1,refDistance:1,maxDistance:1e4,rolloffFactor:10,coneInnerAngle:40,coneOuterAngle:50,coneOuterGain:.4});L.frequency.value=s[b],L.type="sine",S.gain.setValueAtTime(c[b]*i,o),S.gain.exponentialRampToValueAtTime(.001*i,o+a),_.pan.value=h,L.connect(S),S.connect(_),_.connect(O),O.connect(u),L.start(o),L.stop(o+a),p.push(L)}const g=b=>{u.disconnect(),p.forEach(L=>{L.disconnect()}),this.activeAudioIds.delete(b)},v=setTimeout(()=>g(v),a*1e3*2);return this.activeAudioIds.set(v,p),v}playZeroTone(){return this.playOscillator(Lj,0,{index:Ev,waveType:"triangle"})}playWaitingTone(){return setInterval(()=>this.playOscillator(xj,0,{index:Ev,waveType:"sine"}),1e3)}playCompleteTone(){return this.playOscillator(bj,0,{index:Ev,waveType:"sine"})}interpolate(t,n,l){return n.min===0&&n.max===0?0:(t-n.min)/(n.max-n.min)*(l.max-l.min)+l.min}clamp(t,n,l){return Math.max(n,Math.min(t,l))}toggle(){switch(this.mode){case"off":this.mode=this.isCombinedAudio?"combined":"on";break;case"on":this.mode="off";break;case"combined":this.mode="on";break}const n=`Sound is ${this.isCombinedAudio&&this.mode==="on"?"separate":this.mode}`;this.notification.notify(n)}stop(t){(Array.isArray(t)?t:[t]).forEach(l=>{const o=this.activeAudioIds.get(l);if(!o){clearInterval(l);return}o.forEach(a=>{a==null||a.disconnect(),a==null||a.stop()}),clearTimeout(l),this.activeAudioIds.delete(l)})}stopAll(){this.activeAudioIds.entries().forEach(([t,n])=>{clearTimeout(t),n.forEach(l=>{l.disconnect(),l.stop()})}),this.activeAudioIds.clear()}playSimultaneousTones(t){const n=this.getVolume(),l=Sv,o=this.audioContext,a=o.currentTime,i=this.getFrequencyRange(),s=Array.isArray(t[0].value)?t[0].value[1]??t[0].value[0]:t[0].value,c=t[0].min,u=t[0].max,Q=this.interpolate(s,{min:c,max:u},i);t.forEach((f,h)=>{const p=Q,v=this.audioPalette.getPaletteEntry(h).waveType,b=o.createOscillator();b.type=v,b.frequency.value=p;const L=o.createGain();L.gain.setValueAtTime(n,a),L.gain.exponentialRampToValueAtTime(.01*n,a+l),b.connect(L),L.connect(this.compressor),b.start(a),b.stop(a+l);const S=setTimeout(()=>{b.disconnect(),L.disconnect()},l*1e3*2);this.activeAudioIds.set(S,[b])})}}const Sj=250,Ej=50,Mj=500,Aj=20;class _j{constructor(t,n,l){ae(this,"context");ae(this,"notification");ae(this,"settings");ae(this,"autoplayId");ae(this,"currentDirection");ae(this,"userSpeed");ae(this,"defaultSpeed");ae(this,"minSpeed");ae(this,"maxSpeed");ae(this,"autoplayRate");ae(this,"interval");ae(this,"currentDuration");ae(this,"onChangeEmitter");ae(this,"onChange");this.notification=n,this.context=t,this.settings=l,this.autoplayId=null,this.currentDirection=null,this.userSpeed=null,this.defaultSpeed=Sj,this.minSpeed=Ej,this.maxSpeed=Mj,this.autoplayRate=this.defaultSpeed,this.interval=Aj,this.currentDuration=this.settings.loadSettings().general.autoplayDuration,this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event,this.settings.addObserver(this)}dispose(){this.stop(),this.onChangeEmitter.dispose(),this.settings.removeObserver(this)}update(t){this.updateSettings(t)}updateSettings(t){this.currentDuration=t.general.autoplayDuration,this.currentDirection&&this.restart()}start(t,n){this.stop(),this.onChangeEmitter.fire({type:"start"}),this.autoplayRate=this.getAutoplayRate(t,n),this.currentDirection=t,this.autoplayId=setInterval(()=>{this.context.isMovable(t)?this.context.moveOnce(t):this.stop()},this.autoplayRate)}stop(){this.autoplayId&&clearInterval(this.autoplayId),this.autoplayId=null,this.currentDirection=null,this.onChangeEmitter.fire({type:"stop"})}restart(){this.autoplayId&&clearInterval(this.autoplayId),this.currentDirection&&this.start(this.currentDirection)}speedUp(){const t=this.userSpeed??this.autoplayRate;t-this.interval>this.minSpeed?(this.userSpeed=t-this.interval,this.autoplayRate=this.userSpeed,this.restart(),this.notification.notify("Speed up")):this.notification.notify("Max speed")}speedDown(){const t=this.userSpeed??this.autoplayRate;t+this.interval<=this.maxSpeed?(this.userSpeed=t+this.interval,this.autoplayRate=this.userSpeed,this.restart(),this.notification.notify("Speed down")):this.notification.notify("Min speed")}resetSpeed(){this.userSpeed=null,this.autoplayRate=this.defaultSpeed,this.restart(),this.notification.notify("Reset speed")}getAutoplayRate(t,n){if(this.userSpeed!==null)return this.userSpeed;if(n&&!n.empty){const l=Math.ceil(this.currentDuration/n.autoplay[t]);return this.defaultSpeed=l,this.minSpeed=Math.min(this.minSpeed,l),l}return this.defaultSpeed}}const sS=32;class Rc{encode(t){const n=new Array,l=new Array,o=new Array;for(let a=0;a<t.values.length;a++){l.push(new Array);const i=(t.max[a]-t.min[a])/4,s=t.min[a]+i,c=s+i,u=c+i;for(let Q=0;Q<t.values[a].length;Q++)t.values[a][Q]===0?n.push(" "):t.values[a][Q]<=s||t.values[a][Q]<=c?n.push("⠤"):t.values[a][Q]<=u?n.push("⠒"):n.push("⠉"),l[a].push(o.length),o.push({row:a,col:Q});n.push(xe.NEW_LINE),l[a].push(o.length),o.push({row:a,col:t.values[a].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}}class Oj{constructor(){ae(this,"GLOBAL_MIN","globalMin");ae(this,"GLOBAL_MAX","globalMax");ae(this,"BLANK","blank");ae(this,"LOWER_OUTLIER","lowerOutlier");ae(this,"UPPER_OUTLIER","upperOutlier");ae(this,"MIN","min");ae(this,"MAX","max");ae(this,"Q1","q1");ae(this,"Q2","q2");ae(this,"Q3","q3")}encode(t,n=sS){const l=new Array,o=new Array,a=new Array;for(let i=0;i<t.values.length;i++){const s=t.values[i],c=[{type:this.GLOBAL_MIN,value:t.min},...s.lowerOutliers.map(V=>({type:this.LOWER_OUTLIER,value:V})),{type:this.MIN,value:s.min},{type:this.Q1,value:s.q1},{type:this.Q2,value:s.q2},{type:this.Q3,value:s.q3},{type:this.MAX,value:s.max},...s.upperOutliers.map(V=>({type:this.UPPER_OUTLIER,value:V})),{type:this.GLOBAL_MAX,value:t.max}],u=new Array;let Q=!0;for(let V=0;V<c.length-1;V++){const k=c[V],B=c[V+1],R=Math.abs(Q?B.value-k.value:k.value-c[V-1].value);k.type===this.LOWER_OUTLIER||k.type===this.UPPER_OUTLIER?(u.push({type:k.type,length:0,numChars:1}),u.push({type:this.BLANK,length:R,numChars:0})):k.type===this.Q2?(Q=!1,u.push({type:this.Q2,length:0,numChars:2})):k.type===this.GLOBAL_MIN||k.type===this.GLOBAL_MAX?u.push({type:this.BLANK,length:R,numChars:0}):u.push({type:k.type,length:R,numChars:1})}let f=u.reduce((V,k)=>V+(k.numChars>0?k.numChars:0),0),[h,p,g,v]=[-1,-1,-1,-1];for(let V=0;V<u.length;V++)u[V].type===this.MIN&&u[V].length>0&&(h=V),u[V].type===this.MAX&&u[V].length>0&&(p=V),u[V].type===this.Q1&&(g=V),u[V].type===this.Q3&&(v=V);h!==-1&&p!==-1&&u[h].length!==u[p].length&&(u[h].length>u[p].length?(u[h].numChars++,f++):(u[p].numChars++,f++)),g!==-1&&v!==-1&&u[g].length!==u[v].length&&(u[g].length>u[v].length?(u[g].numChars++,f++):(u[v].numChars++,f++));const b=Math.max(0,n-f),L=u.reduce((V,k)=>V+(k.type!==this.Q2&&k.length>0?k.length:0),0);for(const V of u)if(V.type!==this.Q2&&V.length>0){const k=Math.round(V.length/L*b);V.numChars+=k}const S=u.reduce((V,k)=>V+k.numChars,0);let _=n-S,O=0;for(;_!==0;){const V=u[O%u.length];V.type!==this.BLANK&&V.type!==this.Q2&&V.length>0&&(V.numChars+=_>0?1:-1,_+=_>0?-1:1),O++}let E=-1;const A=[this.LOWER_OUTLIER,this.MIN,this.Q1,this.Q2,this.Q3,this.MAX,this.UPPER_OUTLIER];a.push(Array.from({length:A.length}).fill(-1));for(const V of u){V.type!==this.BLANK&&V.type!==this.GLOBAL_MIN&&V.type!==this.GLOBAL_MAX&&(E=A.indexOf(V.type),a[i][E]=l.length);for(let k=0;k<V.numChars;k++){let B="⠀";V.type===this.MIN||V.type===this.MAX?B="⠒":V.type===this.Q1||V.type===this.Q3?B="⠿":V.type===this.Q2?B=k===0?"⠸":"⠇":V.type===this.LOWER_OUTLIER||V.type===this.UPPER_OUTLIER?B="⠂":V.type===this.BLANK&&(B="⠀"),l.push(B),o.push({row:i,col:E})}}for(let V=0;V<3;V++)if(a[i][V]===-1){for(let k=V+1;k<=3;k++)if(a[i][k]!==-1){a[i][V]=a[i][k];break}}for(let V=6;V>3;V--)if(a[i][V]===-1){for(let k=V-1;k>=3;k--)if(a[i][k]!==-1){a[i][V]=a[i][k];break}}l.push(xe.NEW_LINE),o.push({row:i,col:E})}return{value:l.join(xe.EMPTY),cellToIndex:a,indexToCell:o}}}class Cj{encode(t){const n=new Array,l=new Array,o=new Array,a=(t.max-t.min)/3,i=t.min+a,s=i+a;for(let c=0;c<t.values.length;c++){l.push(new Array);for(let u=0;u<t.values[c].length;u++)t.values[c][u]===0?n.push(" "):t.values[c][u]<=i?n.push("⠤"):t.values[c][u]<=s?n.push("⠒"):n.push("⠉"),l[c].push(o.length),o.push({row:c,col:u});n.push(xe.NEW_LINE),l[c].push(o.length),o.push({row:c,col:t.values[c].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}}class uS{encode(t){const n=new Array,l=new Array,o=new Array;for(let a=0;a<t.values.length;a++){l.push(new Array);const{low:i,medium:s,mediumHigh:c,high:u}=this.getThresholds(a,t);for(let Q=0;Q<t.values[a].length;Q++){const f=t.values[a][Q],h=Q>0?t.values[a][Q-1]:null,p=this.getBrailleChar(f,h,i,s,u,c);n.push(p),l[a].push(o.length),o.push({row:a,col:Q})}n.push(xe.NEW_LINE),l[a].push(o.length),o.push({row:a,col:t.values[a].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}getBrailleChar(t,n,l,o,a,i){return i===void 0&&(i=a),t<=l&&n!==null&&n>l?n<=o?"⢄":n<=i?"⢆":"⢇":t<=l?"⣀":n!==null&&n<=l?t<=o?"⡠":t<=i?"⡰":"⡸":t<=o&&n!==null&&n>o?n<=i?"⠢":"⠣":t<=o?"⠤":n!==null&&n<=o?t<=i?"⠔":"⠜":t<=i&&n!==null&&n>i?"⠑":t<=i?"⠒":n!==null&&n<=i?"⠊":t<=a?"⠉":""}getBraille6Char(t,n,l,o,a){const i=f=>f<=l?"low":f<=o?"medium":(f<=a,"high"),s=i(t),c=n!==null?i(n):null,u={"low,medium":"⠢","low,high":"⠣","low,null":"⠤","low,low":"⠤","medium,low":"⠔","medium,high":"⠑","medium,null":"⠒","medium,medium":"⠒","high,low":"⠜","high,medium":"⠊","high,null":"⠉","high,high":"⠉"},Q=`${s},${c}`;return u[Q]||""}addDot8(t){if(!t||t.length===0)return"⢀";const o=t.charCodeAt(0)-10240|128;return String.fromCharCode(10240+o)}}class wj extends uS{getThresholds(t,n){const l=(n.max-n.min)/3,o=n.min+l,a=o+l,i=n.max;return{low:o,medium:a,high:i}}encode(t){var a;const n=new Array,l=new Array,o=new Array;for(let i=0;i<t.values.length;i++){l.push(new Array);const{low:s,medium:c,high:u}=this.getThresholds(i,t);for(let Q=0;Q<t.values[i].length;Q++){const f=t.values[i][Q],h=Q>0?t.values[i][Q-1]:null;let p=this.getBraille6Char(f,h,s,c,u);((a=t.custom)==null?void 0:a[Q])==="Bear"&&(p=this.addDot8(p)),n.push(p),l[i].push(o.length),o.push({row:i,col:Q})}n.push(xe.NEW_LINE),l[i].push(o.length),o.push({row:i,col:t.values[i].length})}return{value:n.join(xe.EMPTY),cellToIndex:l,indexToCell:o}}}class Vj extends uS{getThresholds(t,n){const l=(n.max[t]-n.min[t])/4,o=n.min[t]+l,a=o+l,i=a+l,s=n.max[t];return{low:o,medium:a,mediumHigh:i,high:s}}}class Dj{constructor(t,n,l){ae(this,"context");ae(this,"notification");ae(this,"display");ae(this,"enabled");ae(this,"cacheId");ae(this,"cache");ae(this,"encoders");ae(this,"onChangeEmitter");ae(this,"onChange");this.context=t,this.notification=n,this.display=l,this.enabled=!1,this.cacheId=xe.EMPTY,this.cache=null,this.encoders=new Map([[P2.BAR,new Rc],[P2.BOX,new Oj],[P2.CANDLESTICK,new wj],[P2.DODGED,new Rc],[P2.HEATMAP,new Cj],[P2.HISTOGRAM,new Rc],[P2.LINE,new Vj],[P2.NORMALIZED,new Rc],[P2.STACKED,new Rc]]),this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose(),this.cache=null,this.encoders.clear()}update(t){if(!this.enabled||t.empty)return;const n=t.type==="subplot"?t.trace:t;if(n.empty||n.braille.empty||!this.encoders.has(n.traceType))return;const l=n.braille;if(this.cacheId!==l.id||this.cache===null){const o=this.encoders.get(n.traceType);this.cache=o.encode(l,sS),this.cacheId=l.id}this.onChangeEmitter.fire({value:this.cache.value.trim(),index:this.cache.cellToIndex[l.row][l.col]})}moveToIndex(t){if(!this.enabled||this.cache===null||t<0||t>=this.cache.indexToCell.length)return;const{row:n,col:l}=this.cache.indexToCell[t];this.context.moveToIndex(n,l)}toggle(t){if(t.empty){this.notification.notify("No info for braille");return}if(t.braille.empty){const l=`Braille is not supported for plot type: ${t.braille.traceType}`;this.notification.notify(l);return}this.enabled=!this.enabled,this.update(t),this.display.toggleFocus(H1.BRAILLE);const n=`Braille is ${this.enabled?"on":"off"}`;this.notification.notify(n)}}var cS=(e=>(e[e.OK=200]="OK",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.SERVER_ERROR=500]="SERVER_ERROR",e))(cS||{});class TS{constructor(){}static async post(t,n,l){const o={...this.DEFAULT_HEADERS,...l};return this.request(t,"POST",o,n)}static async request(t,n,l,o){try{const a=await fetch(t,{method:n,headers:l,body:o});return a.ok?{success:!0,data:await a.json()}:{success:!1,error:{statusCode:a.status,message:`API Error: ${a.status} - ${a.statusText}`}}}catch(a){return console.error(`Error in API ${n} request to ${t}:`,a),{success:!1,error:{statusCode:cS.SERVER_ERROR,message:a instanceof Error?a.message:"Unknown error occurred"}}}}}ae(TS,"DEFAULT_HEADERS",{"Content-Type":"application/json"});const Rj=`You are an accessibility assistant specializing in describing statistical visualizations to blind users. Your role is to:
3
3
  1. Provide simple, straightforward descriptions of charts and graphs
4
4
  2. Focus on basic patterns and key points
5
5
  3. Use simple, everyday language with minimal statistical terms
@@ -322,7 +322,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
322
322
  `&&(O.value+=" ");const V=A.boxSizing,k=Dm(A.paddingBottom)+Dm(A.paddingTop),B=Dm(A.borderBottomWidth)+Dm(A.borderTopWidth),R=O.scrollHeight;O.value="x";const F=O.scrollHeight;let q=R;a&&(q=Math.max(Number(a)*F,q)),o&&(q=Math.min(Number(o)*F,q)),q=Math.max(q,F);const $=q+(V==="border-box"?k+B:0),Z=Math.abs(q-R)<=1;return{outerHeightStyle:$,overflowing:Z}},[o,a,t.placeholder]),v=kr(()=>{const _=Q.current,O=g();if(!_||!O||CA(O))return!1;const E=O.outerHeightStyle;return h.current!=null&&h.current!==E}),b=oe.useCallback(()=>{const _=Q.current,O=g();if(!_||!O||CA(O))return;const E=O.outerHeightStyle;h.current!==E&&(h.current=E,_.style.height=`${E}px`),_.style.overflow=O.overflowing?"hidden":""},[g]),L=oe.useRef(-1);Ri(()=>{const _=WM(b),O=Q==null?void 0:Q.current;if(!O)return;const E=Ni(O);E.addEventListener("resize",_);let A;return typeof ResizeObserver<"u"&&(A=new ResizeObserver(()=>{v()&&(A.unobserve(O),cancelAnimationFrame(L.current),b(),L.current=requestAnimationFrame(()=>{A.observe(O)}))}),A.observe(O)),()=>{_.clear(),cancelAnimationFrame(L.current),E.removeEventListener("resize",_),A&&A.disconnect()}},[g,b,v]),Ri(()=>{b()});const S=_=>{u||b();const O=_.target,E=O.value.length,A=O.value.endsWith(`
323
323
  `),V=O.selectionStart===E;A&&V&&O.setSelectionRange(E,E),l&&l(_)};return He.jsxs(oe.Fragment,{children:[He.jsx("textarea",{value:s,onChange:S,ref:f,rows:a,style:i,...c}),He.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:{...XX.shadow,...i,paddingTop:0,paddingBottom:0}})]})});ZX.NODE_ENV!=="production"&&(FL.propTypes={className:M.string,maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),onChange:M.func,placeholder:M.string,style:M.object,value:M.oneOfType([M.arrayOf(M.string),M.number,M.string])});function z7(e){return typeof e=="string"}function Xa({props:e,states:t,muiFormControl:n}){return t.reduce((l,o)=>(l[o]=e[o],n&&typeof e[o]>"u"&&(l[o]=n[o]),l),{})}var YX={};const mT=oe.createContext(void 0);YX.NODE_ENV!=="production"&&(mT.displayName="FormControlContext");function Q5(){return oe.useContext(mT)}function wA(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Rm(e,t=!1){return e&&(wA(e.value)&&e.value!==""||t&&wA(e.defaultValue)&&e.defaultValue!=="")}function KX(e){return e.startAdornment}function JX(e){return It("MuiInputBase",e)}const Us=kt("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var yT={},VA;const km=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Ge(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Nm=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},eW=e=>{const{classes:t,color:n,disabled:l,error:o,endAdornment:a,focused:i,formControl:s,fullWidth:c,hiddenLabel:u,multiline:Q,readOnly:f,size:h,startAdornment:p,type:g}=e,v={root:["root",`color${Ge(n)}`,l&&"disabled",o&&"error",c&&"fullWidth",i&&"focused",s&&"formControl",h&&h!=="medium"&&`size${Ge(h)}`,Q&&"multiline",p&&"adornedStart",a&&"adornedEnd",u&&"hiddenLabel",f&&"readOnly"],input:["input",l&&"disabled",g==="search"&&"inputTypeSearch",Q&&"inputMultiline",h==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",a&&"inputAdornedEnd",f&&"readOnly"]};return Ut(v,JX,t)},Bm=Ke("div",{name:"MuiInputBase",slot:"Root",overridesResolver:km})(Vt(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Us.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Pm=Ke("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Nm})(Vt(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},l={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Us.formControl} &`]:{"&::-webkit-input-placeholder":l,"&::-moz-placeholder":l,"&::-ms-input-placeholder":l,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Us.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:a})=>!a.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:a})=>a.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),DA=aZ({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Im=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:i,className:s,color:c,components:u={},componentsProps:Q={},defaultValue:f,disabled:h,disableInjectingGlobalStyles:p,endAdornment:g,error:v,fullWidth:b=!1,id:L,inputComponent:S="input",inputProps:_={},inputRef:O,margin:E,maxRows:A,minRows:V,multiline:k=!1,name:B,onBlur:R,onChange:F,onClick:q,onFocus:$,onKeyDown:Z,onKeyUp:ee,placeholder:W,readOnly:te,renderSuffix:J,rows:Y,size:I,slotProps:z={},slots:ne={},startAdornment:U,type:de="text",value:me,...he}=l,se=_.value!=null?_.value:me,{current:fe}=oe.useRef(se!=null),Ee=oe.useRef(),Se=oe.useCallback(ct=>{yT.NODE_ENV!=="production"&&ct&&ct.nodeName!=="INPUT"&&!ct.focus&&console.error(["MUI: You have provided a `inputComponent` to the input component","that does not correctly handle the `ref` prop.","Make sure the `ref` prop is called with a HTMLInputElement."].join(`
324
324
  `))},[]),_e=v3(Ee,O,_.ref,Se),[ze,ue]=oe.useState(!1),Pe=Q5();yT.NODE_ENV!=="production"&&oe.useEffect(()=>{if(Pe)return Pe.registerEffect()},[Pe]);const We=Xa({props:l,muiFormControl:Pe,states:["color","disabled","error","hiddenLabel","size","required","filled"]});We.focused=Pe?Pe.focused:ze,oe.useEffect(()=>{!Pe&&h&&ze&&(ue(!1),R&&R())},[Pe,h,ze,R]);const dt=Pe&&Pe.onFilled,at=Pe&&Pe.onEmpty,pt=oe.useCallback(ct=>{Rm(ct)?dt&&dt():at&&at()},[dt,at]);Ri(()=>{fe&&pt({value:se})},[se,pt,fe]);const jt=ct=>{$&&$(ct),_.onFocus&&_.onFocus(ct),Pe&&Pe.onFocus?Pe.onFocus(ct):ue(!0)},d1=ct=>{R&&R(ct),_.onBlur&&_.onBlur(ct),Pe&&Pe.onBlur?Pe.onBlur(ct):ue(!1)},lt=(ct,...i1)=>{if(!fe){const _t=ct.target||Ee.current;if(_t==null)throw new Error(yT.NODE_ENV!=="production"?"MUI: Expected valid input target. Did you use a custom `inputComponent` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info.":Or(1));pt({value:_t.value})}_.onChange&&_.onChange(ct,...i1),F&&F(ct,...i1)};oe.useEffect(()=>{pt(Ee.current)},[]);const ut=ct=>{Ee.current&&ct.currentTarget===ct.target&&Ee.current.focus(),q&&q(ct)};let e2=S,T1=_;k&&e2==="input"&&(Y?(yT.NODE_ENV!=="production"&&(V||A)&&console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."),T1={type:void 0,minRows:Y,maxRows:Y,...T1}):T1={type:void 0,maxRows:A,minRows:V,...T1},e2=FL);const Ze=ct=>{pt(ct.animationName==="mui-auto-fill-cancel"?Ee.current:{value:"x"})};oe.useEffect(()=>{Pe&&Pe.setAdornedStart(!!U)},[Pe,U]);const ye={...l,color:We.color||"primary",disabled:We.disabled,endAdornment:g,error:We.error,focused:We.focused,formControl:Pe,fullWidth:b,hiddenLabel:We.hiddenLabel,multiline:k,size:We.size,startAdornment:U,type:de},De=eW(ye),Ye=ne.root||u.Root||Bm,tt=z.root||Q.root||{},rt=ne.input||u.Input||Pm;return T1={...T1,...z.input??Q.input},He.jsxs(oe.Fragment,{children:[!p&&typeof DA=="function"&&(VA||(VA=He.jsx(DA,{}))),He.jsxs(Ye,{...tt,ref:n,onClick:ut,...he,...!z7(Ye)&&{ownerState:{...ye,...tt.ownerState}},className:Tt(De.root,tt.className,s,te&&"MuiInputBase-readOnly"),children:[U,He.jsx(mT.Provider,{value:null,children:He.jsx(rt,{"aria-invalid":We.error,"aria-describedby":o,autoComplete:a,autoFocus:i,defaultValue:f,disabled:We.disabled,id:L,onAnimationStart:Ze,name:B,placeholder:W,readOnly:te,required:We.required,rows:Y,value:se,onKeyDown:Z,onKeyUp:ee,type:de,...T1,...!z7(rt)&&{as:e2,ownerState:{...ye,...T1.ownerState}},ref:_e,className:Tt(De.input,T1.className,te&&"MuiInputBase-readOnly"),onBlur:d1,onChange:lt,onFocus:jt})}),g,J?J({...We,startAdornment:U}):null]})]})});yT.NODE_ENV!=="production"&&(Im.propTypes={"aria-describedby":M.string,autoComplete:M.string,autoFocus:M.bool,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["primary","secondary","error","info","success","warning"]),M.string]),components:M.shape({Input:M.elementType,Root:M.elementType}),componentsProps:M.shape({input:M.object,root:M.object}),defaultValue:M.any,disabled:M.bool,disableInjectingGlobalStyles:M.bool,endAdornment:M.node,error:M.bool,fullWidth:M.bool,id:M.string,inputComponent:NL,inputProps:M.object,inputRef:bn,margin:M.oneOf(["dense","none"]),maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),multiline:M.bool,name:M.string,onBlur:M.func,onChange:M.func,onClick:M.func,onFocus:M.func,onInvalid:M.func,onKeyDown:M.func,onKeyUp:M.func,placeholder:M.string,readOnly:M.bool,renderSuffix:M.func,required:M.bool,rows:M.oneOfType([M.number,M.string]),size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),slotProps:M.shape({input:M.object,root:M.object}),slots:M.shape({input:M.elementType,root:M.elementType}),startAdornment:M.node,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.string,value:M.any});function tW(e){return It("MuiInput",e)}const gT={...Us,...kt("MuiInput",["root","underline","input"])};function nW(e){return It("MuiOutlinedInput",e)}const Br={...Us,...kt("MuiOutlinedInput",["root","notchedOutline","input"])};function rW(e){return It("MuiFilledInput",e)}const q7={...Us,...kt("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},iW=X3(He.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),aW=X3(He.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function oW(e){return It("MuiAvatar",e)}kt("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);var lW={};const sW=e=>{const{classes:t,variant:n,colorDefault:l}=e;return Ut({root:["root",n,l&&"colorDefault"],img:["img"],fallback:["fallback"]},oW,t)},uW=Ke("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(Vt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})}}}]}))),cW=Ke("img",{name:"MuiAvatar",slot:"Img"})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),TW=Ke(aW,{name:"MuiAvatar",slot:"Fallback"})({width:"75%",height:"75%"});function QW({crossOrigin:e,referrerPolicy:t,src:n,srcSet:l}){const[o,a]=oe.useState(!1);return oe.useEffect(()=>{if(!n&&!l)return;a(!1);let i=!0;const s=new Image;return s.onload=()=>{i&&a("loaded")},s.onerror=()=>{i&&a("error")},s.crossOrigin=e,s.referrerPolicy=t,s.src=n,l&&(s.srcset=l),()=>{i=!1}},[e,t,n,l]),o}const RA=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiAvatar"}),{alt:o,children:a,className:i,component:s="div",slots:c={},slotProps:u={},imgProps:Q,sizes:f,src:h,srcSet:p,variant:g="circular",...v}=l;let b=null;const L={...l,component:s,variant:g},S=QW({...Q,...typeof u.img=="function"?u.img(L):u.img,src:h,srcSet:p}),_=h||p,O=_&&S!=="error";L.colorDefault=!O,delete L.ownerState;const E=sW(L),[A,V]=t1("root",{ref:n,className:Tt(E.root,i),elementType:uW,externalForwardedProps:{slots:c,slotProps:u,component:s,...v},ownerState:L}),[k,B]=t1("img",{className:E.img,elementType:cW,externalForwardedProps:{slots:c,slotProps:{img:{...Q,...u.img}}},additionalProps:{alt:o,src:h,srcSet:p,sizes:f},ownerState:L}),[R,F]=t1("fallback",{className:E.fallback,elementType:TW,externalForwardedProps:{slots:c,slotProps:u},shouldForwardComponentProp:!0,ownerState:L});return O?b=He.jsx(k,{...B}):a||a===0?b=a:_&&o?b=o[0]:b=He.jsx(R,{...F}),He.jsx(A,{...V,children:b})});lW.NODE_ENV!=="production"&&(RA.propTypes={alt:M.string,children:M.node,classes:M.object,className:M.string,component:M.elementType,imgProps:M.object,sizes:M.string,slotProps:M.shape({fallback:M.oneOfType([M.func,M.object]),img:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object])}),slots:M.shape({fallback:M.elementType,img:M.elementType,root:M.elementType}),src:M.string,srcSet:M.string,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),variant:M.oneOfType([M.oneOf(["circular","rounded","square"]),M.string])});function fW(e){const{prototype:t={}}=e;return!!t.isReactComponent}function kA(e,t,n,l,o){const a=e[t],i=o||t;if(a==null||typeof window>"u")return null;let s;const c=a.type;return typeof c=="function"&&!fW(c)&&(s="Did you accidentally use a plain function component for an element instead?"),s!==void 0?new Error(`Invalid ${l} \`${i}\` supplied to \`${n}\`. Expected an element that can hold a ref. ${s} For more information see https://mui.com/r/caveat-with-refs-guide`):null}const vT=Bi(M.element,kA);vT.isRequired=Bi(M.element.isRequired,kA);var dW={};const hW={entering:{opacity:1},entered:{opacity:1}},jm=oe.forwardRef(function(t,n){const l=Ga(),o={enter:l.transitions.duration.enteringScreen,exit:l.transitions.duration.leavingScreen},{addEndListener:a,appear:i=!0,children:s,easing:c,in:u,onEnter:Q,onEntered:f,onEntering:h,onExit:p,onExited:g,onExiting:v,style:b,timeout:L=o,TransitionComponent:S=Nr,..._}=t,O=oe.useRef(null),E=v3(O,pT(s),n),A=Z=>ee=>{if(Z){const W=O.current;ee===void 0?Z(W):Z(W,ee)}},V=A(h),k=A((Z,ee)=>{TA(Z);const W=_m({style:b,timeout:L,easing:c},{mode:"enter"});Z.style.webkitTransition=l.transitions.create("opacity",W),Z.style.transition=l.transitions.create("opacity",W),Q&&Q(Z,ee)}),B=A(f),R=A(v),F=A(Z=>{const ee=_m({style:b,timeout:L,easing:c},{mode:"exit"});Z.style.webkitTransition=l.transitions.create("opacity",ee),Z.style.transition=l.transitions.create("opacity",ee),p&&p(Z)}),q=A(g),$=Z=>{a&&a(O.current,Z)};return He.jsx(S,{appear:i,in:u,nodeRef:O,onEnter:k,onEntered:B,onEntering:V,onExit:F,onExited:q,onExiting:R,addEndListener:$,timeout:L,..._,children:(Z,{ownerState:ee,...W})=>oe.cloneElement(s,{style:{opacity:0,visibility:Z==="exited"&&!u?"hidden":void 0,...hW[Z],...b,...s.props.style},ref:E,...W})})});dW.NODE_ENV!=="production"&&(jm.propTypes={addEndListener:M.func,appear:M.bool,children:vT.isRequired,easing:M.oneOfType([M.shape({enter:M.string,exit:M.string}),M.string]),in:M.bool,onEnter:M.func,onEntered:M.func,onEntering:M.func,onExit:M.func,onExited:M.func,onExiting:M.func,style:M.object,timeout:M.oneOfType([M.number,M.shape({appear:M.number,enter:M.number,exit:M.number})])});function pW(e){return It("MuiBackdrop",e)}kt("MuiBackdrop",["root","invisible"]);var mW={};const yW=e=>{const{classes:t,invisible:n}=e;return Ut({root:["root",n&&"invisible"]},pW,t)},gW=Ke("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),zL=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiBackdrop"}),{children:o,className:a,component:i="div",invisible:s=!1,open:c,components:u={},componentsProps:Q={},slotProps:f={},slots:h={},TransitionComponent:p,transitionDuration:g,...v}=l,b={...l,component:i,invisible:s},L=yW(b),S={transition:p,root:u.Root,...h},_={...Q,...f},O={component:i,slots:S,slotProps:_},[E,A]=t1("root",{elementType:gW,externalForwardedProps:O,className:Tt(L.root,a),ownerState:b}),[V,k]=t1("transition",{elementType:jm,externalForwardedProps:O,ownerState:b});return He.jsx(V,{in:c,timeout:g,...v,...k,children:He.jsx(E,{"aria-hidden":!0,...A,classes:L,ref:n,children:o})})});mW.NODE_ENV!=="production"&&(zL.propTypes={children:M.node,classes:M.object,className:M.string,component:M.elementType,components:M.shape({Root:M.elementType}),componentsProps:M.shape({root:M.object}),invisible:M.bool,open:M.bool.isRequired,slotProps:M.shape({root:M.oneOfType([M.func,M.object]),transition:M.oneOfType([M.func,M.object])}),slots:M.shape({root:M.elementType,transition:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),TransitionComponent:M.elementType,transitionDuration:M.oneOfType([M.number,M.shape({appear:M.number,enter:M.number,exit:M.number})])});const vW=kt("MuiBox",["root"]);var LW={};const xW=GM(),Pr=EU({themeId:Hm,defaultTheme:xW,defaultClassName:vW.root,generateClassName:dE.generate});LW.NODE_ENV!=="production"&&(Pr.propTypes={children:M.node,component:M.elementType,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function bW(e){return It("MuiButton",e)}const $7=kt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);var HW={};const NA=oe.createContext({});HW.NODE_ENV!=="production"&&(NA.displayName="ButtonGroupContext");var SW={};const BA=oe.createContext(void 0);SW.NODE_ENV!=="production"&&(BA.displayName="ButtonGroupButtonContext");var EW={};const MW=e=>{const{color:t,disableElevation:n,fullWidth:l,size:o,variant:a,loading:i,loadingPosition:s,classes:c}=e,u={root:["root",i&&"loading",a,`${a}${Ge(t)}`,`size${Ge(o)}`,`${a}Size${Ge(o)}`,`color${Ge(t)}`,n&&"disableElevation",l&&"fullWidth",i&&`loadingPosition${Ge(s)}`],startIcon:["icon","startIcon",`iconSize${Ge(o)}`],endIcon:["icon","endIcon",`iconSize${Ge(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},Q=Ut(u,bW,c);return{...c,...Q}},PA=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],AW=Ke(F7,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${Ge(n.color)}`],t[`size${Ge(n.size)}`],t[`${n.variant}Size${Ge(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Vt(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${$7.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${$7.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${$7.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${$7.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(_2()).map(([l])=>({props:{color:l},style:{"--variant-textColor":(e.vars||e).palette[l].main,"--variant-outlinedColor":(e.vars||e).palette[l].main,"--variant-outlinedBorder":e.vars?`rgba(${e.vars.palette[l].mainChannel} / 0.5)`:_1(e.palette[l].main,.5),"--variant-containedColor":(e.vars||e).palette[l].contrastText,"--variant-containedBg":(e.vars||e).palette[l].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[l].dark,"--variant-textBg":e.vars?`rgba(${e.vars.palette[l].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette[l].main,e.palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[l].main,"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette[l].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette[l].main,e.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette.text.primary,e.palette.action.hoverOpacity),"--variant-outlinedBg":e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette.text.primary,e.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${$7.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${$7.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${$7.loading}`]:{color:"transparent"}}}]}})),_W=Ke("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${Ge(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...PA]})),OW=Ke("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${Ge(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...PA]})),CW=Ke("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),IA=Ke("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Gs=oe.forwardRef(function(t,n){const l=oe.useContext(NA),o=oe.useContext(BA),a=iT(l,t),i=e1({props:a,name:"MuiButton"}),{children:s,color:c="primary",component:u="button",className:Q,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:p=!1,endIcon:g,focusVisibleClassName:v,fullWidth:b=!1,id:L,loading:S=null,loadingIndicator:_,loadingPosition:O="center",size:E="medium",startIcon:A,type:V,variant:k="text",...B}=i,R=ks(L),F=_??He.jsx(dT,{"aria-labelledby":R,color:"inherit",size:16}),q={...i,color:c,component:u,disabled:f,disableElevation:h,disableFocusRipple:p,fullWidth:b,loading:S,loadingIndicator:F,loadingPosition:O,size:E,type:V,variant:k},$=MW(q),Z=(A||S&&O==="start")&&He.jsx(_W,{className:$.startIcon,ownerState:q,children:A||He.jsx(IA,{className:$.loadingIconPlaceholder,ownerState:q})}),ee=(g||S&&O==="end")&&He.jsx(OW,{className:$.endIcon,ownerState:q,children:g||He.jsx(IA,{className:$.loadingIconPlaceholder,ownerState:q})}),W=o||"",te=typeof S=="boolean"?He.jsx("span",{className:$.loadingWrapper,style:{display:"contents"},children:S&&He.jsx(CW,{className:$.loadingIndicator,ownerState:q,children:F})}):null;return He.jsxs(AW,{ownerState:q,className:Tt(l.className,$.root,Q,W),component:u,disabled:f||S,focusRipple:!p,focusVisibleClassName:Tt($.focusVisible,v),ref:n,type:V,id:S?R:L,...B,classes:$,children:[Z,O!=="end"&&te,s,O==="end"&&te,ee]})});EW.NODE_ENV!=="production"&&(Gs.propTypes={children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["inherit","primary","secondary","success","error","info","warning"]),M.string]),component:M.elementType,disabled:M.bool,disableElevation:M.bool,disableFocusRipple:M.bool,disableRipple:M.bool,endIcon:M.node,focusVisibleClassName:M.string,fullWidth:M.bool,href:M.string,id:M.string,loading:M.bool,loadingIndicator:M.node,loadingPosition:M.oneOf(["center","end","start"]),size:M.oneOfType([M.oneOf(["small","medium","large"]),M.string]),startIcon:M.node,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.oneOfType([M.oneOf(["button","reset","submit"]),M.string]),variant:M.oneOfType([M.oneOf(["contained","outlined","text"]),M.string])});function wW(e){return It("PrivateSwitchBase",e)}kt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var VW={};const DW=e=>{const{classes:t,checked:n,disabled:l,edge:o}=e,a={root:["root",n&&"checked",l&&"disabled",o&&`edge${Ge(o)}`],input:["input"]};return Ut(a,wW,t)},RW=Ke(F7,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),kW=Ke("input",{name:"MuiSwitchBase",shouldForwardProp:E4})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),qL=oe.forwardRef(function(t,n){const{autoFocus:l,checked:o,checkedIcon:a,defaultChecked:i,disabled:s,disableFocusRipple:c=!1,edge:u=!1,icon:Q,id:f,inputProps:h,inputRef:p,name:g,onBlur:v,onChange:b,onFocus:L,readOnly:S,required:_=!1,tabIndex:O,type:E,value:A,slots:V={},slotProps:k={},...B}=t,[R,F]=cT({controlled:o,default:!!i,name:"SwitchBase",state:"checked"}),q=Q5(),$=me=>{L&&L(me),q&&q.onFocus&&q.onFocus(me)},Z=me=>{v&&v(me),q&&q.onBlur&&q.onBlur(me)},ee=me=>{if(me.nativeEvent.defaultPrevented)return;const he=me.target.checked;F(he),b&&b(me,he)};let W=s;q&&typeof W>"u"&&(W=q.disabled);const te=E==="checkbox"||E==="radio",J={...t,checked:R,disabled:W,disableFocusRipple:c,edge:u},Y=DW(J),I={slots:V,slotProps:{input:h,...k}},[z,ne]=t1("root",{ref:n,elementType:RW,className:Y.root,shouldForwardComponentProp:!0,externalForwardedProps:{...I,component:"span",...B},getSlotProps:me=>({...me,onFocus:he=>{var se;(se=me.onFocus)==null||se.call(me,he),$(he)},onBlur:he=>{var se;(se=me.onBlur)==null||se.call(me,he),Z(he)}}),ownerState:J,additionalProps:{centerRipple:!0,focusRipple:!c,disabled:W,role:void 0,tabIndex:null}}),[U,de]=t1("input",{ref:p,elementType:kW,className:Y.input,externalForwardedProps:I,getSlotProps:me=>({...me,onChange:he=>{var se;(se=me.onChange)==null||se.call(me,he),ee(he)}}),ownerState:J,additionalProps:{autoFocus:l,checked:o,defaultChecked:i,disabled:W,id:te?f:void 0,name:g,readOnly:S,required:_,tabIndex:O,type:E,...E==="checkbox"&&A===void 0?{}:{value:A}}});return He.jsxs(z,{...ne,children:[He.jsx(U,{...de}),R?a:Q]})});VW.NODE_ENV!=="production"&&(qL.propTypes={autoFocus:M.bool,checked:M.bool,checkedIcon:M.node.isRequired,classes:M.object,className:M.string,defaultChecked:M.bool,disabled:M.bool,disableFocusRipple:M.bool,edge:M.oneOf(["end","start",!1]),icon:M.node.isRequired,id:M.string,inputProps:M.object,inputRef:bn,name:M.string,onBlur:M.func,onChange:M.func,onFocus:M.func,readOnly:M.bool,required:M.bool,slotProps:M.shape({input:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object])}),slots:M.shape({input:M.elementType,root:M.elementType}),sx:M.object,tabIndex:M.oneOfType([M.number,M.string]),type:M.string.isRequired,value:M.any});function jA(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function NW(e){const t=M4(e);return t.body===e?Ni(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function LT(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function FA(e){return parseInt(Ni(e).getComputedStyle(e).paddingRight,10)||0}function BW(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),l=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||l}function zA(e,t,n,l,o){const a=[t,n,...l];[].forEach.call(e.children,i=>{const s=!a.includes(i),c=!BW(i);s&&c&&LT(i,o)})}function $L(e,t){let n=-1;return e.some((l,o)=>t(l)?(n=o,!0):!1),n}function PW(e,t){const n=[],l=e.container;if(!t.disableScrollLock){if(NW(l)){const i=jA(Ni(l));n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${FA(l)+i}px`;const s=M4(l).querySelectorAll(".mui-fixed");[].forEach.call(s,c=>{n.push({value:c.style.paddingRight,property:"padding-right",el:c}),c.style.paddingRight=`${FA(c)+i}px`})}let a;if(l.parentNode instanceof DocumentFragment)a=M4(l).body;else{const i=l.parentElement,s=Ni(l);a=(i==null?void 0:i.nodeName)==="HTML"&&s.getComputedStyle(i).overflowY==="scroll"?i:l}n.push({value:a.style.overflow,property:"overflow",el:a},{value:a.style.overflowX,property:"overflow-x",el:a},{value:a.style.overflowY,property:"overflow-y",el:a}),a.style.overflow="hidden"}return()=>{n.forEach(({value:a,el:i,property:s})=>{a?i.style.setProperty(s,a):i.style.removeProperty(s)})}}function IW(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class jW{constructor(){this.modals=[],this.containers=[]}add(t,n){let l=this.modals.indexOf(t);if(l!==-1)return l;l=this.modals.length,this.modals.push(t),t.modalRef&&LT(t.modalRef,!1);const o=IW(n);zA(n,t.mount,t.modalRef,o,!0);const a=$L(this.containers,i=>i.container===n);return a!==-1?(this.containers[a].modals.push(t),l):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),l)}mount(t,n){const l=$L(this.containers,a=>a.modals.includes(t)),o=this.containers[l];o.restore||(o.restore=PW(o,n))}remove(t,n=!0){const l=this.modals.indexOf(t);if(l===-1)return l;const o=$L(this.containers,i=>i.modals.includes(t)),a=this.containers[o];if(a.modals.splice(a.modals.indexOf(t),1),this.modals.splice(l,1),a.modals.length===0)a.restore&&a.restore(),t.modalRef&&LT(t.modalRef,n),zA(a.container,t.mount,t.modalRef,a.hiddenSiblings,!1),this.containers.splice(o,1);else{const i=a.modals[a.modals.length-1];i.modalRef&&LT(i.modalRef,!1)}return l}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}var UL={};const FW=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function zW(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function qW(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=l=>e.ownerDocument.querySelector(`input[type="radio"]${l}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function $W(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||qW(e))}function UW(e){const t=[],n=[];return Array.from(e.querySelectorAll(FW)).forEach((l,o)=>{const a=zW(l);a===-1||!$W(l)||(a===0?t.push(l):n.push({documentOrder:o,tabIndex:a,node:l}))}),n.sort((l,o)=>l.tabIndex===o.tabIndex?l.documentOrder-o.documentOrder:l.tabIndex-o.tabIndex).map(l=>l.node).concat(t)}function GW(){return!0}function Fm(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:l=!1,disableRestoreFocus:o=!1,getTabbable:a=UW,isEnabled:i=GW,open:s}=e,c=oe.useRef(!1),u=oe.useRef(null),Q=oe.useRef(null),f=oe.useRef(null),h=oe.useRef(null),p=oe.useRef(!1),g=oe.useRef(null),v=v3(pT(t),g),b=oe.useRef(null);oe.useEffect(()=>{!s||!g.current||(p.current=!n)},[n,s]),oe.useEffect(()=>{if(!s||!g.current)return;const _=M4(g.current);return g.current.contains(_.activeElement)||(g.current.hasAttribute("tabIndex")||(UL.NODE_ENV!=="production"&&console.error(["MUI: The modal content node does not accept focus.",'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
325
- `)),g.current.setAttribute("tabIndex","-1")),p.current&&g.current.focus()),()=>{o||(f.current&&f.current.focus&&(c.current=!0,f.current.focus()),f.current=null)}},[s]),oe.useEffect(()=>{if(!s||!g.current)return;const _=M4(g.current),O=V=>{b.current=V,!(l||!i()||V.key!=="Tab")&&_.activeElement===g.current&&V.shiftKey&&(c.current=!0,Q.current&&Q.current.focus())},E=()=>{var B,R;const V=g.current;if(V===null)return;if(!_.hasFocus()||!i()||c.current){c.current=!1;return}if(V.contains(_.activeElement)||l&&_.activeElement!==u.current&&_.activeElement!==Q.current)return;if(_.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let k=[];if((_.activeElement===u.current||_.activeElement===Q.current)&&(k=a(g.current)),k.length>0){const F=!!((B=b.current)!=null&&B.shiftKey&&((R=b.current)==null?void 0:R.key)==="Tab"),q=k[0],$=k[k.length-1];typeof q!="string"&&typeof $!="string"&&(F?$.focus():q.focus())}else V.focus()};_.addEventListener("focusin",E),_.addEventListener("keydown",O,!0);const A=setInterval(()=>{_.activeElement&&_.activeElement.tagName==="BODY"&&E()},50);return()=>{clearInterval(A),_.removeEventListener("focusin",E),_.removeEventListener("keydown",O,!0)}},[n,l,o,i,s,a]);const L=_=>{f.current===null&&(f.current=_.relatedTarget),p.current=!0,h.current=_.target;const O=t.props.onFocus;O&&O(_)},S=_=>{f.current===null&&(f.current=_.relatedTarget),p.current=!0};return He.jsxs(oe.Fragment,{children:[He.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:u,"data-testid":"sentinelStart"}),oe.cloneElement(t,{ref:v,onFocus:L}),He.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:Q,"data-testid":"sentinelEnd"})]})}UL.NODE_ENV!=="production"&&(Fm.propTypes={children:vT,disableAutoFocus:M.bool,disableEnforceFocus:M.bool,disableRestoreFocus:M.bool,getTabbable:M.func,isEnabled:M.func,open:M.bool.isRequired}),UL.NODE_ENV!=="production"&&(Fm.propTypes=AM(Fm.propTypes));function ZW(e){return typeof e=="function"?e():e}function XW(e){return e?e.props.hasOwnProperty("in"):!1}const qA=()=>{},zm=new jW;function WW(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:l=!1,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:i,children:s,onClose:c,open:u,rootRef:Q}=e,f=oe.useRef({}),h=oe.useRef(null),p=oe.useRef(null),g=v3(p,Q),[v,b]=oe.useState(!u),L=XW(s);let S=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(S=!1);const _=()=>M4(h.current),O=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),E=()=>{zm.mount(O(),{disableScrollLock:l}),p.current&&(p.current.scrollTop=0)},A=kr(()=>{const ee=ZW(t)||_().body;zm.add(O(),ee),p.current&&E()}),V=()=>zm.isTopModal(O()),k=kr(ee=>{h.current=ee,ee&&(u&&V()?E():p.current&&LT(p.current,S))}),B=oe.useCallback(()=>{zm.remove(O(),S)},[S]);oe.useEffect(()=>()=>{B()},[B]),oe.useEffect(()=>{u?A():(!L||!o)&&B()},[u,B,L,o,A]);const R=ee=>W=>{var te;(te=ee.onKeyDown)==null||te.call(ee,W),!(W.key!=="Escape"||W.which===229||!V())&&(n||(W.stopPropagation(),c&&c(W,"escapeKeyDown")))},F=ee=>W=>{var te;(te=ee.onClick)==null||te.call(ee,W),W.target===W.currentTarget&&c&&c(W,"backdropClick")};return{getRootProps:(ee={})=>{const W=fT(e);delete W.onTransitionEnter,delete W.onTransitionExited;const te={...W,...ee};return{role:"presentation",...te,onKeyDown:R(te),ref:g}},getBackdropProps:(ee={})=>{const W=ee;return{"aria-hidden":!0,...W,onClick:F(W),open:u}},getTransitionProps:()=>{const ee=()=>{b(!1),a&&a()},W=()=>{b(!0),i&&i(),o&&B()};return{onEnter:Zv(ee,(s==null?void 0:s.props.onEnter)??qA),onExited:Zv(W,(s==null?void 0:s.props.onExited)??qA)}},rootRef:g,portalRef:k,isTopModal:V,exited:v,hasTransition:L}}function YW(e){return It("MuiModal",e)}kt("MuiModal",["root","hidden","backdrop"]);var KW={};const JW=e=>{const{open:t,exited:n,classes:l}=e;return Ut({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},YW,l)},eY=Ke("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Vt(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),tY=Ke(zL,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),GL=oe.forwardRef(function(t,n){const l=e1({name:"MuiModal",props:t}),{BackdropComponent:o=tY,BackdropProps:a,classes:i,className:s,closeAfterTransition:c=!1,children:u,container:Q,component:f,components:h={},componentsProps:p={},disableAutoFocus:g=!1,disableEnforceFocus:v=!1,disableEscapeKeyDown:b=!1,disablePortal:L=!1,disableRestoreFocus:S=!1,disableScrollLock:_=!1,hideBackdrop:O=!1,keepMounted:E=!1,onClose:A,onTransitionEnter:V,onTransitionExited:k,open:B,slotProps:R={},slots:F={},theme:q,...$}=l,Z={...l,closeAfterTransition:c,disableAutoFocus:g,disableEnforceFocus:v,disableEscapeKeyDown:b,disablePortal:L,disableRestoreFocus:S,disableScrollLock:_,hideBackdrop:O,keepMounted:E},{getRootProps:ee,getBackdropProps:W,getTransitionProps:te,portalRef:J,isTopModal:Y,exited:I,hasTransition:z}=WW({...Z,rootRef:n}),ne={...Z,exited:I},U=JW(ne),de={};if(u.props.tabIndex===void 0&&(de.tabIndex="-1"),z){const{onEnter:Se,onExited:_e}=te();de.onEnter=Se,de.onExited=_e}const me={slots:{root:h.Root,backdrop:h.Backdrop,...F},slotProps:{...p,...R}},[he,se]=t1("root",{ref:n,elementType:eY,externalForwardedProps:{...me,...$,component:f},getSlotProps:ee,ownerState:ne,className:Tt(s,U==null?void 0:U.root,!ne.open&&ne.exited&&(U==null?void 0:U.hidden))}),[fe,Ee]=t1("backdrop",{ref:a==null?void 0:a.ref,elementType:o,externalForwardedProps:me,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:Se=>W({...Se,onClick:_e=>{Se!=null&&Se.onClick&&Se.onClick(_e)}}),className:Tt(a==null?void 0:a.className,U==null?void 0:U.backdrop),ownerState:ne});return!E&&!B&&(!z||I)?null:He.jsx(Vm,{ref:J,container:Q,disablePortal:L,children:He.jsxs(he,{...se,children:[!O&&o?He.jsx(fe,{...Ee}):null,He.jsx(Fm,{disableEnforceFocus:v,disableAutoFocus:g,disableRestoreFocus:S,isEnabled:Y,open:B,children:oe.cloneElement(u,de)})]})})});KW.NODE_ENV!=="production"&&(GL.propTypes={BackdropComponent:M.elementType,BackdropProps:M.object,children:vT.isRequired,classes:M.object,className:M.string,closeAfterTransition:M.bool,component:M.elementType,components:M.shape({Backdrop:M.elementType,Root:M.elementType}),componentsProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object])}),container:M.oneOfType([hT,M.func]),disableAutoFocus:M.bool,disableEnforceFocus:M.bool,disableEscapeKeyDown:M.bool,disablePortal:M.bool,disableRestoreFocus:M.bool,disableScrollLock:M.bool,hideBackdrop:M.bool,keepMounted:M.bool,onClose:M.func,onTransitionEnter:M.func,onTransitionExited:M.func,open:M.bool.isRequired,slotProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object])}),slots:M.shape({backdrop:M.elementType,root:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function nY(e){return It("MuiDialog",e)}const ZL=kt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);var rY={};const XL=oe.createContext({});rY.NODE_ENV!=="production"&&(XL.displayName="DialogContext");var iY={};const aY=Ke(zL,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),oY=e=>{const{classes:t,scroll:n,maxWidth:l,fullWidth:o,fullScreen:a}=e,i={root:["root"],container:["container",`scroll${Ge(n)}`],paper:["paper",`paperScroll${Ge(n)}`,`paperWidth${Ge(String(l))}`,o&&"paperFullWidth",a&&"paperFullScreen"]};return Ut(i,nY,t)},lY=Ke(GL,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),sY=Ke("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ge(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),uY=Ke(QT,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ge(n.scroll)}`],t[`paperWidth${Ge(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Vt(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${ZL.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${ZL.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${ZL.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),qm=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialog"}),o=Ga(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":s,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:Q,children:f,className:h,disableEscapeKeyDown:p=!1,fullScreen:g=!1,fullWidth:v=!1,maxWidth:b="sm",onClick:L,onClose:S,open:_,PaperComponent:O=QT,PaperProps:E={},scroll:A="paper",slots:V={},slotProps:k={},TransitionComponent:B=jm,transitionDuration:R=a,TransitionProps:F,...q}=l,$={...l,disableEscapeKeyDown:p,fullScreen:g,fullWidth:v,maxWidth:b,scroll:A},Z=oY($),ee=oe.useRef(),W=ue=>{ee.current=ue.target===ue.currentTarget},te=ue=>{L&&L(ue),ee.current&&(ee.current=null,S&&S(ue,"backdropClick"))},J=ks(s),Y=oe.useMemo(()=>({titleId:J}),[J]),I={transition:B,...V},z={transition:F,paper:E,backdrop:Q,...k},ne={slots:I,slotProps:z},[U,de]=t1("root",{elementType:lY,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:$,className:Tt(Z.root,h),ref:n}),[me,he]=t1("backdrop",{elementType:aY,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:$}),[se,fe]=t1("paper",{elementType:uY,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:$,className:Tt(Z.paper,E.className)}),[Ee,Se]=t1("container",{elementType:sY,externalForwardedProps:ne,ownerState:$,className:Z.container}),[_e,ze]=t1("transition",{elementType:jm,externalForwardedProps:ne,ownerState:$,additionalProps:{appear:!0,in:_,timeout:R,role:"presentation"}});return He.jsx(U,{closeAfterTransition:!0,slots:{backdrop:me},slotProps:{backdrop:{transitionDuration:R,as:u,...he}},disableEscapeKeyDown:p,onClose:S,open:_,onClick:te,...de,...q,children:He.jsx(_e,{...ze,children:He.jsx(Ee,{onMouseDown:W,...Se,children:He.jsx(se,{as:O,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":J,"aria-modal":c,...fe,children:He.jsx(XL.Provider,{value:Y,children:f})})})})})});iY.NODE_ENV!=="production"&&(qm.propTypes={"aria-describedby":M.string,"aria-labelledby":M.string,"aria-modal":M.oneOfType([M.oneOf(["false","true"]),M.bool]),BackdropComponent:M.elementType,BackdropProps:M.object,children:M.node,classes:M.object,className:M.string,disableEscapeKeyDown:M.bool,fullScreen:M.bool,fullWidth:M.bool,maxWidth:M.oneOfType([M.oneOf(["xs","sm","md","lg","xl",!1]),M.string]),onClick:M.func,onClose:M.func,open:M.bool.isRequired,PaperComponent:M.elementType,PaperProps:M.object,scroll:M.oneOf(["body","paper"]),slotProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),container:M.oneOfType([M.func,M.object]),paper:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),transition:M.oneOfType([M.func,M.object])}),slots:M.shape({backdrop:M.elementType,container:M.elementType,paper:M.elementType,root:M.elementType,transition:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),TransitionComponent:M.elementType,transitionDuration:M.oneOfType([M.number,M.shape({appear:M.number,enter:M.number,exit:M.number})]),TransitionProps:M.object});function cY(e){return It("MuiDialogActions",e)}kt("MuiDialogActions",["root","spacing"]);var TY={};const QY=e=>{const{classes:t,disableSpacing:n}=e;return Ut({root:["root",!n&&"spacing"]},cY,t)},fY=Ke("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),WL=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:a=!1,...i}=l,s={...l,disableSpacing:a},c=QY(s);return He.jsx(fY,{className:Tt(c.root,o),ownerState:s,ref:n,...i})});TY.NODE_ENV!=="production"&&(WL.propTypes={children:M.node,classes:M.object,className:M.string,disableSpacing:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function dY(e){return It("MuiDialogContent",e)}kt("MuiDialogContent",["root","dividers"]);function hY(e){return It("MuiDialogTitle",e)}const pY=kt("MuiDialogTitle",["root"]);var mY={};const yY=e=>{const{classes:t,dividers:n}=e;return Ut({root:["root",n&&"dividers"]},dY,t)},gY=Ke("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Vt(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${pY.root} + &`]:{paddingTop:0}}}]}))),$m=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialogContent"}),{className:o,dividers:a=!1,...i}=l,s={...l,dividers:a},c=yY(s);return He.jsx(gY,{className:Tt(c.root,o),ownerState:s,ref:n,...i})});mY.NODE_ENV!=="production"&&($m.propTypes={children:M.node,classes:M.object,className:M.string,dividers:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});var vY={};const LY=e=>{const{classes:t}=e;return Ut({root:["root"]},hY,t)},xY=Ke(K3,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),YL=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialogTitle"}),{className:o,id:a,...i}=l,s=l,c=LY(s),{titleId:u=a}=oe.useContext(XL);return He.jsx(xY,{component:"h2",className:Tt(c.root,o),ownerState:s,ref:n,variant:"h6",id:a??u,...i})});vY.NODE_ENV!=="production"&&(YL.propTypes={children:M.node,classes:M.object,className:M.string,id:M.string,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function bY(e){return It("MuiDivider",e)}const $A=kt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);var HY={};const SY=e=>{const{absolute:t,children:n,classes:l,flexItem:o,light:a,orientation:i,textAlign:s,variant:c}=e;return Ut({root:["root",t&&"absolute",c,a&&"light",i==="vertical"&&"vertical",o&&"flexItem",n&&"withChildren",n&&i==="vertical"&&"withChildrenVertical",s==="right"&&i!=="vertical"&&"textAlignRight",s==="left"&&i!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",i==="vertical"&&"wrapperVertical"]},bY,l)},EY=Ke("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(Vt(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:_1(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:t})=>!!t.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:t})=>t.children&&t.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:t})=>t.orientation==="vertical"&&t.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:t})=>t.textAlign==="right"&&t.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:t})=>t.textAlign==="left"&&t.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),MY=Ke("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(Vt(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),Zs=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDivider"}),{absolute:o=!1,children:a,className:i,orientation:s="horizontal",component:c=a||s==="vertical"?"div":"hr",flexItem:u=!1,light:Q=!1,role:f=c!=="hr"?"separator":void 0,textAlign:h="center",variant:p="fullWidth",...g}=l,v={...l,absolute:o,component:c,flexItem:u,light:Q,orientation:s,role:f,textAlign:h,variant:p},b=SY(v);return He.jsx(EY,{as:c,className:Tt(b.root,i),role:f,ref:n,ownerState:v,"aria-orientation":f==="separator"&&(c!=="hr"||s==="vertical")?s:void 0,...g,children:a?He.jsx(MY,{className:b.wrapper,ownerState:v,children:a}):null})});Zs&&(Zs.muiSkipListHighlight=!0),HY.NODE_ENV!=="production"&&(Zs.propTypes={absolute:M.bool,children:M.node,classes:M.object,className:M.string,component:M.elementType,flexItem:M.bool,light:M.bool,orientation:M.oneOf(["horizontal","vertical"]),role:M.string,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),textAlign:M.oneOf(["center","left","right"]),variant:M.oneOfType([M.oneOf(["fullWidth","inset","middle"]),M.string])});var AY={};const _Y=e=>{const{classes:t,disableUnderline:n,startAdornment:l,endAdornment:o,size:a,hiddenLabel:i,multiline:s}=e,c={root:["root",!n&&"underline",l&&"adornedStart",o&&"adornedEnd",a==="small"&&`size${Ge(a)}`,i&&"hiddenLabel",s&&"multiline"],input:["input"]},u=Ut(c,rW,t);return{...t,...u}},OY=Ke(Bm,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...km(e,t),!n.disableUnderline&&t.underline]}})(Vt(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",l=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:l,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:l}},[`&.${q7.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:l},[`&.${q7.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:i})=>!i.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${q7.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${q7.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${q7.disabled}, .${q7.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${q7.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(_2()).map(([i])=>{var s;return{props:{disableUnderline:!1,color:i},style:{"&::after":{borderBottom:`2px solid ${(s=(e.vars||e).palette[i])==null?void 0:s.main}`}}}}),{props:({ownerState:i})=>i.startAdornment,style:{paddingLeft:12}},{props:({ownerState:i})=>i.endAdornment,style:{paddingRight:12}},{props:({ownerState:i})=>i.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:i,size:s})=>i.multiline&&s==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel&&i.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),CY=Ke(Pm,{name:"MuiFilledInput",slot:"Input",overridesResolver:Nm})(Vt(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),Um=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:a={},componentsProps:i,fullWidth:s=!1,hiddenLabel:c,inputComponent:u="input",multiline:Q=!1,slotProps:f,slots:h={},type:p="text",...g}=l,v={...l,disableUnderline:o,fullWidth:s,inputComponent:u,multiline:Q,type:p},b=_Y(l),L={root:{ownerState:v},input:{ownerState:v}},S=f??i?G3(L,f??i):L,_=h.root??a.Root??OY,O=h.input??a.Input??CY;return He.jsx(Im,{slots:{root:_,input:O},slotProps:S,fullWidth:s,inputComponent:u,multiline:Q,ref:n,type:p,...g,classes:b})});AY.NODE_ENV!=="production"&&(Um.propTypes={autoComplete:M.string,autoFocus:M.bool,classes:M.object,color:M.oneOfType([M.oneOf(["primary","secondary"]),M.string]),components:M.shape({Input:M.elementType,Root:M.elementType}),componentsProps:M.shape({input:M.object,root:M.object}),defaultValue:M.any,disabled:M.bool,disableUnderline:M.bool,endAdornment:M.node,error:M.bool,fullWidth:M.bool,hiddenLabel:M.bool,id:M.string,inputComponent:M.elementType,inputProps:M.object,inputRef:bn,margin:M.oneOf(["dense","none"]),maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),multiline:M.bool,name:M.string,onChange:M.func,placeholder:M.string,readOnly:M.bool,required:M.bool,rows:M.oneOfType([M.number,M.string]),slotProps:M.shape({input:M.object,root:M.object}),slots:M.shape({input:M.elementType,root:M.elementType}),startAdornment:M.node,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.string,value:M.any}),Um.muiName="Input";function wY(e){return It("MuiFormControl",e)}kt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var UA={};const VY=e=>{const{classes:t,margin:n,fullWidth:l}=e,o={root:["root",n!=="none"&&`margin${Ge(n)}`,l&&"fullWidth"]};return Ut(o,wY,t)},DY=Ke("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Ge(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),J4=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFormControl"}),{children:o,className:a,color:i="primary",component:s="div",disabled:c=!1,error:u=!1,focused:Q,fullWidth:f=!1,hiddenLabel:h=!1,margin:p="none",required:g=!1,size:v="medium",variant:b="outlined",...L}=l,S={...l,color:i,component:s,disabled:c,error:u,fullWidth:f,hiddenLabel:h,margin:p,required:g,size:v,variant:b},_=VY(S),[O,E]=oe.useState(()=>{let W=!1;return o&&oe.Children.forEach(o,te=>{if(!vm(te,["Input","Select"]))return;const J=vm(te,["Select"])?te.props.input:te;J&&KX(J.props)&&(W=!0)}),W}),[A,V]=oe.useState(()=>{let W=!1;return o&&oe.Children.forEach(o,te=>{vm(te,["Input","Select"])&&(Rm(te.props,!0)||Rm(te.props.inputProps,!0))&&(W=!0)}),W}),[k,B]=oe.useState(!1);c&&k&&B(!1);const R=Q!==void 0&&!c?Q:k;let F;const q=oe.useRef(!1);UA.NODE_ENV!=="production"&&(F=()=>(q.current&&console.error(["MUI: There are multiple `InputBase` components inside a FormControl.","This creates visual inconsistencies, only use one `InputBase`."].join(`
325
+ `)),g.current.setAttribute("tabIndex","-1")),p.current&&g.current.focus()),()=>{o||(f.current&&f.current.focus&&(c.current=!0,f.current.focus()),f.current=null)}},[s]),oe.useEffect(()=>{if(!s||!g.current)return;const _=M4(g.current),O=V=>{b.current=V,!(l||!i()||V.key!=="Tab")&&_.activeElement===g.current&&V.shiftKey&&(c.current=!0,Q.current&&Q.current.focus())},E=()=>{var B,R;const V=g.current;if(V===null)return;if(!_.hasFocus()||!i()||c.current){c.current=!1;return}if(V.contains(_.activeElement)||l&&_.activeElement!==u.current&&_.activeElement!==Q.current)return;if(_.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!p.current)return;let k=[];if((_.activeElement===u.current||_.activeElement===Q.current)&&(k=a(g.current)),k.length>0){const F=!!((B=b.current)!=null&&B.shiftKey&&((R=b.current)==null?void 0:R.key)==="Tab"),q=k[0],$=k[k.length-1];typeof q!="string"&&typeof $!="string"&&(F?$.focus():q.focus())}else V.focus()};_.addEventListener("focusin",E),_.addEventListener("keydown",O,!0);const A=setInterval(()=>{_.activeElement&&_.activeElement.tagName==="BODY"&&E()},50);return()=>{clearInterval(A),_.removeEventListener("focusin",E),_.removeEventListener("keydown",O,!0)}},[n,l,o,i,s,a]);const L=_=>{f.current===null&&(f.current=_.relatedTarget),p.current=!0,h.current=_.target;const O=t.props.onFocus;O&&O(_)},S=_=>{f.current===null&&(f.current=_.relatedTarget),p.current=!0};return He.jsxs(oe.Fragment,{children:[He.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:u,"data-testid":"sentinelStart"}),oe.cloneElement(t,{ref:v,onFocus:L}),He.jsx("div",{tabIndex:s?0:-1,onFocus:S,ref:Q,"data-testid":"sentinelEnd"})]})}UL.NODE_ENV!=="production"&&(Fm.propTypes={children:vT,disableAutoFocus:M.bool,disableEnforceFocus:M.bool,disableRestoreFocus:M.bool,getTabbable:M.func,isEnabled:M.func,open:M.bool.isRequired}),UL.NODE_ENV!=="production"&&(Fm.propTypes=AM(Fm.propTypes));function ZW(e){return typeof e=="function"?e():e}function XW(e){return e?e.props.hasOwnProperty("in"):!1}const qA=()=>{},zm=new jW;function WW(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:l=!1,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:i,children:s,onClose:c,open:u,rootRef:Q}=e,f=oe.useRef({}),h=oe.useRef(null),p=oe.useRef(null),g=v3(p,Q),[v,b]=oe.useState(!u),L=XW(s);let S=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(S=!1);const _=()=>M4(h.current),O=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),E=()=>{zm.mount(O(),{disableScrollLock:l}),p.current&&(p.current.scrollTop=0)},A=kr(()=>{const ee=ZW(t)||_().body;zm.add(O(),ee),p.current&&E()}),V=()=>zm.isTopModal(O()),k=kr(ee=>{h.current=ee,ee&&(u&&V()?E():p.current&&LT(p.current,S))}),B=oe.useCallback(()=>{zm.remove(O(),S)},[S]);oe.useEffect(()=>()=>{B()},[B]),oe.useEffect(()=>{u?A():(!L||!o)&&B()},[u,B,L,o,A]);const R=ee=>W=>{var te;(te=ee.onKeyDown)==null||te.call(ee,W),!(W.key!=="Escape"||W.which===229||!V())&&(n||(W.stopPropagation(),c&&c(W,"escapeKeyDown")))},F=ee=>W=>{var te;(te=ee.onClick)==null||te.call(ee,W),W.target===W.currentTarget&&c&&c(W,"backdropClick")};return{getRootProps:(ee={})=>{const W=fT(e);delete W.onTransitionEnter,delete W.onTransitionExited;const te={...W,...ee};return{role:"presentation",...te,onKeyDown:R(te),ref:g}},getBackdropProps:(ee={})=>{const W=ee;return{"aria-hidden":!0,...W,onClick:F(W),open:u}},getTransitionProps:()=>{const ee=()=>{b(!1),a&&a()},W=()=>{b(!0),i&&i(),o&&B()};return{onEnter:Zv(ee,(s==null?void 0:s.props.onEnter)??qA),onExited:Zv(W,(s==null?void 0:s.props.onExited)??qA)}},rootRef:g,portalRef:k,isTopModal:V,exited:v,hasTransition:L}}function YW(e){return It("MuiModal",e)}kt("MuiModal",["root","hidden","backdrop"]);var KW={};const JW=e=>{const{open:t,exited:n,classes:l}=e;return Ut({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},YW,l)},eY=Ke("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Vt(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),tY=Ke(zL,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),GL=oe.forwardRef(function(t,n){const l=e1({name:"MuiModal",props:t}),{BackdropComponent:o=tY,BackdropProps:a,classes:i,className:s,closeAfterTransition:c=!1,children:u,container:Q,component:f,components:h={},componentsProps:p={},disableAutoFocus:g=!1,disableEnforceFocus:v=!1,disableEscapeKeyDown:b=!1,disablePortal:L=!1,disableRestoreFocus:S=!1,disableScrollLock:_=!1,hideBackdrop:O=!1,keepMounted:E=!1,onClose:A,onTransitionEnter:V,onTransitionExited:k,open:B,slotProps:R={},slots:F={},theme:q,...$}=l,Z={...l,closeAfterTransition:c,disableAutoFocus:g,disableEnforceFocus:v,disableEscapeKeyDown:b,disablePortal:L,disableRestoreFocus:S,disableScrollLock:_,hideBackdrop:O,keepMounted:E},{getRootProps:ee,getBackdropProps:W,getTransitionProps:te,portalRef:J,isTopModal:Y,exited:I,hasTransition:z}=WW({...Z,rootRef:n}),ne={...Z,exited:I},U=JW(ne),de={};if(u.props.tabIndex===void 0&&(de.tabIndex="-1"),z){const{onEnter:Se,onExited:_e}=te();de.onEnter=Se,de.onExited=_e}const me={slots:{root:h.Root,backdrop:h.Backdrop,...F},slotProps:{...p,...R}},[he,se]=t1("root",{ref:n,elementType:eY,externalForwardedProps:{...me,...$,component:f},getSlotProps:ee,ownerState:ne,className:Tt(s,U==null?void 0:U.root,!ne.open&&ne.exited&&(U==null?void 0:U.hidden))}),[fe,Ee]=t1("backdrop",{ref:a==null?void 0:a.ref,elementType:o,externalForwardedProps:me,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:Se=>W({...Se,onClick:_e=>{Se!=null&&Se.onClick&&Se.onClick(_e)}}),className:Tt(a==null?void 0:a.className,U==null?void 0:U.backdrop),ownerState:ne});return!E&&!B&&(!z||I)?null:He.jsx(Vm,{ref:J,container:Q,disablePortal:L,children:He.jsxs(he,{...se,children:[!O&&o?He.jsx(fe,{...Ee}):null,He.jsx(Fm,{disableEnforceFocus:v,disableAutoFocus:g,disableRestoreFocus:S,isEnabled:Y,open:B,children:oe.cloneElement(u,de)})]})})});KW.NODE_ENV!=="production"&&(GL.propTypes={BackdropComponent:M.elementType,BackdropProps:M.object,children:vT.isRequired,classes:M.object,className:M.string,closeAfterTransition:M.bool,component:M.elementType,components:M.shape({Backdrop:M.elementType,Root:M.elementType}),componentsProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object])}),container:M.oneOfType([hT,M.func]),disableAutoFocus:M.bool,disableEnforceFocus:M.bool,disableEscapeKeyDown:M.bool,disablePortal:M.bool,disableRestoreFocus:M.bool,disableScrollLock:M.bool,hideBackdrop:M.bool,keepMounted:M.bool,onClose:M.func,onTransitionEnter:M.func,onTransitionExited:M.func,open:M.bool.isRequired,slotProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object])}),slots:M.shape({backdrop:M.elementType,root:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function nY(e){return It("MuiDialog",e)}const ZL=kt("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);var rY={};const XL=oe.createContext({});rY.NODE_ENV!=="production"&&(XL.displayName="DialogContext");var iY={};const aY=Ke(zL,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),oY=e=>{const{classes:t,scroll:n,maxWidth:l,fullWidth:o,fullScreen:a}=e,i={root:["root"],container:["container",`scroll${Ge(n)}`],paper:["paper",`paperScroll${Ge(n)}`,`paperWidth${Ge(String(l))}`,o&&"paperFullWidth",a&&"paperFullScreen"]};return Ut(i,nY,t)},lY=Ke(GL,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),sY=Ke("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${Ge(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),uY=Ke(QT,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${Ge(n.scroll)}`],t[`paperWidth${Ge(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Vt(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${ZL.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${ZL.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${ZL.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),qm=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialog"}),o=Ga(),a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":i,"aria-labelledby":s,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:Q,children:f,className:h,disableEscapeKeyDown:p=!1,fullScreen:g=!1,fullWidth:v=!1,maxWidth:b="sm",onClick:L,onClose:S,open:_,PaperComponent:O=QT,PaperProps:E={},scroll:A="paper",slots:V={},slotProps:k={},TransitionComponent:B=jm,transitionDuration:R=a,TransitionProps:F,...q}=l,$={...l,disableEscapeKeyDown:p,fullScreen:g,fullWidth:v,maxWidth:b,scroll:A},Z=oY($),ee=oe.useRef(),W=ue=>{ee.current=ue.target===ue.currentTarget},te=ue=>{L&&L(ue),ee.current&&(ee.current=null,S&&S(ue,"backdropClick"))},J=ks(s),Y=oe.useMemo(()=>({titleId:J}),[J]),I={transition:B,...V},z={transition:F,paper:E,backdrop:Q,...k},ne={slots:I,slotProps:z},[U,de]=t1("root",{elementType:lY,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:$,className:Tt(Z.root,h),ref:n}),[me,he]=t1("backdrop",{elementType:aY,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:$}),[se,fe]=t1("paper",{elementType:uY,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:$,className:Tt(Z.paper,E.className)}),[Ee,Se]=t1("container",{elementType:sY,externalForwardedProps:ne,ownerState:$,className:Z.container}),[_e,ze]=t1("transition",{elementType:jm,externalForwardedProps:ne,ownerState:$,additionalProps:{appear:!0,in:_,timeout:R,role:"presentation"}});return He.jsx(U,{closeAfterTransition:!0,slots:{backdrop:me},slotProps:{backdrop:{transitionDuration:R,as:u,...he}},disableEscapeKeyDown:p,onClose:S,open:_,onClick:te,...de,...q,children:He.jsx(_e,{...ze,children:He.jsx(Ee,{onMouseDown:W,...Se,children:He.jsx(se,{as:O,elevation:24,role:"dialog","aria-describedby":i,"aria-labelledby":J,"aria-modal":c,...fe,children:He.jsx(XL.Provider,{value:Y,children:f})})})})})});iY.NODE_ENV!=="production"&&(qm.propTypes={"aria-describedby":M.string,"aria-labelledby":M.string,"aria-modal":M.oneOfType([M.oneOf(["false","true"]),M.bool]),BackdropComponent:M.elementType,BackdropProps:M.object,children:M.node,classes:M.object,className:M.string,disableEscapeKeyDown:M.bool,fullScreen:M.bool,fullWidth:M.bool,maxWidth:M.oneOfType([M.oneOf(["xs","sm","md","lg","xl",!1]),M.string]),onClick:M.func,onClose:M.func,open:M.bool.isRequired,PaperComponent:M.elementType,PaperProps:M.object,scroll:M.oneOf(["body","paper"]),slotProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),container:M.oneOfType([M.func,M.object]),paper:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),transition:M.oneOfType([M.func,M.object])}),slots:M.shape({backdrop:M.elementType,container:M.elementType,paper:M.elementType,root:M.elementType,transition:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),TransitionComponent:M.elementType,transitionDuration:M.oneOfType([M.number,M.shape({appear:M.number,enter:M.number,exit:M.number})]),TransitionProps:M.object});function cY(e){return It("MuiDialogActions",e)}kt("MuiDialogActions",["root","spacing"]);var TY={};const QY=e=>{const{classes:t,disableSpacing:n}=e;return Ut({root:["root",!n&&"spacing"]},cY,t)},fY=Ke("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),WL=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:a=!1,...i}=l,s={...l,disableSpacing:a},c=QY(s);return He.jsx(fY,{className:Tt(c.root,o),ownerState:s,ref:n,...i})});TY.NODE_ENV!=="production"&&(WL.propTypes={children:M.node,classes:M.object,className:M.string,disableSpacing:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function dY(e){return It("MuiDialogContent",e)}kt("MuiDialogContent",["root","dividers"]);function hY(e){return It("MuiDialogTitle",e)}const pY=kt("MuiDialogTitle",["root"]);var mY={};const yY=e=>{const{classes:t,dividers:n}=e;return Ut({root:["root",n&&"dividers"]},dY,t)},gY=Ke("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Vt(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${pY.root} + &`]:{paddingTop:0}}}]}))),$m=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialogContent"}),{className:o,dividers:a=!1,...i}=l,s={...l,dividers:a},c=yY(s);return He.jsx(gY,{className:Tt(c.root,o),ownerState:s,ref:n,...i})});mY.NODE_ENV!=="production"&&($m.propTypes={children:M.node,classes:M.object,className:M.string,dividers:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});var vY={};const LY=e=>{const{classes:t}=e;return Ut({root:["root"]},hY,t)},xY=Ke(K3,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),YL=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDialogTitle"}),{className:o,id:a,...i}=l,s=l,c=LY(s),{titleId:u=a}=oe.useContext(XL);return He.jsx(xY,{component:"h2",className:Tt(c.root,o),ownerState:s,ref:n,variant:"h6",id:a??u,...i})});vY.NODE_ENV!=="production"&&(YL.propTypes={children:M.node,classes:M.object,className:M.string,id:M.string,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function bY(e){return It("MuiDivider",e)}const $A=kt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);var HY={};const SY=e=>{const{absolute:t,children:n,classes:l,flexItem:o,light:a,orientation:i,textAlign:s,variant:c}=e;return Ut({root:["root",t&&"absolute",c,a&&"light",i==="vertical"&&"vertical",o&&"flexItem",n&&"withChildren",n&&i==="vertical"&&"withChildrenVertical",s==="right"&&i!=="vertical"&&"textAlignRight",s==="left"&&i!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",i==="vertical"&&"wrapperVertical"]},bY,l)},EY=Ke("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(Vt(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:_1(e.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:t})=>!!t.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:t})=>t.children&&t.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:t})=>t.orientation==="vertical"&&t.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:t})=>t.textAlign==="right"&&t.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:t})=>t.textAlign==="left"&&t.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),MY=Ke("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(Vt(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),Zs=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiDivider"}),{absolute:o=!1,children:a,className:i,orientation:s="horizontal",component:c=a||s==="vertical"?"div":"hr",flexItem:u=!1,light:Q=!1,role:f=c!=="hr"?"separator":void 0,textAlign:h="center",variant:p="fullWidth",...g}=l,v={...l,absolute:o,component:c,flexItem:u,light:Q,orientation:s,role:f,textAlign:h,variant:p},b=SY(v);return He.jsx(EY,{as:c,className:Tt(b.root,i),role:f,ref:n,ownerState:v,"aria-orientation":f==="separator"&&(c!=="hr"||s==="vertical")?s:void 0,...g,children:a?He.jsx(MY,{className:b.wrapper,ownerState:v,children:a}):null})});Zs&&(Zs.muiSkipListHighlight=!0),HY.NODE_ENV!=="production"&&(Zs.propTypes={absolute:M.bool,children:M.node,classes:M.object,className:M.string,component:M.elementType,flexItem:M.bool,light:M.bool,orientation:M.oneOf(["horizontal","vertical"]),role:M.string,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),textAlign:M.oneOf(["center","left","right"]),variant:M.oneOfType([M.oneOf(["fullWidth","inset","middle"]),M.string])});var AY={};const _Y=e=>{const{classes:t,disableUnderline:n,startAdornment:l,endAdornment:o,size:a,hiddenLabel:i,multiline:s}=e,c={root:["root",!n&&"underline",l&&"adornedStart",o&&"adornedEnd",a==="small"&&`size${Ge(a)}`,i&&"hiddenLabel",s&&"multiline"],input:["input"]},u=Ut(c,rW,t);return{...t,...u}},OY=Ke(Bm,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...km(e,t),!n.disableUnderline&&t.underline]}})(Vt(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",l=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:l,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:l}},[`&.${q7.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:l},[`&.${q7.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:i})=>!i.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${q7.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${q7.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${q7.disabled}, .${q7.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${q7.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(_2()).map(([i])=>{var s;return{props:{disableUnderline:!1,color:i},style:{"&::after":{borderBottom:`2px solid ${(s=(e.vars||e).palette[i])==null?void 0:s.main}`}}}}),{props:({ownerState:i})=>i.startAdornment,style:{paddingLeft:12}},{props:({ownerState:i})=>i.endAdornment,style:{paddingRight:12}},{props:({ownerState:i})=>i.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:i,size:s})=>i.multiline&&s==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:i})=>i.multiline&&i.hiddenLabel&&i.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),CY=Ke(Pm,{name:"MuiFilledInput",slot:"Input",overridesResolver:Nm})(Vt(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),Um=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:a={},componentsProps:i,fullWidth:s=!1,hiddenLabel:c,inputComponent:u="input",multiline:Q=!1,slotProps:f,slots:h={},type:p="text",...g}=l,v={...l,disableUnderline:o,fullWidth:s,inputComponent:u,multiline:Q,type:p},b=_Y(l),L={root:{ownerState:v},input:{ownerState:v}},S=f??i?G3(L,f??i):L,_=h.root??a.Root??OY,O=h.input??a.Input??CY;return He.jsx(Im,{slots:{root:_,input:O},slotProps:S,fullWidth:s,inputComponent:u,multiline:Q,ref:n,type:p,...g,classes:b})});AY.NODE_ENV!=="production"&&(Um.propTypes={autoComplete:M.string,autoFocus:M.bool,classes:M.object,color:M.oneOfType([M.oneOf(["primary","secondary"]),M.string]),components:M.shape({Input:M.elementType,Root:M.elementType}),componentsProps:M.shape({input:M.object,root:M.object}),defaultValue:M.any,disabled:M.bool,disableUnderline:M.bool,endAdornment:M.node,error:M.bool,fullWidth:M.bool,hiddenLabel:M.bool,id:M.string,inputComponent:M.elementType,inputProps:M.object,inputRef:bn,margin:M.oneOf(["dense","none"]),maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),multiline:M.bool,name:M.string,onChange:M.func,placeholder:M.string,readOnly:M.bool,required:M.bool,rows:M.oneOfType([M.number,M.string]),slotProps:M.shape({input:M.object,root:M.object}),slots:M.shape({input:M.elementType,root:M.elementType}),startAdornment:M.node,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.string,value:M.any}),Um.muiName="Input";function wY(e){return It("MuiFormControl",e)}kt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var UA={};const VY=e=>{const{classes:t,margin:n,fullWidth:l}=e,o={root:["root",n!=="none"&&`margin${Ge(n)}`,l&&"fullWidth"]};return Ut(o,wY,t)},DY=Ke("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${Ge(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),J4=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFormControl"}),{children:o,className:a,color:i="primary",component:s="div",disabled:c=!1,error:u=!1,focused:Q,fullWidth:f=!1,hiddenLabel:h=!1,margin:p="none",required:g=!1,size:v="medium",variant:b="outlined",...L}=l,S={...l,color:i,component:s,disabled:c,error:u,fullWidth:f,hiddenLabel:h,margin:p,required:g,size:v,variant:b},_=VY(S),[O,E]=oe.useState(()=>{let W=!1;return o&&oe.Children.forEach(o,te=>{if(!vm(te,["Input","Select"]))return;const J=vm(te,["Select"])?te.props.input:te;J&&KX(J.props)&&(W=!0)}),W}),[A,V]=oe.useState(()=>{let W=!1;return o&&oe.Children.forEach(o,te=>{vm(te,["Input","Select"])&&(Rm(te.props,!0)||Rm(te.props.inputProps,!0))&&(W=!0)}),W}),[k,B]=oe.useState(!1);c&&k&&B(!1);const R=Q!==void 0&&!c?Q:k;let F;const q=oe.useRef(!1);UA.NODE_ENV!=="production"&&(F=()=>(q.current&&console.error(["MUI: There are multiple `InputBase` components inside a FormControl.","This creates visual inconsistencies, only use one `InputBase`."].join(`
326
326
  `)),q.current=!0,()=>{q.current=!1}));const $=oe.useCallback(()=>{V(!0)},[]),Z=oe.useCallback(()=>{V(!1)},[]),ee=oe.useMemo(()=>({adornedStart:O,setAdornedStart:E,color:i,disabled:c,error:u,filled:A,focused:R,fullWidth:f,hiddenLabel:h,size:v,onBlur:()=>{B(!1)},onFocus:()=>{B(!0)},onEmpty:Z,onFilled:$,registerEffect:F,required:g,variant:b}),[O,i,c,u,A,R,f,h,F,Z,$,g,v,b]);return He.jsx(mT.Provider,{value:ee,children:He.jsx(DY,{as:s,ownerState:S,className:Tt(_.root,a),ref:n,...L,children:o})})});UA.NODE_ENV!=="production"&&(J4.propTypes={children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["primary","secondary","error","info","success","warning"]),M.string]),component:M.elementType,disabled:M.bool,error:M.bool,focused:M.bool,fullWidth:M.bool,hiddenLabel:M.bool,margin:M.oneOf(["dense","none","normal"]),required:M.bool,size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),variant:M.oneOf(["filled","outlined","standard"])});function RY(e){return It("MuiFormControlLabel",e)}const xT=kt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);var kY={};const NY=e=>{const{classes:t,disabled:n,labelPlacement:l,error:o,required:a}=e,i={root:["root",n&&"disabled",`labelPlacement${Ge(l)}`,o&&"error",a&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Ut(i,RY,t)},BY=Ke("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${xT.label}`]:t.label},t.root,t[`labelPlacement${Ge(n.labelPlacement)}`]]}})(Vt(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${xT.disabled}`]:{cursor:"default"},[`& .${xT.label}`]:{[`&.${xT.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),PY=Ke("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(Vt(({theme:e})=>({[`&.${xT.error}`]:{color:(e.vars||e).palette.error.main}}))),KL=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFormControlLabel"}),{checked:o,className:a,componentsProps:i={},control:s,disabled:c,disableTypography:u,inputRef:Q,label:f,labelPlacement:h="end",name:p,onChange:g,required:v,slots:b={},slotProps:L={},value:S,..._}=l,O=Q5(),E=c??s.props.disabled??(O==null?void 0:O.disabled),A=v??s.props.required,V={disabled:E,required:A};["checked","name","onChange","value","inputRef"].forEach(ee=>{typeof s.props[ee]>"u"&&typeof l[ee]<"u"&&(V[ee]=l[ee])});const k=Xa({props:l,muiFormControl:O,states:["error"]}),B={...l,disabled:E,labelPlacement:h,required:A,error:k.error},R=NY(B),F={slots:b,slotProps:{...i,...L}},[q,$]=t1("typography",{elementType:K3,externalForwardedProps:F,ownerState:B});let Z=f;return Z!=null&&Z.type!==K3&&!u&&(Z=He.jsx(q,{component:"span",...$,className:Tt(R.label,$==null?void 0:$.className),children:Z})),He.jsxs(BY,{className:Tt(R.root,a),ownerState:B,ref:n,..._,children:[oe.cloneElement(s,V),A?He.jsxs("div",{children:[Z,He.jsxs(PY,{ownerState:B,"aria-hidden":!0,className:R.asterisk,children:[" ","*"]})]}):Z]})});kY.NODE_ENV!=="production"&&(KL.propTypes={checked:M.bool,classes:M.object,className:M.string,componentsProps:M.shape({typography:M.object}),control:M.element.isRequired,disabled:M.bool,disableTypography:M.bool,inputRef:bn,label:M.node,labelPlacement:M.oneOf(["bottom","end","start","top"]),name:M.string,onChange:M.func,required:M.bool,slotProps:M.shape({typography:M.oneOfType([M.func,M.object])}),slots:M.shape({typography:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),value:M.any});function IY(e){return It("MuiFormGroup",e)}kt("MuiFormGroup",["root","row","error"]);var jY={};const FY=e=>{const{classes:t,row:n,error:l}=e;return Ut({root:["root",n&&"row",l&&"error"]},IY,t)},zY=Ke("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"}}]}),GA=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFormGroup"}),{className:o,row:a=!1,...i}=l,s=Q5(),c=Xa({props:l,muiFormControl:s,states:["error"]}),u={...l,row:a,error:c.error},Q=FY(u);return He.jsx(zY,{className:Tt(Q.root,o),ownerState:u,ref:n,...i})});jY.NODE_ENV!=="production"&&(GA.propTypes={children:M.node,classes:M.object,className:M.string,row:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});function qY(e){return It("MuiFormHelperText",e)}const ZA=kt("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var $Y={},XA;const UY=e=>{const{classes:t,contained:n,size:l,disabled:o,error:a,filled:i,focused:s,required:c}=e,u={root:["root",o&&"disabled",a&&"error",l&&`size${Ge(l)}`,n&&"contained",s&&"focused",i&&"filled",c&&"required"]};return Ut(u,qY,t)},GY=Ke("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${Ge(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Vt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${ZA.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ZA.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),WA=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFormHelperText"}),{children:o,className:a,component:i="p",disabled:s,error:c,filled:u,focused:Q,margin:f,required:h,variant:p,...g}=l,v=Q5(),b=Xa({props:l,muiFormControl:v,states:["variant","size","disabled","error","filled","focused","required"]}),L={...l,component:i,contained:b.variant==="filled"||b.variant==="outlined",variant:b.variant,size:b.size,disabled:b.disabled,error:b.error,filled:b.filled,focused:b.focused,required:b.required};delete L.ownerState;const S=UY(L);return He.jsx(GY,{as:i,className:Tt(S.root,a),ref:n,...g,ownerState:L,children:o===" "?XA||(XA=He.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):o})});$Y.NODE_ENV!=="production"&&(WA.propTypes={children:M.node,classes:M.object,className:M.string,component:M.elementType,disabled:M.bool,error:M.bool,filled:M.bool,focused:M.bool,margin:M.oneOf(["dense"]),required:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),variant:M.oneOfType([M.oneOf(["filled","outlined","standard"]),M.string])});function ZY(e){return It("MuiFormLabel",e)}const bT=kt("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]);var XY={};const WY=e=>{const{classes:t,color:n,focused:l,disabled:o,error:a,filled:i,required:s}=e,c={root:["root",`color${Ge(n)}`,o&&"disabled",a&&"error",i&&"filled",l&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]};return Ut(c,ZY,t)},YY=Ke("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(Vt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(_2()).map(([t])=>({props:{color:t},style:{[`&.${bT.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${bT.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${bT.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),KY=Ke("span",{name:"MuiFormLabel",slot:"Asterisk"})(Vt(({theme:e})=>({[`&.${bT.error}`]:{color:(e.vars||e).palette.error.main}}))),YA=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiFormLabel"}),{children:o,className:a,color:i,component:s="label",disabled:c,error:u,filled:Q,focused:f,required:h,...p}=l,g=Q5(),v=Xa({props:l,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),b={...l,color:v.color||"primary",component:s,disabled:v.disabled,error:v.error,filled:v.filled,focused:v.focused,required:v.required},L=WY(b);return He.jsxs(YY,{as:s,ownerState:b,className:Tt(L.root,a),ref:n,...p,children:[o,v.required&&He.jsxs(KY,{ownerState:b,"aria-hidden":!0,className:L.asterisk,children:[" ","*"]})]})});XY.NODE_ENV!=="production"&&(YA.propTypes={children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["error","info","primary","secondary","success","warning"]),M.string]),component:M.elementType,disabled:M.bool,error:M.bool,filled:M.bool,focused:M.bool,required:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});var KA={};const bt=xG({createStyledComponent:Ke("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>e1({props:e,name:"MuiGrid"}),useTheme:Ga});if(KA.NODE_ENV!=="production"&&(bt.propTypes={children:M.node,columns:M.oneOfType([M.arrayOf(M.number),M.number,M.object]),columnSpacing:M.oneOfType([M.arrayOf(M.oneOfType([M.number,M.string])),M.number,M.object,M.string]),container:M.bool,direction:M.oneOfType([M.oneOf(["column-reverse","column","row-reverse","row"]),M.arrayOf(M.oneOf(["column-reverse","column","row-reverse","row"])),M.object]),offset:M.oneOfType([M.string,M.number,M.arrayOf(M.oneOfType([M.string,M.number])),M.object]),rowSpacing:M.oneOfType([M.arrayOf(M.oneOfType([M.number,M.string])),M.number,M.object,M.string]),size:M.oneOfType([M.string,M.bool,M.number,M.arrayOf(M.oneOfType([M.string,M.bool,M.number])),M.object]),spacing:M.oneOfType([M.arrayOf(M.oneOfType([M.number,M.string])),M.number,M.object,M.string]),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),unstable_level:M.number,wrap:M.oneOf(["nowrap","wrap-reverse","wrap"])}),KA.NODE_ENV!=="production"){const e=bt,t=fZ("Grid",e);e.propTypes={...e.propTypes,direction:t("container"),spacing:t("container"),wrap:t("container")}}var JY={};function JL(e){return`scale(${e}, ${e**2})`}const eK={entering:{opacity:1,transform:JL(1)},entered:{opacity:1,transform:"none"}},ex=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Gm=oe.forwardRef(function(t,n){const{addEndListener:l,appear:o=!0,children:a,easing:i,in:s,onEnter:c,onEntered:u,onEntering:Q,onExit:f,onExited:h,onExiting:p,style:g,timeout:v="auto",TransitionComponent:b=Nr,...L}=t,S=cA(),_=oe.useRef(),O=Ga(),E=oe.useRef(null),A=v3(E,pT(a),n),V=ee=>W=>{if(ee){const te=E.current;W===void 0?ee(te):ee(te,W)}},k=V(Q),B=V((ee,W)=>{TA(ee);const{duration:te,delay:J,easing:Y}=_m({style:g,timeout:v,easing:i},{mode:"enter"});let I;v==="auto"?(I=O.transitions.getAutoHeightDuration(ee.clientHeight),_.current=I):I=te,ee.style.transition=[O.transitions.create("opacity",{duration:I,delay:J}),O.transitions.create("transform",{duration:ex?I:I*.666,delay:J,easing:Y})].join(","),c&&c(ee,W)}),R=V(u),F=V(p),q=V(ee=>{const{duration:W,delay:te,easing:J}=_m({style:g,timeout:v,easing:i},{mode:"exit"});let Y;v==="auto"?(Y=O.transitions.getAutoHeightDuration(ee.clientHeight),_.current=Y):Y=W,ee.style.transition=[O.transitions.create("opacity",{duration:Y,delay:te}),O.transitions.create("transform",{duration:ex?Y:Y*.666,delay:ex?te:te||Y*.333,easing:J})].join(","),ee.style.opacity=0,ee.style.transform=JL(.75),f&&f(ee)}),$=V(h),Z=ee=>{v==="auto"&&S.start(_.current||0,ee),l&&l(E.current,ee)};return He.jsx(b,{appear:o,in:s,nodeRef:E,onEnter:B,onEntered:R,onEntering:k,onExit:q,onExited:$,onExiting:F,addEndListener:Z,timeout:v==="auto"?null:v,...L,children:(ee,{ownerState:W,...te})=>oe.cloneElement(a,{style:{opacity:0,transform:JL(.75),visibility:ee==="exited"&&!s?"hidden":void 0,...eK[ee],...g,...a.props.style},ref:A,...te})})});JY.NODE_ENV!=="production"&&(Gm.propTypes={addEndListener:M.func,appear:M.bool,children:vT.isRequired,easing:M.oneOfType([M.shape({enter:M.string,exit:M.string}),M.string]),in:M.bool,onEnter:M.func,onEntered:M.func,onEntering:M.func,onExit:M.func,onExited:M.func,onExiting:M.func,style:M.object,timeout:M.oneOfType([M.oneOf(["auto"]),M.number,M.shape({appear:M.number,enter:M.number,exit:M.number})])}),Gm&&(Gm.muiSupportAuto=!0);var tK={};const nK=e=>{const{classes:t,disableUnderline:n}=e,o=Ut({root:["root",!n&&"underline"],input:["input"]},tW,t);return{...t,...o}},rK=Ke(Bm,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...km(e,t),!n.disableUnderline&&t.underline]}})(Vt(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:l})=>l.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:l})=>!l.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${gT.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${gT.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${gT.disabled}, .${gT.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${gT.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(_2()).map(([l])=>({props:{color:l,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[l].main}`}}}))]}})),iK=Ke(Pm,{name:"MuiInput",slot:"Input",overridesResolver:Nm})({}),Zm=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:a={},componentsProps:i,fullWidth:s=!1,inputComponent:c="input",multiline:u=!1,slotProps:Q,slots:f={},type:h="text",...p}=l,g=nK(l),b={root:{ownerState:{disableUnderline:o}}},L=Q??i?G3(Q??i,b):b,S=f.root??a.Root??rK,_=f.input??a.Input??iK;return He.jsx(Im,{slots:{root:S,input:_},slotProps:L,fullWidth:s,inputComponent:c,multiline:u,ref:n,type:h,...p,classes:g})});tK.NODE_ENV!=="production"&&(Zm.propTypes={autoComplete:M.string,autoFocus:M.bool,classes:M.object,color:M.oneOfType([M.oneOf(["primary","secondary"]),M.string]),components:M.shape({Input:M.elementType,Root:M.elementType}),componentsProps:M.shape({input:M.object,root:M.object}),defaultValue:M.any,disabled:M.bool,disableUnderline:M.bool,endAdornment:M.node,error:M.bool,fullWidth:M.bool,id:M.string,inputComponent:M.elementType,inputProps:M.object,inputRef:bn,margin:M.oneOf(["dense","none"]),maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),multiline:M.bool,name:M.string,onChange:M.func,placeholder:M.string,readOnly:M.bool,required:M.bool,rows:M.oneOfType([M.number,M.string]),slotProps:M.shape({input:M.object,root:M.object}),slots:M.shape({input:M.elementType,root:M.elementType}),startAdornment:M.node,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.string,value:M.any}),Zm.muiName="Input";function aK(e){return It("MuiInputAdornment",e)}const JA=kt("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var e_={},t_;const oK=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Ge(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},lK=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:l,position:o,size:a,variant:i}=e,s={root:["root",n&&"disablePointerEvents",o&&`position${Ge(o)}`,i,l&&"hiddenLabel",a&&`size${Ge(a)}`]};return Ut(s,aK,t)},sK=Ke("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:oK})(Vt(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${JA.positionStart}&:not(.${JA.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),n_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiInputAdornment"}),{children:o,className:a,component:i="div",disablePointerEvents:s=!1,disableTypography:c=!1,position:u,variant:Q,...f}=l,h=Q5()||{};let p=Q;Q&&h.variant&&e_.NODE_ENV!=="production"&&Q===h.variant&&console.error("MUI: The `InputAdornment` variant infers the variant prop you do not have to provide one."),h&&!p&&(p=h.variant);const g={...l,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:s,position:u,variant:p},v=lK(g);return He.jsx(mT.Provider,{value:null,children:He.jsx(sK,{as:i,ownerState:g,className:Tt(v.root,a),ref:n,...f,children:typeof o=="string"&&!c?He.jsx(K3,{color:"textSecondary",children:o}):He.jsxs(oe.Fragment,{children:[u==="start"?t_||(t_=He.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,o]})})})});e_.NODE_ENV!=="production"&&(n_.propTypes={children:M.node,classes:M.object,className:M.string,component:M.elementType,disablePointerEvents:M.bool,disableTypography:M.bool,position:M.oneOf(["end","start"]).isRequired,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),variant:M.oneOf(["filled","outlined","standard"])});function uK(e){return It("MuiInputLabel",e)}kt("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);var cK={};const TK=e=>{const{classes:t,formControl:n,size:l,shrink:o,disableAnimation:a,variant:i,required:s}=e,c={root:["root",n&&"formControl",!a&&"animated",o&&"shrink",l&&l!=="medium"&&`size${Ge(l)}`,i],asterisk:[s&&"asterisk"]},u=Ut(c,uK,t);return{...t,...u}},QK=Ke(YA,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${bT.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Vt(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:l})=>t==="filled"&&n.shrink&&l==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),r_=oe.forwardRef(function(t,n){const l=e1({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:a,shrink:i,variant:s,className:c,...u}=l,Q=Q5();let f=i;typeof f>"u"&&Q&&(f=Q.filled||Q.focused||Q.adornedStart);const h=Xa({props:l,muiFormControl:Q,states:["size","variant","required","focused"]}),p={...l,disableAnimation:o,formControl:Q,shrink:f,size:h.size,variant:h.variant,required:h.required,focused:h.focused},g=TK(p);return He.jsx(QK,{"data-shrink":f,ref:n,className:Tt(g.root,c),...u,ownerState:p,classes:g})});cK.NODE_ENV!=="production"&&(r_.propTypes={children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["error","info","primary","secondary","success","warning"]),M.string]),disableAnimation:M.bool,disabled:M.bool,error:M.bool,focused:M.bool,margin:M.oneOf(["dense"]),required:M.bool,shrink:M.bool,size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),variant:M.oneOf(["filled","outlined","standard"])});var fK={};const Xm=oe.createContext({});fK.NODE_ENV!=="production"&&(Xm.displayName="ListContext");function dK(e){return It("MuiList",e)}kt("MuiList",["root","padding","dense","subheader"]);var hK={};const pK=e=>{const{classes:t,disablePadding:n,dense:l,subheader:o}=e;return Ut({root:["root",!n&&"padding",l&&"dense",o&&"subheader"]},dK,t)},mK=Ke("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),i_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiList"}),{children:o,className:a,component:i="ul",dense:s=!1,disablePadding:c=!1,subheader:u,...Q}=l,f=oe.useMemo(()=>({dense:s}),[s]),h={...l,component:i,dense:s,disablePadding:c},p=pK(h);return He.jsx(Xm.Provider,{value:f,children:He.jsxs(mK,{as:i,className:Tt(p.root,a),ref:n,ownerState:h,...Q,children:[u,o]})})});hK.NODE_ENV!=="production"&&(i_.propTypes={children:M.node,classes:M.object,className:M.string,component:M.elementType,dense:M.bool,disablePadding:M.bool,subheader:M.node,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object])});const a_=kt("MuiListItemIcon",["root","alignItemsFlexStart"]),o_=kt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);var l_={};function tx(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function s_(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function u_(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function HT(e,t,n,l,o,a){let i=!1,s=o(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(i)return!1;i=!0}const c=l?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!u_(s,a)||c)s=o(e,s,n);else return s.focus(),!0}return!1}const c_=oe.forwardRef(function(t,n){const{actions:l,autoFocus:o=!1,autoFocusItem:a=!1,children:i,className:s,disabledItemsFocusable:c=!1,disableListWrap:u=!1,onKeyDown:Q,variant:f="selectedMenu",...h}=t,p=oe.useRef(null),g=oe.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ri(()=>{o&&p.current.focus()},[o]),oe.useImperativeHandle(l,()=>({adjustStyleForScrollbar:(_,{direction:O})=>{const E=!p.current.style.width;if(_.clientHeight<p.current.clientHeight&&E){const A=`${jA(Ni(_))}px`;p.current.style[O==="rtl"?"paddingLeft":"paddingRight"]=A,p.current.style.width=`calc(100% + ${A})`}return p.current}}),[]);const v=_=>{const O=p.current,E=_.key;if(_.ctrlKey||_.metaKey||_.altKey){Q&&Q(_);return}const V=M4(O).activeElement;if(E==="ArrowDown")_.preventDefault(),HT(O,V,u,c,tx);else if(E==="ArrowUp")_.preventDefault(),HT(O,V,u,c,s_);else if(E==="Home")_.preventDefault(),HT(O,null,u,c,tx);else if(E==="End")_.preventDefault(),HT(O,null,u,c,s_);else if(E.length===1){const k=g.current,B=E.toLowerCase(),R=performance.now();k.keys.length>0&&(R-k.lastTime>500?(k.keys=[],k.repeating=!0,k.previousKeyMatched=!0):k.repeating&&B!==k.keys[0]&&(k.repeating=!1)),k.lastTime=R,k.keys.push(B);const F=V&&!k.repeating&&u_(V,k);k.previousKeyMatched&&(F||HT(O,V,!1,c,tx,k))?_.preventDefault():k.previousKeyMatched=!1}Q&&Q(_)},b=v3(p,n);let L=-1;oe.Children.forEach(i,(_,O)=>{if(!oe.isValidElement(_)){L===O&&(L+=1,L>=i.length&&(L=-1));return}l_.NODE_ENV!=="production"&&R7.isFragment(_)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join(`
327
327
  `)),_.props.disabled||(f==="selectedMenu"&&_.props.selected||L===-1)&&(L=O),L===O&&(_.props.disabled||_.props.muiSkipListHighlight||_.type.muiSkipListHighlight)&&(L+=1,L>=i.length&&(L=-1))});const S=oe.Children.map(i,(_,O)=>{if(O===L){const E={};return a&&(E.autoFocus=!0),_.props.tabIndex===void 0&&f==="selectedMenu"&&(E.tabIndex=0),oe.cloneElement(_,E)}return _});return He.jsx(i_,{role:"menu",ref:b,className:s,onKeyDown:v,tabIndex:o?0:-1,...h,children:S})});l_.NODE_ENV!=="production"&&(c_.propTypes={autoFocus:M.bool,autoFocusItem:M.bool,children:M.node,className:M.string,disabledItemsFocusable:M.bool,disableListWrap:M.bool,onKeyDown:M.func,variant:M.oneOf(["menu","selectedMenu"])});function yK(e){return It("MuiPopover",e)}kt("MuiPopover",["root","paper"]);var Xs={};function T_(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function Q_(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function f_(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function ST(e){return typeof e=="function"?e():e}const gK=e=>{const{classes:t}=e;return Ut({root:["root"],paper:["paper"]},yK,t)},vK=Ke(GL,{name:"MuiPopover",slot:"Root"})({}),d_=Ke(QT,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),h_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiPopover"}),{action:o,anchorEl:a,anchorOrigin:i={vertical:"top",horizontal:"left"},anchorPosition:s,anchorReference:c="anchorEl",children:u,className:Q,container:f,elevation:h=8,marginThreshold:p=16,open:g,PaperProps:v={},slots:b={},slotProps:L={},transformOrigin:S={vertical:"top",horizontal:"left"},TransitionComponent:_,transitionDuration:O="auto",TransitionProps:E={},disableScrollLock:A=!1,...V}=l,k=oe.useRef(),B={...l,anchorOrigin:i,anchorReference:c,elevation:h,marginThreshold:p,transformOrigin:S,TransitionComponent:_,transitionDuration:O,TransitionProps:E},R=gK(B),F=oe.useCallback(()=>{if(c==="anchorPosition")return Xs.NODE_ENV!=="production"&&(s||console.error('MUI: You need to provide a `anchorPosition` prop when using <Popover anchorReference="anchorPosition" />.')),s;const Se=ST(a),_e=Se&&Se.nodeType===1?Se:M4(k.current).body,ze=_e.getBoundingClientRect();if(Xs.NODE_ENV!=="production"){const ue=_e.getBoundingClientRect();Xs.NODE_ENV!=="test"&&ue.top===0&&ue.left===0&&ue.right===0&&ue.bottom===0&&console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
328
328
  `))}return{top:ze.top+T_(ze,i.vertical),left:ze.left+Q_(ze,i.horizontal)}},[a,i.horizontal,i.vertical,s,c]),q=oe.useCallback(Se=>({vertical:T_(Se,S.vertical),horizontal:Q_(Se,S.horizontal)}),[S.horizontal,S.vertical]),$=oe.useCallback(Se=>{const _e={width:Se.offsetWidth,height:Se.offsetHeight},ze=q(_e);if(c==="none")return{top:null,left:null,transformOrigin:f_(ze)};const ue=F();let Pe=ue.top-ze.vertical,We=ue.left-ze.horizontal;const dt=Pe+_e.height,at=We+_e.width,pt=Ni(ST(a)),jt=pt.innerHeight-p,d1=pt.innerWidth-p;if(p!==null&&Pe<p){const lt=Pe-p;Pe-=lt,ze.vertical+=lt}else if(p!==null&&dt>jt){const lt=dt-jt;Pe-=lt,ze.vertical+=lt}if(Xs.NODE_ENV!=="production"&&_e.height>jt&&_e.height&&jt&&console.error(["MUI: The popover component is too tall.",`Some part of it can not be seen on the screen (${_e.height-jt}px).`,"Please consider adding a `max-height` to improve the user-experience."].join(`
@@ -331,7 +331,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
331
331
  `))}return null}),anchorOrigin:M.shape({horizontal:M.oneOfType([M.oneOf(["center","left","right"]),M.number]).isRequired,vertical:M.oneOfType([M.oneOf(["bottom","center","top"]),M.number]).isRequired}),anchorPosition:M.shape({left:M.number.isRequired,top:M.number.isRequired}),anchorReference:M.oneOf(["anchorEl","anchorPosition","none"]),BackdropComponent:M.elementType,BackdropProps:M.object,children:M.node,classes:M.object,className:M.string,container:M.oneOfType([hT,M.func]),disableScrollLock:M.bool,elevation:dA,marginThreshold:M.number,onClose:M.func,open:M.bool.isRequired,PaperProps:M.shape({component:NL}),slotProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),paper:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),transition:M.oneOfType([M.func,M.object])}),slots:M.shape({backdrop:M.elementType,paper:M.elementType,root:M.elementType,transition:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),transformOrigin:M.shape({horizontal:M.oneOfType([M.oneOf(["center","left","right"]),M.number]).isRequired,vertical:M.oneOfType([M.oneOf(["bottom","center","top"]),M.number]).isRequired}),TransitionComponent:M.elementType,transitionDuration:M.oneOfType([M.oneOf(["auto"]),M.number,M.shape({appear:M.number,enter:M.number,exit:M.number})]),TransitionProps:M.object});function LK(e){return It("MuiMenu",e)}kt("MuiMenu",["root","paper","list"]);var p_={};const xK={vertical:"top",horizontal:"right"},bK={vertical:"top",horizontal:"left"},HK=e=>{const{classes:t}=e;return Ut({root:["root"],paper:["paper"],list:["list"]},LK,t)},SK=Ke(h_,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),EK=Ke(d_,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MK=Ke(c_,{name:"MuiMenu",slot:"List"})({outline:0}),m_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:a,className:i,disableAutoFocusItem:s=!1,MenuListProps:c={},onClose:u,open:Q,PaperProps:f={},PopoverClasses:h,transitionDuration:p="auto",TransitionProps:{onEntering:g,...v}={},variant:b="selectedMenu",slots:L={},slotProps:S={},..._}=l,O=_M(),E={...l,autoFocus:o,disableAutoFocusItem:s,MenuListProps:c,onEntering:g,PaperProps:f,transitionDuration:p,TransitionProps:v,variant:b},A=HK(E),V=o&&!s&&Q,k=oe.useRef(null),B=(Y,I)=>{k.current&&k.current.adjustStyleForScrollbar(Y,{direction:O?"rtl":"ltr"}),g&&g(Y,I)},R=Y=>{Y.key==="Tab"&&(Y.preventDefault(),u&&u(Y,"tabKeyDown"))};let F=-1;oe.Children.map(a,(Y,I)=>{oe.isValidElement(Y)&&(p_.NODE_ENV!=="production"&&R7.isFragment(Y)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join(`
332
332
  `)),Y.props.disabled||(b==="selectedMenu"&&Y.props.selected||F===-1)&&(F=I))});const q={slots:L,slotProps:{list:c,transition:v,paper:f,...S}},$=Ii({elementType:L.root,externalSlotProps:S.root,ownerState:E,className:[A.root,i]}),[Z,ee]=t1("paper",{className:A.paper,elementType:EK,externalForwardedProps:q,shouldForwardComponentProp:!0,ownerState:E}),[W,te]=t1("list",{className:Tt(A.list,c.className),elementType:MK,shouldForwardComponentProp:!0,externalForwardedProps:q,getSlotProps:Y=>({...Y,onKeyDown:I=>{var z;R(I),(z=Y.onKeyDown)==null||z.call(Y,I)}}),ownerState:E}),J=typeof q.slotProps.transition=="function"?q.slotProps.transition(E):q.slotProps.transition;return He.jsx(SK,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:O?"right":"left"},transformOrigin:O?xK:bK,slots:{root:L.root,paper:Z,backdrop:L.backdrop,...L.transition&&{transition:L.transition}},slotProps:{root:$,paper:ee,backdrop:typeof S.backdrop=="function"?S.backdrop(E):S.backdrop,transition:{...J,onEntering:(...Y)=>{var I;B(...Y),(I=J==null?void 0:J.onEntering)==null||I.call(J,...Y)}}},open:Q,ref:n,transitionDuration:p,ownerState:E,..._,classes:h,children:He.jsx(W,{actions:k,autoFocus:o&&(F===-1||s),autoFocusItem:V,variant:b,...te,children:a})})});p_.NODE_ENV!=="production"&&(m_.propTypes={anchorEl:M.oneOfType([hT,M.func]),autoFocus:M.bool,children:M.node,classes:M.object,className:M.string,disableAutoFocusItem:M.bool,MenuListProps:M.object,onClose:M.func,open:M.bool.isRequired,PaperProps:M.object,PopoverClasses:M.object,slotProps:M.shape({backdrop:M.oneOfType([M.func,M.object]),list:M.oneOfType([M.func,M.object]),paper:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),transition:M.oneOfType([M.func,M.object])}),slots:M.shape({backdrop:M.elementType,list:M.elementType,paper:M.elementType,root:M.elementType,transition:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),transitionDuration:M.oneOfType([M.oneOf(["auto"]),M.number,M.shape({appear:M.number,enter:M.number,exit:M.number})]),TransitionProps:M.object,variant:M.oneOf(["menu","selectedMenu"])});function AK(e){return It("MuiMenuItem",e)}const ET=kt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);var y_={};const _K=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},OK=e=>{const{disabled:t,dense:n,divider:l,disableGutters:o,selected:a,classes:i}=e,c=Ut({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",l&&"divider",a&&"selected"]},AK,i);return{...i,...c}},CK=Ke(F7,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:_K})(Vt(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ET.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:_1(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${ET.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:_1(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${ET.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:_1(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:_1(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${ET.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${ET.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${$A.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${$A.inset}`]:{marginLeft:52},[`& .${o_.root}`]:{marginTop:0,marginBottom:0},[`& .${o_.inset}`]:{paddingLeft:36},[`& .${a_.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${a_.root} svg`]:{fontSize:"1.25rem"}}}]}))),U7=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:a="li",dense:i=!1,divider:s=!1,disableGutters:c=!1,focusVisibleClassName:u,role:Q="menuitem",tabIndex:f,className:h,...p}=l,g=oe.useContext(Xm),v=oe.useMemo(()=>({dense:i||g.dense||!1,disableGutters:c}),[g.dense,i,c]),b=oe.useRef(null);Ri(()=>{o&&(b.current?b.current.focus():y_.NODE_ENV!=="production"&&console.error("MUI: Unable to set focus to a MenuItem whose component has not been rendered."))},[o]);const L={...l,dense:v.dense,divider:s,disableGutters:c},S=OK(l),_=v3(b,n);let O;return l.disabled||(O=f!==void 0?f:-1),He.jsx(Xm.Provider,{value:v,children:He.jsx(CK,{ref:_,role:Q,tabIndex:O,component:a,focusVisibleClassName:Tt(S.focusVisible,u),className:Tt(S.root,h),...p,ownerState:L,classes:S})})});y_.NODE_ENV!=="production"&&(U7.propTypes={autoFocus:M.bool,children:M.node,classes:M.object,className:M.string,component:M.elementType,dense:M.bool,disabled:M.bool,disableGutters:M.bool,divider:M.bool,focusVisibleClassName:M.string,role:M.string,selected:M.bool,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),tabIndex:M.number});function wK(e){return It("MuiNativeSelect",e)}const nx=kt("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var VK={};const DK=e=>{const{classes:t,variant:n,disabled:l,multiple:o,open:a,error:i}=e,s={select:["select",n,l&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${Ge(n)}`,a&&"iconOpen",l&&"disabled"]};return Ut(s,wK,t)},g_=Ke("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${nx.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),RK=Ke(g_,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:E4,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${nx.multiple}`]:t.multiple}]}})({}),v_=Ke("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${nx.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),kK=Ke(v_,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ge(n.variant)}`],n.open&&t.iconOpen]}})({}),L_=oe.forwardRef(function(t,n){const{className:l,disabled:o,error:a,IconComponent:i,inputRef:s,variant:c="standard",...u}=t,Q={...t,disabled:o,variant:c,error:a},f=DK(Q);return He.jsxs(oe.Fragment,{children:[He.jsx(RK,{ownerState:Q,className:Tt(f.select,l),disabled:o,ref:s||n,...u}),t.multiple?null:He.jsx(kK,{as:i,ownerState:Q,className:f.icon})]})});VK.NODE_ENV!=="production"&&(L_.propTypes={children:M.node,classes:M.object,className:M.string,disabled:M.bool,error:M.bool,IconComponent:M.elementType.isRequired,inputRef:bn,multiple:M.bool,name:M.string,onChange:M.func,value:M.any,variant:M.oneOf(["standard","outlined","filled"])});var NK={},x_;const BK=Ke("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:E4})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),PK=Ke("legend",{name:"MuiNotchedOutlined",shouldForwardProp:E4})(Vt(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function b_(e){const{children:t,classes:n,className:l,label:o,notched:a,...i}=e,s=o!=null&&o!=="",c={...e,notched:a,withLabel:s};return He.jsx(BK,{"aria-hidden":!0,className:l,ownerState:c,...i,children:He.jsx(PK,{ownerState:c,children:s?He.jsx("span",{children:o}):x_||(x_=He.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}NK.NODE_ENV!=="production"&&(b_.propTypes={children:M.node,classes:M.object,className:M.string,label:M.node,notched:M.bool.isRequired,style:M.object});var IK={};const jK=e=>{const{classes:t}=e,l=Ut({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},nW,t);return{...t,...l}},FK=Ke(Bm,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:km})(Vt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Br.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Br.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Br.focused} .${Br.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(_2()).map(([n])=>({props:{color:n},style:{[`&.${Br.focused} .${Br.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${Br.error} .${Br.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Br.disabled} .${Br.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:l})=>n.multiline&&l==="small",style:{padding:"8.5px 14px"}}]}})),zK=Ke(b_,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(Vt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}})),qK=Ke(Pm,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Nm})(Vt(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),Wm=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:a=!1,inputComponent:i="input",label:s,multiline:c=!1,notched:u,slots:Q={},slotProps:f={},type:h="text",...p}=l,g=jK(l),v=Q5(),b=Xa({props:l,muiFormControl:v,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),L={...l,color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:v,fullWidth:a,hiddenLabel:b.hiddenLabel,multiline:c,size:b.size,type:h},S=Q.root??o.Root??FK,_=Q.input??o.Input??qK,[O,E]=t1("notchedOutline",{elementType:zK,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:L,externalForwardedProps:{slots:Q,slotProps:f},additionalProps:{label:s!=null&&s!==""&&b.required?He.jsxs(oe.Fragment,{children:[s," ","*"]}):s}});return He.jsx(Im,{slots:{root:S,input:_},slotProps:f,renderSuffix:A=>He.jsx(O,{...E,notched:typeof u<"u"?u:!!(A.startAdornment||A.filled||A.focused)}),fullWidth:a,inputComponent:i,multiline:c,ref:n,type:h,...p,classes:{...g,notchedOutline:null}})});IK.NODE_ENV!=="production"&&(Wm.propTypes={autoComplete:M.string,autoFocus:M.bool,classes:M.object,color:M.oneOfType([M.oneOf(["primary","secondary"]),M.string]),components:M.shape({Input:M.elementType,Root:M.elementType}),defaultValue:M.any,disabled:M.bool,endAdornment:M.node,error:M.bool,fullWidth:M.bool,id:M.string,inputComponent:M.elementType,inputProps:M.object,inputRef:bn,label:M.node,margin:M.oneOf(["dense","none"]),maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),multiline:M.bool,name:M.string,notched:M.bool,onChange:M.func,placeholder:M.string,readOnly:M.bool,required:M.bool,rows:M.oneOfType([M.number,M.string]),slotProps:M.shape({input:M.object,notchedOutline:M.oneOfType([M.func,M.object]),root:M.object}),slots:M.shape({input:M.elementType,notchedOutline:M.elementType,root:M.elementType}),startAdornment:M.node,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.string,value:M.any}),Wm.muiName="Input";const $K=X3(He.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),UK=X3(He.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked");var GK={};const ZK=Ke("span",{name:"MuiRadioButtonIcon",shouldForwardProp:E4})({position:"relative",display:"flex"}),XK=Ke($K,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),WK=Ke(UK,{name:"MuiRadioButtonIcon"})(Vt(({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 rx(e){const{checked:t=!1,classes:n={},fontSize:l}=e,o={...e,checked:t};return He.jsxs(ZK,{className:n.root,ownerState:o,children:[He.jsx(XK,{fontSize:l,className:n.background,ownerState:o}),He.jsx(WK,{fontSize:l,className:n.dot,ownerState:o})]})}GK.NODE_ENV!=="production"&&(rx.propTypes={checked:M.bool,classes:M.object,fontSize:M.oneOf(["small","medium"])});var YK={};const ix=oe.createContext(void 0);YK.NODE_ENV!=="production"&&(ix.displayName="RadioGroupContext");function KK(){return oe.useContext(ix)}function JK(e){return It("MuiRadio",e)}const H_=kt("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]);var eJ={};const tJ=e=>{const{classes:t,color:n,size:l}=e,o={root:["root",`color${Ge(n)}`,l!=="medium"&&`size${Ge(l)}`]};return{...t,...Ut(o,JK,t)}},nJ=Ke(qL,{shouldForwardProp:e=>E4(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size!=="medium"&&t[`size${Ge(n.size)}`],t[`color${Ge(n.color)}`]]}})(Vt(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${H_.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(_2()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(_2()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${H_.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function rJ(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const iJ=He.jsx(rx,{checked:!0}),aJ=He.jsx(rx,{}),ax=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiRadio"}),{checked:o,checkedIcon:a=iJ,color:i="primary",icon:s=aJ,name:c,onChange:u,size:Q="medium",className:f,disabled:h,disableRipple:p=!1,slots:g={},slotProps:v={},inputProps:b,...L}=l,S=Q5();let _=h;S&&typeof _>"u"&&(_=S.disabled),_??(_=!1);const O={...l,disabled:_,disableRipple:p,color:i,size:Q},E=tJ(O),A=KK();let V=o;const k=Zv(u,A&&A.onChange);let B=c;A&&(typeof V>"u"&&(V=rJ(A.value,l.value)),typeof B>"u"&&(B=A.name));const R=v.input??b,[F,q]=t1("root",{ref:n,elementType:nJ,className:Tt(E.root,f),shouldForwardComponentProp:!0,externalForwardedProps:{slots:g,slotProps:v,...L},getSlotProps:$=>({...$,onChange:(Z,...ee)=>{var W;(W=$.onChange)==null||W.call($,Z,...ee),k(Z,...ee)}}),ownerState:O,additionalProps:{type:"radio",icon:oe.cloneElement(s,{fontSize:s.props.fontSize??Q}),checkedIcon:oe.cloneElement(a,{fontSize:a.props.fontSize??Q}),disabled:_,name:B,checked:V,slots:g,slotProps:{input:typeof R=="function"?R(O):R}}});return He.jsx(F,{...q,classes:E})});eJ.NODE_ENV!=="production"&&(ax.propTypes={checked:M.bool,checkedIcon:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["default","primary","secondary","error","info","success","warning"]),M.string]),disabled:M.bool,disableRipple:M.bool,icon:M.node,id:M.string,inputProps:M.object,inputRef:bn,name:M.string,onChange:M.func,required:M.bool,size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),slotProps:M.shape({input:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object])}),slots:M.shape({input:M.elementType,root:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),value:M.any});function oJ(e){return It("MuiRadioGroup",e)}kt("MuiRadioGroup",["root","row","error"]);var lJ={};const sJ=e=>{const{classes:t,row:n,error:l}=e;return Ut({root:["root",n&&"row",l&&"error"]},oJ,t)},S_=oe.forwardRef(function(t,n){const{actions:l,children:o,className:a,defaultValue:i,name:s,onChange:c,value:u,...Q}=t,f=oe.useRef(null),h=sJ(t),[p,g]=cT({controlled:u,default:i,name:"RadioGroup"});oe.useImperativeHandle(l,()=>({focus:()=>{let S=f.current.querySelector("input:not(:disabled):checked");S||(S=f.current.querySelector("input:not(:disabled)")),S&&S.focus()}}),[]);const v=v3(n,f),b=ks(s),L=oe.useMemo(()=>({name:b,onChange(S){g(S.target.value),c&&c(S,S.target.value)},value:p}),[b,c,g,p]);return He.jsx(ix.Provider,{value:L,children:He.jsx(GA,{role:"radiogroup",ref:v,className:Tt(h.root,a),...Q,children:o})})});lJ.NODE_ENV!=="production"&&(S_.propTypes={children:M.node,className:M.string,defaultValue:M.any,name:M.string,onChange:M.func,value:M.any});const uJ={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function E_(e){return It("MuiSelect",e)}const MT=kt("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Ym={},M_;const cJ=Ke(g_,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${MT.select}`]:t.select},{[`&.${MT.select}`]:t[n.variant]},{[`&.${MT.error}`]:t.error},{[`&.${MT.multiple}`]:t.multiple}]}})({[`&.${MT.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),TJ=Ke(v_,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${Ge(n.variant)}`],n.open&&t.iconOpen]}})({}),QJ=Ke("input",{shouldForwardProp:e=>Sm(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function A_(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function fJ(e){return e==null||typeof e=="string"&&!e.trim()}const dJ=e=>{const{classes:t,variant:n,disabled:l,multiple:o,open:a,error:i}=e,s={select:["select",n,l&&"disabled",o&&"multiple",i&&"error"],icon:["icon",`icon${Ge(n)}`,a&&"iconOpen",l&&"disabled"],nativeInput:["nativeInput"]};return Ut(s,E_,t)},__=oe.forwardRef(function(t,n){var Q1,G1;const{"aria-describedby":l,"aria-label":o,autoFocus:a,autoWidth:i,children:s,className:c,defaultOpen:u,defaultValue:Q,disabled:f,displayEmpty:h,error:p=!1,IconComponent:g,inputRef:v,labelId:b,MenuProps:L={},multiple:S,name:_,onBlur:O,onChange:E,onClose:A,onFocus:V,onOpen:k,open:B,readOnly:R,renderValue:F,required:q,SelectDisplayProps:$={},tabIndex:Z,type:ee,value:W,variant:te="standard",...J}=t,[Y,I]=cT({controlled:W,default:Q,name:"Select"}),[z,ne]=cT({controlled:B,default:u,name:"Select"}),U=oe.useRef(null),de=oe.useRef(null),[me,he]=oe.useState(null),{current:se}=oe.useRef(B!=null),[fe,Ee]=oe.useState(),Se=v3(n,v),_e=oe.useCallback(K=>{de.current=K,K&&he(K)},[]),ze=me==null?void 0:me.parentNode;oe.useImperativeHandle(Se,()=>({focus:()=>{de.current.focus()},node:U.current,value:Y}),[Y]),oe.useEffect(()=>{u&&z&&me&&!se&&(Ee(i?null:ze.clientWidth),de.current.focus())},[me,i]),oe.useEffect(()=>{a&&de.current.focus()},[a]),oe.useEffect(()=>{if(!b)return;const K=M4(de.current).getElementById(b);if(K){const pe=()=>{getSelection().isCollapsed&&de.current.focus()};return K.addEventListener("click",pe),()=>{K.removeEventListener("click",pe)}}},[b]);const ue=(K,pe)=>{K?k&&k(pe):A&&A(pe),se||(Ee(i?null:ze.clientWidth),ne(K))},Pe=K=>{K.button===0&&(K.preventDefault(),de.current.focus(),ue(!0,K))},We=K=>{ue(!1,K)},dt=oe.Children.toArray(s),at=K=>{const pe=dt.find(Ue=>Ue.props.value===K.target.value);pe!==void 0&&(I(pe.props.value),E&&E(K,pe))},pt=K=>pe=>{let Ue;if(pe.currentTarget.hasAttribute("tabindex")){if(S){Ue=Array.isArray(Y)?Y.slice():[];const Je=Y.indexOf(K.props.value);Je===-1?Ue.push(K.props.value):Ue.splice(Je,1)}else Ue=K.props.value;if(K.props.onClick&&K.props.onClick(pe),Y!==Ue&&(I(Ue),E)){const Je=pe.nativeEvent||pe,nt=new Je.constructor(Je.type,Je);Object.defineProperty(nt,"target",{writable:!0,value:{value:Ue,name:_}}),E(nt,K)}S||ue(!1,pe)}},jt=K=>{R||[" ","ArrowUp","ArrowDown","Enter"].includes(K.key)&&(K.preventDefault(),ue(!0,K))},d1=me!==null&&z,lt=K=>{!d1&&O&&(Object.defineProperty(K,"target",{writable:!0,value:{value:Y,name:_}}),O(K))};delete J["aria-invalid"];let ut,e2;const T1=[];let Ze=!1,ye=!1;(Rm({value:Y})||h)&&(F?ut=F(Y):Ze=!0);const De=dt.map(K=>{if(!oe.isValidElement(K))return null;Ym.NODE_ENV!=="production"&&R7.isFragment(K)&&console.error(["MUI: The Select component doesn't accept a Fragment as a child.","Consider providing an array instead."].join(`
333
333
  `));let pe;if(S){if(!Array.isArray(Y))throw new Error(Ym.NODE_ENV!=="production"?"MUI: The `value` prop must be an array when using the `Select` component with `multiple`.":Or(2));pe=Y.some(Ue=>A_(Ue,K.props.value)),pe&&Ze&&T1.push(K.props.children)}else pe=A_(Y,K.props.value),pe&&Ze&&(e2=K.props.children);return pe&&(ye=!0),oe.cloneElement(K,{"aria-selected":pe?"true":"false",onClick:pt(K),onKeyUp:Ue=>{Ue.key===" "&&Ue.preventDefault(),K.props.onKeyUp&&K.props.onKeyUp(Ue)},role:"option",selected:pe,value:void 0,"data-value":K.props.value})});Ym.NODE_ENV!=="production"&&oe.useEffect(()=>{if(!ye&&!S&&Y!==""){const K=dt.map(pe=>pe.props.value);console.warn([`MUI: You have provided an out-of-range value \`${Y}\` for the select ${_?`(name="${_}") `:""}component.`,"Consider providing a value that matches one of the available options or ''.",`The available values are ${K.filter(pe=>pe!=null).map(pe=>`\`${pe}\``).join(", ")||'""'}.`].join(`
334
- `))}},[ye,dt,S,_,Y]),Ze&&(S?T1.length===0?ut=null:ut=T1.reduce((K,pe,Ue)=>(K.push(pe),Ue<T1.length-1&&K.push(", "),K),[]):ut=e2);let Ye=fe;!i&&se&&me&&(Ye=ze.clientWidth);let tt;typeof Z<"u"?tt=Z:tt=f?null:0;const rt=$.id||(_?`mui-component-select-${_}`:void 0),ct={...t,variant:te,value:Y,open:d1,error:p},i1=dJ(ct),_t={...L.PaperProps,...(Q1=L.slotProps)==null?void 0:Q1.paper},h1={...L.MenuListProps,...(G1=L.slotProps)==null?void 0:G1.list},p1=ks();return He.jsxs(oe.Fragment,{children:[He.jsx(cJ,{as:"div",ref:_e,tabIndex:tt,role:"combobox","aria-controls":d1?p1:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":d1?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[b,rt].filter(Boolean).join(" ")||void 0,"aria-describedby":l,"aria-required":q?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:jt,onMouseDown:f||R?null:Pe,onBlur:lt,onFocus:V,...$,ownerState:ct,className:Tt($.className,i1.select,c),id:rt,children:fJ(ut)?M_||(M_=He.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):ut}),He.jsx(QJ,{"aria-invalid":p,value:Array.isArray(Y)?Y.join(","):Y,name:_,ref:U,"aria-hidden":!0,onChange:at,tabIndex:-1,disabled:f,className:i1.nativeInput,autoFocus:a,required:q,...J,ownerState:ct}),He.jsx(TJ,{as:g,className:i1.icon,ownerState:ct}),He.jsx(m_,{id:`menu-${_||""}`,anchorEl:ze,open:d1,onClose:We,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...L,slotProps:{...L.slotProps,list:{"aria-labelledby":b,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:p1,...h1},paper:{..._t,style:{minWidth:Ye,..._t!=null?_t.style:null}}},children:De})]})});Ym.NODE_ENV!=="production"&&(__.propTypes={"aria-describedby":M.string,"aria-label":M.string,autoFocus:M.bool,autoWidth:M.bool,children:M.node,classes:M.object,className:M.string,defaultOpen:M.bool,defaultValue:M.any,disabled:M.bool,displayEmpty:M.bool,error:M.bool,IconComponent:M.elementType.isRequired,inputRef:bn,labelId:M.string,MenuProps:M.object,multiple:M.bool,name:M.string,onBlur:M.func,onChange:M.func,onClose:M.func,onFocus:M.func,onOpen:M.func,open:M.bool,readOnly:M.bool,renderValue:M.func,required:M.bool,SelectDisplayProps:M.object,tabIndex:M.oneOfType([M.number,M.string]),type:M.any,value:M.any,variant:M.oneOf(["standard","outlined","filled"])});var hJ={};const pJ=e=>{const{classes:t}=e,l=Ut({root:["root"]},E_,t);return{...t,...l}},ox={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>E4(e)&&e!=="variant"},mJ=Ke(Zm,ox)(""),yJ=Ke(Wm,ox)(""),gJ=Ke(Um,ox)(""),Ws=oe.forwardRef(function(t,n){const l=e1({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:a,classes:i={},className:s,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:Q=iW,id:f,input:h,inputProps:p,label:g,labelId:v,MenuProps:b,multiple:L=!1,native:S=!1,onClose:_,onOpen:O,open:E,renderValue:A,SelectDisplayProps:V,variant:k="outlined",...B}=l,R=S?L_:__,F=Q5(),q=Xa({props:l,muiFormControl:F,states:["variant","error"]}),$=q.variant||k,Z={...l,variant:$,classes:i},ee=pJ(Z),{root:W,...te}=ee,J=h||{standard:He.jsx(mJ,{ownerState:Z}),outlined:He.jsx(yJ,{label:g,ownerState:Z}),filled:He.jsx(gJ,{ownerState:Z})}[$],Y=v3(n,pT(J));return He.jsx(oe.Fragment,{children:oe.cloneElement(J,{inputComponent:R,inputProps:{children:a,error:q.error,IconComponent:Q,variant:$,type:void 0,multiple:L,...S?{id:f}:{autoWidth:o,defaultOpen:c,displayEmpty:u,labelId:v,MenuProps:b,onClose:_,onOpen:O,open:E,renderValue:A,SelectDisplayProps:{id:f,...V}},...p,classes:p?G3(te,p.classes):te,...h?h.props.inputProps:{}},...(L&&S||u)&&$==="outlined"?{notched:!0}:{},ref:Y,className:Tt(J.props.className,s,ee.root),...!h&&{variant:$},...B})})});hJ.NODE_ENV!=="production"&&(Ws.propTypes={autoWidth:M.bool,children:M.node,classes:M.object,className:M.string,defaultOpen:M.bool,defaultValue:M.any,displayEmpty:M.bool,IconComponent:M.elementType,id:M.string,input:M.element,inputProps:M.object,label:M.node,labelId:M.string,MenuProps:M.object,multiple:M.bool,native:M.bool,onChange:M.func,onClose:M.func,onOpen:M.func,open:M.bool,renderValue:M.func,SelectDisplayProps:M.object,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),value:M.oneOfType([M.oneOf([""]),M.any]),variant:M.oneOf(["filled","outlined","standard"])}),Ws.muiName="Select";function vJ(e,t,n=(l,o)=>l===o){return e.length===t.length&&e.every((l,o)=>n(l,t[o]))}const LJ=2;function Ys(e,t,n,l,o){return n===1?Math.min(e+t,o):Math.max(e-t,l)}function O_(e,t){return e-t}function C_(e,t){const{index:n}=e.reduce((l,o,a)=>{const i=Math.abs(t-o);return l===null||i<l.distance||i===l.distance?{distance:i,index:a}:l},null)??{};return n}function Km(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let l=0;l<n.changedTouches.length;l+=1){const o=n.changedTouches[l];if(o.identifier===t.current)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Jm(e,t,n){return(e-t)*100/(n-t)}function xJ(e,t,n){return(n-t)*e+t}function bJ(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),l=n[0].split(".")[1];return(l?l.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function HJ(e,t,n){const l=Math.round((e-n)/t)*t+n;return Number(l.toFixed(bJ(t)))}function w_({values:e,newValue:t,index:n}){const l=e.slice();return l[n]=t,l.sort(O_)}function ey({sliderRef:e,activeIndex:t,setActive:n}){var o,a,i;const l=M4(e.current);(!((o=e.current)!=null&&o.contains(l.activeElement))||Number((a=l==null?void 0:l.activeElement)==null?void 0:a.getAttribute("data-index"))!==t)&&((i=e.current)==null||i.querySelector(`[type="range"][data-index="${t}"]`).focus()),n&&n(t)}function ty(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?vJ(e,t):!1}const SJ={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}%`})}},EJ=e=>e;let ny;function V_(){return ny===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ny=CSS.supports("touch-action","none"):ny=!0),ny}function MJ(e){const{"aria-labelledby":t,defaultValue:n,disabled:l=!1,disableSwap:o=!1,isRtl:a=!1,marks:i=!1,max:s=100,min:c=0,name:u,onChange:Q,onChangeCommitted:f,orientation:h="horizontal",rootRef:p,scale:g=EJ,step:v=1,shiftStep:b=10,tabIndex:L,value:S}=e,_=oe.useRef(void 0),[O,E]=oe.useState(-1),[A,V]=oe.useState(-1),[k,B]=oe.useState(!1),R=oe.useRef(0),F=oe.useRef(null),[q,$]=cT({controlled:S,default:n??c,name:"Slider"}),Z=Q&&((Ze,ye,De)=>{const Ye=Ze.nativeEvent||Ze,tt=new Ye.constructor(Ye.type,Ye);Object.defineProperty(tt,"target",{writable:!0,value:{value:ye,name:u}}),F.current=ye,Q(tt,ye,De)}),ee=Array.isArray(q);let W=ee?q.slice().sort(O_):[q];W=W.map(Ze=>Ze==null?c:Rs(Ze,c,s));const te=i===!0&&v!==null?[...Array(Math.floor((s-c)/v)+1)].map((Ze,ye)=>({value:c+v*ye})):i||[],J=te.map(Ze=>Ze.value),[Y,I]=oe.useState(-1),z=oe.useRef(null),ne=v3(p,z),U=Ze=>ye=>{var Ye;const De=Number(ye.currentTarget.getAttribute("data-index"));Om(ye.target)&&I(De),V(De),(Ye=Ze==null?void 0:Ze.onFocus)==null||Ye.call(Ze,ye)},de=Ze=>ye=>{var De;Om(ye.target)||I(-1),V(-1),(De=Ze==null?void 0:Ze.onBlur)==null||De.call(Ze,ye)},me=(Ze,ye)=>{const De=Number(Ze.currentTarget.getAttribute("data-index")),Ye=W[De],tt=J.indexOf(Ye);let rt=ye;if(te&&v==null){const ct=J[J.length-1];rt>=ct?rt=ct:rt<=J[0]?rt=J[0]:rt=rt<Ye?J[tt-1]:J[tt+1]}if(rt=Rs(rt,c,s),ee){o&&(rt=Rs(rt,W[De-1]||-1/0,W[De+1]||1/0));const ct=rt;rt=w_({values:W,newValue:rt,index:De});let i1=De;o||(i1=rt.indexOf(ct)),ey({sliderRef:z,activeIndex:i1})}$(rt),I(De),Z&&!ty(rt,q)&&Z(Ze,rt,De),f&&f(Ze,F.current??rt)},he=Ze=>ye=>{var De;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(ye.key)){ye.preventDefault();const Ye=Number(ye.currentTarget.getAttribute("data-index")),tt=W[Ye];let rt=null;if(v!=null){const ct=ye.shiftKey?b:v;switch(ye.key){case"ArrowUp":rt=Ys(tt,ct,1,c,s);break;case"ArrowRight":rt=Ys(tt,ct,a?-1:1,c,s);break;case"ArrowDown":rt=Ys(tt,ct,-1,c,s);break;case"ArrowLeft":rt=Ys(tt,ct,a?1:-1,c,s);break;case"PageUp":rt=Ys(tt,b,1,c,s);break;case"PageDown":rt=Ys(tt,b,-1,c,s);break;case"Home":rt=c;break;case"End":rt=s;break}}else if(te){const ct=J[J.length-1],i1=J.indexOf(tt),_t=[a?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],h1=[a?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];_t.includes(ye.key)?i1===0?rt=J[0]:rt=J[i1-1]:h1.includes(ye.key)&&(i1===J.length-1?rt=ct:rt=J[i1+1])}rt!=null&&me(ye,rt)}(De=Ze==null?void 0:Ze.onKeyDown)==null||De.call(Ze,ye)};Ri(()=>{var Ze;l&&z.current.contains(document.activeElement)&&((Ze=document.activeElement)==null||Ze.blur())},[l]),l&&O!==-1&&E(-1),l&&Y!==-1&&I(-1);const se=Ze=>ye=>{var De;(De=Ze.onChange)==null||De.call(Ze,ye),me(ye,ye.target.valueAsNumber)},fe=oe.useRef(void 0);let Ee=h;a&&h==="horizontal"&&(Ee+="-reverse");const Se=({finger:Ze,move:ye=!1})=>{const{current:De}=z,{width:Ye,height:tt,bottom:rt,left:ct}=De.getBoundingClientRect();let i1;Ee.startsWith("vertical")?i1=(rt-Ze.y)/tt:i1=(Ze.x-ct)/Ye,Ee.includes("-reverse")&&(i1=1-i1);let _t;if(_t=xJ(i1,c,s),v)_t=HJ(_t,v,c);else{const p1=C_(J,_t);_t=J[p1]}_t=Rs(_t,c,s);let h1=0;if(ee){ye?h1=fe.current:h1=C_(W,_t),o&&(_t=Rs(_t,W[h1-1]||-1/0,W[h1+1]||1/0));const p1=_t;_t=w_({values:W,newValue:_t,index:h1}),o&&ye||(h1=_t.indexOf(p1),fe.current=h1)}return{newValue:_t,activeIndex:h1}},_e=kr(Ze=>{const ye=Km(Ze,_);if(!ye)return;if(R.current+=1,Ze.type==="mousemove"&&Ze.buttons===0){ze(Ze);return}const{newValue:De,activeIndex:Ye}=Se({finger:ye,move:!0});ey({sliderRef:z,activeIndex:Ye,setActive:E}),$(De),!k&&R.current>LJ&&B(!0),Z&&!ty(De,q)&&Z(Ze,De,Ye)}),ze=kr(Ze=>{const ye=Km(Ze,_);if(B(!1),!ye)return;const{newValue:De}=Se({finger:ye,move:!0});E(-1),Ze.type==="touchend"&&V(-1),f&&f(Ze,F.current??De),_.current=void 0,Pe()}),ue=kr(Ze=>{if(l)return;V_()||Ze.preventDefault();const ye=Ze.changedTouches[0];ye!=null&&(_.current=ye.identifier);const De=Km(Ze,_);if(De!==!1){const{newValue:tt,activeIndex:rt}=Se({finger:De});ey({sliderRef:z,activeIndex:rt,setActive:E}),$(tt),Z&&!ty(tt,q)&&Z(Ze,tt,rt)}R.current=0;const Ye=M4(z.current);Ye.addEventListener("touchmove",_e,{passive:!0}),Ye.addEventListener("touchend",ze,{passive:!0})}),Pe=oe.useCallback(()=>{const Ze=M4(z.current);Ze.removeEventListener("mousemove",_e),Ze.removeEventListener("mouseup",ze),Ze.removeEventListener("touchmove",_e),Ze.removeEventListener("touchend",ze)},[ze,_e]);oe.useEffect(()=>{const{current:Ze}=z;return Ze.addEventListener("touchstart",ue,{passive:V_()}),()=>{Ze.removeEventListener("touchstart",ue),Pe()}},[Pe,ue]),oe.useEffect(()=>{l&&Pe()},[l,Pe]);const We=Ze=>ye=>{var tt;if((tt=Ze.onMouseDown)==null||tt.call(Ze,ye),l||ye.defaultPrevented||ye.button!==0)return;ye.preventDefault();const De=Km(ye,_);if(De!==!1){const{newValue:rt,activeIndex:ct}=Se({finger:De});ey({sliderRef:z,activeIndex:ct,setActive:E}),$(rt),Z&&!ty(rt,q)&&Z(ye,rt,ct)}R.current=0;const Ye=M4(z.current);Ye.addEventListener("mousemove",_e,{passive:!0}),Ye.addEventListener("mouseup",ze)},dt=Jm(ee?W[0]:c,c,s),at=Jm(W[W.length-1],c,s)-dt,pt=(Ze={})=>{const ye=fT(Ze),De={onMouseDown:We(ye||{})},Ye={...ye,...De};return{...Ze,ref:ne,...Ye}},jt=Ze=>ye=>{var Ye;(Ye=Ze.onMouseOver)==null||Ye.call(Ze,ye);const De=Number(ye.currentTarget.getAttribute("data-index"));V(De)},d1=Ze=>ye=>{var De;(De=Ze.onMouseLeave)==null||De.call(Ze,ye),V(-1)},lt=(Ze={})=>{const ye=fT(Ze),De={onMouseOver:jt(ye||{}),onMouseLeave:d1(ye||{})};return{...Ze,...ye,...De}},ut=Ze=>({pointerEvents:O!==-1&&O!==Ze?"none":void 0});let e2;return h==="vertical"&&(e2=a?"vertical-rl":"vertical-lr"),{active:O,axis:Ee,axisProps:SJ,dragging:k,focusedThumbIndex:Y,getHiddenInputProps:(Ze={})=>{const ye=fT(Ze),De={onChange:se(ye||{}),onFocus:U(ye||{}),onBlur:de(ye||{}),onKeyDown:he(ye||{})},Ye={...ye,...De};return{tabIndex:L,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":g(s),"aria-valuemin":g(c),name:u,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:l,...Ze,...Ye,style:{...uJ,direction:a?"rtl":"ltr",width:"100%",height:"100%",writingMode:e2}}},getRootProps:pt,getThumbProps:lt,marks:te,open:A,range:ee,rootRef:ne,trackLeap:at,trackOffset:dt,values:W,getThumbStyle:ut}}const AJ=e=>!e||!z7(e);function _J(e){return It("MuiSlider",e)}const A6=kt("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"]);var OJ={};const CJ=e=>{const{open:t}=e;return{offset:Tt(t&&A6.valueLabelOpen),circle:A6.valueLabelCircle,label:A6.valueLabelLabel}};function D_(e){const{children:t,className:n,value:l}=e,o=CJ(e);return t?oe.cloneElement(t,{className:t.props.className},He.jsxs(oe.Fragment,{children:[t.props.children,He.jsx("span",{className:Tt(o.offset,n),"aria-hidden":!0,children:He.jsx("span",{className:o.circle,children:He.jsx("span",{className:o.label,children:l})})})]})):null}OJ.NODE_ENV!=="production"&&(D_.propTypes={children:M.element.isRequired,className:M.string,value:M.node});var R_={};function k_(e){return e}const wJ=Ke("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Ge(n.color)}`],n.size!=="medium"&&t[`size${Ge(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Vt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${A6.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${A6.dragging}`]:{[`& .${A6.thumb}, & .${A6.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(_2()).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}}]}))),VJ=Ke("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}}]}),DJ=Ke("span",{name:"MuiSlider",slot:"Track"})(Vt(({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(_2()).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:Ua(e.palette[t].main,.62),borderColor:Ua(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:$a(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:$a(e.palette[t].main,.5)})}}}))]}))),RJ=Ke("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${Ge(n.color)}`],n.size!=="medium"&&t[`thumbSize${Ge(n.size)}`]]}})(Vt(({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%)"},[`&.${A6.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(_2()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${A6.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${_1(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${A6.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${_1(e.palette[t].main,.16)}`}}}}))]}))),N_=Ke(D_,{name:"MuiSlider",slot:"ValueLabel"})(Vt(({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%"},[`&.${A6.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%"},[`&.${A6.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"}}]})));R_.NODE_ENV!=="production"&&(N_.propTypes={children:M.element.isRequired,index:M.number.isRequired,open:M.bool.isRequired,value:M.node});const kJ=Ke("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Sm(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Vt(({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}}]}))),NJ=Ke("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Sm(e)&&e!=="markLabelActive"})(Vt(({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}}]}))),BJ=e=>{const{disabled:t,dragging:n,marked:l,orientation:o,track:a,classes:i,color:s,size:c}=e,u={root:["root",t&&"disabled",n&&"dragging",l&&"marked",o==="vertical"&&"vertical",a==="inverted"&&"trackInverted",a===!1&&"trackFalse",s&&`color${Ge(s)}`,c&&`size${Ge(c)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",c&&`thumbSize${Ge(c)}`,s&&`thumbColor${Ge(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ut(u,_J,i)},PJ=({children:e})=>e,B_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiSlider"}),o=_M(),{"aria-label":a,"aria-valuetext":i,"aria-labelledby":s,component:c="span",components:u={},componentsProps:Q={},color:f="primary",classes:h,className:p,disableSwap:g=!1,disabled:v=!1,getAriaLabel:b,getAriaValueText:L,marks:S=!1,max:_=100,min:O=0,name:E,onChange:A,onChangeCommitted:V,orientation:k="horizontal",shiftStep:B=10,size:R="medium",step:F=1,scale:q=k_,slotProps:$,slots:Z,tabIndex:ee,track:W="normal",value:te,valueLabelDisplay:J="off",valueLabelFormat:Y=k_,...I}=l,z={...l,isRtl:o,max:_,min:O,classes:h,disabled:v,disableSwap:g,orientation:k,marks:S,color:f,size:R,step:F,shiftStep:B,scale:q,track:W,valueLabelDisplay:J,valueLabelFormat:Y},{axisProps:ne,getRootProps:U,getHiddenInputProps:de,getThumbProps:me,open:he,active:se,axis:fe,focusedThumbIndex:Ee,range:Se,dragging:_e,marks:ze,values:ue,trackOffset:Pe,trackLeap:We,getThumbStyle:dt}=MJ({...z,rootRef:n});z.marked=ze.length>0&&ze.some(nt=>nt.label),z.dragging=_e,z.focusedThumbIndex=Ee;const at=BJ(z),pt=(Z==null?void 0:Z.root)??u.Root??wJ,jt=(Z==null?void 0:Z.rail)??u.Rail??VJ,d1=(Z==null?void 0:Z.track)??u.Track??DJ,lt=(Z==null?void 0:Z.thumb)??u.Thumb??RJ,ut=(Z==null?void 0:Z.valueLabel)??u.ValueLabel??N_,e2=(Z==null?void 0:Z.mark)??u.Mark??kJ,T1=(Z==null?void 0:Z.markLabel)??u.MarkLabel??NJ,Ze=(Z==null?void 0:Z.input)??u.Input??"input",ye=($==null?void 0:$.root)??Q.root,De=($==null?void 0:$.rail)??Q.rail,Ye=($==null?void 0:$.track)??Q.track,tt=($==null?void 0:$.thumb)??Q.thumb,rt=($==null?void 0:$.valueLabel)??Q.valueLabel,ct=($==null?void 0:$.mark)??Q.mark,i1=($==null?void 0:$.markLabel)??Q.markLabel,_t=($==null?void 0:$.input)??Q.input,h1=Ii({elementType:pt,getSlotProps:U,externalSlotProps:ye,externalForwardedProps:I,additionalProps:{...AJ(pt)&&{as:c}},ownerState:{...z,...ye==null?void 0:ye.ownerState},className:[at.root,p]}),p1=Ii({elementType:jt,externalSlotProps:De,ownerState:z,className:at.rail}),Q1=Ii({elementType:d1,externalSlotProps:Ye,additionalProps:{style:{...ne[fe].offset(Pe),...ne[fe].leap(We)}},ownerState:{...z,...Ye==null?void 0:Ye.ownerState},className:at.track}),G1=Ii({elementType:lt,getSlotProps:me,externalSlotProps:tt,ownerState:{...z,...tt==null?void 0:tt.ownerState},className:at.thumb}),K=Ii({elementType:ut,externalSlotProps:rt,ownerState:{...z,...rt==null?void 0:rt.ownerState},className:at.valueLabel}),pe=Ii({elementType:e2,externalSlotProps:ct,ownerState:z,className:at.mark}),Ue=Ii({elementType:T1,externalSlotProps:i1,ownerState:z,className:at.markLabel}),Je=Ii({elementType:Ze,getSlotProps:de,externalSlotProps:_t,ownerState:z});return He.jsxs(pt,{...h1,children:[He.jsx(jt,{...p1}),He.jsx(d1,{...Q1}),ze.filter(nt=>nt.value>=O&&nt.value<=_).map((nt,mt)=>{const Mt=Jm(nt.value,O,_),Gt=ne[fe].offset(Mt);let xt;return W===!1?xt=ue.includes(nt.value):xt=W==="normal"&&(Se?nt.value>=ue[0]&&nt.value<=ue[ue.length-1]:nt.value<=ue[0])||W==="inverted"&&(Se?nt.value<=ue[0]||nt.value>=ue[ue.length-1]:nt.value>=ue[0]),He.jsxs(oe.Fragment,{children:[He.jsx(e2,{"data-index":mt,...pe,...!z7(e2)&&{markActive:xt},style:{...Gt,...pe.style},className:Tt(pe.className,xt&&at.markActive)}),nt.label!=null?He.jsx(T1,{"aria-hidden":!0,"data-index":mt,...Ue,...!z7(T1)&&{markLabelActive:xt},style:{...Gt,...Ue.style},className:Tt(at.markLabel,Ue.className,xt&&at.markLabelActive),children:nt.label}):null]},mt)}),ue.map((nt,mt)=>{const Mt=Jm(nt,O,_),Gt=ne[fe].offset(Mt),xt=J==="off"?PJ:ut;return He.jsx(xt,{...!z7(xt)&&{valueLabelFormat:Y,valueLabelDisplay:J,value:typeof Y=="function"?Y(q(nt),mt):Y,index:mt,open:he===mt||se===mt||J==="on",disabled:v},...K,children:He.jsx(lt,{"data-index":mt,...G1,className:Tt(at.thumb,G1.className,se===mt&&at.active,Ee===mt&&at.focusVisible),style:{...Gt,...dt(mt),...G1.style},children:He.jsx(Ze,{"data-index":mt,"aria-label":b?b(mt):a,"aria-valuenow":q(nt),"aria-labelledby":s,"aria-valuetext":L?L(q(nt),mt):i,value:ue[mt],...Je})})},mt)})]})});R_.NODE_ENV!=="production"&&(B_.propTypes={"aria-label":Bi(M.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":M.string,"aria-valuetext":Bi(M.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["primary","secondary","error","info","success","warning"]),M.string]),components:M.shape({Input:M.elementType,Mark:M.elementType,MarkLabel:M.elementType,Rail:M.elementType,Root:M.elementType,Thumb:M.elementType,Track:M.elementType,ValueLabel:M.elementType}),componentsProps:M.shape({input:M.oneOfType([M.func,M.object]),mark:M.oneOfType([M.func,M.object]),markLabel:M.oneOfType([M.func,M.object]),rail:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),thumb:M.oneOfType([M.func,M.object]),track:M.oneOfType([M.func,M.object]),valueLabel:M.oneOfType([M.func,M.shape({children:M.element,className:M.string,open:M.bool,style:M.object,value:M.node,valueLabelDisplay:M.oneOf(["auto","off","on"])})])}),defaultValue:M.oneOfType([M.arrayOf(M.number),M.number]),disabled:M.bool,disableSwap:M.bool,getAriaLabel:M.func,getAriaValueText:M.func,marks:M.oneOfType([M.arrayOf(M.shape({label:M.node,value:M.number.isRequired})),M.bool]),max:M.number,min:M.number,name:M.string,onChange:M.func,onChangeCommitted:M.func,orientation:M.oneOf(["horizontal","vertical"]),scale:M.func,shiftStep:M.number,size:M.oneOfType([M.oneOf(["small","medium"]),M.string]),slotProps:M.shape({input:M.oneOfType([M.func,M.object]),mark:M.oneOfType([M.func,M.object]),markLabel:M.oneOfType([M.func,M.object]),rail:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),thumb:M.oneOfType([M.func,M.object]),track:M.oneOfType([M.func,M.object]),valueLabel:M.oneOfType([M.func,M.shape({children:M.element,className:M.string,open:M.bool,style:M.object,value:M.node,valueLabelDisplay:M.oneOf(["auto","off","on"])})])}),slots:M.shape({input:M.elementType,mark:M.elementType,markLabel:M.elementType,rail:M.elementType,root:M.elementType,thumb:M.elementType,track:M.elementType,valueLabel:M.elementType}),step:M.number,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),tabIndex:M.number,track:M.oneOf(["inverted","normal",!1]),value:M.oneOfType([M.arrayOf(M.number),M.number]),valueLabelDisplay:M.oneOf(["auto","off","on"]),valueLabelFormat:M.oneOfType([M.func,M.string])});function IJ(e){return It("MuiSwitch",e)}const A4=kt("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]);var jJ={};const FJ=e=>{const{classes:t,edge:n,size:l,color:o,checked:a,disabled:i}=e,s={root:["root",n&&`edge${Ge(n)}`,`size${Ge(l)}`],switchBase:["switchBase",`color${Ge(o)}`,a&&"checked",i&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},c=Ut(s,IJ,t);return{...t,...c}},zJ=Ke("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Ge(n.edge)}`],t[`size${Ge(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${A4.thumb}`]:{width:16,height:16},[`& .${A4.switchBase}`]:{padding:4,[`&.${A4.checked}`]:{transform:"translateX(16px)"}}}}]}),qJ=Ke(qL,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${A4.input}`]:t.input},n.color!=="default"&&t[`color${Ge(n.color)}`]]}})(Vt(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${A4.checked}`]:{transform:"translateX(20px)"},[`&.${A4.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${A4.checked} + .${A4.track}`]:{opacity:.5},[`&.${A4.disabled} + .${A4.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${A4.input}`]:{left:"-100%",width:"300%"}})),Vt(({theme:e})=>({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(_2(["light"])).map(([t])=>({props:{color:t},style:{[`&.${A4.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette[t].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${A4.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?Ua(e.palette[t].main,.62):$a(e.palette[t].main,.55)}`}},[`&.${A4.checked} + .${A4.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),$J=Ke("span",{name:"MuiSwitch",slot:"Track"})(Vt(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),UJ=Ke("span",{name:"MuiSwitch",slot:"Thumb"})(Vt(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),P_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiSwitch"}),{className:o,color:a="primary",edge:i=!1,size:s="medium",sx:c,slots:u={},slotProps:Q={},...f}=l,h={...l,color:a,edge:i,size:s},p=FJ(h),g={slots:u,slotProps:Q},[v,b]=t1("root",{className:Tt(p.root,o),elementType:zJ,externalForwardedProps:g,ownerState:h,additionalProps:{sx:c}}),[L,S]=t1("thumb",{className:p.thumb,elementType:UJ,externalForwardedProps:g,ownerState:h}),_=He.jsx(L,{...S}),[O,E]=t1("track",{className:p.track,elementType:$J,externalForwardedProps:g,ownerState:h});return He.jsxs(v,{...b,children:[He.jsx(qJ,{type:"checkbox",icon:_,checkedIcon:_,ref:n,ownerState:h,...f,classes:{...p,root:p.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...Q.switchBase&&{root:typeof Q.switchBase=="function"?Q.switchBase(h):Q.switchBase},...Q.input&&{input:typeof Q.input=="function"?Q.input(h):Q.input}}}),He.jsx(O,{...E})]})});jJ.NODE_ENV!=="production"&&(P_.propTypes={checked:M.bool,checkedIcon:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["default","primary","secondary","error","info","success","warning"]),M.string]),defaultChecked:M.bool,disabled:M.bool,disableRipple:M.bool,edge:M.oneOf(["end","start",!1]),icon:M.node,id:M.string,inputProps:M.object,inputRef:bn,onChange:M.func,required:M.bool,size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),slotProps:M.shape({input:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),switchBase:M.oneOfType([M.func,M.object]),thumb:M.oneOfType([M.func,M.object]),track:M.oneOfType([M.func,M.object])}),slots:M.shape({input:M.elementType,root:M.elementType,switchBase:M.elementType,thumb:M.elementType,track:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),value:M.any});function GJ(e){return It("MuiTextField",e)}kt("MuiTextField",["root"]);var I_={};const ZJ={standard:Zm,filled:Um,outlined:Wm},XJ=e=>{const{classes:t}=e;return Ut({root:["root"]},GJ,t)},WJ=Ke(J4,{name:"MuiTextField",slot:"Root"})({}),Wa=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:a=!1,children:i,className:s,color:c="primary",defaultValue:u,disabled:Q=!1,error:f=!1,FormHelperTextProps:h,fullWidth:p=!1,helperText:g,id:v,InputLabelProps:b,inputProps:L,InputProps:S,inputRef:_,label:O,maxRows:E,minRows:A,multiline:V=!1,name:k,onBlur:B,onChange:R,onFocus:F,placeholder:q,required:$=!1,rows:Z,select:ee=!1,SelectProps:W,slots:te={},slotProps:J={},type:Y,value:I,variant:z="outlined",...ne}=l,U={...l,autoFocus:a,color:c,disabled:Q,error:f,fullWidth:p,multiline:V,required:$,select:ee,variant:z},de=XJ(U);I_.NODE_ENV!=="production"&&ee&&!i&&console.error("MUI: `children` must be passed when using the `TextField` component with `select`.");const me=ks(v),he=g&&me?`${me}-helper-text`:void 0,se=O&&me?`${me}-label`:void 0,fe=ZJ[z],Ee={slots:te,slotProps:{input:S,inputLabel:b,htmlInput:L,formHelperText:h,select:W,...J}},Se={},_e=Ee.slotProps.inputLabel;z==="outlined"&&(_e&&typeof _e.shrink<"u"&&(Se.notched=_e.shrink),Se.label=O),ee&&((!W||!W.native)&&(Se.id=void 0),Se["aria-describedby"]=void 0);const[ze,ue]=t1("root",{elementType:WJ,shouldForwardComponentProp:!0,externalForwardedProps:{...Ee,...ne},ownerState:U,className:Tt(de.root,s),ref:n,additionalProps:{disabled:Q,error:f,fullWidth:p,required:$,color:c,variant:z}}),[Pe,We]=t1("input",{elementType:fe,externalForwardedProps:Ee,additionalProps:Se,ownerState:U}),[dt,at]=t1("inputLabel",{elementType:r_,externalForwardedProps:Ee,ownerState:U}),[pt,jt]=t1("htmlInput",{elementType:"input",externalForwardedProps:Ee,ownerState:U}),[d1,lt]=t1("formHelperText",{elementType:WA,externalForwardedProps:Ee,ownerState:U}),[ut,e2]=t1("select",{elementType:Ws,externalForwardedProps:Ee,ownerState:U}),T1=He.jsx(Pe,{"aria-describedby":he,autoComplete:o,autoFocus:a,defaultValue:u,fullWidth:p,multiline:V,name:k,rows:Z,maxRows:E,minRows:A,type:Y,value:I,id:me,inputRef:_,onBlur:B,onChange:R,onFocus:F,placeholder:q,inputProps:jt,slots:{input:te.htmlInput?pt:void 0},...We});return He.jsxs(ze,{...ue,children:[O!=null&&O!==""&&He.jsx(dt,{htmlFor:me,id:se,...at,children:O}),ee?He.jsx(ut,{"aria-describedby":he,id:me,labelId:se,value:I,input:T1,...e2,children:i}):T1,g&&He.jsx(d1,{id:he,...lt,children:g})]})});I_.NODE_ENV!=="production"&&(Wa.propTypes={autoComplete:M.string,autoFocus:M.bool,children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["primary","secondary","error","info","success","warning"]),M.string]),defaultValue:M.any,disabled:M.bool,error:M.bool,FormHelperTextProps:M.object,fullWidth:M.bool,helperText:M.node,id:M.string,InputLabelProps:M.object,inputProps:M.object,InputProps:M.object,inputRef:bn,label:M.node,margin:M.oneOf(["dense","none","normal"]),maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),multiline:M.bool,name:M.string,onBlur:M.func,onChange:M.func,onFocus:M.func,placeholder:M.string,required:M.bool,rows:M.oneOfType([M.number,M.string]),select:M.bool,SelectProps:M.object,size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),slotProps:M.shape({formHelperText:M.oneOfType([M.func,M.object]),htmlInput:M.oneOfType([M.func,M.object]),input:M.oneOfType([M.func,M.object]),inputLabel:M.oneOfType([M.func,M.object]),select:M.oneOfType([M.func,M.object])}),slots:M.shape({formHelperText:M.elementType,htmlInput:M.elementType,input:M.elementType,inputLabel:M.elementType,root:M.elementType,select:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.string,value:M.any,variant:M.oneOf(["filled","outlined","standard"])});const YJ=({model:e,fontSize:t="small"})=>{if(!e)return Le.createElement(JM,{fontSize:t});switch(e){case"OPENAI":return Le.createElement(B7,{fontSize:t,viewBox:"0 0 24 24"},Le.createElement("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.78.78 0 0 0 .78 0l5.843-3.369v2.332a.074.074 0 0 1-.028.057l-4.832 2.795a4.504 4.504 0 0 1-6.153-1.645zm-.856-8.246a4.476 4.476 0 0 1 2.346-1.973l-.004.162v5.517a.787.787 0 0 0 .392.681l5.843 3.369-2.02 1.168a.069.069 0 0 1-.066 0l-4.827-2.79a4.504 4.504 0 0 1-1.664-6.134zm16.008 3.73-5.843-3.369 2.02-1.168a.07.07 0 0 1 .066 0l4.827 2.79a4.494 4.494 0 0 1-1.12 8.107v-5.517a.795.795 0 0 0-.397-.681zm2.253-3.395a4.47 4.47 0 0 1-.535.983l-.142-.085-4.779-2.759a.78.78 0 0 0-.78 0L8.927 11.9V9.569a.07.07 0 0 1 .028-.057l4.827-2.79a4.504 4.504 0 0 1 6.682 2.771zm-12.35 3.369-2.02-1.168a.067.067 0 0 1-.037-.052V7.967a4.504 4.504 0 0 1 7.37-3.454l-.142.081-4.779 2.759a.795.795 0 0 0-.392.681zm1.069-2.332 2.606-1.507 2.606 1.507v3.014l-2.606 1.507-2.606-1.507z"}));case"ANTHROPIC_CLAUDE":return Le.createElement(B7,{fontSize:t,viewBox:"0 0 24 24"},Le.createElement("path",{d:"M15.5 2.25a4.25 4.25 0 0 0-4.25 4.25h-2.5A6.75 6.75 0 0 1 15.5 0h2.5v2.25zM2.25 8.5A4.25 4.25 0 0 0 6.5 12.75v2.5A6.75 6.75 0 0 1 0 8.5v-2.5h2.25zM8.5 21.75a4.25 4.25 0 0 0 4.25-4.25h2.5A6.75 6.75 0 0 1 8.5 24H6v-2.25zM21.75 15.5a4.25 4.25 0 0 0-4.25-4.25v-2.5A6.75 6.75 0 0 1 24 15.5V18h-2.25z"}),Le.createElement("path",{d:"M12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 8a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"}));case"GOOGLE_GEMINI":return Le.createElement(B7,{fontSize:t,viewBox:"0 0 24 24"},Le.createElement("path",{d:"M4 12c0-4.41 3.59-8 8-8s8 3.59 8 8-3.59 8-8 8-8-3.59-8-8m8-10c-5.51 0-10 4.49-10 10s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m2.5 10c0 1.38-1.12 2.5-2.5 2.5S9.5 13.38 9.5 12 10.62 9.5 12 9.5s2.5 1.12 2.5 2.5M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6m0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4"}));default:return Le.createElement(JM,{fontSize:t})}},KJ=({enabledModels:e})=>{const t=Pa("settings"),n=Pa("chat"),l=t.state,o=(s,c)=>{const u=t.state,Q={...u,llm:{...u.llm,models:{...u.llm.models,[s]:{...u.llm.models[s],version:c,enabled:!0}}}};t.saveSettings(Q),n.loadInitialMessage()},a=s=>{const c=zc[s],u=c.labels;return c.options.map(Q=>{const f=Q;return{label:u[f],value:f}})},i=s=>{const c=zc[s],u=l.llm.models[s].version,Q=c.options;return!u||!Q.includes(u)?c.default:u};return Le.createElement(Pr,{sx:{mt:2,display:"flex",flexDirection:"column",gap:1}},e.map(s=>Le.createElement(Pr,{key:s.modelKey,sx:{display:"flex",alignItems:"center",gap:1}},Le.createElement(K3,{variant:"body2",sx:{minWidth:100}},s.name,":"),Le.createElement(J4,{size:"small",sx:{minWidth:200}},Le.createElement(Ws,{value:i(s.modelKey),onChange:c=>o(s.modelKey,c.target.value),"aria-label":`Select ${s.name} version`,MenuProps:{disablePortal:!0,PaperProps:{sx:{maxHeight:200}}}},a(s.modelKey).map(c=>Le.createElement(U7,{key:c.value,value:c.value},c.label)))))))};function poe(){}function moe(){}function j_(e){const t=[],n=String(e||"");let l=n.indexOf(","),o=0,a=!1;for(;!a;){l===-1&&(l=n.length,a=!0);const i=n.slice(o,l).trim();(i||!a)&&t.push(i),o=l+1,l=n.indexOf(",",o)}return t}function JJ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eee=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tee=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nee={};function F_(e,t){return(nee.jsx?tee:eee).test(e)}const ree=/[ \t\n\f\r]/g;function iee(e){return typeof e=="object"?e.type==="text"?z_(e.value):!1:z_(e)}function z_(e){return e.replace(ree,"")===""}class AT{constructor(t,n,l){this.normal=n,this.property=t,l&&(this.space=l)}}AT.prototype.normal={},AT.prototype.property={},AT.prototype.space=void 0;function q_(e,t){const n={},l={};for(const o of e)Object.assign(n,o.property),Object.assign(l,o.normal);return new AT(n,l,t)}function _T(e){return e.toLowerCase()}class en{constructor(t,n){this.attribute=n,this.property=t}}en.prototype.attribute="",en.prototype.booleanish=!1,en.prototype.boolean=!1,en.prototype.commaOrSpaceSeparated=!1,en.prototype.commaSeparated=!1,en.prototype.defined=!1,en.prototype.mustUseProperty=!1,en.prototype.number=!1,en.prototype.overloadedBoolean=!1,en.prototype.property="",en.prototype.spaceSeparated=!1,en.prototype.space=void 0;let aee=0;const Xt=G7(),W2=G7(),lx=G7(),et=G7(),s2=G7(),Ks=G7(),Hn=G7();function G7(){return 2**++aee}const sx=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xt,booleanish:W2,commaOrSpaceSeparated:Hn,commaSeparated:Ks,number:et,overloadedBoolean:lx,spaceSeparated:s2},Symbol.toStringTag,{value:"Module"})),ux=Object.keys(sx);class cx extends en{constructor(t,n,l,o){let a=-1;if(super(t,n),$_(this,"space",o),typeof l=="number")for(;++a<ux.length;){const i=ux[a];$_(this,ux[a],(l&sx[i])===sx[i])}}}cx.prototype.defined=!0;function $_(e,t,n){n&&(e[t]=n)}function Js(e){const t={},n={};for(const[l,o]of Object.entries(e.properties)){const a=new cx(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(a.mustUseProperty=!0),t[l]=a,n[_T(l)]=l,n[_T(a.attribute)]=l}return new AT(t,n,e.space)}const U_=Js({properties:{ariaActiveDescendant:null,ariaAtomic:W2,ariaAutoComplete:null,ariaBusy:W2,ariaChecked:W2,ariaColCount:et,ariaColIndex:et,ariaColSpan:et,ariaControls:s2,ariaCurrent:null,ariaDescribedBy:s2,ariaDetails:null,ariaDisabled:W2,ariaDropEffect:s2,ariaErrorMessage:null,ariaExpanded:W2,ariaFlowTo:s2,ariaGrabbed:W2,ariaHasPopup:null,ariaHidden:W2,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:s2,ariaLevel:et,ariaLive:null,ariaModal:W2,ariaMultiLine:W2,ariaMultiSelectable:W2,ariaOrientation:null,ariaOwns:s2,ariaPlaceholder:null,ariaPosInSet:et,ariaPressed:W2,ariaReadOnly:W2,ariaRelevant:null,ariaRequired:W2,ariaRoleDescription:s2,ariaRowCount:et,ariaRowIndex:et,ariaRowSpan:et,ariaSelected:W2,ariaSetSize:et,ariaSort:null,ariaValueMax:et,ariaValueMin:et,ariaValueNow:et,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function G_(e,t){return t in e?e[t]:t}function Z_(e,t){return G_(e,t.toLowerCase())}const oee=Js({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ks,acceptCharset:s2,accessKey:s2,action:null,allow:null,allowFullScreen:Xt,allowPaymentRequest:Xt,allowUserMedia:Xt,alt:null,as:null,async:Xt,autoCapitalize:null,autoComplete:s2,autoFocus:Xt,autoPlay:Xt,blocking:s2,capture:null,charSet:null,checked:Xt,cite:null,className:s2,cols:et,colSpan:null,content:null,contentEditable:W2,controls:Xt,controlsList:s2,coords:et|Ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xt,defer:Xt,dir:null,dirName:null,disabled:Xt,download:lx,draggable:W2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xt,formTarget:null,headers:s2,height:et,hidden:lx,high:et,href:null,hrefLang:null,htmlFor:s2,httpEquiv:s2,id:null,imageSizes:null,imageSrcSet:null,inert:Xt,inputMode:null,integrity:null,is:null,isMap:Xt,itemId:null,itemProp:s2,itemRef:s2,itemScope:Xt,itemType:s2,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xt,low:et,manifest:null,max:null,maxLength:et,media:null,method:null,min:null,minLength:et,multiple:Xt,muted:Xt,name:null,nonce:null,noModule:Xt,noValidate:Xt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xt,optimum:et,pattern:null,ping:s2,placeholder:null,playsInline:Xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xt,referrerPolicy:null,rel:s2,required:Xt,reversed:Xt,rows:et,rowSpan:et,sandbox:s2,scope:null,scoped:Xt,seamless:Xt,selected:Xt,shadowRootClonable:Xt,shadowRootDelegatesFocus:Xt,shadowRootMode:null,shape:null,size:et,sizes:null,slot:null,span:et,spellCheck:W2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:et,step:null,style:null,tabIndex:et,target:null,title:null,translate:null,type:null,typeMustMatch:Xt,useMap:null,value:W2,width:et,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:s2,axis:null,background:null,bgColor:null,border:et,borderColor:null,bottomMargin:et,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xt,declare:Xt,event:null,face:null,frame:null,frameBorder:null,hSpace:et,leftMargin:et,link:null,longDesc:null,lowSrc:null,marginHeight:et,marginWidth:et,noResize:Xt,noHref:Xt,noShade:Xt,noWrap:Xt,object:null,profile:null,prompt:null,rev:null,rightMargin:et,rules:null,scheme:null,scrolling:W2,standby:null,summary:null,text:null,topMargin:et,valueType:null,version:null,vAlign:null,vLink:null,vSpace:et,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xt,disableRemotePlayback:Xt,prefix:null,property:null,results:et,security:null,unselectable:null},space:"html",transform:Z_}),lee=Js({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Hn,accentHeight:et,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:et,amplitude:et,arabicForm:null,ascent:et,attributeName:null,attributeType:null,azimuth:et,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:et,by:null,calcMode:null,capHeight:et,className:s2,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:et,diffuseConstant:et,direction:null,display:null,dur:null,divisor:et,dominantBaseline:null,download:Xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:et,enableBackground:null,end:null,event:null,exponent:et,externalResourcesRequired:null,fill:null,fillOpacity:et,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ks,g2:Ks,glyphName:Ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:et,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:et,horizOriginX:et,horizOriginY:et,id:null,ideographic:et,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:et,k:et,k1:et,k2:et,k3:et,k4:et,kernelMatrix:Hn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:et,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:et,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:et,overlineThickness:et,paintOrder:null,panose1:null,path:null,pathLength:et,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:s2,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:et,pointsAtY:et,pointsAtZ:et,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hn,rev:Hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hn,requiredFeatures:Hn,requiredFonts:Hn,requiredFormats:Hn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:et,specularExponent:et,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:et,strikethroughThickness:et,string:null,stroke:null,strokeDashArray:Hn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:et,strokeOpacity:et,strokeWidth:null,style:null,surfaceScale:et,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hn,tabIndex:et,tableValues:null,target:null,targetX:et,targetY:et,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:et,underlineThickness:et,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:et,values:null,vAlphabetic:et,vMathematical:et,vectorEffect:null,vHanging:et,vIdeographic:et,version:null,vertAdvY:et,vertOriginX:et,vertOriginY:et,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:et,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:G_}),X_=Js({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),W_=Js({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Z_}),Y_=Js({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),see={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},uee=/[A-Z]/g,K_=/-[a-z]/g,cee=/^data[-\w.:]+$/i;function J_(e,t){const n=_T(t);let l=t,o=en;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cee.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(K_,Qee);l="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!K_.test(a)){let i=a.replace(uee,Tee);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=cx}return new o(l,t)}function Tee(e){return"-"+e.toLowerCase()}function Qee(e){return e.charAt(1).toUpperCase()}const eO=q_([U_,oee,X_,W_,Y_],"html"),ry=q_([U_,lee,X_,W_,Y_],"svg");function tO(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function fee(e){return e.join(" ").trim()}var e9={},Tx,nO;function dee(){if(nO)return Tx;nO=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
334
+ `))}},[ye,dt,S,_,Y]),Ze&&(S?T1.length===0?ut=null:ut=T1.reduce((K,pe,Ue)=>(K.push(pe),Ue<T1.length-1&&K.push(", "),K),[]):ut=e2);let Ye=fe;!i&&se&&me&&(Ye=ze.clientWidth);let tt;typeof Z<"u"?tt=Z:tt=f?null:0;const rt=$.id||(_?`mui-component-select-${_}`:void 0),ct={...t,variant:te,value:Y,open:d1,error:p},i1=dJ(ct),_t={...L.PaperProps,...(Q1=L.slotProps)==null?void 0:Q1.paper},h1={...L.MenuListProps,...(G1=L.slotProps)==null?void 0:G1.list},p1=ks();return He.jsxs(oe.Fragment,{children:[He.jsx(cJ,{as:"div",ref:_e,tabIndex:tt,role:"combobox","aria-controls":d1?p1:void 0,"aria-disabled":f?"true":void 0,"aria-expanded":d1?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[b,rt].filter(Boolean).join(" ")||void 0,"aria-describedby":l,"aria-required":q?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:jt,onMouseDown:f||R?null:Pe,onBlur:lt,onFocus:V,...$,ownerState:ct,className:Tt($.className,i1.select,c),id:rt,children:fJ(ut)?M_||(M_=He.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):ut}),He.jsx(QJ,{"aria-invalid":p,value:Array.isArray(Y)?Y.join(","):Y,name:_,ref:U,"aria-hidden":!0,onChange:at,tabIndex:-1,disabled:f,className:i1.nativeInput,autoFocus:a,required:q,...J,ownerState:ct}),He.jsx(TJ,{as:g,className:i1.icon,ownerState:ct}),He.jsx(m_,{id:`menu-${_||""}`,anchorEl:ze,open:d1,onClose:We,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...L,slotProps:{...L.slotProps,list:{"aria-labelledby":b,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:p1,...h1},paper:{..._t,style:{minWidth:Ye,..._t!=null?_t.style:null}}},children:De})]})});Ym.NODE_ENV!=="production"&&(__.propTypes={"aria-describedby":M.string,"aria-label":M.string,autoFocus:M.bool,autoWidth:M.bool,children:M.node,classes:M.object,className:M.string,defaultOpen:M.bool,defaultValue:M.any,disabled:M.bool,displayEmpty:M.bool,error:M.bool,IconComponent:M.elementType.isRequired,inputRef:bn,labelId:M.string,MenuProps:M.object,multiple:M.bool,name:M.string,onBlur:M.func,onChange:M.func,onClose:M.func,onFocus:M.func,onOpen:M.func,open:M.bool,readOnly:M.bool,renderValue:M.func,required:M.bool,SelectDisplayProps:M.object,tabIndex:M.oneOfType([M.number,M.string]),type:M.any,value:M.any,variant:M.oneOf(["standard","outlined","filled"])});var hJ={};const pJ=e=>{const{classes:t}=e,l=Ut({root:["root"]},E_,t);return{...t,...l}},ox={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>E4(e)&&e!=="variant"},mJ=Ke(Zm,ox)(""),yJ=Ke(Wm,ox)(""),gJ=Ke(Um,ox)(""),Ws=oe.forwardRef(function(t,n){const l=e1({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:a,classes:i={},className:s,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:Q=iW,id:f,input:h,inputProps:p,label:g,labelId:v,MenuProps:b,multiple:L=!1,native:S=!1,onClose:_,onOpen:O,open:E,renderValue:A,SelectDisplayProps:V,variant:k="outlined",...B}=l,R=S?L_:__,F=Q5(),q=Xa({props:l,muiFormControl:F,states:["variant","error"]}),$=q.variant||k,Z={...l,variant:$,classes:i},ee=pJ(Z),{root:W,...te}=ee,J=h||{standard:He.jsx(mJ,{ownerState:Z}),outlined:He.jsx(yJ,{label:g,ownerState:Z}),filled:He.jsx(gJ,{ownerState:Z})}[$],Y=v3(n,pT(J));return He.jsx(oe.Fragment,{children:oe.cloneElement(J,{inputComponent:R,inputProps:{children:a,error:q.error,IconComponent:Q,variant:$,type:void 0,multiple:L,...S?{id:f}:{autoWidth:o,defaultOpen:c,displayEmpty:u,labelId:v,MenuProps:b,onClose:_,onOpen:O,open:E,renderValue:A,SelectDisplayProps:{id:f,...V}},...p,classes:p?G3(te,p.classes):te,...h?h.props.inputProps:{}},...(L&&S||u)&&$==="outlined"?{notched:!0}:{},ref:Y,className:Tt(J.props.className,s,ee.root),...!h&&{variant:$},...B})})});hJ.NODE_ENV!=="production"&&(Ws.propTypes={autoWidth:M.bool,children:M.node,classes:M.object,className:M.string,defaultOpen:M.bool,defaultValue:M.any,displayEmpty:M.bool,IconComponent:M.elementType,id:M.string,input:M.element,inputProps:M.object,label:M.node,labelId:M.string,MenuProps:M.object,multiple:M.bool,native:M.bool,onChange:M.func,onClose:M.func,onOpen:M.func,open:M.bool,renderValue:M.func,SelectDisplayProps:M.object,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),value:M.oneOfType([M.oneOf([""]),M.any]),variant:M.oneOf(["filled","outlined","standard"])}),Ws.muiName="Select";function vJ(e,t,n=(l,o)=>l===o){return e.length===t.length&&e.every((l,o)=>n(l,t[o]))}const LJ=2;function Ys(e,t,n,l,o){return n===1?Math.min(e+t,o):Math.max(e-t,l)}function O_(e,t){return e-t}function C_(e,t){const{index:n}=e.reduce((l,o,a)=>{const i=Math.abs(t-o);return l===null||i<l.distance||i===l.distance?{distance:i,index:a}:l},null)??{};return n}function Km(e,t){if(t.current!==void 0&&e.changedTouches){const n=e;for(let l=0;l<n.changedTouches.length;l+=1){const o=n.changedTouches[l];if(o.identifier===t.current)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Jm(e,t,n){return(e-t)*100/(n-t)}function xJ(e,t,n){return(n-t)*e+t}function bJ(e){if(Math.abs(e)<1){const n=e.toExponential().split("e-"),l=n[0].split(".")[1];return(l?l.length:0)+parseInt(n[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function HJ(e,t,n){const l=Math.round((e-n)/t)*t+n;return Number(l.toFixed(bJ(t)))}function w_({values:e,newValue:t,index:n}){const l=e.slice();return l[n]=t,l.sort(O_)}function ey({sliderRef:e,activeIndex:t,setActive:n}){var o,a,i;const l=M4(e.current);(!((o=e.current)!=null&&o.contains(l.activeElement))||Number((a=l==null?void 0:l.activeElement)==null?void 0:a.getAttribute("data-index"))!==t)&&((i=e.current)==null||i.querySelector(`[type="range"][data-index="${t}"]`).focus()),n&&n(t)}function ty(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?vJ(e,t):!1}const SJ={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}%`})}},EJ=e=>e;let ny;function V_(){return ny===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?ny=CSS.supports("touch-action","none"):ny=!0),ny}function MJ(e){const{"aria-labelledby":t,defaultValue:n,disabled:l=!1,disableSwap:o=!1,isRtl:a=!1,marks:i=!1,max:s=100,min:c=0,name:u,onChange:Q,onChangeCommitted:f,orientation:h="horizontal",rootRef:p,scale:g=EJ,step:v=1,shiftStep:b=10,tabIndex:L,value:S}=e,_=oe.useRef(void 0),[O,E]=oe.useState(-1),[A,V]=oe.useState(-1),[k,B]=oe.useState(!1),R=oe.useRef(0),F=oe.useRef(null),[q,$]=cT({controlled:S,default:n??c,name:"Slider"}),Z=Q&&((Ze,ye,De)=>{const Ye=Ze.nativeEvent||Ze,tt=new Ye.constructor(Ye.type,Ye);Object.defineProperty(tt,"target",{writable:!0,value:{value:ye,name:u}}),F.current=ye,Q(tt,ye,De)}),ee=Array.isArray(q);let W=ee?q.slice().sort(O_):[q];W=W.map(Ze=>Ze==null?c:Rs(Ze,c,s));const te=i===!0&&v!==null?[...Array(Math.floor((s-c)/v)+1)].map((Ze,ye)=>({value:c+v*ye})):i||[],J=te.map(Ze=>Ze.value),[Y,I]=oe.useState(-1),z=oe.useRef(null),ne=v3(p,z),U=Ze=>ye=>{var Ye;const De=Number(ye.currentTarget.getAttribute("data-index"));Om(ye.target)&&I(De),V(De),(Ye=Ze==null?void 0:Ze.onFocus)==null||Ye.call(Ze,ye)},de=Ze=>ye=>{var De;Om(ye.target)||I(-1),V(-1),(De=Ze==null?void 0:Ze.onBlur)==null||De.call(Ze,ye)},me=(Ze,ye)=>{const De=Number(Ze.currentTarget.getAttribute("data-index")),Ye=W[De],tt=J.indexOf(Ye);let rt=ye;if(te&&v==null){const ct=J[J.length-1];rt>=ct?rt=ct:rt<=J[0]?rt=J[0]:rt=rt<Ye?J[tt-1]:J[tt+1]}if(rt=Rs(rt,c,s),ee){o&&(rt=Rs(rt,W[De-1]||-1/0,W[De+1]||1/0));const ct=rt;rt=w_({values:W,newValue:rt,index:De});let i1=De;o||(i1=rt.indexOf(ct)),ey({sliderRef:z,activeIndex:i1})}$(rt),I(De),Z&&!ty(rt,q)&&Z(Ze,rt,De),f&&f(Ze,F.current??rt)},he=Ze=>ye=>{var De;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(ye.key)){ye.preventDefault();const Ye=Number(ye.currentTarget.getAttribute("data-index")),tt=W[Ye];let rt=null;if(v!=null){const ct=ye.shiftKey?b:v;switch(ye.key){case"ArrowUp":rt=Ys(tt,ct,1,c,s);break;case"ArrowRight":rt=Ys(tt,ct,a?-1:1,c,s);break;case"ArrowDown":rt=Ys(tt,ct,-1,c,s);break;case"ArrowLeft":rt=Ys(tt,ct,a?1:-1,c,s);break;case"PageUp":rt=Ys(tt,b,1,c,s);break;case"PageDown":rt=Ys(tt,b,-1,c,s);break;case"Home":rt=c;break;case"End":rt=s;break}}else if(te){const ct=J[J.length-1],i1=J.indexOf(tt),_t=[a?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],h1=[a?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];_t.includes(ye.key)?i1===0?rt=J[0]:rt=J[i1-1]:h1.includes(ye.key)&&(i1===J.length-1?rt=ct:rt=J[i1+1])}rt!=null&&me(ye,rt)}(De=Ze==null?void 0:Ze.onKeyDown)==null||De.call(Ze,ye)};Ri(()=>{var Ze;l&&z.current.contains(document.activeElement)&&((Ze=document.activeElement)==null||Ze.blur())},[l]),l&&O!==-1&&E(-1),l&&Y!==-1&&I(-1);const se=Ze=>ye=>{var De;(De=Ze.onChange)==null||De.call(Ze,ye),me(ye,ye.target.valueAsNumber)},fe=oe.useRef(void 0);let Ee=h;a&&h==="horizontal"&&(Ee+="-reverse");const Se=({finger:Ze,move:ye=!1})=>{const{current:De}=z,{width:Ye,height:tt,bottom:rt,left:ct}=De.getBoundingClientRect();let i1;Ee.startsWith("vertical")?i1=(rt-Ze.y)/tt:i1=(Ze.x-ct)/Ye,Ee.includes("-reverse")&&(i1=1-i1);let _t;if(_t=xJ(i1,c,s),v)_t=HJ(_t,v,c);else{const p1=C_(J,_t);_t=J[p1]}_t=Rs(_t,c,s);let h1=0;if(ee){ye?h1=fe.current:h1=C_(W,_t),o&&(_t=Rs(_t,W[h1-1]||-1/0,W[h1+1]||1/0));const p1=_t;_t=w_({values:W,newValue:_t,index:h1}),o&&ye||(h1=_t.indexOf(p1),fe.current=h1)}return{newValue:_t,activeIndex:h1}},_e=kr(Ze=>{const ye=Km(Ze,_);if(!ye)return;if(R.current+=1,Ze.type==="mousemove"&&Ze.buttons===0){ze(Ze);return}const{newValue:De,activeIndex:Ye}=Se({finger:ye,move:!0});ey({sliderRef:z,activeIndex:Ye,setActive:E}),$(De),!k&&R.current>LJ&&B(!0),Z&&!ty(De,q)&&Z(Ze,De,Ye)}),ze=kr(Ze=>{const ye=Km(Ze,_);if(B(!1),!ye)return;const{newValue:De}=Se({finger:ye,move:!0});E(-1),Ze.type==="touchend"&&V(-1),f&&f(Ze,F.current??De),_.current=void 0,Pe()}),ue=kr(Ze=>{if(l)return;V_()||Ze.preventDefault();const ye=Ze.changedTouches[0];ye!=null&&(_.current=ye.identifier);const De=Km(Ze,_);if(De!==!1){const{newValue:tt,activeIndex:rt}=Se({finger:De});ey({sliderRef:z,activeIndex:rt,setActive:E}),$(tt),Z&&!ty(tt,q)&&Z(Ze,tt,rt)}R.current=0;const Ye=M4(z.current);Ye.addEventListener("touchmove",_e,{passive:!0}),Ye.addEventListener("touchend",ze,{passive:!0})}),Pe=oe.useCallback(()=>{const Ze=M4(z.current);Ze.removeEventListener("mousemove",_e),Ze.removeEventListener("mouseup",ze),Ze.removeEventListener("touchmove",_e),Ze.removeEventListener("touchend",ze)},[ze,_e]);oe.useEffect(()=>{const{current:Ze}=z;return Ze.addEventListener("touchstart",ue,{passive:V_()}),()=>{Ze.removeEventListener("touchstart",ue),Pe()}},[Pe,ue]),oe.useEffect(()=>{l&&Pe()},[l,Pe]);const We=Ze=>ye=>{var tt;if((tt=Ze.onMouseDown)==null||tt.call(Ze,ye),l||ye.defaultPrevented||ye.button!==0)return;ye.preventDefault();const De=Km(ye,_);if(De!==!1){const{newValue:rt,activeIndex:ct}=Se({finger:De});ey({sliderRef:z,activeIndex:ct,setActive:E}),$(rt),Z&&!ty(rt,q)&&Z(ye,rt,ct)}R.current=0;const Ye=M4(z.current);Ye.addEventListener("mousemove",_e,{passive:!0}),Ye.addEventListener("mouseup",ze)},dt=Jm(ee?W[0]:c,c,s),at=Jm(W[W.length-1],c,s)-dt,pt=(Ze={})=>{const ye=fT(Ze),De={onMouseDown:We(ye||{})},Ye={...ye,...De};return{...Ze,ref:ne,...Ye}},jt=Ze=>ye=>{var Ye;(Ye=Ze.onMouseOver)==null||Ye.call(Ze,ye);const De=Number(ye.currentTarget.getAttribute("data-index"));V(De)},d1=Ze=>ye=>{var De;(De=Ze.onMouseLeave)==null||De.call(Ze,ye),V(-1)},lt=(Ze={})=>{const ye=fT(Ze),De={onMouseOver:jt(ye||{}),onMouseLeave:d1(ye||{})};return{...Ze,...ye,...De}},ut=Ze=>({pointerEvents:O!==-1&&O!==Ze?"none":void 0});let e2;return h==="vertical"&&(e2=a?"vertical-rl":"vertical-lr"),{active:O,axis:Ee,axisProps:SJ,dragging:k,focusedThumbIndex:Y,getHiddenInputProps:(Ze={})=>{const ye=fT(Ze),De={onChange:se(ye||{}),onFocus:U(ye||{}),onBlur:de(ye||{}),onKeyDown:he(ye||{})},Ye={...ye,...De};return{tabIndex:L,"aria-labelledby":t,"aria-orientation":h,"aria-valuemax":g(s),"aria-valuemin":g(c),name:u,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:l,...Ze,...Ye,style:{...uJ,direction:a?"rtl":"ltr",width:"100%",height:"100%",writingMode:e2}}},getRootProps:pt,getThumbProps:lt,marks:te,open:A,range:ee,rootRef:ne,trackLeap:at,trackOffset:dt,values:W,getThumbStyle:ut}}const AJ=e=>!e||!z7(e);function _J(e){return It("MuiSlider",e)}const A6=kt("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"]);var OJ={};const CJ=e=>{const{open:t}=e;return{offset:Tt(t&&A6.valueLabelOpen),circle:A6.valueLabelCircle,label:A6.valueLabelLabel}};function D_(e){const{children:t,className:n,value:l}=e,o=CJ(e);return t?oe.cloneElement(t,{className:t.props.className},He.jsxs(oe.Fragment,{children:[t.props.children,He.jsx("span",{className:Tt(o.offset,n),"aria-hidden":!0,children:He.jsx("span",{className:o.circle,children:He.jsx("span",{className:o.label,children:l})})})]})):null}OJ.NODE_ENV!=="production"&&(D_.propTypes={children:M.element.isRequired,className:M.string,value:M.node});var R_={};function k_(e){return e}const wJ=Ke("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${Ge(n.color)}`],n.size!=="medium"&&t[`size${Ge(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(Vt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${A6.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${A6.dragging}`]:{[`& .${A6.thumb}, & .${A6.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(_2()).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}}]}))),VJ=Ke("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}}]}),DJ=Ke("span",{name:"MuiSlider",slot:"Track"})(Vt(({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(_2()).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:Ua(e.palette[t].main,.62),borderColor:Ua(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:$a(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:$a(e.palette[t].main,.5)})}}}))]}))),RJ=Ke("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${Ge(n.color)}`],n.size!=="medium"&&t[`thumbSize${Ge(n.size)}`]]}})(Vt(({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%)"},[`&.${A6.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(_2()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${A6.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${_1(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${A6.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${_1(e.palette[t].main,.16)}`}}}}))]}))),N_=Ke(D_,{name:"MuiSlider",slot:"ValueLabel"})(Vt(({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%"},[`&.${A6.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%"},[`&.${A6.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"}}]})));R_.NODE_ENV!=="production"&&(N_.propTypes={children:M.element.isRequired,index:M.number.isRequired,open:M.bool.isRequired,value:M.node});const kJ=Ke("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Sm(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(Vt(({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}}]}))),NJ=Ke("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Sm(e)&&e!=="markLabelActive"})(Vt(({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}}]}))),BJ=e=>{const{disabled:t,dragging:n,marked:l,orientation:o,track:a,classes:i,color:s,size:c}=e,u={root:["root",t&&"disabled",n&&"dragging",l&&"marked",o==="vertical"&&"vertical",a==="inverted"&&"trackInverted",a===!1&&"trackFalse",s&&`color${Ge(s)}`,c&&`size${Ge(c)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",c&&`thumbSize${Ge(c)}`,s&&`thumbColor${Ge(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ut(u,_J,i)},PJ=({children:e})=>e,B_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiSlider"}),o=_M(),{"aria-label":a,"aria-valuetext":i,"aria-labelledby":s,component:c="span",components:u={},componentsProps:Q={},color:f="primary",classes:h,className:p,disableSwap:g=!1,disabled:v=!1,getAriaLabel:b,getAriaValueText:L,marks:S=!1,max:_=100,min:O=0,name:E,onChange:A,onChangeCommitted:V,orientation:k="horizontal",shiftStep:B=10,size:R="medium",step:F=1,scale:q=k_,slotProps:$,slots:Z,tabIndex:ee,track:W="normal",value:te,valueLabelDisplay:J="off",valueLabelFormat:Y=k_,...I}=l,z={...l,isRtl:o,max:_,min:O,classes:h,disabled:v,disableSwap:g,orientation:k,marks:S,color:f,size:R,step:F,shiftStep:B,scale:q,track:W,valueLabelDisplay:J,valueLabelFormat:Y},{axisProps:ne,getRootProps:U,getHiddenInputProps:de,getThumbProps:me,open:he,active:se,axis:fe,focusedThumbIndex:Ee,range:Se,dragging:_e,marks:ze,values:ue,trackOffset:Pe,trackLeap:We,getThumbStyle:dt}=MJ({...z,rootRef:n});z.marked=ze.length>0&&ze.some(nt=>nt.label),z.dragging=_e,z.focusedThumbIndex=Ee;const at=BJ(z),pt=(Z==null?void 0:Z.root)??u.Root??wJ,jt=(Z==null?void 0:Z.rail)??u.Rail??VJ,d1=(Z==null?void 0:Z.track)??u.Track??DJ,lt=(Z==null?void 0:Z.thumb)??u.Thumb??RJ,ut=(Z==null?void 0:Z.valueLabel)??u.ValueLabel??N_,e2=(Z==null?void 0:Z.mark)??u.Mark??kJ,T1=(Z==null?void 0:Z.markLabel)??u.MarkLabel??NJ,Ze=(Z==null?void 0:Z.input)??u.Input??"input",ye=($==null?void 0:$.root)??Q.root,De=($==null?void 0:$.rail)??Q.rail,Ye=($==null?void 0:$.track)??Q.track,tt=($==null?void 0:$.thumb)??Q.thumb,rt=($==null?void 0:$.valueLabel)??Q.valueLabel,ct=($==null?void 0:$.mark)??Q.mark,i1=($==null?void 0:$.markLabel)??Q.markLabel,_t=($==null?void 0:$.input)??Q.input,h1=Ii({elementType:pt,getSlotProps:U,externalSlotProps:ye,externalForwardedProps:I,additionalProps:{...AJ(pt)&&{as:c}},ownerState:{...z,...ye==null?void 0:ye.ownerState},className:[at.root,p]}),p1=Ii({elementType:jt,externalSlotProps:De,ownerState:z,className:at.rail}),Q1=Ii({elementType:d1,externalSlotProps:Ye,additionalProps:{style:{...ne[fe].offset(Pe),...ne[fe].leap(We)}},ownerState:{...z,...Ye==null?void 0:Ye.ownerState},className:at.track}),G1=Ii({elementType:lt,getSlotProps:me,externalSlotProps:tt,ownerState:{...z,...tt==null?void 0:tt.ownerState},className:at.thumb}),K=Ii({elementType:ut,externalSlotProps:rt,ownerState:{...z,...rt==null?void 0:rt.ownerState},className:at.valueLabel}),pe=Ii({elementType:e2,externalSlotProps:ct,ownerState:z,className:at.mark}),Ue=Ii({elementType:T1,externalSlotProps:i1,ownerState:z,className:at.markLabel}),Je=Ii({elementType:Ze,getSlotProps:de,externalSlotProps:_t,ownerState:z});return He.jsxs(pt,{...h1,children:[He.jsx(jt,{...p1}),He.jsx(d1,{...Q1}),ze.filter(nt=>nt.value>=O&&nt.value<=_).map((nt,mt)=>{const Mt=Jm(nt.value,O,_),Gt=ne[fe].offset(Mt);let xt;return W===!1?xt=ue.includes(nt.value):xt=W==="normal"&&(Se?nt.value>=ue[0]&&nt.value<=ue[ue.length-1]:nt.value<=ue[0])||W==="inverted"&&(Se?nt.value<=ue[0]||nt.value>=ue[ue.length-1]:nt.value>=ue[0]),He.jsxs(oe.Fragment,{children:[He.jsx(e2,{"data-index":mt,...pe,...!z7(e2)&&{markActive:xt},style:{...Gt,...pe.style},className:Tt(pe.className,xt&&at.markActive)}),nt.label!=null?He.jsx(T1,{"aria-hidden":!0,"data-index":mt,...Ue,...!z7(T1)&&{markLabelActive:xt},style:{...Gt,...Ue.style},className:Tt(at.markLabel,Ue.className,xt&&at.markLabelActive),children:nt.label}):null]},mt)}),ue.map((nt,mt)=>{const Mt=Jm(nt,O,_),Gt=ne[fe].offset(Mt),xt=J==="off"?PJ:ut;return He.jsx(xt,{...!z7(xt)&&{valueLabelFormat:Y,valueLabelDisplay:J,value:typeof Y=="function"?Y(q(nt),mt):Y,index:mt,open:he===mt||se===mt||J==="on",disabled:v},...K,children:He.jsx(lt,{"data-index":mt,...G1,className:Tt(at.thumb,G1.className,se===mt&&at.active,Ee===mt&&at.focusVisible),style:{...Gt,...dt(mt),...G1.style},children:He.jsx(Ze,{"data-index":mt,"aria-label":b?b(mt):a,"aria-valuenow":q(nt),"aria-labelledby":s,"aria-valuetext":L?L(q(nt),mt):i,value:ue[mt],...Je})})},mt)})]})});R_.NODE_ENV!=="production"&&(B_.propTypes={"aria-label":Bi(M.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":M.string,"aria-valuetext":Bi(M.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["primary","secondary","error","info","success","warning"]),M.string]),components:M.shape({Input:M.elementType,Mark:M.elementType,MarkLabel:M.elementType,Rail:M.elementType,Root:M.elementType,Thumb:M.elementType,Track:M.elementType,ValueLabel:M.elementType}),componentsProps:M.shape({input:M.oneOfType([M.func,M.object]),mark:M.oneOfType([M.func,M.object]),markLabel:M.oneOfType([M.func,M.object]),rail:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),thumb:M.oneOfType([M.func,M.object]),track:M.oneOfType([M.func,M.object]),valueLabel:M.oneOfType([M.func,M.shape({children:M.element,className:M.string,open:M.bool,style:M.object,value:M.node,valueLabelDisplay:M.oneOf(["auto","off","on"])})])}),defaultValue:M.oneOfType([M.arrayOf(M.number),M.number]),disabled:M.bool,disableSwap:M.bool,getAriaLabel:M.func,getAriaValueText:M.func,marks:M.oneOfType([M.arrayOf(M.shape({label:M.node,value:M.number.isRequired})),M.bool]),max:M.number,min:M.number,name:M.string,onChange:M.func,onChangeCommitted:M.func,orientation:M.oneOf(["horizontal","vertical"]),scale:M.func,shiftStep:M.number,size:M.oneOfType([M.oneOf(["small","medium"]),M.string]),slotProps:M.shape({input:M.oneOfType([M.func,M.object]),mark:M.oneOfType([M.func,M.object]),markLabel:M.oneOfType([M.func,M.object]),rail:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),thumb:M.oneOfType([M.func,M.object]),track:M.oneOfType([M.func,M.object]),valueLabel:M.oneOfType([M.func,M.shape({children:M.element,className:M.string,open:M.bool,style:M.object,value:M.node,valueLabelDisplay:M.oneOf(["auto","off","on"])})])}),slots:M.shape({input:M.elementType,mark:M.elementType,markLabel:M.elementType,rail:M.elementType,root:M.elementType,thumb:M.elementType,track:M.elementType,valueLabel:M.elementType}),step:M.number,sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),tabIndex:M.number,track:M.oneOf(["inverted","normal",!1]),value:M.oneOfType([M.arrayOf(M.number),M.number]),valueLabelDisplay:M.oneOf(["auto","off","on"]),valueLabelFormat:M.oneOfType([M.func,M.string])});function IJ(e){return It("MuiSwitch",e)}const A4=kt("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]);var jJ={};const FJ=e=>{const{classes:t,edge:n,size:l,color:o,checked:a,disabled:i}=e,s={root:["root",n&&`edge${Ge(n)}`,`size${Ge(l)}`],switchBase:["switchBase",`color${Ge(o)}`,a&&"checked",i&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},c=Ut(s,IJ,t);return{...t,...c}},zJ=Ke("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${Ge(n.edge)}`],t[`size${Ge(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${A4.thumb}`]:{width:16,height:16},[`& .${A4.switchBase}`]:{padding:4,[`&.${A4.checked}`]:{transform:"translateX(16px)"}}}}]}),qJ=Ke(qL,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${A4.input}`]:t.input},n.color!=="default"&&t[`color${Ge(n.color)}`]]}})(Vt(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${A4.checked}`]:{transform:"translateX(20px)"},[`&.${A4.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${A4.checked} + .${A4.track}`]:{opacity:.5},[`&.${A4.disabled} + .${A4.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${A4.input}`]:{left:"-100%",width:"300%"}})),Vt(({theme:e})=>({"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(_2(["light"])).map(([t])=>({props:{color:t},style:{[`&.${A4.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:_1(e.palette[t].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${A4.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?Ua(e.palette[t].main,.62):$a(e.palette[t].main,.55)}`}},[`&.${A4.checked} + .${A4.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),$J=Ke("span",{name:"MuiSwitch",slot:"Track"})(Vt(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),UJ=Ke("span",{name:"MuiSwitch",slot:"Thumb"})(Vt(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),P_=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiSwitch"}),{className:o,color:a="primary",edge:i=!1,size:s="medium",sx:c,slots:u={},slotProps:Q={},...f}=l,h={...l,color:a,edge:i,size:s},p=FJ(h),g={slots:u,slotProps:Q},[v,b]=t1("root",{className:Tt(p.root,o),elementType:zJ,externalForwardedProps:g,ownerState:h,additionalProps:{sx:c}}),[L,S]=t1("thumb",{className:p.thumb,elementType:UJ,externalForwardedProps:g,ownerState:h}),_=He.jsx(L,{...S}),[O,E]=t1("track",{className:p.track,elementType:$J,externalForwardedProps:g,ownerState:h});return He.jsxs(v,{...b,children:[He.jsx(qJ,{type:"checkbox",icon:_,checkedIcon:_,ref:n,ownerState:h,...f,classes:{...p,root:p.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...Q.switchBase&&{root:typeof Q.switchBase=="function"?Q.switchBase(h):Q.switchBase},...Q.input&&{input:typeof Q.input=="function"?Q.input(h):Q.input}}}),He.jsx(O,{...E})]})});jJ.NODE_ENV!=="production"&&(P_.propTypes={checked:M.bool,checkedIcon:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["default","primary","secondary","error","info","success","warning"]),M.string]),defaultChecked:M.bool,disabled:M.bool,disableRipple:M.bool,edge:M.oneOf(["end","start",!1]),icon:M.node,id:M.string,inputProps:M.object,inputRef:bn,onChange:M.func,required:M.bool,size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),slotProps:M.shape({input:M.oneOfType([M.func,M.object]),root:M.oneOfType([M.func,M.object]),switchBase:M.oneOfType([M.func,M.object]),thumb:M.oneOfType([M.func,M.object]),track:M.oneOfType([M.func,M.object])}),slots:M.shape({input:M.elementType,root:M.elementType,switchBase:M.elementType,thumb:M.elementType,track:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),value:M.any});function GJ(e){return It("MuiTextField",e)}kt("MuiTextField",["root"]);var I_={};const ZJ={standard:Zm,filled:Um,outlined:Wm},XJ=e=>{const{classes:t}=e;return Ut({root:["root"]},GJ,t)},WJ=Ke(J4,{name:"MuiTextField",slot:"Root"})({}),Wa=oe.forwardRef(function(t,n){const l=e1({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:a=!1,children:i,className:s,color:c="primary",defaultValue:u,disabled:Q=!1,error:f=!1,FormHelperTextProps:h,fullWidth:p=!1,helperText:g,id:v,InputLabelProps:b,inputProps:L,InputProps:S,inputRef:_,label:O,maxRows:E,minRows:A,multiline:V=!1,name:k,onBlur:B,onChange:R,onFocus:F,placeholder:q,required:$=!1,rows:Z,select:ee=!1,SelectProps:W,slots:te={},slotProps:J={},type:Y,value:I,variant:z="outlined",...ne}=l,U={...l,autoFocus:a,color:c,disabled:Q,error:f,fullWidth:p,multiline:V,required:$,select:ee,variant:z},de=XJ(U);I_.NODE_ENV!=="production"&&ee&&!i&&console.error("MUI: `children` must be passed when using the `TextField` component with `select`.");const me=ks(v),he=g&&me?`${me}-helper-text`:void 0,se=O&&me?`${me}-label`:void 0,fe=ZJ[z],Ee={slots:te,slotProps:{input:S,inputLabel:b,htmlInput:L,formHelperText:h,select:W,...J}},Se={},_e=Ee.slotProps.inputLabel;z==="outlined"&&(_e&&typeof _e.shrink<"u"&&(Se.notched=_e.shrink),Se.label=O),ee&&((!W||!W.native)&&(Se.id=void 0),Se["aria-describedby"]=void 0);const[ze,ue]=t1("root",{elementType:WJ,shouldForwardComponentProp:!0,externalForwardedProps:{...Ee,...ne},ownerState:U,className:Tt(de.root,s),ref:n,additionalProps:{disabled:Q,error:f,fullWidth:p,required:$,color:c,variant:z}}),[Pe,We]=t1("input",{elementType:fe,externalForwardedProps:Ee,additionalProps:Se,ownerState:U}),[dt,at]=t1("inputLabel",{elementType:r_,externalForwardedProps:Ee,ownerState:U}),[pt,jt]=t1("htmlInput",{elementType:"input",externalForwardedProps:Ee,ownerState:U}),[d1,lt]=t1("formHelperText",{elementType:WA,externalForwardedProps:Ee,ownerState:U}),[ut,e2]=t1("select",{elementType:Ws,externalForwardedProps:Ee,ownerState:U}),T1=He.jsx(Pe,{"aria-describedby":he,autoComplete:o,autoFocus:a,defaultValue:u,fullWidth:p,multiline:V,name:k,rows:Z,maxRows:E,minRows:A,type:Y,value:I,id:me,inputRef:_,onBlur:B,onChange:R,onFocus:F,placeholder:q,inputProps:jt,slots:{input:te.htmlInput?pt:void 0},...We});return He.jsxs(ze,{...ue,children:[O!=null&&O!==""&&He.jsx(dt,{htmlFor:me,id:se,...at,children:O}),ee?He.jsx(ut,{"aria-describedby":he,id:me,labelId:se,value:I,input:T1,...e2,children:i}):T1,g&&He.jsx(d1,{id:he,...lt,children:g})]})});I_.NODE_ENV!=="production"&&(Wa.propTypes={autoComplete:M.string,autoFocus:M.bool,children:M.node,classes:M.object,className:M.string,color:M.oneOfType([M.oneOf(["primary","secondary","error","info","success","warning"]),M.string]),defaultValue:M.any,disabled:M.bool,error:M.bool,FormHelperTextProps:M.object,fullWidth:M.bool,helperText:M.node,id:M.string,InputLabelProps:M.object,inputProps:M.object,InputProps:M.object,inputRef:bn,label:M.node,margin:M.oneOf(["dense","none","normal"]),maxRows:M.oneOfType([M.number,M.string]),minRows:M.oneOfType([M.number,M.string]),multiline:M.bool,name:M.string,onBlur:M.func,onChange:M.func,onFocus:M.func,placeholder:M.string,required:M.bool,rows:M.oneOfType([M.number,M.string]),select:M.bool,SelectProps:M.object,size:M.oneOfType([M.oneOf(["medium","small"]),M.string]),slotProps:M.shape({formHelperText:M.oneOfType([M.func,M.object]),htmlInput:M.oneOfType([M.func,M.object]),input:M.oneOfType([M.func,M.object]),inputLabel:M.oneOfType([M.func,M.object]),select:M.oneOfType([M.func,M.object])}),slots:M.shape({formHelperText:M.elementType,htmlInput:M.elementType,input:M.elementType,inputLabel:M.elementType,root:M.elementType,select:M.elementType}),sx:M.oneOfType([M.arrayOf(M.oneOfType([M.func,M.object,M.bool])),M.func,M.object]),type:M.string,value:M.any,variant:M.oneOf(["filled","outlined","standard"])});const YJ=({model:e,fontSize:t="small"})=>{if(!e)return Le.createElement(JM,{fontSize:t});switch(e){case"OPENAI":return Le.createElement(B7,{fontSize:t,viewBox:"0 0 24 24"},Le.createElement("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.78.78 0 0 0 .78 0l5.843-3.369v2.332a.074.074 0 0 1-.028.057l-4.832 2.795a4.504 4.504 0 0 1-6.153-1.645zm-.856-8.246a4.476 4.476 0 0 1 2.346-1.973l-.004.162v5.517a.787.787 0 0 0 .392.681l5.843 3.369-2.02 1.168a.069.069 0 0 1-.066 0l-4.827-2.79a4.504 4.504 0 0 1-1.664-6.134zm16.008 3.73-5.843-3.369 2.02-1.168a.07.07 0 0 1 .066 0l4.827 2.79a4.494 4.494 0 0 1-1.12 8.107v-5.517a.795.795 0 0 0-.397-.681zm2.253-3.395a4.47 4.47 0 0 1-.535.983l-.142-.085-4.779-2.759a.78.78 0 0 0-.78 0L8.927 11.9V9.569a.07.07 0 0 1 .028-.057l4.827-2.79a4.504 4.504 0 0 1 6.682 2.771zm-12.35 3.369-2.02-1.168a.067.067 0 0 1-.037-.052V7.967a4.504 4.504 0 0 1 7.37-3.454l-.142.081-4.779 2.759a.795.795 0 0 0-.392.681zm1.069-2.332 2.606-1.507 2.606 1.507v3.014l-2.606 1.507-2.606-1.507z"}));case"ANTHROPIC_CLAUDE":return Le.createElement(B7,{fontSize:t,viewBox:"0 0 24 24"},Le.createElement("path",{d:"M15.5 2.25a4.25 4.25 0 0 0-4.25 4.25h-2.5A6.75 6.75 0 0 1 15.5 0h2.5v2.25zM2.25 8.5A4.25 4.25 0 0 0 6.5 12.75v2.5A6.75 6.75 0 0 1 0 8.5v-2.5h2.25zM8.5 21.75a4.25 4.25 0 0 0 4.25-4.25h2.5A6.75 6.75 0 0 1 8.5 24H6v-2.25zM21.75 15.5a4.25 4.25 0 0 0-4.25-4.25v-2.5A6.75 6.75 0 0 1 24 15.5V18h-2.25z"}),Le.createElement("path",{d:"M12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 8a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"}));case"GOOGLE_GEMINI":return Le.createElement(B7,{fontSize:t,viewBox:"0 0 24 24"},Le.createElement("path",{d:"M4 12c0-4.41 3.59-8 8-8s8 3.59 8 8-3.59 8-8 8-8-3.59-8-8m8-10c-5.51 0-10 4.49-10 10s4.49 10 10 10 10-4.49 10-10S17.51 2 12 2m2.5 10c0 1.38-1.12 2.5-2.5 2.5S9.5 13.38 9.5 12 10.62 9.5 12 9.5s2.5 1.12 2.5 2.5M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6m0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4"}));default:return Le.createElement(JM,{fontSize:t})}},KJ=({enabledModels:e})=>{const t=Pa("settings"),n=Pa("chat"),l=t.state,o=(s,c)=>{const u=t.state,Q={...u,llm:{...u.llm,models:{...u.llm.models,[s]:{...u.llm.models[s],version:c,enabled:!0}}}};t.saveSettings(Q),n.loadInitialMessage()},a=s=>{const c=zc[s],u=c.labels;return c.options.map(Q=>{const f=Q;return{label:u[f],value:f}})},i=s=>{const c=zc[s],u=l.llm.models[s].version,Q=c.options;return!u||!Q.includes(u)?c.default:u};return Le.createElement(Pr,{sx:{mt:2,display:"flex",flexDirection:"column",gap:1}},e.map(s=>Le.createElement(Pr,{key:s.modelKey,sx:{display:"flex",alignItems:"center",gap:1}},Le.createElement(K3,{variant:"body2",sx:{minWidth:100}},s.name,":"),Le.createElement(J4,{size:"small",sx:{minWidth:200}},Le.createElement(Ws,{value:i(s.modelKey),onChange:c=>o(s.modelKey,c.target.value),"aria-label":`Select ${s.name} version`,MenuProps:{disablePortal:!0,PaperProps:{sx:{maxHeight:200}}}},a(s.modelKey).map(c=>Le.createElement(U7,{key:c.value,value:c.value},c.label)))))))};function poe(){}function moe(){}function j_(e){const t=[],n=String(e||"");let l=n.indexOf(","),o=0,a=!1;for(;!a;){l===-1&&(l=n.length,a=!0);const i=n.slice(o,l).trim();(i||!a)&&t.push(i),o=l+1,l=n.indexOf(",",o)}return t}function JJ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eee=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tee=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nee={};function F_(e,t){return(nee.jsx?tee:eee).test(e)}const ree=/[ \t\n\f\r]/g;function iee(e){return typeof e=="object"?e.type==="text"?z_(e.value):!1:z_(e)}function z_(e){return e.replace(ree,"")===""}class AT{constructor(t,n,l){this.normal=n,this.property=t,l&&(this.space=l)}}AT.prototype.normal={},AT.prototype.property={},AT.prototype.space=void 0;function q_(e,t){const n={},l={};for(const o of e)Object.assign(n,o.property),Object.assign(l,o.normal);return new AT(n,l,t)}function _T(e){return e.toLowerCase()}class en{constructor(t,n){this.attribute=n,this.property=t}}en.prototype.attribute="",en.prototype.booleanish=!1,en.prototype.boolean=!1,en.prototype.commaOrSpaceSeparated=!1,en.prototype.commaSeparated=!1,en.prototype.defined=!1,en.prototype.mustUseProperty=!1,en.prototype.number=!1,en.prototype.overloadedBoolean=!1,en.prototype.property="",en.prototype.spaceSeparated=!1,en.prototype.space=void 0;let aee=0;const Xt=G7(),W2=G7(),lx=G7(),et=G7(),s2=G7(),Ks=G7(),Hn=G7();function G7(){return 2**++aee}const sx=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xt,booleanish:W2,commaOrSpaceSeparated:Hn,commaSeparated:Ks,number:et,overloadedBoolean:lx,spaceSeparated:s2},Symbol.toStringTag,{value:"Module"})),ux=Object.keys(sx);class cx extends en{constructor(t,n,l,o){let a=-1;if(super(t,n),$_(this,"space",o),typeof l=="number")for(;++a<ux.length;){const i=ux[a];$_(this,ux[a],(l&sx[i])===sx[i])}}}cx.prototype.defined=!0;function $_(e,t,n){n&&(e[t]=n)}function Js(e){const t={},n={};for(const[l,o]of Object.entries(e.properties)){const a=new cx(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(a.mustUseProperty=!0),t[l]=a,n[_T(l)]=l,n[_T(a.attribute)]=l}return new AT(t,n,e.space)}const U_=Js({properties:{ariaActiveDescendant:null,ariaAtomic:W2,ariaAutoComplete:null,ariaBusy:W2,ariaChecked:W2,ariaColCount:et,ariaColIndex:et,ariaColSpan:et,ariaControls:s2,ariaCurrent:null,ariaDescribedBy:s2,ariaDetails:null,ariaDisabled:W2,ariaDropEffect:s2,ariaErrorMessage:null,ariaExpanded:W2,ariaFlowTo:s2,ariaGrabbed:W2,ariaHasPopup:null,ariaHidden:W2,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:s2,ariaLevel:et,ariaLive:null,ariaModal:W2,ariaMultiLine:W2,ariaMultiSelectable:W2,ariaOrientation:null,ariaOwns:s2,ariaPlaceholder:null,ariaPosInSet:et,ariaPressed:W2,ariaReadOnly:W2,ariaRelevant:null,ariaRequired:W2,ariaRoleDescription:s2,ariaRowCount:et,ariaRowIndex:et,ariaRowSpan:et,ariaSelected:W2,ariaSetSize:et,ariaSort:null,ariaValueMax:et,ariaValueMin:et,ariaValueNow:et,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function G_(e,t){return t in e?e[t]:t}function Z_(e,t){return G_(e,t.toLowerCase())}const oee=Js({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ks,acceptCharset:s2,accessKey:s2,action:null,allow:null,allowFullScreen:Xt,allowPaymentRequest:Xt,allowUserMedia:Xt,alt:null,as:null,async:Xt,autoCapitalize:null,autoComplete:s2,autoFocus:Xt,autoPlay:Xt,blocking:s2,capture:null,charSet:null,checked:Xt,cite:null,className:s2,cols:et,colSpan:null,content:null,contentEditable:W2,controls:Xt,controlsList:s2,coords:et|Ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xt,defer:Xt,dir:null,dirName:null,disabled:Xt,download:lx,draggable:W2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xt,formTarget:null,headers:s2,height:et,hidden:lx,high:et,href:null,hrefLang:null,htmlFor:s2,httpEquiv:s2,id:null,imageSizes:null,imageSrcSet:null,inert:Xt,inputMode:null,integrity:null,is:null,isMap:Xt,itemId:null,itemProp:s2,itemRef:s2,itemScope:Xt,itemType:s2,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xt,low:et,manifest:null,max:null,maxLength:et,media:null,method:null,min:null,minLength:et,multiple:Xt,muted:Xt,name:null,nonce:null,noModule:Xt,noValidate:Xt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xt,optimum:et,pattern:null,ping:s2,placeholder:null,playsInline:Xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xt,referrerPolicy:null,rel:s2,required:Xt,reversed:Xt,rows:et,rowSpan:et,sandbox:s2,scope:null,scoped:Xt,seamless:Xt,selected:Xt,shadowRootClonable:Xt,shadowRootDelegatesFocus:Xt,shadowRootMode:null,shape:null,size:et,sizes:null,slot:null,span:et,spellCheck:W2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:et,step:null,style:null,tabIndex:et,target:null,title:null,translate:null,type:null,typeMustMatch:Xt,useMap:null,value:W2,width:et,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:s2,axis:null,background:null,bgColor:null,border:et,borderColor:null,bottomMargin:et,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xt,declare:Xt,event:null,face:null,frame:null,frameBorder:null,hSpace:et,leftMargin:et,link:null,longDesc:null,lowSrc:null,marginHeight:et,marginWidth:et,noResize:Xt,noHref:Xt,noShade:Xt,noWrap:Xt,object:null,profile:null,prompt:null,rev:null,rightMargin:et,rules:null,scheme:null,scrolling:W2,standby:null,summary:null,text:null,topMargin:et,valueType:null,version:null,vAlign:null,vLink:null,vSpace:et,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xt,disableRemotePlayback:Xt,prefix:null,property:null,results:et,security:null,unselectable:null},space:"html",transform:Z_}),lee=Js({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Hn,accentHeight:et,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:et,amplitude:et,arabicForm:null,ascent:et,attributeName:null,attributeType:null,azimuth:et,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:et,by:null,calcMode:null,capHeight:et,className:s2,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:et,diffuseConstant:et,direction:null,display:null,dur:null,divisor:et,dominantBaseline:null,download:Xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:et,enableBackground:null,end:null,event:null,exponent:et,externalResourcesRequired:null,fill:null,fillOpacity:et,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ks,g2:Ks,glyphName:Ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:et,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:et,horizOriginX:et,horizOriginY:et,id:null,ideographic:et,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:et,k:et,k1:et,k2:et,k3:et,k4:et,kernelMatrix:Hn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:et,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:et,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:et,overlineThickness:et,paintOrder:null,panose1:null,path:null,pathLength:et,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:s2,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:et,pointsAtY:et,pointsAtZ:et,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hn,rev:Hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hn,requiredFeatures:Hn,requiredFonts:Hn,requiredFormats:Hn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:et,specularExponent:et,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:et,strikethroughThickness:et,string:null,stroke:null,strokeDashArray:Hn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:et,strokeOpacity:et,strokeWidth:null,style:null,surfaceScale:et,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hn,tabIndex:et,tableValues:null,target:null,targetX:et,targetY:et,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:et,underlineThickness:et,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:et,values:null,vAlphabetic:et,vMathematical:et,vectorEffect:null,vHanging:et,vIdeographic:et,version:null,vertAdvY:et,vertOriginX:et,vertOriginY:et,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:et,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:G_}),X_=Js({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),W_=Js({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Z_}),Y_=Js({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),see={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},uee=/[A-Z]/g,K_=/-[a-z]/g,cee=/^data[-\w.:]+$/i;function J_(e,t){const n=_T(t);let l=t,o=en;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&cee.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(K_,Qee);l="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!K_.test(a)){let i=a.replace(uee,Tee);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=cx}return new o(l,t)}function Tee(e){return"-"+e.toLowerCase()}function Qee(e){return e.charAt(1).toUpperCase()}const eO=q_([U_,oee,X_,W_,Y_],"html"),ry=q_([U_,lee,X_,W_,Y_],"svg");function tO(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function fee(e){return e.join(" ").trim()}var e9={},Tx,nO;function dee(){if(nO)return Tx;nO=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
335
335
  `,u="/",Q="*",f="",h="comment",p="declaration";Tx=function(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var L=1,S=1;function _($){var Z=$.match(t);Z&&(L+=Z.length);var ee=$.lastIndexOf(c);S=~ee?$.length-ee:S+$.length}function O(){var $={line:L,column:S};return function(Z){return Z.position=new E($),k(),Z}}function E($){this.start=$,this.end={line:L,column:S},this.source=b.source}E.prototype.content=v;function A($){var Z=new Error(b.source+":"+L+":"+S+": "+$);if(Z.reason=$,Z.filename=b.source,Z.line=L,Z.column=S,Z.source=v,!b.silent)throw Z}function V($){var Z=$.exec(v);if(Z){var ee=Z[0];return _(ee),v=v.slice(ee.length),Z}}function k(){V(n)}function B($){var Z;for($=$||[];Z=R();)Z!==!1&&$.push(Z);return $}function R(){var $=O();if(!(u!=v.charAt(0)||Q!=v.charAt(1))){for(var Z=2;f!=v.charAt(Z)&&(Q!=v.charAt(Z)||u!=v.charAt(Z+1));)++Z;if(Z+=2,f===v.charAt(Z-1))return A("End of comment missing");var ee=v.slice(2,Z-2);return S+=2,_(ee),v=v.slice(Z),S+=2,$({type:h,comment:ee})}}function F(){var $=O(),Z=V(l);if(Z){if(R(),!V(o))return A("property missing ':'");var ee=V(a),W=$({type:p,property:g(Z[0].replace(e,f)),value:ee?g(ee[0].replace(e,f)):f});return V(i),W}}function q(){var $=[];B($);for(var Z;Z=F();)Z!==!1&&($.push(Z),B($));return $}return k(),q()};function g(v){return v?v.replace(s,f):f}return Tx}var rO;function hee(){if(rO)return e9;rO=1;var e=e9&&e9.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e9,"__esModule",{value:!0}),e9.default=n;var t=e(dee());function n(l,o){var a=null;if(!l||typeof l!="string")return a;var i=(0,t.default)(l),s=typeof o=="function";return i.forEach(function(c){if(c.type==="declaration"){var u=c.property,Q=c.value;s?o(u,Q,c):Q&&(a=a||{},a[u]=Q)}}),a}return e9}var OT={},iO;function pee(){if(iO)return OT;iO=1,Object.defineProperty(OT,"__esModule",{value:!0}),OT.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(u){return!u||n.test(u)||e.test(u)},i=function(u,Q){return Q.toUpperCase()},s=function(u,Q){return"".concat(Q,"-")},c=function(u,Q){return Q===void 0&&(Q={}),a(u)?u:(u=u.toLowerCase(),Q.reactCompat?u=u.replace(o,s):u=u.replace(l,s),u.replace(t,i))};return OT.camelCase=c,OT}var CT,aO;function mee(){if(aO)return CT;aO=1;var e=CT&&CT.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(hee()),n=pee();function l(o,a){var i={};return!o||typeof o!="string"||(0,t.default)(o,function(s,c){s&&c&&(i[(0,n.camelCase)(s,a)]=c)}),i}return l.default=l,CT=l,CT}var yee=mee();const gee=kc(yee),oO=lO("end"),Qx=lO("start");function lO(e){return t;function t(n){const l=n&&n.position&&n.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function sO(e){const t=Qx(e),n=oO(e);if(t&&n)return{start:t,end:n}}function wT(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?uO(e.position):"start"in e||"end"in e?uO(e):"line"in e||"column"in e?fx(e):""}function fx(e){return cO(e&&e.line)+":"+cO(e&&e.column)}function uO(e){return fx(e&&e.start)+"-"+fx(e&&e.end)}function cO(e){return e&&typeof e=="number"?e:1}class J3 extends Error{constructor(t,n,l){super(),typeof n=="string"&&(l=n,n=void 0);let o="",a={},i=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?o=t:!a.cause&&t&&(i=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?a.ruleId=l:(a.source=l.slice(0,c),a.ruleId=l.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=s?s.line:void 0,this.name=wT(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}J3.prototype.file="",J3.prototype.name="",J3.prototype.reason="",J3.prototype.message="",J3.prototype.stack="",J3.prototype.column=void 0,J3.prototype.line=void 0,J3.prototype.ancestors=void 0,J3.prototype.cause=void 0,J3.prototype.fatal=void 0,J3.prototype.place=void 0,J3.prototype.ruleId=void 0,J3.prototype.source=void 0;const dx={}.hasOwnProperty,vee=new Map,Lee=/[A-Z]/g,xee=new Set(["table","tbody","thead","tfoot","tr"]),bee=new Set(["td","th"]),TO="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hee(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let l;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=wee(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=Cee(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:l,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ry:eO,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=QO(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function QO(e,t,n){if(t.type==="element")return See(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Eee(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Aee(e,t,n);if(t.type==="mdxjsEsm")return Mee(e,t);if(t.type==="root")return _ee(e,t,n);if(t.type==="text")return Oee(e,t)}function See(e,t,n){const l=e.schema;let o=l;t.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=ry,e.schema=o),e.ancestors.push(t);const a=dO(e,t.tagName,!1),i=Vee(e,t);let s=px(e,t);return xee.has(t.tagName)&&(s=s.filter(function(c){return typeof c=="string"?!iee(c):!0})),fO(e,i,a,t),hx(i,s),e.ancestors.pop(),e.schema=l,e.create(t,a,i,n)}function Eee(e,t){if(t.data&&t.data.estree&&e.evaluater){const l=t.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}VT(e,t.position)}function Mee(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);VT(e,t.position)}function Aee(e,t,n){const l=e.schema;let o=l;t.name==="svg"&&l.space==="html"&&(o=ry,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:dO(e,t.name,!0),i=Dee(e,t),s=px(e,t);return fO(e,i,a,t),hx(i,s),e.ancestors.pop(),e.schema=l,e.create(t,a,i,n)}function _ee(e,t,n){const l={};return hx(l,px(e,t)),e.create(t,e.Fragment,l,n)}function Oee(e,t){return t.value}function fO(e,t,n,l){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=l)}function hx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Cee(e,t,n){return l;function l(o,a,i,s){const u=Array.isArray(i.children)?n:t;return s?u(a,i,s):u(a,i)}}function wee(e,t){return n;function n(l,o,a,i){const s=Array.isArray(a.children),c=Qx(l);return t(o,a,i,s,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Vee(e,t){const n={};let l,o;for(o in t.properties)if(o!=="children"&&dx.call(t.properties,o)){const a=Ree(e,o,t.properties[o]);if(a){const[i,s]=a;e.tableCellAlignToStyle&&i==="align"&&typeof s=="string"&&bee.has(t.tagName)?l=s:n[i]=s}}if(l){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return n}function Dee(e,t){const n={};for(const l of t.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const a=l.data.estree.body[0];a.type;const i=a.expression;i.type;const s=i.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else VT(e,t.position);else{const o=l.name;let a;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const s=l.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else VT(e,t.position);else a=l.value===null?!0:l.value;n[o]=a}return n}function px(e,t){const n=[];let l=-1;const o=e.passKeys?new Map:vee;for(;++l<t.children.length;){const a=t.children[l];let i;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=o.get(c)||0;i=c+"-"+u,o.set(c,u+1)}}const s=QO(e,a,i);s!==void 0&&n.push(s)}return n}function Ree(e,t,n){const l=J_(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=l.commaSeparated?JJ(n):fee(n)),l.property==="style"){let o=typeof n=="object"?n:kee(e,String(n));return e.stylePropertyNameCase==="css"&&(o=Nee(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?see[l.property]||l.property:l.attribute,n]}}function kee(e,t){try{return gee(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const l=n,o=new J3("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=TO+"#cannot-parse-style-attribute",o}}function dO(e,t,n){let l;if(!n)l={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,i;for(;++a<o.length;){const s=F_(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};i=i?{type:"MemberExpression",object:i,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}l=i}else l=F_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(l.type==="Literal"){const o=l.value;return dx.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);VT(e)}function VT(e,t){const n=new J3("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=TO+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Nee(e){const t={};let n;for(n in e)dx.call(e,n)&&(t[Bee(n)]=e[n]);return t}function Bee(e){let t=e.replace(Lee,Pee);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Pee(e){return"-"+e.toLowerCase()}const mx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Iee={};function yx(e,t){const n=Iee,l=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hO(e,l,o)}function hO(e,t,n){if(jee(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return pO(e.children,t,n)}return Array.isArray(e)?pO(e,t,n):""}function pO(e,t,n){const l=[];let o=-1;for(;++o<e.length;)l[o]=hO(e[o],t,n);return l.join("")}function jee(e){return!!(e&&typeof e=="object")}const mO=document.createElement("i");function gx(e){const t="&"+e+";";mO.innerHTML=t;const n=mO.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Sn(e,t,n,l){const o=e.length;let a=0,i;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,l.length<1e4)i=Array.from(l),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<l.length;)i=l.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function _6(e,t){return e.length>0?(Sn(e,e.length,0,t),e):t}const yO={}.hasOwnProperty;function gO(e){const t={};let n=-1;for(;++n<e.length;)Fee(t,e[n]);return t}function Fee(e,t){let n;for(n in t){const o=(yO.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let i;if(a)for(i in a){yO.call(o,i)||(o[i]=[]);const s=a[i];zee(o[i],Array.isArray(s)?s:s?[s]:[])}}}function zee(e,t){let n=-1;const l=[];for(;++n<t.length;)(t[n].add==="after"?e:l).push(t[n]);Sn(e,0,0,l)}function vO(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function f5(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _4=Ya(/[A-Za-z]/),e4=Ya(/[\dA-Za-z]/),qee=Ya(/[#-'*+\--9=?A-Z^-~]/);function iy(e){return e!==null&&(e<32||e===127)}const vx=Ya(/\d/),$ee=Ya(/[\dA-Fa-f]/),Uee=Ya(/[!-/:-@[-`{-~]/);function gt(e){return e!==null&&e<-2}function K1(e){return e!==null&&(e<0||e===32)}function l1(e){return e===-2||e===-1||e===32}const ay=Ya(new RegExp("\\p{P}|\\p{S}","u")),Z7=Ya(/\s/);function Ya(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function t9(e){const t=[];let n=-1,l=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let i="";if(a===37&&e4(e.charCodeAt(n+1))&&e4(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(i=String.fromCharCode(a,s),o=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(l,n),encodeURIComponent(i)),l=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(l)}function r1(e,t,n,l){const o=l?l-1:Number.POSITIVE_INFINITY;let a=0;return i;function i(c){return l1(c)?(e.enter(n),s(c)):t(c)}function s(c){return l1(c)&&a++<o?(e.consume(c),s):(e.exit(n),t(c))}}const Gee={tokenize:Zee};function Zee(e){const t=e.attempt(this.parser.constructs.contentInitial,l,o);let n;return t;function l(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r1(e,t,"linePrefix")}function o(s){return e.enter("paragraph"),a(s)}function a(s){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,i(s)}function i(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return gt(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),i)}}const Xee={tokenize:Wee},LO={tokenize:Yee};function Wee(e){const t=this,n=[];let l=0,o,a,i;return s;function s(_){if(l<n.length){const O=n[l];return t.containerState=O[1],e.attempt(O[0].continuation,c,u)(_)}return u(_)}function c(_){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&S();const O=t.events.length;let E=O,A;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){A=t.events[E][1].end;break}L(l);let V=O;for(;V<t.events.length;)t.events[V][1].end={...A},V++;return Sn(t.events,E+1,0,t.events.slice(O)),t.events.length=V,u(_)}return s(_)}function u(_){if(l===n.length){if(!o)return h(_);if(o.currentConstruct&&o.currentConstruct.concrete)return g(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(LO,Q,f)(_)}function Q(_){return o&&S(),L(l),h(_)}function f(_){return t.parser.lazy[t.now().line]=l!==n.length,i=t.now().offset,g(_)}function h(_){return t.containerState={},e.attempt(LO,p,g)(_)}function p(_){return l++,n.push([t.currentConstruct,t.containerState]),h(_)}function g(_){if(_===null){o&&S(),L(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),v(_)}function v(_){if(_===null){b(e.exit("chunkFlow"),!0),L(0),e.consume(_);return}return gt(_)?(e.consume(_),b(e.exit("chunkFlow")),l=0,t.interrupt=void 0,s):(e.consume(_),v)}function b(_,O){const E=t.sliceStream(_);if(O&&E.push(null),_.previous=a,a&&(a.next=_),a=_,o.defineSkip(_.start),o.write(E),t.parser.lazy[_.start.line]){let A=o.events.length;for(;A--;)if(o.events[A][1].start.offset<i&&(!o.events[A][1].end||o.events[A][1].end.offset>i))return;const V=t.events.length;let k=V,B,R;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(B){R=t.events[k][1].end;break}B=!0}for(L(l),A=V;A<t.events.length;)t.events[A][1].end={...R},A++;Sn(t.events,k+1,0,t.events.slice(V)),t.events.length=A}}function L(_){let O=n.length;for(;O-- >_;){const E=n[O];t.containerState=E[1],E[0].exit.call(t,e)}n.length=_}function S(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Yee(e,t,n){return r1(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function n9(e){if(e===null||K1(e)||Z7(e))return 1;if(ay(e))return 2}function oy(e,t,n){const l=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!l.includes(a)&&(t=a(t,n),l.push(a))}return t}const Lx={name:"attention",resolveAll:Kee,tokenize:Jee};function Kee(e,t){let n=-1,l,o,a,i,s,c,u,Q;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(l=n;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&t.sliceSerialize(e[l][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[l][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[l][1].end.offset-e[l][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[l][1].end},h={...e[n][1].start};xO(f,-c),xO(h,c),i={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[l][1].end}},s={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:c>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[n][1].start}},o={type:c>1?"strong":"emphasis",start:{...i.start},end:{...s.end}},e[l][1].end={...i.start},e[n][1].start={...s.end},u=[],e[l][1].end.offset-e[l][1].start.offset&&(u=_6(u,[["enter",e[l][1],t],["exit",e[l][1],t]])),u=_6(u,[["enter",o,t],["enter",i,t],["exit",i,t],["enter",a,t]]),u=_6(u,oy(t.parser.constructs.insideSpan.null,e.slice(l+1,n),t)),u=_6(u,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(Q=2,u=_6(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):Q=0,Sn(e,l-1,n-l+3,u),n=l+u.length-Q-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Jee(e,t){const n=this.parser.constructs.attentionMarkers.null,l=this.previous,o=n9(l);let a;return i;function i(c){return a=c,e.enter("attentionSequence"),s(c)}function s(c){if(c===a)return e.consume(c),s;const u=e.exit("attentionSequence"),Q=n9(c),f=!Q||Q===2&&o||n.includes(c),h=!o||o===2&&Q||n.includes(l);return u._open=!!(a===42?f:f&&(o||!h)),u._close=!!(a===42?h:h&&(Q||!f)),t(c)}}function xO(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ete={name:"autolink",tokenize:tte};function tte(e,t,n){let l=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return _4(p)?(e.consume(p),i):p===64?n(p):u(p)}function i(p){return p===43||p===45||p===46||e4(p)?(l=1,s(p)):u(p)}function s(p){return p===58?(e.consume(p),l=0,c):(p===43||p===45||p===46||e4(p))&&l++<32?(e.consume(p),s):(l=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||iy(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),Q):qee(p)?(e.consume(p),u):n(p)}function Q(p){return e4(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),l=0,Q):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||e4(p))&&l++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const DT={partial:!0,tokenize:nte};function nte(e,t,n){return l;function l(a){return l1(a)?r1(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||gt(a)?t(a):n(a)}}const bO={continuation:{tokenize:ite},exit:ate,name:"blockQuote",tokenize:rte};function rte(e,t,n){const l=this;return o;function o(i){if(i===62){const s=l.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),a}return n(i)}function a(i){return l1(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function ite(e,t,n){const l=this;return o;function o(i){return l1(i)?r1(e,a,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return e.attempt(bO,t,n)(i)}}function ate(e){e.exit("blockQuote")}const HO={name:"characterEscape",tokenize:ote};function ote(e,t,n){return l;function l(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return Uee(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const SO={name:"characterReference",tokenize:lte};function lte(e,t,n){const l=this;let o=0,a,i;return s;function s(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,i=e4,Q(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,i=$ee,Q):(e.enter("characterReferenceValue"),a=7,i=vx,Q(f))}function Q(f){if(f===59&&o){const h=e.exit("characterReferenceValue");return i===e4&&!gx(l.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(f)&&o++<a?(e.consume(f),Q):n(f)}}const EO={partial:!0,tokenize:ute},MO={concrete:!0,name:"codeFenced",tokenize:ste};function ste(e,t,n){const l=this,o={partial:!0,tokenize:E};let a=0,i=0,s;return c;function c(A){return u(A)}function u(A){const V=l.events[l.events.length-1];return a=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,s=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),Q(A)}function Q(A){return A===s?(i++,e.consume(A),Q):i<3?n(A):(e.exit("codeFencedFenceSequence"),l1(A)?r1(e,f,"whitespace")(A):f(A))}function f(A){return A===null||gt(A)?(e.exit("codeFencedFence"),l.interrupt?t(A):e.check(EO,v,O)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(A))}function h(A){return A===null||gt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(A)):l1(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),r1(e,p,"whitespace")(A)):A===96&&A===s?n(A):(e.consume(A),h)}function p(A){return A===null||gt(A)?f(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||gt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(A)):A===96&&A===s?n(A):(e.consume(A),g)}function v(A){return e.attempt(o,O,b)(A)}function b(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),L}function L(A){return a>0&&l1(A)?r1(e,S,"linePrefix",a+1)(A):S(A)}function S(A){return A===null||gt(A)?e.check(EO,v,O)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||gt(A)?(e.exit("codeFlowValue"),S(A)):(e.consume(A),_)}function O(A){return e.exit("codeFenced"),t(A)}function E(A,V,k){let B=0;return R;function R(ee){return A.enter("lineEnding"),A.consume(ee),A.exit("lineEnding"),F}function F(ee){return A.enter("codeFencedFence"),l1(ee)?r1(A,q,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):q(ee)}function q(ee){return ee===s?(A.enter("codeFencedFenceSequence"),$(ee)):k(ee)}function $(ee){return ee===s?(B++,A.consume(ee),$):B>=i?(A.exit("codeFencedFenceSequence"),l1(ee)?r1(A,Z,"whitespace")(ee):Z(ee)):k(ee)}function Z(ee){return ee===null||gt(ee)?(A.exit("codeFencedFence"),V(ee)):k(ee)}}}function ute(e,t,n){const l=this;return o;function o(i){return i===null?n(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a)}function a(i){return l.parser.lazy[l.now().line]?n(i):t(i)}}const xx={name:"codeIndented",tokenize:Tte},cte={partial:!0,tokenize:Qte};function Tte(e,t,n){const l=this;return o;function o(u){return e.enter("codeIndented"),r1(e,a,"linePrefix",5)(u)}function a(u){const Q=l.events[l.events.length-1];return Q&&Q[1].type==="linePrefix"&&Q[2].sliceSerialize(Q[1],!0).length>=4?i(u):n(u)}function i(u){return u===null?c(u):gt(u)?e.attempt(cte,i,c)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||gt(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),s)}function c(u){return e.exit("codeIndented"),t(u)}}function Qte(e,t,n){const l=this;return o;function o(i){return l.parser.lazy[l.now().line]?n(i):gt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):r1(e,a,"linePrefix",5)(i)}function a(i){const s=l.events[l.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):gt(i)?o(i):n(i)}}const fte={name:"codeText",previous:hte,resolve:dte,tokenize:pte};function dte(e){let t=e.length-4,n=3,l,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(l=n;++l<t;)if(e[l][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(l=n-1,t++;++l<=t;)o===void 0?l!==t&&e[l][1].type!=="lineEnding"&&(o=l):(l===t||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),t-=l-o-2,l=o+2),o=void 0);return e}function hte(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pte(e,t,n){let l=0,o,a;return i;function i(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),l++,s):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(a=e.enter("codeTextSequence"),o=0,Q(f)):gt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||gt(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function Q(f){return f===96?(e.consume(f),o++,Q):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}class mte{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const l=n??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(t,l):t>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(t,n,l){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&RT(this.left,l),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),RT(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),RT(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);RT(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);RT(this.left,n.reverse())}}}function RT(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function AO(e){const t={};let n=-1,l,o,a,i,s,c,u;const Q=new mte(e);for(;++n<Q.length;){for(;n in t;)n=t[n];if(l=Q.get(n),n&&l[1].type==="chunkFlow"&&Q.get(n-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(l[0]==="enter")l[1].contentType&&(Object.assign(t,yte(Q,n)),n=t[n],u=!0);else if(l[1]._container){for(a=n,o=void 0;a--;)if(i=Q.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(o&&(Q.get(o)[1].type="lineEndingBlank"),i[1].type="lineEnding",o=a);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;o&&(l[1].end={...Q.get(o)[1].start},s=Q.slice(o,n),s.unshift(l),Q.splice(o,n-o+1,s))}}return Sn(e,0,Number.POSITIVE_INFINITY,Q.slice(0)),!u}function yte(e,t){const n=e.get(t)[1],l=e.get(t)[2];let o=t-1;const a=[];let i=n._tokenizer;i||(i=l.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const s=i.events,c=[],u={};let Q,f,h=-1,p=n,g=0,v=0;const b=[v];for(;p;){for(;e.get(++o)[1]!==p;);a.push(o),p._tokenizer||(Q=l.sliceStream(p),p.next||Q.push(null),f&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(Q),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(v=h+1,b.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),h=b.length;h--;){const L=s.slice(b[h],b[h+1]),S=a.pop();c.push([S,S+L.length-1]),e.splice(S,2,L)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const gte={resolve:Lte,tokenize:xte},vte={partial:!0,tokenize:bte};function Lte(e){return AO(e),e}function xte(e,t){let n;return l;function l(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(s)}function o(s){return s===null?a(s):gt(s)?e.check(vte,i,a)(s):(e.consume(s),o)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function i(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function bte(e,t,n){const l=this;return o;function o(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r1(e,a,"linePrefix")}function a(i){if(i===null||gt(i))return n(i);const s=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(i):e.interrupt(l.parser.constructs.flow,n,t)(i)}}function _O(e,t,n,l,o,a,i,s,c){const u=c||Number.POSITIVE_INFINITY;let Q=0;return f;function f(L){return L===60?(e.enter(l),e.enter(o),e.enter(a),e.consume(L),e.exit(a),h):L===null||L===32||L===41||iy(L)?n(L):(e.enter(l),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(L))}function h(L){return L===62?(e.enter(a),e.consume(L),e.exit(a),e.exit(o),e.exit(l),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(L))}function p(L){return L===62?(e.exit("chunkString"),e.exit(s),h(L)):L===null||L===60||gt(L)?n(L):(e.consume(L),L===92?g:p)}function g(L){return L===60||L===62||L===92?(e.consume(L),p):p(L)}function v(L){return!Q&&(L===null||L===41||K1(L))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(l),t(L)):Q<u&&L===40?(e.consume(L),Q++,v):L===41?(e.consume(L),Q--,v):L===null||L===32||L===40||iy(L)?n(L):(e.consume(L),L===92?b:v)}function b(L){return L===40||L===41||L===92?(e.consume(L),v):v(L)}}function OO(e,t,n,l,o,a){const i=this;let s=0,c;return u;function u(p){return e.enter(l),e.enter(o),e.consume(p),e.exit(o),e.enter(a),Q}function Q(p){return s>999||p===null||p===91||p===93&&!c||p===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(p):p===93?(e.exit(a),e.enter(o),e.consume(p),e.exit(o),e.exit(l),t):gt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Q):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||gt(p)||s++>999?(e.exit("chunkString"),Q(p)):(e.consume(p),c||(c=!l1(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}}function CO(e,t,n,l,o,a){let i;return s;function s(h){return h===34||h===39||h===40?(e.enter(l),e.enter(o),e.consume(h),e.exit(o),i=h===40?41:h,c):n(h)}function c(h){return h===i?(e.enter(o),e.consume(h),e.exit(o),e.exit(l),t):(e.enter(a),u(h))}function u(h){return h===i?(e.exit(a),c(i)):h===null?n(h):gt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),r1(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),Q(h))}function Q(h){return h===i||h===null||gt(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:Q)}function f(h){return h===i||h===92?(e.consume(h),Q):Q(h)}}function kT(e,t){let n;return l;function l(o){return gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,l):l1(o)?r1(e,l,n?"linePrefix":"lineSuffix")(o):t(o)}}const Hte={name:"definition",tokenize:Ete},Ste={partial:!0,tokenize:Mte};function Ete(e,t,n){const l=this;let o;return a;function a(p){return e.enter("definition"),i(p)}function i(p){return OO.call(l,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return o=f5(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return K1(p)?kT(e,u)(p):u(p)}function u(p){return _O(e,Q,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function Q(p){return e.attempt(Ste,f,f)(p)}function f(p){return l1(p)?r1(e,h,"whitespace")(p):h(p)}function h(p){return p===null||gt(p)?(e.exit("definition"),l.parser.defined.push(o),t(p)):n(p)}}function Mte(e,t,n){return l;function l(s){return K1(s)?kT(e,o)(s):n(s)}function o(s){return CO(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return l1(s)?r1(e,i,"whitespace")(s):i(s)}function i(s){return s===null||gt(s)?t(s):n(s)}}const Ate={name:"hardBreakEscape",tokenize:_te};function _te(e,t,n){return l;function l(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return gt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Ote={name:"headingAtx",resolve:Cte,tokenize:wte};function Cte(e,t){let n=e.length-2,l=3,o,a;return e[l][1].type==="whitespace"&&(l+=2),n-2>l&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(l===n-1||n-4>l&&e[n-2][1].type==="whitespace")&&(n-=l+1===n?2:4),n>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[n][1].end},a={type:"chunkText",start:e[l][1].start,end:e[n][1].end,contentType:"text"},Sn(e,l,n-l+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function wte(e,t,n){let l=0;return o;function o(Q){return e.enter("atxHeading"),a(Q)}function a(Q){return e.enter("atxHeadingSequence"),i(Q)}function i(Q){return Q===35&&l++<6?(e.consume(Q),i):Q===null||K1(Q)?(e.exit("atxHeadingSequence"),s(Q)):n(Q)}function s(Q){return Q===35?(e.enter("atxHeadingSequence"),c(Q)):Q===null||gt(Q)?(e.exit("atxHeading"),t(Q)):l1(Q)?r1(e,s,"whitespace")(Q):(e.enter("atxHeadingText"),u(Q))}function c(Q){return Q===35?(e.consume(Q),c):(e.exit("atxHeadingSequence"),s(Q))}function u(Q){return Q===null||Q===35||K1(Q)?(e.exit("atxHeadingText"),s(Q)):(e.consume(Q),u)}}const Vte=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],wO=["pre","script","style","textarea"],Dte={concrete:!0,name:"htmlFlow",resolveTo:Nte,tokenize:Bte},Rte={partial:!0,tokenize:Ite},kte={partial:!0,tokenize:Pte};function Nte(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Bte(e,t,n){const l=this;let o,a,i,s,c;return u;function u(U){return Q(U)}function Q(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),f}function f(U){return U===33?(e.consume(U),h):U===47?(e.consume(U),a=!0,v):U===63?(e.consume(U),o=3,l.interrupt?t:I):_4(U)?(e.consume(U),i=String.fromCharCode(U),b):n(U)}function h(U){return U===45?(e.consume(U),o=2,p):U===91?(e.consume(U),o=5,s=0,g):_4(U)?(e.consume(U),o=4,l.interrupt?t:I):n(U)}function p(U){return U===45?(e.consume(U),l.interrupt?t:I):n(U)}function g(U){const de="CDATA[";return U===de.charCodeAt(s++)?(e.consume(U),s===de.length?l.interrupt?t:q:g):n(U)}function v(U){return _4(U)?(e.consume(U),i=String.fromCharCode(U),b):n(U)}function b(U){if(U===null||U===47||U===62||K1(U)){const de=U===47,me=i.toLowerCase();return!de&&!a&&wO.includes(me)?(o=1,l.interrupt?t(U):q(U)):Vte.includes(i.toLowerCase())?(o=6,de?(e.consume(U),L):l.interrupt?t(U):q(U)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(U):a?S(U):_(U))}return U===45||e4(U)?(e.consume(U),i+=String.fromCharCode(U),b):n(U)}function L(U){return U===62?(e.consume(U),l.interrupt?t:q):n(U)}function S(U){return l1(U)?(e.consume(U),S):R(U)}function _(U){return U===47?(e.consume(U),R):U===58||U===95||_4(U)?(e.consume(U),O):l1(U)?(e.consume(U),_):R(U)}function O(U){return U===45||U===46||U===58||U===95||e4(U)?(e.consume(U),O):E(U)}function E(U){return U===61?(e.consume(U),A):l1(U)?(e.consume(U),E):_(U)}function A(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,V):l1(U)?(e.consume(U),A):k(U)}function V(U){return U===c?(e.consume(U),c=null,B):U===null||gt(U)?n(U):(e.consume(U),V)}function k(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||K1(U)?E(U):(e.consume(U),k)}function B(U){return U===47||U===62||l1(U)?_(U):n(U)}function R(U){return U===62?(e.consume(U),F):n(U)}function F(U){return U===null||gt(U)?q(U):l1(U)?(e.consume(U),F):n(U)}function q(U){return U===45&&o===2?(e.consume(U),W):U===60&&o===1?(e.consume(U),te):U===62&&o===4?(e.consume(U),z):U===63&&o===3?(e.consume(U),I):U===93&&o===5?(e.consume(U),Y):gt(U)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Rte,ne,$)(U)):U===null||gt(U)?(e.exit("htmlFlowData"),$(U)):(e.consume(U),q)}function $(U){return e.check(kte,Z,ne)(U)}function Z(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),ee}function ee(U){return U===null||gt(U)?$(U):(e.enter("htmlFlowData"),q(U))}function W(U){return U===45?(e.consume(U),I):q(U)}function te(U){return U===47?(e.consume(U),i="",J):q(U)}function J(U){if(U===62){const de=i.toLowerCase();return wO.includes(de)?(e.consume(U),z):q(U)}return _4(U)&&i.length<8?(e.consume(U),i+=String.fromCharCode(U),J):q(U)}function Y(U){return U===93?(e.consume(U),I):q(U)}function I(U){return U===62?(e.consume(U),z):U===45&&o===2?(e.consume(U),I):q(U)}function z(U){return U===null||gt(U)?(e.exit("htmlFlowData"),ne(U)):(e.consume(U),z)}function ne(U){return e.exit("htmlFlow"),t(U)}}function Pte(e,t,n){const l=this;return o;function o(i){return gt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):n(i)}function a(i){return l.parser.lazy[l.now().line]?n(i):t(i)}}function Ite(e,t,n){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(DT,t,n)}}const jte={name:"htmlText",tokenize:Fte};function Fte(e,t,n){const l=this;let o,a,i;return s;function s(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),c}function c(I){return I===33?(e.consume(I),u):I===47?(e.consume(I),E):I===63?(e.consume(I),_):_4(I)?(e.consume(I),k):n(I)}function u(I){return I===45?(e.consume(I),Q):I===91?(e.consume(I),a=0,g):_4(I)?(e.consume(I),S):n(I)}function Q(I){return I===45?(e.consume(I),p):n(I)}function f(I){return I===null?n(I):I===45?(e.consume(I),h):gt(I)?(i=f,te(I)):(e.consume(I),f)}function h(I){return I===45?(e.consume(I),p):f(I)}function p(I){return I===62?W(I):I===45?h(I):f(I)}function g(I){const z="CDATA[";return I===z.charCodeAt(a++)?(e.consume(I),a===z.length?v:g):n(I)}function v(I){return I===null?n(I):I===93?(e.consume(I),b):gt(I)?(i=v,te(I)):(e.consume(I),v)}function b(I){return I===93?(e.consume(I),L):v(I)}function L(I){return I===62?W(I):I===93?(e.consume(I),L):v(I)}function S(I){return I===null||I===62?W(I):gt(I)?(i=S,te(I)):(e.consume(I),S)}function _(I){return I===null?n(I):I===63?(e.consume(I),O):gt(I)?(i=_,te(I)):(e.consume(I),_)}function O(I){return I===62?W(I):_(I)}function E(I){return _4(I)?(e.consume(I),A):n(I)}function A(I){return I===45||e4(I)?(e.consume(I),A):V(I)}function V(I){return gt(I)?(i=V,te(I)):l1(I)?(e.consume(I),V):W(I)}function k(I){return I===45||e4(I)?(e.consume(I),k):I===47||I===62||K1(I)?B(I):n(I)}function B(I){return I===47?(e.consume(I),W):I===58||I===95||_4(I)?(e.consume(I),R):gt(I)?(i=B,te(I)):l1(I)?(e.consume(I),B):W(I)}function R(I){return I===45||I===46||I===58||I===95||e4(I)?(e.consume(I),R):F(I)}function F(I){return I===61?(e.consume(I),q):gt(I)?(i=F,te(I)):l1(I)?(e.consume(I),F):B(I)}function q(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),o=I,$):gt(I)?(i=q,te(I)):l1(I)?(e.consume(I),q):(e.consume(I),Z)}function $(I){return I===o?(e.consume(I),o=void 0,ee):I===null?n(I):gt(I)?(i=$,te(I)):(e.consume(I),$)}function Z(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||K1(I)?B(I):(e.consume(I),Z)}function ee(I){return I===47||I===62||K1(I)?B(I):n(I)}function W(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function te(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),J}function J(I){return l1(I)?r1(e,Y,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):Y(I)}function Y(I){return e.enter("htmlTextData"),i(I)}}const bx={name:"labelEnd",resolveAll:Ute,resolveTo:Gte,tokenize:Zte},zte={tokenize:Xte},qte={tokenize:Wte},$te={tokenize:Yte};function Ute(e){let t=-1;const n=[];for(;++t<e.length;){const l=e[t][1];if(n.push(e[t]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",t+=o}}return e.length!==n.length&&Sn(e,0,e.length,n),e}function Gte(e,t){let n=e.length,l=0,o,a,i,s;for(;n--;)if(o=e[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(i=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[i][1].end}},Q={type:"labelText",start:{...e[a+l+2][1].end},end:{...e[i-2][1].start}};return s=[["enter",c,t],["enter",u,t]],s=_6(s,e.slice(a+1,a+l+3)),s=_6(s,[["enter",Q,t]]),s=_6(s,oy(t.parser.constructs.insideSpan.null,e.slice(a+l+4,i-3),t)),s=_6(s,[["exit",Q,t],e[i-2],e[i-1],["exit",u,t]]),s=_6(s,e.slice(i+1)),s=_6(s,[["exit",c,t]]),Sn(e,a,e.length,s),e}function Zte(e,t,n){const l=this;let o=l.events.length,a,i;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){a=l.events[o][1];break}return s;function s(h){return a?a._inactive?f(h):(i=l.parser.defined.includes(f5(l.sliceSerialize({start:a.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(zte,Q,i?Q:f)(h):h===91?e.attempt(qte,Q,i?u:f)(h):i?Q(h):f(h)}function u(h){return e.attempt($te,Q,f)(h)}function Q(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function Xte(e,t,n){return l;function l(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return K1(f)?kT(e,a)(f):a(f)}function a(f){return f===41?Q(f):_O(e,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function i(f){return K1(f)?kT(e,c)(f):Q(f)}function s(f){return n(f)}function c(f){return f===34||f===39||f===40?CO(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):Q(f)}function u(f){return K1(f)?kT(e,Q)(f):Q(f)}function Q(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Wte(e,t,n){const l=this;return o;function o(s){return OO.call(l,e,a,i,"reference","referenceMarker","referenceString")(s)}function a(s){return l.parser.defined.includes(f5(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function i(s){return n(s)}}function Yte(e,t,n){return l;function l(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Kte={name:"labelStartImage",resolveAll:bx.resolveAll,tokenize:Jte};function Jte(e,t,n){const l=this;return o;function o(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),i):n(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in l.parser.constructs?n(s):t(s)}}const e1e={name:"labelStartLink",resolveAll:bx.resolveAll,tokenize:t1e};function t1e(e,t,n){const l=this;return o;function o(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in l.parser.constructs?n(i):t(i)}}const Hx={name:"lineEnding",tokenize:n1e};function n1e(e,t){return n;function n(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r1(e,t,"linePrefix")}}const ly={name:"thematicBreak",tokenize:r1e};function r1e(e,t,n){let l=0,o;return a;function a(u){return e.enter("thematicBreak"),i(u)}function i(u){return o=u,s(u)}function s(u){return u===o?(e.enter("thematicBreakSequence"),c(u)):l>=3&&(u===null||gt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===o?(e.consume(u),l++,c):(e.exit("thematicBreakSequence"),l1(u)?r1(e,s,"whitespace")(u):s(u))}}const tn={continuation:{tokenize:l1e},exit:u1e,name:"list",tokenize:o1e},i1e={partial:!0,tokenize:c1e},a1e={partial:!0,tokenize:s1e};function o1e(e,t,n){const l=this,o=l.events[l.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,i=0;return s;function s(p){const g=l.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!l.containerState.marker||p===l.containerState.marker:vx(p)){if(l.containerState.type||(l.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ly,n,u)(p):u(p);if(!l.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return vx(p)&&++i<10?(e.consume(p),c):(!l.interrupt||i<2)&&(l.containerState.marker?p===l.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||p,e.check(DT,l.interrupt?n:Q,e.attempt(i1e,h,f))}function Q(p){return l.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return l1(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return l.containerState.size=a+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function l1e(e,t,n){const l=this;return l.containerState._closeFlow=void 0,e.check(DT,o,a);function o(s){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,r1(e,t,"listItemIndent",l.containerState.size+1)(s)}function a(s){return l.containerState.furtherBlankLines||!l1(s)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,i(s)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(a1e,t,i)(s))}function i(s){return l.containerState._closeFlow=!0,l.interrupt=void 0,r1(e,e.attempt(tn,t,n),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function s1e(e,t,n){const l=this;return r1(e,o,"listItemIndent",l.containerState.size+1);function o(a){const i=l.events[l.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===l.containerState.size?t(a):n(a)}}function u1e(e){e.exit(this.containerState.type)}function c1e(e,t,n){const l=this;return r1(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const i=l.events[l.events.length-1];return!l1(a)&&i&&i[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const VO={name:"setextUnderline",resolveTo:T1e,tokenize:Q1e};function T1e(e,t){let n=e.length,l,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){l=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const i={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",i,t]),e.splice(a+1,0,["exit",e[l][1],t]),e[l][1].end={...e[a][1].end}):e[l][1]=i,e.push(["exit",i,t]),e}function Q1e(e,t,n){const l=this;let o;return a;function a(u){let Q=l.events.length,f;for(;Q--;)if(l.events[Q][1].type!=="lineEnding"&&l.events[Q][1].type!=="linePrefix"&&l.events[Q][1].type!=="content"){f=l.events[Q][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||f)?(e.enter("setextHeadingLine"),o=u,i(u)):n(u)}function i(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===o?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),l1(u)?r1(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||gt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const f1e={tokenize:d1e};function d1e(e){const t=this,n=e.attempt(DT,l,e.attempt(this.parser.constructs.flowInitial,o,r1(e,e.attempt(this.parser.constructs.flow,o,e.attempt(gte,o)),"linePrefix")));return n;function l(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const h1e={resolveAll:RO()},p1e=DO("string"),m1e=DO("text");function DO(e){return{resolveAll:RO(e==="text"?y1e:void 0),tokenize:t};function t(n){const l=this,o=this.parser.constructs[e],a=n.attempt(o,i,s);return i;function i(Q){return u(Q)?a(Q):s(Q)}function s(Q){if(Q===null){n.consume(Q);return}return n.enter("data"),n.consume(Q),c}function c(Q){return u(Q)?(n.exit("data"),a(Q)):(n.consume(Q),c)}function u(Q){if(Q===null)return!0;const f=o[Q];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(l,l.previous))return!0}return!1}}}function RO(e){return t;function t(n,l){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(n,l):n}}function y1e(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const l=e[n-1][1],o=t.sliceStream(l);let a=o.length,i=-1,s=0,c;for(;a--;){const u=o[a];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(u===-2)c=!0,s++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||c||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?i:l.start._bufferIndex+i,_index:l.start._index+a,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...u.start},l.start.offset===l.end.offset?Object.assign(l,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const g1e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Hte},disable:{null:[]},document:{42:tn,43:tn,45:tn,48:tn,49:tn,50:tn,51:tn,52:tn,53:tn,54:tn,55:tn,56:tn,57:tn,62:bO},flow:{35:Ote,42:ly,45:[VO,ly],60:Dte,61:VO,95:ly,96:MO,126:MO},flowInitial:{[-2]:xx,[-1]:xx,32:xx},insideSpan:{null:[Lx,h1e]},string:{38:SO,92:HO},text:{[-5]:Hx,[-4]:Hx,[-3]:Hx,33:Kte,38:SO,42:Lx,60:[ete,jte],91:e1e,92:[Ate,HO],93:bx,95:Lx,96:fte}},Symbol.toStringTag,{value:"Module"}));function v1e(e,t,n){let l={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let i=[],s=[];const c={attempt:V(E),check:V(A),consume:S,enter:_,exit:O,interrupt:V(A,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let Q=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(F){return i=_6(i,F),b(),i[i.length-1]!==null?[]:(k(t,0),u.events=oy(a,u.events,u),u.events)}function h(F,q){return x1e(p(F),q)}function p(F){return L1e(i,F)}function g(){const{_bufferIndex:F,_index:q,line:$,column:Z,offset:ee}=l;return{_bufferIndex:F,_index:q,line:$,column:Z,offset:ee}}function v(F){o[F.line]=F.column,R()}function b(){let F;for(;l._index<i.length;){const q=i[l._index];if(typeof q=="string")for(F=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===F&&l._bufferIndex<q.length;)L(q.charCodeAt(l._bufferIndex));else L(q)}}function L(F){Q=Q(F)}function S(F){gt(F)?(l.line++,l.column=1,l.offset+=F===-3?2:1,R()):F!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===i[l._index].length&&(l._bufferIndex=-1,l._index++)),u.previous=F}function _(F,q){const $=q||{};return $.type=F,$.start=g(),u.events.push(["enter",$,u]),s.push($),$}function O(F){const q=s.pop();return q.end=g(),u.events.push(["exit",q,u]),q}function E(F,q){k(F,q.from)}function A(F,q){q.restore()}function V(F,q){return $;function $(Z,ee,W){let te,J,Y,I;return Array.isArray(Z)?ne(Z):"tokenize"in Z?ne([Z]):z(Z);function z(he){return se;function se(fe){const Ee=fe!==null&&he[fe],Se=fe!==null&&he.null,_e=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return ne(_e)(fe)}}function ne(he){return te=he,J=0,he.length===0?W:U(he[J])}function U(he){return se;function se(fe){return I=B(),Y=he,he.partial||(u.currentConstruct=he),he.name&&u.parser.constructs.disable.null.includes(he.name)?me():he.tokenize.call(q?Object.assign(Object.create(u),q):u,c,de,me)(fe)}}function de(he){return F(Y,I),ee}function me(he){return I.restore(),++J<te.length?U(te[J]):W}}}function k(F,q){F.resolveAll&&!a.includes(F)&&a.push(F),F.resolve&&Sn(u.events,q,u.events.length-q,F.resolve(u.events.slice(q),u)),F.resolveTo&&(u.events=F.resolveTo(u.events,u))}function B(){const F=g(),q=u.previous,$=u.currentConstruct,Z=u.events.length,ee=Array.from(s);return{from:Z,restore:W};function W(){l=F,u.previous=q,u.currentConstruct=$,u.events.length=Z,s=ee,R()}}function R(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function L1e(e,t){const n=t.start._index,l=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(l,a)];else{if(i=e.slice(n,o),l>-1){const s=i[0];typeof s=="string"?i[0]=s.slice(l):i.shift()}a>0&&i.push(e[o].slice(0,a))}return i}function x1e(e,t){let n=-1;const l=[];let o;for(;++n<e.length;){const a=e[n];let i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
336
336
  `;break}case-3:{i=`\r
337
337
  `;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&o)continue;i=" ";break}default:i=String.fromCharCode(a)}o=a===-2,l.push(i)}return l.join("")}function b1e(e){const l={constructs:gO([g1e,...(e||{}).extensions||[]]),content:o(Gee),defined:[],document:o(Xee),flow:o(f1e),lazy:{},string:o(p1e),text:o(m1e)};return l;function o(a){return i;function i(s){return v1e(l,a,s)}}}function H1e(e){for(;!AO(e););return e}const kO=/[\0\t\n\r]/g;function S1e(){let e=1,t="",n=!0,l;return o;function o(a,i,s){const c=[];let u,Q,f,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(kO.lastIndex=f,u=kO.exec(a),h=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(h),!u){t=a.slice(f);break}if(p===10&&f===h&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),f<h&&(c.push(a.slice(f,h)),e+=h-f),p){case 0:{c.push(65533),e++;break}case 9:{for(Q=Math.ceil(e/4)*4,c.push(-2);e++<Q;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:l=!0,e=1}f=h+1}return s&&(l&&c.push(-5),t&&c.push(t),c.push(null)),c}}const E1e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function M1e(e){return e.replace(E1e,A1e)}function A1e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return vO(n.slice(a?2:1),a?16:10)}return gx(n)||e}const NO={}.hasOwnProperty;function _1e(e,t,n){return typeof t!="string"&&(n=t,t=void 0),O1e(n)(H1e(b1e(n).document().write(S1e()(e,t,!0))))}function O1e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(jt),autolinkProtocol:B,autolinkEmail:B,atxHeading:a(We),blockQuote:a(Se),characterEscape:B,characterReference:B,codeFenced:a(_e),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(_e,i),codeText:a(ze,i),codeTextData:B,data:B,codeFlowValue:B,definition:a(ue),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(Pe),hardBreakEscape:a(dt),hardBreakTrailing:a(dt),htmlFlow:a(at,i),htmlFlowData:B,htmlText:a(at,i),htmlTextData:B,image:a(pt),label:i,link:a(jt),listItem:a(lt),listItemValue:h,listOrdered:a(d1,f),listUnordered:a(d1),paragraph:a(ut),reference:U,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(We),strong:a(e2),thematicBreak:a(Ze)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:Ee,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:he,characterReference:se,codeFenced:c(b),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:c(L),codeText:c(ee),codeTextData:R,data:R,definition:c(),definitionDestinationString:O,definitionLabelString:S,definitionTitleString:_,emphasis:c(),hardBreakEscape:c(q),hardBreakTrailing:c(q),htmlFlow:c($),htmlFlowData:R,htmlText:c(Z),htmlTextData:R,image:c(te),label:Y,labelText:J,lineEnding:F,link:c(W),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:I,resourceTitleString:z,resource:ne,setextHeading:c(k),setextHeadingLineSequence:V,setextHeadingText:A,strong:c(),thematicBreak:c()}};BO(t,(e||{}).mdastExtensions||[]);const n={};return l;function l(ye){let De={type:"root",children:[]};const Ye={stack:[De],tokenStack:[],config:t,enter:s,exit:u,buffer:i,resume:Q,data:n},tt=[];let rt=-1;for(;++rt<ye.length;)if(ye[rt][1].type==="listOrdered"||ye[rt][1].type==="listUnordered")if(ye[rt][0]==="enter")tt.push(rt);else{const ct=tt.pop();rt=o(ye,ct,rt)}for(rt=-1;++rt<ye.length;){const ct=t[ye[rt][0]];NO.call(ct,ye[rt][1].type)&&ct[ye[rt][1].type].call(Object.assign({sliceSerialize:ye[rt][2].sliceSerialize},Ye),ye[rt][1])}if(Ye.tokenStack.length>0){const ct=Ye.tokenStack[Ye.tokenStack.length-1];(ct[1]||PO).call(Ye,void 0,ct[0])}for(De.position={start:Ka(ye.length>0?ye[0][1].start:{line:1,column:1,offset:0}),end:Ka(ye.length>0?ye[ye.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)De=t.transforms[rt](De)||De;return De}function o(ye,De,Ye){let tt=De-1,rt=-1,ct=!1,i1,_t,h1,p1;for(;++tt<=Ye;){const Q1=ye[tt];switch(Q1[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Q1[0]==="enter"?rt++:rt--,p1=void 0;break}case"lineEndingBlank":{Q1[0]==="enter"&&(i1&&!p1&&!rt&&!h1&&(h1=tt),p1=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:p1=void 0}if(!rt&&Q1[0]==="enter"&&Q1[1].type==="listItemPrefix"||rt===-1&&Q1[0]==="exit"&&(Q1[1].type==="listUnordered"||Q1[1].type==="listOrdered")){if(i1){let G1=tt;for(_t=void 0;G1--;){const K=ye[G1];if(K[1].type==="lineEnding"||K[1].type==="lineEndingBlank"){if(K[0]==="exit")continue;_t&&(ye[_t][1].type="lineEndingBlank",ct=!0),K[1].type="lineEnding",_t=G1}else if(!(K[1].type==="linePrefix"||K[1].type==="blockQuotePrefix"||K[1].type==="blockQuotePrefixWhitespace"||K[1].type==="blockQuoteMarker"||K[1].type==="listItemIndent"))break}h1&&(!_t||h1<_t)&&(i1._spread=!0),i1.end=Object.assign({},_t?ye[_t][1].start:Q1[1].end),ye.splice(_t||tt,0,["exit",i1,Q1[2]]),tt++,Ye++}if(Q1[1].type==="listItemPrefix"){const G1={type:"listItem",_spread:!1,start:Object.assign({},Q1[1].start),end:void 0};i1=G1,ye.splice(tt,0,["enter",G1,Q1[2]]),tt++,Ye++,h1=void 0,p1=!0}}}return ye[De][1]._spread=ct,Ye}function a(ye,De){return Ye;function Ye(tt){s.call(this,ye(tt),tt),De&&De.call(this,tt)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(ye,De,Ye){this.stack[this.stack.length-1].children.push(ye),this.stack.push(ye),this.tokenStack.push([De,Ye||void 0]),ye.position={start:Ka(De.start),end:void 0}}function c(ye){return De;function De(Ye){ye&&ye.call(this,Ye),u.call(this,Ye)}}function u(ye,De){const Ye=this.stack.pop(),tt=this.tokenStack.pop();if(tt)tt[0].type!==ye.type&&(De?De.call(this,ye,tt[0]):(tt[1]||PO).call(this,ye,tt[0]));else throw new Error("Cannot close `"+ye.type+"` ("+wT({start:ye.start,end:ye.end})+"): it’s not open");Ye.position.end=Ka(ye.end)}function Q(){return yx(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(ye){if(this.data.expectingFirstListItemValue){const De=this.stack[this.stack.length-2];De.start=Number.parseInt(this.sliceSerialize(ye),10),this.data.expectingFirstListItemValue=void 0}}function p(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.lang=ye}function g(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.meta=ye}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye.replace(/(\r?\n|\r)$/g,"")}function S(ye){const De=this.resume(),Ye=this.stack[this.stack.length-1];Ye.label=De,Ye.identifier=f5(this.sliceSerialize(ye)).toLowerCase()}function _(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.title=ye}function O(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.url=ye}function E(ye){const De=this.stack[this.stack.length-1];if(!De.depth){const Ye=this.sliceSerialize(ye).length;De.depth=Ye}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function V(ye){const De=this.stack[this.stack.length-1];De.depth=this.sliceSerialize(ye).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function B(ye){const Ye=this.stack[this.stack.length-1].children;let tt=Ye[Ye.length-1];(!tt||tt.type!=="text")&&(tt=T1(),tt.position={start:Ka(ye.start),end:void 0},Ye.push(tt)),this.stack.push(tt)}function R(ye){const De=this.stack.pop();De.value+=this.sliceSerialize(ye),De.position.end=Ka(ye.end)}function F(ye){const De=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ye=De.children[De.children.length-1];Ye.position.end=Ka(ye.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(De.type)&&(B.call(this,ye),R.call(this,ye))}function q(){this.data.atHardBreak=!0}function $(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye}function Z(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye}function ee(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.value=ye}function W(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const De=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=De,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function te(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const De=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=De,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function J(ye){const De=this.sliceSerialize(ye),Ye=this.stack[this.stack.length-2];Ye.label=M1e(De),Ye.identifier=f5(De).toLowerCase()}function Y(){const ye=this.stack[this.stack.length-1],De=this.resume(),Ye=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ye.type==="link"){const tt=ye.children;Ye.children=tt}else Ye.alt=De}function I(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.url=ye}function z(){const ye=this.resume(),De=this.stack[this.stack.length-1];De.title=ye}function ne(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function de(ye){const De=this.resume(),Ye=this.stack[this.stack.length-1];Ye.label=De,Ye.identifier=f5(this.sliceSerialize(ye)).toLowerCase(),this.data.referenceType="full"}function me(ye){this.data.characterReferenceType=ye.type}function he(ye){const De=this.sliceSerialize(ye),Ye=this.data.characterReferenceType;let tt;Ye?(tt=vO(De,Ye==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):tt=gx(De);const rt=this.stack[this.stack.length-1];rt.value+=tt}function se(ye){const De=this.stack.pop();De.position.end=Ka(ye.end)}function fe(ye){R.call(this,ye);const De=this.stack[this.stack.length-1];De.url=this.sliceSerialize(ye)}function Ee(ye){R.call(this,ye);const De=this.stack[this.stack.length-1];De.url="mailto:"+this.sliceSerialize(ye)}function Se(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function ze(){return{type:"inlineCode",value:""}}function ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function We(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function at(){return{type:"html",value:""}}function pt(){return{type:"image",title:null,url:"",alt:null}}function jt(){return{type:"link",title:null,url:"",children:[]}}function d1(ye){return{type:"list",ordered:ye.type==="listOrdered",start:null,spread:ye._spread,children:[]}}function lt(ye){return{type:"listItem",spread:ye._spread,checked:null,children:[]}}function ut(){return{type:"paragraph",children:[]}}function e2(){return{type:"strong",children:[]}}function T1(){return{type:"text",value:""}}function Ze(){return{type:"thematicBreak"}}}function Ka(e){return{line:e.line,column:e.column,offset:e.offset}}function BO(e,t){let n=-1;for(;++n<t.length;){const l=t[n];Array.isArray(l)?BO(e,l):C1e(e,l)}}function C1e(e,t){let n;for(n in t)if(NO.call(t,n))switch(n){case"canContainEols":{const l=t[n];l&&e[n].push(...l);break}case"transforms":{const l=t[n];l&&e[n].push(...l);break}case"enter":case"exit":{const l=t[n];l&&Object.assign(e[n],l);break}}}function PO(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wT({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wT({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wT({start:t.start,end:t.end})+") is still open")}function w1e(e){const t=this;t.parser=n;function n(l){return _1e(l,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function V1e(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function D1e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -663,5 +663,5 @@ You might need to use a local HTTP server (instead of file://): https://react.de
663
663
  ${Dt.ctrl}+up, ${Dt.ctrl}+down,
664
664
  ${Dt.ctrl}+left, ${Dt.ctrl}+right,
665
665
  pageup, pagedown, home, end,
666
- tab, ${Dt.ctrl}+a, ${Dt.ctrl}+c`},Y0e={TOGGLE_SETTINGS:"esc"},K0e={ACTIVATE_TRACE_LABEL_SCOPE:"l",AUTOPLAY_UPWARD:`${Dt.ctrl}+shift+up`,AUTOPLAY_DOWNWARD:`${Dt.ctrl}+shift+down`,AUTOPLAY_FORWARD:`${Dt.ctrl}+shift+right`,AUTOPLAY_BACKWARD:`${Dt.ctrl}+shift+left`,STOP_AUTOPLAY:`${Dt.ctrl}, up, down, left, right`,SPEED_UP_AUTOPLAY:".",SPEED_DOWN_AUTOPLAY:",",RESET_AUTOPLAY_SPEED:"/",MOVE_UP:"up",MOVE_DOWN:"down",MOVE_RIGHT:"right",MOVE_LEFT:"left",MOVE_TO_TOP_EXTREME:`${Dt.ctrl}+up`,MOVE_TO_BOTTOM_EXTREME:`${Dt.ctrl}+down`,MOVE_TO_LEFT_EXTREME:`${Dt.ctrl}+left`,MOVE_TO_RIGHT_EXTREME:`${Dt.ctrl}+right`,MOVE_TO_SUBPLOT_CONTEXT:"esc",MOVE_TO_NEXT_TRACE:"pageup",MOVE_TO_PREV_TRACE:"pagedown",TOGGLE_BRAILLE:"b",TOGGLE_TEXT:"t",TOGGLE_AUDIO:"s",TOGGLE_REVIEW:"r",TOGGLE_HELP:`${Dt.ctrl}+/`,TOGGLE_CHAT:"shift+/",TOGGLE_SETTINGS:`${Dt.ctrl}+,`,DESCRIBE_POINT:"space"},J0e={[H1.BRAILLE]:q0e,[H1.CHAT]:$0e,[H1.FIGURE_LABEL]:U0e,[H1.HELP]:G0e,[H1.REVIEW]:W0e,[H1.SETTINGS]:Y0e,[H1.SUBPLOT]:Z0e,[H1.TRACE]:K0e,[H1.TRACE_LABEL]:X0e};class eae{constructor(t){ae(this,"commandFactory");this.commandFactory=new z0e(t)}register(t){q3.filter=n=>{const l=n.target;return l.tagName.toLowerCase()===xe.INPUT?l.id.startsWith(xe.REVIEW_INPUT):l.tagName.toLowerCase()===xe.TEXT_AREA?l.id.startsWith(xe.BRAILLE_TEXT_AREA):!0};for(const[n,l]of Object.entries(J0e))for(const[o,a]of Object.entries(l))o==="STOP_AUTOPLAY"&&q3("*",H1.TRACE,i=>{(q3.command||q3.ctrl)&&this.commandFactory.create(o).execute(i)}),q3(a,{scope:n},i=>{o!=="ALLOW_DEFAULT"&&(i.preventDefault(),this.commandFactory.create(o).execute(i))});q3.setScope(t)}unregister(){q3.unbind()}}class tae{constructor(){ae(this,"onChangeEmitter");ae(this,"onChange");this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose()}notify(t){t&&this.onChangeEmitter.fire({value:t})}}class nae{constructor(t,n,l){ae(this,"notification");ae(this,"display");ae(this,"text");ae(this,"enabled");ae(this,"onChangeEmitter");ae(this,"onChange");this.notification=t,this.display=n,this.text=l,this.enabled=!1,this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose()}update(t){if(!this.enabled||t.empty)return;const n=this.text.format(t);n&&this.onChangeEmitter.fire({value:n})}toggle(t){if(t.empty){this.notification.notify("No info for review");return}this.enabled=!this.enabled,this.update(t),this.display.toggleFocus(H1.REVIEW);const n=`Review is ${this.enabled?"on":"off"}`;this.notification.notify(n)}}const Ob="maidr-settings";class rae{constructor(t,n){ae(this,"storage");ae(this,"display");ae(this,"defaultSettings");ae(this,"currentSettings");ae(this,"observers");this.storage=t,this.display=n,this.observers=[],this.defaultSettings={general:{volume:50,highlightColor:"#03c809",brailleDisplaySize:32,minFrequency:200,maxFrequency:1e3,autoplayDuration:4e3,ariaMode:"assertive"},llm:{expertiseLevel:"basic",customInstruction:"",models:{OPENAI:{enabled:!1,apiKey:"",name:"OpenAI",version:"gpt-4o"},ANTHROPIC_CLAUDE:{enabled:!1,apiKey:"",name:"Anthropic Claude",version:"claude-3-7-sonnet-latest"},GOOGLE_GEMINI:{enabled:!1,apiKey:"",name:"Google Gemini",version:"gemini-2.0-flash"}}}};const l=this.storage.load(Ob);this.currentSettings=l??this.defaultSettings}get state(){return this.currentSettings}addObserver(t){this.observers.push(t)}removeObserver(t){this.observers=this.observers.filter(n=>n!==t)}notifyStateUpdate(){for(const t of this.observers)t.update(this.currentSettings)}loadSettings(){return this.currentSettings}saveSettings(t){this.currentSettings=t,this.storage.save(Ob,this.currentSettings),this.notifyStateUpdate()}resetSettings(){return this.currentSettings=this.defaultSettings,this.storage.remove(Ob),this.notifyStateUpdate(),this.currentSettings}toggle(){this.display.toggleFocus(H1.SETTINGS)}}class iae{save(t,n){try{const l=JSON.stringify(n);localStorage.setItem(t,l)}catch(l){console.error(`Error while saving ${t} to storage`,l)}}load(t){try{const n=localStorage.getItem(t);return n===null?null:JSON.parse(n)}catch(n){return console.error(`Error while loading ${t} from storage`,n),null}}remove(t){try{localStorage.removeItem(t)}catch(n){console.error(`Error while removing ${t} from storage`,n)}}}class aae{constructor(t){ae(this,"notification");ae(this,"mode");ae(this,"currentState",null);ae(this,"currentSubplotIndex",null);ae(this,"onChangeEmitter");ae(this,"onChange");this.notification=t,this.mode="verbose",this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose()}getCurrentState(){return this.currentState}getCoordinateText(){return!this.currentState||this.currentState.empty?null:this.currentState.type==="subplot"&&!this.currentState.trace.empty?this.formatCoordinateText(this.currentState.trace):this.currentState.type==="trace"&&!this.currentState.empty?this.formatCoordinateText(this.currentState):null}isLayerSwitch(){if(!this.currentState||this.currentState.empty||this.currentState.type!=="subplot")return!1;const t=this.currentState.index;return this.currentSubplotIndex!==null&&this.currentSubplotIndex!==t?(this.currentSubplotIndex=t,!0):this.currentSubplotIndex===null?(this.currentSubplotIndex=t,t!==0):!1}formatCoordinateText(t){if(t.empty||!t.text)return null;const{text:n}=t,l=[];if(n.main&&n.main.value!==void 0){const o=Array.isArray(n.main.value)?n.main.value.join(", "):String(n.main.value);l.push(`${n.main.label} is ${o}`)}if(n.cross&&n.cross.value!==void 0){const o=Array.isArray(n.cross.value)?n.cross.value.join(", "):String(n.cross.value);l.push(`${n.cross.label} is ${o}`)}return n.fill&&n.fill.value!==void 0&&l.push(`${n.fill.label} is ${n.fill.value}`),l.length>0?l.join(", "):null}format(t){return typeof t=="string"?t:!t||t.empty?`No ${t.type==="trace"?"plot":t.type} info to display`:t.type==="figure"?this.formatFigureText(t.index,t.size,t.traceTypes):t.type==="subplot"?this.formatSubplotText(t.index,t.size,t.trace.traceType,t.trace):this.mode==="verbose"?this.formatVerboseTraceText(t.text):this.formatTerseTraceText(t.text)}formatFigureText(t,n,l){const o=l.length===1?`This is a ${l[0]} plot`:`This is a multi-layered plot containing ${l.join(xe.COMMA_SPACE)} plots`;return`Subplot ${t} of ${n}: ${o}. Press 'ENTER' to select this subplot.`}formatSubplotText(t,n,l,o){const a=o&&!o.empty?o.plotType:l;return`Layer ${t} of ${n}: ${a} plot`}formatVerboseTraceText(t){const n=new Array;return n.push(t.main.label,xe.IS),t.range!==void 0?n.push(String(t.range.min),xe.THROUGH,String(t.range.max)):Array.isArray(t.main.value)?n.push(t.main.value.join(xe.COMMA_SPACE)):n.push(String(t.main.value)),n.push(xe.COMMA_SPACE,t.cross.label),t.section!==void 0&&(n.push(xe.COMMA_SPACE),Array.isArray(t.cross.value)&&n.push(String(t.cross.value.length),xe.SPACE),n.push(t.section)),Array.isArray(t.cross.value)?t.cross.value.length>1?n.push(xe.ARE,t.cross.value.join(xe.COMMA_SPACE)):t.cross.value.length>0&&n.push(xe.IS,t.cross.value.join(xe.COMMA_SPACE)):n.push(xe.IS,String(t.cross.value)),t.fill!==void 0&&n.push(xe.COMMA_SPACE,t.fill.label,xe.IS,t.fill.value),n.join(xe.EMPTY)}formatTerseTraceText(t){const n=new Array;return Array.isArray(t.main.value)?n.push(xe.OPEN_BRACKET,t.main.value.join(xe.COMMA_SPACE),xe.CLOSE_BRACKET):n.push(String(t.main.value),xe.COMMA_SPACE),t.section!==void 0&&t.fill!==void 0?Array.isArray(t.cross.value)?n.push(xe.OPEN_BRACKET,t.cross.value.join(xe.COMMA_SPACE),xe.CLOSE_BRACKET,xe.COMMA_SPACE,t.section):n.push(String(t.cross.value),xe.COMMA_SPACE,t.section):Array.isArray(t.cross.value)?n.push(xe.OPEN_BRACKET,t.cross.value.join(xe.COMMA_SPACE),xe.CLOSE_BRACKET):n.push(String(t.cross.value)),t.section!==void 0&&t.fill===void 0&&(n.push(xe.COMMA_SPACE),Array.isArray(t.cross.value)&&n.push(String(t.cross.value.length),xe.SPACE),n.push(t.section)),t.fill!==void 0&&(t.section!==void 0?n.push(xe.SPACE,t.fill.value):n.push(xe.COMMA_SPACE,t.fill.value)),n.join(xe.EMPTY)}update(t){if(this.mode==="off")return;if(this.currentState=t,t.type==="subplot"){const l=this.format(t);l&&this.notification.notify(l);return}const n=this.format(t);n&&this.onChangeEmitter.fire({value:n})}toggle(){switch(this.mode){case"off":this.mode="verbose";break;case"terse":this.mode="off";break;case"verbose":this.mode="terse";break}const t=`Text mode is ${this.mode}`;return this.notification.notify(t),this.mode!=="off"}}class bB{constructor(t,n,l){ae(this,"figure");ae(this,"context");ae(this,"displayService");ae(this,"notificationService");ae(this,"settingsService");ae(this,"audioService");ae(this,"brailleService");ae(this,"textService");ae(this,"reviewService");ae(this,"autoplayService");ae(this,"highlightService");ae(this,"helpService");ae(this,"chatService");ae(this,"textViewModel");ae(this,"brailleViewModel");ae(this,"reviewViewModel");ae(this,"displayViewModel");ae(this,"helpViewModel");ae(this,"chatViewModel");ae(this,"settingsViewModel");ae(this,"keybinding");this.figure=new gj(t),this.context=new RI(this.figure),this.displayService=new o0e(this.context,n,l),this.notificationService=new tae;const o=new iae;this.settingsService=new rae(o,this.displayService),this.audioService=new Hj(this.notificationService,this.context.state,this.settingsService),this.brailleService=new Dj(this.context,this.notificationService,this.displayService),this.textService=new aae(this.notificationService),this.reviewService=new nae(this.notificationService,this.displayService,this.textService),this.autoplayService=new _j(this.context,this.notificationService,this.settingsService),this.highlightService=new s0e(this.settingsService),this.helpService=new l0e(this.context,this.displayService),this.chatService=new jj(this.displayService,t),this.textViewModel=new tq(ja,this.textService,this.notificationService,this.autoplayService),this.brailleViewModel=new Sz(ja,this.brailleService),this.reviewViewModel=new $z(ja,this.reviewService),this.displayViewModel=new Nz(ja,this.displayService),this.helpViewModel=new jz(ja,this.helpService),this.chatViewModel=new Vz(ja,this.chatService,this.audioService),this.settingsViewModel=new Zz(ja,this.settingsService),this.notificationService.notify(this.context.getInstruction(!1)),this.keybinding=new eae({context:this.context,audioService:this.audioService,autoplayService:this.autoplayService,highlightService:this.highlightService,brailleViewModel:this.brailleViewModel,chatViewModel:this.chatViewModel,helpViewModel:this.helpViewModel,reviewViewModel:this.reviewViewModel,settingsViewModel:this.settingsViewModel,textViewModel:this.textViewModel}),this.registerViewModels(),this.registerObservers(),this.settingsService.addObserver(this.highlightService),this.keybinding.register(this.context.scope)}dispose(){this.keybinding.unregister(),T5.instance.dispose(),this.settingsViewModel.dispose(),this.chatViewModel.dispose(),this.helpViewModel.dispose(),this.displayViewModel.dispose(),this.reviewViewModel.dispose(),this.brailleViewModel.dispose(),this.textViewModel.dispose(),this.highlightService.dispose(),this.autoplayService.dispose(),this.textService.dispose(),this.reviewService.dispose(),this.brailleService.dispose(),this.audioService.dispose(),this.notificationService.dispose(),this.displayService.dispose(),this.context.dispose(),this.figure.dispose()}registerViewModels(){T5.instance.register("text",this.textViewModel),T5.instance.register("braille",this.brailleViewModel),T5.instance.register("review",this.reviewViewModel),T5.instance.register("display",this.displayViewModel),T5.instance.register("help",this.helpViewModel),T5.instance.register("chat",this.chatViewModel),T5.instance.register("settings",this.settingsViewModel)}registerObservers(){this.figure.addObserver(this.textService),this.figure.addObserver(this.highlightService),this.figure.subplots.forEach(t=>t.forEach(n=>{n.addObserver(this.textService),n.addObserver(this.audioService),n.addObserver(this.brailleService),n.addObserver(this.highlightService),n.traces.forEach(l=>l.forEach(o=>{o.addObserver(this.audioService),o.addObserver(this.brailleService),o.addObserver(this.textService),o.addObserver(this.reviewService),o.addObserver(this.highlightService)}))}))}}document.readyState==="loading"?document.addEventListener(S4.DOM_LOADED,HB):HB();function HB(){const e=document.querySelectorAll(`[${xe.MAIDR_DATA}]`);if(e.forEach(l=>{const o=l.getAttribute(xe.MAIDR_DATA);if(o)try{const a=JSON.parse(o);SB(a,l)}catch(a){console.error("Error parsing maidr attribute:",a)}}),e.length!==0)return;const t=window.maidr;if(!t)return;const n=document.getElementById(t.id);n&&SB(t,n)}function SB(e,t){let n=null,l=null,o=null;const a=()=>{setTimeout(()=>{if(!n)return;const u=document.activeElement;n.contains(u)||(o==null||o.dispose(),o=null)},0)},i=()=>{setTimeout(()=>{if(!(!n||!l)&&!o){const u=JSON.parse(JSON.stringify(e));o=new bB(u,t,l)}},0)},s=document.createElement(xe.FIGURE);s.id=`${xe.MAIDR_FIGURE}-${e.id}`,t.parentNode.replaceChild(s,t),s.appendChild(t);const c=document.createElement(xe.ARTICLE);c.id=`${xe.MAIDR_ARTICLE}-${e.id}`,s.parentNode.replaceChild(c,s),c.appendChild(s),l=document.createElement(xe.DIV),l.id=`${xe.REACT_CONTAINER}-${e.id}`,s.appendChild(l),n=s,t.addEventListener(S4.FOCUS_IN,i),t.addEventListener(S4.CLICK,i),n.addEventListener(S4.FOCUS_OUT,a),(()=>{const u=JSON.parse(JSON.stringify(e));new bB(u,t,l).dispose()})()}});
666
+ tab, ${Dt.ctrl}+a, ${Dt.ctrl}+c`},Y0e={TOGGLE_SETTINGS:"esc"},K0e={ACTIVATE_TRACE_LABEL_SCOPE:"l",AUTOPLAY_UPWARD:`${Dt.ctrl}+shift+up`,AUTOPLAY_DOWNWARD:`${Dt.ctrl}+shift+down`,AUTOPLAY_FORWARD:`${Dt.ctrl}+shift+right`,AUTOPLAY_BACKWARD:`${Dt.ctrl}+shift+left`,STOP_AUTOPLAY:`${Dt.ctrl}, up, down, left, right`,SPEED_UP_AUTOPLAY:".",SPEED_DOWN_AUTOPLAY:",",RESET_AUTOPLAY_SPEED:"/",MOVE_UP:"up",MOVE_DOWN:"down",MOVE_RIGHT:"right",MOVE_LEFT:"left",MOVE_TO_TOP_EXTREME:`${Dt.ctrl}+up`,MOVE_TO_BOTTOM_EXTREME:`${Dt.ctrl}+down`,MOVE_TO_LEFT_EXTREME:`${Dt.ctrl}+left`,MOVE_TO_RIGHT_EXTREME:`${Dt.ctrl}+right`,MOVE_TO_SUBPLOT_CONTEXT:"esc",MOVE_TO_NEXT_TRACE:"pageup",MOVE_TO_PREV_TRACE:"pagedown",TOGGLE_BRAILLE:"b",TOGGLE_TEXT:"t",TOGGLE_AUDIO:"s",TOGGLE_REVIEW:"r",TOGGLE_HELP:`${Dt.ctrl}+/`,TOGGLE_CHAT:"shift+/",TOGGLE_SETTINGS:`${Dt.ctrl}+,`,DESCRIBE_POINT:"space"},J0e={[H1.BRAILLE]:q0e,[H1.CHAT]:$0e,[H1.FIGURE_LABEL]:U0e,[H1.HELP]:G0e,[H1.REVIEW]:W0e,[H1.SETTINGS]:Y0e,[H1.SUBPLOT]:Z0e,[H1.TRACE]:K0e,[H1.TRACE_LABEL]:X0e};class eae{constructor(t){ae(this,"commandFactory");this.commandFactory=new z0e(t)}register(t){q3.filter=n=>{const l=n.target;return l.tagName.toLowerCase()===xe.INPUT?l.id.startsWith(xe.REVIEW_INPUT):l.tagName.toLowerCase()===xe.TEXT_AREA?l.id.startsWith(xe.BRAILLE_TEXT_AREA):!0};for(const[n,l]of Object.entries(J0e))for(const[o,a]of Object.entries(l))o==="STOP_AUTOPLAY"&&q3("*",H1.TRACE,i=>{(q3.command||q3.ctrl)&&this.commandFactory.create(o).execute(i)}),q3(a,{scope:n},i=>{o!=="ALLOW_DEFAULT"&&(i.preventDefault(),this.commandFactory.create(o).execute(i))});q3.setScope(t)}unregister(){q3.unbind()}}class tae{constructor(){ae(this,"onChangeEmitter");ae(this,"onChange");this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose()}notify(t){t&&this.onChangeEmitter.fire({value:t})}}class nae{constructor(t,n,l){ae(this,"notification");ae(this,"display");ae(this,"text");ae(this,"enabled");ae(this,"onChangeEmitter");ae(this,"onChange");this.notification=t,this.display=n,this.text=l,this.enabled=!1,this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose()}update(t){if(!this.enabled||t.empty)return;const n=this.text.format(t);n&&this.onChangeEmitter.fire({value:n})}toggle(t){if(t.empty){this.notification.notify("No info for review");return}this.enabled=!this.enabled,this.update(t),this.display.toggleFocus(H1.REVIEW);const n=`Review is ${this.enabled?"on":"off"}`;this.notification.notify(n)}}const Ob="maidr-settings";class rae{constructor(t,n){ae(this,"storage");ae(this,"display");ae(this,"defaultSettings");ae(this,"currentSettings");ae(this,"observers");this.storage=t,this.display=n,this.observers=[],this.defaultSettings={general:{volume:50,highlightColor:"#03c809",brailleDisplaySize:32,minFrequency:200,maxFrequency:1e3,autoplayDuration:4e3,ariaMode:"assertive"},llm:{expertiseLevel:"basic",customInstruction:"",models:{OPENAI:{enabled:!1,apiKey:"",name:"OpenAI",version:"gpt-4o"},ANTHROPIC_CLAUDE:{enabled:!1,apiKey:"",name:"Anthropic Claude",version:"claude-3-7-sonnet-latest"},GOOGLE_GEMINI:{enabled:!1,apiKey:"",name:"Google Gemini",version:"gemini-2.0-flash"}}}};const l=this.storage.load(Ob);this.currentSettings=l??this.defaultSettings}get state(){return this.currentSettings}addObserver(t){this.observers.push(t)}removeObserver(t){this.observers=this.observers.filter(n=>n!==t)}notifyStateUpdate(){for(const t of this.observers)t.update(this.currentSettings)}loadSettings(){return this.currentSettings}saveSettings(t){this.currentSettings=t,this.storage.save(Ob,this.currentSettings),this.notifyStateUpdate()}resetSettings(){return this.currentSettings=this.defaultSettings,this.storage.remove(Ob),this.notifyStateUpdate(),this.currentSettings}toggle(){this.display.toggleFocus(H1.SETTINGS)}}class iae{save(t,n){try{const l=JSON.stringify(n);localStorage.setItem(t,l)}catch(l){console.error(`Error while saving ${t} to storage`,l)}}load(t){try{const n=localStorage.getItem(t);return n===null?null:JSON.parse(n)}catch(n){return console.error(`Error while loading ${t} from storage`,n),null}}remove(t){try{localStorage.removeItem(t)}catch(n){console.error(`Error while removing ${t} from storage`,n)}}}class aae{constructor(t){ae(this,"notification");ae(this,"mode");ae(this,"currentState",null);ae(this,"currentSubplotIndex",null);ae(this,"onChangeEmitter");ae(this,"onChange");this.notification=t,this.mode="verbose",this.onChangeEmitter=new Ms,this.onChange=this.onChangeEmitter.event}dispose(){this.onChangeEmitter.dispose()}getCurrentState(){return this.currentState}getCoordinateText(){return!this.currentState||this.currentState.empty?null:this.currentState.type==="subplot"&&!this.currentState.trace.empty?this.formatCoordinateText(this.currentState.trace):this.currentState.type==="trace"&&!this.currentState.empty?this.formatCoordinateText(this.currentState):null}isLayerSwitch(){if(!this.currentState||this.currentState.empty||this.currentState.type!=="subplot")return!1;const t=this.currentState.index;return this.currentSubplotIndex!==null&&this.currentSubplotIndex!==t?(this.currentSubplotIndex=t,!0):this.currentSubplotIndex===null?(this.currentSubplotIndex=t,t!==0):!1}formatCoordinateText(t){if(t.empty||!t.text)return null;const{text:n}=t,l=[];if(n.main&&n.main.value!==void 0){const o=Array.isArray(n.main.value)?n.main.value.join(", "):String(n.main.value);l.push(`${n.main.label} is ${o}`)}if(n.cross&&n.cross.value!==void 0){const o=Array.isArray(n.cross.value)?n.cross.value.join(", "):String(n.cross.value);l.push(`${n.cross.label} is ${o}`)}return n.fill&&n.fill.value!==void 0&&l.push(`${n.fill.label} is ${n.fill.value}`),l.length>0?l.join(", "):null}format(t){return typeof t=="string"?t:!t||t.empty?t.type==="subplot"?"No additional layer":`No ${t.type==="trace"?"plot":t.type} info to display`:t.type==="figure"?this.formatFigureText(t.index,t.size,t.traceTypes):t.type==="subplot"?this.formatSubplotText(t.index,t.size,t.trace.traceType,t.trace):this.mode==="verbose"?this.formatVerboseTraceText(t.text):this.formatTerseTraceText(t.text)}formatFigureText(t,n,l){const o=l.length===1?`This is a ${l[0]} plot`:`This is a multi-layered plot containing ${l.join(xe.COMMA_SPACE)} plots`;return`Subplot ${t} of ${n}: ${o}. Press 'ENTER' to select this subplot.`}formatSubplotText(t,n,l,o){const a=o&&!o.empty?o.plotType:l;return`Layer ${t} of ${n}: ${a} plot`}formatVerboseTraceText(t){const n=new Array;return n.push(t.main.label,xe.IS),t.range!==void 0?n.push(String(t.range.min),xe.THROUGH,String(t.range.max)):Array.isArray(t.main.value)?n.push(t.main.value.join(xe.COMMA_SPACE)):n.push(String(t.main.value)),n.push(xe.COMMA_SPACE,t.cross.label),t.section!==void 0&&(n.push(xe.COMMA_SPACE),Array.isArray(t.cross.value)&&n.push(String(t.cross.value.length),xe.SPACE),n.push(t.section)),Array.isArray(t.cross.value)?t.cross.value.length>1?n.push(xe.ARE,t.cross.value.join(xe.COMMA_SPACE)):t.cross.value.length>0&&n.push(xe.IS,t.cross.value.join(xe.COMMA_SPACE)):n.push(xe.IS,String(t.cross.value)),t.fill!==void 0&&n.push(xe.COMMA_SPACE,t.fill.label,xe.IS,t.fill.value),n.join(xe.EMPTY)}formatTerseTraceText(t){const n=new Array;return Array.isArray(t.main.value)?n.push(xe.OPEN_BRACKET,t.main.value.join(xe.COMMA_SPACE),xe.CLOSE_BRACKET):n.push(String(t.main.value),xe.COMMA_SPACE),t.section!==void 0&&t.fill!==void 0?Array.isArray(t.cross.value)?n.push(xe.OPEN_BRACKET,t.cross.value.join(xe.COMMA_SPACE),xe.CLOSE_BRACKET,xe.COMMA_SPACE,t.section):n.push(String(t.cross.value),xe.COMMA_SPACE,t.section):Array.isArray(t.cross.value)?n.push(xe.OPEN_BRACKET,t.cross.value.join(xe.COMMA_SPACE),xe.CLOSE_BRACKET):n.push(String(t.cross.value)),t.section!==void 0&&t.fill===void 0&&(n.push(xe.COMMA_SPACE),Array.isArray(t.cross.value)&&n.push(String(t.cross.value.length),xe.SPACE),n.push(t.section)),t.fill!==void 0&&(t.section!==void 0?n.push(xe.SPACE,t.fill.value):n.push(xe.COMMA_SPACE,t.fill.value)),n.join(xe.EMPTY)}update(t){if(this.mode==="off")return;if(this.currentState=t,t.type==="subplot"){const l=this.format(t);l&&this.notification.notify(l);return}const n=this.format(t);n&&this.onChangeEmitter.fire({value:n})}toggle(){switch(this.mode){case"off":this.mode="verbose";break;case"terse":this.mode="off";break;case"verbose":this.mode="terse";break}const t=`Text mode is ${this.mode}`;return this.notification.notify(t),this.mode!=="off"}}class bB{constructor(t,n,l){ae(this,"figure");ae(this,"context");ae(this,"displayService");ae(this,"notificationService");ae(this,"settingsService");ae(this,"audioService");ae(this,"brailleService");ae(this,"textService");ae(this,"reviewService");ae(this,"autoplayService");ae(this,"highlightService");ae(this,"helpService");ae(this,"chatService");ae(this,"textViewModel");ae(this,"brailleViewModel");ae(this,"reviewViewModel");ae(this,"displayViewModel");ae(this,"helpViewModel");ae(this,"chatViewModel");ae(this,"settingsViewModel");ae(this,"keybinding");this.figure=new gj(t),this.context=new RI(this.figure),this.displayService=new o0e(this.context,n,l),this.notificationService=new tae;const o=new iae;this.settingsService=new rae(o,this.displayService),this.audioService=new Hj(this.notificationService,this.context.state,this.settingsService),this.brailleService=new Dj(this.context,this.notificationService,this.displayService),this.textService=new aae(this.notificationService),this.reviewService=new nae(this.notificationService,this.displayService,this.textService),this.autoplayService=new _j(this.context,this.notificationService,this.settingsService),this.highlightService=new s0e(this.settingsService),this.helpService=new l0e(this.context,this.displayService),this.chatService=new jj(this.displayService,t),this.textViewModel=new tq(ja,this.textService,this.notificationService,this.autoplayService),this.brailleViewModel=new Sz(ja,this.brailleService),this.reviewViewModel=new $z(ja,this.reviewService),this.displayViewModel=new Nz(ja,this.displayService),this.helpViewModel=new jz(ja,this.helpService),this.chatViewModel=new Vz(ja,this.chatService,this.audioService),this.settingsViewModel=new Zz(ja,this.settingsService),this.notificationService.notify(this.context.getInstruction(!1)),this.keybinding=new eae({context:this.context,audioService:this.audioService,autoplayService:this.autoplayService,highlightService:this.highlightService,brailleViewModel:this.brailleViewModel,chatViewModel:this.chatViewModel,helpViewModel:this.helpViewModel,reviewViewModel:this.reviewViewModel,settingsViewModel:this.settingsViewModel,textViewModel:this.textViewModel}),this.registerViewModels(),this.registerObservers(),this.settingsService.addObserver(this.highlightService),this.keybinding.register(this.context.scope)}dispose(){this.keybinding.unregister(),T5.instance.dispose(),this.settingsViewModel.dispose(),this.chatViewModel.dispose(),this.helpViewModel.dispose(),this.displayViewModel.dispose(),this.reviewViewModel.dispose(),this.brailleViewModel.dispose(),this.textViewModel.dispose(),this.highlightService.dispose(),this.autoplayService.dispose(),this.textService.dispose(),this.reviewService.dispose(),this.brailleService.dispose(),this.audioService.dispose(),this.notificationService.dispose(),this.displayService.dispose(),this.context.dispose(),this.figure.dispose()}registerViewModels(){T5.instance.register("text",this.textViewModel),T5.instance.register("braille",this.brailleViewModel),T5.instance.register("review",this.reviewViewModel),T5.instance.register("display",this.displayViewModel),T5.instance.register("help",this.helpViewModel),T5.instance.register("chat",this.chatViewModel),T5.instance.register("settings",this.settingsViewModel)}registerObservers(){this.figure.addObserver(this.textService),this.figure.addObserver(this.highlightService),this.figure.addObserver(this.audioService),this.figure.subplots.forEach(t=>t.forEach(n=>{n.addObserver(this.textService),n.addObserver(this.brailleService),n.addObserver(this.highlightService),n.traces.forEach(l=>l.forEach(o=>{o.addObserver(this.audioService),o.addObserver(this.brailleService),o.addObserver(this.textService),o.addObserver(this.reviewService),o.addObserver(this.highlightService)}))}))}}document.readyState==="loading"?document.addEventListener(S4.DOM_LOADED,HB):HB();function HB(){const e=document.querySelectorAll(`[${xe.MAIDR_DATA}]`);if(e.forEach(l=>{const o=l.getAttribute(xe.MAIDR_DATA);if(o)try{const a=JSON.parse(o);SB(a,l)}catch(a){console.error("Error parsing maidr attribute:",a)}}),e.length!==0)return;const t=window.maidr;if(!t)return;const n=document.getElementById(t.id);n&&SB(t,n)}function SB(e,t){let n=null,l=null,o=null;const a=()=>{setTimeout(()=>{if(!n)return;const u=document.activeElement;n.contains(u)||(o==null||o.dispose(),o=null)},0)},i=()=>{setTimeout(()=>{if(!(!n||!l)&&!o){const u=JSON.parse(JSON.stringify(e));o=new bB(u,t,l)}},0)},s=document.createElement(xe.FIGURE);s.id=`${xe.MAIDR_FIGURE}-${e.id}`,t.parentNode.replaceChild(s,t),s.appendChild(t);const c=document.createElement(xe.ARTICLE);c.id=`${xe.MAIDR_ARTICLE}-${e.id}`,s.parentNode.replaceChild(c,s),c.appendChild(s),l=document.createElement(xe.DIV),l.id=`${xe.REACT_CONTAINER}-${e.id}`,s.appendChild(l),n=s,t.addEventListener(S4.FOCUS_IN,i),t.addEventListener(S4.CLICK,i),n.addEventListener(S4.FOCUS_OUT,a),(()=>{const u=JSON.parse(JSON.stringify(e));new bB(u,t,l).dispose()})()}});
667
667
  //# sourceMappingURL=maidr.js.map