e===t){return e.length===t.length&&e.every((e,n)=>r(e,t[n]))}(e,t)}const tW={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}%`})}},rW=e=>e;let nW;function oW(){return void 0===nW&&(nW="undefined"==typeof CSS||"function"!=typeof CSS.supports||CSS.supports("touch-action","none")),nW}function iW(t){const{"aria-labelledby":r,defaultValue:n,disabled:o=!1,disableSwap:i=!1,isRtl:a=!1,marks:s=!1,max:l=100,min:c=0,name:u,onChange:d,onChangeCommitted:p,orientation:h="horizontal",rootRef:f,scale:m=rW,step:g=1,shiftStep:b=10,tabIndex:y,value:v}=t,x=e.useRef(),[w,_]=e.useState(-1),[C,k]=e.useState(-1),[S,A]=e.useState(!1),j=e.useRef(0),[R,I]=function({controlled:t,default:r,name:n,state:o="value"}){const{current:i}=e.useRef(void 0!==t),[a,s]=e.useState(r);return[i?t:a,e.useCallback(e=>{i||s(e)},[])]}({controlled:v,default:null!=n?n:c,name:"Slider"}),M=d&&((e,t,r)=>{const n=e.nativeEvent||e,o=new n.constructor(n.type,n);Object.defineProperty(o,"target",{writable:!0,value:{value:t,name:u}}),d(o,t,r)}),E=Array.isArray(R);let T=E?R.slice().sort(GH):[R];T=T.map(e=>null==e?c:FH(e,c,l));const O=!0===s&&null!==g?[...Array(Math.floor((l-c)/g)+1)].map((e,t)=>({value:c+g*t})):s||[],P=O.map(e=>e.value),{isFocusVisibleRef:L,onBlur:z,onFocus:N,ref:F}=UH(),[D,B]=e.useState(-1),$=e.useRef(),H=es(F,$),W=es(f,H),V=e=>t=>{var r;const n=Number(t.currentTarget.getAttribute("data-index"));N(t),!0===L.current&&B(n),k(n),null==e||null==(r=e.onFocus)||r.call(e,t)},q=e=>t=>{var r;z(t),!1===L.current&&B(-1),k(-1),null==e||null==(r=e.onBlur)||r.call(e,t)},U=(e,t)=>{const r=Number(e.currentTarget.getAttribute("data-index")),n=T[r],o=P.indexOf(n);let a=t;if(O&&null==g){const e=P[P.length-1];a=a>e?e:at=>{var r;if(null!==g){const e=Number(t.currentTarget.getAttribute("data-index")),r=T[e];let n=null;("ArrowLeft"===t.key||"ArrowDown"===t.key)&&t.shiftKey||"PageDown"===t.key?n=Math.max(r-b,c):(("ArrowRight"===t.key||"ArrowUp"===t.key)&&t.shiftKey||"PageUp"===t.key)&&(n=Math.min(r+b,l)),null!==n&&(U(t,n),t.preventDefault())}null==e||null==(r=e.onKeyDown)||r.call(e,t)};ns(()=>{var e;o&&$.current.contains(document.activeElement)&&(null==(e=document.activeElement)||e.blur())},[o]),o&&-1!==w&&_(-1),o&&-1!==D&&B(-1);const G=e.useRef();let K=h;a&&"horizontal"===h&&(K+="-reverse");const X=({finger:e,move:t=!1})=>{const{current:r}=$,{width:n,height:o,bottom:a,left:s}=r.getBoundingClientRect();let u,d;if(u=0===K.indexOf("vertical")?(a-e.y)/o:(e.x-s)/n,-1!==K.indexOf("-reverse")&&(u=1-u),d=function(e,t,r){return(r-t)*e+t}(u,c,l),g)d=function(e,t,r){const n=Math.round((e-r)/t)*t+r;return Number(n.toFixed(function(e){if(Math.abs(e)<1){const t=e.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}(t)))}(d,g,c);else{const e=KH(P,d);d=P[e]}d=FH(d,c,l);let p=0;if(E){p=t?G.current:KH(T,d),i&&(d=FH(d,T[p-1]||-1/0,T[p+1]||1/0));const e=d;d=YH({values:T,newValue:d,index:p}),i&&t||(p=d.indexOf(e),G.current=p)}return{newValue:d,activeIndex:p}},J=os(e=>{const t=XH(e,x);if(!t)return;if(j.current+=1,"mousemove"===e.type&&0===e.buttons)return void Y(e);const{newValue:r,activeIndex:n}=X({finger:t,move:!0});QH({sliderRef:$,activeIndex:n,setActive:_}),I(r),!S&&j.current>2&&A(!0),M&&!eW(r,R)&&M(e,r,n)}),Y=os(e=>{const t=XH(e,x);if(A(!1),!t)return;const{newValue:r}=X({finger:t,move:!0});_(-1),"touchend"===e.type&&k(-1),p&&p(e,r),x.current=void 0,ee()}),Q=os(e=>{if(o)return;oW()||e.preventDefault();const t=e.changedTouches[0];null!=t&&(x.current=t.identifier);const r=XH(e,x);if(!1!==r){const{newValue:t,activeIndex:n}=X({finger:r});QH({sliderRef:$,activeIndex:n,setActive:_}),I(t),M&&!eW(t,R)&&M(e,t,n)}j.current=0;const n=is($.current);n.addEventListener("touchmove",J,{passive:!0}),n.addEventListener("touchend",Y,{passive:!0})}),ee=e.useCallback(()=>{const e=is($.current);e.removeEventListener("mousemove",J),e.removeEventListener("mouseup",Y),e.removeEventListener("touchmove",J),e.removeEventListener("touchend",Y)},[Y,J]);e.useEffect(()=>{const{current:e}=$;return e.addEventListener("touchstart",Q,{passive:oW()}),()=>{e.removeEventListener("touchstart",Q),ee()}},[ee,Q]),e.useEffect(()=>{o&&ee()},[o,ee]);const te=JH(E?T[0]:c,c,l),re=JH(T[T.length-1],c,l)-te,ne=e=>t=>{var r;null==(r=e.onMouseLeave)||r.call(e,t),k(-1)};return{active:w,axis:K,axisProps:tW,dragging:S,focusedThumbIndex:D,getHiddenInputProps:(e={})=>{var n;const i=Li(e),s={onChange:(d=i||{},e=>{var t;null==(t=d.onChange)||t.call(d,e),U(e,e.target.valueAsNumber)}),onFocus:V(i||{}),onBlur:q(i||{}),onKeyDown:Z(i||{})};var d;const p=(0,Se.A)({},i,s);return(0,Se.A)({tabIndex:y,"aria-labelledby":r,"aria-orientation":h,"aria-valuemax":m(l),"aria-valuemin":m(c),name:u,type:"range",min:t.min,max:t.max,step:null===t.step&&t.marks?"any":null!=(n=t.step)?n:void 0,disabled:o},e,p,{style:(0,Se.A)({},ZH,{direction:a?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:(e={})=>{const t=Li(e),r={onMouseDown:(n=t||{},e=>{var t;if(null==(t=n.onMouseDown)||t.call(n,e),o)return;if(e.defaultPrevented)return;if(0!==e.button)return;e.preventDefault();const r=XH(e,x);if(!1!==r){const{newValue:t,activeIndex:n}=X({finger:r});QH({sliderRef:$,activeIndex:n,setActive:_}),I(t),M&&!eW(t,R)&&M(e,t,n)}j.current=0;const i=is($.current);i.addEventListener("mousemove",J,{passive:!0}),i.addEventListener("mouseup",Y)})};var n;const i=(0,Se.A)({},t,r);return(0,Se.A)({},e,{ref:W},i)},getThumbProps:(e={})=>{const t=Li(e),r={onMouseOver:(n=t||{},e=>{var t;null==(t=n.onMouseOver)||t.call(n,e);const r=Number(e.currentTarget.getAttribute("data-index"));k(r)}),onMouseLeave:ne(t||{})};var n;return(0,Se.A)({},e,t,r)},marks:O,open:C,range:E,rootRef:W,trackLeap:re,trackOffset:te,values:T,getThumbStyle:e=>({pointerEvents:-1!==w&&w!==e?"none":void 0})}}function aW(e){return ho("MuiSlider",e)}const sW=fo("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"]),lW=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"],cW=Ei();function uW(e){return e}const dW=jo("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${wi(r.color)}`],"medium"!==r.size&&t[`size${wi(r.size)}`],r.marked&&t.marked,"vertical"===r.orientation&&t.vertical,"inverted"===r.track&&t.trackInverted,!1===r.track&&t.trackFalse]}})(({theme:e})=>{var t;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${sW.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${sW.dragging}`]:{[`& .${sW.thumb}, & .${sW.track}`]:{transition:"none"}},variants:[...Object.keys((null!=(t=e.vars)?t:e).palette).filter(t=>{var r;return(null!=(r=e.vars)?r:e).palette[t].main}).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}}]}}),pW=jo("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.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}}]}),hW=jo("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e})=>{var t;return{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.keys((null!=(t=e.vars)?t:e).palette).filter(t=>{var r;return(null!=(r=e.vars)?r:e).palette[t].main}).map(t=>({props:{color:t,track:"inverted"},style:(0,Se.A)({},e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:(0,Se.A)({backgroundColor:(0,Oe.a)(e.palette[t].main,.62),borderColor:(0,Oe.a)(e.palette[t].main,.62)},e.applyStyles("dark",{backgroundColor:(0,Oe.e$)(e.palette[t].main,.5)}),e.applyStyles("dark",{borderColor:(0,Oe.e$)(e.palette[t].main,.5)})))}))]}}),fW=jo("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${wi(r.color)}`],"medium"!==r.size&&t[`thumbSize${wi(r.size)}`]]}})(({theme:e})=>{var t;return{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%)"},[`&.${sW.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.keys((null!=(t=e.vars)?t:e).palette).filter(t=>{var r;return(null!=(r=e.vars)?r:e).palette[t].main}).map(t=>({props:{color:t},style:{[`&:hover, &.${sW.focusVisible}`]:(0,Se.A)({},e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${(0,Oe.X4)(e.palette[t].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${sW.active}`]:(0,Se.A)({},e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)}`}:{boxShadow:`0px 0px 0px 14px ${(0,Oe.X4)(e.palette[t].main,.16)}`})}}))]}}),mW=jo(function(t){const{children:r,className:n,value:o}=t,i=(e=>{const{open:t}=e;return{offset:ao(t&&sW.valueLabelOpen),circle:sW.valueLabelCircle,label:sW.valueLabelLabel}})(t);return r?e.cloneElement(r,{className:ao(r.props.className)},(0,Nt.jsxs)(e.Fragment,{children:[r.props.children,(0,Nt.jsx)("span",{className:ao(i.offset,n),"aria-hidden":!0,children:(0,Nt.jsx)("span",{className:i.circle,children:(0,Nt.jsx)("span",{className:i.label,children:o})})})]})):null},{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e})=>(0,Se.A)({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%"},[`&.${sW.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%"},[`&.${sW.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"}}]})),gW=jo("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>So(e)&&"markActive"!==e,overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(({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}}]})),bW=jo("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>So(e)&&"markLabelActive"!==e,overridesResolver:(e,t)=>t.markLabel})(({theme:e})=>(0,Se.A)({},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}}]})),yW=({children:e})=>e,vW=e.forwardRef(function(t,r){var n,o,i,a,s,l,c,u,d,p,h,f,m,g,b,y,v,x,w,_,C,k,S,A;const j=cW({props:t,name:"MuiSlider"}),R=Wt(),{"aria-label":I,"aria-valuetext":M,"aria-labelledby":E,component:T="span",components:O={},componentsProps:P={},color:L="primary",classes:z,className:N,disableSwap:F=!1,disabled:D=!1,getAriaLabel:B,getAriaValueText:$,marks:H=!1,max:W=100,min:V=0,orientation:q="horizontal",shiftStep:U=10,size:Z="medium",step:G=1,scale:K=uW,slotProps:X,slots:J,track:Y="normal",valueLabelDisplay:Q="off",valueLabelFormat:ee=uW}=j,te=(0,Ae.A)(j,lW),re=(0,Se.A)({},j,{isRtl:R,max:W,min:V,classes:z,disabled:D,disableSwap:F,orientation:q,marks:H,color:L,size:Z,step:G,shiftStep:U,scale:K,track:Y,valueLabelDisplay:Q,valueLabelFormat:ee}),{axisProps:ne,getRootProps:oe,getHiddenInputProps:ie,getThumbProps:ae,open:se,active:le,axis:ce,focusedThumbIndex:ue,range:de,dragging:pe,marks:he,values:fe,trackOffset:me,trackLeap:ge,getThumbStyle:be}=iW((0,Se.A)({},re,{rootRef:r}));re.marked=he.length>0&&he.some(e=>e.label),re.dragging=pe,re.focusedThumbIndex=ue;const ye=(e=>{const{disabled:t,dragging:r,marked:n,orientation:o,track:i,classes:a,color:s,size:l}=e;return _o({root:["root",t&&"disabled",r&&"dragging",n&&"marked","vertical"===o&&"vertical","inverted"===i&&"trackInverted",!1===i&&"trackFalse",s&&`color${wi(s)}`,l&&`size${wi(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${wi(l)}`,s&&`thumbColor${wi(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]},aW,a)})(re),ve=null!=(n=null!=(o=null==J?void 0:J.root)?o:O.Root)?n:dW,xe=null!=(i=null!=(a=null==J?void 0:J.rail)?a:O.Rail)?i:pW,we=null!=(s=null!=(l=null==J?void 0:J.track)?l:O.Track)?s:hW,_e=null!=(c=null!=(u=null==J?void 0:J.thumb)?u:O.Thumb)?c:fW,Ce=null!=(d=null!=(p=null==J?void 0:J.valueLabel)?p:O.ValueLabel)?d:mW,ke=null!=(h=null!=(f=null==J?void 0:J.mark)?f:O.Mark)?h:gW,je=null!=(m=null!=(g=null==J?void 0:J.markLabel)?g:O.MarkLabel)?m:bW,Re=null!=(b=null!=(y=null==J?void 0:J.input)?y:O.Input)?b:"input",Ie=null!=(v=null==X?void 0:X.root)?v:P.root,Me=null!=(x=null==X?void 0:X.rail)?x:P.rail,Ee=null!=(w=null==X?void 0:X.track)?w:P.track,Te=null!=(_=null==X?void 0:X.thumb)?_:P.thumb,Oe=null!=(C=null==X?void 0:X.valueLabel)?C:P.valueLabel,Pe=null!=(k=null==X?void 0:X.mark)?k:P.mark,Le=null!=(S=null==X?void 0:X.markLabel)?S:P.markLabel,ze=null!=(A=null==X?void 0:X.input)?A:P.input,Ne=rs({elementType:ve,getSlotProps:oe,externalSlotProps:Ie,externalForwardedProps:te,additionalProps:(0,Se.A)({},(qe=ve,(!qe||!Fi(qe))&&{as:T})),ownerState:(0,Se.A)({},re,null==Ie?void 0:Ie.ownerState),className:[ye.root,N]}),Fe=rs({elementType:xe,externalSlotProps:Me,ownerState:re,className:ye.rail}),De=rs({elementType:we,externalSlotProps:Ee,additionalProps:{style:(0,Se.A)({},ne[ce].offset(me),ne[ce].leap(ge))},ownerState:(0,Se.A)({},re,null==Ee?void 0:Ee.ownerState),className:ye.track}),Be=rs({elementType:_e,getSlotProps:ae,externalSlotProps:Te,ownerState:(0,Se.A)({},re,null==Te?void 0:Te.ownerState),className:ye.thumb}),$e=rs({elementType:Ce,externalSlotProps:Oe,ownerState:(0,Se.A)({},re,null==Oe?void 0:Oe.ownerState),className:ye.valueLabel}),He=rs({elementType:ke,externalSlotProps:Pe,ownerState:re,className:ye.mark}),We=rs({elementType:je,externalSlotProps:Le,ownerState:re,className:ye.markLabel}),Ve=rs({elementType:Re,getSlotProps:ie,externalSlotProps:ze,ownerState:re});var qe;return(0,Nt.jsxs)(ve,(0,Se.A)({},Ne,{children:[(0,Nt.jsx)(xe,(0,Se.A)({},Fe)),(0,Nt.jsx)(we,(0,Se.A)({},De)),he.filter(e=>e.value>=V&&e.value<=W).map((t,r)=>{const n=JH(t.value,V,W),o=ne[ce].offset(n);let i;return i=!1===Y?-1!==fe.indexOf(t.value):"normal"===Y&&(de?t.value>=fe[0]&&t.value<=fe[fe.length-1]:t.value<=fe[0])||"inverted"===Y&&(de?t.value<=fe[0]||t.value>=fe[fe.length-1]:t.value>=fe[0]),(0,Nt.jsxs)(e.Fragment,{children:[(0,Nt.jsx)(ke,(0,Se.A)({"data-index":r},He,!Fi(ke)&&{markActive:i},{style:(0,Se.A)({},o,He.style),className:ao(He.className,i&&ye.markActive)})),null!=t.label?(0,Nt.jsx)(je,(0,Se.A)({"aria-hidden":!0,"data-index":r},We,!Fi(je)&&{markLabelActive:i},{style:(0,Se.A)({},o,We.style),className:ao(ye.markLabel,We.className,i&&ye.markLabelActive),children:t.label})):null]},r)}),fe.map((e,t)=>{const r=JH(e,V,W),n=ne[ce].offset(r),o="off"===Q?yW:Ce;return(0,Nt.jsx)(o,(0,Se.A)({},!Fi(o)&&{valueLabelFormat:ee,valueLabelDisplay:Q,value:"function"==typeof ee?ee(K(e),t):ee,index:t,open:se===t||le===t||"on"===Q,disabled:D},$e,{children:(0,Nt.jsx)(_e,(0,Se.A)({"data-index":t},Be,{className:ao(ye.thumb,Be.className,le===t&&ye.active,ue===t&&ye.focusVisible),style:(0,Se.A)({},n,be(t),Be.style),children:(0,Nt.jsx)(Re,(0,Se.A)({"data-index":t,"aria-label":B?B(t):I,"aria-valuenow":K(e),"aria-labelledby":E,"aria-valuetext":$?$(K(e),t):M,value:fe[t]},Ve))}))}),t)})]}))}),xW=vW;var wW=t().forwardRef((e,r)=>t().createElement(xW,{...e,ref:r}));function _W(t){if("undefined"==typeof window)return t;const r=e.useRef(null);return e.useLayoutEffect(()=>{r.current=t}),e.useCallback((...e)=>{var t;null===(t=r.current)||void 0===t||t.call(r,...e)},[])}const CW={},kW={isOpen:!1,setAnchorElUsed:!1,anchorEl:void 0,anchorPosition:void 0,hovered:!1,focused:!1,_openEventType:null,_childPopupState:null,_deferNextOpen:!1,_deferNextClose:!1};function SW({isOpen:e,popupId:t,variant:r}){return{..."popover"===r?{"aria-haspopup":!0,"aria-controls":e&&null!=t?t:void 0}:"popper"===r?{"aria-describedby":e&&null!=t?t:void 0}:void 0}}function AW({isOpen:e,anchorEl:t,anchorPosition:r,close:n,popupId:o,onMouseLeave:i,disableAutoFocus:a,_openEventType:s}){return{id:o,anchorEl:t,anchorPosition:r,anchorReference:"contextmenu"===s?"anchorPosition":"anchorEl",open:e,onClose:n,onMouseLeave:i,...a&&{disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0}}}function jW(e,t){const{anchorEl:r,_childPopupState:n}=t;return RW(r,e)||RW(function(e,{popupId:t}){if(!t)return null;const r="function"==typeof e.getRootNode?e.getRootNode():document;return"function"==typeof r.getElementById?r.getElementById(t):null}(e,t),e)||null!=n&&jW(e,n)}function RW(e,t){if(!e)return!1;for(;t;){if(t===e)return!0;t=t.parentElement}return!1}let IW=0;var MW=({popupId:t,...r})=>function({parentPopupState:t,popupId:r,variant:n,disableAutoFocus:o}){const i=(0,e.useRef)(!0);(0,e.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);const[a,s]=(0,e.useState)(kW),l=(0,e.useCallback)(e=>{i.current&&s(e)},[]),c=(0,e.useCallback)(e=>l(t=>({...t,setAnchorElUsed:!0,anchorEl:e??void 0})),[]),u=_W(e=>(a.isOpen?h(e):d(e),a)),d=_W(e=>{const r=e instanceof Element?void 0:e,o=e instanceof Element?e:(null==e?void 0:e.currentTarget)instanceof Element?e.currentTarget:void 0;if("touchstart"===(null==r?void 0:r.type))return void l(e=>({...e,_deferNextOpen:!0}));const i=null==r?void 0:r.clientX,a=null==r?void 0:r.clientY,s="number"==typeof i&&"number"==typeof a?{left:i,top:a}:void 0,c=i=>{if(e||i.setAnchorElUsed||"dialog"===n||CW.missingEventOrAnchorEl||(CW.missingEventOrAnchorEl=!0,console.error("[material-ui-popup-state] WARNING","eventOrAnchorEl should be defined if setAnchorEl is not used")),t){if(!t.isOpen)return i;setTimeout(()=>t._setChildPopupState(y))}const a={...i,isOpen:!0,anchorPosition:s,hovered:"mouseover"===(null==r?void 0:r.type)||i.hovered,focused:"focus"===(null==r?void 0:r.type)||i.focused,_openEventType:null==r?void 0:r.type};return null!=r&&r.currentTarget?i.setAnchorElUsed||(a.anchorEl=null==r?void 0:r.currentTarget):o&&(a.anchorEl=o),a};l(e=>e._deferNextOpen?(setTimeout(()=>l(c),0),{...e,_deferNextOpen:!1}):c(e))}),p=e=>{const{_childPopupState:r}=e;return setTimeout(()=>{null==r||r.close(),null==t||t._setChildPopupState(null)}),{...e,isOpen:!1,hovered:!1,focused:!1}},h=_W(e=>{const t=e instanceof Element?void 0:e;"touchstart"!==(null==t?void 0:t.type)?l(e=>e._deferNextClose?(setTimeout(()=>l(p),0),{...e,_deferNextClose:!1}):p(e)):l(e=>({...e,_deferNextClose:!0}))}),f=(0,e.useCallback)((e,t)=>{e?d(t):h(t)},[]),m=_W(e=>{const{relatedTarget:t}=e;l(e=>!e.hovered||t instanceof Element&&jW(t,y)?e:e.focused?{...e,hovered:!1}:p(e))}),g=_W(e=>{if(!e)return;const{relatedTarget:t}=e;l(e=>!e.focused||t instanceof Element&&jW(t,y)?e:e.hovered?{...e,focused:!1}:p(e))}),b=(0,e.useCallback)(e=>l(t=>({...t,_childPopupState:e})),[]),y={...a,setAnchorEl:c,popupId:r,variant:n,open:d,close:h,toggle:u,setOpen:f,onBlur:g,onMouseLeave:m,disableAutoFocus:o??Boolean(a.hovered||a.focused),_setChildPopupState:b};return y}({...r,popupId:(0,e.useRef)(t||"eui-popup-"+IW++).current});function EW(){return(EW=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}function OW(t){var r=(0,e.useRef)(t),n=(0,e.useRef)(function(e){r.current&&r.current(e)});return r.current=t,n.current}var PW=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e0:e.buttons>0)&&i.current?a(NW(i.current,e,l.current)):r(!1)},t=function(){return r(!1)};function r(r){var n=c.current,o=zW(i.current),a=r?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,n=i.current;if(n&&(FW(t),!function(e,t){return t&&!LW(e)}(t,c.current)&&n)){if(LW(t)){c.current=!0;var o=t.changedTouches||[];o.length&&(l.current=o[0].identifier)}n.focus(),a(NW(n,t,l.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]},[s,a]),d=u[0],p=u[1],h=u[2];return(0,e.useEffect)(function(){return h},[h]),e.createElement("div",EW({},o,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:p,tabIndex:0,role:"slider"}))}),BW=function(e){return e.filter(Boolean).join(" ")},$W=function(t){var r=t.color,n=t.left,o=t.top,i=void 0===o?.5:o,a=BW(["react-colorful__pointer",t.className]);return e.createElement("div",{className:a,style:{top:100*i+"%",left:100*n+"%"}},e.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:r}}))},HW=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},WW={grad:.9,turn:360,rad:360/(2*Math.PI)},VW=function(e){return iV(qW(e))},qW=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?HW(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?HW(parseInt(e.substring(6,8),16)/255,2):1}},UW=function(e,t){return void 0===t&&(t="deg"),Number(e)*(WW[t]||1)},ZW=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?KW({h:UW(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},GW=ZW,KW=function(e){var t=e.s,r=e.l;return{h:e.h,s:(t*=(r<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}},XW=function(e){return oV(eV(e))},JW=function(e){var t=e.s,r=e.v,n=e.a,o=(200-t)*r/100;return{h:HW(e.h),s:HW(o>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0),l:HW(o/2),a:HW(n,2)}},YW=function(e){var t=JW(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},QW=function(e){var t=JW(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},eV=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var i=Math.floor(t),a=n*(1-r),s=n*(1-(t-i)*r),l=n*(1-(1-t+i)*r),c=i%6;return{r:HW(255*[n,s,a,a,l,n][c]),g:HW(255*[l,n,n,s,a,a][c]),b:HW(255*[a,a,l,n,n,s][c]),a:HW(o,2)}},tV=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?iV({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},rV=tV,nV=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},oV=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=o<1?nV(HW(255*o)):"";return"#"+nV(t)+nV(r)+nV(n)+i},iV=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=Math.max(t,r,n),a=i-Math.min(t,r,n),s=a?i===t?(r-n)/a:i===r?2+(n-t)/a:4+(t-r)/a:0;return{h:HW(60*(s<0?s+6:s)),s:HW(i?a/i*100:0),v:HW(i/255*100),a:o}},aV=e.memo(function(t){var r=t.hue,n=t.onChange,o=BW(["react-colorful__hue",t.className]);return e.createElement("div",{className:o},e.createElement(DW,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:PW(r+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":HW(r),"aria-valuemax":"360","aria-valuemin":"0"},e.createElement($W,{className:"react-colorful__hue-pointer",left:r/360,color:YW({h:r,s:100,v:100,a:1})})))}),sV=e.memo(function(t){var r=t.hsva,n=t.onChange,o={backgroundColor:YW({h:r.h,s:100,v:100,a:1})};return e.createElement("div",{className:"react-colorful__saturation",style:o},e.createElement(DW,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:PW(r.s+100*e.left,0,100),v:PW(r.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+HW(r.s)+"%, Brightness "+HW(r.v)+"%"},e.createElement($W,{className:"react-colorful__saturation-pointer",top:1-r.v/100,left:r.s/100,color:YW(r)})))}),lV=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},cV=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},uV=function(e,t){return e.toLowerCase()===t.toLowerCase()||lV(qW(e),qW(t))};function dV(t,r,n){var o=OW(n),i=(0,e.useState)(function(){return t.toHsva(r)}),a=i[0],s=i[1],l=(0,e.useRef)({color:r,hsva:a});(0,e.useEffect)(function(){if(!t.equal(r,l.current.color)){var e=t.toHsva(r);l.current={hsva:e,color:r},s(e)}},[r,t]),(0,e.useEffect)(function(){var e;lV(a,l.current.hsva)||t.equal(e=t.fromHsva(a),l.current.color)||(l.current={hsva:a,color:e},o(e))},[a,t,o]);var c=(0,e.useCallback)(function(e){s(function(t){return Object.assign({},t,e)})},[]);return[a,c]}var pV="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,hV=new Map,fV=function(e){pV(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!hV.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',hV.set(t,n);var o=r.nc;o&&n.setAttribute("nonce",o),t.head.appendChild(n)}},[])},mV=function(t){var r=t.className,n=t.colorModel,o=t.color,i=void 0===o?n.defaultColor:o,a=t.onChange,s=TW(t,["className","colorModel","color","onChange"]),l=(0,e.useRef)(null);fV(l);var c=dV(n,i,a),u=c[0],d=c[1],p=BW(["react-colorful",r]);return e.createElement("div",EW({},s,{ref:l,className:p}),e.createElement(sV,{hsva:u,onChange:d}),e.createElement(aV,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},gV={defaultColor:"000",toHsva:VW,fromHsva:function(e){return XW({h:e.h,s:e.s,v:e.v,a:1})},equal:uV},bV=function(t){var r=t.className,n=t.hsva,o=t.onChange,i={backgroundImage:"linear-gradient(90deg, "+QW(Object.assign({},n,{a:0}))+", "+QW(Object.assign({},n,{a:1}))+")"},a=BW(["react-colorful__alpha",r]),s=HW(100*n.a);return e.createElement("div",{className:a},e.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),e.createElement(DW,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:PW(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},e.createElement($W,{className:"react-colorful__alpha-pointer",left:n.a,color:QW(n)})))},yV=function(t){var r=t.className,n=t.colorModel,o=t.color,i=void 0===o?n.defaultColor:o,a=t.onChange,s=TW(t,["className","colorModel","color","onChange"]),l=(0,e.useRef)(null);fV(l);var c=dV(n,i,a),u=c[0],d=c[1],p=BW(["react-colorful",r]);return e.createElement("div",EW({},s,{ref:l,className:p}),e.createElement(sV,{hsva:u,onChange:d}),e.createElement(aV,{hue:u.h,onChange:d}),e.createElement(bV,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},vV={defaultColor:"0001",toHsva:VW,fromHsva:XW,equal:uV},xV={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:ZW,fromHsva:QW,equal:cV},wV={defaultColor:"hsl(0, 0%, 0%)",toHsva:GW,fromHsva:YW,equal:cV},_V={defaultColor:"rgba(0, 0, 0, 1)",toHsva:tV,fromHsva:function(e){var t=eV(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:cV},CV={defaultColor:"rgb(0, 0, 0)",toHsva:rV,fromHsva:function(e){var t=eV(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:cV};const kV=Ma("div")(({theme:e})=>({"& .react-colorful":{width:"100%",height:"auto",gap:e.spacing(2),"& .react-colorful__saturation":{borderRadius:0,height:200},"& .react-colorful__hue, & .react-colorful__alpha":{borderRadius:5*e.shape.borderRadius,height:"12px"},"& .react-colorful__pointer":{width:"24px",height:"24px"}}})),SV={hex:function(t){return e.createElement(mV,EW({},t,{colorModel:gV}))},rgb:function(t){return e.createElement(mV,EW({},t,{colorModel:CV}))},hsl:function(t){return e.createElement(mV,EW({},t,{colorModel:wV}))}},AV={hex:function(t){return e.createElement(yV,EW({},t,{colorModel:vV}))},rgb:function(t){return e.createElement(yV,EW({},t,{colorModel:_V}))},hsl:function(t){return e.createElement(yV,EW({},t,{colorModel:xV}))}};var jV=t().forwardRef((e,r)=>{const{value:n,format:o,onChange:i,disableOpacity:a=!1,...s}=e,l=a?SV[o]:AV[o];return t().createElement(kV,{...s,ref:r},t().createElement(l,{color:n,onChange:e=>{const t="hex"===o&&e.startsWith("#Na")?"":e;i(t)}}))}),RV=t().forwardRef((e,r)=>t().createElement(dz,{...e,ref:r})),IV={grad:.9,turn:360,rad:360/(2*Math.PI)},MV=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},EV=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},TV=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},OV=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},PV=function(e){return{r:TV(e.r,0,255),g:TV(e.g,0,255),b:TV(e.b,0,255),a:TV(e.a)}},LV=function(e){return{r:EV(e.r),g:EV(e.g),b:EV(e.b),a:EV(e.a,3)}},zV=/^#([0-9a-f]{3,8})$/i,NV=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},FV=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=Math.max(t,r,n),a=i-Math.min(t,r,n),s=a?i===t?(r-n)/a:i===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:o}},DV=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var i=Math.floor(t),a=n*(1-r),s=n*(1-(t-i)*r),l=n*(1-(1-t+i)*r),c=i%6;return{r:255*[n,s,a,a,l,n][c],g:255*[l,n,n,s,a,a][c],b:255*[a,a,l,n,n,s][c],a:o}},BV=function(e){return{h:OV(e.h),s:TV(e.s,0,100),l:TV(e.l,0,100),a:TV(e.a)}},$V=function(e){return{h:EV(e.h),s:EV(e.s),l:EV(e.l),a:EV(e.a,3)}},HV=function(e){return DV((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},WV=function(e){return{h:(t=FV(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},VV=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qV=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,UV=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ZV=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,GV={string:[[function(e){var t=zV.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?EV(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?EV(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=UV.exec(e)||ZV.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:PV({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=VV.exec(e)||qV.exec(e);if(!t)return null;var r,n,o=BV({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(IV[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return HV(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=void 0===o?1:o;return MV(t)&&MV(r)&&MV(n)?PV({r:Number(t),g:Number(r),b:Number(n),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,i=void 0===o?1:o;if(!MV(t)||!MV(r)||!MV(n))return null;var a=BV({h:Number(t),s:Number(r),l:Number(n),a:Number(i)});return HV(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,i=void 0===o?1:o;if(!MV(t)||!MV(r)||!MV(n))return null;var a=function(e){return{h:OV(e.h),s:TV(e.s,0,100),v:TV(e.v,0,100),a:TV(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(i)});return DV(a)},"hsv"]]},KV=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=LV(this.rgba)).r,r=e.g,n=e.b,i=(o=e.a)<1?NV(EV(255*o)):"","#"+NV(t)+NV(r)+NV(n)+i;var e,t,r,n,o,i},e.prototype.toRgb=function(){return LV(this.rgba)},e.prototype.toRgbString=function(){return t=(e=LV(this.rgba)).r,r=e.g,n=e.b,(o=e.a)<1?"rgba("+t+", "+r+", "+n+", "+o+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,o},e.prototype.toHsl=function(){return $V(WV(this.rgba))},e.prototype.toHslString=function(){return t=(e=$V(WV(this.rgba))).h,r=e.s,n=e.l,(o=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+o+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,o},e.prototype.toHsv=function(){return e=FV(this.rgba),{h:EV(e.h),s:EV(e.s),v:EV(e.v),a:EV(e.a,3)};var e},e.prototype.invert=function(){return tq({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),tq(JV(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),tq(JV(this.rgba,-e))},e.prototype.grayscale=function(){return tq(JV(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),tq(QV(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),tq(QV(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?tq({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):EV(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=WV(this.rgba);return"number"==typeof e?tq({h:e,s:t.s,l:t.l,a:t.a}):EV(t.h)},e.prototype.isEqual=function(e){return this.toHex()===tq(e).toHex()},e}(),tq=function(e){return e instanceof eq?e:new eq(e)};const rq=Ma(RV)(()=>({"& .MuiInputBase-input":{"-moz-appearance":"textfield","&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{margin:0,"-webkit-appearance":"none"}}}));var nq=t().forwardRef((e,r)=>{const{value:n,onChange:o,min:i,max:a,onBlur:s,...l}=e;return t().createElement(rq,{type:"number",...l,ref:r,value:n,onChange:e=>{const t=parseFloat(e.target.value);o(t)},onBlur:e=>{const t=((e,{min:t,max:r}={})=>"number"!=typeof(e="string"==typeof e?parseFloat(e):e)||isNaN(e)?0:(void 0!==r&&(e=Math.min(e,r)),void 0!==t&&(e=Math.max(e,t)),e))(e.target.value,{min:i,max:a});o(t),s?.(e)}})}),oq=({value:e,onChange:r,disableOpacity:n=!1,...o})=>{const{r:i,g:a,b:s,a:l}=e;return t().createElement(vo,{display:"flex",gap:.75},t().createElement(nq,{...o,min:0,max:255,value:i,onChange:t=>r({...e,r:t})}),t().createElement(nq,{...o,min:0,max:255,value:a,onChange:t=>r({...e,g:t})}),t().createElement(nq,{...o,min:0,max:255,value:s,onChange:t=>r({...e,b:t})}),!n&&t().createElement(nq,{...o,min:0,max:100,value:Math.round(100*l),onChange:t=>r({...e,a:t/100}),endAdornment:t().createElement(jF,{disableTypography:!0,position:"end"},"%")}))},iq=()=>aq;function aq(e,t,r){let n=tq(e);return void 0!==r&&r>=0&&r<=1&&(n=n.alpha(r)),"rgb"===t?n.toRgbString():"hsl"===t?n.toHslString():n.toHex()}var sq=t().forwardRef((r,n)=>{const{value:o,onChange:i,disableOpacity:a=!1,...s}=r,l=iq(),c=(0,e.useRef)(o);return t().createElement(RV,{...s,ref:n,value:o,onChange:e=>{const t=e.target.value.replace(/^#+/g,"");i("#"+t)},onFocus:e=>{c.current=e.target.value,s.onFocus?.(e)},onBlur:e=>{(e=>{const t=e.target.value;if("string"!=typeof(r=t)||!tq(r).isValid())return void i(c.current);var r;if(a&&function(e){return 1!==tq(e).alpha()}(t))return c.current=l(t,"hex",1),void i(c.current);c.current=t})(e),s.onBlur?.(e)}})}),lq=t().forwardRef((e,r)=>{const{value:n,onChange:o,...i}=e;return t().createElement(RV,{ref:r,sx:{width:"57px"},...i,value:(100*n).toFixed(),onChange:e=>o(function(e){if(!e)return 0;const t=parseInt(e);if(isNaN(t))return 1;const r=t/100;return r>1?1:r<0?0:r}(e.target.value)),endAdornment:t().createElement(jF,{disableTypography:!0,position:"end"},"%")})}),cq=({value:e,onChange:r,disableOpacity:n=!1,...o})=>{const{h:i,s:a,l:s,a:l}=e;return t().createElement(vo,{display:"flex",gap:.75},t().createElement(nq,{...o,min:0,max:360,value:i,onChange:t=>r({...e,h:t})}),t().createElement(nq,{...o,min:0,max:100,value:a,onChange:t=>r({...e,s:t})}),t().createElement(nq,{...o,min:0,max:100,value:s,onChange:t=>r({...e,l:t})}),!n&&t().createElement(nq,{...o,min:0,max:100,value:Math.round(100*l),onChange:t=>r({...e,a:t/100}),endAdornment:t().createElement(jF,{disableTypography:!0,position:"end"},"%")}))};const uq=["hex","rgb","hsl"],dq=new Set(uq);var pq=(e,t=uq)=>{const r=tq(e),n=function(e){return XV(e)[1]}(e)||t[0],o=dq.has(n)?n:uq[0];return{format:o,colorData:r,color:hq(r,o),getAlpha:()=>r.alpha(),isValid:()=>r.isValid(),toHsl:()=>r.toHsl(),toRgb:()=>r.toRgb(),toHex:()=>r.toHex()}};function hq(e,t){return"rgb"===t?e.toRgbString():"hsl"===t?e.toHslString():e.toHex()}const fq=Ma("div")(({theme:e})=>({boxSizing:"border-box",display:"flex",flexDirection:"column",gap:e.spacing(2),padding:e.spacing(2),width:305})),mq=["hex","rgb","hsl"],gq={hideInputFields:!1,disableOpacity:!1,formats:mq},bq=Ma(Ez)(({theme:e})=>({...e.typography.caption})),yq=t().forwardRef((e,r)=>{const{value:n,onChange:o,hideInputFields:i,disableOpacity:a=!1,formats:s=mq,...l}={...gq,...e},c=function(e){if(0===e.length)return["hex"];const t=mq.length;return e.slice(0,t)}(s),{format:u,getAlpha:d,toRgb:p,toHsl:h}=pq(n,c),f=iq(),m=c.length>1,g=new Set(c);return t().createElement(fq,{...l,ref:r},t().createElement(jV,{value:n,format:u,onChange:o,disableOpacity:a}),!i&&t().createElement(vo,{display:"flex",gap:1},m&&t().createElement(_z,{size:"tiny",value:u,onChange:e=>{const t=e.target.value,r=f(n,t);o(r)}},g.has("hex")&&t().createElement(bq,{value:"hex"},"HEX"),g.has("rgb")&&t().createElement(bq,{value:"rgb"},"RGB"),g.has("hsl")&&t().createElement(bq,{value:"hsl"},"HSL")),"hex"===u&&t().createElement(t().Fragment,null,t().createElement(sq,{size:"tiny",value:n,onChange:o,disableOpacity:a,sx:{flexGrow:1}}),!a&&t().createElement(lq,{size:"tiny",value:d(),onChange:e=>{const t=f(n,u,e);o(t)}})),"rgb"===u&&t().createElement(oq,{size:"tiny",value:p(),disableOpacity:a,onChange:e=>{const t=f(e,"rgb");o(t)}}),"hsl"===u&&t().createElement(cq,{size:"tiny",value:h(),disableOpacity:a,onChange:e=>{const t=f(e,"hsl");o(t)}})))});yq.defaultProps=gq;var vq=yq;const xq=Ma("span")(({theme:e,ownerState:t})=>{const{value:r,size:n,shape:o}=t,i={tiny:26,small:38,medium:54,inherit:"1em"}[n||"medium"],a=[];if(r){const e=/[a-z]-gradient\(/.test(r)?r:`linear-gradient(${r}, ${r})`;a.push(e)}a.push('url(\'data:image/svg+xml;charset=utf-8,\')');const s=a.join(", ");return{display:"inline-flex",flexShrink:0,flexGrow:0,borderRadius:"circular"===o?"50%":e.shape.borderRadius*e.shape.__unstableBorderRadiusMultipliers[2],fontSize:"inherit"===n?"inherit":void 0,width:i,height:i,minWidth:"initial",outline:`1px solid ${e.palette.action.disabled}`,border:0,padding:0,backgroundColor:e.palette.common.white,backgroundPosition:"center",backgroundImage:s,"button&":{"&:not(:disabled)":{cursor:"pointer"},"&:not(:disabled):hover, &:focus":{outlineWidth:2,outlineColor:e.palette.text.primary}}}}),wq={component:"span",size:"medium"},_q=t().forwardRef((e,r)=>{const{value:n,size:o,component:i,shape:a,...s}={...wq,...e},l={value:n,size:o,shape:a};return t().createElement(xq,{...s,as:i,ref:r,ownerState:l})});_q.defaultProps=wq;var Cq=_q;const kq={disablePortal:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},Sq=t().forwardRef((e,r)=>{const{children:n,...o}={...kq,...e};return t().createElement(hN,{...o,ref:r},n)});Sq.defaultProps=kq;var Aq=Sq;const jq={hideInputFields:!1,disableOpacity:!1},Rq=t().forwardRef((e,r)=>{const{size:n,anchorEl:o,anchorOrigin:i,anchorReference:a,anchorPosition:s,transformOrigin:l,hideInputFields:c,slotProps:u={},value:d="",onChange:p,disabled:h,indicatorShape:f,disableOpacity:m,formats:g}={...jq,...e},b=MW({variant:"popover",popupId:"eui-color-picker-popover"}),y=Object.entries({anchorEl:o,anchorOrigin:i,anchorReference:a,anchorPosition:s,transformOrigin:l}).reduce((e,[t,r])=>r?{...e,[t]:r}:e,{});return t().createElement(t().Fragment,null,t().createElement(Cq,{ref:r,size:n,value:d,component:"button",disabled:h,shape:f,...(v=b,{...SW(v),onClick:v.open,onTouchStart:v.open}),...u.colorIndicator}),t().createElement(Aq,{...AW(b),...y,...u.popover},t().createElement(vq,{value:d,onChange:p,hideInputFields:c,disableOpacity:m,formats:g,...u.colorBox})));var v});Rq.defaultProps=jq;var Iq=Rq;const Mq=e=>{e=(e=>(3===(e=e.replace(/^#/,"")).length&&(e=e.split("").map(e=>e+e).join("")),`#${e}`))(e).replace(/^#/,"");const t=8===e.length,r=parseInt(e.slice(0,2),16)/255,n=parseInt(e.slice(2,4),16)/255,o=parseInt(e.slice(4,6),16)/255,i=t?parseInt(e.slice(6,8),16)/255:1,a=Math.max(r,n,o),s=Math.min(r,n,o);let l,c;const u=(a+s)/2;if(a===s)l=c=0;else{const e=a-s;switch(c=u>.5?e/(2-a-s):e/(a+s),a){case r:l=(n-o)/e+(n{const[i,a]=(0,Vn.useState)(r),s=Mq(t);(0,Vn.useEffect)(()=>{a(r)},[r]);const l=(e,t=null)=>{Ww(null!=t?t:Vw.contrastColorChanged,{area:o,component:e})},c=(e,t)=>{const r=e?.target?.value||t;if(r&&!/^\d{1,2}$|^100$/.test(r))return;const o=r&&!isNaN(r)?parseInt(r,10):0;if(o>=0&&o<=100){const e=(({h:e,s:t,l:r,a:n=1})=>{t/=100,r/=100;const o=(1-Math.abs(2*r-1))*t,i=o*(1-Math.abs(e/60%2-1)),a=r-o/2;let s,l,c;[s,l,c]=e<60?[o,i,0]:e<120?[i,o,0]:e<180?[0,o,i]:e<240?[0,i,o]:e<300?[i,0,o]:[o,0,i];const u=e=>Math.round(255*(e+a)).toString(16).padStart(2,"0"),d=Math.round(255*n).toString(16).padStart(2,"0");return n<1?`#${u(s)}${u(l)}${u(c)}${d}`.toUpperCase():`#${u(s)}${u(l)}${u(c)}`.toUpperCase()})({...Mq(i),l:o});n(e),l("slider")}};return(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(Jw,{variant:"body2",as:"p",children:e}),(0,Nt.jsxs)(Tq,{children:[(0,Nt.jsx)(n_,{}),(0,Nt.jsx)(wW,{"aria-label":(0,tS.__)("Lightness","pojo-accessibility"),color:"secondary",value:s.l,size:"small",sx:{width:"150px"},onChange:c}),(0,Nt.jsx)(r_,{}),(0,Nt.jsx)(KF,{variant:"outlined",size:"small",color:"secondary",value:s.l,onChange:c,inputProps:{"aria-label":(0,tS.__)("Lightness percent","pojo-accessibility")},InputProps:{sx:{width:"75px",paddingRight:"4px",marginRight:"8px"},endAdornment:(0,Nt.jsx)(jF,{position:"end",children:(0,Nt.jsx)(F_,{size:"small",disabled:!0,sx:{minWidth:"auto"},children:"%"})})}}),(0,Nt.jsx)(Iq,{disableOpacity:!0,formats:["hex"],value:t,onChange:e=>{a(e),n(e),l("color-picker")},size:"small"}),(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:(0,tS.__)("Reset","pojo-accessibility"),PopperProps:{disablePortal:!0},children:t!==r?(0,Nt.jsx)(Ca,{onClick:()=>{n(r),l("reset",Vw.contrastResetClicked)},size:"tiny",children:(0,Nt.jsx)(NH,{fontSize:"tiny",sx:{transform:"rotate(180deg)"}})}):(0,Nt.jsx)(NH,{color:"disabled",fontSize:"tiny",sx:{p:"6px",transform:"rotate(180deg)"}})})]})]})},Tq=Ma(vo)`
display: flex;
align-items: center;
gap: ${({theme:e})=>e.spacing(1)};
`;Eq.propTypes={title:IR().string.isRequired,color:IR().string.isRequired,initialColor:IR().string.isRequired,setColor:IR().func.isRequired,area:IR().string.isRequired};var Oq=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.75 3.5C10.888 3.5 10.0614 3.84241 9.4519 4.4519C8.84241 5.0614 8.5 5.88805 8.5 6.75V10H15V6.75C15 5.88805 14.6576 5.0614 14.0481 4.4519C13.4386 3.84241 12.612 3.5 11.75 3.5ZM16.5 10V6.75C16.5 5.49022 15.9996 4.28204 15.1088 3.39124C14.218 2.50044 13.0098 2 11.75 2C10.4902 2 9.28204 2.50044 8.39124 3.39124C7.50044 4.28204 7 5.49022 7 6.75V10H6.75C6.02065 10 5.32118 10.2897 4.80546 10.8055C4.28973 11.3212 4 12.0207 4 12.75V18.75C4 19.4793 4.28973 20.1788 4.80546 20.6945C5.32118 21.2103 6.02065 21.5 6.75 21.5H16.75C17.4793 21.5 18.1788 21.2103 18.6945 20.6945C19.2103 20.1788 19.5 19.4793 19.5 18.75V12.75C19.5 12.0207 19.2103 11.3212 18.6945 10.8055C18.1788 10.2897 17.4793 10 16.75 10H16.5Z"})));const Pq=({title:e,description:t})=>(0,Nt.jsxs)(vo,{children:[(0,Nt.jsxs)(vo,{display:"flex",alignItems:"center",gap:1,children:[(0,Nt.jsx)(Jw,{variant:"body2",as:"p",color:"text.disabled",children:e}),(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:t,PopperProps:{disablePortal:!0,sx:{"& .MuiTooltip-tooltip":{maxWidth:400}}},children:(0,Nt.jsx)(Oq,{tabindex:0,color:"disabled",fontSize:"tiny"})})]}),(0,Nt.jsxs)(Lq,{children:[(0,Nt.jsx)(n_,{}),(0,Nt.jsx)(wW,{"aria-label":(0,tS.__)("Lightness","pojo-accessibility"),color:"secondary",size:"small",sx:{width:"150px"},disabled:!0}),(0,Nt.jsx)(r_,{}),(0,Nt.jsx)(KF,{variant:"outlined",size:"small",color:"secondary",defaultValue:"-",disabled:!0,inputProps:{"aria-label":(0,tS.__)("Lightness percent","pojo-accessibility")},InputProps:{sx:{width:"75px",paddingRight:"4px",marginRight:"8px"},endAdornment:(0,Nt.jsx)(jF,{position:"end",children:(0,Nt.jsx)(F_,{size:"small",disabled:!0,sx:{minWidth:"auto"},children:"%"})})}}),(0,Nt.jsx)(Cq,{value:"rgba(0, 0, 0, 0)",disabled:!0,size:"small"}),(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:(0,tS.__)("Reset","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(NH,{color:"disabled",fontSize:"tiny",sx:{p:"6px",transform:"rotate(180deg)"}})})]})]}),Lq=Ma(vo)`
display: flex;
align-items: center;
gap: ${({theme:e})=>e.spacing(1)};
`;Pq.propTypes={title:IR().string.isRequired,description:IR().string.isRequired};var zq=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19995 12.0498C4.19995 11.6356 4.53574 11.2998 4.94995 11.2998H18.95C19.3642 11.2998 19.7 11.6356 19.7 12.0498C19.7 12.464 19.3642 12.7998 18.95 12.7998H4.94995C4.53574 12.7998 4.19995 12.464 4.19995 12.0498Z"}))),Nq=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 4.75C11 4.33579 11.3358 4 11.75 4C12.1642 4 12.5 4.33579 12.5 4.75V11H18.75C19.1642 11 19.5 11.3358 19.5 11.75C19.5 12.1642 19.1642 12.5 18.75 12.5H12.5V18.75C12.5 19.1642 12.1642 19.5 11.75 19.5C11.3358 19.5 11 19.1642 11 18.75V12.5H4.75C4.33579 12.5 4 12.1642 4 11.75C4 11.3358 4.33579 11 4.75 11H11V4.75Z"})));const Fq=({parents:e,setParentSmaller:t,setParentLarger:r})=>{(0,Vn.useEffect)(()=>{Ww(Vw.backgroundAdaptorTriggered)},[]);const n=Math.max(0,5-e.length),o=e.length>1,i=e.length>0&&"/html"!==e.at(-1);return(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(Jw,{variant:"body2",as:"p",sx:{mb:2},children:(0,tS.__)("Background area","pojo-accessibility")}),(0,Nt.jsxs)(vo,{display:"flex",alignItems:"center",gap:1,children:[(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:(0,tS.__)("Apply to a smaller area","pojo-accessibility"),PopperProps:{disablePortal:!0},children:o?(0,Nt.jsx)(Ca,{onClick:t,children:(0,Nt.jsx)(zq,{})}):(0,Nt.jsx)(zq,{color:"disabled",sx:{px:1}})}),(0,Nt.jsx)(Dq,{children:[...Array(5)].map((e,t)=>{const r=16+16*(4-t),o=t===n;return(0,Nt.jsx)(Bq,{size:r,filled:o},t)})}),(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:(0,tS.__)("Apply to a larger area","pojo-accessibility"),PopperProps:{disablePortal:!0},children:i?(0,Nt.jsx)(Ca,{onClick:r,children:(0,Nt.jsx)(Nq,{})}):(0,Nt.jsx)(Nq,{color:"disabled",sx:{px:1}})})]})]})},Dq=Ma(vo)`
position: relative;
width: 80px;
height: 80px;
display: flex;
align-items: center;
justify-content: center;
`,Bq=Ma(vo)`
position: absolute;
width: ${({size:e})=>e}px;
height: ${({size:e})=>e}px;
box-sizing: border-box;
border: ${({filled:e})=>e?"1px solid #000":"1px dashed #000"};
background-color: ${({filled:e})=>e?"#93C5FD":"transparent"};
`;Fq.propTypes={parents:IR().arrayOf(IR().string).isRequired,setParentSmaller:IR().func.isRequired,setParentLarger:IR().func.isRequired};const $q=(e,t)=>{const r=[];if(!t)return[CS()(e,{ignoreId:!0})];let n=e;for(;n&&(r.push(CS()(n,{ignoreId:!0})),n!==t);)n=n.parentElement;return r},Hq=e=>{if(!(e&&e instanceof Element))return null;const t=new Set([iS,aS,sS]),r=[];for(;e&&e.nodeType===Node.ELEMENT_NODE;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,r.unshift(n);break}if(e.className&&"body"!==e.tagName.toLowerCase()){const r=e.className.trim().split(/\s+/).filter(e=>e&&!t.has(e));r.length&&(n+="."+r.join("."))}const o=e.parentNode;if(o&&("body"!==o.tagName?.toLowerCase()||"div"!==e.tagName?.toLowerCase())){const t=Array.from(o.children).filter(t=>t.tagName===e.tagName);t.length>1&&(n+=`:nth-of-type(${t.indexOf(e)+1})`)}r.unshift(n),e=e.parentElement}return r.join(" > ")},Wq=({item:e,current:t,setCurrent:r})=>{const{colorContrastData:n,resolved:o,setResolved:i,isResolved:a,isManage:s,setOpenedBlock:l,setColorContrastData:c,setIsManageChanged:u,updateRemediationList:d,currentScanId:p}=QS(),h=s?"manage":"main",[f,m]=(0,Vn.useState)(!1),[g,b]=(0,Vn.useState)(!0),[y,v]=(0,Vn.useState)(!1),x=n?.[h]?.[t]?.isGlobal||e.global||!1,w=(0,Vn.useRef)(null);(0,Vn.useEffect)(()=>{e?.node&&(w.current=x)},[t]);const _=e=>{const r=[...n?.[h]];if(r[t]={...n?.[h]?.[t]||{},...e},c({...n,[h]:r}),e.color||e.background){const e=M(r[t]);E(e)}},C=e=>{Ww(Vw.backgroundAdaptorChanged,{method:e})};(0,Vn.useEffect)(()=>{s||g||!a(mS.colorContrast)||(ZS(),l(mS.main)),b(!1)},[a(mS.colorContrast)]);const{color:k=e.messageArgs[3]||zH(window.getComputedStyle(e.node).getPropertyValue("color")),background:S=e.messageArgs[4],parents:A=(e.isEdit?$q(e.node,e.parentNode):[e.path.dom]),resolved:j=!1,backgroundChanged:R=e.isEdit}=n[h]?.[t]||{};(0,Vn.useEffect)(()=>{if(s&&y){const t=document.getElementById("ea11y-remediation-styles");t&&(t.innerHTML=t.innerHTML.replace(e.data.rule,""))}},[y]);const I=e=>/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e.trim()),M=t=>{const r=t.parents||A,n=r.length>0?r.at(-1):e.path.dom;if(t.color&&!I(t.color)||t.background&&!I(t.background))throw new Error("Invalid hex color input detected");try{const r=GS(n),o=Hq(e.node),i=Hq(r),a=`${t.color?`${o} {color: ${t.color} !important;}`:""}${t.background?`${i} {background-color: ${t.background} !important;}`:""}`;return(e=>{try{return!(!e||"string"!=typeof e||(LH.parse(e),0))}catch(e){return!1}})(a)?a:""}catch(e){return console.warn("Failed to convert XPath to CSS selector",e),""}},E=e=>{let t=document.getElementById("ea11y-remediation-styles-edit");t||(t=document.createElement("style"),t.id="ea11y-remediation-styles-edit",document.body.appendChild(t)),t.innerHTML=e},T=j&&n?.[h]?.[t]?.isGlobal===w.current;return{isGlobal:x,setIsGlobal:e=>{_({isGlobal:e})},color:k,background:S,parents:A,isDisabled:T,resolved:j,backgroundChanged:R,parentChanged:y,loading:f,changeColor:e=>{_({color:e,resolved:!1})},changeBackground:e=>{GS(A.at(-1))&&_({background:e,resolved:!1,backgroundChanged:!0})},setParentLarger:()=>{const e=GS(A.at(-1)),t=e?.parentElement;if(e&&t)try{const e=CS()(t,{ignoreId:!0});US(t,sS),_({parents:[...A,e],resolved:!1}),v(!0),C("plus")}catch(e){console.warn("Failed to get XPath for parent element:",e)}},setParentSmaller:()=>{const e=A.slice(0,-1),t=GS(e.at(-1));A.length<=1||!t||(e.length>1?US(t,sS):ZS(sS),_({parents:e,resolved:!1}),v(!0),C("minus"))},onSubmit:async()=>{const a=A.length>0?A.at(-1):null,s=n$(a);m(!0);try{const l=M(n?.[h]?.[t]),c=await oo.submitRemediation({url:window?.ea11yScannerData?.pageData?.url,remediation:{rule:l,category:e.reasonCategory.match(/\((AAA?|AA?|A)\)/)?.[1]||"",type:"STYLES",xpath:e.path.dom,find:e.snippet,parentFind:s,parentXPath:a},global:x,rule:e.ruleId,group:mS.colorContrast});await oo.resolveIssue(p),_({remediation:c.remediation,resolved:!0}),ZS(),r(t+1),i(o+1),v(!1),E(l),w.current=x,d()}catch(e){console.error("Failed to submit remediation:",e)}finally{m(!1)}},onUpdate:async()=>{const r=M(n?.[h]?.[t]),o=n$(e.path.dom),i=A.length>0?A.at(-1):null,a=n$(i);try{m(!0);const s=n?.[h]?.[t]?.remediation,l=e.id||s.id,c=e.data||JSON.parse(s.content),p=JSON.stringify({...c,rule:r,find:o,parentFind:a,parentXPath:i});await oo.updateRemediationContent({url:window?.ea11yScannerData?.pageData?.url,id:l,content:p,global:x}),u(!0),ZS(),v(!1),E(r),w.current=x,d()}catch(e){console.error(e)}finally{m(!1)}}}};Wq.propTypes={item:r$.isRequired,current:IR().number.isRequired,setCurrent:IR().func.isRequired};const Vq=e=>{if(null===e)return null;let t=e.parentNode;return e.slotOwner?t=e.slotOwner:e.ownerElement?t=e.ownerElement:t&&11===t.nodeType&&(t=t.host?t.host:null),t},qq=e=>{let t=e;do{t=Vq(t)}while(t&&1!==t.nodeType);return t};class Uq{static CSSColorLookup={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",buttontext:"rgba(0, 0, 0, 0.847)",buttonface:"#ffffff",graytext:"rgba(0, 0, 0, 0.247)"};static Color(e){if(!e)return null;if("transparent"===(e=e.toLowerCase()))return new Zq(255,255,255,0);if(e in Uq.CSSColorLookup&&(e=Uq.CSSColorLookup[e]),e.startsWith("rgb(")){const t=/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=e.match(t);return null===r?null:new Zq(r[1],r[2],r[3])}if(e.startsWith("rgba(")){const t=/\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,r=e.match(t);return null===r?null:new Zq(r[1],r[2],r[3],r[4])}if("#"!==e.charAt(0))return null;4===e.length&&(e="#"+e.charAt(1).repeat(2)+e.charAt(2).repeat(2)+e.charAt(3).repeat(2));const t=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),n=parseInt(e.substring(5,7),16);return new Zq(t,r,n)}static ColorCombo(e){try{const t=e.ownerDocument;if(!t)return null;const r=t.defaultView;if(!r)return null;const n=[];let o=e;for(;o;)1===o.nodeType&&n.push(o),o=qq(o);const i={hasGradient:!1,hasBGImage:!1,textShadow:!1,fg:null,bg:null};let a=r.getComputedStyle(e),s=a.color;s||(s="black");let l=Uq.Color(s);const c=/transparent|rgba?\([^)]+\)/gi,u=function(e,t,r){try{if(void 0===e.length)return e;let n=null,o=null;for(let i=1;i1e-4;){for(;c+l<=1&&s>r.contrastRatio(e[i].mix(e[i-1],c+l).getOverlayColor(t));)a=e[i].mix(e[i-1],c+l).getOverlayColor(t),s=r.contrastRatio(a),c+=l;for(;c-l>=0&&s>r.contrastRatio(e[i].mix(e[i-1],c-l).getOverlayColor(t));)a=e[i].mix(e[i-1],c-l).getOverlayColor(t),s=r.contrastRatio(a),c-=l;l/=10}(null===o||o>s)&&(o=s,n=a)}return n}catch(e){console.log(e)}return t};let d=Uq.Color("white"),p=null,h=null,f=null;for(;n.length>0;){const e=n.pop();if(a=r.getComputedStyle(e),null===a)continue;let t=null;if(a.backgroundColor&&"transparent"!==a.backgroundColor&&"rgba(0, 0, 0, 0)"!==a.backgroundColor&&(t=Uq.Color(a.backgroundColor)),a.backgroundImage&&a.backgroundImage.indexOf&&-1!==a.backgroundImage.indexOf("gradient")){const e=a.backgroundImage.match(c);if(e){const r=[];for(let t=0;t0&&parseFloat(a.opacity)<1?(null!==f&&(f.alpha=p*h,d=f.getOverlayColor(d)),p=1,h=null,f=null,a.opacity&&a.opacity.length>0&&(p=parseFloat(a.opacity)),null!==t&&(f=t,h=f.alpha||1,delete f.alpha,1===p&&1===h&&(i.hasBGImage=!1,i.hasGradient=!1))):null!==t&&(null===f?(f=t,h=f.alpha||1,delete f.alpha):(f=t.getOverlayColor(f),h=f.alpha||1),1===p&&1===h&&1===(f.alpha||1)&&t.alpha),a.backgroundImage&&"none"!==a.backgroundImage&&(a.backgroundImage.indexOf&&-1!==a.backgroundImage.indexOf("gradient")?i.hasGradient=!0:i.hasBGImage=!0)}return null!==f&&(l=l.getOverlayColor(f),delete l.alpha),l.alpha=(l.alpha||1)*p,l=l.getOverlayColor(d),null!==f&&(f.alpha=p*h,d=f.getOverlayColor(d)),i.fg=l,i.bg=d,a.textShadow&&"none"!==a.textShadow&&(i.textShadow=!0),i}catch(e){return null}}}class Zq{red;green;blue;alpha;constructor(e,t,r,n){function o(e){if("string"!=typeof e)return e;let t=e;return t=t.trim(),"%"!==t[t.length-1]?parseInt(t):Math.round(2.55*parseFloat(t.substring(0,t.length-1)))}this.red=o(e),this.green=o(t),this.blue=o(r),void 0!==n&&(this.alpha="string"==typeof n?parseFloat(n):n)}toHexHelp(e){const t=Math.round(e).toString(16);return 1===t.length?"0"+t:t}toHex(){return"#"+this.toHexHelp(this.red)+this.toHexHelp(this.green)+this.toHexHelp(this.blue)}contrastRatio(e){let t=this;void 0!==this.alpha&&(t=this.getOverlayColor(e));const r=t.relativeLuminance(),n=e.relativeLuminance();return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)}relativeLuminance(){let e=this.red/255,t=this.green/255,r=this.blue/255;return e=e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4),t=t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),r=r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*e+.7152*t+.0722*r}mix(e,t){if(void 0===this.alpha&&void 0===e.alpha)return new Zq(t*this.red+(1-t)*e.red,t*this.green+(1-t)*e.green,t*this.blue+(1-t)*e.blue);const r=this.alpha?this.alpha:1,n=e.alpha?e.alpha:1;return new Zq(t*this.red+(1-t)*e.red,t*this.green+(1-t)*e.green,t*this.blue+(1-t)*e.blue,t*r+(1-t)*n)}getOverlayColor(e){if(void 0===this.alpha||this.alpha>=1)return this;if(this.alpha<0)return null;if(void 0!==e.alpha&&e.alpha<1)return null;const t=this.mix(e,this.alpha);return delete t.alpha,t}static fromCSSColor(e){let t=-1,r=-1,n=-1;if((e=e.toLowerCase()).startsWith("rgb(")){const o=/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i=e.match(o);if(null===i)return null;t=i[1],r=i[2],n=i[3]}else if(e.startsWith("rgba(")){const o=/\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(.+)\s*\)/,i=e.match(o);if(null===i)return null;t=i[1],r=i[2],n=i[3]}else{if("#"!==e.charAt(0)){if(!(e in Uq.CSSColorLookup))return null;e=Uq.CSSColorLookup[e]}const o=function(e){const t={a:10,b:11,c:12,d:13,e:14,f:15};let r=0;for(let n=0;n{const t=Uq.ColorCombo(e);if(null===t)throw new Error("unable to get color combo for element: "+e.nodeName);const r=t.fg,n=t.bg,o=r.contrastRatio(n),i=(e=>{if(!e)return!1;const{fontSize:t,fontWeight:r}=window.getComputedStyle(e);return parseFloat(t)>=(parseInt(r,10)>=700?18.66:24)})(e),a=o>=(i?3:4.5);return{ratio:+o.toFixed(2),largeText:i,passesAA:a,isPotential:t.hasBGImage||t.hasGradient}},Kq=({item:e,current:t,setCurrent:r,setIsEdit:n})=>{const{isManage:o}=QS(),{isGlobal:i,setIsGlobal:a,color:s,background:l,parents:c,isDisabled:u,resolved:d,backgroundChanged:p,parentChanged:h,loading:f,changeColor:m,changeBackground:g,setParentSmaller:b,setParentLarger:y,onSubmit:v,onUpdate:x}=Wq({item:e,current:t,setCurrent:r}),w=(0,Vn.useRef)(null);(0,Vn.useEffect)(()=>{e?.node&&(w.current=zH(window.getComputedStyle(e.node).getPropertyValue("color")))},[e]);const _=e.messageArgs[3]&&e.messageArgs[4]&&!e.isPotential,C=Gq(e.node),k=!C.passesAA||u||f||e.isEdit&&s===e.messageArgs[3]&&l===e.messageArgs[4]&&!h,S=o?(0,tS.__)("Apply changes","pojo-accessibility"):(0,tS.__)("Apply fix","pojo-accessibility");return(0,Nt.jsxs)(Yk,{children:[(0,Nt.jsx)(yO,{}),(0,Nt.jsx)(Jw,{variant:"body2",as:"p",children:(0,tS.__)("Adjust the text or background lightness until the indicator shows an accessible level.","pojo-accessibility")}),(0,Nt.jsx)(Eq,{title:(0,tS.__)("Text","pojo-accessibility"),color:s,initialColor:w.current||s,setColor:m,area:"color"}),_?(0,Nt.jsx)(Eq,{title:(0,tS.__)("Background","pojo-accessibility"),color:l,initialColor:e.messageArgs[4],setColor:g,area:"background"}):(0,Nt.jsx)(Pq,{title:(0,tS.__)("Background","pojo-accessibility"),description:(0,tS.__)("Image and gradient backgrounds must be changed in the design","pojo-accessibility")}),p&&(0,Nt.jsx)(Fq,{parents:c,setParentSmaller:b,setParentLarger:y}),(0,Nt.jsxs)(Ga,{severity:C.passesAA?"success":"error",children:[(0,Nt.jsx)(KN,{sx:{mr:1},children:(0,tS.__)("Contrast level:","pojo-accessibility")}),C.ratio]}),(0,Nt.jsxs)(vo,{children:[!o&&(0,Nt.jsx)(e$,{item:e,onGlobalChange:e=>{a(e)},isChecked:i}),(0,Nt.jsxs)(vo,{display:"flex",gap:1,justifyContent:"flex-end",children:[o&&(0,Nt.jsx)(F_,{color:"secondary",variant:"text",onClick:()=>{n(!1)},children:(0,tS.__)("Cancel","pojo-accessibility")}),(0,Nt.jsx)(F_,{variant:"contained",size:"small",color:"info",loading:f,disabled:k,onClick:e.isEdit||d?async()=>{await x(),n?n(!1):r(t+1)}:async()=>{await v(),Ww(Vw.applyFixButtonClicked,{fix_method:"color contrast",issue_type:e.message,current_contrast_ratio:C.ratio,background_level:c.length,category_name:mS.colorContrast,page_url:window.ea11yScannerData?.pageData?.url,is_global:i?"yes":"no"})},sx:{mt:o?0:1.5},fullWidth:!o,children:i?(0,tS.__)("Apply to all","pojo-accessibility"):S})]})]})]})};Kq.propTypes={item:r$,current:IR().number.isRequired,setCurrent:IR().func.isRequired,setIsEdit:IR().func};const Xq=()=>{const{sortedViolations:e,isResolved:t}=QS(),[r,n]=(0,Vn.useState)(0),o=t(mS.colorContrast);(0,Vn.useEffect)(()=>{const t=e.colorContrast?.[r];!o&&e.colorContrast?.length?US(t?.node,aS):ZS(),t&&Ww(Vw.issueSelected,{issue_type:t.message,rule_id:t.ruleId,wcag_level:t.reasonCategory.match(/\((AAA?|AA?|A)\)/)?.[1]||"",category_name:mS.colorContrast,current_contrast_ratio:t.messageArgs[0],scenario:t.messageArgs[3]&&t.messageArgs[4]?"regular_flow":"gradient"})},[r]);const i=t=>{t>(e.colorContrast?.length||0)-1?n(0):n(t)};return(0,Nt.jsxs)(Lk,{children:[(0,Nt.jsx)(Kq,{item:e.colorContrast[r],current:r,setCurrent:i}),(0,Nt.jsx)(M$,{total:e.colorContrast?.length||0,current:r,setCurrent:i})]})},Jq=({children:e})=>(0,Nt.jsx)(Bz,{children:e});Jq.propTypes={children:IR().node.isRequired};const Yq=Jq;var Qq=t().forwardRef((e,r)=>t().createElement(pB,{...e,ref:r}));const eU=({node:e})=>{const t=()=>e.getAttribute("data-ea11y-scanner-heading-draft"),r=()=>{if(t())return;const r=e.getAttribute("role"),n=e.getAttribute("aria-level");e.setAttribute("data-ea11y-scanner-heading-draft","true"),e.setAttribute("data-ea11y-scanner-original-role",r||""),e.setAttribute("data-ea11y-scanner-original-level",n||"")};return{hasDraft:t,getOriginalHeadingLevel:()=>{const t=e.getAttribute("data-ea11y-scanner-original-level");return t?parseInt(t,10):null},getDraftLevelForDisplay:()=>t()?"none"===e.getAttribute("role")?"p":`h${e.getAttribute("aria-level")}`:"",backupOriginalAttributes:r,restoreOriginalAttributes:()=>{if(!t())return;const r=e.getAttribute("data-ea11y-scanner-original-role"),n=e.getAttribute("data-ea11y-scanner-original-level");r?e.setAttribute("role",r):e.removeAttribute("role"),n?e.setAttribute("aria-level",n):e.removeAttribute("aria-level"),e.removeAttribute("data-ea11y-scanner-original-role"),e.removeAttribute("data-ea11y-scanner-original-level"),e.removeAttribute("data-ea11y-scanner-heading-draft")},clearOriginalAttributes:()=>{e.removeAttribute("data-ea11y-scanner-original-role"),e.removeAttribute("data-ea11y-scanner-original-level"),e.removeAttribute("data-ea11y-scanner-heading-draft")},applyNewLevel:t=>{r(),"p"===t?(e.setAttribute("role","none"),e.removeAttribute("aria-level")):(e.setAttribute("role","heading"),e.setAttribute("aria-level",t[1]))}}},tU=({node:e,status:t,isDisabled:r,isDismiss:n,setIsDismiss:o,setIsSubmitted:i,displayLevel:a,violation:s})=>{const{error:l}=Gn(),{isLoading:c,error:u,updateHeadingsTree:d,onHeadingWarningDismiss:p,onHeadingLevelUpdate:h,collapseHeading:f}=sO(),{restoreOriginalAttributes:m,clearOriginalAttributes:g}=eU({node:e});return(0,Nt.jsxs)(Kz,{children:[kS.WARNING===t&&(0,Nt.jsx)(Xz,{label:(0,tS.__)("Not an issue","pojo-accessibility"),control:(0,Nt.jsx)(pF,{color:"info",checked:n,size:"small"}),onChange:e=>o(e.target.checked)}),(0,Nt.jsx)(F_,{size:"small",color:"secondary",variant:"text",onClick:()=>{m(),setTimeout(()=>d(),0),o(!1),f()},disabled:c,children:(0,tS.__)("Cancel","pojo-accessibility")}),(0,Nt.jsx)(F_,{size:"small",color:"info",variant:"contained",disabled:r,onClick:async()=>{i(!0),n&&await(async()=>{await p({node:e})?(f(),o(!1),Ww(Vw.markAsResolveClicked,{category_name:"Headings",issue_type:s,element_selector:TS(e)}),setTimeout(()=>d(),0)):l(u)})(),await(async()=>{await h({node:e,newLevel:a,rule:s})?("p"===a&&e.setAttribute("role","presentation"),f(),g(),setTimeout(()=>d(),0),Ww(Vw.applyFixButtonClicked,{fix_method:"Headings",category_name:"Headings",issue_type:s})):l(u)})()},children:(0,tS.__)("Apply","pojo-accessibility")})]})};tU.propTypes={status:IR().oneOf(Object.values(kS)).isRequired,node:IR().object.isRequired,isDisabled:IR().bool.isRequired,isDismiss:IR().bool.isRequired,setIsDismiss:IR().func.isRequired,setIsSubmitted:IR().func.isRequired,displayLevel:IR().string.isRequired,violation:IR().oneOf(Object.values(BS)),isExpanded:IR().bool.isRequired};const rU=tU,nU=({status:e,violation:t})=>(0,Nt.jsxs)(Uz,{severity:e,icon:!1,tabIndex:"0",children:[(0,Nt.jsx)(KN,{children:Lz[t]?.title}),(0,Nt.jsx)(Jw,{sx:{fontSize:"14px"},children:Lz[t]?.description})]});nU.propTypes={status:IR().oneOf(Object.values(kS)).isRequired,violation:IR().oneOf(Object.values(BS)).isRequired};const oU=nU,iU=({id:e,status:t,isDismiss:r,level:n,node:o,displayLevel:i,content:a,isExpanded:s,toggleHeading:l})=>{const c=r?kS.SUCCESS:t,u=Tz[c],d=u.icon;return(0,Nt.jsxs)(Hz,{level:n,onClick:()=>{s||Ww(Vw.headingClicked,{level:i,location:LS(o).replace("heading-tree-","")}),l()},isExpanded:s,"aria-expanded":s,"aria-controls":e,"aria-invalid":kS.SUCCESS!==t,"aria-description":SS[t],children:[(0,Nt.jsx)(Vz,{status:c,children:(0,Nt.jsx)(Jw,{as:"span",variant:"subtitle2",children:i.toUpperCase()})}),(0,Nt.jsx)(qz,{level:n,as:"span",variant:"body2",children:a}),(0,Nt.jsx)(d,{color:u.iconColor,fontSize:"small"})]})};iU.propTypes={status:IR().oneOf(Object.values(kS)).isRequired,isDismiss:IR().bool.isRequired,level:IR().number.isRequired,displayLevel:IR().string.isRequired,content:IR().string.isRequired,isExpanded:IR().bool.isRequired,toggleHeading:IR().func.isRequired};const aU=iU,sU=(0,Vn.memo)(({id:e,level:t,content:r,node:n,status:o,violation:i=null,isExpanded:a,toggleHeading:s})=>{const{isLoading:l,updateHeadingsTree:c}=sO(),{applyNewLevel:u,hasDraft:d,getDraftLevelForDisplay:p,restoreOriginalAttributes:h}=eU({node:n}),f=d(n),m=f?p():`h${t}`,[g,b]=(0,Vn.useState)(!1),[y,v]=(0,Vn.useState)(!1),x=kS.WARNING===o&&!g||!f&&!g||l;return(0,Vn.useEffect)(()=>{a?(n.style.boxShadow="0 0 0 8px #2563EB",n.style.borderRadius="4px",n.style.transition="300ms ease-in-out",n.scrollIntoView({behavior:"smooth"})):(n.style.boxShadow="",n.style.borderRadius="",n.style.transition="",y||(h(),setTimeout(()=>c(),0),v(!1)))},[a]),(0,Nt.jsxs)($z,{isExpanded:a,children:[(0,Nt.jsx)(aU,{displayLevel:m,id:e,level:t,status:o,isDismiss:g,content:r,isExpanded:a,toggleHeading:s}),(0,Nt.jsx)(Qq,{in:a,timeout:190,unmountOnExit:!0,mountOnEnter:!0,appear:!1,sx:{width:"100%"},children:(0,Nt.jsxs)(Wz,{role:"region","aria-labelledby":e,children:[(0,Nt.jsxs)(Zz,{children:[(0,Nt.jsx)(Gz,{MenuProps:{disablePortal:!0},fullWidth:!0,size:"small",color:"secondary",error:kS.ERROR===o,"aria-label":(0,tS.__)("Select new heading level","pojo-accessibility"),variant:"outlined",value:m,onChange:e=>{Ww(Vw.headingSelected,{previous_heading:m,new_heading:e.target.value.toUpperCase()}),u(e.target.value),v(!1),c()},disabled:g||l,children:Pz}),(kS.ERROR===o||kS.WARNING===o&&!g)&&i&&(0,Nt.jsx)(oU,{status:o,violation:i})]}),(0,Nt.jsx)(rU,{status:o,node:n,isDisabled:x,isDismiss:g,setIsDismiss:b,displayLevel:m,violation:i,isExpanded:a,setIsSubmitted:v})]})})]})},(e,t)=>e.id===t.id&&e.level===t.level&&e.content===t.content&&e.node===t.node&&e.status===t.status&&e.violation===t.violation&&e.isExpanded===t.isExpanded);sU.propTypes={id:IR().string.isRequired,level:IR().number.isRequired,content:IR().string.isRequired,node:IR().object.isRequired,status:IR().oneOf(Object.values(kS)).isRequired,violation:IR().oneOf(Object.values(BS)),isExpanded:IR().bool.isRequired,toggleHeading:IR().func.isRequired};const lU=sU,cU=(0,Vn.memo)(()=>(0,Nt.jsxs)(uU,{children:[(0,Nt.jsx)(Nk,{width:"100%",height:48}),(0,Nt.jsx)(Nk,{width:"100%",height:48}),(0,Nt.jsx)(Nk,{width:"100%",height:48}),(0,Nt.jsx)(Nk,{width:"100%",height:48}),(0,Nt.jsx)(Nk,{width:"100%",height:48}),(0,Nt.jsx)(Nk,{width:"100%",height:48}),(0,Nt.jsx)(Nk,{width:"100%",height:48})]})),uU=Ma(vo)`
display: flex;
flex-direction: column;
margin-top: ${({theme:e})=>e.spacing(2)};
gap: ${({theme:e})=>e.spacing(1.5)};
`,dU=cU,pU=()=>{const{isLoading:e,expandedKey:t,pageHeadings:r,updateHeadingsTree:n,toggleHeading:o}=sO();(0,Vn.useEffect)(()=>{n()},[]);const i=(0,Vn.useCallback)((e,r)=>{const n=e.flatMap((e,r)=>{const n=LS(e.node),a=(0,Nt.jsx)(lU,{id:n,level:e.level,content:e.content,node:e.node,status:e.status,violation:e.violationCode,isExpanded:t===n,toggleHeading:()=>o(e.node)},n);return e.children.length?[a,i(e.children,r)]:[a]}),a=(0,Nt.jsx)(Yq,{children:n});return!1!==r?(0,Nt.jsx)("li",{children:a},`heading-structure-${r}-nested`):a},[t,o,LS]);return!r.length&&e?(0,Nt.jsx)(dU,{}):i(r,!1)},hU=()=>(0,Nt.jsxs)(Bk,{children:[(0,Nt.jsx)(e_,{}),(0,Nt.jsxs)(vo,{sx:{maxWidth:"300px"},children:[(0,Nt.jsx)(Jw,{variant:"h5",align:"center",sx:{mb:2},children:(0,tS.__)("No headings found","pojo-accessibility")}),(0,Nt.jsx)(Jw,{variant:"body2",align:"center",children:(0,tS.__)("Each page should have a main heading (H1) to establish proper structure and help users understand the page content.","pojo-accessibility")})]})]}),fU=(0,Vn.memo)(()=>(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(zz,{as:"p",variant:"body2",children:(0,tS.__)("Make sure the order of your headings makes sense, so content is read in the right order.","pojo-accessibility")}),(0,Nt.jsx)(zz,{as:"p",variant:"body2",children:_A((0,tS.__)("{{bold}}Note:{{/bold}} Changing a heading’s level won’t affect how it looks.","pojo-accessibility"),{bold:({children:e})=>(0,Nt.jsx)("span",{children:e})})})]})),mU=()=>{const{isLoading:e,pageHeadings:t}=sO();return t.length||e?(0,Nt.jsxs)(Lk,{children:[(0,Nt.jsx)(fU,{}),(0,Nt.jsx)(pU,{})]}):(0,Nt.jsx)(hU,{})},gU=()=>{const{tabsProps:e}=NN();return(0,Nt.jsxs)(Bk,{sx:{px:6},children:[(0,Nt.jsx)(o_,{}),(0,Nt.jsx)(Jw,{variant:"subtitle1",as:"h3",align:"center",children:(0,tS.__)("No fixes yet","pojo-accessibility")}),(0,Nt.jsx)(Jw,{variant:"body2",align:"center",color:"text.secondary",children:(0,tS.__)("Once you start fixing issues for this page, they’ll appear here.","pojo-accessibility")}),(0,Nt.jsx)(F_,{size:"small",variant:"text",color:"info",onClick:t=>{e.onChange(t,mS.main)},children:(0,tS.__)("Fix issues","pojo-accessibility")})]})};var bU=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{d:"M11.9999 6.90002C11.1715 6.90002 10.4999 6.22845 10.4999 5.40002C10.4999 4.5716 11.1715 3.90002 11.9999 3.90002C12.8283 3.90002 13.4999 4.5716 13.4999 5.40002C13.4999 6.22845 12.8283 6.90002 11.9999 6.90002Z"}),e.createElement("path",{d:"M11.9999 13.5C11.1715 13.5 10.4999 12.8285 10.4999 12C10.4999 11.1716 11.1715 10.5 11.9999 10.5C12.8283 10.5 13.4999 11.1716 13.4999 12C13.4999 12.8285 12.8283 13.5 11.9999 13.5Z"}),e.createElement("path",{d:"M11.9999 20.1C11.1714 20.1 10.4999 19.4285 10.4999 18.6C10.4999 17.7716 11.1715 17.1 11.9999 17.1C12.8283 17.1 13.4999 17.7716 13.4999 18.6C13.4999 19.4285 12.8283 20.1 11.9999 20.1Z"}))),yU=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.2295 8.24989H15C14.5858 8.24989 14.25 8.58568 14.25 8.99989C14.25 9.4141 14.5858 9.74989 15 9.74989H19.4164C19.4276 9.75014 19.4389 9.75015 19.4502 9.74989H20C20.4142 9.74989 20.75 9.4141 20.75 8.99989V3.99989C20.75 3.58568 20.4142 3.24989 20 3.24989C19.5858 3.24989 19.25 3.58568 19.25 3.99989V7.05997C17.216 4.05724 13.4602 2.59135 9.82139 3.52648C8.28303 3.92219 6.88124 4.72923 5.76667 5.86098C4.65209 6.99273 3.86662 8.40653 3.49449 9.95076C3.12236 11.495 3.1776 13.1114 3.6543 14.6266C4.13101 16.1418 5.01118 17.4987 6.20042 18.5517C7.38967 19.6047 8.84313 20.3141 10.4049 20.6039C11.9667 20.8936 13.5779 20.7528 15.0657 20.1964C16.5535 19.64 17.8618 18.6892 18.8503 17.4458C19.8388 16.2024 20.4702 14.7134 20.6767 13.1384C20.7306 12.7277 20.4413 12.3511 20.0306 12.2972C19.6199 12.2434 19.2433 12.5327 19.1894 12.9434C19.0183 14.2483 18.4952 15.4821 17.6761 16.5123C16.8571 17.5426 15.7731 18.3304 14.5403 18.7914C13.3076 19.2524 11.9726 19.3691 10.6785 19.129C9.38447 18.889 8.18018 18.3012 7.1948 17.4287C6.20943 16.5562 5.48014 15.4319 5.08516 14.1765C4.69018 12.921 4.6444 11.5817 4.95274 10.3022C5.26108 9.02267 5.9119 7.85123 6.83541 6.9135C7.75887 5.9758 8.92032 5.30712 10.1949 4.97924M10.1949 4.97924C13.3573 4.1666 16.6106 5.53614 18.2295 8.24989L10.1949 4.97924Z"}))),vU=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 3.75C9.9337 3.75 9.87011 3.77634 9.82322 3.82322C9.77634 3.87011 9.75 3.9337 9.75 4V6.25H14.25V4C14.25 3.9337 14.2237 3.87011 14.1768 3.82322C14.1299 3.77634 14.0663 3.75 14 3.75H10ZM15.75 6.25V4C15.75 3.53587 15.5656 3.09075 15.2374 2.76256C14.9092 2.43437 14.4641 2.25 14 2.25H10C9.53587 2.25 9.09075 2.43437 8.76256 2.76256C8.43437 3.09075 8.25 3.53587 8.25 4V6.25H5.00877C5.00349 6.24994 4.9982 6.24994 4.9929 6.25H4C3.58579 6.25 3.25 6.58579 3.25 7C3.25 7.41421 3.58579 7.75 4 7.75H4.3099L5.25021 19.0337C5.25898 19.7508 5.54767 20.4368 6.05546 20.9445C6.57118 21.4603 7.27065 21.75 8 21.75H16C16.7293 21.75 17.4288 21.4603 17.9445 20.9445C18.4523 20.4368 18.741 19.7508 18.7498 19.0337L19.6901 7.75H20C20.4142 7.75 20.75 7.41421 20.75 7C20.75 6.58579 20.4142 6.25 20 6.25H19.0071C19.0018 6.24994 18.9965 6.24994 18.9912 6.25H15.75ZM5.8151 7.75L6.74741 18.9377C6.74914 18.9584 6.75 18.9792 6.75 19C6.75 19.3315 6.8817 19.6495 7.11612 19.8839C7.35054 20.1183 7.66848 20.25 8 20.25H16C16.3315 20.25 16.6495 20.1183 16.8839 19.8839C17.1183 19.6495 17.25 19.3315 17.25 19C17.25 18.9792 17.2509 18.9584 17.2526 18.9377L18.1849 7.75H5.8151ZM10 10.25C10.4142 10.25 10.75 10.5858 10.75 11V17C10.75 17.4142 10.4142 17.75 10 17.75C9.58579 17.75 9.25 17.4142 9.25 17V11C9.25 10.5858 9.58579 10.25 10 10.25ZM14 10.25C14.4142 10.25 14.75 10.5858 14.75 11V17C14.75 17.4142 14.4142 17.75 14 17.75C13.5858 17.75 13.25 17.4142 13.25 17V11C13.25 10.5858 13.5858 10.25 14 10.25Z"}))),xU=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.7 2.25C8.46249 2.25 8.23103 2.29047 8.0079 2.38964C7.78802 2.48736 7.61395 2.62539 7.46967 2.76967L2.76967 7.46967C2.62539 7.61395 2.48736 7.78802 2.38964 8.0079C2.29047 8.23103 2.25 8.46249 2.25 8.7V15.3C2.25 15.5375 2.29047 15.769 2.38964 15.9921C2.48736 16.212 2.62539 16.3861 2.76967 16.5303L7.46967 21.2303C7.61395 21.3746 7.78802 21.5126 8.0079 21.6104C8.23103 21.7095 8.46249 21.75 8.7 21.75H15.3C15.5375 21.75 15.769 21.7095 15.9921 21.6104C16.212 21.5126 16.3861 21.3746 16.5303 21.2303L21.2303 16.5303C21.3746 16.3861 21.5126 16.212 21.6104 15.9921C21.7095 15.769 21.75 15.5375 21.75 15.3V8.7C21.75 8.46249 21.7095 8.23103 21.6104 8.0079C21.5126 7.78802 21.3746 7.61395 21.2303 7.46967L16.5303 2.76967C16.3861 2.62539 16.212 2.48736 15.9921 2.38964C15.769 2.29047 15.5375 2.25 15.3 2.25H8.7ZM12.75 8C12.75 7.58579 12.4142 7.25 12 7.25C11.5858 7.25 11.25 7.58579 11.25 8V12C11.25 12.4142 11.5858 12.75 12 12.75C12.4142 12.75 12.75 12.4142 12.75 12V8ZM12 15.25C11.5858 15.25 11.25 15.5858 11.25 16C11.25 16.4142 11.5858 16.75 12 16.75H12.01C12.4242 16.75 12.76 16.4142 12.76 16C12.76 15.5858 12.4242 15.25 12.01 15.25H12Z"})));const wU=({open:e,hideConfirmation:t,onDelete:r,count:n=null,isMain:o=!1})=>(0,Nt.jsx)(rB,{open:e,onClose:t,onCancel:t,title:o?(0,tS.sprintf)(
// Translators: %s - fixes count
// Translators: %s - fixes count
(0,tS.__)("Remove %s fixes?","pojo-accessibility"),n):(0,tS.__)("Remove this fix?","pojo-accessibility"),approveText:o?(0,tS.__)("Remove fixes","pojo-accessibility"):(0,tS.__)("Remove fix","pojo-accessibility"),cancelText:(0,tS.__)("Not now","pojo-accessibility"),logo:(0,Nt.jsx)(xU,{color:"error",sx:{mt:"6px"}}),onApprove:r,showCloseButton:!0,disablePortal:!0,PaperProps:{sx:{maxWidth:"440px",width:"100%"}},children:(0,Nt.jsx)(Jw,{variant:"body2",children:o?(0,tS.__)("This removes the fixes and marks the accessibility issues as unresolve. This can’t be undone.","pojo-accessibility"):(0,tS.__)("This removes the fix and marks the accessibility issue as unresolve. This can’t be undone.","pojo-accessibility")})});wU.propTypes={open:IR().bool.isRequired,hideConfirmation:IR().func.isRequired,onDelete:IR().func.isRequired,count:IR().number,isMain:IR().bool};const _U=wU,CU=({open:e,hideConfirmation:t,onDelete:r,count:n=null,isMain:o=!1})=>(0,Nt.jsx)(rB,{open:e,onClose:t,onCancel:t,title:o?(0,tS.sprintf)(
// Translators: %s - fixes count
// Translators: %s - fixes count
(0,tS.__)("Remove %s fixes across scans","pojo-accessibility"),n):(0,tS.__)("Remove fix across scans?","pojo-accessibility"),approveText:(0,tS.__)("Remove everywhere","pojo-accessibility"),cancelText:(0,tS.__)("Not now","pojo-accessibility"),logo:(0,Nt.jsx)(xU,{color:"error",sx:{mt:"6px"}}),onApprove:r,showCloseButton:!0,disablePortal:!0,PaperProps:{sx:{maxWidth:"440px",width:"100%"}},children:(0,Nt.jsx)(Jw,{variant:"body2",children:o?(0,tS.__)("These fixes will no longer apply to past or future scans, leaving the issues unresolved.","pojo-accessibility"):(0,tS.__)("This fix will no longer apply to past or future scans, leaving the issue unresolved.","pojo-accessibility")})});CU.propTypes={open:IR().bool.isRequired,hideConfirmation:IR().func.isRequired,onDelete:IR().func.isRequired,count:IR().number,isMain:IR().bool};const kU=CU,SU=({open:e,hideConfirmation:t,onDisable:r,count:n=null})=>(0,Nt.jsx)(rB,{open:e,onClose:t,onCancel:t,title:(0,tS.sprintf)(
// Translators: %s - fixes count
// Translators: %s - fixes count
(0,tS.__)("Disable %s fixes across scans","pojo-accessibility"),n),approveButtonColor:"warning",approveText:(0,tS.__)("Disable everywhere","pojo-accessibility"),cancelText:(0,tS.__)("Not now","pojo-accessibility"),logo:(0,Nt.jsx)(xU,{color:"warning",sx:{mt:"6px"}}),onApprove:r,showCloseButton:!0,disablePortal:!0,PaperProps:{sx:{maxWidth:"440px",width:"100%"}},children:(0,Nt.jsx)(Jw,{variant:"body2",children:(0,tS.__)("These fixes will be disabled on past and future scans, leaving the issues unresolved. You can always enable them again.","pojo-accessibility")})});SU.propTypes={open:IR().bool.isRequired,hideConfirmation:IR().func.isRequired,onDisable:IR().func.isRequired,count:IR().number.isRequired};const AU=SU;var jU=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 11.75C2.25 6.36522 6.61522 2 12 2C17.3848 2 21.75 6.36522 21.75 11.75C21.75 17.1348 17.3848 21.5 12 21.5C6.61522 21.5 2.25 17.1348 2.25 11.75ZM11.25 7.75C11.25 7.33579 11.5858 7 12 7H12.01C12.4242 7 12.76 7.33579 12.76 7.75C12.76 8.16421 12.4242 8.5 12.01 8.5H12C11.5858 8.5 11.25 8.16421 11.25 7.75ZM10.25 11.75C10.25 11.3358 10.5858 11 11 11H12C12.4142 11 12.75 11.3358 12.75 11.75V15H13C13.4142 15 13.75 15.3358 13.75 15.75C13.75 16.1642 13.4142 16.5 13 16.5H12C11.5858 16.5 11.25 16.1642 11.25 15.75V12.5H11C10.5858 12.5 10.25 12.1642 10.25 11.75Z"})));const RU=({open:e,hideConfirmation:t,onEnable:r,count:n})=>(0,Nt.jsx)(rB,{open:e,onClose:t,onCancel:t,title:(0,tS.sprintf)(
// Translators: %s - fixes count
// Translators: %s - fixes count
(0,tS.__)("Enable %s fixes across scans","pojo-accessibility"),n),approveButtonColor:"info",approveText:(0,tS.__)("Enable everywhere","pojo-accessibility"),cancelText:(0,tS.__)("Not now","pojo-accessibility"),logo:(0,Nt.jsx)(jU,{color:"info",sx:{mt:"6px"}}),onApprove:r,showCloseButton:!0,disablePortal:!0,PaperProps:{sx:{maxWidth:"440px",width:"100%"}},children:(0,Nt.jsx)(Jw,{variant:"body2",children:(0,tS.__)("These fixes will be enabled on past and future scans, making the issues resolved. You can disable them again at any time.","pojo-accessibility")})});RU.propTypes={open:IR().bool.isRequired,hideConfirmation:IR().func.isRequired,onEnable:IR().func.isRequired,count:IR().number.isRequired};const IU=RU,MU=(e=null)=>{const{error:t}=Gn(),{remediations:r,sortedRemediation:n,openedBlock:o,setSortedRemediation:i,setLoading:a,updateRemediationList:s,setIsManageChanged:l}=QS(),[c,u]=(0,Vn.useState)(!1);return{activeRequest:c,updateAllRemediationForPage:(e,o)=>async()=>{try{a(!0),await oo.updateRemediationStatusForPage({url:window?.ea11yScannerData?.pageData?.url,active:e,group:o}),l(!0),await s(),Ww(Vw[e?"remediationEnabled":"remediationDisabled"],{action_type:e?"enable_all":"disable_all",remediations_amount:o?n[o]:r?.length,category:o||"all",is_global:"no"})}catch(e){console.error(e),t((0,tS.__)("An error occurred.","pojo-accessibility"))}finally{a(!1)}},deleteAllRemediationForPage:async e=>{try{if(a(!0),await oo.deleteRemediationForPage({url:window?.ea11yScannerData?.pageData?.url,group:e}),Ww(Vw.remediationRemoved,{action_type:"remove_all",remediations_amount:e?n[e]:r?.length,category:e||"all",is_global:"no"}),e)await s();else{const e=new URL(window.location.href);e.searchParams.delete("open-ea11y-assistant"),e.searchParams.delete("open-ea11y-assistant-src"),e.searchParams.append("open-ea11y-assistant","1"),window.location.assign(e)}}catch(e){console.error(e),t((0,tS.__)("An error occurred.","pojo-accessibility"))}finally{a(!1)}},updateRemediation:r=>async()=>{try{u(!0),await oo.updateRemediation({url:window?.ea11yScannerData?.pageData?.url,active:r,id:e.id}),await s(),l(!0),Ww(Vw[r?"remediationEnabled":"remediationDisabled"],{action_type:r?"enable_specific":"disable_specific",category_name:o,issue_type:e.rule})}catch(e){console.error(e),t((0,tS.__)("An error occurred.","pojo-accessibility"))}finally{u(!1)}},deleteRemediation:async()=>{try{u(!0),await oo.deleteRemediation({url:window?.ea11yScannerData?.pageData?.url,id:e.id}),await s(),l(!0),Ww(Vw.remediationRemoved,{action_type:"remove_specific",category_name:o,issue_type:e.rule,is_global:"no"})}catch(e){console.error(e),t((0,tS.__)("An error occurred.","pojo-accessibility"))}finally{ZS(),u(!1)}},editRemediation:async r=>{try{u(!0);const t=JSON.stringify(r);await oo.updateRemediationContent({url:window?.ea11yScannerData?.pageData?.url,id:e.id,content:t});const a=n[o].map(r=>r.id===e.id?{...r,content:t}:r);i({...n,[o]:a}),l(!0),Ww(Vw.applyFixButtonClicked,{fix_method:"manual",snippet_content:t,category_name:o,source:"remediation"})}catch(e){console.error(e),t((0,tS.__)("An error occurred.","pojo-accessibility"))}finally{u(!1)}}}},EU=({group:e})=>{const{sortedRemediation:t}=QS(),{deleteAllRemediationForPage:r,updateAllRemediationForPage:n}=MU(),o=(0,Vn.useRef)(null),[i,a]=(0,Vn.useState)(!1),[s,l]=(0,Vn.useState)(!1),c=t[e]?.length,u=c===t[e]?.filter(e=>!Number(e.active))?.length,d=()=>a(!i);return(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(Ca,{id:`${e}-menu-button`,"aria-controls":s?`${e}-manage-menu`:void 0,"aria-expanded":s?"true":void 0,"aria-haspopup":"true",onClick:()=>{l(!0)},ref:o,size:"tiny","aria-label":(0,tS.sprintf)(
// Translators: %s - group title
// Translators: %s - group title
(0,tS.__)("%s menu","pojo-accessibility"),bS[e]),children:(0,Nt.jsx)(bU,{fontSize:"tiny"})}),(0,Nt.jsxs)(fN,{open:s,id:`${e}-manage-menu`,anchorEl:o.current,onClose:()=>l(!1),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},MenuListProps:{"aria-labelledby":`${e}-menu-button`},PaperProps:{style:{overflow:"visible"}},disablePortal:!0,children:[u?(0,Nt.jsxs)(Ez,{onClick:n(!0,e),dense:!0,children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(yU,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Enable all","pojo-accessibility")})]}):(0,Nt.jsxs)(Ez,{onClick:n(!1,e),dense:!0,children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(Jk,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Disable all","pojo-accessibility")})]}),(0,Nt.jsxs)(Ez,{onClick:d,dense:!0,children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(vU,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Remove all","pojo-accessibility")})]})]}),(0,Nt.jsx)(_U,{open:i,hideConfirmation:d,onDelete:async()=>{a(!1),await r(e)},count:c,isMain:!0})]})};EU.propTypes={group:IR().string.isRequired};const TU=({group:e})=>{const{sortedGlobalRemediation:t}=QS(),{updateGlobalRemediationGroupForPage:r,updateGlobalRemediationGroupForAllPages:n,deleteGlobalRemediations:o}=oB(),i=(0,Vn.useRef)(null),[a,s]=(0,Vn.useState)(!1),[l,c]=(0,Vn.useState)(!1),[u,d]=(0,Vn.useState)(!1),[p,h]=(0,Vn.useState)(!1),f=t[e]?.length,m=f===t[e]?.filter(e=>!Number(e.active_for_page))?.length,g=f===t[e]?.filter(e=>!Number(e.active))?.length,b=()=>{n(g,e)};return(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(Ca,{id:`${e}-menu-button--global`,"aria-controls":p?`${e}-manage-menu`:void 0,"aria-expanded":p?"true":void 0,"aria-haspopup":"true",onClick:()=>{h(!0)},ref:i,size:"tiny","aria-label":(0,tS.sprintf)(
// Translators: %s - group title
// Translators: %s - group title
(0,tS.__)("%s menu","pojo-accessibility"),bS[e]),children:(0,Nt.jsx)(bU,{fontSize:"tiny"})}),(0,Nt.jsxs)(fN,{open:p,id:`${e}-manage-menu--global`,anchorEl:i.current,onClose:()=>h(!1),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},MenuListProps:{"aria-labelledby":`${e}-menu-button--global`},PaperProps:{style:{overflow:"visible"}},disablePortal:!0,children:[(0,Nt.jsx)(Ez,{onClick:()=>{r(m,e)},dense:!0,children:m?(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(yU,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Enable on this page","pojo-accessibility")})]}):(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(Jk,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Disable on this page","pojo-accessibility")})]})}),(0,Nt.jsx)(Ez,{onClick:()=>{g?d(!0):c(!0),Ww(Vw.popupButtonClicked,{data:{popupType:g?"global_enable_confirmation":"global_disable_confirmation",buttonName:g?(0,tS.__)("Enable across scans","pojo-accessibility"):(0,tS.__)("Disable across scans","pojo-accessibility")}})},dense:!0,children:g?(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(yU,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Enable across scans","pojo-accessibility")})]}):(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(Jk,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Disable across scans","pojo-accessibility")})]})}),(0,Nt.jsxs)(Ez,{onClick:()=>{s(!0),Ww(Vw.popupButtonClicked,{data:{popupType:"global_delete_confirmation",buttonName:"Remove across scans"}})},dense:!0,children:[(0,Nt.jsx)(_N,{children:(0,Nt.jsx)(vU,{fontSize:"tiny"})}),(0,Nt.jsx)(vC,{children:(0,tS.__)("Remove across scans","pojo-accessibility")})]})]}),(0,Nt.jsx)(kU,{open:a,hideConfirmation:()=>s(!1),onDelete:()=>{s(!1),o(e)},count:f,isMain:!0}),(0,Nt.jsx)(AU,{open:l,hideConfirmation:()=>c(!l),onDisable:b,count:f}),(0,Nt.jsx)(IU,{open:u,hideConfirmation:()=>c(!l),onEnable:b,count:f})]})};TU.propTypes={group:IR().string.isRequired};const OU=({title:e,count:t,block:r,global:n=!1})=>{const{sortedRemediation:o,sortedGlobalRemediation:i,setOpenedBlock:a,setIsManageGlobal:s}=QS(),l=(n?i:o)[r].length;return(0,Nt.jsxs)(qk,{children:[(0,Nt.jsx)(Uk,{variant:"text",color:"secondary",size:"large",fullWidth:!0,onClick:()=>{a(r),s(n),Ww(Vw.categoryClicked,{page_url:window.ea11yScannerData?.pageData?.url,issue_count:t,category_name:r,source:"remediation"})},children:(0,Nt.jsx)(Jw,{noWrap:!0,variant:"subtitle2",as:"h4",color:"text.primary",children:e})}),(0,Nt.jsx)(lC,{icon:n?(0,Nt.jsx)(tD,{fontSize:"small"}):null,label:(0,tS.sprintf)(
// Translators: %1$s - active, %2$s - total
// Translators: %1$s - active, %2$s - total
(0,tS.__)("%1$s/%2$s active","pojo-accessibility"),t,l),color:t>0?"info":"default",variant:"standard",size:"tiny",disabled:0===t}),n?(0,Nt.jsx)(TU,{group:r}):(0,Nt.jsx)(EU,{group:r})]})};OU.propTypes={title:IR().string.isRequired,count:IR().number.isRequired,block:IR().string.isRequired,global:IR().bool};const PU=({global:e=!1})=>{const{sortedRemediation:t,sortedGlobalRemediation:r}=QS(),n=e?r:t;return(0,Nt.jsx)(Kk,{children:Object.keys(n).flatMap(t=>{if(n[t].length<1)return[];const r=n[t].filter(({active:t,active_for_page:r})=>Number(e?r:t)).length;return(0,Nt.jsx)(OU,{title:bS[t],count:r,block:mS[t],global:e},t)})})};PU.propTypes={global:IR().bool};const LU=PU,zU=()=>{const{remediations:e}=QS(),{deleteAllRemediationForPage:t}=MU(),[r,n]=(0,Vn.useState)(!1),o=()=>n(!r);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:(0,tS.__)("Remove all","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"tiny",color:"error",onClick:o,children:(0,Nt.jsx)(vU,{fontSize:"tiny"})})}),(0,Nt.jsx)(_U,{open:r,hideConfirmation:o,onDelete:async()=>{n(!1),await t()},count:e.length,isMain:!0})]})},NU=()=>{const{remediations:e}=QS(),{updateAllRemediationForPage:t}=MU();return(0,Nt.jsx)(F_,{startIcon:(0,Nt.jsx)(Jk,{}),size:"small",color:"secondary",variant:"text",onClick:t(!1),disabled:e.length<1,children:(0,tS.__)("Disable all","pojo-accessibility")})},FU=()=>{const{updateAllRemediationForPage:e}=MU();return(0,Nt.jsx)(F_,{startIcon:(0,Nt.jsx)(yU,{}),size:"small",color:"info",variant:"text",onClick:e(!0),children:(0,tS.__)("Enable all","pojo-accessibility")})},DU=()=>{const{remediations:e}=QS(),t=e.length>0&&e?.length===e?.filter(e=>!Number(e.active))?.length;return(0,Nt.jsxs)(vo,{display:"flex",gap:1,children:[t&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(zU,{}),(0,Nt.jsx)(yO,{orientation:"vertical",flexItem:!0,sx:{my:.5}})]}),t?(0,Nt.jsx)(FU,{}):(0,Nt.jsx)(NU,{})]})},BU=()=>{const{globalRemediations:e}=QS(),{deleteGlobalRemediations:t}=oB(),[r,n]=(0,Vn.useState)(!1);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:(0,tS.__)("Remove all","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"tiny",color:"error",onClick:()=>{n(!0),Ww(Vw.popupButtonClicked,{data:{popupType:"global_delete_confirmation",buttonName:"Remove all"}})},children:(0,Nt.jsx)(vU,{fontSize:"tiny"})})}),(0,Nt.jsx)(kU,{open:r,hideConfirmation:()=>n(!1),onDelete:async()=>{n(!1),await t()},count:e.length,isMain:!0})]})};var $U=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.46967 9.21967C5.76256 8.92678 6.23744 8.92678 6.53033 9.21967L12 14.6893L17.4697 9.21967C17.7626 8.92678 18.2374 8.92678 18.5303 9.21967C18.8232 9.51256 18.8232 9.98744 18.5303 10.2803L12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L5.46967 10.2803C5.17678 9.98744 5.17678 9.51256 5.46967 9.21967Z"})));const HU=({isAllExcluded:e,isAllDisabled:t})=>{const{globalRemediations:r}=QS(),[n,o]=(0,Vn.useState)(!1),i=(0,Vn.useRef)(null),[a,s]=(0,Vn.useState)(!1),[l,c]=(0,Vn.useState)(!1),{updateAllGlobalRemediationForPage:u,updateAllGlobalRemediationForAllPages:d}=oB(),p=()=>{d(t)};return(0,Nt.jsxs)(vo,{display:"flex",gap:1,children:[(0,Nt.jsx)(F_,{id:"global-remediation-menu-button",startIcon:e?(0,Nt.jsx)(yU,{}):(0,Nt.jsx)(Jk,{}),endIcon:(0,Nt.jsx)($U,{}),size:"small",color:e?"info":"secondary",variant:"text",onClick:()=>{o(!0)},ref:i,children:e?(0,tS.__)("Enable all","pojo-accessibility"):(0,tS.__)("Disable all","pojo-accessibility")}),(0,Nt.jsxs)(fN,{id:"global-remediation-menu",open:n,MenuListProps:{"aria-labelledby":"global-remediation-menu-button"},anchorEl:i.current,onClose:()=>o(!1),disablePortal:!0,children:[(0,Nt.jsx)(Ez,{onClick:()=>{u(e)},dense:!0,children:(0,Nt.jsx)(vC,{children:e?(0,tS.__)("Enable on this page","pojo-accessibility"):(0,tS.__)("Disable on this page","pojo-accessibility")})}),(0,Nt.jsx)(Ez,{onClick:()=>{t?c(!0):s(!0),Ww(Vw.popupButtonClicked,{data:{popupType:t?"global_enable_confirmation":"global_disable_confirmation",buttonName:t?"Enable across scans":"Disable across scans"}})},dense:!0,children:(0,Nt.jsx)(vC,{children:t?(0,tS.__)("Enable across scans","pojo-accessibility"):(0,tS.__)("Disable across scans","pojo-accessibility")})})]}),(0,Nt.jsx)(AU,{open:a,hideConfirmation:()=>s(!a),onDisable:p,count:r.length}),(0,Nt.jsx)(IU,{open:l,hideConfirmation:()=>s(!a),onEnable:p,count:r.length})]})};HU.propTypes={isAllExcluded:IR().bool.isRequired,isAllDisabled:IR().bool.isRequired};const WU=HU,VU=()=>{const{globalRemediations:e}=QS(),t=e?.length,r=t===e?.filter(e=>!Number(e.active_for_page))?.length,n=t===e?.filter(e=>!Number(e.active))?.length;return(0,Nt.jsxs)(vo,{display:"flex",gap:1,children:[r&&n&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(BU,{}),(0,Nt.jsx)(yO,{orientation:"vertical",flexItem:!0,sx:{my:.5}})]}),(0,Nt.jsx)(WU,{isAllExcluded:r,isAllDisabled:n})]})},qU=()=>{const{remediations:e,globalRemediations:t}=QS(),[r,n]=(0,Vn.useState)(!0),o=(e.length>0||t.length>0)&&!uS&&!window.localStorage.getItem(pS)&&r;return(0,Nt.jsxs)(ZU,{children:[e.length>0&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(UU,{children:[(0,Nt.jsx)(Jw,{variant:"body2",color:"text.tertiary",children:(0,tS.__)("Fixes on this page","pojo-accessibility")}),(0,Nt.jsx)(DU,{})]}),(0,Nt.jsx)(LU,{})]}),t.length>0&&(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsxs)(UU,{sx:{mt:2},children:[(0,Nt.jsx)(Jw,{variant:"body2",color:"text.tertiary",children:(0,tS.__)("Cross-page fixes","pojo-accessibility")}),(0,Nt.jsx)(VU,{})]}),(0,Nt.jsx)(LU,{global:!0})]}),0===e.length&&0===t.length&&(0,Nt.jsx)(gU,{}),o&&(0,Nt.jsxs)(Ga,{icon:(0,Nt.jsx)(EN,{color:"promotion"}),color:"error",onClose:()=>{window.localStorage.setItem(pS,Date.now().toString()),n(!1)},sx:{mt:2},children:[(0,Nt.jsx)(Jw,{variant:"body2",sx:{mb:1.5,color:"text.secondary"},children:(0,tS.__)("Resolve these issues on all of your scanned pages with a click.","pojo-accessibility")}),(0,Nt.jsx)(F_,{size:"small",color:"promotion",variant:"contained",href:lS,target:"_blank",rel:"noreferrer",onClick:()=>{Ww(Vw.upgradeButtonClicked,{current_plan:window.ea11yScannerData?.planData?.plan?.name,feature_locked:"global_banner"})},children:(0,tS.__)("Upgrade now","pojo-accessibility")})]})]})},UU=Ma(vo)`
display: flex;
align-items: center;
justify-content: space-between;
`,ZU=Ma(X_)`
display: flex;
flex-direction: column;
gap: ${({theme:e})=>e.spacing(2)};
padding: 0 ${({theme:e})=>e.spacing(2)};
`,GU=({id:e,rule:t})=>{const{activeRequest:r,deleteGlobalRemediation:n}=oB(),[o,i]=(0,Vn.useState)(!1),a=()=>i(!o);return(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(vR,{placement:"top",title:(0,tS.__)("Remove","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"tiny",color:"error",onClick:a,disabled:r,children:(0,Nt.jsx)(vU,{fontSize:"tiny"})})}),(0,Nt.jsx)(yO,{orientation:"vertical",flexItem:!0,sx:{my:.5}}),(0,Nt.jsx)(kU,{open:o,hideConfirmation:a,onDelete:async()=>{i(!1),await n(e,t)}})]})};GU.propTypes={id:IR().number.isRequired,rule:IR().string.isRequired};const KU=GU,XU=({item:e})=>{const[t,r]=(0,Vn.useState)(!1),n=(0,Vn.useRef)(null),o="1"!==e.active,i="1"!==e.active_for_page,{activeRequest:a,updateGlobalRemediationForPage:s,updateGlobalRemediationForAllPages:l}=oB(),c=()=>r(!1);return(0,Nt.jsxs)(vo,{display:"flex",gap:1,justifyContent:"flex-end",children:[o&&i&&(0,Nt.jsx)(KU,{id:e.id,rule:e.rule}),(0,Nt.jsx)(F_,{id:"global-remediation-menu-button",startIcon:i?(0,Nt.jsx)(yU,{}):(0,Nt.jsx)(Jk,{}),endIcon:(0,Nt.jsx)($U,{}),size:"small",color:i?"info":"secondary",variant:"outlined",disabled:a,onClick:()=>{r(!0)},ref:n,sx:{ml:1},children:i?(0,tS.__)("Enable fix","pojo-accessibility"):(0,tS.__)("Disable fix","pojo-accessibility")}),(0,Nt.jsxs)(fN,{id:"global-remediation-menu",open:t,MenuListProps:{"aria-labelledby":"global-remediation-menu-button"},anchorEl:n.current,onClose:c,disablePortal:!0,children:[(0,Nt.jsx)(Ez,{onClick:()=>{c(),s(e.id,i,e.rule)},disabled:a,dense:!0,children:(0,Nt.jsx)(vC,{children:i?(0,tS.__)("Enable on this page","pojo-accessibility"):(0,tS.__)("Disable on this page","pojo-accessibility")})}),(0,Nt.jsx)(Ez,{onClick:()=>{c(),l(e.id,o,e.rule)},disabled:a,dense:!0,children:(0,Nt.jsx)(vC,{children:o?(0,tS.__)("Enable across scans","pojo-accessibility"):(0,tS.__)("Disable across scans","pojo-accessibility")})})]})]})};XU.propTypes={item:r$};const JU=XU,YU=({item:e,isActive:t})=>{const{activeRequest:r,deleteRemediation:n,updateRemediation:o}=MU(e),[i,a]=(0,Vn.useState)(!1),s=()=>a(!i),l=e?.content?JSON.parse(e.content):null;return(0,Nt.jsxs)(vo,{display:"flex",gap:1,justifyContent:t&&l?.find?"space-between":"flex-end",sx:{width:"100%"},children:[t?(0,Nt.jsxs)(Nt.Fragment,{children:[l?.find&&(0,Nt.jsx)(e$,{item:e}),(0,Nt.jsx)(F_,{startIcon:(0,Nt.jsx)(Jk,{}),size:"small",color:"secondary",variant:"outlined",disabled:r,onClick:o(!1),children:(0,tS.__)("Disable fix","pojo-accessibility")})]}):(0,Nt.jsxs)(vo,{display:"flex",gap:.5,children:[(0,Nt.jsx)(vR,{placement:"top",title:(0,tS.__)("Remove","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"tiny",color:"error",onClick:s,disabled:r,children:(0,Nt.jsx)(vU,{fontSize:"tiny"})})}),(0,Nt.jsx)(yO,{orientation:"vertical",flexItem:!0,sx:{my:.5}}),(0,Nt.jsx)(F_,{startIcon:(0,Nt.jsx)(yU,{}),size:"small",color:"info",variant:"outlined",disabled:r,onClick:o(!0),sx:{ml:1},children:(0,tS.__)("Enable fix","pojo-accessibility")})]}),(0,Nt.jsx)(_U,{open:i,hideConfirmation:s,onDelete:async()=>{a(!1),await n()}})]})};YU.propTypes={item:QB,isActive:IR().bool.isRequired};const QU=YU,eZ=({item:e,isActive:t})=>"1"===e.global?(0,Nt.jsx)(JU,{item:e}):(0,Nt.jsx)(QU,{isActive:t,item:e}),tZ=({item:e})=>{const t=JSON.parse(e.content),{openedBlock:r}=QS(),{copied:n,copyToClipboard:o}=jH(),{activeRequest:i,editRemediation:a}=MU(e),[s,l]=(0,Vn.useState)(!1),[c,u]=(0,Vn.useState)(t.replace),d="1"===e.global?"1"===e.active_for_page:"1"===e.active;return(0,Nt.jsx)(vo,{sx:{mb:3},children:(0,Nt.jsxs)(q_,{variant:"outlined",sx:{overflow:"visible"},children:[(0,Nt.jsxs)(X_,{sx:{pt:1.5,pb:0},children:[(0,Nt.jsxs)(KB,{children:[(0,Nt.jsxs)(XB,{children:[(0,Nt.jsx)(WN,{}),(0,Nt.jsx)(Jw,{variant:"subtitle2",children:d?(0,tS.__)("Active fix","pojo-accessibility"):(0,tS.__)("Fix (disabled)","pojo-accessibility")}),e.global&&(0,Nt.jsx)(lC,{icon:(0,Nt.jsx)(tD,{fontSize:"small"}),label:(0,tS.__)("Cross-scan","pojo-accessibility"),color:"default",variant:"outlined",size:"tiny"})]}),!s&&(0,Nt.jsxs)(vo,{display:"flex",alignItems:"center",children:["1"===e.global?(0,Nt.jsx)(vR,{placement:"top",title:(0,tS.__)("You can't edit cross-scan fixes with Ally","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(bH,{fontSize:"tiny",color:"disabled",sx:{p:.5}})}):(0,Nt.jsx)(vR,{placement:"top",title:(0,tS.__)("Edit","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"tiny",onClick:()=>{l(!0),Ww(Vw.editSnippetClicked,{snippet_content:t.replace,category_name:r,source:"remediation"})},disabled:i,children:(0,Nt.jsx)(bH,{fontSize:"tiny"})})}),(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:n?(0,tS.__)("Copied!","pojo-accessibility"):(0,tS.__)("Copy","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"tiny",onClick:o(t.replace,"fixed_snippet","remediation"),children:(0,Nt.jsx)(Y$,{fontSize:"tiny"})})})]})]}),s?(0,Nt.jsx)(JB,{value:c,color:"secondary",size:"small",multiline:!0,fullWidth:!0,onChange:e=>{u(e.target.value)},inputProps:{"aria-label":(0,tS.__)("Manual edit","pojo-accessibility")},disabled:i}):(0,Nt.jsx)(Fk,{color:d?"info":"secondary",icon:!1,disabled:!d,children:(0,Nt.jsx)(vo,{display:"flex",gap:.5,alignItems:"start",children:(0,Nt.jsx)(qB,{variant:"body2",color:d?"text.primary":"text.disabled",children:t.replace})})})]}),(0,Nt.jsx)(CH,{sx:{p:2},children:s?(0,Nt.jsxs)(Nt.Fragment,{children:[(0,Nt.jsx)(F_,{size:"small",color:"secondary",variant:"text",onClick:()=>l(!1),disabled:i,children:(0,tS.__)("Cancel","pojo-accessibility")}),(0,Nt.jsx)(F_,{size:"small",color:"info",variant:"contained",loadingPosition:"start",disabled:c===t.replace||i,onClick:async()=>{await a({...t,replace:c}),l(!1)},children:(0,tS.__)("Apply changes","pojo-accessibility")})]}):(0,Nt.jsx)(eZ,{item:e,isActive:d})})]})})};tZ.propTypes={item:QB};const rZ=({item:e})=>{const{copied:t,copyToClipboard:r}=jH(),n=JSON.parse(e.content);return(0,Nt.jsx)(Nt.Fragment,{children:(0,Nt.jsxs)(VB,{children:[(0,Nt.jsxs)(vo,{children:[(0,Nt.jsxs)(vo,{display:"flex",gap:1,alignItems:"center",children:[(0,Nt.jsx)(Jw,{variant:"subtitle2",as:"h5",children:(0,tS.__)("What’s the issue","pojo-accessibility")}),(0,Nt.jsx)(SR,{tabIndex:"0",placement:"top",PopperProps:{disablePortal:!0},content:(0,Nt.jsxs)(UB,{children:[(0,Nt.jsx)(Jw,{variant:"subtitle1",sx:{mb:1,textTransform:"none"},children:(0,tS.__)("What's the issue and why it matters?","pojo-accessibility")}),(0,Nt.jsx)(Jw,{variant:"body2",children:MH[e.rule].whyItMatters})]}),children:(0,Nt.jsx)(AA,{fontSize:"small",color:"action"})})]}),(0,Nt.jsx)(Jw,{variant:"body2",children:MH[e.rule]?.whatsTheIssue})]}),(0,Nt.jsxs)(vo,{children:[(0,Nt.jsxs)(YB,{children:[(0,Nt.jsx)(Jw,{variant:"subtitle2",children:(0,tS.__)("Affected element:","pojo-accessibility")}),(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:t?(0,tS.__)("Copied!","pojo-accessibility"):(0,tS.__)("Copy","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"tiny",onClick:r(n.find,"error_snippet","remediation"),children:(0,Nt.jsx)(Y$,{fontSize:"tiny"})})})]}),(0,Nt.jsx)(Fk,{color:"error",icon:!1,children:(0,Nt.jsx)(qB,{variant:"body2",children:n.find})})]}),(0,Nt.jsx)(tZ,{item:e})]})})};rZ.propTypes={item:QB};const nZ=()=>{const{openIndex:e,handleOpen:t,openedBlock:r,sortedRemediation:n,sortedGlobalRemediation:o,isManageGlobal:i,setOpenedBlock:a}=QS(),s=i?o:n;return(0,Vn.useEffect)(()=>{0===s[r]?.length&&a(mS.management)},[s[r]?.length]),(0,Nt.jsx)(vo,{sx:{pb:8},children:s[r].map((r,n)=>{var o;return(0,Nt.jsxs)(HB,{elevation:0,square:!0,disableGutters:!0,expanded:e===n,onChange:t(n,r),children:[(0,Nt.jsxs)(WB,{"aria-controls":`manual-panel-${n}`,id:`manual-panel-${n}`,children:[(0,Nt.jsx)(X$,{color:"info",checkedIcon:(0,Nt.jsx)(uO,{}),disabled:!0,checked:Number(r.active),role:"presentation"}),(0,Nt.jsxs)(vo,{display:"flex",gap:.5,alignItems:"center",children:[(0,Nt.jsx)(Jw,{variant:"body2",noWrap:!0,children:null!==(o=MH[r.rule]?.violationName)&&void 0!==o?o:r.rule}),"1"===r.global&&(0,Nt.jsx)(vR,{arrow:!0,placement:"top",title:(0,tS.__)("Cross-scan issue","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(tD,{color:"action",fontSize:"tiny"})})]})]}),(0,Nt.jsx)(rZ,{item:r})]},`${r.rule}-${n}`)})})};var oZ=e.forwardRef((t,r)=>e.createElement(ka,{viewBox:"0 0 24 24",...t,ref:r},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9461 4.49382C12.7055 3.50206 11.2945 3.50206 11.0539 4.49382L11.0538 4.49421C10.6578 6.12252 8.79686 6.89441 7.36336 6.02285L7.36299 6.02262C6.49035 5.49135 5.49253 6.49022 6.0235 7.3618C6.22619 7.69432 6.34752 8.06998 6.37762 8.45824C6.40773 8.84659 6.34572 9.23656 6.19663 9.59641C6.04755 9.95627 5.8156 10.2758 5.51966 10.5291C5.22378 10.7823 4.8723 10.9621 4.49382 11.0539C3.50206 11.2945 3.50206 12.7055 4.49382 12.9461L4.49422 12.9462C4.87244 13.0382 5.22363 13.2181 5.51923 13.4714C5.81483 13.7246 6.0465 14.0441 6.19542 14.4037C6.34433 14.7633 6.40629 15.153 6.37625 15.5411C6.34621 15.9292 6.22502 16.3047 6.02253 16.6371C5.49145 17.5098 6.49026 18.5074 7.3618 17.9765C7.69431 17.7738 8.06998 17.6525 8.45824 17.6224C8.84659 17.5923 9.23656 17.6543 9.59641 17.8034C9.95627 17.9525 10.2758 18.1844 10.5291 18.4803C10.7823 18.7762 10.9621 19.1277 11.0539 19.5062C11.2945 20.4979 12.7055 20.4979 12.9461 19.5062L12.9462 19.5058C13.0382 19.1276 13.2181 18.7764 13.4714 18.4808C13.7246 18.1852 14.0441 17.9535 14.4037 17.8046C14.7633 17.6557 15.153 17.5937 15.5411 17.6238C15.9292 17.6538 16.3047 17.775 16.6371 17.9775C17.5097 18.5085 18.5074 17.5097 17.9765 16.6382C17.7738 16.3057 17.6525 15.93 17.6224 15.5418C17.5923 15.1534 17.6543 14.7634 17.8034 14.4036C17.9525 14.0437 18.1844 13.7242 18.4803 13.4709C18.7762 13.2177 19.1277 13.0379 19.5062 12.9461C20.4979 12.7055 20.4979 11.2945 19.5062 11.0539L19.5058 11.0538C19.1276 10.9618 18.7764 10.7819 18.4808 10.5286C18.1852 10.2754 17.9535 9.95594 17.8046 9.59631C17.6557 9.23668 17.5937 8.84698 17.6238 8.45889C17.6538 8.07081 17.775 7.69528 17.9775 7.36285C18.5085 6.49025 17.5097 5.49256 16.6382 6.0235C16.3057 6.22619 15.93 6.34752 15.5418 6.37762C15.1534 6.40773 14.7634 6.34572 14.4036 6.19663C14.0437 6.04755 13.7242 5.8156 13.4709 5.51966C13.2177 5.22378 13.0379 4.8723 12.9461 4.49382ZM9.59624 4.13979C10.2079 1.61994 13.7925 1.62007 14.4039 4.14018L14.4039 4.14039C14.44 4.28943 14.5108 4.42783 14.6105 4.54434C14.7102 4.66085 14.836 4.75216 14.9777 4.81086C15.1194 4.86955 15.2729 4.89397 15.4258 4.88211C15.5787 4.87026 15.7266 4.82247 15.8576 4.74264L15.8578 4.7425C18.0722 3.39347 20.6074 5.92764 19.2586 8.14301L19.2585 8.14315C19.1788 8.27403 19.1311 8.42187 19.1193 8.57465C19.1075 8.72744 19.1318 8.88086 19.1905 9.02245C19.2491 9.16404 19.3403 9.28979 19.4567 9.38949C19.573 9.4891 19.7111 9.5599 19.8598 9.59614C22.3801 10.2075 22.3801 13.7925 19.8598 14.4039L19.8596 14.4039C19.7106 14.44 19.5722 14.5108 19.4557 14.6105C19.3392 14.7102 19.2478 14.836 19.1891 14.9777C19.1304 15.1194 19.106 15.2729 19.1179 15.4258C19.1297 15.5787 19.1775 15.7266 19.2574 15.8576L19.2575 15.8578C20.6065 18.0722 18.0724 20.6074 15.857 19.2586L15.8569 19.2585C15.726 19.1788 15.5781 19.1311 15.4253 19.1193C15.2726 19.1075 15.1191 19.1318 14.9776 19.1905C14.836 19.2491 14.7102 19.3403 14.6105 19.4567C14.5109 19.573 14.4401 19.7111 14.4039 19.8598C13.7925 22.3801 10.2075 22.3801 9.59614 19.8598L9.59609 19.8596C9.55998 19.7106 9.48919 19.5722 9.38948 19.4557C9.28977 19.3392 9.16396 19.2478 9.02228 19.1891C8.88061 19.1304 8.72708 19.106 8.57419 19.1179C8.4213 19.1297 8.27337 19.1775 8.14244 19.2574L8.1422 19.2575C5.92778 20.6065 3.39265 18.0724 4.74138 15.857L4.74147 15.8569C4.82118 15.726 4.86889 15.5781 4.88072 15.4253C4.89255 15.2726 4.86816 15.1191 4.80953 14.9776C4.7509 14.836 4.65969 14.7102 4.54332 14.6105C4.42705 14.5109 4.28893 14.4401 4.14018 14.4039C1.61994 13.7925 1.61994 10.2075 4.14018 9.59614L4.14039 9.59609C4.28943 9.55998 4.42783 9.48919 4.54434 9.38948C4.66085 9.28977 4.75216 9.16396 4.81086 9.02228C4.86955 8.88061 4.89397 8.72708 4.88211 8.57419C4.87026 8.4213 4.82247 8.27337 4.74264 8.14244L4.7425 8.1422C3.39354 5.92791 5.92736 3.39294 8.14263 4.74115C8.70903 5.08552 9.4399 4.7816 9.59614 4.14018M12 9.75C10.7574 9.75 9.75 10.7574 9.75 12C9.75 13.2426 10.7574 14.25 12 14.25C13.2426 14.25 14.25 13.2426 14.25 12C14.25 10.7574 13.2426 9.75 12 9.75ZM8.25 12C8.25 9.92893 9.92893 8.25 12 8.25C14.0711 8.25 15.75 9.92893 15.75 12C15.75 14.0711 14.0711 15.75 12 15.75C9.92893 15.75 8.25 14.0711 8.25 12Z"})));const iZ=({isActive:e,openEdit:t,global:r})=>(0,Nt.jsxs)(KB,{children:[(0,Nt.jsxs)(XB,{children:[(0,Nt.jsx)(oZ,{}),(0,Nt.jsx)(Jw,{variant:"subtitle2",children:e?(0,tS.__)("Active fix","pojo-accessibility"):(0,tS.__)("Fix (disabled)","pojo-accessibility")}),r&&(0,Nt.jsx)(lC,{icon:(0,Nt.jsx)(tD,{fontSize:"small"}),label:(0,tS.__)("Cross-scan","pojo-accessibility"),color:"default",variant:"outlined",size:"tiny"})]}),(0,Nt.jsx)(vo,{display:"flex",alignItems:"center",children:r?(0,Nt.jsx)(vR,{placement:"top",title:(0,tS.__)("You can't edit cross-scan fixes with Ally","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(bH,{fontSize:"small",color:"disabled"})}):(0,Nt.jsx)(vR,{placement:"top",title:(0,tS.__)("Edit","pojo-accessibility"),PopperProps:{disablePortal:!0},children:(0,Nt.jsx)(Ca,{size:"small",onClick:t,children:(0,Nt.jsx)(bH,{fontSize:"small"})})})})]});iZ.propTypes={isActive:IR().bool.isRequired,openEdit:IR().func.isRequired,global:IR().bool.isRequired};const aZ=({item:e,current:t,openEdit:r})=>{const n=JSON.parse(e?.content),o=GS(n?.xpath),i="1"===e.global,a=i?"1"===e.active_for_page:"1"===e.active;(0,Vn.useEffect)(()=>{o?US(o):ZS()},[t]);const s="role"===n.attribute_name&&"presentation"===n.attribute_value;return(0,Nt.jsxs)(Yk,{children:[(0,Nt.jsx)(yO,{}),(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(iZ,{isActive:a,openEdit:r,global:i}),(0,Nt.jsx)(eD,{element:o})]}),s?(0,Nt.jsx)(Dk,{color:a?"info":"secondary",disabled:!a,children:(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(KN,{children:(0,tS.__)("Decorative image","pojo-accessibility")}),(0,tS.__)("(decorative images don't require descriptions)","pojo-accessibility")]})}):(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(Jw,{variant:"body2",sx:{mb:1},children:(0,tS.__)("Alt text","pojo-accessibility")}),(0,Nt.jsx)(Dk,{color:a?"info":"secondary",icon:!1,disabled:!a,children:(0,Nt.jsx)(vo,{children:n.attribute_value})})]}),(0,Nt.jsx)(eZ,{item:e,isActive:a})]})};aZ.propTypes={item:QB,current:IR().number.isRequired,openEdit:IR().func.isRequired};const sZ=()=>{const{sortedRemediation:e,sortedGlobalRemediation:t,isManageGlobal:r,setOpenedBlock:n}=QS(),[o,i]=(0,Vn.useState)(0),[a,s]=(0,Vn.useState)(!1),l=r?t:e,c=l[mS.altText][o];if(!c)return l[mS.altText].length>0?i(0):n(mS.management),null;const u=e=>{e>l[mS.altText].length-1?i(0):i(e)},d=JSON.parse(c?.content||""),p=GS(d?.xpath);return(0,Nt.jsxs)(Lk,{children:[a?(0,Nt.jsx)(s$,{item:{id:c.id,node:p,data:d,path:{dom:d?.xpath},global:"1"===c.global},current:o,setCurrent:u,setIsEdit:s}):(0,Nt.jsx)(aZ,{item:c,current:o,openEdit:()=>{s(!0)}}),(0,Nt.jsx)(M$,{total:l.altText.length,current:o,setCurrent:u})]})},lZ=({title:e,color:t,isActive:r})=>{const n=Mq(t);return(0,Nt.jsxs)(vo,{display:"flex",gap:2,alignItems:"center",sx:{p:.5},children:[(0,Nt.jsx)(Jw,{variant:"body2",sx:{flexGrow:1},children:e}),(0,Nt.jsxs)(cZ,{display:"flex",gap:1,isActive:r,children:[(0,Nt.jsx)(r_,{}),(0,Nt.jsx)(vo,{sx:{width:"25px"},children:n.l}),(0,Nt.jsx)(vo,{children:"%"})]}),(0,Nt.jsx)(Cq,{value:t,size:"tiny"})]})},cZ=Ma(vo)`
color: ${({isActive:e,theme:t})=>e?t.palette.text.primary:t.palette.text.disabled};
& svg * {
stroke: ${({isActive:e,theme:t})=>e?t.palette.text.primary:t.palette.text.disabled}!important;
}
`;lZ.propTypes={title:IR().string.isRequired,color:IR().string.isRequired,isActive:IR().bool.isRequired};const uZ=({item:e,node:t,color:r,background:n,current:o,openEdit:i})=>{(0,Vn.useEffect)(()=>{t?US(t):ZS()},[o]),(0,Vn.useEffect)(()=>{n?.item&&US(n?.item,sS)},[n?.item]);const a="1"===e.global,s=a?"1"===e.active_for_page:"1"===e.active;return(0,Nt.jsxs)(Yk,{children:[(0,Nt.jsx)(yO,{}),(0,Nt.jsxs)(vo,{children:[(0,Nt.jsx)(iZ,{isActive:s,openEdit:i,global:a}),(0,Nt.jsx)(Qk,{color:s?"info":"secondary",icon:!1,children:(0,Nt.jsxs)(vo,{children:[r&&(0,Nt.jsx)(lZ,{title:(0,tS.__)("Text","pojo-accessibility"),color:r.value,isActive:s}),r&&n&&(0,Nt.jsx)(yO,{sx:{my:1}}),n&&(0,Nt.jsx)(lZ,{title:(0,tS.__)("Background","pojo-accessibility"),color:n.value,isActive:s})]})})]}),(0,Nt.jsx)(eZ,{item:e,isActive:s})]})};uZ.propTypes={item:QB,node:IR().node.isRequired,color:IR().shape({item:IR().node,value:IR().string}),current:IR().number.isRequired,openEdit:IR().func.isRequired};const dZ=()=>{const{sortedRemediation:e,sortedGlobalRemediation:t,isManageGlobal:r,setOpenedBlock:n}=QS(),[o,i]=(0,Vn.useState)(0),[a,s]=(0,Vn.useState)(!1),l=r?t:e,c=l[mS.colorContrast][o];if(!c)return l[mS.colorContrast].length>0?i(0):n(mS.management),null;const u=c?.content?JSON.parse(c.content):null,d=u?.xpath?GS(u.xpath):null,p=u?.rule?(e=>{const t={color:null,background:null},r=e.matchAll(/([^{]+)\s*\{([^}]+)\}/g);for(const[,e,n]of r){let r;try{r=document.querySelector(e.trim())}catch{continue}const o=n.match(/(?{e>l[mS.colorContrast].length-1?i(0):i(e)},f=d?Gq(d):null;return(0,Nt.jsxs)(Lk,{children:[a?(0,Nt.jsx)(Kq,{item:{id:c.id,node:d,data:u,messageArgs:[f?.ratio,"","",p.color?.value,p.background?.value],path:{dom:u?.xpath},isEdit:a,isPotential:f?.isPotential,parentNode:p.background?.item,global:"1"===c.global},current:o,setCurrent:h,setIsEdit:s}):(0,Nt.jsx)(uZ,{item:c,node:d,color:p.color,background:p.background,current:o,openEdit:()=>{s(!0)}}),(0,Nt.jsx)(M$,{total:l[mS.colorContrast].length,current:o,setCurrent:h})]})},pZ=()=>{const{notificationMessage:e,notificationType:t}=Un(),{setOpenedBlock:r,violation:n,resolved:o,openedBlock:i,isError:a,isManage:s,quotaExceeded:l,loading:c}=QS(),{tabsProps:u,getTabProps:d,getTabPanelProps:p}=NN(),h=(0,Vn.useRef)(null),f=Boolean(!s&&(o>0&&n===o||0===n));(0,Vn.useEffect)(()=>{window.ea11yScannerData?.planData?.user?.id&&null!==n&&(async()=>{const{ea11ySettingsData:e,ea11yScannerData:t}=window,r=e?.planData||t?.planData,n=e?.planScope||t?.planScope,o=r?.plan;if(!r?.scopes?.includes(Hw)&&!n?.includes(Hw))return;const i=e?.pluginEnv||t?.pluginEnv,a=e?.pluginVersion||t?.pluginVersion;await $w.init("150605b3b9f979922f2ac5a52e2dcfe9",{debug:"dev"===i,track_pageview:!1,persistence:"localStorage"}),$w.register({productName:"app_access",appType:"Apps",version:a,environment:i,is_trial:Boolean(o?.name?.toLowerCase().includes("free")),plan_type:o?.name,subscription_id:o?.subscription_id}),$w.identify(r?.user?.id);const s={$email:r?.user?.email,$user_id:r?.user?.id,$subscription_type:o?.name,$subscription_id:o?.subscription_id,$subscription_status:o?.status,$scanned_urls:`${r?.scannedPages?.used||0}/${r?.scannedPages?.allowed||0}`};$w.people?.set_once(s)})()},[window.ea11yScannerData?.planData?.user?.id,n]),(0,Vn.useEffect)(()=>{f&&(ZS(),r(mS.main))},[f]),(0,Vn.useEffect)(()=>{fS&&!l||Ww(Vw.upgradeSuggestionViewed,{current_plan:window.ea11yScannerData?.planData?.plan?.name,action_trigger:"scan_triggered",feature_locked:"multi-page scan"})},[fS,l]);const m=()=>window.ea11yScannerData?.isConnected?!fS||l?(0,Nt.jsx)(ON,{}):a?(0,Nt.jsx)(rS,{}):c?(0,Nt.jsx)(IN,{}):null:(0,Nt.jsx)(MN,{});return(0,Nt.jsx)(Mi.FocusTrap,{containerElements:[h.current],focusTrapOptions:{initialFocus:!1,allowOutsideClick:!0},children:(0,Nt.jsx)(Rk,{elevation:6,ref:h,children:(0,Nt.jsxs)(wo,{fallback:(0,Nt.jsx)(rS,{}),children:[(0,Nt.jsx)(RN,{}),(0,Nt.jsx)(vo,{sx:{borderBottom:1,borderColor:"divider"},children:(0,Nt.jsxs)(Ik,{...u,"aria-label":(0,tS.__)("Accessibility Assistant Tabs","pojo-accessibility"),variant:"fullWidth",children:[(0,Nt.jsx)(Ii,{label:(0,tS.__)("Issues found","pojo-accessibility"),...d(mS.main)}),(0,Nt.jsx)(Ii,{label:(0,tS.__)("Manage fixes","pojo-accessibility"),...d(mS.management)})]})}),(0,Nt.jsx)(iN,{}),(0,Nt.jsx)(Mk,{...p(mS.main),children:m()||(()=>{if(f)return(0,Nt.jsx)(FN,{});switch(i){case mS.main:return(0,Nt.jsx)($N,{});case mS.altText:return(0,Nt.jsx)(P$,{});case mS.colorContrast:return(0,Nt.jsx)(Xq,{});case mS.headingStructure:return(0,Nt.jsx)(mU,{});default:return(0,Nt.jsx)(OH,{})}})()}),(0,Nt.jsx)(Mk,{...p(mS.management),children:m()||(()=>{switch(i){case mS.management:return(0,Nt.jsx)(qU,{});case mS.altText:return(0,Nt.jsx)(sZ,{});case mS.colorContrast:return(0,Nt.jsx)(dZ,{});case mS.headingStructure:return(0,Nt.jsx)(mU,{});default:return(0,Nt.jsx)(nZ,{})}})()}),(0,Nt.jsx)(Ws,{message:e,type:t})]})})})};window.addEventListener("load",()=>{const e=new URLSearchParams(window.location.search);"1"!==e.get("open-ea11y-assistant")&&"1"!==e.get(nS)||setTimeout(()=>{hZ()},500)}),document.addEventListener("DOMContentLoaded",function(){document.querySelector("#wp-admin-bar-ea11y-clear-cache > a")?.addEventListener("click",async e=>{e.stopPropagation(),e.preventDefault();try{await oo.clearCache(),window.location.reload()}catch(e){console.error(e)}}),document.querySelectorAll("#wp-admin-bar-ea11y-scanner-wizard > a, #wp-admin-bar-ea11y-scan-page > a")?.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault();const t=document.getElementById(oS),r=new URL(window.location.href);r.searchParams.delete("open-ea11y-assistant-src"),r.searchParams.append("open-ea11y-assistant-src","top_bar"),history.replaceState(null,"",r),t?SN(t):hZ()})})});const hZ=()=>{const e=document.querySelector("#wpadminbar");window.ea11yScannerData={...window.ea11yScannerData,adminBar:e},e.remove();const t=document.createElement("aside");t.id=oS,t.setAttribute("aria-label",(0,tS.__)("Accessibility Assistant","pojo-accessibility")),cS&&t.setAttribute("dir","rtl"),document.body.style[cS?"marginLeft":"marginRight"]="425px",document.body.appendChild(t);const r=t.attachShadow({mode:"open"}),n=document.createElement("div");r.appendChild(n);const o=window?.ea11ySettingsData?.isDevelopment,i=Boolean(o)?Vn.StrictMode:Vn.Fragment,a=(0,$n.A)({key:"css",prepend:!0,container:r,stylisPlugins:cS?[Wn,Q]:[]}),s=Ot({direction:cS?"rtl":"ltr"});(0,Vn.createRoot)(n).render((0,Nt.jsx)(i,{children:(0,Nt.jsx)(Dt.C,{value:a,children:(0,Nt.jsx)(ke,{rtl:cS,children:(0,Nt.jsx)(Bn,{colorScheme:"light",theme:s,children:(0,Nt.jsx)(Zn,{children:(0,Nt.jsx)(YS,{children:(0,Nt.jsx)(zN,{children:(0,Nt.jsx)(iO,{children:(0,Nt.jsx)(pZ,{})})})})})})})})}))}})()})();