@gamecrafters/base-ui 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.d.ts +1 -0
- package/build/components/strong/Strong.d.ts +9 -0
- package/build/components/strong/Strong.types.d.ts +7 -0
- package/build/components/strong/index.d.ts +2 -0
- package/build/main.cjs.js +1 -1
- package/build/main.esm.js +1 -1
- package/build/styles/main.css +1 -1
- package/package.json +1 -1
package/build/main.cjs.js
CHANGED
|
@@ -817,4 +817,4 @@ ${this.fragmentDiscardExpression_?` if (${this.fragmentDiscardExpression_}) { d
|
|
|
817
817
|
gl_FragColor = color;
|
|
818
818
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
819
819
|
gl_FragColor *= ${DV.TRANSITION_ALPHA};
|
|
820
|
-
}`,uniforms:o,paletteTextures:i.paletteTextures}}var hU=class extends kz{constructor(e){e=e?Object.assign({},e):{};let t=e.style||{};delete e.style,super(e),this.sources_=e.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=t,this.styleVariables_=this.style_.variables||{},this.styleBandCount_=NaN,this.styleNodataBandIndex_=void 0,this.handleSourceUpdate_(),this.addChangeListener(jL.SOURCE,this.handleSourceUpdate_)}getSources(e,t){let n=this.getSource();return this.sources_?typeof this.sources_==`function`?this.sources_(e,t):this.sources_:n?[n]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){let e=this.getRenderSource();return e?e.getState():`undefined`}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache();let e=this.getSource();if(e){if(e.getState()===`loading`){let t=()=>{e.getState()===`ready`&&(e.removeEventListener(`change`,t),this.setStyle(this.style_))};e.addEventListener(`change`,t)}else this.setStyle(this.style_)}}getFirstSource_(){let e=2**53-1,t=this.getSources([-e,-e,e,e],e);return t&&t.length?t[0]:null}usesCoverageBand_(e,t){if(!e||!t||e.hasAlpha!==!1)return!1;let n=e.getProjection();return!!n&&!Vk(n,t)}getSourceBandCount_(e){let t=this.getFirstSource_(),n=t&&`bandCount`in t?t.bandCount:4;return this.usesCoverageBand_(t,e)?n+1:n}getSourceNodataBandIndex_(e){let t=this.getFirstSource_();if(t)return this.usesCoverageBand_(t,e)?t.bandCount+1:`nodataBandIndex`in t?t.nodataBandIndex:void 0}parseStyleForRender_(e){let t=this.getSourceBandCount_(e),n=this.getSourceNodataBandIndex_(e);return this.styleBandCount_=t,this.styleNodataBandIndex_=n,mU(this.style_,t,n)}applyShaders_(e){let t=this.parseStyleForRender_(e);this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures})}createRenderer(){let e=this.getMapInternal()?.getView()?.getProjection(),t=this.parseStyleForRender_(e);return new AV(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.getCacheSize(),paletteTextures:t.paletteTextures})}renderSources(e,t){let n=this.getRenderer(),r;for(let i=0,a=t.length;i<a;++i)this.renderedSource_=t[i],n.prepareFrame(e)&&(r=n.renderFrame(e));return r}render(e,t){this.rendered=!0;let n=e.viewState;if(this.hasRenderer()){let e=n.projection;(this.getSourceBandCount_(e)!==this.styleBandCount_||this.getSourceNodataBandIndex_(e)!==this.styleNodataBandIndex_)&&this.applyShaders_(e)}let r=this.getSources(e.extent,n.resolution),i=!0;for(let e=0,t=r.length;e<t;++e){let t=r[e],n=t.getState();if(n==`loading`){let e=()=>{t.getState()==`ready`&&(t.removeEventListener(`change`,e),this.changed())};t.addEventListener(`change`,e)}i&&=n==`ready`}let a=this.renderSources(e,r);if(this.getRenderer().renderComplete&&i)return this.renderedResolution_=n.resolution,a;if(this.renderedResolution_>.5*n.resolution){let t=this.getSources(e.extent,this.renderedResolution_).filter(e=>!r.includes(e));if(t.length>0)return this.renderSources(e,t)}return a}setStyle(e){if(this.styleVariables_=e.variables||{},this.style_=e,this.hasRenderer()){let e=this.getMapInternal()?.getView()?.getProjection();this.applyShaders_(e),this.changed()}}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}};hU.prototype.dispose;function gU({name:e,...t}){return DB(()=>new hU(t),e),null}gU.displayName=`MapWebGLTileLayer`;const _U=e=>{let t=sB(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addControl(r),()=>{t.removeControl(r)}},[t,r]),r},vU=(e,t,n)=>{let r=l.useRef(null);if(!r.current){let t=document.createElement(`div`);t.setAttribute(`data-component`,e),r.current=t}let i=r.current;return _U(()=>new QL({element:i,target:n})),l.useEffect(()=>{i.className=G(`ol-unselectable ol-control`,t)},[i,t]),i};function yU(e){return _U(()=>new $L(e)),null}yU.displayName=`MapAttributionControl`;const bU=[`fullscreenchange`,`webkitfullscreenchange`],xU={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var SU=class extends QL{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target}),this.on,this.once,this.un,this.keys_=e.keys!==void 0&&e.keys,this.source_=e.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=e.className===void 0?`ol-full-screen`:e.className,this.documentListeners_=[],this.activeClassName_=e.activeClassName===void 0?[this.cssClassName_+`-true`]:e.activeClassName.split(` `),this.inactiveClassName_=e.inactiveClassName===void 0?[this.cssClassName_+`-false`]:e.inactiveClassName.split(` `);let t=e.label===void 0?`⤢`:e.label;this.labelNode_=typeof t==`string`?document.createTextNode(t):t;let n=e.labelActive===void 0?`×`:e.labelActive;this.labelActiveNode_=typeof n==`string`?document.createTextNode(n):n;let r=e.tipLabel?e.tipLabel:`Toggle full-screen`;this.button_=document.createElement(`button`),this.button_.title=r,this.button_.setAttribute(`type`,`button`),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(IE.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ol-unselectable ol-control`,this.element.appendChild(this.button_)}handleClick_(e){e.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){let e=this.getMap();if(!e)return;let t=e.getOwnerDocument();if(CU(t)){if(wU(t))DU(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?EU(n):TU(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=wU(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Kj(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(xU.ENTERFULLSCREEN)):(Kj(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(xU.LEAVEFULLSCREEN)),e.updateSize())}setClassName_(e,t){t?(e.classList.remove(...this.inactiveClassName_),e.classList.add(...this.activeClassName_)):(e.classList.remove(...this.activeClassName_),e.classList.add(...this.inactiveClassName_))}setMap(e){let t=this.getMap();t&&t.removeChangeListener(JL.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(JL.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)FE(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();CU(n)?this.element.classList.remove(WM):this.element.classList.add(WM);for(let t=0,r=bU.length;t<r;++t)e.push(NE(n,bU[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function CU(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function wU(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function TU(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function EU(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():TU(e)}function DU(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function OU(e){return _U(()=>new SU(e)),null}OU.displayName=`MapFullScreenControl`;const kU=`units`,AU=[1,2,5],jU=25.4/.28;var MU=class extends QL{constructor(e){e||={};let t=document.createElement(`div`);t.style.pointerEvents=`none`,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;let n=e.className===void 0?e.bar?`ol-scale-bar`:`ol-scale-line`:e.className;this.innerElement_=document.createElement(`div`),this.innerElement_.className=n+`-inner`,this.element.className=n+` ol-unselectable`,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth===void 0?64:e.minWidth,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_=``,this.addChangeListener(kU,this.handleUnitsChanged_),this.setUnits(e.units||`metric`),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(kU)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(kU,e)}setDpi(e){this.dpi_=e}updateElement_(){let e=this.viewState_;if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=e.center,n=e.projection,r=this.getUnits(),i=r==`degrees`?`degrees`:`m`,a=Pk(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||jU)/jU,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||jU)/jU,c=o*a,l=``;if(r==`degrees`){let e=FO.degrees;c*=e,c<e/60?(l=`″`,a*=3600):c<e?(l=`′`,a*=60):l=`°`}else if(r==`imperial`)c<.9144?(l=`in`,a/=.0254):c<1609.344?(l=`ft`,a/=.3048):(l=`mi`,a/=1609.344);else if(r==`nautical`)a/=1852,l=`NM`;else if(r==`metric`)c<1e-6?(l=`nm`,a*=1e9):c<.001?(l=`μm`,a*=1e6):c<1?(l=`mm`,a*=1e3):c<1e3?l=`m`:(l=`km`,a/=1e3);else if(r==`us`)c<.9144?(l=`in`,a*=39.37):c<1609.344?(l=`ft`,a/=.30480061):(l=`mi`,a/=1609.3472);else throw Error(`Invalid units`);let u=3*Math.floor(Math.log(o*a)/Math.log(10)),d,f,p,m=0,h,g;for(;;){p=Math.floor(u/3);let e=10**p;if(d=AU[(u%3+3)%3]*e,f=Math.round(d/a),isNaN(f)){this.element.style.display=`none`,this.renderedVisible_=!1;return}if(s!==void 0&&f>=s){d=m,f=h,p=g;break}if(f>=o)break;m=d,h=f,g=p,++u}let _=this.scaleBar_?this.createScaleBar(f,d,l):d.toFixed(p<0?-p:0)+` `+l;this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+`px`,this.renderedWidth_=f),this.renderedVisible_||=(this.element.style.display=``,!0)}createScaleBar(e,t,n){let r=this.getScaleForResolution(),i=r<1?Math.round(1/r).toLocaleString()+` : 1`:`1 : `+Math.round(r).toLocaleString(),a=this.scaleBarSteps_,o=e/a,s=[this.createMarker(`absolute`)];for(let r=0;r<a;++r){let i=r%2==0?`ol-scale-singlebar-odd`:`ol-scale-singlebar-even`;s.push(`<div><div class="ol-scale-singlebar ${i}" style="width: ${o}px;"></div>`+this.createMarker(`relative`)+(r%2==0||a===2?this.createStepText(r,e,!1,t,n):``)+`</div>`)}return s.push(this.createStepText(a,e,!0,t,n)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+i+`</div>`:``)+s.join(``)}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e===`absolute`?3:-10}px;"></div>`}createStepText(e,t,n,r,i){let a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?``:` `+i),o=e===0?-3:t/this.scaleBarSteps_*-1,s=e===0?0:t/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${o}px;text-align: ${e===0?`left`:`center`};min-width: ${s}px;left: ${n?t+`px`:`unset`};">`+a+`</div>`}getScaleForResolution(){let e=Pk(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||jU;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function NU(e){return _U(()=>new MU(e)),null}NU.displayName=`MapScaleLineControl`;const PU=`projection`,FU=`coordinateFormat`;var IU=class extends QL{constructor(e){e||={};let t=document.createElement(`div`);t.className=e.className===void 0?`ol-mouse-position`:e.className,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un,this.addChangeListener(PU,this.handleProjectionChanged_),e.coordinateFormat&&this.setCoordinateFormat(e.coordinateFormat),e.projection&&this.setProjection(e.projection),this.renderOnMouseOut_=e.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?e.placeholder:` `,this.renderedHTML_=t.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=e.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(FU)}getProjection(){return this.get(PU)}handleMouseMove(e){let t=this.getMap();this.updateHTML_(t.getEventPixel(e))}handleMouseOut(e){this.updateHTML_(null)}setMap(e){if(super.setMap(e),e){let t=e.getViewport();this.listenerKeys.push(NE(t,GL.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(NE(t,GL.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(FU,e)}setProjection(e){this.set(PU,Nk(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?Hk(this.mapProjection_,e):Ak}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=Kk();e&&(this.transform_=Hk(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&MO(n,e||this.getProjection()||this.mapProjection_);let r=this.getCoordinateFormat();t=r?r(n):n.toString()}}(!this.renderedHTML_||t!==this.renderedHTML_)&&(this.element.innerHTML=t,this.renderedHTML_=t)}render(e){let t=e.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}};function LU(e){return _U(()=>new IU(e)),null}LU.displayName=`MapMousePositionControl`;const RU=.75,zU=.1;var BU=class extends QL{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed===void 0||e.collapsed,this.collapsible_=e.collapsible===void 0||e.collapsible,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0&&e.rotateWithView,this.viewExtent_=void 0;let t=e.className===void 0?`ol-overviewmap`:e.className,n=e.tipLabel===void 0?`Overview map`:e.tipLabel,r=e.collapseLabel===void 0?`‹`:e.collapseLabel;typeof r==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=r):this.collapseLabel_=r;let i=e.label===void 0?`›`:e.label;typeof i==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=i):this.label_=i;let a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,o=document.createElement(`button`);o.setAttribute(`type`,`button`),o.title=n,o.appendChild(a),o.addEventListener(IE.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new JR({view:e.view,controls:new sD,interactions:new sD});this.ovmap_=s,e.layers&&e.layers.forEach(function(e){s.addLayer(e)});let c=document.createElement(`div`);c.className=`ol-overviewmap-box`,c.style.boxSizing=`border-box`,this.boxOverlay_=new ZR({position:[0,0],positioning:`center-center`,element:c}),this.ovmap_.addOverlay(this.boxOverlay_);let l=t+` ol-unselectable ol-control`+(this.collapsed_&&this.collapsible_?` ol-collapsed`:``)+(this.collapsible_?``:` ol-uncollapsible`),u=this.element;u.className=l,u.appendChild(this.ovmapDiv_),u.appendChild(o);let d=this.boxOverlay_,f=this.boxOverlay_.getElement(),p=e=>({clientX:e.clientX,clientY:e.clientY}),m=function(e){let t=p(e),n=s.getEventCoordinate(t);d.setPosition(n)},h=e=>{let t=s.getEventCoordinateInternal(e),n=this.getMap();n.getView().setCenterInternal(t);let r=n.getOwnerDocument();r.removeEventListener(`pointermove`,m),r.removeEventListener(`pointerup`,h)};this.ovmapDiv_.addEventListener(`pointerdown`,e=>{let t=this.getMap().getOwnerDocument();e.target===f&&t.addEventListener(`pointermove`,m),t.addEventListener(`pointerup`,h)})}setMap(e){let t=this.getMap();if(e!==t){if(t){let e=t.getView();e&&this.unbindView_(e),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(NE(e,AE.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===JL.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===JL.TARGET||e.key===JL.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new wL({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(fL.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(fL.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView().calculateExtentInternal(n);if(this.viewExtent_&&ED(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(UD(r)),s=t.getPixelFromCoordinateInternal(FD(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*zU||l<d*zU||c>u*RU||l>d*RU?this.resetExtent_():vD(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();YD(r,1/(2**(Math.log(RU/zU)/Math.LN2/2)*zU)),i.fitInternal(bj(r))}recenter_(){let e=this.getMap(),t=this.ovmap_,n=e.getView();t.getView().setCenterInternal(n.getCenterInternal())}updateBox_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView(),i=t.getView(),a=this.rotateWithView_?0:-r.getRotation(),o=this.boxOverlay_,s=this.boxOverlay_.getElement(),c=r.getCenter(),l=r.getResolution(),u=i.getResolution(),d=n[0]*l/u,f=n[1]*l/u;if(o.setPosition(c),s){s.style.width=d+`px`,s.style.height=f+`px`;let e=`rotate(`+a+`rad)`;s.style.transform=e}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||=PE(this.ovmap_,qL.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(GM),this.collapsed_?Kj(this.collapseLabel_,this.label_):Kj(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;let e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle(`ol-uncollapsible`),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};function VU(e){return _U(()=>new BU(e)),null}VU.displayName=`MapOverviewMapControl`;var HU=class e extends wA{constructor(e,t,n){super(),n!==void 0&&t===void 0?this.setFlatCoordinates(n,e):(t||=0,this.setCenterAndRadius(e,t,n))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=e-i[0],o=t-i[1],s=a*a+o*o;if(s<r){if(s===0)for(let e=0;e<this.stride;++e)n[e]=i[e];else{let e=this.getRadius()/Math.sqrt(s);n[0]=i[0]+e*a,n[1]=i[1]+e*o;for(let e=2;e<this.stride;++e)n[e]=i[e]}return n.length=this.stride,s}return r}containsXY(e,t){let n=this.flatCoordinates,r=e-n[0],i=t-n[1];return r*r+i*i<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,n=t[this.stride]-t[0];return SD(t[0]-n,t[1]-n,t[0]+n,t[1]+n,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return`Circle`}intersectsExtent(e){if(KD(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||MD(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(let n=1;n<t;++n)r[t+n]=e[n];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,n){this.setLayout(n,e,0),this.flatCoordinates||=[];let r=this.flatCoordinates,i=RA(r,0,e,this.stride);r[i++]=r[0]+t;for(let e=1,t=this.stride;e<t;++e)r[i++]=r[e];r.length=i,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let n=this.getCenter(),r=this.getStride();this.setCenter(vA(n,0,n.length,r,e,t,n)),this.changed()}};HU.prototype.transform;var UU=class e extends CA{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(FE),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(NE(e[t],IE.CHANGE,this.changed,this))}clone(){let t=new e(WU(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<gD(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){CD(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)OD(e,t[n].getExtent());return e}getGeometries(){return WU(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=ID(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(WU(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function WU(e){return e.map(e=>e.clone())}function GU(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function KU(e,t){let n=e.length,r=Math.floor(t),i=t-r;r>=n?r-=n:r<0&&(r+=n);let a=r+1;a>=n&&(a-=n);let o=e[r],s=o[0],c=o[1],l=e[a],u=l[0]-s,d=l[1]-c;return[s+u*i,c+d*i]}const qU={index:-1,endIndex:NaN,closestTargetDistance:1/0};function JU(e,t,n,r){let i=e[0],a=e[1],o=1/0,s=-1,c=NaN;for(let e=0;e<t.targets.length;++e){let n=t.targets[e],r=n.coordinates,l=1/0,u;for(let e=0;e<r.length-1;++e){let t=r[e],n=r[e+1],o=tW(i,a,t,n);o.squaredDistance<l&&(l=o.squaredDistance,u=e+o.along)}l<o&&(o=l,n.ring&&t.targetIndex===e&&(n.endIndex>n.startIndex?u<n.startIndex&&(u+=r.length):n.endIndex<n.startIndex&&u>n.startIndex&&(u-=r.length)),c=u,s=e)}let l=t.targets[s],u=l.ring;if(t.targetIndex===s&&u){let e=KU(l.coordinates,c);AO(n.getPixelFromCoordinate(e),n.getPixelFromCoordinate(t.startCoord))>r&&(u=!1)}if(u){let e=l.coordinates,t=e.length,n=l.startIndex,r=c;if(n<r){let i=$U(e,n,r);$U(e,n,r-t)<i&&(c-=t)}else{let i=$U(e,n,r);$U(e,n,r+t)<i&&(c+=t)}}return qU.index=s,qU.endIndex=c,qU.closestTargetDistance=o,qU}function YU(e,t){let n=[];for(let r=0;r<t.length;++r)XU(e,t[r].getGeometry(),n);return n}function XU(e,t,n){if(t instanceof iM){ZU(e,t.getCoordinates(),!1,n);return}if(t instanceof RN){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)ZU(e,r[t],!1,n);return}if(t instanceof yj){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)ZU(e,r[t],!0,n);return}if(t instanceof VN){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t){let i=r[t];for(let t=0,r=i.length;t<r;++t)ZU(e,i[t],!0,n)}return}if(t instanceof UU){let r=t.getGeometries();for(let t=0;t<r.length;++t)XU(e,r[t],n);return}}function ZU(e,t,n,r){let i=e[0],a=e[1];for(let e=0,o=t.length-1;e<o;++e){let o=t[e],s=t[e+1],c=tW(i,a,o,s);if(c.squaredDistance===0){let i=e+c.along;r.push({coordinates:t,ring:n,startIndex:i,endIndex:i});return}}}function QU(e,t){return rO(e[0],e[1],t[0],t[1])}function $U(e,t,n){let r,i;t<n?(r=t,i=n):(r=n,i=t);let a=Math.ceil(r),o=Math.floor(i);if(a>o)return QU(KU(e,r),KU(e,i));let s=0;if(r<a){let t=KU(e,r),n=GU(e,a);s+=QU(t,n)}if(o<i){let t=GU(e,o),n=KU(e,i);s+=QU(t,n)}for(let t=a;t<o-1;++t){let n=GU(e,t),r=GU(e,t+1);s+=QU(n,r)}return s}const eW={along:0,squaredDistance:0};function tW(e,t,n,r){let i=n[0],a=n[1],o=r[0],s=r[1],c=o-i,l=s-a,u=0,d=i,f=a;return(c!==0||l!==0)&&(u=tO(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),eW.along=u,eW.squaredDistance=lO(rO(e,t,d,f),10),eW}const nW={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var rW=class extends ZE{constructor(e,t){super(e),this.feature=t}},iW=class extends CR{constructor(e){let t=e;t.stopDown||=qE,super(t),this.on,this.once,this.un,this.options_=e,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=oW(this.type_),this.stopClick_=!!e.stopClick,this.ignoreNextUpEvent_=!1,this.minPoints_=e.minPoints?e.minPoints:this.mode_===`Polygon`?3:2,this.maxPoints_=this.mode_===`Circle`?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:KE,this.geometryLayout_=e.geometryLayout?e.geometryLayout:`XY`;let n=e.geometryFunction;if(!n){let e=this.mode_;if(e===`Circle`)n=(e,t,n)=>{let r=t||new HU([NaN,NaN]),i=Jk(e[0],n),a=kO(i,Jk(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=Kk();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=lj:e===`LineString`?t=iM:e===`Polygon`&&(t=yj),n=(n,r,i)=>(r?e===`Polygon`?n[0].length?r.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):r.setCoordinates([],this.geometryLayout_):r.setCoordinates(n,this.geometryLayout_):r=new t(n,this.geometryLayout_),r)}}this.geometryFunction_=n,this.dragVertexDelay_=e.dragVertexDelay===void 0?500:e.dragVertexDelay,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new RL({source:new pP({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:aW(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:_R,this.freehandCondition_,this.freehandCondition_=e.freehand?pR:e.freehandCondition?e.freehandCondition:yR,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(rR.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?pR:e:hR,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?pR:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:yR}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===IE.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===WL.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===WL.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===WL.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===WL.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===WL.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===WL.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===WL.DBLCLICK&&(n=!1),super.handleEvent(e)&&n}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new UL(WL.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}let t=this.getMap(),n=fD([t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_])]),r=this.traceSource_.getFeaturesInExtent(n);if(r.length===0)return;let i=YU(e.coordinate,r);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(GU(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(GU(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&AO(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=JU(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex;let i=KU(r.coordinates,r.endIndex),a=this.getMap().getPixelFromCoordinate(i);e.coordinate=i,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&=(clearTimeout(this.downTimeout_),void 0),this.handlePointerMove_(e);let n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){let r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_===`Point`)&&(this.atFinish_(e.pixel,n)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){let t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],a=r*r+i*i;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let n=!1;if(this.sketchFeature_){let r=!1,i=[this.finishCoordinate_],a=this.mode_;if(a===`Point`)n=!0;else if(a===`Circle`)n=this.sketchCoords_.length===2;else if(a===`LineString`)r=!t&&this.sketchCoords_.length>this.minPoints_;else if(a===`Polygon`){let e=this.sketchCoords_;r=e[0].length>this.minPoints_,i=[e[0][0],e[0][e[0].length-2]],i=t?[e[0][0]]:[e[0][0],e[0][e[0].length-2]]}if(r){let t=this.getMap();for(let r=0,a=i.length;r<a;r++){let a=i[r],o=t.getPixelFromCoordinate(a),s=e[0]-o[0],c=e[1]-o[1],l=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(s*s+c*c)<=l,n){this.finishCoordinate_=a;break}}}}return n}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new lD(new lj(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new lD;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new iM(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=EA(this.geometryLayout_);for(;e.length<n;)e.push(0);this.finishCoordinate_=e,this.mode_===`Point`?this.sketchCoords_=e.slice():this.mode_===`Polygon`?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new lD(new iM(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new lD,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new rW(nW.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=EA(this.geometryLayout_),a,o;for(;e.length<i;)e.push(0);this.mode_===`Point`?o=this.sketchCoords_:this.mode_===`Polygon`?(a=this.sketchCoords_[0],o=a[a.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,o=a[a.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),n.getType()===`Polygon`&&this.mode_!==`Polygon`?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r,i,a=this.mode_;return a===`LineString`||a===`Circle`?(this.finishCoordinate_=e.slice(),i=this.sketchCoords_,i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),this.geometryFunction_(i,t,n)):a===`Polygon`&&(i=this.sketchCoords_[0],i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),r&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,t,n)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;for(let i=0;i<e;++i){let e;if(r===`LineString`||r===`Circle`){if(e=this.sketchCoords_,e.splice(-2,1),e.length>=2){this.finishCoordinate_=e[e.length-2].slice();let t=this.finishCoordinate_.slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}this.geometryFunction_(e,t,n),t.getType()===`Polygon`&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r===`Polygon`){e=this.sketchCoords_[0],e.splice(-2,1);let r=this.sketchLine_.getGeometry();if(e.length>=2){let t=e[e.length-2].slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}r.setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,n)}if(e.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_,n=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_===`LineString`?(t.pop(),this.geometryFunction_(t,n,r)):this.mode_===`Polygon`&&(t[0].pop(),this.geometryFunction_(t,n,r),t=n.getCoordinates()),this.type_===`MultiPoint`?e.setGeometry(new zN([t])):this.type_===`MultiLineString`?e.setGeometry(new RN([t])):this.type_===`MultiPolygon`&&e.setGeometry(new VN([t])),this.dispatchEvent(new rW(nW.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;let e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){let e=this.abortDrawing_();e&&this.dispatchEvent(new rW(nW.DRAWABORT,e))}appendCoordinates(e){let t=this.mode_,n=!this.sketchFeature_;n&&this.startDrawing_(e[0]);let r;if(t===`LineString`||t===`Circle`)r=this.sketchCoords_;else if(t===`Polygon`)r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;n&&r.shift(),r.pop();for(let t=0;t<e.length;t++)this.addToDrawing_(e[t]);let i=e[e.length-1];this.sketchFeature_=this.addToDrawing_(i),this.modifyDrawing_(i)}extend(e){let t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();let n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new lD(new lj(n)),this.updateSketchFeatures_(),this.dispatchEvent(new rW(nW.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){let e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);let t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){let e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}};function aW(){let e=EP();return function(t,n){return e[t.getGeometry().getType()]}}function oW(e){switch(e){case`Point`:case`MultiPoint`:return`Point`;case`LineString`:case`MultiLineString`:return`LineString`;case`Polygon`:case`MultiPolygon`:return`Polygon`;case`Circle`:return`Circle`;default:throw Error(`Invalid type: `+e)}}const sW=[0,0,0,0],cW=[],lW={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function uW(e,t,n){let r;switch(t){case`LineString`:r=e;break;case`MultiLineString`:case`Polygon`:r=e[n[0]];break;case`MultiPolygon`:r=e[n[1]][n[0]]}return r}var dW=class extends ZE{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},fW=class extends CR{constructor(e){if(super(e),this.handleSourceAdd_=this.handleSourceAdd_.bind(this),this.handleSourceRemove_=this.handleSourceRemove_.bind(this),this.handleExternalCollectionAdd_=this.handleExternalCollectionAdd_.bind(this),this.handleExternalCollectionRemove_=this.handleExternalCollectionRemove_.bind(this),this.handleFeatureChange_=this.handleFeatureChange_.bind(this),this.on,this.once,this.un,this.condition_=e.condition?e.condition:SR,this.defaultDeleteCondition_=function(e){return lR(e)&&gR(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:pR,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new cP,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new RL({source:new pP({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:gW(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=e.traceSource||e.source||null,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null,this.filterFunctionWasSupplied_=e.filter!=null,this.filter_=e.filter?e.filter:()=>!0,this.coordinatesEqual_=e.sharedVerticesEqual?e.sharedVerticesEqual:EO,!(e.features||e.source))throw Error(`The modify interaction requires features collection or a source`);let t;e.features?(t=e.features.getArray(),e.features.addEventListener(kE.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(kE.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(dP.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(dP.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_)}),e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=[],t.filter(this.filter_).forEach(e=>this.addFeature_(e)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;t=e?e===!0?pR:e:hR,this.traceCondition_=t}addFeature_(e){this.features_.push(e);let t=e.getGeometry();if(t){let n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}let n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new sD;let n=this.featuresBeingModified_.getArray();for(let e=0,r=t.length;e<r;++e){let r=t[e].feature;r&&!n.includes(r)&&this.featuresBeingModified_.push(r)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new dW(lW.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){let t=this.features_.indexOf(e);this.features_.splice(t,1),this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.length===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}removeFeatureSegmentData_(e){let t=this.rBush_,n=[];t.forEach(function(t){e===t.feature&&n.push(t)});for(let e=n.length-1;e>=0;--e){let r=n[e];for(let e=this.dragSegments_.length-1;e>=0;--e)this.dragSegments_[e][0]===r&&this.dragSegments_.splice(e,1);t.remove(r)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){let t=e.feature;t&&this.externalAddFeatureHandler_(t)}handleSourceRemove_(e){let t=e.feature;t&&this.externalRemoveFeatureHandler_(t)}handleExternalCollectionAdd_(e){let t=e.element;t&&this.externalAddFeatureHandler_(t)}handleExternalCollectionRemove_(e){let t=e.element;t&&this.externalRemoveFeatureHandler_(t)}externalAddFeatureHandler_(e){e.addEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_),this.removeFeature_(e)}handleFeatureChange_(e){if(!this.changingFeature_){let t=e.target;this.removeFeature_(t),this.filter_(t)&&this.addFeature_(t)}}writePointGeometry_(e,t){let n=t.getCoordinates(),r={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length-1;r<i;++r){let i=n.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:i};this.rBush_.insert(fD(i),a)}}writeMultiLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(fD(a),o)}}}writePolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(fD(a),o)}}}writeMultiPolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length;n<a;++n){let a=i[n];for(let i=0,o=a.length-1;i<o;++i){let o=a.slice(i,i+2),s={feature:e,geometry:t,depth:[n,r],index:i,segment:o};this.rBush_.insert(fD(o),s)}}}}writeCircleGeometry_(e,t){let n=t.getCenter(),r={feature:e,geometry:t,index:0,segment:[n,n]},i={feature:e,geometry:t,index:1,segment:[n,n]},a=[r,i];r.featureSegments=a,i.featureSegments=a,this.rBush_.insert(wD(n),r);let o=t,s=Kk();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=xj(o).transform(e,s)}this.rBush_.insert(o.getExtent(),i)}writeGeometryCollectionGeometry_(e,t){let n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=n[t],i=this.SEGMENT_WRITERS_[r.getType()];i(e,r)}}createOrUpdateVertexFeature_(e,t,n,r){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(e):(i=new lD(new lj(e)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set(`features`,t),i.set(`geometries`,n),i.set(`existing`,r),i}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==WL.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=WL.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==WL.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;let t=this.getMap().getView().getProjection(),n=[],r=this.vertexFeature_.getGeometry().getCoordinates(),i=fD([r]),a=this.rBush_.getInExtent(i),o={};a.sort(pW);for(let i=0,s=a.length;i<s;++i){let s=a[i],c=s.segment,l=X(s.geometry),u=s.depth;if(u&&(l+=`-`+u.join(`-`)),o[l]||(o[l]=[,,]),s.geometry.getType()===`Circle`&&s.index===1){let n=hW(e,s,t);this.coordinatesEqual_(n,r)&&!o[l][0]&&(this.dragSegments_.push([s,0]),o[l][0]=s);continue}if(this.coordinatesEqual_(c[0],r)&&!o[l][0]){this.dragSegments_.push([s,0]),o[l][0]=s;continue}if(this.coordinatesEqual_(c[1],r)&&!o[l][1]){if(o[l][0]&&o[l][0].index===0){let e=s.geometry.getCoordinates();switch(s.geometry.getType()){case`LineString`:case`MultiLineString`:continue;case`MultiPolygon`:e=e[u[1]];case`Polygon`:if(s.index!==e[u[0]].length-2)continue}}this.dragSegments_.push([s,1]),o[l][1]=s;continue}X(c)in this.vertexSegments_&&!o[l][0]&&!o[l][1]&&n.push(s)}return n}deactivateTrace_(){this.traceState_={active:!1}}tracePassesVertex_(e,t){if(e===t)return!1;if(e<t){let n=Math.ceil(e),r=Math.floor(t);return r===t&&--r,n<=r}let n=Math.floor(e),r=Math.ceil(t);return r===t&&(r+=1),n>=r}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&AO(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=JU(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;let r=!0;if(t.targetIndex===-1){let e=t.targets[n.index];r=this.tracePassesVertex_(e.startIndex,n.endIndex)}if(r){if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index,t.targets[t.targetIndex].endIndex=n.endIndex}let i=t.targets[n.index],a=KU(i.coordinates,n.endIndex);for(let e of this.dragSegments_)this.updateGeometry_(a.slice(),e);return a}getTraceCandidates_(e){let t=this.getMap(),n=this.pixelTolerance_,r=fD([t.getCoordinateFromPixel([e.pixel[0]-n,e.pixel[1]+n]),t.getCoordinateFromPixel([e.pixel[0]+n,e.pixel[1]-n])]);return this.traceSource_.getFeaturesInExtent(r)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}let t=this.getTraceCandidates_(e);if(t.length===0)return;let n=YU(e.coordinate,t);n.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}shiftTracedSegmentIndices_(e,t,n){for(let r of this.dragSegments_){let i=r[0];i!==e&&i.geometry===e.geometry&&(i.depth===void 0||e.depth===void 0||WE(i.depth,e.depth))&&i.index>=t&&(i.index+=n)}}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}if(n>0)for(let e of this.traceSegments_){let t=e[0],r=t.geometry,i=e[1],a=e[0].index+1;i===1&&(a-=n);let o=r.getCoordinates();uW(o,r.getType(),t.depth).splice(a,n),this.setGeometryCoordinates_(r,o),this.shiftTracedSegmentIndices_(t,a+n,-n),i===1&&(t.index-=n)}}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(GU(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(GU(e.coordinates,t))}if(r.length)for(let e of this.traceSegments_){let t=e[0],n=t.geometry,i=e[1],a=t.index+1;i===0&&r.reverse();let o=n.getCoordinates();uW(o,n.getType(),t.depth).splice(a,0,...r),this.setGeometryCoordinates_(n,o),this.shiftTracedSegmentIndices_(t,a,r.length),i===1&&(t.index+=r.length)}}updateGeometry_(e,t){let n=t[0],r=n.depth,i,a=n.segment,o=n.geometry,s=t[1],c=o.getStride();for(let t=2;t<c;++t)e[t]=a[s][t];switch(e.length=c,o.getType()){case`Point`:i=e,a[0]=e,a[1]=e;break;case`MultiPoint`:i=o.getCoordinates(),i[n.index]=e,a[0]=e,a[1]=e;break;case`LineString`:i=o.getCoordinates(),i[n.index+s]=e,a[s]=e;break;case`MultiLineString`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`Polygon`:{i=o.getCoordinates();let t=i[r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`MultiPolygon`:{i=o.getCoordinates();let t=i[r[1]][r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`Circle`:let t=o;if(a[0]=e,a[1]=e,n.index===0)this.changingFeature_=!0,t.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let n=this.getMap().getView().getProjection(),r=AO(Jk(t.getCenter(),n),Jk(e,n)),i=Kk();if(i){let e=t.clone().transform(i,n);e.setRadius(r),r=e.transform(n,i).getRadius()}t.setRadius(r),this.changingFeature_=!1}}i&&this.setGeometryCoordinates_(o,i)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],n=[],r=[],i=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(i){this.traceSegments_=[];for(let t of this.dragSegments_){let n=t[0];AO(wO(i,n.segment),i)/e.map.getView().getResolution()<1&&this.traceSegments_.push(t)}this.traceSegments_.length>1&&(this.deactivateTrace_(),this.traceSegments_=null)}for(let e=0,i=this.dragSegments_.length;e<i;++e){let i=this.dragSegments_[e],a=i[0],o=a.feature;n.includes(o)||n.push(o);let s=a.geometry;r.includes(s)||r.push(s),this.updateGeometry_(t,i)}let a=this.updateTrace_(e);this.createOrUpdateVertexFeature_(a||t,n,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;let t=e.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(t);if(n?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,n),this.vertexFeature_)){let e=this.vertexFeature_.getGeometry().getCoordinates();for(let t=n.length-1;t>=0;--t)this.insertVertex_(n[t],e);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){let t=this.traceState_.active?new Set:null;for(let n=this.dragSegments_.length-1;n>=0;--n){let r=this.dragSegments_[n][0];t&&t.add(r.feature);let i=r.geometry;if(i.getType()===`Circle`){let t=i,n=t.getCenter(),a=r.featureSegments[0],o=r.featureSegments[1];a.segment[0]=n,a.segment[1]=n,o.segment[0]=n,o.segment[1]=n,this.rBush_.update(wD(n),a);let s=t,c=Kk();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=xj(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(fD(r.segment),r)}if(t)for(let e of t)this.removeFeature_(e),this.filter_(e)&&this.addFeature_(e);return this.featuresBeingModified_&&=(this.toggleTraceState_(e),this.dispatchEvent(new dW(lW.MODIFYEND,this.featuresBeingModified_,e)),null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){let t=this.getMap(),n=t.getPixelFromCoordinate(e),r=t.getView().getProjection(),i=function(t,n){return mW(e,t,r)-mW(e,n,r)},a,o;if(this.hitDetection_){let e=typeof this.hitDetection_==`object`?e=>e===this.hitDetection_:void 0;t.forEachFeatureAtPixel(n,(e,t,n)=>{n&&n.getType()===`Point`&&(n=new lj(qk(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof lD&&this.features_.includes(e)){o=i;let t=e.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:e,geometry:o,segment:[t,t]}]}return!0},{layerFilter:e})}if(!a){let n=Yk(mD(Xk(wD(e,sW),r),t.getView().getResolution()*this.pixelTolerance_,sW),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=hW(e,s,r),u=t.getPixelFromCoordinate(l),d=AO(n,u);if(o||d<=this.pixelTolerance_){let n={};if(n[X(c)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-e[0],this.delta_[1]=l[1]-e[1]),s.geometry.getType()===`Circle`&&s.index===1)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);else{let e=t.getPixelFromCoordinate(c[0]),r=t.getPixelFromCoordinate(c[1]),i=kO(u,e),o=kO(u,r);if(d=Math.sqrt(Math.min(i,o)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null);return}this.snappedToVertex_&&(l=i>o?c[1]:c[0]),this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);let f={};f[X(s.geometry)]=!0;for(let e=1,t=a.length;e<t;++e){let t=a[e].segment;if(this.coordinatesEqual_(c[0],t[0])&&this.coordinatesEqual_(c[1],t[1])||this.coordinatesEqual_(c[0],t[1])&&this.coordinatesEqual_(c[1],t[0])){let r=X(a[e].geometry);r in f||(f[r]=!0,n[X(t)]=!0)}else break}}this.vertexSegments_=n;return}}this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null)}insertVertex_(e,t){let n=e.segment,r=e.feature,i=e.geometry,a=e.depth,o=e.index,s;for(;t.length<i.getStride();)t.push(0);switch(i.getType()){case`MultiLineString`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`Polygon`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`MultiPolygon`:s=i.getCoordinates(),s[a[1]][a[0]].splice(o+1,0,t);break;case`LineString`:s=i.getCoordinates(),s.splice(o+1,0,t);break;default:return!1}this.setGeometryCoordinates_(i,s);let c=this.rBush_;c.remove(e),this.updateSegmentIndices_(i,o,a,1);let l={segment:[n[0],t],feature:r,geometry:i,depth:a,index:o};c.insert(fD(l.segment),l),this.dragSegments_.push([l,1]);let u={segment:[t,n[1]],feature:r,geometry:i,depth:a,index:o+1};return c.insert(fD(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){let e=this.vertexFeature_?.getGeometry().getCoordinates();return e?qk(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(fD([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=Jk(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=WL.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new dW(lW.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){let e=this.dragSegments_,t={},n=!1,r,i,a,o,s,c,l,u,d,f,p;for(s=e.length-1;s>=0;--s)a=e[s],f=a[0],p=X(f.feature),f.depth&&(p+=`-`+f.depth.join(`-`)),p in t||(t[p]={}),a[1]===0?(t[p].right=f,t[p].index=f.index):a[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,l=t[p].left,c=t[p].index,u=c-1,f=l===void 0?d:l,u<0&&(u=0),o=f.geometry,i=o.getCoordinates(),r=i,n=!1,o.getType()){case`MultiLineString`:i[f.depth[0]].length>2&&(i[f.depth[0]].splice(c,1),n=!0);break;case`LineString`:i.length>2&&(i.splice(c,1),n=!0);break;case`MultiPolygon`:r=r[f.depth[1]];case`Polygon`:r=r[f.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),n=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1))}if(n){this.setGeometryCoordinates_(o,i);let t=[];if(l!==void 0&&(this.rBush_.remove(l),t.push(l.segment[0])),d!==void 0&&(this.rBush_.remove(d),t.push(d.segment[1])),l!==void 0&&d!==void 0){let e={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:t};this.rBush_.insert(fD(e.segment),e)}this.updateSegmentIndices_(o,c,f.depth,-1),this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null),e.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(fD([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?Jk(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((e,n)=>e||this.insertVertex_(n,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,r){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(n===void 0||i.depth===void 0||WE(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(kE.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(kE.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(dP.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(dP.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_)}}};function pW(e,t){return e.index-t.index}function mW(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=Kk();t&&(i=i.clone().transform(t,n));let r=kO(i.getCenter(),Jk(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=Jk(e,n);return cW[0]=Jk(t.segment[0],n),cW[1]=Jk(t.segment[1],n),jO(i,cW)}function hW(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=Kk();return i&&(t=t.clone().transform(i,n)),qk(t.getClosestPoint(Jk(e,n)),n)}let i=Jk(e,n);return cW[0]=Jk(t.segment[0],n),cW[1]=Jk(t.segment[1],n),qk(wO(i,cW),n)}function gW(){let e=EP();return function(t,n){return e.Point}}const _W={SNAP:`snap`,UNSNAP:`unsnap`};var vW=class extends ZE{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const yW={Circle(e,t){let n=e,r=Kk();r&&(n=n.clone().transform(r,t));let i=xj(n);return r&&i.transform(t,r),yW.Polygon(i)},GeometryCollection(e,t){let n=[],r=e.getGeometriesArray();for(let e=0;e<r.length;++e){let i=this[r[e].getType()];i&&n.push(i(r[e],t))}return n.flat()},LineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);return t},MultiLineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t},MultiPoint(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length;e<i;e+=r)t.push([n.slice(e,e+2)]);return t},MultiPolygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEndss(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=0,i=o.length;e<i;++e){let i=o[e];for(let e=a,o=i-r;e<o;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=i}}return t},Point(e){return[[e.getFlatCoordinates().slice(0,2)]]},Polygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t}};function bW(e){return e.feature?e.feature:e.element?e.element:null}const xW=[],SW=[],CW=[];var wW=class extends CR{constructor(e){e||={},super({handleDownEvent:KE,stopDown:qE}),this.on,this.once,this.un,this.source_=e.source?e.source:null,this.vertex_=e.vertex===void 0||e.vertex,this.edge_=e.edge===void 0||e.edge,this.intersection_=e.intersection!==void 0&&e.intersection,this.features_=e.features?e.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.rBush_=new cP,this.snapped_=null,this.segmenters_=Object.assign({},yW,e.segmenters)}addFeature(e,t){t=t===void 0||t;let n=X(e),r=e.getGeometry();if(r){let t=this.segmenters_[r.getType()];if(t){this.indexedFeaturesExtents_[n]=r.getExtent(xD());let i=t.call(this.segmenters_,r,this.getMap().getView().getProjection()),a=i.length;for(let t=0;t<a;++t){let n=i[t];SW[t]=fD(n),CW[t]={feature:e,segment:n}}if(this.intersection_)for(let t=0,n=i.length;t<n;++t){let n=i[t];if(n.length===1)continue;let r=SW[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!KD(r,SW[o]))continue;let s=XA(n,t);if(!s)continue;let c=[s];SW[a]=fD(c),CW[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(SW[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=XA(n,r);if(!i)continue;let s=[i];SW[a]=fD(s),CW[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(SW[0],CW[0]):(SW.length=a,CW.length=a,this.rBush_.load(SW,CW))}}t&&(this.featureChangeListenerKeys_[n]&&FE(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=NE(e,IE.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e}areSnapDataEqual_(e,t){return e.segment===t.segment&&e.feature===t.feature}handleEvent(e){let t=this.snapTo(e.pixel,e.coordinate,e.map);return t?(e.coordinate=t.vertex.slice(0,2),e.pixel=t.vertexPixel,this.snapped_&&!this.areSnapDataEqual_(this.snapped_,t)&&this.dispatchEvent(new vW(_W.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new vW(_W.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new vW(_W.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=bW(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=bW(e);t&&(this.removeFeature(t),delete this.pendingFeatures_[X(t)])}handleFeatureChange_(e){let t=e.target;this.handlingDownUpSequence?this.pendingFeatures_[X(t)]=t:this.updateFeature_(t)}handleUpEvent(e){let t=Object.values(this.pendingFeatures_);if(t.length){for(let e of t)this.updateFeature_(e);jE(this.pendingFeatures_)}return!1}removeFeature(e,t){let n=t===void 0||t,r=X(e),i=this.indexedFeaturesExtents_[r];if(i){let t=this.rBush_;t.getInExtent(i).forEach(n=>{(e===n.feature||e===n.intersectionFeature)&&t.remove(n)})}n&&(FE(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])}setMap(e){let t=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();if(Array.isArray(r)||(r=r.getArray()),t&&(n.forEach(FE),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(FE),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(NE(this.features_,kE.ADD,this.handleFeatureAdd_,this),NE(this.features_,kE.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(NE(this.source_,dP.ADDFEATURE,this.handleFeatureAdd_,this),NE(this.source_,dP.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=Jk(t,r),a=Yk(mD(fD([i]),n.getView().getResolution()*this.pixelTolerance_),r),o=this.rBush_.getInExtent(a),s=o.length;if(s===0)return null;let c,l=1/0,u,d=null,f=this.pixelTolerance_*this.pixelTolerance_,p=()=>{if(!c)return null;let t=n.getPixelFromCoordinate(c);return kO(e,t)>f?null:{vertex:c,vertexPixel:[Math.round(t[0]),Math.round(t[1])],feature:u,segment:d}};if(this.vertex_||this.intersection_){for(let e=0;e<s;++e){let t=o[e];if(t.feature.getGeometry().getType()!==`Circle`)for(let e of t.segment){let n=kO(i,Jk(e,r));n<l&&(this.intersection_&&t.intersectionFeature||this.vertex_&&!t.intersectionFeature)&&(c=e,l=n,u=t.feature)}}let e=p();if(e)return e}if(this.edge_){for(let e=0;e<s;++e){let t=null,n=o[e];if(n.feature.getGeometry().getType()===`Circle`){let e=n.feature.getGeometry(),a=Kk();a&&(e=e.clone().transform(a,r)),t=CO(i,e)}else{let[e,a]=n.segment;a&&(xW[0]=Jk(e,r),xW[1]=Jk(a,r),t=wO(i,xW))}if(t){let e=kO(i,t);e<l&&(c=qk(t,r),d=n.feature.getGeometry().getType()===`Circle`?null:n.segment,l=e,u=n.feature)}}let e=p();if(e)return e}return null}updateFeature_(e){this.removeFeature(e,!1),this.addFeature(e,!1)}},TW=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=lD,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?Nk(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=Nk(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return tD()}readFeature(e,t){return tD()}readFeatures(e,t){return tD()}readGeometry(e,t){return tD()}readProjection(e){return tD()}writeFeature(e,t){return tD()}writeFeatures(e,t){return tD()}writeGeometry(e,t){return tD()}};function EW(e,t,n){let r=n?Nk(n.featureProjection):null,i=n?Nk(n.dataProjection):null,a=e;if(r&&i&&!Vk(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;n.getUnits()===`tile-pixels`?a.transform(n,o):a.applyTransform(Wk(n,o))}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}const DW={Point:lj,LineString:iM,Polygon:yj,MultiPoint:zN,MultiLineString:RN,MultiPolygon:VN};function OW(e,t,n){return Array.isArray(t[0])?(hj(e,0,t,n)||(e=e.slice(),_j(e,0,t,n)),e):(mj(e,0,t,n)||(e=e.slice(),gj(e,0,t,n)),e)}function kW(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>kW({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=n.layout.length;return EW(new UN(r,r===`Polygon`?OW(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function AW(e,t){if(!e)return null;if(Array.isArray(e))return new UU(e.map(e=>AW(e,t)));let n=DW[e.type];return EW(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var jW=class extends TW{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(MW(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(MW(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return tD()}readFeaturesFromObject(e,t){return tD()}readGeometry(e,t){return this.readGeometryFromObject(MW(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return tD()}readProjection(e){return this.readProjectionFromObject(MW(e))}readProjectionFromObject(e){return tD()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return tD()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return tD()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return tD()}};function MW(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var NW=class extends jW{constructor(e){e||={},super(),this.dataProjection=Nk(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=Nk(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=[`application/geo+json`,`application/vnd.geo+json`]}readFeatureFromObject(e,t){let n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=PW(n.geometry,t);if(this.featureClass===UN)return kW({geometry:r,id:n.id,properties:n.properties},t);let i=this.featureClass,a=new i;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&a.setGeometryName(n.geometry_name),a.setGeometry(AW(r,t)),`id`in n&&a.setId(n.id),n.properties&&a.setProperties(n.properties,!0),a}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return FW(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=Nk(t.properties.name);else if(t.type===`EPSG`)n=Nk(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`)}else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=UW(a,t),delete i[e.getGeometryName()]),ME(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return UW(e,this.adaptOptions(t))}};function PW(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=LW(e);break;case`LineString`:n=RW(e);break;case`Polygon`:n=HW(e);break;case`MultiPoint`:n=BW(e);break;case`MultiLineString`:n=zW(e);break;case`MultiPolygon`:n=VW(e);break;case`GeometryCollection`:n=IW(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function FW(e,t){return AW(PW(e,t),t)}function IW(e,t){return e.geometries.map(function(e){return PW(e,t)})}function LW(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:TA(t.length)}}function RW(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:TA(t[0]?.length||2)}}function zW(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:BA(r,0,t,n),layout:TA(n)}}function BW(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:TA(t[0]?.length||2)}}function VW(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:VA(n,0,t,r),layout:TA(r)}}function HW(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:BA(n,0,t,r),layout:TA(r)}}function UW(e,t){e=EW(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=YW(e,t);break;case`LineString`:r=GW(e,t);break;case`Polygon`:r=XW(e,t);break;case`MultiPoint`:r=qW(e,t);break;case`MultiLineString`:r=KW(e,t);break;case`MultiPolygon`:r=JW(e,t);break;case`GeometryCollection`:r=WW(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function WW(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return UW(e,t)})}}function GW(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function KW(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function qW(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function JW(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function YW(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function XW(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const ZW={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},QW={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},$W={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},eG=[{shape:`Point`,label:`Draw a point`,Icon:an},{shape:`LineString`,label:`Draw a line`,Icon:bn},{shape:`Circle`,label:`Draw a circle`,Icon:rn}];function tG({target:e,className:t,fileName:n=`react-openlayers-geojson.json`}){let r=sB(),i=vU(`MapDrawControl`,G(ZW.root,t),e),[a,o]=l.useState(!1),[s,c]=l.useState(null),u=l.useRef(null),f=l.useRef(null);if(!u.current){let e=new pP;u.current={source:e,layer:new RL({source:e,style:QW,properties:{key:`drawLayer`}}),modify:new fW({source:e})}}let p=u.current,m=l.useCallback(()=>{let e=p.source.getFeatures(),t=new NW().writeFeaturesObject(e,$W),r=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=n,a.click(),URL.revokeObjectURL(i)},[p,n]);l.useEffect(()=>{if(!(!r||!a))return r.addLayer(p.layer),r.addInteraction(p.modify),()=>{r.removeInteraction(p.modify),r.removeLayer(p.layer)}},[r,a,p]),l.useEffect(()=>{if(!r||!a||!s)return;let e=s===`LineString`?new iW({source:p.source,type:s,maxPoints:2}):new iW({source:p.source,type:s}),t=new wW({source:p.source});return f.current=e,r.addInteraction(e),r.addInteraction(t),()=>{r.removeInteraction(t),r.removeInteraction(e),f.current=null}},[r,a,s,p]),l.useEffect(()=>{if(!r||!a)return;let e=r.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?f.current?.abortDrawing():e.shiftKey&&e.key===`S`&&m()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,a,m]);let h=()=>{o(e=>!e),c(null)},g=e=>{c(t=>t===e?null:e)};return(0,d.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:ZW.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":a,onClick:h,children:(0,q.jsx)(kn,{size:12})}),a?(0,q.jsxs)(`div`,{className:ZW.shapes,children:[eG.map(({shape:e,label:t,Icon:n})=>(0,q.jsx)(`button`,{type:`button`,className:ZW.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":s===e,onClick:()=>g(e),children:(0,q.jsx)(n,{size:12})},e)),(0,q.jsx)(`button`,{type:`button`,className:ZW.shape,title:`Move and reshape what has been drawn`,"aria-pressed":s===null,onClick:()=>g(null),children:(0,q.jsx)(Vt,{size:12})})]}):null]}),i)}tG.displayName=`MapDrawControl`;const nG={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},rG=(e,t)=>e.map((e,n)=>{let r=`${t}${n}`;return{key:r,layer:e,name:e.get(`name`)??e.constructor.name,children:e instanceof HR?rG(e.getLayers().getArray(),`${r}.`):[]}});function iG({target:e,className:t}){let n=sB(),r=vU(`MapLayersControl`,G(nG.root,t),e),[i,a]=l.useState(!1),[o,s]=l.useState(0),c=l.useMemo(()=>n&&i?rG(n.getLayers().getArray(),``):[],[n,i,o]),u=(e,t)=>{e.setVisible(t),s(e=>e+1)},f=e=>(0,q.jsx)(`ul`,{className:nG.list,children:e.map(e=>(0,q.jsxs)(`li`,{className:nG.item,children:[(0,q.jsxs)(`label`,{className:nG.label,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.layer.getVisible(),onChange:t=>u(e.layer,t.target.checked)}),e.name]}),e.children.length>0?f(e.children):null]},e.key))});return(0,d.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:nG.toggle,title:`Click here to switch layers`,"aria-expanded":i,onClick:()=>a(e=>!e),children:(0,q.jsx)(yn,{size:24})}),i?(0,q.jsx)(`div`,{className:nG.layers,children:f(c)}):null]}),r)}iG.displayName=`MapLayersControl`;const aG={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function oG({target:e,className:t,zoom:n=18,color:r=hB,placeholder:i=`Search for a place`}){let a=sB(),o=vU(`MapSearchControl`,G(aG.root,t),e),[s,c]=l.useState(!1),[u,f]=l.useState(``);return(0,d.createPortal)((0,q.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!a||!u)return;let[t]=await pB(u,1);if(!t)return;let i=[Number(t.lon),Number(t.lat)];vB(a,i,r).set(`address`,t.display_name),a.getView().setCenter(zk(i)),a.getView().setZoom(n)},children:[(0,q.jsx)(`button`,{type:`button`,className:aG.toggle,title:i,"aria-expanded":s,onClick:()=>c(e=>!e),children:(0,q.jsx)(On,{size:24})}),s?(0,q.jsx)(`input`,{type:`search`,className:aG.input,value:u,placeholder:i,"aria-label":i,autoComplete:`off`,onChange:e=>f(e.target.value)}):null]}),o)}oG.displayName=`MapSearchControl`;const sG=e=>{let t=sB(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addInteraction(r),()=>{t.removeInteraction(r)}},[t,r]),r};var cG=class extends CR{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:yR,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!xR(e))return;let t=e.map,n=t.getSize(),r=e.pixel,i=r[0]-n[0]/2,a=n[1]/2-r[1],o=Math.atan2(a,i),s=Math.sqrt(i*i+a*a),c=t.getView();if(this.lastAngle_!==void 0){let e=this.lastAngle_-o;c.adjustRotationInternal(e)}this.lastAngle_=o,this.lastMagnitude_!==void 0&&c.adjustResolutionInternal(this.lastMagnitude_/s),this.lastMagnitude_!==void 0&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}handleUpEvent(e){if(!xR(e))return!0;let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1}handleDownEvent(e){return xR(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function lG(e){return sG(()=>new cG(e)),null}lG.displayName=`MapDragRotateAndZoomInteraction`;const uG={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var dG=class extends ZE{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},fG=class extends CR{constructor(e){e||={},super(e),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=e.features===void 0?null:e.features;let t;if(e.layers&&!this.features_){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=KE;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:KE,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:pR,this.lastFeature_=null,this.addChangeListener(rR.ACTIVE,this.handleActiveChanged_)}handleDownEvent(e){if(!e.originalEvent||!this.condition_(e))return!1;if(this.lastFeature_=this.featuresAtPixel_(e.pixel,e.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=e.coordinate,this.lastCoordinate_=e.coordinate,this.handleMoveEvent(e);let t=this.features_||new sD([this.lastFeature_]);return this.dispatchEvent(new dG(uG.TRANSLATESTART,t,e.coordinate,this.startCoordinate_,e)),!0}return!1}handleUpEvent(e){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(e);let t=this.features_||new sD([this.lastFeature_]);return this.dispatchEvent(new dG(uG.TRANSLATEEND,t,e.coordinate,this.startCoordinate_,e)),this.startCoordinate_=null,!0}return!1}handleDragEvent(e){if(this.lastCoordinate_){let t=e.coordinate,n=e.map.getView().getProjection(),r=Jk(t,n),i=Jk(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new sD([this.lastFeature_]),c=Kk();s.forEach(function(e){let t=e.getGeometry();c?(t.transform(c,n),t.translate(a,o),t.transform(n,c)):t.translate(a,o),e.setGeometry(t)}),this.lastCoordinate_=t,this.dispatchEvent(new dG(uG.TRANSLATING,s,t,this.startCoordinate_,e))}}handleMoveEvent(e){let t=e.map.getViewport();this.featuresAtPixel_(e.pixel,e.map)?(t.classList.remove(this.lastCoordinate_?`ol-grab`:`ol-grabbing`),t.classList.add(this.lastCoordinate_?`ol-grabbing`:`ol-grab`)):t.classList.remove(`ol-grab`,`ol-grabbing`)}featuresAtPixel_(e,t){return t.forEachFeatureAtPixel(e,(e,t)=>{if(!(!(e instanceof lD)||!this.filter_(e,t))&&!(this.features_&&!this.features_.getArray().includes(e)))return e},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(e){this.hitTolerance_=e}setMap(e){let t=this.getMap();super.setMap(e),this.updateState_(t)}handleActiveChanged_(){this.updateState_(null)}updateState_(e){let t=this.getMap(),n=this.getActive();(!t||!n)&&(t||=e,t&&t.getViewport().classList.remove(`ol-grab`,`ol-grabbing`))}};function pG(e){return sG(()=>new fG(e)),null}pG.displayName=`MapTranslateInteraction`;function mG(e){let t=l.useRef(null),n=e=>{let n=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return n instanceof lD&&(t.current={feature:n,coordinate:e.coordinate},!0)},r=e=>{let n=t.current;if(!n)return;let r=n.feature.getGeometry();r&&(r.translate(e.coordinate[0]-n.coordinate[0],e.coordinate[1]-n.coordinate[1]),n.coordinate=e.coordinate)},i=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},a=()=>(t.current=null,!1);return sG(()=>new CR({handleDownEvent:n,handleDragEvent:r,handleMoveEvent:i,handleUpEvent:a,...e})),null}mG.displayName=`MapPointerInteraction`;const hG={SELECT:`select`};var gG=class extends ZE{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const _G={};var vG=class e extends iR{constructor(e){super(),this.on,this.once,this.un,e||={},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:gR,this.addCondition_=e.addCondition?e.addCondition:hR,this.removeCondition_=e.removeCondition?e.removeCondition:hR,this.toggleCondition_=e.toggleCondition?e.toggleCondition:yR,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:KE,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?yG():e.style,this.features_=e.features||new sD;let t;if(e.layers){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=KE;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[X(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[X(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(kE.ADD,this.boundAddFeature_),this.features_.addEventListener(kE.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(kE.ADD,this.boundAddFeature_),this.features_.removeEventListener(kE.REMOVE,this.boundRemoveFeature_))}addFeature_(e){let t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){let e=this.findLayerOfFeature_(t);e&&this.addFeatureLayerAssociation_(t,e)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element),this.removeFeatureLayerAssociation_(e.element)}findLayerOfFeature_(e){return this.getMap().getAllLayers().find(function(t){if(t instanceof RL&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in _G||(_G[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(t){let n=this.getMap().getInteractions().getArray();for(let r=n.length-1;r>=0;--r){let i=n[r];if(i!==this&&i instanceof e&&i.getStyle()&&i.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(i.getStyle());return}}let r=X(t);t.setStyle(_G[r]),delete _G[r]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[X(e)]}selectFeature(e){let t=this.findLayerOfFeature_(e);if(!this.layerFilter_(t)||!this.filter_(e,t))return!1;let n=this.getFeatures();return!n.getArray().includes(e)&&(this.addFeatureLayerAssociation_(e,t),n.push(e),this.dispatchEvent(new gG(hG.SELECT,[e],[],void 0)),!0)}deselectFeature(e){let t=this.getFeatures(),n=t.getArray().indexOf(e);return n!==-1&&(t.removeAt(n),this.dispatchEvent(new gG(hG.SELECT,[],[e],void 0)),!0)}toggleFeature(e){this.deselectFeature(e)||this.selectFeature(e)}clearSelection(){let e=this.getFeatures();if(e.getLength()!==0){let t=e.getArray().slice();e.clear(),this.dispatchEvent(new gG(hG.SELECT,[],t,void 0))}}handleEvent(e){if(!this.condition_(e))return!0;let t=this.addCondition_(e),n=this.removeCondition_(e),r=this.toggleCondition_(e),i=!t&&!n&&!r,a=e.map,o=this.getFeatures(),s=[],c=[];if(i){a.forEachFeatureAtPixel(e.pixel,(e,t)=>{if(!(!(e instanceof lD)||!this.filter_(e,t)))return this.addFeatureLayerAssociation_(e,t),c.push(e),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=o.getLength()-1;e>=0;--e){let t=o.item(e),n=c.indexOf(t);n===-1?(o.removeAt(e),s.push(t)):c.splice(n,1)}c.length!==0&&o.extend(c)}else{a.forEachFeatureAtPixel(e.pixel,(e,i)=>{if(!(e instanceof lD)||!this.filter_(e,i))return;let a=o.getArray().includes(e);return a&&(n||r)?s.push(e):!a&&(t||r)&&(this.addFeatureLayerAssociation_(e,i),c.push(e)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=s.length-1;e>=0;--e)o.remove(s[e]);o.extend(c)}return(c.length>0||s.length>0)&&this.dispatchEvent(new gG(hG.SELECT,c,s,e)),!0}};function yG(){let e=EP();return UE(e.Polygon,e.LineString),UE(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const bG=`#ff0000`,xG=`rgba(255, 0, 0, 0.4)`,SG=e=>new OP({text:e,font:`12px Calibri,sans-serif`,fill:new mP({color:`#000`}),stroke:new hP({color:`#fff`,width:3}),offsetY:-10}),CG=e=>{let t=e.getGeometry();if(!(t instanceof CA))return;let n=t.getType();if(n===`Point`)return new SP({image:new xP({radius:6,fill:new mP({color:xG}),stroke:new hP({color:bG,width:2})})});if(n===`LineString`){let e=new SP({stroke:new hP({color:bG,width:3})}),n=hO(t)/1e3;return n>0&&e.setText(SG(`Length: ${n.toFixed(2)} km`)),e}let r=new SP({fill:new mP({color:xG}),stroke:new hP({color:bG,width:2})});try{let e=_O(t)/1e6;e>0&&r.setText(SG(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function wG({onSelect:e,style:t=CG,...n}){let r=sB(),i=sG(()=>new vG({...n,style:t})),a=l.useRef(e);return l.useEffect(()=>{a.current=e},[e]),l.useEffect(()=>{let e=i.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&a.current?.(e)});return()=>eD(e)},[i]),l.useEffect(()=>{if(!r)return;let e=r.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=i.getFeatures();t.forEach(e=>{i.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,i]),null}wG.displayName=`MapSelectInteraction`;function TG(e){return lO(e,5)}function EG(e){return parseFloat(e)}function DG(e){return TG(e).toString()}function OG(e,t){return!isNaN(e)&&e!==EG(DG(t))}function kG(e,t){return OG(e[0],t[0])||OG(e[1],t[1])}var AG=class extends iR{constructor(e){super(),e=Object.assign({animate:!0,params:[`x`,`y`,`z`,`r`,`l`],replace:!1,prefix:``},e||{});let t;t=e.animate===!0?{duration:250}:e.animate?e.animate:null,this.animationOptions_=t,this.params_=e.params.reduce((e,t)=>(e[t]=!0,e),{}),this.replace_=e.replace,this.prefix_=e.prefix,this.listenerKeys_=[],this.initial_=!0,this.updateState_=this.updateState_.bind(this),this.trackedCallbacks_={},this.trackedValues_={}}getParamName_(e){return this.prefix_?this.prefix_+e:e}get_(e,t){return e.get(this.getParamName_(t))}set_(e,t,n){t in this.params_&&e.set(this.getParamName_(t),n)}delete_(e,t){t in this.params_&&e.delete(this.getParamName_(t))}setMap(e){let t=this.getMap();super.setMap(e),e!==t&&(t&&this.unregisterListeners_(t),e&&(this.initial_=!0,this.updateState_(),this.registerListeners_(e)))}registerListeners_(e){this.listenerKeys_.push(NE(e,qL.MOVEEND,this.updateUrl_,this),NE(e.getLayerGroup(),IE.CHANGE,this.updateUrl_,this),NE(e,`change:layergroup`,this.handleChangeLayerGroup_,this)),this.replace_||addEventListener(`popstate`,this.updateState_)}unregisterListeners_(e){for(let e=0,t=this.listenerKeys_.length;e<t;++e)FE(this.listenerKeys_[e]);this.listenerKeys_.length=0,this.replace_||removeEventListener(`popstate`,this.updateState_);let t=new URL(window.location.href),n=t.searchParams;this.delete_(n,`x`),this.delete_(n,`y`),this.delete_(n,`z`),this.delete_(n,`r`),this.delete_(n,`l`),window.history.replaceState(null,``,t)}handleChangeLayerGroup_(){let e=this.getMap();e&&(this.unregisterListeners_(e),this.registerListeners_(e),this.initial_=!0,this.updateUrl_())}updateState_(){let e=new URL(window.location.href).searchParams;for(let t in this.trackedCallbacks_){let n=e.get(t);t in this.trackedCallbacks_&&n!==this.trackedValues_[t]&&(this.trackedValues_[t]=n,this.trackedCallbacks_[t](n))}let t=this.getMap();if(!t)return;let n=t.getView();if(!n||!n.isDef())return;let r=!1,i={},a=EG(this.get_(e,`z`));`z`in this.params_&&OG(a,n.getZoom())&&(r=!0,i.zoom=a);let o=EG(this.get_(e,`r`));`r`in this.params_&&OG(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[EG(this.get_(e,`x`)),EG(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&kG(s,n.getCenter())&&(r=!0,i.center=s),r&&(!this.initial_&&this.animationOptions_?n.animate(Object.assign(i,this.animationOptions_)):(i.center&&n.setCenter(i.center),`zoom`in i&&n.setZoom(i.zoom),`rotation`in i&&n.setRotation(i.rotation)));let c=t.getAllLayers(),l=this.get_(e,`l`);if(`l`in this.params_&&l&&l.length===c.length)for(let e=0,t=c.length;e<t;++e){let t=parseInt(l[e]);if(!isNaN(t)){let n=!!t,r=c[e];r.getVisible()!==n&&r.setVisible(n)}}}track(e,t){this.trackedCallbacks_[e]=t;let n=new URL(window.location.href).searchParams.get(e);return this.trackedValues_[e]=n,n}update(e,t){let n=new URL(window.location.href),r=n.searchParams;t===null?r.delete(e):r.set(e,t),e in this.trackedValues_&&(this.trackedValues_[e]=t),this.updateHistory_(n)}updateUrl_(){let e=this.getMap();if(!e)return;let t=e.getView();if(!t||!t.isDef())return;let n=t.getCenter(),r=t.getZoom(),i=t.getRotation(),a=e.getAllLayers(),o=Array(a.length);for(let e=0,t=a.length;e<t;++e)o[e]=a[e].getVisible()?`1`:`0`;let s=new URL(window.location.href),c=s.searchParams;this.set_(c,`x`,DG(n[0])),this.set_(c,`y`,DG(n[1])),this.set_(c,`z`,DG(r)),this.set_(c,`r`,DG(i)),this.set_(c,`l`,o.join(``)),this.updateHistory_(s),this.initial_=!1}updateHistory_(e){e.href!==window.location.href&&(this.initial_||this.replace_?window.history.replaceState(history.state,``,e):window.history.pushState(null,``,e))}};function jG(e){return sG(()=>new AG(e)),null}jG.displayName=`MapLinkInteraction`;const MG={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},NG=37.7649804,PG=-122.4323829,FG=[];function IG({latitude:e,longitude:t,zoom:n,marker:r,markerColor:i,markerLabel:a}){let o=sB(),s=l.useRef(!1);return l.useEffect(()=>{if(!o)return;let r=o.getView(),i=zk([t,e]);if(s.current){r.animate({center:i,zoom:n,duration:500});return}s.current=!0,r.setCenter(i),r.setZoom(n)},[o,e,t,n]),l.useEffect(()=>{if(!o||!r)return;let n=vB(o,[t,e],i,a);return()=>yB(o,n)},[o,e,t,r,i,a]),null}IG.displayName=`MapLocation`;function LG(e,t){let{latitude:n=NG,longitude:r=PG,zoom:i=16,width:a,height:o,controls:s=FG,marker:c=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=e,y=Y(f),b=l.useRef(null),x=ar(t,b),S=l.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=MG.toolbar,S.current=e}let C=S.current;l.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,q.jsx)(NU,{},e);case`fullScreen`:return(0,q.jsx)(OU,{target:C,source:y},e);case`search`:return(0,q.jsx)(oG,{target:C},e);case`layers`:return(0,q.jsx)(iG,{target:C},e);case`draw`:return(0,q.jsx)(tG,{target:C},e)}};return(0,q.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:G(MG.root,p),style:{...m,"--map-width":typeof a==`number`?`${a}px`:a,"--map-height":typeof o==`number`?`${o}px`:o},"data-component":`Map`,...v,children:(0,q.jsxs)(oB,{className:MG.surface,keyboardEventTarget:y,children:[(0,q.jsx)(IG,{latitude:n,longitude:r,zoom:i,marker:c,markerColor:u,markerLabel:d}),s.map(T),h]})})}LG.displayName=`Map`;var RG=K(LG);const zG=Object.assign(RG,{View:cB,Marker:SB,Overlay:wB,LayerGroup:OB,TileLayer:kB,ImageLayer:NB,VectorLayer:PB,GraticuleLayer:FB,HeatmapLayer:pU,WebGLTileLayer:gU,AttributionControl:yU,DrawControl:tG,FullScreenControl:OU,LayersControl:iG,MousePositionControl:LU,OverviewMapControl:VU,ScaleLineControl:NU,SearchControl:oG,DragRotateAndZoomInteraction:lG,LinkInteraction:jG,PointerInteraction:mG,SelectInteraction:wG,TranslateInteraction:pG}),BG={root:`markdown`};function VG(e,t){let{className:n,source:r,transformers:i,preserveNewLines:a=!1,...o}=e,[s]=(0,y.useLexicalComposerContext)(),c=l.useCallback(e=>{s.setRootElement(e)},[s]),u=ar(t,c);return rr(()=>{s.update(()=>{(0,v.$convertFromMarkdownString)(r,i,void 0,a)},{discrete:!0})},[s,r,i,a]),(0,q.jsx)(`div`,{ref:u,className:G(BG.root,n),"data-component":`Markdown`,...o})}VG.displayName=`MarkdownProse`;var HG=K(VG);const UG=`Markdown`,WG=[C.HeadingNode,C.QuoteNode,S.ListNode,S.ListItemNode,x.LinkNode,b.CodeNode,b.CodeHighlightNode],GG=[v.CHECK_LIST,...v.TRANSFORMERS],KG={paragraph:`markdown-paragraph`,heading:{h1:`markdown-heading-1`,h2:`markdown-heading-2`,h3:`markdown-heading-3`,h4:`markdown-heading-4`,h5:`markdown-heading-5`,h6:`markdown-heading-6`},quote:`markdown-quote`,link:`markdown-link`,code:`markdown-code-block`,list:{ul:`markdown-list-bullet`,ol:`markdown-list-number`,listitem:`markdown-list-item`,checklist:`markdown-list-check`,listitemChecked:`markdown-list-item-checked`,listitemUnchecked:`markdown-list-item-unchecked`,nested:{listitem:`markdown-list-item-nested`}},text:{bold:`markdown-bold`,italic:`markdown-italic`,strikethrough:`markdown-strikethrough`,highlight:`markdown-highlight`,code:`markdown-code-inline`},ltr:`markdown-ltr`,rtl:`markdown-rtl`};function qG(e,t){let{className:n,children:r=``,transformers:i=GG,preserveNewLines:a=!1,namespace:o=UG,onError:s,...c}=e;return(0,q.jsx)(_.LexicalComposer,{initialConfig:{namespace:o,theme:KG,nodes:WG,editable:!1,onError:s??(e=>{throw e})},children:(0,q.jsx)(HG,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}qG.displayName=`Markdown`;var JG=K(qG);const YG=(0,l.createContext)({}),XG=()=>(0,l.useContext)(YG),ZG=(e={})=>{let{paused:t,defaultPaused:n,onPauseChange:r}=e,i=t!==void 0,[a,o]=l.useState(n??!1),s=i?t:a,c=e=>{e!==s&&(i||o(e),r?.(e))};return{paused:s,pause:()=>c(!0),resume:()=>c(!1),toggle:()=>c(!s),setPaused:c}},QG={root:`marquee`},$G=e=>e===`top`||e===`bottom`;function eK(e,t){let{as:n=`div`,className:r,side:i=`start`,speed:a=50,delay:o=0,loopCount:s=0,autoFill:c=!1,spacing:u,reverse:d=!1,paused:f,defaultPaused:p,pauseOnInteraction:m=!0,onPauseChange:h,onLoopComplete:g,onComplete:_,children:v,...y}=e,b=ZG({paused:f,defaultPaused:p,onPauseChange:h}),x=$G(i),S=l.useRef(null),C=l.useRef(null),[w,T]=l.useState(0),[E,D]=l.useState(0);rr(()=>{let e=S.current,t=C.current;if(e===null||t===null)return;let n=()=>{let n=x?e.clientHeight:e.clientWidth,r=x?t.offsetHeight:t.offsetWidth;T(e=>e===n?e:n),D(e=>e===r?e:r)};n();let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[x]);let O=c&&E>0?Math.max(Math.ceil(w/E)+1,2):2,k=E>0&&a>0?E/a:0,{style:A,onMouseEnter:j,onMouseLeave:M,onFocus:N,onBlur:P,...F}=y,[I,L]=l.useState(!1),ee=e=>{j?.(e),m&&L(!0)},R=e=>{M?.(e),L(!1)},z=e=>{N?.(e),m&&L(!0)},te=e=>{P?.(e),e.currentTarget.contains(e.relatedTarget)||L(!1)},ne=b.paused||I,B={...b,side:i,orientation:x?`vertical`:`horizontal`,copyCount:O,viewportRef:S,copyRef:C,onLoopComplete:g,onComplete:_};return(0,q.jsx)(YG.Provider,{value:B,children:(0,q.jsx)(n,{ref:t,className:G(QG.root,r),style:{...A,"--marquee-duration":`${k}s`,"--marquee-delay":`${o}ms`,"--marquee-loop-count":s>0?`${s}`:`infinite`,...u===void 0?null:{"--marquee-spacing":u}},onMouseEnter:ee,onMouseLeave:R,onFocus:z,onBlur:te,"data-component":`Marquee`,"data-orientation":x?`vertical`:`horizontal`,"data-side":i,"data-reverse":d||void 0,"data-paused":ne||void 0,"data-running":E>0||void 0,...F,children:v})})}eK.displayName=`Marquee`;var tK=K(eK);const nK={root:`marquee-content`};function rK(e,t){let{as:n=`div`,className:r,children:i,...a}=e,{copyCount:o=1,copyRef:s,onLoopComplete:c,onComplete:u}=l.useContext(YG),d=ar(t,s),f=l.useRef(0),p=e=>e.target===e.currentTarget,m=e=>{p(e)&&(f.current+=1,c?.(f.current))},h=e=>{p(e)&&(f.current+=1,c?.(f.current),u?.())};return(0,q.jsx)(q.Fragment,{children:Array.from({length:o},(e,t)=>{let o=t===0;return(0,q.jsx)(n,{ref:o?d:void 0,className:G(nK.root,r),"aria-hidden":!o||void 0,inert:!o,onAnimationIteration:o?m:void 0,onAnimationEnd:o?h:void 0,"data-component":`Marquee.Content`,...a,children:i},t)})})}rK.displayName=`Marquee.Content`;var iK=K(rK);const aK={root:`marquee-edge`};function oK(e,t){let{as:n=`div`,className:r,side:i,...a}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(aK.root,r),"data-component":`Marquee.Edge`,"data-side":i,...a})}oK.displayName=`Marquee.Edge`;var sK=K(oK);const cK={root:`marquee-item`};function lK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(cK.root,r),"data-component":`Marquee.Item`,...i})}lK.displayName=`Marquee.Item`;var uK=K(lK);const dK={root:`marquee-viewport`};function fK(e,t){let{as:n=`div`,className:r,...i}=e,{viewportRef:a}=l.useContext(YG),o=ar(t,a);return(0,q.jsx)(n,{ref:o,className:G(dK.root,r),"data-component":`Marquee.Viewport`,...i})}fK.displayName=`Marquee.Viewport`;var pK=K(fK);const mK=Object.assign(tK,{Root:tK,Viewport:pK,Content:iK,Item:uK,Edge:sK}),hK=(0,l.createContext)({}),gK=W(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function _K(e,t){let{as:n=`div`,className:r,align:i,...a}=e,{align:o}=l.useContext(hK),s=i??o??`start`,c={align:s};return(0,q.jsx)(Cl.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(gK({align:s}),r),"data-component":`Message`,"data-align":s,...a})})}_K.displayName=`Message`;var vK=K(_K);const yK={root:`message-avatar`};function bK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(yK.root,r),"data-component":`Message.Avatar`,...i})}bK.displayName=`Message.Avatar`;var xK=K(bK);const SK={root:`message-content`};function CK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(SK.root,r),"data-component":`Message.Content`,...i})}CK.displayName=`Message.Content`;var wK=K(CK);const TK={root:`message-footer`};function EK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(TK.root,r),"data-component":`Message.Footer`,...i})}EK.displayName=`Message.Footer`;var DK=K(EK);const OK={root:`message-group`};function kK(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,q.jsx)(hK.Provider,{value:{align:i},children:(0,q.jsx)(n,{ref:t,className:G(OK.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}kK.displayName=`Message.Group`;var AK=K(kK);const jK={root:`message-header`};function MK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(jK.root,r),"data-component":`Message.Header`,...i})}MK.displayName=`Message.Header`;var NK=K(MK);const PK=Object.assign(vK,{Group:AK,Avatar:xK,Content:wK,Header:NK,Footer:DK}),FK=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},IK=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,LK=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return IK(r??0,r,i);let a=e+t*n,o=Math.max(FK(n),FK(e)),s=o===0?a:Number(a.toFixed(o));return IK(s,r,i)},RK=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},zK=(0,l.createContext)({}),BK={root:`meter-indicator`};function VK(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(BK.root,r),"data-component":`Meter.Indicator`,...i})}VK.displayName=`Meter.Indicator`;var HK=K(VK);const UK={root:`meter-label`};function WK(e,t){let{as:n=`span`,className:r,id:i,...a}=e,{labelId:o}=l.useContext(zK);return(0,q.jsx)(n,{ref:t,id:i??o,className:G(UK.root,r),"data-component":`Meter.Label`,...a})}WK.displayName=`Meter.Label`;var GK=K(WK);const KK={root:`meter-track`};function qK(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(KK.root,r),"data-component":`Meter.Track`,...i})}qK.displayName=`Meter.Track`;var JK=K(qK);const YK={root:`meter-value`};function XK(e,t){let{className:n,children:r,...i}=e,{formattedValue:a=``,value:o=0}=l.useContext(zK);return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(YK.root,n),"data-component":`Meter.Value`,...i,children:typeof r==`function`?r({formattedValue:a,value:o}):r??a})}XK.displayName=`Meter.Value`;var ZK=K(XK);const QK=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,$K=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),eq={header:`meter-header`,hidden:`sr-only`},tq=W(`meter`,{variants:{size:{small:`meter-small`,medium:`meter-medium`,large:`meter-large`},variant:{accent:`meter-accent`,attention:`meter-attention`,danger:`meter-danger`,done:`meter-done`,neutral:`meter-neutral`,severe:`meter-severe`,sponsors:`meter-sponsors`,success:`meter-success`}}});function nq(e,t){let{as:n=`div`,className:r,style:i,value:a,min:o=0,max:s=100,format:c,getAriaValueText:l,size:u=`medium`,variant:d=`success`,children:f,id:p,"aria-label":m,"aria-labelledby":h,...g}=e,_=`${Y(p)}-label`,[v,y]=xr(f,{label:GK,value:ZK,track:JK}),b=IK(Number.isNaN(a)?o:a,o,s),x=IK(QK(b,o,s),0,100),S=$K(b,x,c),C=l?l(S,a):S,w=h??(v.label&&!m?_:void 0),T={value:b,percentage:x,formattedValue:S,labelId:_};return(0,q.jsx)(zK.Provider,{value:T,children:(0,q.jsxs)(n,{ref:t,id:p,role:`meter`,"aria-valuenow":b,"aria-valuemin":o,"aria-valuemax":s,"aria-valuetext":C,"aria-label":m,"aria-labelledby":w,className:G(tq({size:u,variant:d}),r),style:{...i,"--meter-percentage":`${x}%`},"data-component":`Meter`,"data-size":u,"data-variant":d,"data-value":b,...g,children:[v.label||v.value?(0,q.jsxs)(`span`,{className:eq.header,children:[v.label,v.value]}):null,v.track??(0,q.jsx)(JK,{children:(0,q.jsx)(HK,{})}),y,(0,q.jsx)(`span`,{role:`presentation`,className:eq.hidden,children:`x`})]})})}nq.displayName=`Meter`;var rq=K(nq);const iq=Object.assign(rq,{Label:GK,Value:ZK,Track:JK,Indicator:HK});function aq(e,t){return(0,q.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}aq.displayName=`NativeSelect.OptGroup`;var oq=K(aq);function sq(e,t){return(0,q.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}sq.displayName=`NativeSelect.Option`;var cq=K(sq);const lq=Object.assign(Rx,{Option:cq,OptGroup:oq}),uq={root:`navigation-list-heading`,hidden:`sr-only`};function dq(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(Tr,{as:t,size:`small`,className:G(n?uq.hidden:uq.root,r),"data-component":`NavigationList.Heading`,...i})}dq.displayName=`NavigationList.Heading`;const fq=l.createContext(null),pq=l.createContext({depth:0}),mq=l.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),hq=e=>Number.parseInt(e.slice(1),10),gq=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},_q={heading:dq},vq={container:`NavigationList`};function yq(e,t){let{children:n,className:r,"aria-label":i,"aria-labelledby":a,...o}=e,[s,c]=xr(n,_q),u=Y(),d=s.heading,f=d?d.props.id??u:void 0,p=d?hq(d.props.as??`h2`):null;return(0,q.jsx)(`nav`,{ref:t,"aria-label":i,"aria-labelledby":a??(i?void 0:f),className:G(r),"data-component":`NavigationList`,...o,children:(0,q.jsxs)(fq.Provider,{value:p,children:[d?l.cloneElement(d,{id:f}):null,(0,q.jsx)(Ar.Provider,{value:vq,children:(0,q.jsx)(ji,{children:c})})]})})}yq.displayName=`NavigationList`;var bq=l.forwardRef(yq);function xq(e){let{title:t,children:n,hideDivider:r=!1,...i}=e,a=l.useContext(fq);return(0,q.jsxs)(q.Fragment,{children:[r?null:(0,q.jsx)(ji.Divider,{}),(0,q.jsxs)(ji.Group,{"data-component":`NavigationList.Group`,...i,children:[t?(0,q.jsx)(ji.GroupHeading,{as:gq(a),children:t}):null,n]})]})}xq.displayName=`NavigationList.Group`;const Sq={chevron:`navigation-list-chevron`},Cq={trailingVisual:ji.TrailingVisual},wq=e=>{if(!l.isValidElement(e))return!1;let t=e.props[`aria-current`];return t&&t!==`false`?!0:l.Children.toArray(e.props.children).some(wq)};function Tq(e){let{children:t,subNavigation:n,defaultOpen:r,className:i}=e,a=Y(),o=Y(),s=l.useRef(null),c=l.useMemo(()=>wq(n),[n]),[u,d]=l.useState(r??c),[f,p]=l.useState(c);rr(()=>{let e=c||!!s.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[c,n]);let m=l.useMemo(()=>({buttonId:a,subNavigationId:o,isOpen:u}),[a,o,u]),[h,g]=xr(t,Cq);return(0,q.jsx)(mq.Provider,{value:m,children:(0,q.jsxs)(ji.Item,{id:a,active:!u&&f,"aria-expanded":u,"aria-controls":o,onSelect:()=>d(e=>!e),className:i,"data-component":`NavigationList.Item`,children:[g,(0,q.jsxs)(ji.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,q.jsx)(Qt,{className:Sq.chevron})]}),(0,q.jsx)(ji.SubItem,{children:l.cloneElement(n,{ref:s})})]})})}Tq.displayName=`NavigationList.ItemWithSubNavigation`;const Eq={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function Dq(e,t){let{className:n,children:r,...i}=e,{buttonId:a,subNavigationId:o,isOpen:s}=l.useContext(mq),{depth:c}=l.useContext(pq),u=l.useMemo(()=>({depth:c+1}),[c]);return!a||!o||c>=4?null:(0,q.jsx)(pq.Provider,{value:u,children:(0,q.jsx)(`ul`,{ref:t,id:o,hidden:!s,"aria-labelledby":a,className:G(Eq.root,Eq.items,n),"data-component":`NavigationList.SubNavigation`,"data-depth":c+1,...i,children:r})})}Dq.displayName=`NavigationList.SubNavigation`;var Oq=K(Dq);const kq={subNavigation:Oq},Aq=ji.LinkItem;function jq(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=xr(r,kq);return c.subNavigation?(0,q.jsx)(Tq,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,q.jsx)(Aq,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}jq.displayName=`NavigationList.Item`;var Mq=K(jq);const Nq=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,q.jsx)(e,{});function Pq(e,t){let{label:n=`Show more`,pages:r=0,items:i,renderItem:a,...o}=e,[s,c]=l.useState(0),u=Y(),d=i.length/r,f=r===0?i.length:Math.ceil(d*s),p=s===1?0:f-Math.floor(d);return rr(()=>{s!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[s,u]),(0,q.jsxs)(q.Fragment,{children:[s>0?i.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:o,...s}=e,c=t===p?u:void 0;return a?a({...e,"data-expand-focus-target":c}):(0,q.jsxs)(Mq,{"data-expand-focus-target":c,...s,children:[r?(0,q.jsx)(ji.LeadingVisual,{children:(0,q.jsx)(r,{})}):null,n,i?(0,q.jsx)(ji.TrailingVisual,{children:Nq(i)}):null,o?(0,q.jsx)(ji.TrailingAction,{...o}):null]},e.id??t)}):null,s<r||s===0?(0,q.jsxs)(ji.Item,{ref:t,as:`button`,"aria-expanded":!1,onSelect:()=>c(e=>e+1),"data-component":`NavigationList.GroupExpand`,...o,children:[n,(0,q.jsx)(ji.TrailingVisual,{children:(0,q.jsx)(Pt,{})})]}):null]})}Pq.displayName=`NavigationList.GroupExpand`;var Fq=l.forwardRef(Pq);const Iq={root:`navigation-list-group-heading`};function Lq(e){let{as:t,className:n,...r}=e,i=l.useContext(fq);return(0,q.jsx)(ji.GroupHeading,{as:t??gq(i),className:G(Iq.root,n),"data-component":`NavigationList.GroupHeading`,...r})}Lq.displayName=`NavigationList.GroupHeading`;const Rq=yr(Lq,Hr),zq=Object.assign(bq,{Heading:dq,Item:Mq,SubNavigation:Oq,Group:xq,GroupHeading:Rq,GroupExpand:Fq,Description:Rr,LeadingVisual:ni,TrailingVisual:bi,TrailingAction:yi,Divider:Br}),Bq={root:`navigation-menu-heading`,hidden:`sr-only`};function Vq(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(Tr,{as:t,size:`small`,className:G(n?Bq.hidden:Bq.root,r),"data-component":`NavigationMenu.Heading`,...i})}Vq.displayName=`NavigationMenu.Heading`;const Hq=(0,l.createContext)({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),Uq=(0,l.createContext)({value:``,triggerId:``,contentId:``,isOpen:!1}),Wq=(0,l.createContext)({linkId:``,descriptionId:``}),Gq=(0,l.createContext)(null),Kq=(0,l.createContext)({depth:0}),qq=e=>Number.parseInt(e.slice(1),10),Jq=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},Yq={root:`navigation-menu`},Xq={heading:Vq};function Zq(e,t){let{children:n,className:r,value:i,defaultValue:a=null,onValueChange:o,orientation:s=`horizontal`,openOn:c=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=e,g=l.useRef(null),_=ar(t,g),[v,y]=xr(n,Xq),b=Y(),x=v.heading,S=x?x.props.id??b:void 0,C=x?qq(x.props.as??`h2`):null,w=m??(p?void 0:S),T=i!==void 0,[E,D]=l.useState(a),O=T?i:E,k=l.useRef(o);rr(()=>{k.current=o},[o]);let A=l.useRef(null),j=l.useRef(null),M=l.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);l.useEffect(()=>M,[M]);let N=l.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=l.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=l.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);Hi(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),l.useEffect(()=>{if(O===null)return;let e=e=>{let{target:t}=e;!(t instanceof Node)||g.current?.contains(t)||N(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[O,N]);let I=e=>{f?.(e),O!==null&&(e.relatedTarget instanceof Node&&g.current?.contains(e.relatedTarget)||N(null))},L=l.useMemo(()=>({openValue:O,setOpenValue:N,orientation:s,openOn:c,openAfterDelay:P,closeAfterDelay:F}),[O,N,s,c,P,F]);return(0,q.jsx)(Hq.Provider,{value:L,children:(0,q.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:G(Yq.root,r),"data-component":`NavigationMenu`,"data-orientation":s,...h,onBlur:I,children:(0,q.jsxs)(Gq.Provider,{value:C,children:[x?l.cloneElement(x,{id:S}):null,y]})})})}Zq.displayName=`NavigationMenu`;var Qq=l.forwardRef(Zq);const $q=W(`navigation-menu-content`,{variants:{open:{true:`motion-safe:data-[orientation=horizontal]:animate-in motion-safe:data-[orientation=horizontal]:fade-in motion-safe:data-[orientation=horizontal]:duration-short motion-safe:data-[orientation=horizontal]:slide-in-from-top-1`,false:``},align:{start:`navigation-menu-content-align-start`,center:`navigation-menu-content-align-center`,end:`navigation-menu-content-align-end`}}});function eJ(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e,{orientation:o}=l.useContext(Hq),{triggerId:s,contentId:c,isOpen:u}=l.useContext(Uq);if(!c)return null;let d=o===`vertical`?void 0:i;return(0,q.jsx)(n,{ref:t,id:c,hidden:!u,"aria-labelledby":s,className:G($q({open:u,align:d}),r),"data-component":`NavigationMenu.Content`,"data-orientation":o,"data-align":d,"data-open":u?``:void 0,...a})}eJ.displayName=`NavigationMenu.Content`;var tJ=K(eJ);const nJ={root:`navigation-menu-description`};function rJ(e){let{className:t,...n}=e,{descriptionId:r}=l.useContext(Wq);return(0,q.jsx)(`span`,{id:r,className:G(nJ.root,t),"data-component":`NavigationMenu.Description`,...n})}rJ.displayName=`NavigationMenu.Description`;const iJ={root:`navigation-menu-divider`};function aJ(e){let{className:t,...n}=e;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:G(iJ.root,t),"data-component":`NavigationMenu.Divider`,...n})}aJ.displayName=`NavigationMenu.Divider`;const oJ={root:`navigation-menu-group-heading`};function sJ(e){let{as:t,className:n,...r}=e,i=l.useContext(Gq),a=t??Jq(i);return(0,q.jsx)(a,{className:G(oJ.root,n),"data-component":`NavigationMenu.GroupHeading`,...r})}sJ.displayName=`NavigationMenu.GroupHeading`;const cJ={root:`navigation-menu-group`},lJ={groupHeading:sJ};function uJ(e){let{title:t,children:n,className:r,hideDivider:i=!1,...a}=e,o=Y(),[s,c]=xr(n,lJ),u=s.groupHeading??(t?(0,q.jsx)(sJ,{children:t}):null),d=u?u.props.id??o:void 0;return(0,q.jsxs)(q.Fragment,{children:[i?null:(0,q.jsx)(aJ,{}),(0,q.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:G(cJ.root,r),"data-component":`NavigationMenu.Group`,...a,children:[u?l.cloneElement(u,{id:d}):null,c]})]})}uJ.displayName=`NavigationMenu.Group`;const dJ={root:`navigation-menu-item`};function fJ(e,t){let{children:n,className:r,value:i,onPointerEnter:a,onPointerLeave:o,...s}=e,c=Y(),u=i??c,d=Y(),f=Y(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=l.useContext(Hq),_=p===u,v=e=>{a?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=l.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,q.jsx)(Uq.Provider,{value:b,children:(0,q.jsx)(`li`,{ref:t,className:G(dJ.root,r),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...s,onPointerEnter:v,onPointerLeave:y,children:n})})}fJ.displayName=`NavigationMenu.Item`;var pJ=l.forwardRef(fJ);const mJ={root:`navigation-menu-visual`},hJ=({className:e,...t})=>(0,q.jsx)(`span`,{className:G(mJ.root,e),...t});function gJ(e){return(0,q.jsx)(hJ,{"data-component":`NavigationMenu.LeadingVisual`,...e})}gJ.displayName=`NavigationMenu.LeadingVisual`;const _J={root:`navigation-menu-sub-navigation`};function vJ(e,t){let{className:n,children:r,...i}=e,{linkId:a}=l.useContext(Wq),{depth:o}=l.useContext(Kq),s=l.useMemo(()=>({depth:o+1}),[o]);return!a||o>=4?null:(0,q.jsx)(Kq.Provider,{value:s,children:(0,q.jsx)(`ul`,{ref:t,"aria-labelledby":a,className:G(_J.root,n),"data-component":`NavigationMenu.SubNavigation`,"data-depth":o+1,...i,children:r})})}vJ.displayName=`NavigationMenu.SubNavigation`;var yJ=K(vJ);const bJ={root:`navigation-menu-visual-trailing`};function xJ(e){let{className:t,...n}=e;return(0,q.jsx)(hJ,{className:G(bJ.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}xJ.displayName=`NavigationMenu.TrailingVisual`;const SJ={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},CJ={leadingVisual:gJ,trailingVisual:xJ,description:rJ,subNavigation:yJ};function wJ(e,t){let{as:n=`a`,id:r,className:i,active:a,children:o,onClick:s,...c}=e,{setOpenValue:u}=l.useContext(Hq),{depth:d}=l.useContext(Kq),f=Y(r),p=Y(),[m,h]=xr(o,CJ),g=l.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{s?.(e),!e.defaultPrevented&&u(null)},v=(0,q.jsxs)(n,{ref:t,id:f,"aria-current":a?`page`:void 0,"aria-describedby":m.description?p:void 0,className:G(SJ.root,a&&SJ.active,i),"data-component":`NavigationMenu.Link`,"data-active":a?``:void 0,"data-has-description":m.description?``:void 0,...c,onClick:_,children:[m.leadingVisual,(0,q.jsxs)(`span`,{className:SJ.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,q.jsxs)(Wq.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,q.jsx)(`li`,{className:SJ.item,children:y})}wJ.displayName=`NavigationMenu.Link`;var TJ=K(wJ);const EJ={root:`navigation-menu-list`},DJ=(e,t)=>Array.from(e.querySelectorAll(`[data-component='NavigationMenu.Trigger'], [data-component='NavigationMenu.Link']`)).filter(e=>{let n=e.closest(`[data-component='NavigationMenu.Content']`);return n&&(t===`horizontal`||n.hasAttribute(`hidden`))?!1:!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`});function OJ(e,t){let{children:n,className:r,onKeyDown:i,...a}=e,{orientation:o,openValue:s,setOpenValue:c}=l.useContext(Hq),u=l.useRef(null),d=ar(t,u),f=e=>{i?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=o===`vertical`,r=n?`ArrowDown`:`ArrowRight`,a=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(s===null||!(n instanceof HTMLElement)||!t.contains(n))return;e.preventDefault(),e.stopPropagation(),n.closest(`[data-component='NavigationMenu.Content']`)?.closest(`li`)?.querySelector(`[data-component='NavigationMenu.Trigger']`)?.focus(),c(null);return}let l=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===a?-1:0;if(d===0&&!l)return;let f=DJ(t,o),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&s!==null&&c(null),l){f[e.key===`Home`?0:f.length-1].focus();return}f[(p+d+f.length)%f.length].focus()}};return(0,q.jsx)(`ul`,{ref:d,className:G(EJ.root,r),"data-component":`NavigationMenu.List`,"data-orientation":o,...a,onKeyDown:f,children:n})}OJ.displayName=`NavigationMenu.List`;var kJ=l.forwardRef(OJ);const AJ={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function jJ(e,t){let{children:n,className:r,onClick:i,onKeyDown:a,...o}=e,{setOpenValue:s,orientation:c}=l.useContext(Hq),{value:u,triggerId:d,contentId:f,isOpen:p}=l.useContext(Uq),m=l.useRef(!1);if(rr(()=>{!p||!m.current||(m.current=!1,mr(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{i?.(e),!e.defaultPrevented&&s(p?null:u)},g=e=>{if(a?.(e),e.defaultPrevented)return;let t=c===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,s(u);return}mr(document.getElementById(f))[0]?.focus()}};return(0,q.jsxs)(`button`,{ref:t,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:G(AJ.root,r),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...o,onClick:h,onKeyDown:g,children:[n,(0,q.jsx)(Qt,{className:AJ.chevron})]})}jJ.displayName=`NavigationMenu.Trigger`;var MJ=l.forwardRef(jJ);const NJ=Object.assign(Qq,{Heading:Vq,List:kJ,Item:pJ,Trigger:MJ,Content:tJ,Link:TJ,SubNavigation:yJ,Group:uJ,GroupHeading:sJ,Description:rJ,LeadingVisual:gJ,TrailingVisual:xJ,Divider:aJ}),PJ={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},FJ=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,q.jsxs)(`span`,{className:PJ.stepper,"data-component":`NumberInput.Stepper`,children:[(0,q.jsx)(gi,{type:`button`,variant:`invisible`,size:`small`,icon:tn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:PJ.step,"data-component":`NumberInput.Increment`}),(0,q.jsx)(gi,{type:`button`,variant:`invisible`,size:`small`,icon:Qt,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:PJ.step,"data-component":`NumberInput.Decrement`})]});function IJ(e,t){let{className:n,value:r,defaultValue:i,min:a,max:o,step:s=1,disabled:c,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=e,g=l.useRef(null),_=ar(t,g),v=r!==void 0,[y,b]=l.useState(i??null),x=v?r:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(RK(e.target),e)},w=e=>{let t=LK(x,e,{step:s,min:a,max:o});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&o!==void 0&&x>=o,E=x!=null&&a!==void 0&&x<=a,D=!!c||!!u;return(0,q.jsx)(qo,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:i,min:a,max:o,step:s,disabled:c,readOnly:u,onChange:C,className:G(PJ.root,n),trailingAction:d?void 0:(0,q.jsx)(FJ,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}IJ.displayName=`NumberInput`;var LJ=K(IJ);const RJ={current:null},zJ=(0,l.createContext)({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:RJ,contentWrapperRef:RJ,sidebarRef:RJ,sidebarContentWrapperRef:RJ}),BJ={root:`page-layout-horizontal-divider`};function VJ(e,t){let{className:n,style:r,variant:i=`none`,position:a,...o}=e,{padding:s}=l.useContext(zJ);return(0,q.jsx)(`div`,{ref:t,className:G(BJ.root,n),style:{"--spacing-divider":`var(--page-layout-spacing-${s})`,...r},"data-component":`PageLayout.HorizontalDivider`,...Ui(`variant`,i),...Ui(`position`,a),...o})}VJ.displayName=`PageLayout.HorizontalDivider`;var HJ=K(VJ);const UJ={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function WJ(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(zJ);return(0,q.jsxs)(`footer`,{ref:t,className:G(UJ.root,UJ.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Footer`,...Ui(`hidden`,s),...c,children:[(0,q.jsx)(HJ,{variant:o,className:UJ.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,q.jsx)(`div`,{className:UJ.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i})]})}WJ.displayName=`PageLayout.Footer`;var GJ=K(WJ);const KJ={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function qJ(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(zJ);return(0,q.jsxs)(`header`,{ref:t,className:G(KJ.root,KJ.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Header`,...Ui(`hidden`,s),...c,children:[(0,q.jsx)(`div`,{className:KJ.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i}),(0,q.jsx)(HJ,{variant:o,className:KJ.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}qJ.displayName=`PageLayout.Header`;var JJ=K(qJ);const YJ=1280,XJ={small:256,medium:296,large:320},ZJ=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,QJ=e=>e===`small`||e===`medium`||e===`large`,$J=e=>QJ(e)?XJ[e]:ZJ(e)?parseInt(e.default,10):0,eY=()=>$n&&window.innerWidth>=1280?959:511,tY=e=>`Pane width ${e} pixels`,nY=(e,t,n=tY)=>{e&&(t.min!==void 0&&e.setAttribute(`aria-valuemin`,String(t.min)),t.max!==void 0&&e.setAttribute(`aria-valuemax`,String(t.max)),t.current!==void 0&&(e.setAttribute(`aria-valuenow`,String(t.current)),e.setAttribute(`aria-valuetext`,n(t.current))))},rY=({handle:e,pane:t,contentWrapper:n})=>{e?.style.setProperty(`--drag-handle-background-color`,`var(--background-color-accent-emphasis)`),e?.style.setProperty(`--drag-handle-opacity`,`1`),e?.style.setProperty(`--drag-handle-transition`,`none`),t?.setAttribute(`data-dragging`,`true`),n?.setAttribute(`data-dragging`,`true`)},iY=({handle:e,pane:t,contentWrapper:n})=>{e?.style.removeProperty(`--drag-handle-background-color`),e?.style.removeProperty(`--drag-handle-opacity`),e?.style.removeProperty(`--drag-handle-transition`),t?.removeAttribute(`data-dragging`),n?.removeAttribute(`data-dragging`)},aY={save:(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},get:e=>{try{let t=localStorage.getItem(e);if(t!==null){let e=Number(t);if(!Number.isNaN(e)&&e>0)return Math.round(e)}}catch{}return null}},oY={root:`page-layout-drag-handle`},sY=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,cY=e=>e===`ArrowLeft`||e===`ArrowDown`;function lY(e){let{className:t,handleRef:n,onDragStart:r,onDrag:i,onDragEnd:a,onDoubleClick:o,"aria-label":s,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=tY}=e,g=l.useRef({onDragStart:r,onDrag:i,onDragEnd:a});l.useEffect(()=>{g.current={onDragStart:r,onDrag:i,onDragEnd:a}});let _=l.useRef(!1),v=l.useRef(null),y=l.useRef(null),b=l.useCallback(()=>{_.current||=(rY({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[n,p,m]),x=l.useCallback(()=>{_.current&&=(iY({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[n,p,m]);return l.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,q.jsx)(`div`,{ref:n,role:`slider`,tabIndex:0,"aria-label":c?void 0:s??`Draggable pane splitter`,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:G(oY.root,t),onPointerDown:e=>{if(e.button===0){e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}g.current.onDragStart(e.clientX),b()}},onPointerMove:e=>{_.current&&(e.preventDefault(),y.current=e.clientX,v.current===null&&(v.current=requestAnimationFrame(()=>{v.current=null,y.current!==null&&(g.current.onDrag(y.current,!1),y.current=null)})))},onPointerUp:e=>{_.current&&e.preventDefault()},onLostPointerCapture:()=>{_.current&&(v.current!==null&&(cancelAnimationFrame(v.current),v.current=null,y.current=null),x(),g.current.onDragEnd())},onKeyDown:e=>{sY(e.key)&&(e.preventDefault(),b(),g.current.onDrag(cY(e.key)?-3:3,!0))},onKeyUp:e=>{sY(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:o,"data-component":`PageLayout.DragHandle`})}lY.displayName=`PageLayout.DragHandle`;const uY={root:`page-layout-vertical-divider`};function dY(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,q.jsx)(`div`,{ref:t,className:G(uY.root,n),"data-component":`PageLayout.VerticalDivider`,...Ui(`variant`,r),...Ui(`position`,i),...a})}dY.displayName=`PageLayout.VerticalDivider`;var fY=K(dY);const pY=({width:e,minWidth:t,resizable:n,widthStorageKey:r,paneRef:i,handleRef:a,contentWrapperRef:o,constrainToViewport:s=!1,onResizeEnd:c,currentWidth:u,formatValueText:d})=>{let f=ZJ(e),p=f?parseInt(e.min,10):t,m=f?parseInt(e.max,10):null,h=l.useMemo(()=>$J(e),[e]),g=l.useRef(r),_=l.useRef(c),v=l.useRef(d);rr(()=>{g.current=r,_.current=c,v.current=d});let y=l.useRef(s?256:511),b=l.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:s?Math.min(m,t):m},[m,p,s]),[x,S]=l.useState(()=>typeof u==`number`?u:c===void 0&&n===!0&&r!==void 0?aY.get(r)??h:h),[C,w]=l.useState(h),[T,E]=l.useState(u),D=u!==T;D&&(E(u),typeof u==`number`?S(u):T!==void 0&&S(h)),h!==C&&(w(h),u===void 0&&!D&&S(h));let O=u??x,k=l.useRef(O),[A,j]=l.useState(()=>m??600),M=l.useRef(A);rr(()=>{k.current=O},[O]);let N=l.useCallback(()=>$J(e),[e]),P=l.useCallback(e=>{let t=Math.round(e);if(k.current=t,l.startTransition(()=>{S(t)}),_.current){try{_.current(t)}catch{}return}n&&g.current&&aY.save(g.current,t)},[n]),F=l.useRef(b);return rr(()=>{F.current=b}),rr(()=>{if(!n)return;let e=window.innerWidth,t=()=>{let t=window.innerWidth,n=e<YJ!=t<YJ;e=t,n&&(y.current=eY());let r=F.current();i.current?.style.setProperty(`--pane-max-width`,`${r}px`);let o=k.current>r;o&&(k.current=r,i.current?.style.setProperty(`--pane-width`,`${r}px`)),nY(a.current,{max:r,current:k.current},v.current),(r!==M.current||o)&&(M.current=r,l.startTransition(()=>{j(r),o&&S(r)}))};y.current=eY();let r=F.current();if(M.current=r,i.current?.style.setProperty(`--pane-max-width`,`${r}px`),nY(a.current,{min:p,max:r,current:k.current},v.current),l.startTransition(()=>{j(r)}),m!==null&&!s)return;let c=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,i.current?.setAttribute(`data-dragging`,`true`),o?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,i.current?.removeAttribute(`data-dragging`),o?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-c>=16?(c=e,t()):u===null&&(u=requestAnimationFrame(()=>{u=null,c=performance.now(),t()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[n,m,s,p,i,a,o]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},mY={wrapper:`page-layout-sidebar-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-sidebar-position`,sticky:`page-layout-sidebar-sticky`,fullscreen:`page-layout-sidebar-fullscreen`,sidebar:`page-layout-sidebar`,sidebarResizable:`page-layout-sidebar-resizable`,dragging:`page-layout-dragging`,sidebarFullscreen:`page-layout-sidebar-fullscreen-inner`,divider:`page-layout-sidebar-divider`};function hY(e,t){let{className:n,style:r,children:i,id:a,position:o=`start`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,responsiveVariant:_=`default`,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=l.useContext(zJ),T=l.useRef(null),E=l.useRef(0),D=l.useRef(0),O=l.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=pY({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=ar(t,C),L=Tp(C),ee=Y(a),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},z=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},te=(0,q.jsx)(fY,{variant:h?`line`:m,position:o,className:mY.divider,children:h?(0,q.jsx)(lY,{handleRef:T,dragTargetRef:C,contentWrapperRef:w,"aria-valuemin":j,"aria-valuemax":M,"aria-valuenow":k,onDragStart:e=>{E.current=e,D.current=C.current?.getBoundingClientRect().width??A.current,O.current=N()},onDrag:(e,t)=>{let n=t?N():O.current;if(t){let t=o===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(z(r),nY(T.current,{current:r,max:n}));return}if(!C.current)return;let r=e-E.current,i=Math.max(j,Math.min(n,D.current+(o===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(z(i),nY(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();z(e),nY(T.current,{current:e}),F(e)}}):null});return(0,q.jsxs)(`div`,{className:G(mY.wrapper,mY.hidden,mY.position,mY.sticky,mY.fullscreen,n),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...r},"data-position":o,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...Ui(`is-hidden`,v),children:[o===`end`?te:null,(0,q.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:G(mY.sidebar,mY.sidebarResizable,mY.sidebarFullscreen,mY.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":ZJ(s)?s.min:`${c}px`,"--pane-max-width":ZJ(s)?s.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":ZJ(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${QJ(s)?s:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...a?{id:ee}:{},...x,children:i}),o===`start`?te:null]})}hY.displayName=`PageLayout.Sidebar`;var gY=K(hY);const _Y={content:`page-layout-content-row`},vY=W(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),yY=W(`page-layout-wrapper`,{variants:{width:{full:`page-layout-width-full`,medium:`page-layout-width-medium`,large:`page-layout-width-large`,xlarge:`page-layout-width-xlarge`}}});function bY(e,t){let{className:n,style:r,children:i,containerWidth:a=`xlarge`,padding:o=`normal`,rowGap:s=`normal`,columnGap:c=`normal`,...u}=e,d=l.useRef(null),f=l.useRef(null),p=l.useRef(null),m=l.useRef(null),[h,g]=xr(i,{header:JJ,footer:GJ,sidebar:gY}),_=l.useMemo(()=>({padding:o,rowGap:s,columnGap:c,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[o,s,c]);return(0,q.jsx)(zJ.Provider,{value:_,children:(0,q.jsxs)(`div`,{ref:t,className:G(vY({hasSidebar:!!h.sidebar}),n),style:{"--spacing":`var(--page-layout-spacing-${o})`,...r},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,q.jsxs)(`div`,{ref:m,className:G(yY({width:a})),"data-page-layout-wrapper":``,"data-width":a,children:[h.header,(0,q.jsx)(`div`,{className:_Y.content,children:g}),h.footer]})]})})}bY.displayName=`PageLayout`;var xY=K(bY);const SY={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},CY=W(`page-layout-content`,{variants:{width:{full:`page-layout-content-width-full`,medium:`page-layout-content-width-medium`,large:`page-layout-content-width-large`,xlarge:`page-layout-content-width-xlarge`}}});function wY(e,t){let{as:n=`main`,className:r,children:i,width:a=`full`,padding:o=`none`,hidden:s=!1,...c}=e,{contentWrapperRef:u}=l.useContext(zJ),d=ar(t,u);return(0,q.jsx)(n,{ref:d,className:G(SY.wrapper,SY.hidden,SY.dragging,r),"data-component":`PageLayout.Content`,...Ui(`is-hidden`,s),...c,children:(0,q.jsx)(`div`,{className:G(CY({width:a})),"data-width":a,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:i})})}wY.displayName=`PageLayout.Content`;var TY=K(wY);const EY={wrapper:`page-layout-pane-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-pane-position`,sticky:`page-layout-pane-sticky`,pane:`page-layout-pane`,paneResizable:`page-layout-pane-resizable`,dragging:`page-layout-dragging`,horizontalDivider:`page-layout-pane-horizontal-divider`,verticalDivider:`page-layout-pane-vertical-divider`};function DY(e,t){let{className:n,style:r,children:i,id:a,position:o=`end`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f=`paneWidth`,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,offsetHeader:_=0,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,S=ls(o)?`end`:o,C=ls(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=l.useContext(zJ),O=l.useRef(null),k=l.useRef(0),A=l.useRef(0),j=l.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=pY({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=ar(t,E),z=Tp(E),te=Y(a),ne=z?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},B=e=>{E.current?.style.setProperty(`--pane-width`,`${e}px`),N.current=e};return(0,q.jsxs)(`div`,{className:G(EY.wrapper,EY.hidden,EY.position,EY.sticky,n),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...r},"data-sticky":g||void 0,...Ui(`is-hidden`,v),...Ui(`position`,o),children:[(0,q.jsx)(HJ,{variant:ls(m)?m:{narrow:C,regular:`none`},position:o,className:EY.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,q.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:G(EY.pane,EY.paneResizable,EY.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":ZJ(s)?s.min:`${c}px`,"--pane-max-width":ZJ(s)?s.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":ZJ(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${QJ(s)?s:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...a?{id:te}:{},...x,children:i}),(0,q.jsx)(fY,{variant:ls(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:o,className:EY.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,q.jsx)(lY,{handleRef:O,dragTargetRef:E,contentWrapperRef:D,"aria-valuemin":P,"aria-valuemax":F,"aria-valuenow":M,onDragStart:e=>{k.current=e,A.current=E.current?.getBoundingClientRect().width??N.current,j.current=I()},onDrag:(e,t)=>{let n=t?I():j.current;if(t){let t=Math.max(P,Math.min(n,N.current+e));t!==N.current&&(B(t),nY(O.current,{current:t,max:n}));return}if(!E.current)return;let r=e-k.current,i=Math.max(P,Math.min(n,A.current+(S===`end`?-r:r)));Math.round(i)!==Math.round(N.current)&&(B(i),nY(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();B(e),nY(O.current,{current:e}),ee(e)}}):null})]})}DY.displayName=`PageLayout.Pane`;var OY=K(DY);const kY=Object.assign(xY,{Header:JJ,Content:TY,Pane:OY,Sidebar:gY,Footer:GJ}),AY=[`narrow`,`regular`,`wide`],jY={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},MY=W(`pagination-step`,{variants:{step:{previous:`pagination-step-previous`,next:`pagination-step-next`},current:{true:`pagination-step-current`,false:``},inert:{true:`pagination-step-inert`,false:``}}}),NY=e=>typeof e==`object`?AY.filter(t=>e[t]===!1):e?[]:[...AY],PY=({page:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[e.type===`previous`?(0,q.jsx)($t,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,q.jsx)(en,{"data-component":`Pagination.NextPageIcon`}):null]}),FY=e=>`#${e}`;function IY(e,t){let{as:n=`nav`,className:r,pageCount:i,currentPage:a,onPageChange:o,hrefBuilder:s=FY,marginPageCount:c=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=e,m=l.useMemo(()=>e_(i,a,!!d,c,u),[i,a,d,c,u]),h=NY(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=t_(e,s,t=>o?.(t,e.num)),a=e.type===`previous`||e.type===`next`,c=!!r||!!i[`aria-hidden`],l=G(MY({step:a?e.type:void 0,current:e.selected,inert:c}));if(f&&!r)return f({key:t,children:(0,q.jsx)(PY,{page:e,children:n}),number:e.num,className:l,"data-component":`Pagination.Page`,...i});let u=r?`span`:`a`,d=a?e.type===`previous`?`Pagination.PreviousPage`:`Pagination.NextPage`:`Pagination.Page`;return(0,q.jsx)(u,{role:r?`presentation`:void 0,className:l,"data-component":d,...i,children:(0,q.jsx)(PY,{page:e,children:n})},t)});return(0,q.jsx)(n,{ref:t,"aria-label":`Pagination`,className:G(jY.root,r),"data-component":`Pagination`,...p,children:(0,q.jsx)(`div`,{className:G(jY.steps,h.map(e=>jY.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}IY.displayName=`Pagination`;var LY=K(IY);const RY={root:`password-input`,toggle:`password-input-toggle`};function zY(e,t){let{className:n,visible:r,defaultVisible:i=!1,onVisibilityChange:a,hideToggle:o=!1,showLabel:s=`Show password`,hideLabel:c=`Hide password`,disabled:u,...d}=e,f=r!==void 0,[p,m]=l.useState(i),h=f?r:p;return(0,q.jsx)(qo,{ref:t,type:h?`text`:`password`,disabled:u,className:G(RY.root,n),trailingAction:o?void 0:(0,q.jsx)(qo.Action,{icon:h?pn:mn,"aria-label":h?c:s,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),a?.(t)},className:RY.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}zY.displayName=`PasswordInput`;var BY=K(zY);const VY={root:`pin-input`},HY=W(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),UY={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},WY=(e,t)=>Array.from(e).filter(e=>UY[t].test(e)).join(``);function GY(e,t){let{className:n,length:r=6,value:i,defaultValue:a=``,type:o=`numeric`,mask:s=!1,size:c=`medium`,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m,autoComplete:h,boxLabel:g=`Digit`,onChange:_,onComplete:v,"aria-label":y,"aria-labelledby":b,...x}=e,S=l.useRef([]),C=i!==void 0,[w,T]=l.useState(()=>WY(a,o).slice(0,r)),E=C?i:w,D=Array.from({length:r},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=l.useRef(!1),A=e=>{let t=S.current[e];k.current=!0,t?.focus(),t?.select(),k.current=!1},j=e=>{C||T(e),_?.(e),e.length===r&&v?.(e)},M=(e,t)=>{let n=WY(t,o);if(n.length===0)return;let i=O===-1?e:Math.min(e,O),a=[...D],s=i;Array.from(n).forEach(e=>{s<r&&(a[s]=e,s+=1)}),j(a.join(``)),A(Math.min(s,r-1))},N=e=>{let t=[...D];t[e]=``,j(t.join(``))},P=e=>{if(k.current)return;let t=O===-1?e:Math.min(e,O);t!==e&&A(t)},F=(e,t)=>{if(t.target.value===``){N(e);return}M(e,t.target.value)},I=(e,t)=>{u||d||(t.preventDefault(),M(e,t.clipboardData.getData(`text`)))},L=(e,t)=>{if(!(u||d)){if(t.key===`Backspace`){if(t.preventDefault(),D[e]!==``){N(e);return}e>0&&(N(e-1),A(e-1));return}if(t.key===`Delete`){t.preventDefault(),N(e);return}if(t.key===`ArrowLeft`&&e>0){t.preventDefault(),A(e-1);return}if(t.key===`ArrowRight`&&e<r-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(r-1))}};return(0,q.jsx)(`div`,{ref:t,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:G(VY.root,n),"data-component":`PINInput`,"data-size":c,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,q.jsx)(qo,{ref:e=>{S.current[t]=e},type:s?`password`:`text`,inputMode:o===`numeric`?`numeric`:`text`,size:c,value:e,maxLength:1,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m&&t===0,autoComplete:t===0?h:`off`,"aria-label":`${g} ${t+1} of ${r}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:G(HY({size:c})),"data-component":`PINInput.Box`},t))})}GY.displayName=`PINInput`;var KY=K(GY);const qY={root:`placeholder`};function JY(e,t){let{as:n=`div`,className:r,width:i,height:a,label:o,style:s,children:c,...l}=e;return(0,q.jsx)(n,{ref:t,className:G(qY.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}JY.displayName=`Placeholder`;var YY=K(JY);const XY=(0,l.createContext)({}),ZY=W(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function QY(e,t){let{as:n=`div`,className:r,caret:i=`top`,open:a=!1,relative:o=!1,...s}=e,c={open:a,caret:i};return(0,q.jsx)(XY.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(ZY({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}QY.displayName=`Popover`;var $Y=K(QY);const eX=W(`popover-content`,{variants:{caret:{top:`popover-content-caret-top`,bottom:`popover-content-caret-bottom`,left:`popover-content-caret-left`,right:`popover-content-caret-right`,"top-left":`popover-content-caret-top-left`,"top-right":`popover-content-caret-top-right`,"bottom-left":`popover-content-caret-bottom-left`,"bottom-right":`popover-content-caret-bottom-right`,"left-top":`popover-content-caret-left-top`,"left-bottom":`popover-content-caret-left-bottom`,"right-top":`popover-content-caret-right-top`,"right-bottom":`popover-content-caret-right-bottom`},width:{xsmall:`popover-content-width-xsmall`,small:`popover-content-width-small`,medium:`popover-content-width-medium`,large:`popover-content-width-large`,xlarge:`popover-content-width-xlarge`,auto:`popover-content-width-auto`},height:{small:`popover-content-height-small`,medium:`popover-content-height-medium`,large:`popover-content-height-large`,xlarge:`popover-content-height-xlarge`,auto:`popover-content-height-auto`,"fit-content":`popover-content-height-fit-content`},overflow:{auto:`popover-content-overflow-auto`,hidden:`popover-content-overflow-hidden`,scroll:`popover-content-overflow-scroll`,visible:`popover-content-overflow-visible`}}}),tX=[];function nX(e,t){let{as:n=`div`,className:r,width:i=`small`,height:a=`fit-content`,overflow:o=`visible`,onClickOutside:s,onEscape:c,ignoreClickRefs:u=tX,...d}=e,{open:f=!1,caret:p=`top`}=l.useContext(XY),m=l.useRef(null),h=ar(t,m);return l.useEffect(()=>{if(!f||!s)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(m.current?.contains(t)||u.some(({current:e})=>e?.contains(t))||s(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,s,u]),Hi(e=>{!f||!c||(c(e),e.preventDefault())}),(0,q.jsx)(n,{ref:h,className:G(eX({caret:p,width:i,height:a,overflow:o}),r),"data-component":`Popover.Content`,"data-caret":p,"data-width":i,"data-height":a,"data-overflow":o,...d})}nX.displayName=`Popover.Content`;var rX=K(nX);const iX=Object.assign($Y,{Content:rX}),aX={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},oX=W(`progress-circle`,{variants:{size:{small:`progress-circle-small`,medium:`progress-circle-medium`,large:`progress-circle-large`},variant:{accent:`progress-circle-accent`,attention:`progress-circle-attention`,danger:`progress-circle-danger`,done:`progress-circle-done`,neutral:`progress-circle-neutral`,severe:`progress-circle-severe`,sponsors:`progress-circle-sponsors`,success:`progress-circle-success`}}});function sX(e,t){let{as:n=`span`,className:r,progress:i=0,size:a=`medium`,variant:o=`success`,style:s,children:c,"aria-valuenow":u,...d}=e,f=Math.min(Math.max(i,0),100),p=l.Children.toArray(c).length>0;return(0,q.jsxs)(n,{ref:t,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:G(oX({size:a,variant:o}),r),style:{...s,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":a,"data-variant":o,...d,children:[(0,q.jsxs)(`svg`,{className:aX.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:aX.track,cx:16,cy:16,r:14,pathLength:100}),(0,q.jsx)(`circle`,{className:aX.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,q.jsx)(`span`,{className:aX.label,children:c}):null]})}sX.displayName=`ProgressCircle`;var cX=K(sX);const lX={L:1,M:0,Q:3,H:2},uX={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},dX={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function fX(e,t){let n=dX[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const pX={L:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:19,ecCodewordsPerBlock:7,group1Blocks:1,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:34,group2Blocks:0,group2DataCW:0},{totalDataCodewords:55,ecCodewordsPerBlock:15,group1Blocks:1,group1DataCW:55,group2Blocks:0,group2DataCW:0},{totalDataCodewords:80,ecCodewordsPerBlock:20,group1Blocks:1,group1DataCW:80,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:108,group2Blocks:0,group2DataCW:0},{totalDataCodewords:136,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:0,group2DataCW:0},{totalDataCodewords:156,ecCodewordsPerBlock:20,group1Blocks:2,group1DataCW:78,group2Blocks:0,group2DataCW:0},{totalDataCodewords:194,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:97,group2Blocks:0,group2DataCW:0},{totalDataCodewords:232,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:116,group2Blocks:0,group2DataCW:0},{totalDataCodewords:274,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:2,group2DataCW:69},{totalDataCodewords:324,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:81,group2Blocks:0,group2DataCW:0},{totalDataCodewords:370,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:92,group2Blocks:2,group2DataCW:93},{totalDataCodewords:428,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:107,group2Blocks:0,group2DataCW:0},{totalDataCodewords:461,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:523,ecCodewordsPerBlock:22,group1Blocks:5,group1DataCW:87,group2Blocks:1,group2DataCW:88},{totalDataCodewords:589,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:98,group2Blocks:1,group2DataCW:99},{totalDataCodewords:647,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:721,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:120,group2Blocks:1,group2DataCW:121},{totalDataCodewords:795,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:113,group2Blocks:4,group2DataCW:114},{totalDataCodewords:861,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:932,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:116,group2Blocks:4,group2DataCW:117},{totalDataCodewords:1006,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:111,group2Blocks:7,group2DataCW:112},{totalDataCodewords:1094,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:121,group2Blocks:5,group2DataCW:122},{totalDataCodewords:1174,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:1276,ecCodewordsPerBlock:26,group1Blocks:8,group1DataCW:106,group2Blocks:4,group2DataCW:107},{totalDataCodewords:1370,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:114,group2Blocks:2,group2DataCW:115},{totalDataCodewords:1468,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:1531,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:117,group2Blocks:10,group2DataCW:118},{totalDataCodewords:1631,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:116,group2Blocks:7,group2DataCW:117},{totalDataCodewords:1735,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:115,group2Blocks:10,group2DataCW:116},{totalDataCodewords:1843,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:3,group2DataCW:116},{totalDataCodewords:1955,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:0,group2DataCW:0},{totalDataCodewords:2071,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:2191,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:6,group2DataCW:116},{totalDataCodewords:2306,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:121,group2Blocks:7,group2DataCW:122},{totalDataCodewords:2434,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:121,group2Blocks:14,group2DataCW:122},{totalDataCodewords:2566,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:2702,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:122,group2Blocks:18,group2DataCW:123},{totalDataCodewords:2812,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:2956,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:118,group2Blocks:6,group2DataCW:119}],M:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:28,ecCodewordsPerBlock:16,group1Blocks:1,group1DataCW:28,group2Blocks:0,group2DataCW:0},{totalDataCodewords:44,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:44,group2Blocks:0,group2DataCW:0},{totalDataCodewords:64,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:32,group2Blocks:0,group2DataCW:0},{totalDataCodewords:86,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:43,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:27,group2Blocks:0,group2DataCW:0},{totalDataCodewords:124,ecCodewordsPerBlock:18,group1Blocks:4,group1DataCW:31,group2Blocks:0,group2DataCW:0},{totalDataCodewords:154,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:38,group2Blocks:2,group2DataCW:39},{totalDataCodewords:182,ecCodewordsPerBlock:22,group1Blocks:3,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:216,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:43,group2Blocks:1,group2DataCW:44},{totalDataCodewords:254,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:50,group2Blocks:4,group2DataCW:51},{totalDataCodewords:290,ecCodewordsPerBlock:22,group1Blocks:6,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:334,ecCodewordsPerBlock:22,group1Blocks:8,group1DataCW:37,group2Blocks:1,group2DataCW:38},{totalDataCodewords:365,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:40,group2Blocks:5,group2DataCW:41},{totalDataCodewords:415,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:41,group2Blocks:5,group2DataCW:42},{totalDataCodewords:453,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:507,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:1,group2DataCW:47},{totalDataCodewords:563,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:43,group2Blocks:4,group2DataCW:44},{totalDataCodewords:627,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:44,group2Blocks:11,group2DataCW:45},{totalDataCodewords:669,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:41,group2Blocks:13,group2DataCW:42},{totalDataCodewords:714,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:42,group2Blocks:0,group2DataCW:0},{totalDataCodewords:782,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:46,group2Blocks:0,group2DataCW:0},{totalDataCodewords:860,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:47,group2Blocks:14,group2DataCW:48},{totalDataCodewords:914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:45,group2Blocks:14,group2DataCW:46},{totalDataCodewords:1e3,ecCodewordsPerBlock:28,group1Blocks:8,group1DataCW:47,group2Blocks:13,group2DataCW:48},{totalDataCodewords:1062,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:46,group2Blocks:4,group2DataCW:47},{totalDataCodewords:1128,ecCodewordsPerBlock:28,group1Blocks:22,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:1193,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:45,group2Blocks:23,group2DataCW:46},{totalDataCodewords:1267,ecCodewordsPerBlock:28,group1Blocks:21,group1DataCW:45,group2Blocks:7,group2DataCW:46},{totalDataCodewords:1373,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:47,group2Blocks:10,group2DataCW:48},{totalDataCodewords:1455,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:46,group2Blocks:29,group2DataCW:47},{totalDataCodewords:1541,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1631,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:21,group2DataCW:47},{totalDataCodewords:1725,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1812,ecCodewordsPerBlock:28,group1Blocks:12,group1DataCW:47,group2Blocks:26,group2DataCW:48},{totalDataCodewords:1914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:47,group2Blocks:34,group2DataCW:48},{totalDataCodewords:1992,ecCodewordsPerBlock:28,group1Blocks:29,group1DataCW:46,group2Blocks:14,group2DataCW:47},{totalDataCodewords:2102,ecCodewordsPerBlock:28,group1Blocks:13,group1DataCW:46,group2Blocks:32,group2DataCW:47},{totalDataCodewords:2216,ecCodewordsPerBlock:28,group1Blocks:40,group1DataCW:47,group2Blocks:7,group2DataCW:48},{totalDataCodewords:2334,ecCodewordsPerBlock:28,group1Blocks:18,group1DataCW:47,group2Blocks:31,group2DataCW:48}],Q:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:13,ecCodewordsPerBlock:13,group1Blocks:1,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:22,ecCodewordsPerBlock:22,group1Blocks:1,group1DataCW:22,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:17,group2Blocks:0,group2DataCW:0},{totalDataCodewords:48,ecCodewordsPerBlock:26,group1Blocks:2,group1DataCW:24,group2Blocks:0,group2DataCW:0},{totalDataCodewords:62,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:76,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:88,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:110,ecCodewordsPerBlock:22,group1Blocks:4,group1DataCW:18,group2Blocks:2,group2DataCW:19},{totalDataCodewords:132,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:154,ecCodewordsPerBlock:24,group1Blocks:6,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:180,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:22,group2Blocks:4,group2DataCW:23},{totalDataCodewords:206,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:20,group2Blocks:6,group2DataCW:21},{totalDataCodewords:244,ecCodewordsPerBlock:24,group1Blocks:8,group1DataCW:20,group2Blocks:4,group2DataCW:21},{totalDataCodewords:261,ecCodewordsPerBlock:20,group1Blocks:11,group1DataCW:16,group2Blocks:5,group2DataCW:17},{totalDataCodewords:295,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:325,ecCodewordsPerBlock:24,group1Blocks:15,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:367,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:22,group2Blocks:15,group2DataCW:23},{totalDataCodewords:397,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:1,group2DataCW:23},{totalDataCodewords:445,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:21,group2Blocks:4,group2DataCW:22},{totalDataCodewords:485,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:5,group2DataCW:25},{totalDataCodewords:512,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:568,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:614,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:664,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:718,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:754,ecCodewordsPerBlock:28,group1Blocks:28,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:808,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:23,group2Blocks:26,group2DataCW:24},{totalDataCodewords:871,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:24,group2Blocks:31,group2DataCW:25},{totalDataCodewords:911,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:23,group2Blocks:37,group2DataCW:24},{totalDataCodewords:985,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:25,group2DataCW:25},{totalDataCodewords:1033,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:24,group2Blocks:1,group2DataCW:25},{totalDataCodewords:1115,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:24,group2Blocks:35,group2DataCW:25},{totalDataCodewords:1171,ecCodewordsPerBlock:30,group1Blocks:29,group1DataCW:24,group2Blocks:19,group2DataCW:25},{totalDataCodewords:1231,ecCodewordsPerBlock:30,group1Blocks:44,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:1286,ecCodewordsPerBlock:30,group1Blocks:39,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1354,ecCodewordsPerBlock:30,group1Blocks:46,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1426,ecCodewordsPerBlock:30,group1Blocks:49,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1502,ecCodewordsPerBlock:30,group1Blocks:48,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1582,ecCodewordsPerBlock:30,group1Blocks:43,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:1666,ecCodewordsPerBlock:30,group1Blocks:34,group1DataCW:24,group2Blocks:34,group2DataCW:25}],H:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:9,ecCodewordsPerBlock:17,group1Blocks:1,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:26,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:36,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:46,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:11,group2Blocks:2,group2DataCW:12},{totalDataCodewords:60,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:15,group2Blocks:0,group2DataCW:0},{totalDataCodewords:66,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:13,group2Blocks:1,group2DataCW:14},{totalDataCodewords:86,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:14,group2Blocks:2,group2DataCW:15},{totalDataCodewords:100,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:12,group2Blocks:4,group2DataCW:13},{totalDataCodewords:122,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:140,ecCodewordsPerBlock:24,group1Blocks:3,group1DataCW:12,group2Blocks:8,group2DataCW:13},{totalDataCodewords:158,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:180,ecCodewordsPerBlock:22,group1Blocks:12,group1DataCW:11,group2Blocks:4,group2DataCW:12},{totalDataCodewords:197,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:5,group2DataCW:13},{totalDataCodewords:223,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:7,group2DataCW:13},{totalDataCodewords:253,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:283,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:17,group2DataCW:15},{totalDataCodewords:313,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:19,group2DataCW:15},{totalDataCodewords:341,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:13,group2Blocks:16,group2DataCW:14},{totalDataCodewords:385,ecCodewordsPerBlock:28,group1Blocks:15,group1DataCW:15,group2Blocks:10,group2DataCW:16},{totalDataCodewords:406,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:16,group2Blocks:6,group2DataCW:17},{totalDataCodewords:442,ecCodewordsPerBlock:24,group1Blocks:34,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:464,ecCodewordsPerBlock:30,group1Blocks:16,group1DataCW:15,group2Blocks:14,group2DataCW:16},{totalDataCodewords:514,ecCodewordsPerBlock:30,group1Blocks:30,group1DataCW:16,group2Blocks:2,group2DataCW:17},{totalDataCodewords:538,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:596,ecCodewordsPerBlock:30,group1Blocks:33,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:628,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:661,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:31,group2DataCW:16},{totalDataCodewords:701,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:26,group2DataCW:16},{totalDataCodewords:745,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:25,group2DataCW:16},{totalDataCodewords:793,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:845,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:35,group2DataCW:16},{totalDataCodewords:901,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:961,ecCodewordsPerBlock:30,group1Blocks:59,group1DataCW:16,group2Blocks:1,group2DataCW:17},{totalDataCodewords:986,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:41,group2DataCW:16},{totalDataCodewords:1054,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:15,group2Blocks:64,group2DataCW:16},{totalDataCodewords:1096,ecCodewordsPerBlock:30,group1Blocks:24,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:1142,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:15,group2Blocks:32,group2DataCW:16},{totalDataCodewords:1222,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:15,group2Blocks:67,group2DataCW:16},{totalDataCodewords:1276,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:15,group2Blocks:61,group2DataCW:16}]};function mX(e,t){return pX[t][e]}const hX=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],gX=[0,0,0,0,0,0,0,31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017];function _X(e){return/^\d+$/.test(e)}function vX(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function yX(e){return _X(e)?`numeric`:vX(e)?`alphanumeric`:`byte`}function bX(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function xX(e){let t=[],n=0;for(;n+2<e.length;)EX(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(EX(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&EX(t,Number.parseInt(e[n],10),4),t}function SX(e){let t=[],n=0;for(;n+1<e.length;)EX(t,bX(e[n])*45+bX(e[n+1]),11),n+=2;return n<e.length&&EX(t,bX(e[n]),6),t}function CX(e){let t=[];for(let n of e)EX(t,n,8);return t}function wX(e){let t=[];for(let n of e){let e;if(n>=33088&&n<=40956)e=n-33088;else if(n>=57408&&n<=60351)e=n-49472;else throw Error(`Invalid Shift JIS kanji value: 0x${n.toString(16)}`);let r=e>>8&255,i=e&255;EX(t,r*192+i,13)}return t}function TX(e){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=12288&&r<=40959){let e=33088+(r-12288);e<=40956?t.push(e):t.push(57408+(r-12288-7868))}else throw Error(`Character U+${r.toString(16)} cannot be encoded as Kanji`)}return t}function EX(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function DX(e,t){return mX(e,t).totalDataCodewords*8}function OX(e,t,n,r){let i=n===`auto`||!n?yX(e):n,a=new TextEncoder().encode(e);if(r){let n=DX(r,t);if(kX(e,a,i,r)>n)throw Error(`Data too long for QR version ${r} with EC level ${t}`);return r}for(let n=1;n<=40;n++){let r=DX(n,t);if(kX(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function kX(e,t,n,r){let i=fX(r,n),a;switch(n){case`numeric`:return a=Math.floor(e.length/3)*10+(e.length%3==2?7:e.length%3==1?4:0),4+i+a;case`alphanumeric`:return a=Math.floor(e.length/2)*11+(e.length%2==1?6:0),4+i+a;case`byte`:return 4+i+t.length*8;case`kanji`:return 4+i+e.length*13;default:return 4+i+t.length*8}}function AX(e,t){return t&&t!==`auto`?t:_X(e)?`numeric`:vX(e)?`alphanumeric`:`byte`}const jX=new Uint8Array(512),MX=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)jX[t]=e,MX[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)jX[e]=jX[e-255]})();function NX(e,t){return e===0||t===0?0:jX[(MX[e]+MX[t])%255]}function PX(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,jX[e]]),r=new Uint8Array(n.length+1);for(let e=0;e<n.length;e++)for(let i=0;i<t.length;i++)r[e+i]^=NX(n[e],t[i]);n=r}let r=Array.from({length:t},()=>0);for(let i of e){let e=i^r[0];for(let i=0;i<t-1;i++)r[i]=r[i+1]^NX(e,n[i+1]);r[t-1]=NX(e,n[t])}return r}function FX(e,t,n,r,i,a){let o=[],s=[],c=0;for(let i=0;i<n;i++){let n=e.slice(c,c+r);o.push(n),s.push(PX(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(PX(n,t)),c+=a}let l=[],u=Math.max(r,a);for(let e=0;e<u;e++)for(let t of o)e<t.length&&l.push(t[e]);for(let e=0;e<t;e++)for(let t of s)e<t.length&&l.push(t[e]);return l}function IX(e,t={}){let n=t.ecLevel??`M`,r=AX(e,t.mode),i=OX(e,n,r,t.version),a=mX(i,n),o=FX(RX(LX(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)EX(s,e,8);return{version:i,ecLevel:n,bits:s}}function LX(e,t,n,r){let i=[],a=fX(n,t),o=new TextEncoder().encode(e);switch(EX(i,uX[t],4),EX(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...xX(e));break;case`alphanumeric`:i.push(...SX(e));break;case`byte`:i.push(...CX(o));break;case`kanji`:{let t=TX(e);i.push(...wX(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&EX(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)EX(i,l?236:17,8),l=!l;return i}function RX(e){let t=[];for(let n=0;n<e.length;n+=8){let r=0;for(let t=0;t<8&&n+t<e.length;t++)r=r<<1|e[n+t];t.push(r)}return t}function zX(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function BX(e,t){let n=e.length;VX(e,0,0),VX(e,n-7,0),VX(e,0,n-7),UX(e,n),WX(e,t),e[4*t+9][8]=!0,KX(e,n),t>=7&&qX(e,n)}function VX(e,t,n){let r=e.length;for(let r=0;r<7;r++)for(let i=0;i<7;i++){let a=r===0||r===6||i===0||i===6,o=r>=2&&r<=4&&i>=2&&i<=4;e[t+r][n+i]=a||o}for(let i=-1;i<=7;i++)HX(e,t-1,n+i,!1,r),HX(e,t+7,n+i,!1,r),HX(e,t+i,n-1,!1,r),HX(e,t+i,n+7,!1,r)}function HX(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function UX(e,t){for(let n=8;n<t-8;n++)e[6][n]===null&&(e[6][n]=n%2==0),e[n][6]===null&&(e[n][6]=n%2==0)}function WX(e,t){if(t<2)return;let n=hX[t-1],r=n.length-1;for(let t=0;t<n.length;t++)for(let i=0;i<n.length;i++)(t!==0||i!==0)&&(t!==0||i!==r)&&(t!==r||i!==0)&&GX(e,n[t],n[i])}function GX(e,t,n){for(let r=-2;r<=2;r++)for(let i=-2;i<=2;i++){let a=Math.abs(r)===2||Math.abs(i)===2,o=r===0&&i===0;e[t+r][n+i]=a||o}}function KX(e,t){for(let n=0;n<=8;n++)n<t&&e[8][n]===null&&(e[8][n]=!1),n<t&&e[n][8]===null&&(e[n][8]=!1);for(let n=0;n<7;n++)e[t-1-n][8]===null&&(e[t-1-n][8]=!1);for(let n=0;n<8;n++)e[8][t-1-n]===null&&(e[8][t-1-n]=!1)}function qX(e,t){for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[t-11+r][n]===null&&(e[t-11+r][n]=!1);for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[n][t-11+r]===null&&(e[n][t-11+r]=!1)}function JX(e,t,n){let r=e.length,i=0,a=!0;for(let n=r-1;n>=1;n-=2){n===6&&(n=5);let o=a?Array.from({length:r},(e,t)=>r-1-t):Array.from({length:r},(e,t)=>t);for(let r of o)for(let a of[n,n-1])e[r][a]===null&&(e[r][a]=i<t.length&&t[i]===1,i++);a=!a}}function YX(e,t,n,r){if(e<9&&t<9||e<9&&t>=n-8||e>=n-8&&t<9||e===6||t===6)return!1;if(r>=2){let i=hX[r-1];for(let r of i)for(let a of i)if(!(r<9&&a<9)&&!(r<9&&a>=n-8)&&!(r>=n-8&&a<9)&&e>=r-2&&e<=r+2&&t>=a-2&&t<=a+2)return!1}return!(r>=7&&(e<6&&t>=n-11&&t<=n-9||t<6&&e>=n-11&&e<=n-9)||e===8||t===8||e>=n-8&&t===8||e===8&&t>=n-8)}function XX(e){switch(e){case 0:return(e,t)=>(e+t)%2==0;case 1:return e=>e%2==0;case 2:return(e,t)=>t%3==0;case 3:return(e,t)=>(e+t)%3==0;case 4:return(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0;case 5:return(e,t)=>e*t%2+e*t%3==0;case 6:return(e,t)=>(e*t%2+e*t%3)%2==0;case 7:return(e,t)=>((e+t)%2+e*t%3)%2==0;default:return()=>!1}}function ZX(e,t,n,r){let i=XX(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)YX(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function QX(e,t,n,r){if(r!==void 0&&r>=0&&r<=7)return r;let i=0,a=1/0;for(let r=0;r<8;r++){let o=e.map(e=>[...e]);ZX(o,r,t,n);let s=$X(o,t);s<a&&(a=s,i=r)}return i}function $X(e,t){return eZ(e,t)+tZ(e,t)+nZ(e,t)+rZ(e,t)}function eZ(e,t){let n=0;for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[r][a]==!!e[r][a-1]?(i++,i===5?n+=3:i>5&&n++):i=1}for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[a][r]==!!e[a-1][r]?(i++,i===5?n+=3:i>5&&n++):i=1}return n}function tZ(e,t){let n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=!!e[r][i];t===!!e[r][i+1]&&t===!!e[r+1][i]&&t===!!e[r+1][i+1]&&(n+=3)}return n}function nZ(e,t){let n=0,r=[!0,!1,!0,!0,!0,!1,!0,!1,!1,!1,!1],i=[!1,!1,!1,!1,!0,!1,!0,!0,!0,!1,!0];for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[a][o+n]!==r[n]&&(t=!1),!!e[a][o+n]!==i[n]&&(s=!1);(t||s)&&(n+=40)}for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[o+n][a]!==r[n]&&(t=!1),!!e[o+n][a]!==i[n]&&(s=!1);(t||s)&&(n+=40)}return n}function rZ(e,t){let n=0,r=t*t;for(let r=0;r<t;r++)for(let i=0;i<t;i++)e[r][i]&&n++;let i=n/r,a=Math.floor(i*20)*5,o=Math.ceil(i*20)*5;return Math.min(Math.abs(a-50),Math.abs(o-50))*2}function iZ(e,t){let n=lX[e]<<3|t,r=n<<10;for(let e=4;e>=0;e--)r&1<<e+10&&(r^=1335<<e);return(n<<10|r)^21522}function aZ(e,t,n){let r=e.length,i=iZ(t,n),a=[[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,7],[8,8],[7,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8]];for(let t=0;t<15;t++){let n=(i>>14-t&1)==1,[r,o]=a[t];e[r][o]=n}for(let t=0;t<7;t++){let n=(i>>14-t&1)==1;e[r-1-t][8]=n}for(let t=0;t<8;t++){let n=(i>>7-t&1)==1;e[8][r-8+t]=n}}function oZ(e,t){if(t<7)return;let n=e.length,r=gX[t];for(let t=0;t<18;t++){let i=(r>>t&1)==1,a=Math.floor(t/3),o=t%3;e[n-11+o][a]=i,e[a][n-11+o]=i}}var sZ=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},cZ=class extends sZ{constructor(...e){super(...e),this.name=`InvalidInputError`}};function lZ(e,t={}){let{version:n,ecLevel:r,bits:i}=IX(e,t),a=n*4+17,o=zX(a);BX(o,n),JX(o,i,n);let s=QX(o,a,n,t.mask);return ZX(o,s,a,n),aZ(o,r,s),n>=7&&oZ(o,n),o.map(e=>e.map(e=>e===!0))}function uZ(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}const dZ=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function fZ(e){let t=4294967295;for(let n=0;n<e.length;n++)t=dZ[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function pZ(e){let t=1,n=0;for(let r=0;r<e.length;r++)t=(t+e[r])%65521,n=(n+t)%65521;return(n<<16|t)>>>0}function mZ(e){let t=65535,n=Math.ceil(e.length/t)||1,r=new Uint8Array(n*5+e.length),i=0,a=0;for(;a<e.length||i===0;){let n=e.length-a,o=Math.min(n,t),s=a+o>=e.length;r[i++]=+!!s,r[i++]=o&255,r[i++]=o>>8&255,r[i++]=~o&255,r[i++]=~o>>8&255,r.set(e.subarray(a,a+o),i),i+=o,a+=o}return r.subarray(0,i)}function hZ(e){let t=mZ(e),n=pZ(e),r=new Uint8Array(2+t.length+4);r[0]=120,r[1]=1,r.set(t,2);let i=2+t.length;return r[i]=n>>24&255,r[i+1]=n>>16&255,r[i+2]=n>>8&255,r[i+3]=n&255,r}const gZ=new Uint8Array([137,80,78,71,13,10,26,10]);function _Z(e,t){let n=new Uint8Array([e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]),r=new Uint8Array(8+t.length+4),i=new DataView(r.buffer);i.setUint32(0,t.length),r.set(n,4),r.set(t,8);let a=new Uint8Array(4+t.length);return a.set(n,0),a.set(t,4),i.setUint32(8+t.length,fZ(a)),r}function vZ(e,t,n){let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,e),i.setUint32(4,t),r[8]=8,r[9]=6,r[10]=0,r[11]=0,r[12]=0;let a=e*4,o=t*(1+a),s=new Uint8Array(o),c=0;for(let e=0;e<t;e++)s[c++]=0,s.set(n.subarray(e*a,e*a+a),c),c+=a;let l=hZ(s),u=_Z(`IHDR`,r),d=_Z(`IDAT`,l),f=_Z(`IEND`,new Uint8Array),p=gZ.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(gZ,h),h+=gZ.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function yZ(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint16(0,!0),r=t.getUint16(2,!0),i=t.getUint16(4,!0);if(n!==0||r!==1&&r!==2||i===0)throw Error(`Invalid ICO file`);let a;for(let e=0;e<i;e++){let n=6+e*16,r=t.getUint8(n)||256,i=t.getUint8(n+1)||256,o=t.getUint32(n+8,!0),s=t.getUint32(n+12,!0);(!a||r*i>a.width*a.height)&&(a={width:r,height:i,size:o,offset:s})}let o=a,s=e.subarray(o.offset,o.offset+o.size);return s.length>=4&&t.getUint32(o.offset)===2303741511?`data:image/png;base64,${DZ(s)}`:bZ(s,o.width,o.height)}function bZ(e,t,n){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0),a=r.getInt32(4,!0)||t,o=n,s=r.getUint16(14,!0),c=r.getUint32(16,!0);if(c!==0&&c!==3)throw Error(`Unsupported BMP compression: ${c}`);let l=new Uint8Array(a*o*4);if(s===32)xZ(e,i,a,o,l);else if(s===24)SZ(e,i,a,o,l);else if(s<=8)CZ(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=TZ(a,o,s),n=i+wZ(e,i,s)+t;n<e.length&&EZ(e,n,a,o,l)}return`data:image/png;base64,${DZ(vZ(a,o,l))}`}function xZ(e,t,n,r,i){let a=t,o=n*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*4,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=e[n+3]}}}function SZ(e,t,n,r,i){let a=t+wZ(e,t,24),o=Math.ceil(n*3/4)*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*3,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=255}}}function CZ(e,t,n,r,i,a){let o=wZ(e,t,i),s=e.subarray(t,t+o),c=t+o,l=Math.ceil(n*i/32)*4;for(let t=0;t<r;t++){let o=c+(r-1-t)*l,u=t*n*4;for(let t=0;t<n;t++){let n;if(i===8)n=e[o+t];else if(i===4){let r=e[o+(t>>1)];n=t&1?r&15:r>>4&15}else n=e[o+(t>>3)]>>7-(t&7)&1;let r=n*4,c=u+t*4;a[c]=s[r+2],a[c+1]=s[r+1],a[c+2]=s[r],a[c+3]=255}}}function wZ(e,t,n){if(n>=16)return 0;let r=new DataView(e.buffer,e.byteOffset,e.byteLength);return((t>=36?r.getUint32(32,!0):0)||1<<n)*4}function TZ(e,t,n){return Math.ceil(e*n/32)*4*t}function EZ(e,t,n,r,i){let a=Math.ceil(n/32)*4;for(let o=0;o<r;o++){let s=t+(r-1-o)*a,c=o*n*4;for(let t=0;t<n;t++){let n=s+(t>>3);if(n>=e.length)return;(e[n]>>7-(t&7)&1)==1&&(i[c+t*4+3]=0)}}}function DZ(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const OZ=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function kZ(e,t,n,r){let i=e.size??.3,a=e.margin??0,o=e.hideBackgroundDots??!0,s=t*n,c=s*i,l=r*n+(s-c)/2,u=r*n+(s-c)/2,d=new Set;if(o){let e=Math.floor((t-t*i)/2-a/n),r=Math.ceil((t+t*i)/2+a/n);for(let n=Math.max(0,e);n<Math.min(t,r);n++)for(let i=Math.max(0,e);i<Math.min(t,r);i++)d.add(`${n},${i}`)}let f=``;if(e.backgroundColor){let t=a,n=c+2*t,r=`x="${l-t}" y="${u-t}"`,i=`fill="${uZ(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(OZ.test(e.svg))throw new cZ(`logo.svg contains potentially dangerous content (script, event handlers, or foreignObject)`);let t=`x="${l}" y="${u}"`,n=`width="${c}" height="${c}"`;f+=`<svg ${t} ${n} viewBox="0 0 1 1">`,f+=`<g transform="scale(1)">${e.svg}</g></svg>`}else if(e.path){let t=uZ(e.path),n=`translate(${l},${u}) scale(${c/100})`;f+=`<path d="${t}" transform="${n}" fill="currentColor"/>`}else if(e.imageUrl){if(!/^(https?:|data:image\/)/i.test(e.imageUrl))throw new cZ(`imageUrl must use https:, http:, or data:image/ scheme`);let t=e.imageUrl.match(/^data:image\/(x-icon|vnd\.microsoft\.icon);base64,(.+)$/i),n=e.imageUrl;if(t){let e=atob(t[2]),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);n=yZ(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${uZ(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function AZ(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return jZ(e+o,t+o,a);case`rounded`:return MZ(e+o,t+o,a,a*.25);case`dots`:return NZ(e+n/2,t+n/2,a/2);case`diamond`:return PZ(e+n/2,t+n/2,a);case`classy`:return FZ(e+o,t+o,a);case`classy-rounded`:return IZ(e+o,t+o,a);case`extra-rounded`:return MZ(e+o,t+o,a,a*.5);case`vertical-line`:return LZ(e+o,t,n,a);case`horizontal-line`:return RZ(e,t+o,n,a);case`small-square`:return jZ(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return jZ(e+n*.25,t+n*.25,n*.5);default:return jZ(e+o,t+o,a)}}function jZ(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function MZ(e,t,n,r){return r=Math.min(r,n/2),`M${e+r},${t}h${n-2*r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-2*r}a${r},${r},0,0,1,-${r},-${r}v-${n-2*r}a${r},${r},0,0,1,${r},-${r}z`}function NZ(e,t,n){return`M${e-n},${t}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,-${2*n},0z`}function PZ(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function FZ(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-r}h-${n}v-${n}z`}function IZ(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-r}v-${n}z`}function LZ(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function RZ(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function zZ(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return VZ(e,t,i,i,r)+HZ(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return NZ(e+r,t+r,r)+NZ(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return VZ(e,t,i,i,r)+HZ(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return VZ(e,t,i,i,r)+HZ(e+n,t+n,i-2*n,i-2*n,r*.5)}default:{let r=i-2*n;return`M${e},${t}h${i}v${i}h-${i}zM${e+n},${t+n}v${r}h${r}v-${r}z`}}}function BZ(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return NZ(a,o,i/2);case`rounded`:return MZ(e+n*2,t+n*2,i,n*.75);default:return jZ(e+n*2,t+n*2,i)}}function VZ(e,t,n,r,i){return`M${e+i},${t}h${n-2*i}a${i},${i},0,0,1,${i},${i}v${r-2*i}a${i},${i},0,0,1,-${i},${i}h-${n-2*i}a${i},${i},0,0,1,-${i},-${i}v-${r-2*i}a${i},${i},0,0,1,${i},-${i}z`}function HZ(e,t,n,r,i){return VZ(e,t,n,r,i)}const UZ={root:`qr-code`,canvas:`qr-code-canvas`,background:`qr-code-background`,modules:`qr-code-modules`,corner:`qr-code-corner`,logo:`qr-code-logo`,fallback:`qr-code-fallback`},WZ=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function GZ(e,t){let{value:n,size:r=200,margin:i=4,ecLevel:a,version:o,mode:s,mask:c,dotType:u=`square`,dotSize:d=1,corners:f,color:p,background:m,logo:h,logoSize:g=.3,label:_,fallback:v=null,className:y,style:b,...x}=e,S=a??(h?`H`:void 0),C=l.useMemo(()=>{if(!n)return null;try{return lZ(n,{ecLevel:S,version:o,mode:s,mask:c})}catch{return null}},[n,S,o,s,c]);if(!C)return(0,q.jsx)(`div`,{ref:t,className:G(UZ.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,q.jsx)(`span`,{className:UZ.fallback,children:v}):null});let w=C.length,T=w+i*2,E=r/T,D=h?kZ({size:g},w,E,i).hiddenModules:void 0,O=WZ(w),k=new Set;if(f)for(let e of O)for(let t=0;t<7;t++)for(let n=0;n<7;n++)k.add(`${e.row+t},${e.col+n}`);let A=[];for(let e=0;e<w;e++)for(let t=0;t<w;t++){if(!C[e][t])continue;let n=`${e},${t}`;D?.has(n)||k.has(n)||A.push(AZ((t+i)*E,(e+i)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+i)*E,a=(t+i)*E;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{className:UZ.corner,d:zZ(r,a,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,q.jsx)(`path`,{className:UZ.corner,d:BZ(r,a,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,q.jsxs)(`div`,{ref:t,role:`img`,"aria-label":_??n,className:G(UZ.root,y),style:{...b,"--qr-code-color":p,"--qr-code-background":m,"--qr-code-logo-size":h?`${M*100}%`:void 0},"data-component":`QRCode`,"data-dot-type":u,...x,children:[(0,q.jsxs)(`svg`,{className:UZ.canvas,width:r,height:r,viewBox:`0 0 ${r} ${r}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,q.jsx)(`rect`,{className:UZ.background,width:`100%`,height:`100%`}),f?O.map(e=>(0,q.jsx)(l.Fragment,{children:j(f[e.key],e.row,e.col)},e.key)):null,A.length>0?(0,q.jsx)(`path`,{className:UZ.modules,d:A.join(``)}):null]}),h?(0,q.jsx)(`span`,{className:UZ.logo,"aria-hidden":`true`,children:h}):null]})}GZ.displayName=`QRCode`;var KZ=K(GZ);const qZ=(0,l.createContext)({}),JZ={root:`radio-card-description`};function YZ(e,t){let{className:n,id:r,...i}=e,{descriptionId:a}=l.useContext(qZ);return(0,q.jsx)(`span`,{ref:t,id:r??a,className:G(JZ.root,n),"data-component":`RadioCard.Description`,...i})}YZ.displayName=`RadioCard.Description`;var XZ=K(YZ);const ZZ={root:`radio-card-label`};function QZ(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(qZ);return(0,q.jsx)(`span`,{ref:t,id:r??a,className:G(ZZ.root,n),"data-component":`RadioCard.Label`,...i})}QZ.displayName=`RadioCard.Label`;var $Z=K(QZ);const eQ={root:`radio-card-leading-visual`};function tQ(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(eQ.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}tQ.displayName=`RadioCard.LeadingVisual`;var nQ=K(tQ);const rQ={body:`radio-card-body`,control:`radio-card-control`},iQ=W(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function aQ(e,t){let{className:n,children:r,value:i,name:a,checked:o,defaultChecked:s,disabled:c,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=e,v=l.useContext(zx).disabled||c,y=Y(p),b=`${y}-label`,x=`${y}-description`,[S,C]=xr(r,{leadingVisual:nQ,label:$Z,description:XZ}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,q.jsx)(qZ.Provider,{value:{labelId:b,descriptionId:x},children:(0,q.jsxs)(`label`,{ref:t,className:G(iQ({disabled:!!v,validation:d}),n),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,q.jsxs)(`div`,{className:rQ.body,children:[S.label,S.description,C]}),(0,q.jsx)(Hx,{id:y,value:i,name:a,checked:o,defaultChecked:s,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:rQ.control})]})})}aQ.displayName=`RadioCard`;var oQ=K(aQ);const sQ=Object.assign(oQ,{LeadingVisual:nQ,Label:$Z,Description:XZ}),cQ={root:`radio-group-caption`};function lQ(e,t){let{className:n,...r}=e,{captionId:i}=l.useContext(zx);return(0,q.jsx)(`span`,{ref:t,id:i,className:G(cQ.root,n),"data-component":`RadioGroup.Caption`,...r})}lQ.displayName=`RadioGroup.Caption`;var uQ=K(lQ);const dQ={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function fQ(e,t){let{className:n,children:r,visuallyHidden:i,...a}=e,{disabled:o,required:s}=l.useContext(zx);return(0,q.jsxs)(`span`,{ref:t,title:s?`required field`:void 0,className:G(dQ.root,o&&dQ.disabled,i&&dQ.hidden,n),"data-component":`RadioGroup.Label`,"data-label-disabled":o,...a,children:[r,s?(0,q.jsx)(`span`,{className:dQ.required,children:`*`}):null]})}fQ.displayName=`RadioGroup.Label`;var pQ=K(fQ);const mQ={success:Xt,error:fn},hQ={icon:`radio-group-validation-icon`},gQ=W(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function _Q(e,t){let{className:n,children:r,variant:i,...a}=e,{validationMessageId:o}=l.useContext(zx),s=mQ[i];return(0,q.jsxs)(`span`,{ref:t,className:G(gQ({variant:i}),n),"data-component":`RadioGroup.Validation`,"data-validation-status":i,...a,children:[(0,q.jsx)(s,{className:hQ.icon,"aria-hidden":`true`}),(0,q.jsx)(`span`,{id:o,children:r})]})}_Q.displayName=`RadioGroup.Validation`;var vQ=K(_Q);const yQ={root:`radio-group`,legend:`radio-group-legend`,legendVisible:`radio-group-legend-visible`,body:`radio-group-body`,validation:`radio-group-validation-slot`,hidden:`sr-only`};function bQ(e,t){let{as:n=`fieldset`,className:r,children:i,name:a,disabled:o,required:s,onChange:c,id:u,"aria-labelledby":d,...f}=e,[p,m]=xr(i,{label:pQ,caption:uQ,validation:vQ}),h=Y(u),g=p.caption?`${h}-caption`:void 0,_=p.validation?`${h}-validation`:void 0,v=e=>{let{value:t,checked:n}=e.currentTarget;n&&c?.(t,e)},y=l.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:a,disabled:o,required:s,captionId:g,validationMessageId:_,onChange:v};return(0,q.jsx)(zx.Provider,{value:b,children:(0,q.jsxs)(n,{ref:t,id:h,disabled:o,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:G(yQ.root,r),"data-component":`RadioGroup`,"data-disabled":o,"data-required":s,...f,children:[p.label?(0,q.jsxs)(`legend`,{className:G(yQ.legend,y&&yQ.legendVisible),children:[p.label,s?(0,q.jsx)(`span`,{className:yQ.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,q.jsx)(`div`,{className:yQ.body,children:m}),p.validation?(0,q.jsx)(`div`,{className:yQ.validation,children:p.validation}):null]})})}bQ.displayName=`RadioGroup`;var xQ=K(bQ);const SQ=Object.assign(xQ,{Label:pQ,Caption:uQ,Validation:vQ}),CQ={item:`rating-item`,input:`rating-input`,srOnly:`sr-only`,star:`rating-star`,starTrack:`rating-star-track`,starFill:`rating-star-fill`,starFillIcon:`rating-star-fill-icon`},wQ=W(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),TQ=e=>e===1?`1 star`:`${e} stars`,EQ=(e,t)=>`${e} out of ${t} stars`,DQ=({className:e})=>(0,q.jsx)(`svg`,{className:e,"aria-hidden":`true`,viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.jsx)(`path`,{d:`M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z`})});function OQ(e,t){let{className:n,style:r,count:i=5,value:a,defaultValue:o,size:s=`medium`,readOnly:c,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=TQ,valueLabel:h=EQ,"aria-label":g,..._}=e,v=a!==void 0,[y,b]=l.useState(()=>o??0),x=v?a:y,S=Math.max(Math.trunc(i),0),C=Math.min(Math.max(x,0),S),w=Y(f),T=!c&&!u,E=e=>{T&&(v||b(e),p?.(e))},D=e=>{E(Number(e.currentTarget.value))},O=e=>{d&&Number(e.currentTarget.value)===C&&E(0)},k=c?`span`:`label`;return(0,q.jsx)(`span`,{ref:t,role:c?`img`:`radiogroup`,"aria-label":c?g??h(C,S):g,className:G(wQ({size:s,interactive:T,disabled:!!u}),n),style:{...r,"--rating-value":C},"data-component":`Rating`,"data-size":s,"data-value":C,"data-count":S,"data-readonly":c,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,q.jsxs)(k,{className:CQ.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[c?null:(0,q.jsx)(`input`,{type:`radio`,className:G(CQ.input,CQ.srOnly),name:w,value:n,checked:n===C,disabled:u,"aria-label":m(n,S),onChange:D,onClick:O,"data-component":`Rating.Input`}),(0,q.jsxs)(`span`,{className:CQ.star,"aria-hidden":`true`,children:[(0,q.jsx)(DQ,{className:CQ.starTrack}),(0,q.jsx)(`span`,{className:CQ.starFill,children:(0,q.jsx)(DQ,{className:CQ.starFillIcon})})]})]},n)})})}OQ.displayName=`Rating`;var kQ=K(OQ);const AQ=1e3,jQ=60*AQ,MQ=60*jQ,NQ=24*MQ,PQ=7*NQ,FQ=30*NQ,IQ=12*FQ,LQ=`P30D`,RQ=[{unit:`year`,length:IQ},{unit:`month`,length:FQ},{unit:`week`,length:PQ},{unit:`day`,length:NQ},{unit:`hour`,length:MQ},{unit:`minute`,length:jQ},{unit:`second`,length:AQ}],zQ=[`year`,`month`,`day`,`hour`,`minute`,`second`],BQ={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},VQ=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),HQ=e=>{let t=VQ.exec(e);if(!t||t.slice(1).every(e=>e===void 0))return null;let[,n,r,i,a,o,s,c]=t;return Number(n??0)*IQ+Number(r??0)*FQ+Number(i??0)*PQ+Number(a??0)*NQ+Number(o??0)*MQ+Number(s??0)*jQ+Number(c??0)*AQ},UQ=e=>{let t=Math.abs(e),{unit:n,length:r}=RQ.find(({length:e})=>t>=e)??RQ[RQ.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},WQ=(e,t)=>{let n=Math.floor(Math.abs(e)/AQ),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24),o=Math.floor(a/30),s=Math.floor(o/12),c={year:s,month:o-s*12,day:a-o*30,hour:i-a*24,minute:r-i*60,second:n-r*60};return zQ.slice(0,zQ.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},GQ=e=>{let{value:t,unit:n}=UQ(e);return n===`second`?`1m`:`${Math.abs(t)}${BQ[n]}`},KQ=(e,t)=>{let n=WQ(e,t).filter(({count:e})=>e>0);return n.length===0?`0${BQ[t]}`:n.map(({unit:e,count:t})=>`${t}${BQ[e]}`).join(` `)},qQ=(e,t)=>{let{value:n,unit:r}=UQ(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},JQ=(e,t,n)=>{let r=e.getFullYear()===new Date(t).getFullYear();return{weekday:n.weekday,year:n.year??(r?void 0:`numeric`),month:n.month??`short`,day:n.day??`numeric`,hour:n.hour,minute:n.minute,second:n.second,timeZoneName:n.timeZoneName}},YQ=(e,t,n,r)=>new Intl.DateTimeFormat(r,JQ(e,t,n)).format(e),XQ=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),ZQ=(e,t,n)=>{let{format:r,tense:i,precision:a,threshold:o,prefix:s,dateOptions:c,locale:l}=n,u=e.getTime()-t;if(r===`elapsed`)return{text:KQ(u,a),updateDelay:RQ.find(({unit:e})=>e===a)?.length??AQ};let d=HQ(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=UQ(u);return{text:r===`micro`?GQ(u):qQ(u,l),updateDelay:e}}let f=YQ(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},QQ=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function $Q(e,t){let{as:n=`time`,children:r,date:i,datetime:a,format:o=`auto`,tense:s=`auto`,precision:c=`second`,threshold:u=LQ,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=e,S=QQ(i,a),[C,w]=l.useState(()=>Date.now()),{text:T,updateDelay:E}=S?ZQ(S,C,{format:o,tense:s,precision:c,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return l.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,q.jsx)(n,{ref:t,dateTime:S?.toISOString(),title:f||!S?void 0:XQ(S),"data-component":`RelativeTime`,"data-format":o,"data-tense":s,...x,children:r??T})}$Q.displayName=`RelativeTime`;var e$=K($Q);const t$={root:`resizable`};function n$(e,t){let{className:n,orientation:r=`horizontal`,resizableRef:i,...a}=e;return(0,q.jsx)(w.Group,{elementRef:t,groupRef:i,orientation:r,className:G(t$.root,n),"data-component":`Resizable`,"data-orientation":r,...a})}n$.displayName=`Resizable`;var r$=K(n$);const i$={root:`resizable-panel`};function a$(e,t){let{className:n,...r}=e;return(0,q.jsx)(w.Panel,{elementRef:t,className:G(i$.root,n),"data-component":`Resizable.Panel`,...r})}a$.displayName=`Resizable.Panel`;var o$=K(a$);const s$={root:`resizable-resize-trigger`};function c$(e,t){let{className:n,...r}=e;return(0,q.jsx)(w.Separator,{elementRef:t,className:G(s$.root,n),"data-component":`Resizable.ResizeTrigger`,...r})}c$.displayName=`Resizable.ResizeTrigger`;var l$=K(c$);const u$={root:`resizable-resize-trigger-indicator`};function d$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(u$.root,n),"data-component":`Resizable.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}d$.displayName=`Resizable.ResizeTriggerIndicator`;var f$=K(d$);const p$={root:`resizable-resize-trigger-separator`};function m$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(p$.root,n),"data-component":`Resizable.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}m$.displayName=`Resizable.ResizeTriggerSeparator`;var h$=K(m$);const g$=Object.assign(r$,{Panel:o$,ResizeTrigger:l$,ResizeTriggerSeparator:h$,ResizeTriggerIndicator:f$}),_$=(0,l.createContext)({}),v$=`RichTextEditor`,y$=[C.HeadingNode,C.QuoteNode,S.ListNode,S.ListItemNode,x.LinkNode,x.AutoLinkNode],b$={paragraph:`rich-text-editor-paragraph`,heading:{h1:`rich-text-editor-heading-1`,h2:`rich-text-editor-heading-2`,h3:`rich-text-editor-heading-3`},quote:`rich-text-editor-quote`,link:`rich-text-editor-link`,list:{ul:`rich-text-editor-list-bullet`,ol:`rich-text-editor-list-number`,listitem:`rich-text-editor-list-item`,nested:{listitem:`rich-text-editor-list-item-nested`}},text:{bold:`rich-text-editor-bold`,italic:`rich-text-editor-italic`,underline:`rich-text-editor-underline`,strikethrough:`rich-text-editor-strikethrough`,underlineStrikethrough:`rich-text-editor-underline-strikethrough`,code:`rich-text-editor-inline-code`},ltr:`rich-text-editor-ltr`,rtl:`rich-text-editor-rtl`},x$={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},S$=({readOnly:e})=>{let[t]=(0,y.useLexicalComposerContext)();return l.useEffect(()=>{t.setEditable(!e)},[t,e]),null};function C$(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=v$,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,...g}=e,v={namespace:l,theme:b$,nodes:c?[...y$,...c]:y$,editable:!s,editorState:i,onError:u??(e=>{throw e})},y={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,q.jsx)(`div`,{ref:t,className:G(x$.root,s&&x$.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,...g,children:(0,q.jsx)(_.LexicalComposer,{initialConfig:v,children:(0,q.jsxs)(_$.Provider,{value:y,children:[(0,q.jsx)(T.HistoryPlugin,{}),(0,q.jsx)(D.ListPlugin,{}),(0,q.jsx)(E.LinkPlugin,{}),(0,q.jsx)(k.TabIndentationPlugin,{}),(0,q.jsx)(S$,{readOnly:s}),a?(0,q.jsx)(O.OnChangePlugin,{onChange:(e,t)=>a(e,t)}):null,r]})})})}C$.displayName=`RichTextEditor`;var w$=K(C$);const T$={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function E$(e,t){let{className:n,style:r,...i}=e,{placeholder:a,minHeight:o,maxHeight:s,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d}=l.useContext(_$),f=(0,q.jsx)(`div`,{className:T$.scroll,style:{minHeight:o===void 0?void 0:`${o}px`,maxHeight:s===void 0?void 0:`${s}px`},"data-component":`RichTextEditor.Scroll`,children:a?(0,q.jsx)(A.ContentEditable,{ref:t,className:G(T$.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":a,placeholder:(0,q.jsx)(`div`,{className:T$.placeholder,children:a}),"data-component":`RichTextEditor.Content`,...i}):(0,q.jsx)(A.ContentEditable,{ref:t,className:G(T$.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...i})});return(0,q.jsx)(M.RichTextPlugin,{contentEditable:f,ErrorBoundary:j.LexicalErrorBoundary})}E$.displayName=`RichTextEditor.Content`;var D$=K(E$);const O$=[`history`,`inline`,`block`,`list`,`link`],k$={root:`rich-text-editor-toolbar`,controls:`rich-text-editor-toolbar-controls`,group:`rich-text-editor-toolbar-group`,divider:`rich-text-editor-toolbar-divider`,linkField:`rich-text-editor-link-field`,linkInput:`rich-text-editor-link-input`},A$=[{format:`bold`,icon:Fn,label:`Bold`},{format:`italic`,icon:Bn,label:`Italic`},{format:`underline`,icon:Wn,label:`Underline`},{format:`strikethrough`,icon:Un,label:`Strikethrough`},{format:`code`,icon:sn,label:`Code`}],j$=[{tag:`h1`,icon:Ln,label:`Heading 1`},{tag:`h2`,icon:Rn,label:`Heading 2`},{tag:`h3`,icon:zn,label:`Heading 3`}],M$={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function N$(e){let{className:t,children:n,controls:r=O$,"aria-label":i=`Formatting`,...a}=e,[o]=(0,y.useLexicalComposerContext)(),{readOnly:s}=l.useContext(_$),c=l.useRef(null);_r({containerRef:c,direction:`horizontal`,wrap:!0});let[u,d]=l.useState(M$),[f,p]=l.useState(`paragraph`),[m,h]=l.useState(!1),[g,_]=l.useState(!1),[v,b]=l.useState(!1),[w,T]=l.useState(null),E=l.useCallback(()=>{let e=(0,F.$getSelection)();if(!(0,F.$isRangeSelection)(e))return;d({bold:e.hasFormat(`bold`),italic:e.hasFormat(`italic`),underline:e.hasFormat(`underline`),strikethrough:e.hasFormat(`strikethrough`),code:e.hasFormat(`code`)});let t=e.anchor.getNode(),n=t.getKey()===`root`?t:t.getTopLevelElement();if((0,S.$isListNode)(n))p(n.getListType()===`number`?`number`:`bullet`);else if((0,C.$isHeadingNode)(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else(0,C.$isQuoteNode)(n)?p(`quote`):p(`paragraph`);h((0,x.$isLinkNode)(t)||(0,x.$isLinkNode)(t.getParent()))},[]);l.useEffect(()=>(0,P.mergeRegister)(o.registerUpdateListener(({editorState:e})=>{e.read(E)}),o.registerCommand(F.SELECTION_CHANGE_COMMAND,()=>(E(),!1),F.COMMAND_PRIORITY_CRITICAL),o.registerCommand(F.CAN_UNDO_COMMAND,e=>(_(e),!1),F.COMMAND_PRIORITY_CRITICAL),o.registerCommand(F.CAN_REDO_COMMAND,e=>(b(e),!1),F.COMMAND_PRIORITY_CRITICAL)),[o,E]);let D=e=>{o.update(()=>{let t=(0,F.$getSelection)();if((0,F.$isRangeSelection)(t)){if(f===e){(0,N.$setBlocksType)(t,()=>(0,F.$createParagraphNode)());return}(0,N.$setBlocksType)(t,()=>e===`quote`?(0,C.$createQuoteNode)():(0,C.$createHeadingNode)(e))}})},O=e=>{if(f===e){o.dispatchCommand(S.REMOVE_LIST_COMMAND,void 0);return}o.dispatchCommand(e===`bullet`?S.INSERT_UNORDERED_LIST_COMMAND:S.INSERT_ORDERED_LIST_COMMAND,void 0)},k=()=>{if(m){o.dispatchCommand(x.TOGGLE_LINK_COMMAND,null);return}T(e=>e===null?``:null)},A=()=>{w&&o.dispatchCommand(x.TOGGLE_LINK_COMMAND,w),T(null),o.focus()},j=(e,t,n,r,i,a)=>(0,q.jsx)(gi,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:s||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),M={history:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(gi,{icon:Gt,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:s||!g,onClick:()=>o.dispatchCommand(F.UNDO_COMMAND,void 0),"data-component":`RichTextEditor.Undo`}),(0,q.jsx)(gi,{icon:Ht,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:s||!v,onClick:()=>o.dispatchCommand(F.REDO_COMMAND,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,q.jsx)(q.Fragment,{children:A$.map(({format:e,icon:t,label:n})=>j(n,n,t,u[e],()=>o.dispatchCommand(F.FORMAT_TEXT_COMMAND,e)))}),block:(0,q.jsxs)(q.Fragment,{children:[j$.map(({tag:e,icon:t,label:n})=>j(n,n,t,f===e,()=>D(e))),j(`Quote`,`Quote`,Hn,f===`quote`,()=>D(`quote`))]}),list:(0,q.jsxs)(q.Fragment,{children:[j(`Bulleted list`,`Bulleted list`,In,f===`bullet`,()=>O(`bullet`)),j(`Numbered list`,`Numbered list`,Vn,f===`number`,()=>O(`number`))]}),link:j(`Link`,m?`Remove link`:`Link`,xn,m||w!==null,k)};return(0,q.jsxs)(`div`,{className:G(k$.root,t),"data-component":`RichTextEditor.Toolbar`,children:[(0,q.jsxs)(`div`,{ref:c,role:`toolbar`,"aria-label":i,"aria-orientation":`horizontal`,className:k$.controls,...a,children:[r.map((e,t)=>(0,q.jsxs)(l.Fragment,{children:[t>0?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:k$.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,q.jsx)(`div`,{className:k$.group,"data-control":e,children:M[e]})]},e)),n]}),w===null?null:(0,q.jsxs)(`div`,{className:k$.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,q.jsx)(qo,{autoFocus:!0,size:`small`,type:`url`,value:w,placeholder:`https://example.com`,"aria-label":`Link address`,className:k$.linkInput,onChange:e=>T(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),A()),e.key===`Escape`&&(T(null),o.focus())}}),(0,q.jsx)(pi,{size:`small`,onClick:A,children:`Apply`})]})]})}N$.displayName=`RichTextEditor.Toolbar`;const P$=Object.assign(w$,{Toolbar:N$,Content:D$}),F$={item:`segmented-control-segment`,separator:`segmented-control-segment-separator`,separatorHidden:`segmented-control-segment-separator-hidden`,button:`segmented-control-button`,buttonSelected:`segmented-control-button-selected`,buttonDisabled:`segmented-control-button-disabled`,content:`segmented-control-content`,contentSelected:`segmented-control-content-selected`,contentInteractive:`segmented-control-content-interactive`},I$=e=>{let t=e;return l.isValidElement(e)?e:(0,q.jsx)(t,{})};function L$(e){let{component:t,className:n,children:r,selected:i,disabled:a,tooltip:o,tooltipType:s,tooltipDirection:c,"aria-disabled":l,...u}=e,d=!!a||l===!0||l===`true`,f=(0,q.jsx)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":d||void 0,className:G(F$.button,i&&F$.buttonSelected,d&&!i&&F$.buttonDisabled,n),...u,children:(0,q.jsx)(`span`,{className:G(F$.content,i&&F$.contentSelected,!i&&!d&&F$.contentInteractive),children:r})});return(0,q.jsx)(`li`,{className:G(F$.item,F$.separator,F$.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,q.jsx)(lT,{text:o,type:s,direction:c,children:f}):f})}L$.displayName=`SegmentedControlSegment`;const R$={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function z$(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,q.jsxs)(L$,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,q.jsx)(`span`,{className:G(R$.visual,o&&R$.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:I$(i)}):null,(0,q.jsx)(`span`,{className:G(R$.text,R$.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,q.jsx)(`span`,{className:R$.counter,children:(0,q.jsx)(si,{children:r})})]})}z$.displayName=`SegmentedControl.Button`;const B$={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function V$(e){let{"aria-label":t,className:n,description:r,icon:i,selected:a,disabled:o,tooltipDirection:s,defaultSelected:c,...l}=e;return(0,q.jsx)(L$,{component:`SegmentedControl.IconButton`,className:G(B$.button,n),selected:a,disabled:o,"aria-label":r?t:void 0,tooltip:r??t,tooltipType:r?void 0:`label`,tooltipDirection:s,...l,children:(0,q.jsx)(`span`,{className:G(B$.visual,o&&B$.visualDisabled),"data-component":`SegmentedControl.Icon`,children:I$(i)})})}V$.displayName=`SegmentedControl.IconButton`;const H$={dropdown:`segmented-control-dropdown`},U$=W(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),W$=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),G$=e=>e.type===z$,K$=e=>e.type===V$,q$=e=>{if(e!==void 0)return G$(e)?e.props.children:K$(e)?e.props[`aria-label`]:void 0},J$=e=>e===void 0?null:G$(e)?e.props.leadingVisual??null:K$(e)?e.props.icon:null,Y$=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function X$(e){let{"aria-label":t,"aria-labelledby":n,className:r,children:i,fullWidth:a,onChange:o,size:s=`medium`,variant:c=`default`,...u}=e,d=W$(i),f=o===void 0||d.some(e=>e.props.defaultSelected!==void 0),p=d.findIndex(e=>e.props.defaultSelected||e.props.selected),m=p===-1?0:p,[h,g]=l.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{Y$(t)||(f&&g(e),o?.(e),t.props.onClick?.(n))},b=(0,q.jsx)(`ul`,{"aria-label":t,"aria-labelledby":n,className:G(U$({size:s}),r),"data-component":`SegmentedControl`,"data-size":s,...Ui(`full-width`,a),...Ui(`variant`,c),...u,children:d.map((e,t)=>l.cloneElement(e,{selected:t===_,onClick:n=>y(t,e,n)}))});return ls(c)&&Object.values(c).includes(`dropdown`)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:H$.dropdown,"data-component":`SegmentedControl.Dropdown`,...Ui(`variant`,c),children:(0,q.jsxs)(ma,{children:[(0,q.jsx)(ma.Button,{"aria-label":t&&`${q$(v)}, ${t}`,leadingVisual:J$(v),children:q$(v)}),(0,q.jsx)(ma.Overlay,{"aria-labelledby":n,children:(0,q.jsx)(ji,{selectionVariant:`single`,children:d.map((e,t)=>{let n=J$(e);return(0,q.jsxs)(ji.Item,{selected:t===_,disabled:Y$(e),onSelect:n=>y(t,e,n),children:[n?(0,q.jsx)(ji.LeadingVisual,{children:I$(n)}):null,q$(e)]},t)})})})]})}),b]}):b}X$.displayName=`SegmentedControl`;const Z$=Object.assign(X$,{Button:z$,IconButton:V$}),Q$=Object.assign(lS,{Option:Zx,OptGroup:qx});function $$(e,t){let{className:n,children:r,...i}=e,{required:a,...o}=Xf(i),{labelId:s}=l.useContext(Yf),c=Y();return(0,q.jsx)(pi,{ref:t,type:`button`,"aria-labelledby":s?`${c} ${s}`:void 0,className:G(n),"data-component":`SelectPanel.Button`,...o,children:s?(0,q.jsx)(`span`,{id:c,children:r}):r})}$$.displayName=`SelectPanel.Button`;var e1=K($$);const t1=(0,l.createContext)({}),n1={root:`select-panel-footer`,rootWithoutActions:`select-panel-footer-without-actions`,content:`select-panel-footer-content`,contentWithoutActions:`select-panel-footer-content-without-actions`,actions:`select-panel-footer-actions`};function r1(e,t){let{className:n,children:r,...i}=e,{selectionVariant:a,onCancel:o}=l.useContext(t1),s=a!==`instant`;return!s&&!r?null:(0,q.jsxs)(`div`,{ref:t,className:G(n1.root,!s&&n1.rootWithoutActions,n),"data-component":`SelectPanel.Footer`,"data-has-actions":s?``:void 0,...i,children:[(0,q.jsx)(`div`,{className:G(n1.content,!s&&n1.contentWithoutActions),children:r}),s?(0,q.jsxs)(`div`,{className:n1.actions,children:[(0,q.jsx)(pi,{type:`button`,size:`small`,onClick:o,children:`Cancel`}),(0,q.jsx)(pi,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}r1.displayName=`SelectPanel.Footer`;var i1=K(r1);const a1={root:`select-panel-search-input`};function o1(e,t){let{className:n,value:r,onChange:i,onKeyDown:a,...o}=e,{searchQuery:s,setSearchQuery:c,searchInputRef:u,moveFocusToList:d}=l.useContext(t1),f=l.useRef(null),p=ar(u,f),m=ar(t,p),h=r??s??``;return(0,q.jsx)(qo,{ref:m,block:!0,leadingVisual:On,placeholder:`Search`,value:h,onChange:e=>{c?.(e.currentTarget.value),i?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),a?.(e)},trailingAction:h?(0,q.jsx)(qo.Action,{icon:ln,"aria-label":`Clear`,onClick:()=>{c?.(``),i?.(``,null),f.current?.focus()}}):void 0,className:G(a1.root,n),"data-component":`SelectPanel.SearchInput`,...o})}o1.displayName=`SelectPanel.SearchInput`;var s1=K(o1);const c1={root:`select-panel-header`,content:`select-panel-header-content`,contentWithSearchInput:`select-panel-header-content-with-search`,titleRow:`select-panel-header-title-row`,title:`select-panel-header-title`,heading:`select-panel-header-heading`,description:`select-panel-header-description`,actions:`select-panel-header-actions`},l1={searchInput:s1};function u1(e,t){let{className:n,children:r,onBack:i,...a}=e,[o,s]=xr(r,l1),{panelId:c,title:u,description:d,onCancel:f,onClearSelection:p}=l.useContext(t1);return(0,q.jsxs)(`div`,{ref:t,className:G(c1.root,n),"data-component":`SelectPanel.Header`,...a,children:[(0,q.jsxs)(`div`,{className:G(c1.content,o.searchInput&&c1.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":o.searchInput?``:void 0,children:[(0,q.jsxs)(`div`,{className:c1.titleRow,children:[i?(0,q.jsx)(gi,{type:`button`,variant:`invisible`,icon:Rt,"aria-label":`Back`,onClick:i,"data-component":`SelectPanel.BackButton`}):null,(0,q.jsxs)(`div`,{className:c1.title,"data-has-description":d?``:void 0,"data-has-back":i?``:void 0,children:[(0,q.jsx)(Tr,{as:`h1`,id:c?`${c}-title`:void 0,className:c1.heading,children:u}),d?(0,q.jsx)(`span`,{id:c?`${c}-description`:void 0,className:c1.description,children:d}):null]})]}),(0,q.jsxs)(`div`,{className:c1.actions,children:[p?(0,q.jsx)(gi,{type:`button`,variant:`invisible`,icon:hn,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,q.jsx)(gi,{type:`button`,variant:`invisible`,icon:un,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),o.searchInput,s]})}u1.displayName=`SelectPanel.Header`;var d1=K(u1);const f1={form:`select-panel-form`,container:`select-panel-container`},p1=W(`select-panel-backdrop`,{variants:{variant:{anchored:``,modal:`select-panel-backdrop-modal motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`},narrowVariant:{anchored:``,modal:`select-panel-backdrop-narrow-modal`,"full-screen":``,"bottom-sheet":`select-panel-backdrop-narrow-bottom-sheet`}}}),m1=W(`select-panel motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`,{variants:{width:{small:`select-panel-width-small`,medium:`select-panel-width-medium`,large:`select-panel-width-large`,xlarge:`select-panel-width-xlarge`,auto:`select-panel-width-auto`},maxHeight:{small:`select-panel-max-height-small`,medium:`select-panel-max-height-medium`,large:`select-panel-max-height-large`,xlarge:`select-panel-max-height-xlarge`,"fit-content":`select-panel-max-height-fit-content`},variant:{anchored:`select-panel-anchored`,modal:``},narrowVariant:{anchored:`select-panel-narrow-anchored`,modal:`select-panel-narrow-modal`,"full-screen":`select-panel-narrow-full-screen`,"bottom-sheet":`select-panel-narrow-bottom-sheet`},unplaced:{true:`invisible`,false:``}}}),h1={regular:`anchored`,narrow:`full-screen`},g1=e=>l.isValidElement(e)&&e.type===e1,_1=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function v1(e,t){let{className:n,children:r,title:i,description:a,variant:o=h1,selectionVariant:s=`multiple`,id:c,defaultOpen:u=!1,open:d,anchorRef:f,side:p=`outside-bottom`,align:m=`start`,onCancel:h,onClearSelection:g,onSubmit:_,width:v=`medium`,maxHeight:y=`large`,...b}=e,x=Y(c),S=l.useRef(null),C=f??S,w=l.useRef(null),T=ar(t,w),E=l.useRef(null),D=d!==void 0,[O,k]=l.useState(u),A=D?d:O,j=l.useCallback(()=>{D||k(!1)},[D]),M=l.useCallback(()=>{j(),h?.()},[j,h]),N=l.useCallback(()=>g?.(),[g]),P=l.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=l.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=l.useCallback(()=>{s===`instant`&&P()},[s,P]),[L,ee]=l.useState(``),R=l.Children.toArray(r),z=R.find(g1),[te,ne]=xr(R.filter(e=>e!==z),{header:d1,footer:i1}),B=z?.props.onClick,re=z?l.cloneElement(z,{ref:C,onClick:e=>{B?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,V={...h1,...typeof o==`string`?{regular:o}:o},ie=V.regular??`anchored`,ae=V.narrow,oe=ie===`anchored`||ae===`anchored`,se=l.useRef(null),[ce,le]=l.useState(null),ue=l.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=aa(t,e,{side:p,align:m});se.current&&_1(se.current,n)||(se.current=n,le(n))},[C,p,m]);rr(()=>{if(!A||!oe){se.current=null,le(null);return}ue();let e=new ResizeObserver(ue);return w.current&&e.observe(w.current),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[A,oe,ue]),zi({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),l.useEffect(()=>{A&&!E.current&&F()},[A,F]),Hi(e=>{A&&(e.preventDefault(),M())});let de=l.useMemo(()=>({panelId:x,title:i,description:a,selectionVariant:s,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,i,a,s,L,M,g,N,F]),fe=l.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:s===`instant`?`single`:s,afterSelect:I,enableFocusZone:!0}),[x,s,I]);return(0,q.jsxs)(q.Fragment,{children:[re,A?(0,q.jsx)(ea,{children:(0,q.jsx)(`div`,{className:G(p1({variant:ie,narrowVariant:ae})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...Ui(`variant`,V),children:(0,q.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":a?`${x}-description`:void 0,className:G(m1({width:v,maxHeight:y,variant:ie,narrowVariant:ae,unplaced:oe&&!ce}),n),style:{"--select-panel-top":`${ce?.top??0}px`,"--select-panel-left":`${ce?.left??0}px`},"data-component":`SelectPanel`,"data-width":v,"data-max-height":y,"data-side":ce?.anchorSide??p,"data-align":ce?.anchorAlign??m,...Ui(`variant`,V),...b,children:(0,q.jsx)(`form`,{className:f1.form,onSubmit:P,children:(0,q.jsxs)(t1.Provider,{value:de,children:[te.header??(0,q.jsx)(d1,{}),(0,q.jsx)(`div`,{className:f1.container,children:(0,q.jsx)(Ar.Provider,{value:fe,children:ne})}),te.footer]})})})})}):null]})}v1.displayName=`SelectPanel`;var y1=K(v1);const b1={root:`select-panel-loading`,text:`select-panel-loading-text`};function x1(e,t){let{className:n,children:r=`Fetching items...`,...i}=e;return(0,q.jsxs)(`div`,{ref:t,role:`status`,"aria-live":`polite`,className:G(b1.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,q.jsx)($r,{size:`medium`,srText:null,role:`presentation`}),(0,q.jsx)(`span`,{className:b1.text,children:r})]})}x1.displayName=`SelectPanel.Loading`;var S1=K(x1);const C1={full:`select-panel-message-full`,fullIcon:`select-panel-message-full-icon`,fullTitle:`select-panel-message-full-title`,fullContent:`select-panel-message-full-content`,inline:`select-panel-message-inline`,inlineIcon:`select-panel-message-inline-icon`,variant:{warning:`select-panel-message-warning`,error:`select-panel-message-error`,empty:``},inlineVariant:{warning:`select-panel-message-inline-warning`,error:`select-panel-message-inline-error`,empty:``}};function w1(e,t){let{className:n,children:r,variant:i,size:a,title:o,...s}=e,c=a??(i===`empty`?`full`:`inline`),l=i===`empty`?void 0:{role:`status`,"aria-live":`polite`};return c===`full`?(0,q.jsxs)(`div`,{ref:t,className:G(C1.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,q.jsx)(Gn,{className:G(C1.fullIcon,C1.variant[i]),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:C1.fullTitle,children:o}),(0,q.jsx)(`span`,{className:C1.fullContent,children:r})]}):(0,q.jsxs)(`div`,{ref:t,className:G(C1.inline,C1.variant[i],C1.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,q.jsx)(Gn,{className:C1.inlineIcon,"aria-hidden":`true`}),(0,q.jsx)(`div`,{children:r})]})}w1.displayName=`SelectPanel.Message`;var T1=K(w1);const E1={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},D1=e=>{let{id:t,children:n,className:r,...i}=e,a=Y(t);return(0,q.jsxs)(`span`,{className:E1.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,q.jsx)($d,{id:a,className:G(E1.box,r),...i}),(0,q.jsx)(`label`,{htmlFor:a,className:E1.small,children:n})]})};function O1(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,q.jsx)(D1,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,q.jsx)($c,{className:G(E1.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,q.jsx)(pi,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}O1.displayName=`SelectPanel.SecondaryAction`;const k1=Object.assign(y1,{Button:e1,Header:d1,SearchInput:s1,Footer:i1,SecondaryAction:O1,Loading:S1,Message:T1}),A1=W(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function j1(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,variant:a=`default`,...o}=e;return(0,q.jsx)(n,{ref:t,role:`separator`,"aria-orientation":i,className:G(A1({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}j1.displayName=`Separator`;var M1=K(j1);const N1=W(`slider`,{variants:{size:{small:`slider-small`,medium:`slider-medium`,large:`slider-large`},orientation:{horizontal:`slider-horizontal`,vertical:`slider-vertical`},block:{true:``,false:``}},compoundVariants:[{block:!0,orientation:`horizontal`,class:`slider-block-horizontal`},{block:!0,orientation:`vertical`,class:`slider-block-vertical`}]}),P1=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function F1(e,t){let{className:n,style:r,size:i=`medium`,orientation:a=`horizontal`,block:o,min:s=0,max:c=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=e,g=d!==void 0,[_,v]=l.useState(()=>f??s),y=g?d:_;return(0,q.jsx)(`input`,{ref:t,type:`range`,min:s,max:c,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:G(N1({size:i,orientation:a,block:o}),n),style:{...r,"--slider-fill":`${P1(y,s,c)}%`},"aria-orientation":a===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":i,"data-orientation":a,"data-block":o,"data-disabled":p,...h})}F1.displayName=`Slider`;var I1=K(F1);const L1={open:`open`,issueOpened:`open`,pullOpened:`open`,alertOpened:`open`,closed:`done`,issueClosed:`done`,pullMerged:`done`,alertFixed:`done`,pullClosed:`closed`,alertClosed:`closed`,issueClosedNotPlanned:`neutral`,unavailable:`neutral`,archived:`neutral`,pullQueued:`attention`,draft:`draft`,issueDraft:`draft`,alertDismissed:`draft`},R1={open:null,closed:null,draft:nn,archived:Ft,unavailable:Gn,issueOpened:Dn,issueClosed:Xt,issueClosedNotPlanned:En,issueDraft:nn,pullOpened:Jt,pullClosed:ln,pullMerged:Sn,pullQueued:on,alertOpened:Nn,alertClosed:Mn,alertFixed:An,alertDismissed:jn},z1={open:``,closed:``,draft:`Pull request`,archived:`Archived`,unavailable:``,issueOpened:`Issue`,issueClosed:`Issue`,issueClosedNotPlanned:`Issue, not planned`,issueDraft:`Issue`,pullOpened:`Pull request`,pullClosed:`Pull request`,pullMerged:`Pull request`,pullQueued:`Pull request`,alertOpened:`Alert`,alertClosed:`Alert`,alertFixed:`Alert`,alertDismissed:`Alert`},B1=W(`state-label`,{variants:{size:{small:`state-label-small`,medium:`state-label-medium`},tone:{open:`state-label-open`,closed:`state-label-closed`,done:`state-label-done`,draft:`state-label-draft`,attention:`state-label-attention`,neutral:`state-label-neutral`}}}),V1=W(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function H1(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=R1[i],l=z1[i];return(0,q.jsxs)(n,{ref:t,className:G(B1({size:a,tone:L1[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,q.jsx)(c,{className:G(V1({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}H1.displayName=`StateLabel`;var U1=K(H1);const W1=(0,l.createContext)({}),G1={root:`statistic-card-description`};function K1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(G1.root,n),"data-component":`StatisticCard.Description`,...r})}K1.displayName=`StatisticCard.Description`;var q1=K(K1);const J1={root:`statistic-card-label`};function Y1(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(W1);return(0,q.jsx)(`span`,{ref:t,id:r??a,className:G(J1.root,n),"data-component":`StatisticCard.Label`,...i})}Y1.displayName=`StatisticCard.Label`;var X1=K(Y1);const Z1={root:`statistic-card-trailing-visual`};function Q1(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(Z1.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}Q1.displayName=`StatisticCard.TrailingVisual`;var $1=K(Q1);const e0={hidden:`sr-only`},t0={increase:Kt,decrease:Lt,neutral:Pn},n0={increase:`Up`,decrease:`Down`,neutral:`No change`},r0={increase:`positive`,decrease:`negative`,neutral:`neutral`},i0=W(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function a0(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=t0[i],c=a??r0[i];return(0,q.jsxs)(`span`,{ref:t,className:G(i0({sentiment:c}),n),"data-component":`StatisticCard.Trend`,"data-direction":i,"data-sentiment":c,...o,children:[(0,q.jsx)(s,{"aria-hidden":!0}),(0,q.jsx)(`span`,{className:e0.hidden,children:n0[i]}),r]})}a0.displayName=`StatisticCard.Trend`;var o0=K(a0);const s0={root:`statistic-card-value`};function c0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(s0.root,n),"data-component":`StatisticCard.Value`,...r})}c0.displayName=`StatisticCard.Value`;var l0=K(c0);const u0={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function d0(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${Y(i)}-label`,[l,u]=xr(r,{trailingVisual:$1,label:X1,value:l0,trend:o0,description:q1}),d=o??(l.label&&!a?c:void 0);return(0,q.jsx)(W1.Provider,{value:{labelId:c},children:(0,q.jsxs)(`div`,{ref:t,id:i,role:d||a?`group`:void 0,"aria-label":a,"aria-labelledby":d,className:G(u0.root,n),"data-component":`StatisticCard`,...s,children:[(0,q.jsxs)(`div`,{className:u0.body,children:[l.label,l.value||l.trend?(0,q.jsxs)(`div`,{className:u0.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}d0.displayName=`StatisticCard`;var f0=K(d0);const p0=Object.assign(f0,{Label:X1,Value:l0,Trend:o0,Description:q1,TrailingVisual:$1}),m0=(0,l.createContext)({}),h0={srOnly:`sr-only`},g0=W(`status`,{variants:{variant:{accent:`status-accent`,success:`status-success`,attention:`status-attention`,severe:`status-severe`,danger:`status-danger`,done:`status-done`,neutral:`status-neutral`},size:{small:`status-small`,medium:`status-medium`,large:`status-large`}}});function _0(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,q.jsx)(m0.Provider,{value:{variant:i,size:a},children:(0,q.jsxs)(n,{ref:t,className:G(g0({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,q.jsx)(`span`,{className:h0.srOnly,children:o}):null,s]})})}_0.displayName=`Status`;var v0=K(_0);const y0=W(`status-indicator`,{variants:{variant:{accent:`status-indicator-accent`,success:`status-indicator-success`,attention:`status-indicator-attention`,severe:`status-indicator-severe`,danger:`status-indicator-danger`,done:`status-indicator-done`,neutral:`status-indicator-neutral`},size:{small:`status-indicator-small`,medium:`status-indicator-medium`,large:`status-indicator-large`}}});function b0(e,t){let{className:n,variant:r,size:i,...a}=e,o=l.useContext(m0),s=r??o.variant??`neutral`,c=i??o.size??`medium`;return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(y0({variant:s,size:c}),n),"data-component":`Status.Indicator`,"data-variant":s,"data-size":c,...a})}b0.displayName=`Status.Indicator`;var x0=K(b0);const S0=Object.assign(v0,{Indicator:x0}),C0=(0,l.createContext)(null),w0=W(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),T0=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),E0=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function D0(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=T0(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(w0({orientation:a,size:o}),n),"data-component":`Steps`,"data-orientation":a,"data-size":o,"data-count":c.length,...s,children:c.map((e,t)=>(0,q.jsx)(C0.Provider,{value:{index:t,status:E0(t,i)},children:e},e.key))})}D0.displayName=`Steps`;var O0=K(D0);const k0={root:`steps-body`};function A0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(k0.root,n),"data-component":`Steps.Body`,...r})}A0.displayName=`Steps.Body`;var j0=K(A0);const M0={root:`steps-description`};function N0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(M0.root,n),"data-component":`Steps.Description`,...r})}N0.displayName=`Steps.Description`;var P0=K(N0);const F0=()=>{let e=(0,l.useContext)(C0);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},I0={root:`steps-indicator`,icon:`steps-indicator-icon`};function L0(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=F0();return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(I0.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,q.jsx)(Zt,{className:I0.icon}):a+1)})}L0.displayName=`Steps.Indicator`;var R0=K(L0);const z0={root:`steps-item`,status:`sr-only`},B0={complete:`Completed`,current:``,incomplete:`Not completed`};function V0(e,t){let{className:n,children:r,status:i,statusLabel:a,...o}=e,{index:s,status:c}=F0(),u=i??c,d=a??B0[u],f=l.useMemo(()=>({index:s,status:u}),[s,u]);return(0,q.jsx)(C0.Provider,{value:f,children:(0,q.jsxs)(`li`,{ref:t,"aria-current":u===`current`?`step`:void 0,className:G(z0.root,n),"data-component":`Steps.Item`,"data-status":u,"data-index":s,...o,children:[r,d?(0,q.jsx)(`span`,{className:z0.status,children:d}):null]})})}V0.displayName=`Steps.Item`;var H0=K(V0);const U0={root:`steps-title`};function W0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(U0.root,n),"data-component":`Steps.Title`,...r})}W0.displayName=`Steps.Title`;var G0=K(W0);const K0=Object.assign(O0,{Item:H0,Indicator:R0,Body:j0,Title:G0,Description:P0}),q0=(0,l.createContext)({}),J0=W(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function Y0(e,t){let{as:n=`span`,className:r,swap:i=!1,transition:a=`fade`,children:o,...s}=e,c=l.useMemo(()=>({swap:i}),[i]);return(0,q.jsx)(q0.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(J0({transition:a}),r),"data-component":`Swap`,"data-swap":i?`on`:`off`,"data-transition":a,...s,children:o})})}Y0.displayName=`Swap`;var X0=K(Y0);const Z0={root:`swap-indicator`,active:`swap-indicator-active`};function Q0(e,t){let{as:n=`span`,className:r,type:i,...a}=e,{swap:o}=l.useContext(q0),s=i===(o?`on`:`off`);return(0,q.jsx)(n,{ref:t,"aria-hidden":s?void 0:`true`,className:G(Z0.root,s&&Z0.active,r),"data-component":`Swap.Indicator`,"data-type":i,"data-active":s,...a})}Q0.displayName=`Swap.Indicator`;var $0=K(Q0);const e2=Object.assign(X0,{Indicator:$0}),t2=(0,l.createContext)({}),n2=()=>(0,l.useContext)(t2),r2=({checked:e,disabled:t,readOnly:n,required:r,invalid:i})=>({"data-state":e?`checked`:`unchecked`,"data-disabled":t||void 0,"data-readonly":n||void 0,"data-required":r||void 0,"data-invalid":i||void 0}),i2={root:`switch`};function a2(e,t){let{className:n,value:r,onClick:i,...a}=e,o=l.useRef(r.checked),s={...r,initialChecked:o.current};return(0,q.jsx)(t2.Provider,{value:s,children:(0,q.jsx)(`label`,{ref:t,id:r.ids.root,htmlFor:r.ids.hiddenInput,className:G(i2.root,n),onClick:e=>{i?.(e),e.target.id===r.ids.hiddenInput&&e.stopPropagation()},"data-component":`Switch`,...r2(r),...a})})}a2.displayName=`Switch.RootProvider`;var o2=K(a2);const s2=(e={})=>{let{checked:t,defaultChecked:n,disabled:r,readOnly:i,required:a,invalid:o,name:s,value:c,form:u,id:d,ids:f,onCheckedChange:p}=e,m=l.useContext(Yf),h=t!==void 0,[g,_]=l.useState(!!n),v=h?t:g,y=Y(d),b=e=>{h||_(e),p?.(e)};return{checked:v,disabled:!!(r??m.disabled),readOnly:!!i,required:!!(a??m.required),invalid:!!o,name:s,value:c,form:u,ids:{root:f?.root??y,label:f?.label??`${y}-label`,control:f?.control??`${y}-control`,thumb:f?.thumb??`${y}-thumb`,hiddenInput:f?.hiddenInput??m.id??`${y}-input`},describedBy:[m.validationMessageId,m.captionId].filter(Boolean).join(` `)||void 0,setChecked:b,toggleChecked:()=>b(!v)}};function c2(e,t){let{checked:n,defaultChecked:r,disabled:i,readOnly:a,required:o,invalid:s,name:c,value:l,form:u,id:d,ids:f,onCheckedChange:p,...m}=e,h=s2({checked:n,defaultChecked:r,disabled:i,readOnly:a,required:o,invalid:s,name:c,value:l,form:u,id:d,ids:f,onCheckedChange:p});return(0,q.jsx)(o2,{ref:t,value:h,...m})}c2.displayName=`Switch`;var l2=K(c2);const u2={root:`switch-control`};function d2(e,t){let{className:n,...r}=e,i=l.useContext(t2);return(0,q.jsx)(`span`,{ref:t,id:i.ids?.control,className:G(u2.root,n),"aria-hidden":`true`,"data-component":`Switch.Control`,...r2(i),...r})}d2.displayName=`Switch.Control`;var f2=K(d2);const p2={root:`switch-hidden-input`,hidden:`sr-only`};function m2(e,t){let{className:n,onChange:r,...i}=e,{checked:a=!1,disabled:o,readOnly:s,required:c,invalid:u,name:d,value:f,form:p,ids:m,describedBy:h,initialChecked:g,setChecked:_}=l.useContext(t2),v=l.useRef(null),y=ar(t,v),b=l.useRef(()=>{});return l.useEffect(()=>{b.current=()=>_?.(!!g)},[g,_]),l.useEffect(()=>{let e=v.current?.form;if(!e)return;let t=()=>b.current();return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[p]),(0,q.jsx)(`input`,{ref:y,id:m?.hiddenInput,type:`checkbox`,role:`switch`,className:G(p2.root,p2.hidden,n),checked:a,disabled:o,required:c,name:d,value:f,form:p,"aria-labelledby":m?.label,"aria-describedby":h,"aria-invalid":u||void 0,onChange:e=>{r?.(e),!(s||e.nativeEvent.defaultPrevented)&&_?.(e.currentTarget.checked)},"data-component":`Switch.HiddenInput`,...i})}m2.displayName=`Switch.HiddenInput`;var h2=K(m2);const g2={root:`switch-label`};function _2(e,t){let{className:n,...r}=e,i=l.useContext(t2);return(0,q.jsx)(`span`,{ref:t,id:i.ids?.label,className:G(g2.root,n),"data-component":`Switch.Label`,...r2(i),...r})}_2.displayName=`Switch.Label`;var v2=K(_2);const y2={root:`switch-thumb`};function b2(e,t){let{className:n,...r}=e,i=l.useContext(t2);return(0,q.jsx)(`span`,{ref:t,id:i.ids?.thumb,className:G(y2.root,n),"aria-hidden":`true`,"data-component":`Switch.Thumb`,...r2(i),...r})}b2.displayName=`Switch.Thumb`;var x2=K(b2);const S2=Object.assign(l2,{Root:l2,RootProvider:o2,Control:f2,Thumb:x2,Label:v2,HiddenInput:h2}),C2=(0,l.createContext)({}),w2=()=>(0,l.useContext)(C2),T2=(0,l.createContext)(null),E2=()=>(0,l.useContext)(T2),D2=e=>typeof document>`u`?null:document.getElementById(e),O2=(e,t={})=>{let{scrollElement:n,behavior:r}=t,i=D2(e);if(!i)return!1;if(!n)return i.scrollIntoView?.({behavior:r,block:`start`}),!0;if(!n.contains(i))return!1;let a=i.getBoundingClientRect(),o=n.getBoundingClientRect(),s=P2(getComputedStyle(n).scrollPaddingBlockStart||getComputedStyle(n).scrollPaddingTop),c=P2(getComputedStyle(i).scrollMarginBlockStart||getComputedStyle(i).scrollMarginTop),l=a.top-o.top+n.scrollTop-s-c;return n.scrollTo({top:l,...r&&{behavior:r}}),!0},k2=e=>{let t=e.getAttribute(`href`);if(!t)return null;let n=new URL(t,window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname||n.search!==window.location.search)return null;try{return decodeURIComponent(n.hash.slice(1))||null}catch{return null}},A2=e=>{let t=window.location.href;window.history.pushState(null,``,`#${e}`),window.dispatchEvent(new HashChangeEvent(`hashchange`,{oldURL:t,newURL:window.location.href}))},j2=e=>{if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget;if(t.hasAttribute(`download`))return!1;let n=t.getAttribute(`target`);return n===null||n===``||n===`_self`},M2=e=>e===null||e.x===0&&e.y===0&&e.width===0&&e.height===0,N2=(e,t)=>e!==null&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,P2=e=>{let t=Number.parseFloat(e);return Number.isNaN(t)?0:t},F2=`-20px 0% -40% 0%`,I2=[],L2=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),R2=(e={})=>{let{items:t=I2,activeIds:n,defaultActiveIds:r,onActiveChange:i,rootMargin:a=F2,threshold:o=0,scrollElement:s=null,scrollBehavior:c=`smooth`}=e,u=n!==void 0,[d,f]=l.useState(r??[]),p=u?n:d,m=t.filter(e=>p.includes(e.value)),h=l.useRef({items:t,currentActiveIds:p,onActiveChange:i,isControlled:u});l.useEffect(()=>{h.current={items:t,currentActiveIds:p,onActiveChange:i,isControlled:u}});let g=l.useCallback(e=>{let t=h.current;L2(t.currentActiveIds,e)||(t.isControlled||f(e),t.onActiveChange?.({activeIds:e,activeItems:t.items.filter(t=>e.includes(t.value))}))},[]),_=t.map(e=>e.value).join(),v=Array.isArray(o)?o.join():String(o);return l.useEffect(()=>{let e=h.current.items;if(e.length===0||typeof IntersectionObserver>`u`)return;let t=new Map,n=new IntersectionObserver(e=>{for(let n of e)t.set(n.target.id,n.isIntersecting);let n=h.current.items.filter(e=>t.get(e.value)).map(e=>e.value);n.length!==0&&g(n)},{rootMargin:a,threshold:o,root:s});for(let t of e){let e=D2(t.value);e&&n.observe(e)}return()=>{n.disconnect()}},[_,a,v,s,g]),{items:t,activeIds:p,activeItems:m,setActiveIds:g,scrollTo:(e,t)=>O2(e,{scrollElement:s,behavior:t?.behavior??c}),getItemState:e=>({active:p.includes(e.value),first:e.value===p[0],last:e.value===p[p.length-1],depth:e.depth})}},z2={root:`table-of-contents`};function B2(e,t){let{as:n=`div`,className:r,id:i,items:a,activeIds:o,defaultActiveIds:s,rootMargin:c,threshold:u,scrollElement:d,scrollBehavior:f=`smooth`,autoScroll:p=!0,onActiveChange:m,children:h,...g}=e,_=Y(i),v=l.useMemo(()=>({root:_,title:`${_}-title`,list:`${_}-list`,indicator:`${_}-indicator`,item:e=>`${_}-item-${e}`,link:e=>`${_}-link-${e}`}),[_]),[y,b]=l.useState(null),x=d===void 0?y:d,[S,C]=l.useState(!1),w=R2({items:a,activeIds:o,defaultActiveIds:s,onActiveChange:m,rootMargin:c,threshold:u,scrollElement:x,scrollBehavior:f}),T=w.activeIds[0];l.useEffect(()=>{!p||T===void 0||document.getElementById(v.item(T))?.scrollIntoView?.({behavior:f,block:`nearest`})},[p,T,v,f]);let E={...w,ids:v,scrollElement:x,setScrollElement:b,hasTitle:S,setHasTitle:C};return(0,q.jsx)(C2.Provider,{value:E,children:(0,q.jsx)(n,{ref:t,id:v.root,className:G(z2.root,r),"data-component":`TableOfContents`,...g,children:h})})}B2.displayName=`TableOfContents`;var V2=K(B2);const H2={root:`table-of-contents-content`};function U2(e,t){let{as:n=`article`,className:r,...i}=e,{setScrollElement:a}=w2(),o=ar(t,a);return(0,q.jsx)(n,{ref:o,className:G(H2.root,r),"data-component":`TableOfContents.Content`,...i})}U2.displayName=`TableOfContents.Content`;var W2=K(U2);const G2={root:`table-of-contents-indicator`},K2=e=>e===void 0?void 0:`${e}px`;function q2(e,t){let{as:n=`div`,className:r,style:i,...a}=e,{ids:o,activeIds:s}=w2(),[c,u]=l.useState(null),d=s?.join()??``;return rr(()=>{let e=s??[];if(!o||e.length===0){u(null);return}let t=document.getElementById(o.list),n=document.getElementById(o.item(e[0])),r=document.getElementById(o.item(e[e.length-1]));if(!n){u(null);return}let i=()=>{let e=n.getBoundingClientRect(),i=t?.getBoundingClientRect(),a=t&&i?e.left-i.left+t.scrollLeft:0,o=t&&i?e.top-i.top+t.scrollTop:0,s=r&&r!==n?r.getBoundingClientRect().bottom-e.top:e.height,c={x:a,y:o,width:e.width,height:s};u(e=>N2(e,c)?e:c)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),r&&r!==n&&a.observe(r),t&&a.observe(t),()=>{a.disconnect()}},[d,o]),(0,q.jsx)(n,{ref:t,id:o?.indicator,"aria-hidden":`true`,hidden:M2(c),className:G(G2.root,r),style:{...i,"--table-of-contents-indicator-x":K2(c?.x),"--table-of-contents-indicator-y":K2(c?.y),"--table-of-contents-indicator-width":K2(c?.width),"--table-of-contents-indicator-height":K2(c?.height)},"data-component":`TableOfContents.Indicator`,...a})}q2.displayName=`TableOfContents.Indicator`;var J2=K(q2);const Y2={root:`table-of-contents-item`};function X2(e,t){let{as:n=`li`,className:r,item:i,style:a,...o}=e,{ids:s,getItemState:c}=w2(),l=c?.(i);return(0,q.jsx)(T2.Provider,{value:i,children:(0,q.jsx)(n,{ref:t,id:s?.item(i.value),className:G(Y2.root,r),style:{...a,"--table-of-contents-item-depth":i.depth},"data-component":`TableOfContents.Item`,"data-value":i.value,"data-depth":i.depth,"data-active":l?.active?``:void 0,"data-first":l?.first?``:void 0,"data-last":l?.last?``:void 0,...o})})}X2.displayName=`TableOfContents.Item`;var Z2=K(X2);const Q2={root:`table-of-contents-link`};function $2(e,t){let{as:n=`a`,className:r,onClick:i,...a}=e,{ids:o,scrollElement:s,scrollTo:c,getItemState:l}=w2(),u=E2(),d=u&&l?.(u);return(0,q.jsx)(n,{ref:t,id:u?o?.link(u.value):void 0,className:G(Q2.root,r),"aria-current":d?.active?`location`:void 0,"data-component":`TableOfContents.Link`,"data-value":u?.value,"data-active":d?.active?``:void 0,onClick:e=>{if(i?.(e),e.defaultPrevented||!s||!j2(e))return;let t=k2(e.currentTarget);!t||!c?.(t)||(e.preventDefault(),A2(t))},...a})}$2.displayName=`TableOfContents.Link`;var e4=K($2);const t4={root:`table-of-contents-list`};function n4(e,t){let{as:n=`ul`,className:r,...i}=e,{ids:a}=w2();return(0,q.jsx)(n,{ref:t,id:a?.list,className:G(t4.root,r),"data-component":`TableOfContents.List`,...i})}n4.displayName=`TableOfContents.List`;var r4=K(n4);const i4={root:`table-of-contents-nav`};function a4(e,t){let{as:n=`nav`,className:r,placement:i,...a}=e,{ids:o,hasTitle:s}=w2();return(0,q.jsx)(n,{ref:t,"aria-labelledby":s?o?.title:void 0,className:G(i4.root,r),"data-component":`TableOfContents.Nav`,"data-placement":i,...a})}a4.displayName=`TableOfContents.Nav`;var o4=K(a4);const s4={root:`table-of-contents-title`};function c4(e,t){let{as:n=`h2`,className:r,...i}=e,{ids:a,setHasTitle:o}=w2();return rr(()=>(o?.(!0),()=>o?.(!1)),[o]),(0,q.jsx)(n,{ref:t,id:a?.title,className:G(s4.root,r),"data-component":`TableOfContents.Title`,...i})}c4.displayName=`TableOfContents.Title`;var l4=K(c4);const u4=Object.assign(V2,{Root:V2,Content:W2,Nav:o4,Title:l4,List:r4,Item:Z2,Link:e4,Indicator:J2}),d4=(0,l.createContext)(null);function f4(e){let{children:t,id:n,value:r,defaultValue:i,onChange:a}=e,o=Y(n),s=r!==void 0,[c,u]=l.useState(i),d=s?r:c,f=l.useRef(a);rr(()=>{f.current=a},[a]);let p=l.useMemo(()=>({groupId:o,selectedValue:d,selectTab:e=>{s||u(e),f.current?.(e)}}),[o,d,s]);return(0,q.jsx)(d4.Provider,{value:p,children:t})}f4.displayName=`Tabs`;const p4=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},m4=()=>{let e=(0,l.useContext)(d4);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},h4=e=>{let{value:t,disabled:n}=e,r=m4(),i=r.selectedValue===t;return{selected:i,tabProps:{id:`${r.groupId}-tab-${t}`,role:`tab`,"aria-controls":`${r.groupId}-panel-${t}`,"aria-selected":i,"aria-disabled":n?!0:void 0,tabIndex:i?0:-1,onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&r.selectTab(t)},onMouseDown:e=>{if(n||e.button!==0||e.ctrlKey){e.preventDefault();return}r.selectTab(t)},onFocus:()=>{!i&&!n&&r.selectTab(t)}}}},g4={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function _4(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=h4({value:r,disabled:i});return(0,q.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:p4(a,u.onKeyDown),onMouseDown:p4(o,u.onMouseDown),onFocus:p4(s,u.onFocus),className:G(g4.root,g4.vertical,g4.hover,l&&g4.selected,i&&g4.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}_4.displayName=`Tabs.Tab`;var v4=K(_4);const y4=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),b4=e=>{let{"aria-label":t,"aria-labelledby":n,"aria-orientation":r,ref:i}=e,a=l.useRef(null),o=ar(i,a),s=r??`horizontal`;return{tabListProps:{ref:o,role:`tablist`,"aria-label":t,"aria-labelledby":n,"aria-orientation":s,onKeyDown:e=>{let t=a.current;if(!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,o=e.key===`Home`||e.key===`End`,c=e.key===r?1:e.key===i?-1:0;if(c===0&&!o)return;e.preventDefault(),e.stopPropagation();let l=y4(t);if(l.length===0)return;if(o){l[e.key===`Home`?0:l.length-1].focus();return}let u=l.findIndex(e=>e.getAttribute(`aria-selected`)===`true`);l[u===-1?0:(u+c+l.length)%l.length].focus()}}}},x4={root:`tab-list`,vertical:`tab-list-vertical`};function S4(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=b4({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,q.jsx)(`div`,{...s,...c,onKeyDown:p4(r,c.onKeyDown),className:G(x4.root,l&&x4.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}S4.displayName=`Tabs.List`;var C4=K(S4);const w4=e=>{let{value:t}=e,n=m4(),r=n.selectedValue===t;return{tabPanelProps:{id:`${n.groupId}-panel-${t}`,role:`tabpanel`,"aria-labelledby":`${n.groupId}-tab-${t}`,hidden:!r,"data-selected":r?``:void 0}}};function T4(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=w4({value:r});return(0,q.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}T4.displayName=`Tabs.Panel`;var E4=K(T4);const D4=Object.assign(f4,{List:C4,Tab:v4,Panel:E4}),O4={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},k4=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function A4(e,t){let{className:n,clipSidebar:r,...i}=e,a=k4(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(O4.root,(a===`start`||a===`both`)&&O4.clipStart,(a===`end`||a===`both`)&&O4.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}A4.displayName=`Timeline`;var j4=K(A4);const M4={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function N4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(M4.root,M4.narrow,n),"data-component":`Timeline.Actions`,...r})}N4.displayName=`Timeline.Actions`;var P4=K(N4);const F4={root:`timeline-avatar`};function I4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(F4.root,n),"data-component":`Timeline.Avatar`,...r})}I4.displayName=`Timeline.Avatar`;var L4=K(I4);const R4={wrapper:`timeline-badge-wrapper`},z4=W(`timeline-badge`,{variants:{variant:{accent:`timeline-badge-accent`,success:`timeline-badge-success`,attention:`timeline-badge-attention`,severe:`timeline-badge-severe`,danger:`timeline-badge-danger`,done:`timeline-badge-done`,open:`timeline-badge-open`,closed:`timeline-badge-closed`,sponsors:`timeline-badge-sponsors`}}});function B4(e,t){let{className:n,variant:r,...i}=e;return(0,q.jsx)(`div`,{className:R4.wrapper,children:(0,q.jsx)(`div`,{ref:t,className:G(z4({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}B4.displayName=`Timeline.Badge`;var V4=K(B4);const H4={root:`timeline-body`};function U4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(H4.root,n),"data-component":`Timeline.Body`,...r})}U4.displayName=`Timeline.Body`;var W4=K(U4);const G4={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function K4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`li`,{ref:t,role:`presentation`,className:G(G4.root,G4.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}K4.displayName=`Timeline.Break`;var q4=K(K4);const J4={root:`timeline-item`,rail:`timeline-item-rail`,condensed:`timeline-item-condensed`,condensedBadge:`timeline-item-condensed-badge`,condensedAvatar:`timeline-item-condensed-avatar`,narrow:`timeline-item-narrow`};function Y4(e,t){let{className:n,condensed:r,...i}=e;return(0,q.jsx)(`li`,{ref:t,className:G(J4.root,J4.rail,J4.narrow,r&&J4.condensed,r&&J4.condensedBadge,r&&J4.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}Y4.displayName=`Timeline.Item`;var X4=K(Y4);const Z4=Object.assign(j4,{Item:X4,Avatar:L4,Badge:V4,Body:W4,Break:q4,Actions:P4}),Q4=(0,l.createContext)({}),$4=()=>(0,l.useContext)(Q4);var e3=c(o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))}))());eu.default.extend(e3.default);const t3=e=>{let t=eu.default.duration(Math.max(e,0));return{days:Math.floor(t.asDays()),hours:Math.floor(t.asHours())%24,minutes:Math.floor(t.asMinutes())%60,seconds:Math.floor(t.asSeconds())%60,milliseconds:Math.floor(t.asMilliseconds())%1e3}},n3=e=>{let t=eu.default.duration(e);return{days:t.format(`DD`),hours:t.format(`HH`),minutes:t.format(`mm`),seconds:t.format(`ss`),milliseconds:t.format(`SSS`)}},r3=()=>(0,eu.default)(),i3=1e3,a3=(e,t)=>t>0?Math.floor(e/t)*t:e,o3=(e,t,n,r)=>r?Math.max(t-e,n??0):n===void 0?t+e:Math.min(t+e,n),s3=(e={})=>{let{countdown:t=!1,startMs:n=0,targetMs:r,interval:i=i3,autoStart:a=!1,onTick:o,onComplete:s}=e,[c,u]=l.useState(a?`running`:`idle`),[d,f]=l.useState(0),[p,m]=l.useState(r3),h=t?r??0:r,g=o3(a3(d,i),n,h,t),_=t3(g),v=n3(_),y=h!==void 0&&(t?g<=h:g>=h),b=l.useRef(o),x=l.useRef(s);return l.useEffect(()=>{b.current=o,x.current=s},[o,s]),l.useEffect(()=>{if(c!==`running`)return;let e=window.setInterval(()=>{let e=r3().diff(p),r=o3(a3(e,i),n,h,t),a=t3(r);f(e),b.current?.({value:r,time:a,formattedTime:n3(a)})},i);return()=>{window.clearInterval(e)}},[c,i,p,n,h,t]),l.useEffect(()=>{c!==`running`||!y||(u(`completed`),x.current?.())},[c,y]),{value:g,time:_,formattedTime:v,status:c,running:c===`running`,paused:c===`paused`,completed:c===`completed`,start:()=>{m(r3()),f(0),u(`running`)},pause:()=>{c===`running`&&(f(r3().diff(p)),u(`paused`))},resume:()=>{c===`paused`&&(m(r3().subtract(d,`millisecond`)),u(`running`))},reset:()=>{m(r3()),f(0),u(`idle`)}}},c3={root:`timer`};function l3(e,t){let{as:n=`div`,className:r,countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u,children:d,...f}=e,p=s3({countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u});return(0,q.jsx)(Q4.Provider,{value:p,children:(0,q.jsx)(n,{ref:t,className:G(c3.root,r),"data-component":`Timer`,"data-status":p.status,...f,children:d})})}l3.displayName=`Timer`;var u3=K(l3);const d3={root:`timer-action-trigger`},f3={start:e=>e!==`running`,pause:e=>e===`running`,resume:e=>e===`paused`,reset:e=>e!==`idle`};function p3(e,t){let{className:n,action:r,disabled:i,onClick:a,children:o,...s}=e,c=l.useContext(Q4),u=c.status??`idle`,d={start:c.start,pause:c.pause,resume:c.resume,reset:c.reset}[r];return(0,q.jsx)(pi,{ref:t,disabled:i??!f3[r](u),onClick:e=>{a?.(e),!e.defaultPrevented&&d?.()},className:G(d3.root,n),"data-component":`Timer.ActionTrigger`,"data-action":r,...s,children:o})}p3.displayName=`Timer.ActionTrigger`;var m3=K(p3);const h3={root:`timer-area`};function g3(e,t){let{as:n=`div`,className:r,...i}=e,{status:a}=l.useContext(Q4);return(0,q.jsx)(n,{ref:t,role:`timer`,className:G(h3.root,r),"data-component":`Timer.Area`,"data-status":a,...i})}g3.displayName=`Timer.Area`;var _3=K(g3);const v3={root:`timer-control`};function y3(e,t){let{as:n=`div`,className:r,...i}=e,{status:a}=l.useContext(Q4);return(0,q.jsx)(n,{ref:t,className:G(v3.root,r),"data-component":`Timer.Control`,"data-status":a,...i})}y3.displayName=`Timer.Control`;var b3=K(y3);const x3={root:`timer-item`};function S3(e,t){let{as:n=`div`,className:r,type:i,children:a,...o}=e,{formattedTime:s}=l.useContext(Q4);return(0,q.jsx)(n,{ref:t,className:G(x3.root,r),"data-component":`Timer.Item`,"data-unit":i,...o,children:a??s?.[i]})}S3.displayName=`Timer.Item`;var C3=K(S3);const w3={root:`timer-separator`};function T3(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(w3.root,r),"data-component":`Timer.Separator`,...i})}T3.displayName=`Timer.Separator`;var E3=K(T3);const D3=Object.assign(u3,{Root:u3,Area:_3,Item:C3,Separator:E3,Control:b3,ActionTrigger:m3});let O3=[],k3=0;const A3=new Set,j3=()=>{for(let e of A3)e()},M3=e=>(A3.add(e),()=>{A3.delete(e)}),N3=()=>O3,P3=[],F3=()=>P3,I3=e=>(O3=O3.some(t=>t.id===e.id)?O3.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...O3],j3(),e.id),L3=e=>(O3=O3.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),j3(),e),R3=e=>{O3=O3.filter(t=>t.id!==e),j3()},z3=()=>`toast-${++k3}`,B3=(e,t,n={})=>I3({...n,id:n.id??z3(),title:t,variant:e}),V3=(e,t)=>typeof e==`function`?e(t):e,H3=(e,t,n={})=>{let r=n.id??z3();B3(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){L3(r);return}B3(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,V3(t.success,e)),e=>i(`error`,V3(t.error,e))),r},U3=(e,t)=>B3(`default`,e,t),W3=Object.assign(U3,{message:U3,success:(e,t)=>B3(`success`,e,t),error:(e,t)=>B3(`error`,e,t),warning:(e,t)=>B3(`warning`,e,t),info:(e,t)=>B3(`info`,e,t),loading:(e,t)=>B3(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>I3({...t,id:t.id??z3(),variant:`default`,render:e}),promise:H3,dismiss:L3,getToasts:N3}),G3={root:`toast`,animated:`motion-safe:[transition:transform_var(--motion-transition-state-change),opacity_var(--motion-transition-state-change),height_var(--motion-transition-state-change)]`,grabbable:`toast-grabbable`,lift:{top:`toast-lift-top`,bottom:`toast-lift-bottom`},bridge:`toast-bridge`,bridgeTop:`toast-bridge-top`,bridgeBottom:`toast-bridge-bottom`,card:`toast-card`,iconColor:{default:``,success:`toast-icon-success`,error:`toast-icon-error`,warning:`toast-icon-warning`,info:`toast-icon-info`,loading:``},richColors:{default:``,success:`toast-rich-success`,error:`toast-rich-error`,warning:`toast-rich-warning`,info:`toast-rich-info`,loading:``},hidden:`opacity-0`,waiting:`pointer-events-none`,dragging:`select-none`,body:`toast-body motion-safe:[transition:opacity_var(--motion-transition-state-change)]`,bodyStacked:`opacity-0`,icon:`toast-icon`,content:`toast-content`,title:`toast-title`,description:`toast-description`,actions:`toast-actions`},K3={default:null,success:Xt,error:fn,warning:Gn,info:vn,loading:null},q3=e=>typeof e==`object`&&!!e&&`label`in e&&!l.isValidElement(e);function J3(e){let{toast:t,place:n,position:r,height:i,frontHeight:a,stackSize:o,expanded:s,visible:c,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=e,{id:h,variant:g,title:_,description:v,render:y}=t,b=t.duration??p.duration,x=t.dismissible??p.dismissible,S=t.closeButton??p.closeButton,C=t.richColors??p.richColors,w=t.important??p.important??!1,T=l.useRef(null),[E,D]=l.useState(!1),[O,k]=l.useState({x:0,y:0}),[A,j]=l.useState(!1),[M,N]=l.useState(!1),P=l.useRef(null),F=!!t.dismissed,I=n.index===0,L=E&&!s&&!I,ee=!!y,R=r.startsWith(`top`)?`top`:`bottom`,z=e=>{t.dismissed||(L3(h),e===`timeout`?t.onAutoClose?.(t):t.onDismiss?.(t))};l.useEffect(()=>{D(!0)},[]);let te=l.useRef({revision:-1,time:b});l.useEffect(()=>{if(te.current.revision!==t.revision&&(te.current={revision:t.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),n=window.setTimeout(()=>z(`timeout`),Math.max(te.current.time,0));return()=>{window.clearTimeout(n),te.current.time-=Date.now()-e}},[t,b,u,F]),l.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>R3(h),200);return()=>{window.clearTimeout(e)}},[F,h]),rr(()=>{let e=T.current;if(!e)return;let t=e.style.height;e.style.height=`auto`;let n=e.getBoundingClientRect().height;e.style.height=t,m(h,n)},[m,h,t.revision,_,v,s]);let ne=e=>d.includes(e),B=(e,t,n)=>e<0?ne(t)?e:0:ne(n)?e:0,re=e=>{!x||e.button!==0||e.target.closest(`button`)||(P.current={pointerId:e.pointerId,x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture?.(e.pointerId),j(!0))},V=e=>{let t=P.current;!t||t.pointerId!==e.pointerId||k({x:B(e.clientX-t.x,`left`,`right`),y:B(e.clientY-t.y,`top`,`bottom`)})},ie=e=>{let t=P.current;if(!t||t.pointerId!==e.pointerId)return;if(P.current=null,j(!1),Math.max(Math.abs(O.x),Math.abs(O.y))<45){k({x:0,y:0});return}let n=e.currentTarget.getBoundingClientRect(),r=(e,t)=>e===0?0:Math.sign(e)*(t+32);k({x:r(O.x,n.width),y:r(O.y,n.height)}),N(!0),z(`swipe`)},ae=()=>{P.current=null,j(!1),k({x:0,y:0})},oe=s?`calc(var(--toast-lift) * var(--toast-offset))`:`calc(var(--toast-lift) * var(--toaster-gap) * var(--toast-index))`,se=`calc(var(--toast-lift) * -100%)`,ce={"--toast-index":n.index,"--toast-offset":`${n.offset}px`,"--toast-z-index":o-n.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?a:i),"--toast-shift":E?!F||M?oe:I?se:s?`calc(${oe} + ${se})`:oe:se,"--toast-scale":L?Math.max(1-n.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},le=K3[g],ue=t.icon===void 0?f?.[g]:t.icon,de=ue===void 0?g===`loading`?(0,q.jsx)($r,{size:`small`,srText:null}):le?(0,q.jsx)(le,{}):null:ue,fe=(e,t,n)=>q3(e)?(0,q.jsx)(pi,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||z(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,pe=t.action!==void 0||t.cancel!==void 0;return(0,q.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:G(G3.root,G3.lift[R],G3.bridge,R===`top`?G3.bridgeTop:G3.bridgeBottom,x&&G3.grabbable,!ee&&G3.card,!ee&&G3.iconColor[g],!ee&&C&&G3.richColors[g],(!E||F||!c)&&G3.hidden,!c&&G3.waiting,A?G3.dragging:G3.animated,p.className,t.className),style:ce,"data-component":`Toast`,"data-variant":g,"data-position":r,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":s,"data-stacked":L,"data-visible":c,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:V,onPointerUp:ie,onPointerCancel:ae,children:ee?y?.(t):(0,q.jsxs)(`div`,{className:G(G3.body,L&&G3.bodyStacked),"data-component":`Toast.Body`,children:[de===null?null:(0,q.jsx)(`span`,{className:G3.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:de}),(0,q.jsxs)(`div`,{className:G3.content,"data-component":`Toast.Content`,children:[(0,q.jsx)(`div`,{className:G3.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,q.jsx)(`div`,{className:G3.description,"data-component":`Toast.Description`,children:v})]}),pe?(0,q.jsxs)(`div`,{className:G3.actions,"data-component":`Toast.Actions`,children:[fe(t.cancel,`cancel`,`invisible`),fe(t.action,`action`,`default`)]}):null,S&&x?(0,q.jsx)(gi,{icon:un,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>z(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}J3.displayName=`Toast`;const Y3=W(`toaster z-popover`,{variants:{position:{"top-left":`toaster-top-left`,"top-center":`toaster-top-center`,"top-right":`toaster-top-right`,"bottom-left":`toaster-bottom-left`,"bottom-center":`toaster-bottom-center`,"bottom-right":`toaster-bottom-right`}}}),X3=[`altKey`,`KeyT`],Z3=e=>typeof e==`number`?`${e}px`:e,Q3=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},$3=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),e6=()=>document.visibilityState===`hidden`,t6=()=>!1;function n6(e,t){let{position:n=`bottom-right`,expand:r=!1,visibleToasts:i=3,toastOptions:a,duration:o=4e3,closeButton:s=!1,richColors:c=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=X3,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=e,x=l.useSyncExternalStore(M3,N3,F3),S=l.useSyncExternalStore($3,e6,t6),C=l.useRef(null),w=ar(t,C),[T,E]=l.useState({}),[D,O]=l.useState(!1),k=r||D,A=l.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);l.useEffect(()=>{E(e=>{let t=Object.keys(e).filter(e=>x.some(t=>t.id===e));return t.length===Object.keys(e).length?e:Object.fromEntries(t.map(t=>[t,e[t]]))})},[x]);let j=x.filter(e=>!e.dismissed),M=new Map,N=0;j.forEach((e,t)=>{M.set(e.id,{index:t,offset:N}),N+=(T[e.id]??0)+u});let P=l.useRef(M);for(let e of x)if(!M.has(e.id)){let t=P.current.get(e.id);t&&M.set(e.id,t)}P.current=M;let F=j.length>0?T[j[0].id]??0:0;l.useEffect(()=>{let e=e=>{let t=C.current,n=t!==null&&(document.activeElement===t||t.contains(document.activeElement));if(e.code===`Escape`&&n){O(!1);return}m.every(t=>!!e[t]||e.code===t)&&(O(!0),C.current?.focus())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[m]);let I={duration:o,closeButton:s,richColors:c,dismissible:!0,...a},L=h??Q3(n);return(0,q.jsx)(ea,{children:(0,q.jsx)(`section`,{"aria-label":_,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,tabIndex:-1,"data-component":`Toaster.Region`,children:(0,q.jsx)(`ol`,{ref:w,tabIndex:-1,className:G(Y3({position:n}),v),style:{...y,"--toaster-width":Z3(p),"--toaster-viewport-offset":Z3(d),"--toaster-mobile-offset":Z3(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":n,"data-expanded":k,onPointerEnter:()=>O(!0),onPointerLeave:()=>O(!1),onFocus:()=>O(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||O(!1)},...b,children:x.map(e=>{let t=M.get(e.id)??{index:0,offset:0};return(0,q.jsx)(J3,{toast:e,place:t,position:n,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<i,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}n6.displayName=`Toaster`;var r6=K(n6);const i6=W(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),a6=`medium`,o6=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function s6(e,t){let{as:n=`span`,className:r,size:i=a6,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=o6({as:n,onClick:c.onClick,onFocus:c.onFocus,tabIndex:c.tabIndex,disabled:c.disabled});return(0,q.jsx)(n,{ref:t,onKeyDown:e=>{s?.(e),(e.key===`Backspace`||e.key===`Delete`)&&o?.()},className:G(i6({size:i,interactive:l}),r),"data-component":`Token`,"data-size":i,"data-interactive":l?``:void 0,"data-selected":a?``:void 0,...n===`button`?{type:`button`}:{},...c})}s6.displayName=`TokenBase`;var c6=K(s6);const l6=W(`token-remove-button`,{variants:{size:{small:`token-remove-button-small`,medium:`token-remove-button-medium`,large:`token-remove-button-large`,xlarge:`token-remove-button-xlarge`},raised:{true:`token-remove-button-raised`,false:``}}});function u6(e){let{className:t,size:n=a6,isParentInteractive:r,...i}=e,a=G(l6({size:n,raised:r}),t);return r?(0,q.jsx)(`span`,{"aria-hidden":`true`,tabIndex:-1,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(un,{})}):(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(un,{})})}u6.displayName=`Token.RemoveButton`;const d6={root:`token-text`,interactive:`token-text-interactive`};function f6(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,q.jsx)(n,{ref:t,className:G(d6.root,i&&d6.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}f6.displayName=`Token.Text`;var p6=K(f6);const m6={srOnly:`sr-only`},h6=W(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),g6=W(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),_6=e=>l.isValidElement(e)?e:(0,q.jsx)(e,{});function v6(e,t){let{as:n,className:r,text:i,size:a=a6,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=o6({as:n,onClick:d,onFocus:f.onFocus,tabIndex:f.tabIndex,disabled:f.disabled}),m=!!s&&!c,h=p&&m,g={as:n,href:u,onClick:d},_=e=>{e.stopPropagation(),s?.()};return(0,q.jsxs)(c6,{ref:t,size:a,isSelected:l,onRemove:s,className:G(h6({interactive:p,selected:l,withRemoveButton:m}),r),"data-has-remove-button":m?``:void 0,...h?{}:g,...f,children:[o&&a!==`small`?(0,q.jsx)(`span`,{className:G(g6({size:a})),"data-component":`Token.LeadingVisual`,children:_6(o)}):null,(0,q.jsxs)(p6,{interactive:h,...h?g:{},children:[i,s?(0,q.jsx)(`span`,{className:m6.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,q.jsx)(u6,{size:a,isParentInteractive:p,onClick:_}):null]})}v6.displayName=`Token`;var y6=K(v6);const b6=`#999999`,x6=.6,S6=(e,t,n)=>Math.max(t,Math.min(e,n)),C6=e=>S6(Math.round(e),0,100),w6=e=>{let t=e.trim();if(t.startsWith(`#`)){let e=t.slice(1);if(e.length===3){let[t,n,r]=[...e].map(e=>parseInt(e+e,16));return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}if(e.length===6){let t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),r=parseInt(e.slice(4,6),16);return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}return null}let n=t.match(/^rgba?\(([^)]+)\)$/i);if(!n)return null;let r=n[1].split(/[\s,/]+/).filter(Boolean).map(Number);if(r.length<3||r.slice(0,3).some(Number.isNaN))return null;let[i,a,o]=r;return{r:i,g:a,b:o}},T6=({r:e,g:t,b:n})=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2;if(c===0)return{h:0,s:0,l:Math.round(l*100)};let u=c/(1-Math.abs(2*l-1)),d;return d=o===r?(i-a)/c%6:o===i?(a-r)/c+2:(r-i)/c+4,d=Math.round(d*60),{h:d<0?d+360:d,s:Math.round(u*100),l:Math.round(l*100)}},E6=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,D6=e=>{let t=w6(e)??w6(`#999999`),{h:n,s:r,l:i}=T6(t),a=E6(t),{r:o,g:s,b:c}=t,l=S6(1/(.453-a),0,1),u=S6((a-.96)*100,0,1),d=(x6-a)*100*S6(1/(x6-a),0,1),f=C6(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${C6(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${C6(i-5)}%)`},dark:{background:`rgba(${o}, ${s}, ${c}, 0.18)`,foreground:`hsl(${n}deg, ${r}%, ${f}%)`,border:`hsla(${n}deg, ${r}%, ${f}%, 0.3)`,ring:`hsl(${n}deg, ${r}%, ${f}%)`,backgroundHover:`hsla(${n}deg, ${r}%, ${C6(i+10)}%, 0.3)`}}},O6={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function k6(e,t){let{as:n,className:r,style:i,text:a,size:o=a6,fillColor:s=b6,onRemove:c,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=e,h=l.useMemo(()=>D6(s),[s]),g=o6({as:n,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!c&&!u,v=g&&_,y={as:n,href:f,onClick:p},b=e=>{e.stopPropagation(),c?.()};return(0,q.jsxs)(c6,{ref:t,size:o,isSelected:d,onRemove:c,className:G(O6.root,g&&O6.interactive,d&&O6.selected,_&&O6.withRemoveButton,r),style:{...i,"--issue-label-background":h.light.background,"--issue-label-foreground":h.light.foreground,"--issue-label-border":h.light.border,"--issue-label-ring":h.light.ring,"--issue-label-background-hover":h.light.backgroundHover,"--issue-label-dark-background":h.dark.background,"--issue-label-dark-foreground":h.dark.foreground,"--issue-label-dark-border":h.dark.border,"--issue-label-dark-ring":h.dark.ring,"--issue-label-dark-background-hover":h.dark.backgroundHover},"data-component":`IssueLabelToken`,"data-has-remove-button":_?``:void 0,...v?{}:y,...m,children:[(0,q.jsxs)(p6,{interactive:v,...v?y:{},children:[a,c?(0,q.jsx)(`span`,{className:O6.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,q.jsx)(u6,{size:o,isParentInteractive:g,onClick:b}):null]})}k6.displayName=`IssueLabelToken`;var A6=K(k6);const j6={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function M6(e,t){let{as:n=`a`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(j6.root,j6.interactive,j6.hover,r),"data-component":`TopicTag`,...i})}M6.displayName=`TopicTag`;var N6=K(M6);const P6={root:`topic-tag-group`};function F6(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(P6.root,r),"data-component":`TopicTag.Group`,...i})}F6.displayName=`TopicTag.Group`;var I6=K(F6);const L6=Object.assign(N6,{Group:I6}),R6=(0,l.createContext)(null),z6=(0,l.createContext)(null),B6=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,V6=e=>e!==null&&e.effect===void 0,H6=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function U6(e){let{steps:t,step:n,defaultStep:r=null,onStepChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,onStatusChange:c,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=e,_=Y(h),v=`${_}-title`,y=`${_}-description`,b=l.useRef(null),x=a!==void 0,[S,C]=l.useState(o),w=x?a:S,T=n!==void 0,[E,D]=l.useState(r),O=T?n:E,k=t.length,A=t.findIndex(e=>e.id===O),j=A===-1?null:t[A],M=l.useCallback(e=>{T||D(e),i?.({stepId:e,stepIndex:t.findIndex(t=>t.id===e),count:t.length})},[T,i,t]),N=l.useCallback(e=>{x||C(e),s?.(e)},[x,s]),P=l.useCallback(e=>{let n=e??t[0]?.id??null;M(n),N(!0),c?.({status:`started`})},[N,M,c,t]),F=l.useCallback(e=>{t.some(t=>t.id===e)&&M(e)},[M,t]),I=l.useCallback(()=>{M(null),N(!1)},[N,M]),L=l.useCallback(()=>{I(),c?.({status:`dismissed`})},[I,c]),ee=l.useCallback(()=>{let e=t[A+1];if(!e){I(),c?.({status:`completed`});return}M(e.id)},[M,I,c,A,t]),R=l.useCallback(()=>{let e=A>0?t[A-1]:void 0;e&&M(e.id)},[M,A,t]),[z,te]=l.useState(()=>({stepId:O,ready:V6(j),patch:null}));z.stepId!==O&&te({stepId:O,ready:V6(j),patch:null});let ne=z.stepId===O?z:null,B=ne?.ready??V6(j),re=ne?.patch??null,V=l.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ie=B6(V),ae=l.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});rr(()=>{ae.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let oe=l.useMemo(()=>({next:()=>ae.current.next(),prev:()=>ae.current.prev(),goto:e=>ae.current.goto(e),dismiss:()=>ae.current.dismiss(),show:()=>te(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>te(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>ae.current.step?.target?.()??null}),[O]);l.useEffect(()=>{if(w)return ae.current.step?.effect?.(oe)??void 0},[oe,w]);let se=l.useCallback(()=>ae.current.step?.target?.()??null,[]),[ce,le]=l.useState(null),ue=l.useCallback(()=>{let e=se();if(!e){le(null);return}let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect(),a={top:t,left:n,width:r,height:i};le(e=>e&&H6(e,a)?e:a)},[se]);rr(()=>{if(!w||!B){le(null);return}ue();let e=se();e?.scrollIntoView?.({block:`center`,inline:`nearest`});let t=new ResizeObserver(ue);return e&&t.observe(e),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{t.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[se,ue,w,B,O]),Hi(e=>{!w||!d||(e.preventDefault(),L())}),l.useEffect(()=>{if(!w||!B||!u)return;let e=e=>{e.defaultPrevented||(e.key===`ArrowRight`?(e.preventDefault(),ee()):e.key===`ArrowLeft`&&(e.preventDefault(),R()))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u,ee,w,R,B]),l.useEffect(()=>{if(!w||!B||!f)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(b.current?.contains(t)||se()?.contains(t)||L())};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,L,se,w,B]),l.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let de=l.useMemo(()=>({open:w,step:V,stepIndex:A,steps:t,start:P,next:ee,prev:R,goto:F,dismiss:L,progressText:`${A+1} of ${k}`,progressPercent:k===0?0:(A+1)/k*100,hasNext:A>-1&&A<k-1,hasPrev:A>0}),[k,L,F,ee,w,R,P,V,A,t]),fe=l.useMemo(()=>({...de,titleId:v,descriptionId:y,stepType:ie,ready:B,targetRect:ce,getTarget:se,spotlightOffset:p,spotlightRadius:m,contentRef:b}),[de,y,se,B,p,m,ie,ce,v]);return(0,q.jsx)(R6.Provider,{value:fe,children:g})}U6.displayName=`Tour`;const W6=[];function G6(e){let t=l.useContext(R6);return(0,q.jsx)(q.Fragment,{children:e.children(t?.step?.actions??W6)})}G6.displayName=`Tour.Actions`;const K6={root:`tour-action-trigger`};function q6(e,t){let{action:n,className:r,children:i,onClick:a,variant:o=`default`,...s}=e,c=l.useContext(R6);return c?(0,q.jsx)(pi,{ref:t,variant:o,className:G(K6.root,r),onClick:e=>{if(a?.(e),!e.defaultPrevented){if(typeof n.action==`function`){n.action(c);return}n.action===`next`?c.next():n.action===`prev`?c.prev():c.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof n.action==`string`?n.action:`custom`,...s,children:i??n.label}):null}q6.displayName=`Tour.ActionTrigger`;var J6=K(q6);const Y6={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},X6={top:{start:`-left`,center:``,end:`-right`},bottom:{start:`-left`,center:``,end:`-right`},left:{start:`-top`,center:``,end:`-bottom`},right:{start:`-top`,center:``,end:`-bottom`}};function Z6(e,t){let n=l.useContext(R6),r=l.useContext(z6);if(!n||!r||n.stepType!==`tooltip`||n.step?.arrow===!1)return null;let i=Y6[r.side],a=`${i}${X6[i][r.align]}`;return(0,q.jsx)(nd,{ref:t,location:a,"data-component":`Tour.Arrow`,...e})}Z6.displayName=`Tour.Arrow`;var Q6=K(Z6);const $6=W([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function e8(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(R6);if(!o||!o.open||!o.ready||o.step?.backdrop===!1)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,q.jsx)(ea,{containerName:i,children:(0,q.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:G($6({spotlit:s!==null}),n),style:{...r,"--tour-target-top":`${(s?.top??0)-c}px`,"--tour-target-left":`${(s?.left??0)-c}px`,"--tour-target-width":`${(s?.width??0)+c*2}px`,"--tour-target-height":`${(s?.height??0)+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":s?``:void 0,...a})})}e8.displayName=`Tour.Backdrop`;var t8=K(e8);const n8={root:`tour-close-trigger`};function r8(e,t){let{className:n,icon:r=un,onClick:i,"aria-label":a=`Close tour`,...o}=e,s=l.useContext(R6);return s?(0,q.jsx)(gi,{ref:t,icon:r,variant:`invisible`,size:`small`,"aria-label":a,className:G(n8.root,n),onClick:e=>{i?.(e),!e.defaultPrevented&&s.dismiss()},"data-component":`Tour.CloseTrigger`,...o}):null}r8.displayName=`Tour.CloseTrigger`;var i8=K(r8);const a8={root:`tour-content`};function o8(e,t){let{className:n,...r}=e,i=l.useContext(R6),a=ar(t,i?.contentRef??null),o=i?.step?.id??null,s=i?.ready??!1,c=i?.contentRef;return l.useEffect(()=>{!s||!o||c?.current?.focus()},[c,s,o]),!i||!i.open||!i.ready||!i.step?null:(0,q.jsx)(`div`,{ref:a,role:`dialog`,"aria-labelledby":i.step.title?i.titleId:void 0,"aria-describedby":i.step.description?i.descriptionId:void 0,tabIndex:-1,className:G(a8.root,n),"data-component":`Tour.Content`,"data-type":i.stepType,"data-step":i.step.id,...r})}o8.displayName=`Tour.Content`;var s8=K(o8);const c8={root:`tour-control`};function l8(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(c8.root,n),"data-component":`Tour.Control`,...r})}l8.displayName=`Tour.Control`;var u8=K(l8);const d8={root:`tour-description`};function f8(e,t){let{className:n,children:r,...i}=e,a=l.useContext(R6);return a?(0,q.jsx)(`div`,{ref:t,id:a.descriptionId,className:G(d8.root,n),"data-component":`Tour.Description`,...i,children:r??a.step?.description}):null}f8.displayName=`Tour.Description`;var p8=K(f8);const m8=W([`tour-positioner`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short motion-safe:data-[side=outside-bottom]:slide-in-from-top-2 motion-safe:data-[side=outside-top]:slide-in-from-bottom-2 motion-safe:data-[side=outside-right]:slide-in-from-left-2 motion-safe:data-[side=outside-left]:slide-in-from-right-2`],{variants:{type:{dialog:`tour-positioner-dialog`,tooltip:`tour-positioner-tooltip`,floating:`tour-positioner-floating`},unplaced:{true:`invisible`,false:``}}}),h8=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function g8(e,t){let{side:n=`outside-bottom`,align:r=`center`,placement:i=`bottom-end`,portalContainerName:a,className:o,style:s,children:c,...u}=e,d=l.useContext(R6),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??n,g=f?.align??r,_=f?.placement??i,v=!!(d?.open&&d.ready&&f),y=l.useRef(null),b=ar(t,y),x=l.useRef(null),[S,C]=l.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=l.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=aa(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&h8(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return rr(()=>{if(!v||!m){x.current=null,C(null);return}E();let e=new ResizeObserver(E);return y.current&&e.observe(y.current),()=>{e.disconnect()}},[m,v,d?.targetRect,E]),!d||!v?null:(0,q.jsx)(ea,{containerName:a,children:(0,q.jsx)(`div`,{ref:b,className:G(m8({type:p,unplaced:m&&!S}),o),style:{...s,"--tour-positioner-top":`${S?.top??0}px`,"--tour-positioner-left":`${S?.left??0}px`},"data-component":`Tour.Positioner`,"data-type":p,"data-side":S?.anchorSide??h,"data-align":S?.anchorAlign??g,"data-placement":p===`floating`?_:void 0,...u,children:(0,q.jsx)(z6.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:c})})})}g8.displayName=`Tour.Positioner`;var _8=K(g8);const v8={root:`tour-progress-text`};function y8(e,t){let{className:n,children:r,...i}=e,a=l.useContext(R6);return a?(0,q.jsx)(`div`,{ref:t,className:G(v8.root,n),"data-component":`Tour.ProgressText`,...i,children:r??a.progressText}):null}y8.displayName=`Tour.ProgressText`;var b8=K(y8);const x8={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function S8(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(R6);if(!o||!o.open||!o.ready||!o.targetRect)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,q.jsx)(ea,{containerName:i,children:(0,q.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:G(x8.root,n),style:{...r,"--tour-target-top":`${s.top-c}px`,"--tour-target-left":`${s.left-c}px`,"--tour-target-width":`${s.width+c*2}px`,"--tour-target-height":`${s.height+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...a})})}S8.displayName=`Tour.Spotlight`;var C8=K(S8);const w8={root:`tour-title`};function T8(e,t){let{className:n,children:r,...i}=e,a=l.useContext(R6);return a?(0,q.jsx)(`h2`,{ref:t,id:a.titleId,className:G(w8.root,n),"data-component":`Tour.Title`,...i,children:r??a.step?.title}):null}T8.displayName=`Tour.Title`;var E8=K(T8);const D8=()=>{let e=(0,l.useContext)(R6);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},O8=(e,{timeout:t=1e4}={})=>{let n=null,r=!1,i=()=>{r=!0,n!==null&&(cancelAnimationFrame(n),n=null)};return[new Promise(a=>{let o=Date.now()+t,s=()=>{if(r)return;let t=e();if(t){i(),a(t);return}if(Date.now()>=o){i(),a(null);return}n=requestAnimationFrame(s)};s()}),i]},k8=(e,t,n={})=>{let{predicate:r,...i}=n,a=()=>{};return[new Promise(n=>{let o=e?.();if(!o){n(null);return}let s=e=>{r&&!r(o)||(a(),n(e))};o.addEventListener(t,s,i),a=()=>o.removeEventListener(t,s,i)}),()=>a()]},A8=(e,t)=>O8(e,t),j8=(e,t,n)=>O8(()=>{let n=e();return n&&n.value===t?n:null},n),M8=Object.assign(U6,{Backdrop:t8,Spotlight:C8,Positioner:_8,Content:s8,Arrow:Q6,CloseTrigger:i8,ProgressText:b8,Title:E8,Description:p8,Control:u8,Actions:G6,ActionTrigger:J6}),N8={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function P8(e,t){let{as:n=`div`,className:r,title:i,maxWidth:a=125,inline:o,expandable:s,style:c,...l}=e;return(0,q.jsx)(n,{ref:t,title:i,className:G(N8.root,o?N8.inline:N8.block,s&&N8.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}P8.displayName=`Truncate`;var F8=K(P8);const I8=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=(0,l.useState)(e),[a,o]=(0,l.useState)(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},L8=(0,l.createContext)({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),R8=()=>(0,l.useContext)(L8),z8=(e,t)=>{let{colorScheme:n}=R8();return(n?e[n]:void 0)??t},B8=`(prefers-color-scheme: dark)`,V8=e=>{let t=window?.matchMedia?.(B8);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},H8=()=>window?.matchMedia?.(B8)?.matches?`night`:`day`,U8=()=>`day`,W8=()=>l.useSyncExternalStore(V8,H8,U8),G8=(e,t)=>e===`auto`?t:e,K8=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function q8({children:e,className:t,contextOnly:n,...r}){let{colorMode:i,dayScheme:a,nightScheme:o}=R8(),[s,c]=I8(r.colorMode??i??`day`),[u,d]=I8(r.dayScheme??a??`light`),[f,p]=I8(r.nightScheme??o??`dark`),m=W8(),h=G8(s,m),g=K8(h,u,f),_=l.useMemo(()=>({colorScheme:g,colorMode:s,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:c,setDayScheme:d,setNightScheme:p}),[g,s,h,u,f,c,d,p]);return n?(0,q.jsx)(L8.Provider,{value:_,children:e}):(0,q.jsx)(L8.Provider,{value:_,children:(0,q.jsx)(`div`,{className:t,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":s,children:e})})}q8.displayName=`ThemeProvider`,exports.ARROW_KEY_STEP=3,exports.AUTO_LOCALE=`auto`,exports.Accordion=ur,exports.AccordionContext=Dt,exports.AccordionHeader=Yn,exports.AccordionItem=Qn,exports.AccordionItemContext=Kn,exports.AccordionPanel=lr,exports.ActionBar=qa,exports.ActionBarButton=Ka,exports.ActionBarContext=ya,exports.ActionBarDivider=wa,exports.ActionBarGroup=Da,exports.ActionBarIconButton=Aa,exports.ActionBarItemContext=ba,exports.ActionBarMenu=Fa,exports.ActionList=ji,exports.ActionListContainerContext=Ar,exports.ActionListContext=Er,exports.ActionListDescription=Rr,exports.ActionListDivider=Br,exports.ActionListGroup=Yr,exports.ActionListGroupContext=Vr,exports.ActionListGroupHeading=Kr,exports.ActionListHeading=kr,exports.ActionListItem=Oi,exports.ActionListItemContext=Ir,exports.ActionListLeadingVisual=ni,exports.ActionListLinkItem=Ai,exports.ActionListSubItem=ri,exports.ActionListTrailingAction=yi,exports.ActionListTrailingVisual=bi,exports.ActionMenu=ma,exports.ActionMenuAnchor=Ni,exports.ActionMenuButton=Pi,exports.ActionMenuContext=Mi,exports.ActionMenuOverlay=pa,exports.Alert=Xa,exports.AnchoredOverlay=da,exports.AspectRatio=$a,exports.Attachment=ko,exports.AttachmentAction=oo,exports.AttachmentActions=lo,exports.AttachmentContent=po,exports.AttachmentContext=eo,exports.AttachmentDescription=go,exports.AttachmentGroup=yo,exports.AttachmentMedia=So,exports.AttachmentTitle=To,exports.AttachmentTrigger=Oo,exports.Autocomplete=cs,exports.AutocompleteContext=Ao,exports.AutocompleteDeferredInputContext=Mo,exports.AutocompleteInput=Zo,exports.AutocompleteInputContext=jo,exports.AutocompleteMenu=rs,exports.AutocompleteOverlay=ss,exports.Avatar=ec,exports.AvatarContext=us,exports.AvatarFallback=Xs,exports.AvatarImage=$s,exports.AvatarStack=lc,exports.Badge=mc,exports.Banner=Ic,exports.BannerContext=hc,exports.BannerDescription=_c,exports.BannerPrimaryAction=Nc,exports.BannerSecondaryAction=Fc,exports.BannerTitle=bc,exports.Blankslate=al,exports.BlankslateDescription=Hc,exports.BlankslateHeading=Gc,exports.BlankslatePrimaryAction=Xc,exports.BlankslateSecondaryAction=tl,exports.BlankslateVisual=il,exports.Blockquote=cl,exports.Box=dl,exports.Breadcrumbs=Sl,exports.BreadcrumbsContext=pl,exports.BreadcrumbsItem=xl,exports.Bubble=Rl,exports.BubbleContent=jl,exports.BubbleContext=wl,exports.BubbleGroup=Pl,exports.BubbleGroupContext=Tl,exports.BubbleReactions=Ll,exports.Button=pi,exports.ButtonGroup=Gl,exports.CHART_COLORS=Pd,exports.CHART_OVERFLOW_COLOR=Nd,exports.CHART_SERIES_COLORS=Md,exports.Calendar=Tu,exports.CalendarDay=Jl,exports.Card=Zu,exports.CardAction=Ou,exports.CardDescription=Mu,exports.CardHeading=Fu,exports.CardIcon=Ru,exports.CardImage=Vu,exports.CardMetadata=Wu,exports.Caret=nd,exports.Carousel=Td,exports.CarouselContext=id,exports.CarouselControls=_d,exports.CarouselIndicators=cd,exports.CarouselNextButton=ud,exports.CarouselPlayButton=fd,exports.CarouselPreviousButton=md,exports.CarouselSlide=bd,exports.CarouselSlideContext=ad,exports.Chart=Jd,exports.ChartContext=Ed,exports.ChartGradient=jd,exports.ChartLegend=Hd,exports.ChartRadialText=Gd,exports.ChartTooltip=qd,exports.Checkbox=$d,exports.CheckboxCard=hf,exports.CheckboxCardContext=ef,exports.CheckboxCardDescription=rf,exports.CheckboxCardLabel=sf,exports.CheckboxCardLeadingVisual=uf,exports.CheckboxGroup=jf,exports.CheckboxGroupCaption=vf,exports.CheckboxGroupContext=Yd,exports.CheckboxGroupLabel=xf,exports.CheckboxGroupValidation=Ef,exports.Clipboard=lp,exports.ClipboardContext=Mf,exports.ClipboardControl=Hf,exports.ClipboardCopyText=Gf,exports.ClipboardIndicator=Jf,exports.ClipboardInput=$f,exports.ClipboardLabel=np,exports.ClipboardTrigger=ap,exports.ClipboardValueText=cp,exports.Code=fp,exports.CodeBlock=Fp,exports.CodeBlockCode=wp,exports.CodeBlockContent=Op,exports.CodeBlockContext=pp,exports.CodeBlockHeader=jp,exports.CodeBlockTitle=Pp,exports.Collapsible=Kp,exports.CollapsibleContent=Hp,exports.CollapsiblePanel=Hp,exports.CollapsibleContext=Ip,exports.CollapsibleTrigger=Gp,exports.Combobox=Gm,exports.ComboboxClearTrigger=tm,exports.ComboboxContent=im,exports.ComboboxContext=qp,exports.ComboboxControl=sm,exports.ComboboxEmpty=um,exports.ComboboxInput=hm,exports.ComboboxItem=ym,exports.ComboboxItemContext=Yp,exports.ComboboxItemGroup=Sm,exports.ComboboxItemGroupContext=Jp,exports.ComboboxItemGroupLabel=Tm,exports.ComboboxItemIndicator=Om,exports.ComboboxItemText=jm,exports.ComboboxLabel=Pm,exports.ComboboxList=Lm,exports.ComboboxPositioner=Vm,exports.ComboboxTrigger=Wm,exports.CommandPalette=kh,exports.CommandPaletteContext=Ym,exports.CommandPaletteDialog=sh,exports.CommandPaletteEmpty=uh,exports.CommandPaletteGroup=ph,exports.CommandPaletteGroupContext=Xm,exports.CommandPaletteInput=gh,exports.CommandPaletteItem=yh,exports.CommandPaletteList=Sh,exports.CommandPaletteLoading=Th,exports.CommandPaletteSeparator=Oh,exports.ConfirmationDialog=fg,exports.ContextMenu=Sg,exports.ContextMenuContext=hg,exports.ContextMenuOverlay=yg,exports.ContextMenuTrigger=xg,exports.CounterLabel=si,exports.DAYS_IN_WEEK=7,exports.DAY_KEY_FORMAT=au,exports.DEFAULT_AVATAR_SIZE=20,exports.DEFAULT_COLOR_MODE=`day`,exports.DEFAULT_CURRENT_STEP=1,exports.DEFAULT_DIRECTION=`ltr`,exports.DEFAULT_FLOATING_PANEL_MIN_SIZE=fb,exports.DEFAULT_FLOATING_PANEL_POSITION=db,exports.DEFAULT_FLOATING_PANEL_SIZE=ub,exports.DEFAULT_ISSUE_LABEL_FILL_COLOR=b6,exports.DEFAULT_LOCALE=ms,exports.DEFAULT_MAP_LATITUDE=NG,exports.DEFAULT_MAP_LONGITUDE=PG,exports.DEFAULT_MAP_ZOOM=16,exports.DEFAULT_MARKDOWN_NAMESPACE=UG,exports.DEFAULT_MARKER_COLOR=hB,exports.DEFAULT_MARQUEE_SPEED=50,exports.DEFAULT_MAX_PREVIEW_ITEMS=5,exports.DEFAULT_RATING_COUNT=5,exports.DEFAULT_RELATIVE_TIME_PREFIX=`on`,exports.DEFAULT_RELATIVE_TIME_THRESHOLD=LQ,exports.DEFAULT_RICH_TEXT_EDITOR_CONTROLS=O$,exports.DEFAULT_RICH_TEXT_EDITOR_NAMESPACE=v$,exports.DEFAULT_SORT_DIRECTION=`ASC`,exports.DEFAULT_SPOTLIGHT_OFFSET=4,exports.DEFAULT_SPOTLIGHT_RADIUS=8,exports.DEFAULT_TABLE_OF_CONTENTS_ROOT_MARGIN=F2,exports.DEFAULT_TABLE_PAGE_SIZE=25,exports.DEFAULT_TABLE_SKELETON_ROWS=10,exports.DEFAULT_TEXTAREA_COLS=30,exports.DEFAULT_TEXTAREA_RESIZE=uS,exports.DEFAULT_TEXTAREA_ROWS=7,exports.DEFAULT_TIMER_INTERVAL=i3,exports.DEFAULT_TOKEN_SIZE=a6,exports.DEFAULT_TRUNCATE_MAX_WIDTH=125,exports.DataTable=G_,exports.DatePicker=X_,exports.Details=rv,exports.DetailsSummary=nv,exports.Dialog=iv,exports.DialogBody=Fh,exports.DialogButtons=Lh,exports.DialogCloseButton=zh,exports.DialogContext=Ih,exports.DialogFooter=Hh,exports.DialogHeader=Gh,exports.DialogSubtitle=Jh,exports.DialogTitle=Zh,exports.DirectionContext=Is,exports.DirectionProvider=eE,exports.DragHandle=lY,exports.Drawer=kv,exports.DrawerBody=sv,exports.DrawerCloseButton=dv,exports.DrawerContext=cv,exports.DrawerFooter=mv,exports.DrawerHeader=_v,exports.DrawerSubtitle=bv,exports.DrawerTitle=Cv,exports.Em=Mv,exports.EmptyState=Lv,exports.FLOATING_PANEL_LARGE_STEP=40,exports.FLOATING_PANEL_STEP=8,exports.FRAME_ROOT_CLASS=HS,exports.FileUpload=yy,exports.FileUploadContext=Uv,exports.FileUploadDescription=Kv,exports.FileUploadIcon=Yv,exports.FileUploadItem=vy,exports.FileUploadLabel=Qv,exports.FileUploadList=ty,exports.FilteredActionList=lb,exports.FilteredActionListBodyLoader=ib,exports.FilteredActionListInput=Gy,exports.FilteredActionListItem=Jy,exports.FloatingPanel=ax,exports.FloatingPanelBody=Eb,exports.FloatingPanelCloseTrigger=Ob,exports.FloatingPanelContent=Mb,exports.FloatingPanelContext=xb,exports.FloatingPanelControl=Fb,exports.FloatingPanelDragTrigger=Rb,exports.FloatingPanelHeader=Vb,exports.FloatingPanelPositioner=Wb,exports.FloatingPanelResizeTrigger=Yb,exports.FloatingPanelStageTrigger=Qb,exports.FloatingPanelTitle=tx,exports.FloatingPanelTrigger=ix,exports.Flow=Px,exports.FlowContext=dx,exports.FlowList=mx,exports.FlowNode=_x,exports.FlowParallel=bx,exports.FormControl=FS,exports.FormControlCaption=vS,exports.FormControlContext=Yf,exports.FormControlLabel=xS,exports.FormControlLeadingVisual=wS,exports.FormControlValidation=kS,exports.FormatByte=LS,exports.FormatNumber=zS,exports.Frame=KS,exports.Header=nC,exports.HeaderItem=QS,exports.HeaderLink=tC,exports.Heading=Tr,exports.Hidden=aC,exports.Highlight=fC,exports.HoverCard=xC,exports.HoverCardContent=gC,exports.HoverCardContext=pC,exports.HoverCardTrigger=_C,exports.IconButton=gi,exports.Image=wC,exports.InlineMessage=AC,exports.IssueLabelToken=A6,exports.JSONTreeView=JT,exports.JSONTreeViewContext=yT,exports.KeybindingHint=Pw,exports.Label=ZT,exports.LabelGroup=cE,exports.LayerCard=yE,exports.LayerCardPrimary=dE,exports.LayerCardSecondary=mE,exports.Link=$c,exports.LinkButton=xE,exports.List=OE,exports.ListItem=DE,exports.LocaleContext=Ls,exports.LocaleProvider=Hs,exports.MARKDOWN_NODES=WG,exports.MARKDOWN_TRANSFORMERS=GG,exports.Map=zG,exports.MapAttributionControl=yU,exports.MapDragRotateAndZoomInteraction=lG,exports.MapDrawControl=tG,exports.MapFullScreenControl=OU,exports.MapGraticuleLayer=FB,exports.MapHeatmapLayer=pU,exports.MapImageLayer=NB,exports.MapLayerGroup=OB,exports.MapLayersControl=iG,exports.MapLinkInteraction=jG,exports.MapMarker=SB,exports.MapMousePositionControl=LU,exports.MapOverlay=wB,exports.MapOverviewMapControl=VU,exports.MapPointerInteraction=mG,exports.MapScaleLineControl=NU,exports.MapSearchControl=oG,exports.MapSelectInteraction=wG,exports.MapTileLayer=kB,exports.MapTranslateInteraction=pG,exports.MapVectorLayer=PB,exports.MapView=cB,exports.MapWebGLTileLayer=gU,exports.Mark=cC,exports.Markdown=JG,exports.Marquee=mK,exports.MarqueeContent=iK,exports.MarqueeContext=YG,exports.MarqueeEdge=sK,exports.MarqueeItem=uK,exports.MarqueeViewport=pK,exports.Message=PK,exports.MessageAvatar=xK,exports.MessageContent=wK,exports.MessageContext=Cl,exports.MessageFooter=DK,exports.MessageGroup=AK,exports.MessageGroupContext=hK,exports.MessageHeader=NK,exports.Meter=iq,exports.MeterContext=zK,exports.MeterIndicator=HK,exports.MeterLabel=GK,exports.MeterTrack=JK,exports.MeterValue=ZK,exports.NativeSelect=lq,exports.NativeSelectOptGroup=oq,exports.NativeSelectOption=cq,exports.NavigationList=zq,exports.NavigationListGroup=xq,exports.NavigationListGroupExpand=Fq,exports.NavigationListGroupHeading=Rq,exports.NavigationListHeading=dq,exports.NavigationListItem=Mq,exports.NavigationListSubNavigation=Oq,exports.NavigationMenu=NJ,exports.NavigationMenuContent=tJ,exports.NavigationMenuContext=Hq,exports.NavigationMenuDepthContext=Kq,exports.NavigationMenuDescription=rJ,exports.NavigationMenuDivider=aJ,exports.NavigationMenuGroup=uJ,exports.NavigationMenuGroupHeading=sJ,exports.NavigationMenuHeading=Vq,exports.NavigationMenuHeadingLevelContext=Gq,exports.NavigationMenuItem=pJ,exports.NavigationMenuItemContext=Uq,exports.NavigationMenuLeadingVisual=gJ,exports.NavigationMenuLink=TJ,exports.NavigationMenuLinkContext=Wq,exports.NavigationMenuList=kJ,exports.NavigationMenuSubNavigation=yJ,exports.NavigationMenuTrailingVisual=xJ,exports.NavigationMenuTrigger=MJ,exports.NumberInput=LJ,exports.OverflowObserverContext=ha,exports.OverflowObserverProvider=ga,exports.PINInput=KY,exports.PageLayout=kY,exports.PageLayoutContent=TY,exports.PageLayoutContext=zJ,exports.PageLayoutFooter=GJ,exports.PageLayoutHeader=JJ,exports.PageLayoutPane=OY,exports.PageLayoutSidebar=gY,exports.Pagination=LY,exports.PasswordInput=BY,exports.Placeholder=YY,exports.PlatformContext=Sw,exports.Popover=iX,exports.PopoverContent=rX,exports.PopoverContext=XY,exports.Portal=ea,exports.PortalContext=Gi,exports.ProgressBar=my,exports.ProgressBarItem=uy,exports.ProgressCircle=cX,exports.QRCode=KZ,exports.RICH_TEXT_EDITOR_NODES=y$,exports.Radio=Hx,exports.RadioCard=sQ,exports.RadioCardContext=qZ,exports.RadioCardDescription=XZ,exports.RadioCardLabel=$Z,exports.RadioCardLeadingVisual=nQ,exports.RadioGroup=SQ,exports.RadioGroupCaption=uQ,exports.RadioGroupContext=zx,exports.RadioGroupLabel=pQ,exports.RadioGroupValidation=vQ,exports.Rating=kQ,exports.RelativeTime=e$,exports.Resizable=g$,exports.ResizablePanel=o$,exports.ResizableResizeTrigger=l$,exports.ResizableResizeTriggerIndicator=f$,exports.ResizableResizeTriggerSeparator=h$,exports.RichTextEditor=P$,exports.RichTextEditorContent=D$,exports.RichTextEditorToolbar=N$,exports.SCREEN_READER_DELAY=500,exports.ScrollableRegion=Mh,exports.SegmentedControl=Z$,exports.SegmentedControlButton=z$,exports.SegmentedControlIconButton=V$,exports.Select=Q$,exports.SelectContext=Ux,exports.SelectOptGroup=qx,exports.SelectOptGroupContext=Wx,exports.SelectOption=Zx,exports.SelectPanel=k1,exports.SelectPanelButton=e1,exports.SelectPanelContext=t1,exports.SelectPanelFooter=i1,exports.SelectPanelHeader=d1,exports.SelectPanelLoading=S1,exports.SelectPanelMessage=T1,exports.SelectPanelSearchInput=s1,exports.SelectPanelSecondaryAction=O1,exports.Separator=M1,exports.SkeletonAvatar=Kw,exports.SkeletonBox=g_,exports.SkeletonText=y_,exports.Slider=I1,exports.Spinner=$r,exports.Stack=tb,exports.StackItem=eb,exports.StateLabel=U1,exports.StatisticCard=p0,exports.StatisticCardContext=W1,exports.StatisticCardDescription=q1,exports.StatisticCardLabel=X1,exports.StatisticCardTrailingVisual=$1,exports.StatisticCardTrend=o0,exports.StatisticCardValue=l0,exports.Status=S0,exports.StatusIndicator=x0,exports.Steps=K0,exports.StepsBody=j0,exports.StepsDescription=P0,exports.StepsIndicator=R0,exports.StepsItem=H0,exports.StepsItemContext=C0,exports.StepsTitle=G0,exports.Swap=e2,exports.SwapContext=q0,exports.SwapIndicator=$0,exports.Switch=S2,exports.SwitchContext=t2,exports.SwitchControl=f2,exports.SwitchHiddenInput=h2,exports.SwitchLabel=v2,exports.SwitchRootProvider=o2,exports.SwitchThumb=x2,exports.Tab=v4,exports.TabList=C4,exports.TabPanel=E4,exports.Table=q_,exports.TableActions=kg,exports.TableBody=Pg,exports.TableCell=Lg,exports.TableCellPlaceholder=Bg,exports.TableContainer=Ug,exports.TableDivider=Kg,exports.TableErrorDialog=Jg,exports.TableHead=Xg,exports.TableHeader=$g,exports.TableOfContents=u4,exports.TableOfContentsContent=W2,exports.TableOfContentsContext=C2,exports.TableOfContentsIndicator=J2,exports.TableOfContentsItem=Z2,exports.TableOfContentsItemContext=T2,exports.TableOfContentsLink=e4,exports.TableOfContentsList=r4,exports.TableOfContentsNav=o4,exports.TableOfContentsTitle=l4,exports.TablePagination=d_,exports.TableRow=p_,exports.TableSkeleton=S_,exports.TableSortHeader=T_,exports.TableSubtitle=O_,exports.TableTitle=j_,exports.Tabs=D4,exports.TabsContext=d4,exports.Text=Io,exports.TextInput=qo,exports.TextInputAction=Ko,exports.Textarea=hS,exports.ThemeContext=L8,exports.ThemeProvider=q8,exports.Timeline=Z4,exports.TimelineActions=P4,exports.TimelineAvatar=L4,exports.TimelineBadge=V4,exports.TimelineBody=W4,exports.TimelineBreak=q4,exports.TimelineItem=X4,exports.Timer=D3,exports.TimerActionTrigger=m3,exports.TimerArea=_3,exports.TimerContext=Q4,exports.TimerControl=b3,exports.TimerItem=C3,exports.TimerSeparator=E3,exports.Toaster=r6,exports.Token=y6,exports.TokenBase=c6,exports.TokenRemoveButton=u6,exports.TokenText=p6,exports.Tooltip=lT,exports.TooltipContext=eT,exports.TopicTag=L6,exports.TopicTagGroup=I6,exports.Tour=M8,exports.TourActionTrigger=J6,exports.TourActions=G6,exports.TourArrow=Q6,exports.TourBackdrop=t8,exports.TourCloseTrigger=i8,exports.TourContent=s8,exports.TourContext=R6,exports.TourControl=u8,exports.TourDescription=p8,exports.TourPositioner=_8,exports.TourPositionerContext=z6,exports.TourProgressText=b8,exports.TourSpotlight=C8,exports.TourTitle=E8,exports.TreeView=vT,exports.TreeViewDirectoryIcon=aw,exports.TreeViewErrorDialog=sw,exports.TreeViewItem=_T,exports.TreeViewItemContext=MC,exports.TreeViewLeadingAction=Uw,exports.TreeViewLeadingVisual=Ww,exports.TreeViewRootContext=jC,exports.TreeViewSubTree=$w,exports.TreeViewTrailingVisual=fT,exports.Truncate=F8,exports.buildPaginationModel=e_,exports.buildPaginationPageData=t_,exports.clampToRange=IK,exports.commandScore=Jm,exports.computeEdges=Ox,exports.computeFlowRect=kx,exports.computePositions=Cx,exports.connectorPath=sx,exports.copyText=Ff,exports.createColumnHelper=K_,exports.defaultPaneWidth=XJ,exports.entryIds=wx,exports.exitIds=Tx,exports.extendRange=yu,exports.formatFileSize=Bv,exports.formatMeterValue=$K,exports.formatRelativeTime=ZQ,exports.formatTime=n3,exports.formatTitle=XQ,exports.getAccessibleKeybindingHintString=xw,exports.getAddress=fB,exports.getAnchoredPosition=aa,exports.getCharacterCount=Lo,exports.getFirstDayOfWeek=du,exports.getIssueLabelColors=D6,exports.getLonLat=pB,exports.getMonthWeeks=mu,exports.getPlatform=Tw,exports.getProp=Ld,exports.getRangePosition=vu,exports.getSeriesColor=Fd,exports.getWeekdays=fu,exports.isDateSelectable=hu,exports.isDateWithinRange=_u,exports.isFileAccepted=Vv,exports.isTokenInteractive=o6,exports.markdownTheme=KG,exports.nodeIds=Ex,exports.parseDate=bu,exports.registerPortalRoot=Xi,exports.richTextEditorTheme=b$,exports.scrollToHeading=O2,exports.sortStrategies=L_,exports.splitHighlightChunks=uC,exports.splitTime=t3,exports.startOfWeek=pu,exports.stepValue=LK,exports.toDayKey=cu,exports.toJSONNodes=NT,exports.toValueTokens=BT,exports.toast=W3,exports.transitionSortDirection=M_,exports.triageFiles=Hv,exports.updateAriaValues=nY,exports.useAnnouncements=ab,exports.useChart=Bd,exports.useChartContext=Dd,exports.useClipboard=If,exports.useClipboardContext=Nf,exports.useClippedChildren=rE,exports.useCollator=Us,exports.useColorSchemeVar=z8,exports.useConfirm=mg,exports.useDateFormatter=Ws,exports.useDirection=QT,exports.useFilter=Gs,exports.useFloatingPanelContext=Sb,exports.useFormControlForwardedProps=Xf,exports.useIsRtl=$T,exports.useJSONTreeViewContext=bT,exports.useLocaleContext=Rs,exports.useMap=sB,exports.useMarquee=ZG,exports.useMarqueeContext=XG,exports.useNumberFormatter=Ks,exports.useOverflowObserver=_a,exports.usePaneWidth=pY,exports.usePlatform=Dw,exports.useStepsItem=F0,exports.useSwitch=s2,exports.useSwitchContext=n2,exports.useTab=h4,exports.useTabList=b4,exports.useTabPanel=w4,exports.useTableOfContents=R2,exports.useTableOfContentsContext=w2,exports.useTableOfContentsItemContext=E2,exports.useTabs=m4,exports.useTheme=R8,exports.useTimer=s3,exports.useTimerContext=$4,exports.useTour=D8,exports.valueToPercent=QK,exports.waitForElement=A8,exports.waitForElementValue=j8,exports.waitForEvent=k8;
|
|
820
|
+
}`,uniforms:o,paletteTextures:i.paletteTextures}}var hU=class extends kz{constructor(e){e=e?Object.assign({},e):{};let t=e.style||{};delete e.style,super(e),this.sources_=e.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=t,this.styleVariables_=this.style_.variables||{},this.styleBandCount_=NaN,this.styleNodataBandIndex_=void 0,this.handleSourceUpdate_(),this.addChangeListener(jL.SOURCE,this.handleSourceUpdate_)}getSources(e,t){let n=this.getSource();return this.sources_?typeof this.sources_==`function`?this.sources_(e,t):this.sources_:n?[n]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){let e=this.getRenderSource();return e?e.getState():`undefined`}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache();let e=this.getSource();if(e){if(e.getState()===`loading`){let t=()=>{e.getState()===`ready`&&(e.removeEventListener(`change`,t),this.setStyle(this.style_))};e.addEventListener(`change`,t)}else this.setStyle(this.style_)}}getFirstSource_(){let e=2**53-1,t=this.getSources([-e,-e,e,e],e);return t&&t.length?t[0]:null}usesCoverageBand_(e,t){if(!e||!t||e.hasAlpha!==!1)return!1;let n=e.getProjection();return!!n&&!Vk(n,t)}getSourceBandCount_(e){let t=this.getFirstSource_(),n=t&&`bandCount`in t?t.bandCount:4;return this.usesCoverageBand_(t,e)?n+1:n}getSourceNodataBandIndex_(e){let t=this.getFirstSource_();if(t)return this.usesCoverageBand_(t,e)?t.bandCount+1:`nodataBandIndex`in t?t.nodataBandIndex:void 0}parseStyleForRender_(e){let t=this.getSourceBandCount_(e),n=this.getSourceNodataBandIndex_(e);return this.styleBandCount_=t,this.styleNodataBandIndex_=n,mU(this.style_,t,n)}applyShaders_(e){let t=this.parseStyleForRender_(e);this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures})}createRenderer(){let e=this.getMapInternal()?.getView()?.getProjection(),t=this.parseStyleForRender_(e);return new AV(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.getCacheSize(),paletteTextures:t.paletteTextures})}renderSources(e,t){let n=this.getRenderer(),r;for(let i=0,a=t.length;i<a;++i)this.renderedSource_=t[i],n.prepareFrame(e)&&(r=n.renderFrame(e));return r}render(e,t){this.rendered=!0;let n=e.viewState;if(this.hasRenderer()){let e=n.projection;(this.getSourceBandCount_(e)!==this.styleBandCount_||this.getSourceNodataBandIndex_(e)!==this.styleNodataBandIndex_)&&this.applyShaders_(e)}let r=this.getSources(e.extent,n.resolution),i=!0;for(let e=0,t=r.length;e<t;++e){let t=r[e],n=t.getState();if(n==`loading`){let e=()=>{t.getState()==`ready`&&(t.removeEventListener(`change`,e),this.changed())};t.addEventListener(`change`,e)}i&&=n==`ready`}let a=this.renderSources(e,r);if(this.getRenderer().renderComplete&&i)return this.renderedResolution_=n.resolution,a;if(this.renderedResolution_>.5*n.resolution){let t=this.getSources(e.extent,this.renderedResolution_).filter(e=>!r.includes(e));if(t.length>0)return this.renderSources(e,t)}return a}setStyle(e){if(this.styleVariables_=e.variables||{},this.style_=e,this.hasRenderer()){let e=this.getMapInternal()?.getView()?.getProjection();this.applyShaders_(e),this.changed()}}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}};hU.prototype.dispose;function gU({name:e,...t}){return DB(()=>new hU(t),e),null}gU.displayName=`MapWebGLTileLayer`;const _U=e=>{let t=sB(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addControl(r),()=>{t.removeControl(r)}},[t,r]),r},vU=(e,t,n)=>{let r=l.useRef(null);if(!r.current){let t=document.createElement(`div`);t.setAttribute(`data-component`,e),r.current=t}let i=r.current;return _U(()=>new QL({element:i,target:n})),l.useEffect(()=>{i.className=G(`ol-unselectable ol-control`,t)},[i,t]),i};function yU(e){return _U(()=>new $L(e)),null}yU.displayName=`MapAttributionControl`;const bU=[`fullscreenchange`,`webkitfullscreenchange`],xU={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var SU=class extends QL{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target}),this.on,this.once,this.un,this.keys_=e.keys!==void 0&&e.keys,this.source_=e.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=e.className===void 0?`ol-full-screen`:e.className,this.documentListeners_=[],this.activeClassName_=e.activeClassName===void 0?[this.cssClassName_+`-true`]:e.activeClassName.split(` `),this.inactiveClassName_=e.inactiveClassName===void 0?[this.cssClassName_+`-false`]:e.inactiveClassName.split(` `);let t=e.label===void 0?`⤢`:e.label;this.labelNode_=typeof t==`string`?document.createTextNode(t):t;let n=e.labelActive===void 0?`×`:e.labelActive;this.labelActiveNode_=typeof n==`string`?document.createTextNode(n):n;let r=e.tipLabel?e.tipLabel:`Toggle full-screen`;this.button_=document.createElement(`button`),this.button_.title=r,this.button_.setAttribute(`type`,`button`),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(IE.CLICK,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ol-unselectable ol-control`,this.element.appendChild(this.button_)}handleClick_(e){e.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){let e=this.getMap();if(!e)return;let t=e.getOwnerDocument();if(CU(t)){if(wU(t))DU(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?EU(n):TU(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=wU(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Kj(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(xU.ENTERFULLSCREEN)):(Kj(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(xU.LEAVEFULLSCREEN)),e.updateSize())}setClassName_(e,t){t?(e.classList.remove(...this.inactiveClassName_),e.classList.add(...this.activeClassName_)):(e.classList.remove(...this.activeClassName_),e.classList.add(...this.inactiveClassName_))}setMap(e){let t=this.getMap();t&&t.removeChangeListener(JL.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(JL.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)FE(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();CU(n)?this.element.classList.remove(WM):this.element.classList.add(WM);for(let t=0,r=bU.length;t<r;++t)e.push(NE(n,bU[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function CU(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function wU(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function TU(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function EU(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():TU(e)}function DU(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function OU(e){return _U(()=>new SU(e)),null}OU.displayName=`MapFullScreenControl`;const kU=`units`,AU=[1,2,5],jU=25.4/.28;var MU=class extends QL{constructor(e){e||={};let t=document.createElement(`div`);t.style.pointerEvents=`none`,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;let n=e.className===void 0?e.bar?`ol-scale-bar`:`ol-scale-line`:e.className;this.innerElement_=document.createElement(`div`),this.innerElement_.className=n+`-inner`,this.element.className=n+` ol-unselectable`,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth===void 0?64:e.minWidth,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_=``,this.addChangeListener(kU,this.handleUnitsChanged_),this.setUnits(e.units||`metric`),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(kU)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(kU,e)}setDpi(e){this.dpi_=e}updateElement_(){let e=this.viewState_;if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=e.center,n=e.projection,r=this.getUnits(),i=r==`degrees`?`degrees`:`m`,a=Pk(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||jU)/jU,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||jU)/jU,c=o*a,l=``;if(r==`degrees`){let e=FO.degrees;c*=e,c<e/60?(l=`″`,a*=3600):c<e?(l=`′`,a*=60):l=`°`}else if(r==`imperial`)c<.9144?(l=`in`,a/=.0254):c<1609.344?(l=`ft`,a/=.3048):(l=`mi`,a/=1609.344);else if(r==`nautical`)a/=1852,l=`NM`;else if(r==`metric`)c<1e-6?(l=`nm`,a*=1e9):c<.001?(l=`μm`,a*=1e6):c<1?(l=`mm`,a*=1e3):c<1e3?l=`m`:(l=`km`,a/=1e3);else if(r==`us`)c<.9144?(l=`in`,a*=39.37):c<1609.344?(l=`ft`,a/=.30480061):(l=`mi`,a/=1609.3472);else throw Error(`Invalid units`);let u=3*Math.floor(Math.log(o*a)/Math.log(10)),d,f,p,m=0,h,g;for(;;){p=Math.floor(u/3);let e=10**p;if(d=AU[(u%3+3)%3]*e,f=Math.round(d/a),isNaN(f)){this.element.style.display=`none`,this.renderedVisible_=!1;return}if(s!==void 0&&f>=s){d=m,f=h,p=g;break}if(f>=o)break;m=d,h=f,g=p,++u}let _=this.scaleBar_?this.createScaleBar(f,d,l):d.toFixed(p<0?-p:0)+` `+l;this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+`px`,this.renderedWidth_=f),this.renderedVisible_||=(this.element.style.display=``,!0)}createScaleBar(e,t,n){let r=this.getScaleForResolution(),i=r<1?Math.round(1/r).toLocaleString()+` : 1`:`1 : `+Math.round(r).toLocaleString(),a=this.scaleBarSteps_,o=e/a,s=[this.createMarker(`absolute`)];for(let r=0;r<a;++r){let i=r%2==0?`ol-scale-singlebar-odd`:`ol-scale-singlebar-even`;s.push(`<div><div class="ol-scale-singlebar ${i}" style="width: ${o}px;"></div>`+this.createMarker(`relative`)+(r%2==0||a===2?this.createStepText(r,e,!1,t,n):``)+`</div>`)}return s.push(this.createStepText(a,e,!0,t,n)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+i+`</div>`:``)+s.join(``)}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e===`absolute`?3:-10}px;"></div>`}createStepText(e,t,n,r,i){let a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?``:` `+i),o=e===0?-3:t/this.scaleBarSteps_*-1,s=e===0?0:t/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${o}px;text-align: ${e===0?`left`:`center`};min-width: ${s}px;left: ${n?t+`px`:`unset`};">`+a+`</div>`}getScaleForResolution(){let e=Pk(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||jU;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function NU(e){return _U(()=>new MU(e)),null}NU.displayName=`MapScaleLineControl`;const PU=`projection`,FU=`coordinateFormat`;var IU=class extends QL{constructor(e){e||={};let t=document.createElement(`div`);t.className=e.className===void 0?`ol-mouse-position`:e.className,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un,this.addChangeListener(PU,this.handleProjectionChanged_),e.coordinateFormat&&this.setCoordinateFormat(e.coordinateFormat),e.projection&&this.setProjection(e.projection),this.renderOnMouseOut_=e.placeholder!==void 0,this.placeholder_=this.renderOnMouseOut_?e.placeholder:` `,this.renderedHTML_=t.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=e.wrapX!==!1}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(FU)}getProjection(){return this.get(PU)}handleMouseMove(e){let t=this.getMap();this.updateHTML_(t.getEventPixel(e))}handleMouseOut(e){this.updateHTML_(null)}setMap(e){if(super.setMap(e),e){let t=e.getViewport();this.listenerKeys.push(NE(t,GL.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(NE(t,GL.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(FU,e)}setProjection(e){this.set(PU,Nk(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?Hk(this.mapProjection_,e):Ak}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=Kk();e&&(this.transform_=Hk(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&MO(n,e||this.getProjection()||this.mapProjection_);let r=this.getCoordinateFormat();t=r?r(n):n.toString()}}(!this.renderedHTML_||t!==this.renderedHTML_)&&(this.element.innerHTML=t,this.renderedHTML_=t)}render(e){let t=e.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}};function LU(e){return _U(()=>new IU(e)),null}LU.displayName=`MapMousePositionControl`;const RU=.75,zU=.1;var BU=class extends QL{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=e.collapsed===void 0||e.collapsed,this.collapsible_=e.collapsible===void 0||e.collapsible,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=e.rotateWithView!==void 0&&e.rotateWithView,this.viewExtent_=void 0;let t=e.className===void 0?`ol-overviewmap`:e.className,n=e.tipLabel===void 0?`Overview map`:e.tipLabel,r=e.collapseLabel===void 0?`‹`:e.collapseLabel;typeof r==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=r):this.collapseLabel_=r;let i=e.label===void 0?`›`:e.label;typeof i==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=i):this.label_=i;let a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,o=document.createElement(`button`);o.setAttribute(`type`,`button`),o.title=n,o.appendChild(a),o.addEventListener(IE.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new JR({view:e.view,controls:new sD,interactions:new sD});this.ovmap_=s,e.layers&&e.layers.forEach(function(e){s.addLayer(e)});let c=document.createElement(`div`);c.className=`ol-overviewmap-box`,c.style.boxSizing=`border-box`,this.boxOverlay_=new ZR({position:[0,0],positioning:`center-center`,element:c}),this.ovmap_.addOverlay(this.boxOverlay_);let l=t+` ol-unselectable ol-control`+(this.collapsed_&&this.collapsible_?` ol-collapsed`:``)+(this.collapsible_?``:` ol-uncollapsible`),u=this.element;u.className=l,u.appendChild(this.ovmapDiv_),u.appendChild(o);let d=this.boxOverlay_,f=this.boxOverlay_.getElement(),p=e=>({clientX:e.clientX,clientY:e.clientY}),m=function(e){let t=p(e),n=s.getEventCoordinate(t);d.setPosition(n)},h=e=>{let t=s.getEventCoordinateInternal(e),n=this.getMap();n.getView().setCenterInternal(t);let r=n.getOwnerDocument();r.removeEventListener(`pointermove`,m),r.removeEventListener(`pointerup`,h)};this.ovmapDiv_.addEventListener(`pointerdown`,e=>{let t=this.getMap().getOwnerDocument();e.target===f&&t.addEventListener(`pointermove`,m),t.addEventListener(`pointerup`,h)})}setMap(e){let t=this.getMap();if(e!==t){if(t){let e=t.getView();e&&this.unbindView_(e),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(NE(e,AE.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===JL.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===JL.TARGET||e.key===JL.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new wL({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(fL.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(fL.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView().calculateExtentInternal(n);if(this.viewExtent_&&ED(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(UD(r)),s=t.getPixelFromCoordinateInternal(FD(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*zU||l<d*zU||c>u*RU||l>d*RU?this.resetExtent_():vD(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();YD(r,1/(2**(Math.log(RU/zU)/Math.LN2/2)*zU)),i.fitInternal(bj(r))}recenter_(){let e=this.getMap(),t=this.ovmap_,n=e.getView();t.getView().setCenterInternal(n.getCenterInternal())}updateBox_(){let e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;let n=e.getSize(),r=e.getView(),i=t.getView(),a=this.rotateWithView_?0:-r.getRotation(),o=this.boxOverlay_,s=this.boxOverlay_.getElement(),c=r.getCenter(),l=r.getResolution(),u=i.getResolution(),d=n[0]*l/u,f=n[1]*l/u;if(o.setPosition(c),s){s.style.width=d+`px`,s.style.height=f+`px`;let e=`rotate(`+a+`rad)`;s.style.transform=e}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||=PE(this.ovmap_,qL.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(GM),this.collapsed_?Kj(this.collapseLabel_,this.label_):Kj(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;let e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle(`ol-uncollapsible`),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}};function VU(e){return _U(()=>new BU(e)),null}VU.displayName=`MapOverviewMapControl`;var HU=class e extends wA{constructor(e,t,n){super(),n!==void 0&&t===void 0?this.setFlatCoordinates(n,e):(t||=0,this.setCenterAndRadius(e,t,n))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=e-i[0],o=t-i[1],s=a*a+o*o;if(s<r){if(s===0)for(let e=0;e<this.stride;++e)n[e]=i[e];else{let e=this.getRadius()/Math.sqrt(s);n[0]=i[0]+e*a,n[1]=i[1]+e*o;for(let e=2;e<this.stride;++e)n[e]=i[e]}return n.length=this.stride,s}return r}containsXY(e,t){let n=this.flatCoordinates,r=e-n[0],i=t-n[1];return r*r+i*i<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,n=t[this.stride]-t[0];return SD(t[0]-n,t[1]-n,t[0]+n,t[1]+n,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return`Circle`}intersectsExtent(e){if(KD(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||MD(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(let n=1;n<t;++n)r[t+n]=e[n];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,n){this.setLayout(n,e,0),this.flatCoordinates||=[];let r=this.flatCoordinates,i=RA(r,0,e,this.stride);r[i++]=r[0]+t;for(let e=1,t=this.stride;e<t;++e)r[i++]=r[e];r.length=i,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let n=this.getCenter(),r=this.getStride();this.setCenter(vA(n,0,n.length,r,e,t,n)),this.changed()}};HU.prototype.transform;var UU=class e extends CA{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(FE),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(NE(e[t],IE.CHANGE,this.changed,this))}clone(){let t=new e(WU(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<gD(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){CD(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)OD(e,t[n].getExtent());return e}getGeometries(){return WU(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=ID(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(WU(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function WU(e){return e.map(e=>e.clone())}function GU(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function KU(e,t){let n=e.length,r=Math.floor(t),i=t-r;r>=n?r-=n:r<0&&(r+=n);let a=r+1;a>=n&&(a-=n);let o=e[r],s=o[0],c=o[1],l=e[a],u=l[0]-s,d=l[1]-c;return[s+u*i,c+d*i]}const qU={index:-1,endIndex:NaN,closestTargetDistance:1/0};function JU(e,t,n,r){let i=e[0],a=e[1],o=1/0,s=-1,c=NaN;for(let e=0;e<t.targets.length;++e){let n=t.targets[e],r=n.coordinates,l=1/0,u;for(let e=0;e<r.length-1;++e){let t=r[e],n=r[e+1],o=tW(i,a,t,n);o.squaredDistance<l&&(l=o.squaredDistance,u=e+o.along)}l<o&&(o=l,n.ring&&t.targetIndex===e&&(n.endIndex>n.startIndex?u<n.startIndex&&(u+=r.length):n.endIndex<n.startIndex&&u>n.startIndex&&(u-=r.length)),c=u,s=e)}let l=t.targets[s],u=l.ring;if(t.targetIndex===s&&u){let e=KU(l.coordinates,c);AO(n.getPixelFromCoordinate(e),n.getPixelFromCoordinate(t.startCoord))>r&&(u=!1)}if(u){let e=l.coordinates,t=e.length,n=l.startIndex,r=c;if(n<r){let i=$U(e,n,r);$U(e,n,r-t)<i&&(c-=t)}else{let i=$U(e,n,r);$U(e,n,r+t)<i&&(c+=t)}}return qU.index=s,qU.endIndex=c,qU.closestTargetDistance=o,qU}function YU(e,t){let n=[];for(let r=0;r<t.length;++r)XU(e,t[r].getGeometry(),n);return n}function XU(e,t,n){if(t instanceof iM){ZU(e,t.getCoordinates(),!1,n);return}if(t instanceof RN){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)ZU(e,r[t],!1,n);return}if(t instanceof yj){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)ZU(e,r[t],!0,n);return}if(t instanceof VN){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t){let i=r[t];for(let t=0,r=i.length;t<r;++t)ZU(e,i[t],!0,n)}return}if(t instanceof UU){let r=t.getGeometries();for(let t=0;t<r.length;++t)XU(e,r[t],n);return}}function ZU(e,t,n,r){let i=e[0],a=e[1];for(let e=0,o=t.length-1;e<o;++e){let o=t[e],s=t[e+1],c=tW(i,a,o,s);if(c.squaredDistance===0){let i=e+c.along;r.push({coordinates:t,ring:n,startIndex:i,endIndex:i});return}}}function QU(e,t){return rO(e[0],e[1],t[0],t[1])}function $U(e,t,n){let r,i;t<n?(r=t,i=n):(r=n,i=t);let a=Math.ceil(r),o=Math.floor(i);if(a>o)return QU(KU(e,r),KU(e,i));let s=0;if(r<a){let t=KU(e,r),n=GU(e,a);s+=QU(t,n)}if(o<i){let t=GU(e,o),n=KU(e,i);s+=QU(t,n)}for(let t=a;t<o-1;++t){let n=GU(e,t),r=GU(e,t+1);s+=QU(n,r)}return s}const eW={along:0,squaredDistance:0};function tW(e,t,n,r){let i=n[0],a=n[1],o=r[0],s=r[1],c=o-i,l=s-a,u=0,d=i,f=a;return(c!==0||l!==0)&&(u=tO(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),eW.along=u,eW.squaredDistance=lO(rO(e,t,d,f),10),eW}const nW={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var rW=class extends ZE{constructor(e,t){super(e),this.feature=t}},iW=class extends CR{constructor(e){let t=e;t.stopDown||=qE,super(t),this.on,this.once,this.un,this.options_=e,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=oW(this.type_),this.stopClick_=!!e.stopClick,this.ignoreNextUpEvent_=!1,this.minPoints_=e.minPoints?e.minPoints:this.mode_===`Polygon`?3:2,this.maxPoints_=this.mode_===`Circle`?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:KE,this.geometryLayout_=e.geometryLayout?e.geometryLayout:`XY`;let n=e.geometryFunction;if(!n){let e=this.mode_;if(e===`Circle`)n=(e,t,n)=>{let r=t||new HU([NaN,NaN]),i=Jk(e[0],n),a=kO(i,Jk(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=Kk();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=lj:e===`LineString`?t=iM:e===`Polygon`&&(t=yj),n=(n,r,i)=>(r?e===`Polygon`?n[0].length?r.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):r.setCoordinates([],this.geometryLayout_):r.setCoordinates(n,this.geometryLayout_):r=new t(n,this.geometryLayout_),r)}}this.geometryFunction_=n,this.dragVertexDelay_=e.dragVertexDelay===void 0?500:e.dragVertexDelay,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new RL({source:new pP({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:aW(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:_R,this.freehandCondition_,this.freehandCondition_=e.freehand?pR:e.freehandCondition?e.freehandCondition:yR,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(rR.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?pR:e:hR,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?pR:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:yR}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===IE.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===WL.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===WL.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===WL.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===WL.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===WL.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===WL.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===WL.DBLCLICK&&(n=!1),super.handleEvent(e)&&n}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new UL(WL.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}let t=this.getMap(),n=fD([t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_])]),r=this.traceSource_.getFeaturesInExtent(n);if(r.length===0)return;let i=YU(e.coordinate,r);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(GU(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(GU(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&AO(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=JU(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex;let i=KU(r.coordinates,r.endIndex),a=this.getMap().getPixelFromCoordinate(i);e.coordinate=i,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&=(clearTimeout(this.downTimeout_),void 0),this.handlePointerMove_(e);let n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){let r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_===`Point`)&&(this.atFinish_(e.pixel,n)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){let t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],a=r*r+i*i;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let n=!1;if(this.sketchFeature_){let r=!1,i=[this.finishCoordinate_],a=this.mode_;if(a===`Point`)n=!0;else if(a===`Circle`)n=this.sketchCoords_.length===2;else if(a===`LineString`)r=!t&&this.sketchCoords_.length>this.minPoints_;else if(a===`Polygon`){let e=this.sketchCoords_;r=e[0].length>this.minPoints_,i=[e[0][0],e[0][e[0].length-2]],i=t?[e[0][0]]:[e[0][0],e[0][e[0].length-2]]}if(r){let t=this.getMap();for(let r=0,a=i.length;r<a;r++){let a=i[r],o=t.getPixelFromCoordinate(a),s=e[0]-o[0],c=e[1]-o[1],l=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(s*s+c*c)<=l,n){this.finishCoordinate_=a;break}}}}return n}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new lD(new lj(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new lD;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new iM(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=EA(this.geometryLayout_);for(;e.length<n;)e.push(0);this.finishCoordinate_=e,this.mode_===`Point`?this.sketchCoords_=e.slice():this.mode_===`Polygon`?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new lD(new iM(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new lD,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new rW(nW.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=EA(this.geometryLayout_),a,o;for(;e.length<i;)e.push(0);this.mode_===`Point`?o=this.sketchCoords_:this.mode_===`Polygon`?(a=this.sketchCoords_[0],o=a[a.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,o=a[a.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),n.getType()===`Polygon`&&this.mode_!==`Polygon`?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r,i,a=this.mode_;return a===`LineString`||a===`Circle`?(this.finishCoordinate_=e.slice(),i=this.sketchCoords_,i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),this.geometryFunction_(i,t,n)):a===`Polygon`&&(i=this.sketchCoords_[0],i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),r&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,t,n)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;for(let i=0;i<e;++i){let e;if(r===`LineString`||r===`Circle`){if(e=this.sketchCoords_,e.splice(-2,1),e.length>=2){this.finishCoordinate_=e[e.length-2].slice();let t=this.finishCoordinate_.slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}this.geometryFunction_(e,t,n),t.getType()===`Polygon`&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r===`Polygon`){e=this.sketchCoords_[0],e.splice(-2,1);let r=this.sketchLine_.getGeometry();if(e.length>=2){let t=e[e.length-2].slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}r.setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,n)}if(e.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_,n=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_===`LineString`?(t.pop(),this.geometryFunction_(t,n,r)):this.mode_===`Polygon`&&(t[0].pop(),this.geometryFunction_(t,n,r),t=n.getCoordinates()),this.type_===`MultiPoint`?e.setGeometry(new zN([t])):this.type_===`MultiLineString`?e.setGeometry(new RN([t])):this.type_===`MultiPolygon`&&e.setGeometry(new VN([t])),this.dispatchEvent(new rW(nW.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;let e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){let e=this.abortDrawing_();e&&this.dispatchEvent(new rW(nW.DRAWABORT,e))}appendCoordinates(e){let t=this.mode_,n=!this.sketchFeature_;n&&this.startDrawing_(e[0]);let r;if(t===`LineString`||t===`Circle`)r=this.sketchCoords_;else if(t===`Polygon`)r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;n&&r.shift(),r.pop();for(let t=0;t<e.length;t++)this.addToDrawing_(e[t]);let i=e[e.length-1];this.sketchFeature_=this.addToDrawing_(i),this.modifyDrawing_(i)}extend(e){let t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();let n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new lD(new lj(n)),this.updateSketchFeatures_(),this.dispatchEvent(new rW(nW.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){let e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);let t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){let e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}};function aW(){let e=EP();return function(t,n){return e[t.getGeometry().getType()]}}function oW(e){switch(e){case`Point`:case`MultiPoint`:return`Point`;case`LineString`:case`MultiLineString`:return`LineString`;case`Polygon`:case`MultiPolygon`:return`Polygon`;case`Circle`:return`Circle`;default:throw Error(`Invalid type: `+e)}}const sW=[0,0,0,0],cW=[],lW={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function uW(e,t,n){let r;switch(t){case`LineString`:r=e;break;case`MultiLineString`:case`Polygon`:r=e[n[0]];break;case`MultiPolygon`:r=e[n[1]][n[0]]}return r}var dW=class extends ZE{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},fW=class extends CR{constructor(e){if(super(e),this.handleSourceAdd_=this.handleSourceAdd_.bind(this),this.handleSourceRemove_=this.handleSourceRemove_.bind(this),this.handleExternalCollectionAdd_=this.handleExternalCollectionAdd_.bind(this),this.handleExternalCollectionRemove_=this.handleExternalCollectionRemove_.bind(this),this.handleFeatureChange_=this.handleFeatureChange_.bind(this),this.on,this.once,this.un,this.condition_=e.condition?e.condition:SR,this.defaultDeleteCondition_=function(e){return lR(e)&&gR(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:pR,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new cP,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new RL({source:new pP({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:gW(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=e.traceSource||e.source||null,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null,this.filterFunctionWasSupplied_=e.filter!=null,this.filter_=e.filter?e.filter:()=>!0,this.coordinatesEqual_=e.sharedVerticesEqual?e.sharedVerticesEqual:EO,!(e.features||e.source))throw Error(`The modify interaction requires features collection or a source`);let t;e.features?(t=e.features.getArray(),e.features.addEventListener(kE.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(kE.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(dP.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(dP.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_)}),e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=[],t.filter(this.filter_).forEach(e=>this.addFeature_(e)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;t=e?e===!0?pR:e:hR,this.traceCondition_=t}addFeature_(e){this.features_.push(e);let t=e.getGeometry();if(t){let n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}let n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new sD;let n=this.featuresBeingModified_.getArray();for(let e=0,r=t.length;e<r;++e){let r=t[e].feature;r&&!n.includes(r)&&this.featuresBeingModified_.push(r)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new dW(lW.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){let t=this.features_.indexOf(e);this.features_.splice(t,1),this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.length===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}removeFeatureSegmentData_(e){let t=this.rBush_,n=[];t.forEach(function(t){e===t.feature&&n.push(t)});for(let e=n.length-1;e>=0;--e){let r=n[e];for(let e=this.dragSegments_.length-1;e>=0;--e)this.dragSegments_[e][0]===r&&this.dragSegments_.splice(e,1);t.remove(r)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){let t=e.feature;t&&this.externalAddFeatureHandler_(t)}handleSourceRemove_(e){let t=e.feature;t&&this.externalRemoveFeatureHandler_(t)}handleExternalCollectionAdd_(e){let t=e.element;t&&this.externalAddFeatureHandler_(t)}handleExternalCollectionRemove_(e){let t=e.element;t&&this.externalRemoveFeatureHandler_(t)}externalAddFeatureHandler_(e){e.addEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_),this.removeFeature_(e)}handleFeatureChange_(e){if(!this.changingFeature_){let t=e.target;this.removeFeature_(t),this.filter_(t)&&this.addFeature_(t)}}writePointGeometry_(e,t){let n=t.getCoordinates(),r={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length-1;r<i;++r){let i=n.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:i};this.rBush_.insert(fD(i),a)}}writeMultiLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(fD(a),o)}}}writePolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(fD(a),o)}}}writeMultiPolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length;n<a;++n){let a=i[n];for(let i=0,o=a.length-1;i<o;++i){let o=a.slice(i,i+2),s={feature:e,geometry:t,depth:[n,r],index:i,segment:o};this.rBush_.insert(fD(o),s)}}}}writeCircleGeometry_(e,t){let n=t.getCenter(),r={feature:e,geometry:t,index:0,segment:[n,n]},i={feature:e,geometry:t,index:1,segment:[n,n]},a=[r,i];r.featureSegments=a,i.featureSegments=a,this.rBush_.insert(wD(n),r);let o=t,s=Kk();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=xj(o).transform(e,s)}this.rBush_.insert(o.getExtent(),i)}writeGeometryCollectionGeometry_(e,t){let n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=n[t],i=this.SEGMENT_WRITERS_[r.getType()];i(e,r)}}createOrUpdateVertexFeature_(e,t,n,r){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(e):(i=new lD(new lj(e)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set(`features`,t),i.set(`geometries`,n),i.set(`existing`,r),i}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==WL.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=WL.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==WL.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;let t=this.getMap().getView().getProjection(),n=[],r=this.vertexFeature_.getGeometry().getCoordinates(),i=fD([r]),a=this.rBush_.getInExtent(i),o={};a.sort(pW);for(let i=0,s=a.length;i<s;++i){let s=a[i],c=s.segment,l=X(s.geometry),u=s.depth;if(u&&(l+=`-`+u.join(`-`)),o[l]||(o[l]=[,,]),s.geometry.getType()===`Circle`&&s.index===1){let n=hW(e,s,t);this.coordinatesEqual_(n,r)&&!o[l][0]&&(this.dragSegments_.push([s,0]),o[l][0]=s);continue}if(this.coordinatesEqual_(c[0],r)&&!o[l][0]){this.dragSegments_.push([s,0]),o[l][0]=s;continue}if(this.coordinatesEqual_(c[1],r)&&!o[l][1]){if(o[l][0]&&o[l][0].index===0){let e=s.geometry.getCoordinates();switch(s.geometry.getType()){case`LineString`:case`MultiLineString`:continue;case`MultiPolygon`:e=e[u[1]];case`Polygon`:if(s.index!==e[u[0]].length-2)continue}}this.dragSegments_.push([s,1]),o[l][1]=s;continue}X(c)in this.vertexSegments_&&!o[l][0]&&!o[l][1]&&n.push(s)}return n}deactivateTrace_(){this.traceState_={active:!1}}tracePassesVertex_(e,t){if(e===t)return!1;if(e<t){let n=Math.ceil(e),r=Math.floor(t);return r===t&&--r,n<=r}let n=Math.floor(e),r=Math.ceil(t);return r===t&&(r+=1),n>=r}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&AO(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=JU(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;let r=!0;if(t.targetIndex===-1){let e=t.targets[n.index];r=this.tracePassesVertex_(e.startIndex,n.endIndex)}if(r){if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index,t.targets[t.targetIndex].endIndex=n.endIndex}let i=t.targets[n.index],a=KU(i.coordinates,n.endIndex);for(let e of this.dragSegments_)this.updateGeometry_(a.slice(),e);return a}getTraceCandidates_(e){let t=this.getMap(),n=this.pixelTolerance_,r=fD([t.getCoordinateFromPixel([e.pixel[0]-n,e.pixel[1]+n]),t.getCoordinateFromPixel([e.pixel[0]+n,e.pixel[1]-n])]);return this.traceSource_.getFeaturesInExtent(r)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}let t=this.getTraceCandidates_(e);if(t.length===0)return;let n=YU(e.coordinate,t);n.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}shiftTracedSegmentIndices_(e,t,n){for(let r of this.dragSegments_){let i=r[0];i!==e&&i.geometry===e.geometry&&(i.depth===void 0||e.depth===void 0||WE(i.depth,e.depth))&&i.index>=t&&(i.index+=n)}}removeTracedCoordinates_(e,t){if(e===t)return;let n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}if(n>0)for(let e of this.traceSegments_){let t=e[0],r=t.geometry,i=e[1],a=e[0].index+1;i===1&&(a-=n);let o=r.getCoordinates();uW(o,r.getType(),t.depth).splice(a,n),this.setGeometryCoordinates_(r,o),this.shiftTracedSegmentIndices_(t,a+n,-n),i===1&&(t.index-=n)}}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(GU(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(GU(e.coordinates,t))}if(r.length)for(let e of this.traceSegments_){let t=e[0],n=t.geometry,i=e[1],a=t.index+1;i===0&&r.reverse();let o=n.getCoordinates();uW(o,n.getType(),t.depth).splice(a,0,...r),this.setGeometryCoordinates_(n,o),this.shiftTracedSegmentIndices_(t,a,r.length),i===1&&(t.index+=r.length)}}updateGeometry_(e,t){let n=t[0],r=n.depth,i,a=n.segment,o=n.geometry,s=t[1],c=o.getStride();for(let t=2;t<c;++t)e[t]=a[s][t];switch(e.length=c,o.getType()){case`Point`:i=e,a[0]=e,a[1]=e;break;case`MultiPoint`:i=o.getCoordinates(),i[n.index]=e,a[0]=e,a[1]=e;break;case`LineString`:i=o.getCoordinates(),i[n.index+s]=e,a[s]=e;break;case`MultiLineString`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`Polygon`:{i=o.getCoordinates();let t=i[r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`MultiPolygon`:{i=o.getCoordinates();let t=i[r[1]][r[0]],c=n.index+s;t[c][0]===e[0]&&t[c][1]===e[1]?i=null:(t[c]=e,c===0?t[t.length-1]=e:c===t.length-1&&(t[0]=e)),a[s]=e;break}case`Circle`:let t=o;if(a[0]=e,a[1]=e,n.index===0)this.changingFeature_=!0,t.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let n=this.getMap().getView().getProjection(),r=AO(Jk(t.getCenter(),n),Jk(e,n)),i=Kk();if(i){let e=t.clone().transform(i,n);e.setRadius(r),r=e.transform(n,i).getRadius()}t.setRadius(r),this.changingFeature_=!1}}i&&this.setGeometryCoordinates_(o,i)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],n=[],r=[],i=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(i){this.traceSegments_=[];for(let t of this.dragSegments_){let n=t[0];AO(wO(i,n.segment),i)/e.map.getView().getResolution()<1&&this.traceSegments_.push(t)}this.traceSegments_.length>1&&(this.deactivateTrace_(),this.traceSegments_=null)}for(let e=0,i=this.dragSegments_.length;e<i;++e){let i=this.dragSegments_[e],a=i[0],o=a.feature;n.includes(o)||n.push(o);let s=a.geometry;r.includes(s)||r.push(s),this.updateGeometry_(t,i)}let a=this.updateTrace_(e);this.createOrUpdateVertexFeature_(a||t,n,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;let t=e.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(t);if(n?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,n),this.vertexFeature_)){let e=this.vertexFeature_.getGeometry().getCoordinates();for(let t=n.length-1;t>=0;--t)this.insertVertex_(n[t],e);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){let t=this.traceState_.active?new Set:null;for(let n=this.dragSegments_.length-1;n>=0;--n){let r=this.dragSegments_[n][0];t&&t.add(r.feature);let i=r.geometry;if(i.getType()===`Circle`){let t=i,n=t.getCenter(),a=r.featureSegments[0],o=r.featureSegments[1];a.segment[0]=n,a.segment[1]=n,o.segment[0]=n,o.segment[1]=n,this.rBush_.update(wD(n),a);let s=t,c=Kk();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=xj(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(fD(r.segment),r)}if(t)for(let e of t)this.removeFeature_(e),this.filter_(e)&&this.addFeature_(e);return this.featuresBeingModified_&&=(this.toggleTraceState_(e),this.dispatchEvent(new dW(lW.MODIFYEND,this.featuresBeingModified_,e)),null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){let t=this.getMap(),n=t.getPixelFromCoordinate(e),r=t.getView().getProjection(),i=function(t,n){return mW(e,t,r)-mW(e,n,r)},a,o;if(this.hitDetection_){let e=typeof this.hitDetection_==`object`?e=>e===this.hitDetection_:void 0;t.forEachFeatureAtPixel(n,(e,t,n)=>{n&&n.getType()===`Point`&&(n=new lj(qk(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof lD&&this.features_.includes(e)){o=i;let t=e.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:e,geometry:o,segment:[t,t]}]}return!0},{layerFilter:e})}if(!a){let n=Yk(mD(Xk(wD(e,sW),r),t.getView().getResolution()*this.pixelTolerance_,sW),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=hW(e,s,r),u=t.getPixelFromCoordinate(l),d=AO(n,u);if(o||d<=this.pixelTolerance_){let n={};if(n[X(c)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-e[0],this.delta_[1]=l[1]-e[1]),s.geometry.getType()===`Circle`&&s.index===1)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);else{let e=t.getPixelFromCoordinate(c[0]),r=t.getPixelFromCoordinate(c[1]),i=kO(u,e),o=kO(u,r);if(d=Math.sqrt(Math.min(i,o)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null);return}this.snappedToVertex_&&(l=i>o?c[1]:c[0]),this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);let f={};f[X(s.geometry)]=!0;for(let e=1,t=a.length;e<t;++e){let t=a[e].segment;if(this.coordinatesEqual_(c[0],t[0])&&this.coordinatesEqual_(c[1],t[1])||this.coordinatesEqual_(c[0],t[1])&&this.coordinatesEqual_(c[1],t[0])){let r=X(a[e].geometry);r in f||(f[r]=!0,n[X(t)]=!0)}else break}}this.vertexSegments_=n;return}}this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null)}insertVertex_(e,t){let n=e.segment,r=e.feature,i=e.geometry,a=e.depth,o=e.index,s;for(;t.length<i.getStride();)t.push(0);switch(i.getType()){case`MultiLineString`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`Polygon`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`MultiPolygon`:s=i.getCoordinates(),s[a[1]][a[0]].splice(o+1,0,t);break;case`LineString`:s=i.getCoordinates(),s.splice(o+1,0,t);break;default:return!1}this.setGeometryCoordinates_(i,s);let c=this.rBush_;c.remove(e),this.updateSegmentIndices_(i,o,a,1);let l={segment:[n[0],t],feature:r,geometry:i,depth:a,index:o};c.insert(fD(l.segment),l),this.dragSegments_.push([l,1]);let u={segment:[t,n[1]],feature:r,geometry:i,depth:a,index:o+1};return c.insert(fD(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){let e=this.vertexFeature_?.getGeometry().getCoordinates();return e?qk(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(fD([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=Jk(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=WL.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new dW(lW.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){let e=this.dragSegments_,t={},n=!1,r,i,a,o,s,c,l,u,d,f,p;for(s=e.length-1;s>=0;--s)a=e[s],f=a[0],p=X(f.feature),f.depth&&(p+=`-`+f.depth.join(`-`)),p in t||(t[p]={}),a[1]===0?(t[p].right=f,t[p].index=f.index):a[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,l=t[p].left,c=t[p].index,u=c-1,f=l===void 0?d:l,u<0&&(u=0),o=f.geometry,i=o.getCoordinates(),r=i,n=!1,o.getType()){case`MultiLineString`:i[f.depth[0]].length>2&&(i[f.depth[0]].splice(c,1),n=!0);break;case`LineString`:i.length>2&&(i.splice(c,1),n=!0);break;case`MultiPolygon`:r=r[f.depth[1]];case`Polygon`:r=r[f.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),n=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1))}if(n){this.setGeometryCoordinates_(o,i);let t=[];if(l!==void 0&&(this.rBush_.remove(l),t.push(l.segment[0])),d!==void 0&&(this.rBush_.remove(d),t.push(d.segment[1])),l!==void 0&&d!==void 0){let e={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:t};this.rBush_.insert(fD(e.segment),e)}this.updateSegmentIndices_(o,c,f.depth,-1),this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null),e.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(fD([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?Jk(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((e,n)=>e||this.insertVertex_(n,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,r){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(n===void 0||i.depth===void 0||WE(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(kE.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(kE.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(dP.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(dP.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(IE.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(AE.PROPERTYCHANGE,this.handleFeatureChange_)}}};function pW(e,t){return e.index-t.index}function mW(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=Kk();t&&(i=i.clone().transform(t,n));let r=kO(i.getCenter(),Jk(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=Jk(e,n);return cW[0]=Jk(t.segment[0],n),cW[1]=Jk(t.segment[1],n),jO(i,cW)}function hW(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=Kk();return i&&(t=t.clone().transform(i,n)),qk(t.getClosestPoint(Jk(e,n)),n)}let i=Jk(e,n);return cW[0]=Jk(t.segment[0],n),cW[1]=Jk(t.segment[1],n),qk(wO(i,cW),n)}function gW(){let e=EP();return function(t,n){return e.Point}}const _W={SNAP:`snap`,UNSNAP:`unsnap`};var vW=class extends ZE{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const yW={Circle(e,t){let n=e,r=Kk();r&&(n=n.clone().transform(r,t));let i=xj(n);return r&&i.transform(t,r),yW.Polygon(i)},GeometryCollection(e,t){let n=[],r=e.getGeometriesArray();for(let e=0;e<r.length;++e){let i=this[r[e].getType()];i&&n.push(i(r[e],t))}return n.flat()},LineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);return t},MultiLineString(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t},MultiPoint(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride();for(let e=0,i=n.length;e<i;e+=r)t.push([n.slice(e,e+2)]);return t},MultiPolygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEndss(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=0,i=o.length;e<i;++e){let i=o[e];for(let e=a,o=i-r;e<o;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=i}}return t},Point(e){return[[e.getFlatCoordinates().slice(0,2)]]},Polygon(e){let t=[],n=e.getFlatCoordinates(),r=e.getStride(),i=e.getEnds(),a=0;for(let e=0,o=i.length;e<o;++e){let o=i[e];for(let e=a,i=o-r;e<i;e+=r)t.push([n.slice(e,e+2),n.slice(e+r,e+r+2)]);a=o}return t}};function bW(e){return e.feature?e.feature:e.element?e.element:null}const xW=[],SW=[],CW=[];var wW=class extends CR{constructor(e){e||={},super({handleDownEvent:KE,stopDown:qE}),this.on,this.once,this.un,this.source_=e.source?e.source:null,this.vertex_=e.vertex===void 0||e.vertex,this.edge_=e.edge===void 0||e.edge,this.intersection_=e.intersection!==void 0&&e.intersection,this.features_=e.features?e.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.rBush_=new cP,this.snapped_=null,this.segmenters_=Object.assign({},yW,e.segmenters)}addFeature(e,t){t=t===void 0||t;let n=X(e),r=e.getGeometry();if(r){let t=this.segmenters_[r.getType()];if(t){this.indexedFeaturesExtents_[n]=r.getExtent(xD());let i=t.call(this.segmenters_,r,this.getMap().getView().getProjection()),a=i.length;for(let t=0;t<a;++t){let n=i[t];SW[t]=fD(n),CW[t]={feature:e,segment:n}}if(this.intersection_)for(let t=0,n=i.length;t<n;++t){let n=i[t];if(n.length===1)continue;let r=SW[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!KD(r,SW[o]))continue;let s=XA(n,t);if(!s)continue;let c=[s];SW[a]=fD(c),CW[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(SW[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=XA(n,r);if(!i)continue;let s=[i];SW[a]=fD(s),CW[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(SW[0],CW[0]):(SW.length=a,CW.length=a,this.rBush_.load(SW,CW))}}t&&(this.featureChangeListenerKeys_[n]&&FE(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=NE(e,IE.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e}areSnapDataEqual_(e,t){return e.segment===t.segment&&e.feature===t.feature}handleEvent(e){let t=this.snapTo(e.pixel,e.coordinate,e.map);return t?(e.coordinate=t.vertex.slice(0,2),e.pixel=t.vertexPixel,this.snapped_&&!this.areSnapDataEqual_(this.snapped_,t)&&this.dispatchEvent(new vW(_W.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new vW(_W.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new vW(_W.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=bW(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=bW(e);t&&(this.removeFeature(t),delete this.pendingFeatures_[X(t)])}handleFeatureChange_(e){let t=e.target;this.handlingDownUpSequence?this.pendingFeatures_[X(t)]=t:this.updateFeature_(t)}handleUpEvent(e){let t=Object.values(this.pendingFeatures_);if(t.length){for(let e of t)this.updateFeature_(e);jE(this.pendingFeatures_)}return!1}removeFeature(e,t){let n=t===void 0||t,r=X(e),i=this.indexedFeaturesExtents_[r];if(i){let t=this.rBush_;t.getInExtent(i).forEach(n=>{(e===n.feature||e===n.intersectionFeature)&&t.remove(n)})}n&&(FE(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])}setMap(e){let t=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();if(Array.isArray(r)||(r=r.getArray()),t&&(n.forEach(FE),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(FE),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(NE(this.features_,kE.ADD,this.handleFeatureAdd_,this),NE(this.features_,kE.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(NE(this.source_,dP.ADDFEATURE,this.handleFeatureAdd_,this),NE(this.source_,dP.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=Jk(t,r),a=Yk(mD(fD([i]),n.getView().getResolution()*this.pixelTolerance_),r),o=this.rBush_.getInExtent(a),s=o.length;if(s===0)return null;let c,l=1/0,u,d=null,f=this.pixelTolerance_*this.pixelTolerance_,p=()=>{if(!c)return null;let t=n.getPixelFromCoordinate(c);return kO(e,t)>f?null:{vertex:c,vertexPixel:[Math.round(t[0]),Math.round(t[1])],feature:u,segment:d}};if(this.vertex_||this.intersection_){for(let e=0;e<s;++e){let t=o[e];if(t.feature.getGeometry().getType()!==`Circle`)for(let e of t.segment){let n=kO(i,Jk(e,r));n<l&&(this.intersection_&&t.intersectionFeature||this.vertex_&&!t.intersectionFeature)&&(c=e,l=n,u=t.feature)}}let e=p();if(e)return e}if(this.edge_){for(let e=0;e<s;++e){let t=null,n=o[e];if(n.feature.getGeometry().getType()===`Circle`){let e=n.feature.getGeometry(),a=Kk();a&&(e=e.clone().transform(a,r)),t=CO(i,e)}else{let[e,a]=n.segment;a&&(xW[0]=Jk(e,r),xW[1]=Jk(a,r),t=wO(i,xW))}if(t){let e=kO(i,t);e<l&&(c=qk(t,r),d=n.feature.getGeometry().getType()===`Circle`?null:n.segment,l=e,u=n.feature)}}let e=p();if(e)return e}return null}updateFeature_(e){this.removeFeature(e,!1),this.addFeature(e,!1)}},TW=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=lD,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?Nk(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=Nk(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return tD()}readFeature(e,t){return tD()}readFeatures(e,t){return tD()}readGeometry(e,t){return tD()}readProjection(e){return tD()}writeFeature(e,t){return tD()}writeFeatures(e,t){return tD()}writeGeometry(e,t){return tD()}};function EW(e,t,n){let r=n?Nk(n.featureProjection):null,i=n?Nk(n.dataProjection):null,a=e;if(r&&i&&!Vk(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;n.getUnits()===`tile-pixels`?a.transform(n,o):a.applyTransform(Wk(n,o))}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}const DW={Point:lj,LineString:iM,Polygon:yj,MultiPoint:zN,MultiLineString:RN,MultiPolygon:VN};function OW(e,t,n){return Array.isArray(t[0])?(hj(e,0,t,n)||(e=e.slice(),_j(e,0,t,n)),e):(mj(e,0,t,n)||(e=e.slice(),gj(e,0,t,n)),e)}function kW(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>kW({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=n.layout.length;return EW(new UN(r,r===`Polygon`?OW(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function AW(e,t){if(!e)return null;if(Array.isArray(e))return new UU(e.map(e=>AW(e,t)));let n=DW[e.type];return EW(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var jW=class extends TW{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(MW(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(MW(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return tD()}readFeaturesFromObject(e,t){return tD()}readGeometry(e,t){return this.readGeometryFromObject(MW(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return tD()}readProjection(e){return this.readProjectionFromObject(MW(e))}readProjectionFromObject(e){return tD()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return tD()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return tD()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return tD()}};function MW(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var NW=class extends jW{constructor(e){e||={},super(),this.dataProjection=Nk(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=Nk(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=[`application/geo+json`,`application/vnd.geo+json`]}readFeatureFromObject(e,t){let n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=PW(n.geometry,t);if(this.featureClass===UN)return kW({geometry:r,id:n.id,properties:n.properties},t);let i=this.featureClass,a=new i;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&a.setGeometryName(n.geometry_name),a.setGeometry(AW(r,t)),`id`in n&&a.setId(n.id),n.properties&&a.setProperties(n.properties,!0),a}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return FW(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=Nk(t.properties.name);else if(t.type===`EPSG`)n=Nk(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`)}else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=UW(a,t),delete i[e.getGeometryName()]),ME(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return UW(e,this.adaptOptions(t))}};function PW(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=LW(e);break;case`LineString`:n=RW(e);break;case`Polygon`:n=HW(e);break;case`MultiPoint`:n=BW(e);break;case`MultiLineString`:n=zW(e);break;case`MultiPolygon`:n=VW(e);break;case`GeometryCollection`:n=IW(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function FW(e,t){return AW(PW(e,t),t)}function IW(e,t){return e.geometries.map(function(e){return PW(e,t)})}function LW(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:TA(t.length)}}function RW(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:TA(t[0]?.length||2)}}function zW(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:BA(r,0,t,n),layout:TA(n)}}function BW(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:TA(t[0]?.length||2)}}function VW(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:VA(n,0,t,r),layout:TA(r)}}function HW(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:BA(n,0,t,r),layout:TA(r)}}function UW(e,t){e=EW(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=YW(e,t);break;case`LineString`:r=GW(e,t);break;case`Polygon`:r=XW(e,t);break;case`MultiPoint`:r=qW(e,t);break;case`MultiLineString`:r=KW(e,t);break;case`MultiPolygon`:r=JW(e,t);break;case`GeometryCollection`:r=WW(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function WW(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return UW(e,t)})}}function GW(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function KW(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function qW(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function JW(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function YW(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function XW(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const ZW={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},QW={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},$W={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},eG=[{shape:`Point`,label:`Draw a point`,Icon:an},{shape:`LineString`,label:`Draw a line`,Icon:bn},{shape:`Circle`,label:`Draw a circle`,Icon:rn}];function tG({target:e,className:t,fileName:n=`react-openlayers-geojson.json`}){let r=sB(),i=vU(`MapDrawControl`,G(ZW.root,t),e),[a,o]=l.useState(!1),[s,c]=l.useState(null),u=l.useRef(null),f=l.useRef(null);if(!u.current){let e=new pP;u.current={source:e,layer:new RL({source:e,style:QW,properties:{key:`drawLayer`}}),modify:new fW({source:e})}}let p=u.current,m=l.useCallback(()=>{let e=p.source.getFeatures(),t=new NW().writeFeaturesObject(e,$W),r=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=n,a.click(),URL.revokeObjectURL(i)},[p,n]);l.useEffect(()=>{if(!(!r||!a))return r.addLayer(p.layer),r.addInteraction(p.modify),()=>{r.removeInteraction(p.modify),r.removeLayer(p.layer)}},[r,a,p]),l.useEffect(()=>{if(!r||!a||!s)return;let e=s===`LineString`?new iW({source:p.source,type:s,maxPoints:2}):new iW({source:p.source,type:s}),t=new wW({source:p.source});return f.current=e,r.addInteraction(e),r.addInteraction(t),()=>{r.removeInteraction(t),r.removeInteraction(e),f.current=null}},[r,a,s,p]),l.useEffect(()=>{if(!r||!a)return;let e=r.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?f.current?.abortDrawing():e.shiftKey&&e.key===`S`&&m()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,a,m]);let h=()=>{o(e=>!e),c(null)},g=e=>{c(t=>t===e?null:e)};return(0,d.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:ZW.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":a,onClick:h,children:(0,q.jsx)(kn,{size:12})}),a?(0,q.jsxs)(`div`,{className:ZW.shapes,children:[eG.map(({shape:e,label:t,Icon:n})=>(0,q.jsx)(`button`,{type:`button`,className:ZW.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":s===e,onClick:()=>g(e),children:(0,q.jsx)(n,{size:12})},e)),(0,q.jsx)(`button`,{type:`button`,className:ZW.shape,title:`Move and reshape what has been drawn`,"aria-pressed":s===null,onClick:()=>g(null),children:(0,q.jsx)(Vt,{size:12})})]}):null]}),i)}tG.displayName=`MapDrawControl`;const nG={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},rG=(e,t)=>e.map((e,n)=>{let r=`${t}${n}`;return{key:r,layer:e,name:e.get(`name`)??e.constructor.name,children:e instanceof HR?rG(e.getLayers().getArray(),`${r}.`):[]}});function iG({target:e,className:t}){let n=sB(),r=vU(`MapLayersControl`,G(nG.root,t),e),[i,a]=l.useState(!1),[o,s]=l.useState(0),c=l.useMemo(()=>n&&i?rG(n.getLayers().getArray(),``):[],[n,i,o]),u=(e,t)=>{e.setVisible(t),s(e=>e+1)},f=e=>(0,q.jsx)(`ul`,{className:nG.list,children:e.map(e=>(0,q.jsxs)(`li`,{className:nG.item,children:[(0,q.jsxs)(`label`,{className:nG.label,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.layer.getVisible(),onChange:t=>u(e.layer,t.target.checked)}),e.name]}),e.children.length>0?f(e.children):null]},e.key))});return(0,d.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:nG.toggle,title:`Click here to switch layers`,"aria-expanded":i,onClick:()=>a(e=>!e),children:(0,q.jsx)(yn,{size:24})}),i?(0,q.jsx)(`div`,{className:nG.layers,children:f(c)}):null]}),r)}iG.displayName=`MapLayersControl`;const aG={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function oG({target:e,className:t,zoom:n=18,color:r=hB,placeholder:i=`Search for a place`}){let a=sB(),o=vU(`MapSearchControl`,G(aG.root,t),e),[s,c]=l.useState(!1),[u,f]=l.useState(``);return(0,d.createPortal)((0,q.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!a||!u)return;let[t]=await pB(u,1);if(!t)return;let i=[Number(t.lon),Number(t.lat)];vB(a,i,r).set(`address`,t.display_name),a.getView().setCenter(zk(i)),a.getView().setZoom(n)},children:[(0,q.jsx)(`button`,{type:`button`,className:aG.toggle,title:i,"aria-expanded":s,onClick:()=>c(e=>!e),children:(0,q.jsx)(On,{size:24})}),s?(0,q.jsx)(`input`,{type:`search`,className:aG.input,value:u,placeholder:i,"aria-label":i,autoComplete:`off`,onChange:e=>f(e.target.value)}):null]}),o)}oG.displayName=`MapSearchControl`;const sG=e=>{let t=sB(),n=l.useRef(null);n.current||=e();let r=n.current;return l.useEffect(()=>{if(t)return t.addInteraction(r),()=>{t.removeInteraction(r)}},[t,r]),r};var cG=class extends CR{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:yR,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!xR(e))return;let t=e.map,n=t.getSize(),r=e.pixel,i=r[0]-n[0]/2,a=n[1]/2-r[1],o=Math.atan2(a,i),s=Math.sqrt(i*i+a*a),c=t.getView();if(this.lastAngle_!==void 0){let e=this.lastAngle_-o;c.adjustRotationInternal(e)}this.lastAngle_=o,this.lastMagnitude_!==void 0&&c.adjustResolutionInternal(this.lastMagnitude_/s),this.lastMagnitude_!==void 0&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}handleUpEvent(e){if(!xR(e))return!0;let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1}handleDownEvent(e){return xR(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function lG(e){return sG(()=>new cG(e)),null}lG.displayName=`MapDragRotateAndZoomInteraction`;const uG={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var dG=class extends ZE{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},fG=class extends CR{constructor(e){e||={},super(e),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=e.features===void 0?null:e.features;let t;if(e.layers&&!this.features_){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=KE;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:KE,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:pR,this.lastFeature_=null,this.addChangeListener(rR.ACTIVE,this.handleActiveChanged_)}handleDownEvent(e){if(!e.originalEvent||!this.condition_(e))return!1;if(this.lastFeature_=this.featuresAtPixel_(e.pixel,e.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=e.coordinate,this.lastCoordinate_=e.coordinate,this.handleMoveEvent(e);let t=this.features_||new sD([this.lastFeature_]);return this.dispatchEvent(new dG(uG.TRANSLATESTART,t,e.coordinate,this.startCoordinate_,e)),!0}return!1}handleUpEvent(e){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(e);let t=this.features_||new sD([this.lastFeature_]);return this.dispatchEvent(new dG(uG.TRANSLATEEND,t,e.coordinate,this.startCoordinate_,e)),this.startCoordinate_=null,!0}return!1}handleDragEvent(e){if(this.lastCoordinate_){let t=e.coordinate,n=e.map.getView().getProjection(),r=Jk(t,n),i=Jk(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new sD([this.lastFeature_]),c=Kk();s.forEach(function(e){let t=e.getGeometry();c?(t.transform(c,n),t.translate(a,o),t.transform(n,c)):t.translate(a,o),e.setGeometry(t)}),this.lastCoordinate_=t,this.dispatchEvent(new dG(uG.TRANSLATING,s,t,this.startCoordinate_,e))}}handleMoveEvent(e){let t=e.map.getViewport();this.featuresAtPixel_(e.pixel,e.map)?(t.classList.remove(this.lastCoordinate_?`ol-grab`:`ol-grabbing`),t.classList.add(this.lastCoordinate_?`ol-grabbing`:`ol-grab`)):t.classList.remove(`ol-grab`,`ol-grabbing`)}featuresAtPixel_(e,t){return t.forEachFeatureAtPixel(e,(e,t)=>{if(!(!(e instanceof lD)||!this.filter_(e,t))&&!(this.features_&&!this.features_.getArray().includes(e)))return e},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(e){this.hitTolerance_=e}setMap(e){let t=this.getMap();super.setMap(e),this.updateState_(t)}handleActiveChanged_(){this.updateState_(null)}updateState_(e){let t=this.getMap(),n=this.getActive();(!t||!n)&&(t||=e,t&&t.getViewport().classList.remove(`ol-grab`,`ol-grabbing`))}};function pG(e){return sG(()=>new fG(e)),null}pG.displayName=`MapTranslateInteraction`;function mG(e){let t=l.useRef(null),n=e=>{let n=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return n instanceof lD&&(t.current={feature:n,coordinate:e.coordinate},!0)},r=e=>{let n=t.current;if(!n)return;let r=n.feature.getGeometry();r&&(r.translate(e.coordinate[0]-n.coordinate[0],e.coordinate[1]-n.coordinate[1]),n.coordinate=e.coordinate)},i=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},a=()=>(t.current=null,!1);return sG(()=>new CR({handleDownEvent:n,handleDragEvent:r,handleMoveEvent:i,handleUpEvent:a,...e})),null}mG.displayName=`MapPointerInteraction`;const hG={SELECT:`select`};var gG=class extends ZE{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const _G={};var vG=class e extends iR{constructor(e){super(),this.on,this.once,this.un,e||={},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=e.condition?e.condition:gR,this.addCondition_=e.addCondition?e.addCondition:hR,this.removeCondition_=e.removeCondition?e.removeCondition:hR,this.toggleCondition_=e.toggleCondition?e.toggleCondition:yR,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:KE,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?yG():e.style,this.features_=e.features||new sD;let t;if(e.layers){if(typeof e.layers==`function`)t=e.layers;else{let n=e.layers;t=function(e){return n.includes(e)}}}else t=KE;this.layerFilter_=t,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[X(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[X(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(kE.ADD,this.boundAddFeature_),this.features_.addEventListener(kE.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(kE.ADD,this.boundAddFeature_),this.features_.removeEventListener(kE.REMOVE,this.boundRemoveFeature_))}addFeature_(e){let t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){let e=this.findLayerOfFeature_(t);e&&this.addFeatureLayerAssociation_(t,e)}}removeFeature_(e){this.style_&&this.restorePreviousStyle_(e.element),this.removeFeatureLayerAssociation_(e.element)}findLayerOfFeature_(e){return this.getMap().getAllLayers().find(function(t){if(t instanceof RL&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in _G||(_G[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(t){let n=this.getMap().getInteractions().getArray();for(let r=n.length-1;r>=0;--r){let i=n[r];if(i!==this&&i instanceof e&&i.getStyle()&&i.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(i.getStyle());return}}let r=X(t);t.setStyle(_G[r]),delete _G[r]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[X(e)]}selectFeature(e){let t=this.findLayerOfFeature_(e);if(!this.layerFilter_(t)||!this.filter_(e,t))return!1;let n=this.getFeatures();return!n.getArray().includes(e)&&(this.addFeatureLayerAssociation_(e,t),n.push(e),this.dispatchEvent(new gG(hG.SELECT,[e],[],void 0)),!0)}deselectFeature(e){let t=this.getFeatures(),n=t.getArray().indexOf(e);return n!==-1&&(t.removeAt(n),this.dispatchEvent(new gG(hG.SELECT,[],[e],void 0)),!0)}toggleFeature(e){this.deselectFeature(e)||this.selectFeature(e)}clearSelection(){let e=this.getFeatures();if(e.getLength()!==0){let t=e.getArray().slice();e.clear(),this.dispatchEvent(new gG(hG.SELECT,[],t,void 0))}}handleEvent(e){if(!this.condition_(e))return!0;let t=this.addCondition_(e),n=this.removeCondition_(e),r=this.toggleCondition_(e),i=!t&&!n&&!r,a=e.map,o=this.getFeatures(),s=[],c=[];if(i){a.forEachFeatureAtPixel(e.pixel,(e,t)=>{if(!(!(e instanceof lD)||!this.filter_(e,t)))return this.addFeatureLayerAssociation_(e,t),c.push(e),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=o.getLength()-1;e>=0;--e){let t=o.item(e),n=c.indexOf(t);n===-1?(o.removeAt(e),s.push(t)):c.splice(n,1)}c.length!==0&&o.extend(c)}else{a.forEachFeatureAtPixel(e.pixel,(e,i)=>{if(!(e instanceof lD)||!this.filter_(e,i))return;let a=o.getArray().includes(e);return a&&(n||r)?s.push(e):!a&&(t||r)&&(this.addFeatureLayerAssociation_(e,i),c.push(e)),!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let e=s.length-1;e>=0;--e)o.remove(s[e]);o.extend(c)}return(c.length>0||s.length>0)&&this.dispatchEvent(new gG(hG.SELECT,c,s,e)),!0}};function yG(){let e=EP();return UE(e.Polygon,e.LineString),UE(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const bG=`#ff0000`,xG=`rgba(255, 0, 0, 0.4)`,SG=e=>new OP({text:e,font:`12px Calibri,sans-serif`,fill:new mP({color:`#000`}),stroke:new hP({color:`#fff`,width:3}),offsetY:-10}),CG=e=>{let t=e.getGeometry();if(!(t instanceof CA))return;let n=t.getType();if(n===`Point`)return new SP({image:new xP({radius:6,fill:new mP({color:xG}),stroke:new hP({color:bG,width:2})})});if(n===`LineString`){let e=new SP({stroke:new hP({color:bG,width:3})}),n=hO(t)/1e3;return n>0&&e.setText(SG(`Length: ${n.toFixed(2)} km`)),e}let r=new SP({fill:new mP({color:xG}),stroke:new hP({color:bG,width:2})});try{let e=_O(t)/1e6;e>0&&r.setText(SG(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function wG({onSelect:e,style:t=CG,...n}){let r=sB(),i=sG(()=>new vG({...n,style:t})),a=l.useRef(e);return l.useEffect(()=>{a.current=e},[e]),l.useEffect(()=>{let e=i.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&a.current?.(e)});return()=>eD(e)},[i]),l.useEffect(()=>{if(!r)return;let e=r.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=i.getFeatures();t.forEach(e=>{i.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[r,i]),null}wG.displayName=`MapSelectInteraction`;function TG(e){return lO(e,5)}function EG(e){return parseFloat(e)}function DG(e){return TG(e).toString()}function OG(e,t){return!isNaN(e)&&e!==EG(DG(t))}function kG(e,t){return OG(e[0],t[0])||OG(e[1],t[1])}var AG=class extends iR{constructor(e){super(),e=Object.assign({animate:!0,params:[`x`,`y`,`z`,`r`,`l`],replace:!1,prefix:``},e||{});let t;t=e.animate===!0?{duration:250}:e.animate?e.animate:null,this.animationOptions_=t,this.params_=e.params.reduce((e,t)=>(e[t]=!0,e),{}),this.replace_=e.replace,this.prefix_=e.prefix,this.listenerKeys_=[],this.initial_=!0,this.updateState_=this.updateState_.bind(this),this.trackedCallbacks_={},this.trackedValues_={}}getParamName_(e){return this.prefix_?this.prefix_+e:e}get_(e,t){return e.get(this.getParamName_(t))}set_(e,t,n){t in this.params_&&e.set(this.getParamName_(t),n)}delete_(e,t){t in this.params_&&e.delete(this.getParamName_(t))}setMap(e){let t=this.getMap();super.setMap(e),e!==t&&(t&&this.unregisterListeners_(t),e&&(this.initial_=!0,this.updateState_(),this.registerListeners_(e)))}registerListeners_(e){this.listenerKeys_.push(NE(e,qL.MOVEEND,this.updateUrl_,this),NE(e.getLayerGroup(),IE.CHANGE,this.updateUrl_,this),NE(e,`change:layergroup`,this.handleChangeLayerGroup_,this)),this.replace_||addEventListener(`popstate`,this.updateState_)}unregisterListeners_(e){for(let e=0,t=this.listenerKeys_.length;e<t;++e)FE(this.listenerKeys_[e]);this.listenerKeys_.length=0,this.replace_||removeEventListener(`popstate`,this.updateState_);let t=new URL(window.location.href),n=t.searchParams;this.delete_(n,`x`),this.delete_(n,`y`),this.delete_(n,`z`),this.delete_(n,`r`),this.delete_(n,`l`),window.history.replaceState(null,``,t)}handleChangeLayerGroup_(){let e=this.getMap();e&&(this.unregisterListeners_(e),this.registerListeners_(e),this.initial_=!0,this.updateUrl_())}updateState_(){let e=new URL(window.location.href).searchParams;for(let t in this.trackedCallbacks_){let n=e.get(t);t in this.trackedCallbacks_&&n!==this.trackedValues_[t]&&(this.trackedValues_[t]=n,this.trackedCallbacks_[t](n))}let t=this.getMap();if(!t)return;let n=t.getView();if(!n||!n.isDef())return;let r=!1,i={},a=EG(this.get_(e,`z`));`z`in this.params_&&OG(a,n.getZoom())&&(r=!0,i.zoom=a);let o=EG(this.get_(e,`r`));`r`in this.params_&&OG(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[EG(this.get_(e,`x`)),EG(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&kG(s,n.getCenter())&&(r=!0,i.center=s),r&&(!this.initial_&&this.animationOptions_?n.animate(Object.assign(i,this.animationOptions_)):(i.center&&n.setCenter(i.center),`zoom`in i&&n.setZoom(i.zoom),`rotation`in i&&n.setRotation(i.rotation)));let c=t.getAllLayers(),l=this.get_(e,`l`);if(`l`in this.params_&&l&&l.length===c.length)for(let e=0,t=c.length;e<t;++e){let t=parseInt(l[e]);if(!isNaN(t)){let n=!!t,r=c[e];r.getVisible()!==n&&r.setVisible(n)}}}track(e,t){this.trackedCallbacks_[e]=t;let n=new URL(window.location.href).searchParams.get(e);return this.trackedValues_[e]=n,n}update(e,t){let n=new URL(window.location.href),r=n.searchParams;t===null?r.delete(e):r.set(e,t),e in this.trackedValues_&&(this.trackedValues_[e]=t),this.updateHistory_(n)}updateUrl_(){let e=this.getMap();if(!e)return;let t=e.getView();if(!t||!t.isDef())return;let n=t.getCenter(),r=t.getZoom(),i=t.getRotation(),a=e.getAllLayers(),o=Array(a.length);for(let e=0,t=a.length;e<t;++e)o[e]=a[e].getVisible()?`1`:`0`;let s=new URL(window.location.href),c=s.searchParams;this.set_(c,`x`,DG(n[0])),this.set_(c,`y`,DG(n[1])),this.set_(c,`z`,DG(r)),this.set_(c,`r`,DG(i)),this.set_(c,`l`,o.join(``)),this.updateHistory_(s),this.initial_=!1}updateHistory_(e){e.href!==window.location.href&&(this.initial_||this.replace_?window.history.replaceState(history.state,``,e):window.history.pushState(null,``,e))}};function jG(e){return sG(()=>new AG(e)),null}jG.displayName=`MapLinkInteraction`;const MG={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},NG=37.7649804,PG=-122.4323829,FG=[];function IG({latitude:e,longitude:t,zoom:n,marker:r,markerColor:i,markerLabel:a}){let o=sB(),s=l.useRef(!1);return l.useEffect(()=>{if(!o)return;let r=o.getView(),i=zk([t,e]);if(s.current){r.animate({center:i,zoom:n,duration:500});return}s.current=!0,r.setCenter(i),r.setZoom(n)},[o,e,t,n]),l.useEffect(()=>{if(!o||!r)return;let n=vB(o,[t,e],i,a);return()=>yB(o,n)},[o,e,t,r,i,a]),null}IG.displayName=`MapLocation`;function LG(e,t){let{latitude:n=NG,longitude:r=PG,zoom:i=16,width:a,height:o,controls:s=FG,marker:c=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=e,y=Y(f),b=l.useRef(null),x=ar(t,b),S=l.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=MG.toolbar,S.current=e}let C=S.current;l.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,q.jsx)(NU,{},e);case`fullScreen`:return(0,q.jsx)(OU,{target:C,source:y},e);case`search`:return(0,q.jsx)(oG,{target:C},e);case`layers`:return(0,q.jsx)(iG,{target:C},e);case`draw`:return(0,q.jsx)(tG,{target:C},e)}};return(0,q.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:G(MG.root,p),style:{...m,"--map-width":typeof a==`number`?`${a}px`:a,"--map-height":typeof o==`number`?`${o}px`:o},"data-component":`Map`,...v,children:(0,q.jsxs)(oB,{className:MG.surface,keyboardEventTarget:y,children:[(0,q.jsx)(IG,{latitude:n,longitude:r,zoom:i,marker:c,markerColor:u,markerLabel:d}),s.map(T),h]})})}LG.displayName=`Map`;var RG=K(LG);const zG=Object.assign(RG,{View:cB,Marker:SB,Overlay:wB,LayerGroup:OB,TileLayer:kB,ImageLayer:NB,VectorLayer:PB,GraticuleLayer:FB,HeatmapLayer:pU,WebGLTileLayer:gU,AttributionControl:yU,DrawControl:tG,FullScreenControl:OU,LayersControl:iG,MousePositionControl:LU,OverviewMapControl:VU,ScaleLineControl:NU,SearchControl:oG,DragRotateAndZoomInteraction:lG,LinkInteraction:jG,PointerInteraction:mG,SelectInteraction:wG,TranslateInteraction:pG}),BG={root:`markdown`};function VG(e,t){let{className:n,source:r,transformers:i,preserveNewLines:a=!1,...o}=e,[s]=(0,y.useLexicalComposerContext)(),c=l.useCallback(e=>{s.setRootElement(e)},[s]),u=ar(t,c);return rr(()=>{s.update(()=>{(0,v.$convertFromMarkdownString)(r,i,void 0,a)},{discrete:!0})},[s,r,i,a]),(0,q.jsx)(`div`,{ref:u,className:G(BG.root,n),"data-component":`Markdown`,...o})}VG.displayName=`MarkdownProse`;var HG=K(VG);const UG=`Markdown`,WG=[C.HeadingNode,C.QuoteNode,S.ListNode,S.ListItemNode,x.LinkNode,b.CodeNode,b.CodeHighlightNode],GG=[v.CHECK_LIST,...v.TRANSFORMERS],KG={paragraph:`markdown-paragraph`,heading:{h1:`markdown-heading-1`,h2:`markdown-heading-2`,h3:`markdown-heading-3`,h4:`markdown-heading-4`,h5:`markdown-heading-5`,h6:`markdown-heading-6`},quote:`markdown-quote`,link:`markdown-link`,code:`markdown-code-block`,list:{ul:`markdown-list-bullet`,ol:`markdown-list-number`,listitem:`markdown-list-item`,checklist:`markdown-list-check`,listitemChecked:`markdown-list-item-checked`,listitemUnchecked:`markdown-list-item-unchecked`,nested:{listitem:`markdown-list-item-nested`}},text:{bold:`markdown-bold`,italic:`markdown-italic`,strikethrough:`markdown-strikethrough`,highlight:`markdown-highlight`,code:`markdown-code-inline`},ltr:`markdown-ltr`,rtl:`markdown-rtl`};function qG(e,t){let{className:n,children:r=``,transformers:i=GG,preserveNewLines:a=!1,namespace:o=UG,onError:s,...c}=e;return(0,q.jsx)(_.LexicalComposer,{initialConfig:{namespace:o,theme:KG,nodes:WG,editable:!1,onError:s??(e=>{throw e})},children:(0,q.jsx)(HG,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}qG.displayName=`Markdown`;var JG=K(qG);const YG=(0,l.createContext)({}),XG=()=>(0,l.useContext)(YG),ZG=(e={})=>{let{paused:t,defaultPaused:n,onPauseChange:r}=e,i=t!==void 0,[a,o]=l.useState(n??!1),s=i?t:a,c=e=>{e!==s&&(i||o(e),r?.(e))};return{paused:s,pause:()=>c(!0),resume:()=>c(!1),toggle:()=>c(!s),setPaused:c}},QG={root:`marquee`},$G=e=>e===`top`||e===`bottom`;function eK(e,t){let{as:n=`div`,className:r,side:i=`start`,speed:a=50,delay:o=0,loopCount:s=0,autoFill:c=!1,spacing:u,reverse:d=!1,paused:f,defaultPaused:p,pauseOnInteraction:m=!0,onPauseChange:h,onLoopComplete:g,onComplete:_,children:v,...y}=e,b=ZG({paused:f,defaultPaused:p,onPauseChange:h}),x=$G(i),S=l.useRef(null),C=l.useRef(null),[w,T]=l.useState(0),[E,D]=l.useState(0);rr(()=>{let e=S.current,t=C.current;if(e===null||t===null)return;let n=()=>{let n=x?e.clientHeight:e.clientWidth,r=x?t.offsetHeight:t.offsetWidth;T(e=>e===n?e:n),D(e=>e===r?e:r)};n();let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[x]);let O=c&&E>0?Math.max(Math.ceil(w/E)+1,2):2,k=E>0&&a>0?E/a:0,{style:A,onMouseEnter:j,onMouseLeave:M,onFocus:N,onBlur:P,...F}=y,[I,L]=l.useState(!1),ee=e=>{j?.(e),m&&L(!0)},R=e=>{M?.(e),L(!1)},z=e=>{N?.(e),m&&L(!0)},te=e=>{P?.(e),e.currentTarget.contains(e.relatedTarget)||L(!1)},ne=b.paused||I,B={...b,side:i,orientation:x?`vertical`:`horizontal`,copyCount:O,viewportRef:S,copyRef:C,onLoopComplete:g,onComplete:_};return(0,q.jsx)(YG.Provider,{value:B,children:(0,q.jsx)(n,{ref:t,className:G(QG.root,r),style:{...A,"--marquee-duration":`${k}s`,"--marquee-delay":`${o}ms`,"--marquee-loop-count":s>0?`${s}`:`infinite`,...u===void 0?null:{"--marquee-spacing":u}},onMouseEnter:ee,onMouseLeave:R,onFocus:z,onBlur:te,"data-component":`Marquee`,"data-orientation":x?`vertical`:`horizontal`,"data-side":i,"data-reverse":d||void 0,"data-paused":ne||void 0,"data-running":E>0||void 0,...F,children:v})})}eK.displayName=`Marquee`;var tK=K(eK);const nK={root:`marquee-content`};function rK(e,t){let{as:n=`div`,className:r,children:i,...a}=e,{copyCount:o=1,copyRef:s,onLoopComplete:c,onComplete:u}=l.useContext(YG),d=ar(t,s),f=l.useRef(0),p=e=>e.target===e.currentTarget,m=e=>{p(e)&&(f.current+=1,c?.(f.current))},h=e=>{p(e)&&(f.current+=1,c?.(f.current),u?.())};return(0,q.jsx)(q.Fragment,{children:Array.from({length:o},(e,t)=>{let o=t===0;return(0,q.jsx)(n,{ref:o?d:void 0,className:G(nK.root,r),"aria-hidden":!o||void 0,inert:!o,onAnimationIteration:o?m:void 0,onAnimationEnd:o?h:void 0,"data-component":`Marquee.Content`,...a,children:i},t)})})}rK.displayName=`Marquee.Content`;var iK=K(rK);const aK={root:`marquee-edge`};function oK(e,t){let{as:n=`div`,className:r,side:i,...a}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(aK.root,r),"data-component":`Marquee.Edge`,"data-side":i,...a})}oK.displayName=`Marquee.Edge`;var sK=K(oK);const cK={root:`marquee-item`};function lK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(cK.root,r),"data-component":`Marquee.Item`,...i})}lK.displayName=`Marquee.Item`;var uK=K(lK);const dK={root:`marquee-viewport`};function fK(e,t){let{as:n=`div`,className:r,...i}=e,{viewportRef:a}=l.useContext(YG),o=ar(t,a);return(0,q.jsx)(n,{ref:o,className:G(dK.root,r),"data-component":`Marquee.Viewport`,...i})}fK.displayName=`Marquee.Viewport`;var pK=K(fK);const mK=Object.assign(tK,{Root:tK,Viewport:pK,Content:iK,Item:uK,Edge:sK}),hK=(0,l.createContext)({}),gK=W(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function _K(e,t){let{as:n=`div`,className:r,align:i,...a}=e,{align:o}=l.useContext(hK),s=i??o??`start`,c={align:s};return(0,q.jsx)(Cl.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(gK({align:s}),r),"data-component":`Message`,"data-align":s,...a})})}_K.displayName=`Message`;var vK=K(_K);const yK={root:`message-avatar`};function bK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(yK.root,r),"data-component":`Message.Avatar`,...i})}bK.displayName=`Message.Avatar`;var xK=K(bK);const SK={root:`message-content`};function CK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(SK.root,r),"data-component":`Message.Content`,...i})}CK.displayName=`Message.Content`;var wK=K(CK);const TK={root:`message-footer`};function EK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(TK.root,r),"data-component":`Message.Footer`,...i})}EK.displayName=`Message.Footer`;var DK=K(EK);const OK={root:`message-group`};function kK(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,q.jsx)(hK.Provider,{value:{align:i},children:(0,q.jsx)(n,{ref:t,className:G(OK.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}kK.displayName=`Message.Group`;var AK=K(kK);const jK={root:`message-header`};function MK(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(jK.root,r),"data-component":`Message.Header`,...i})}MK.displayName=`Message.Header`;var NK=K(MK);const PK=Object.assign(vK,{Group:AK,Avatar:xK,Content:wK,Header:NK,Footer:DK}),FK=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},IK=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,LK=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return IK(r??0,r,i);let a=e+t*n,o=Math.max(FK(n),FK(e)),s=o===0?a:Number(a.toFixed(o));return IK(s,r,i)},RK=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},zK=(0,l.createContext)({}),BK={root:`meter-indicator`};function VK(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(BK.root,r),"data-component":`Meter.Indicator`,...i})}VK.displayName=`Meter.Indicator`;var HK=K(VK);const UK={root:`meter-label`};function WK(e,t){let{as:n=`span`,className:r,id:i,...a}=e,{labelId:o}=l.useContext(zK);return(0,q.jsx)(n,{ref:t,id:i??o,className:G(UK.root,r),"data-component":`Meter.Label`,...a})}WK.displayName=`Meter.Label`;var GK=K(WK);const KK={root:`meter-track`};function qK(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(KK.root,r),"data-component":`Meter.Track`,...i})}qK.displayName=`Meter.Track`;var JK=K(qK);const YK={root:`meter-value`};function XK(e,t){let{className:n,children:r,...i}=e,{formattedValue:a=``,value:o=0}=l.useContext(zK);return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(YK.root,n),"data-component":`Meter.Value`,...i,children:typeof r==`function`?r({formattedValue:a,value:o}):r??a})}XK.displayName=`Meter.Value`;var ZK=K(XK);const QK=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,$K=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),eq={header:`meter-header`,hidden:`sr-only`},tq=W(`meter`,{variants:{size:{small:`meter-small`,medium:`meter-medium`,large:`meter-large`},variant:{accent:`meter-accent`,attention:`meter-attention`,danger:`meter-danger`,done:`meter-done`,neutral:`meter-neutral`,severe:`meter-severe`,sponsors:`meter-sponsors`,success:`meter-success`}}});function nq(e,t){let{as:n=`div`,className:r,style:i,value:a,min:o=0,max:s=100,format:c,getAriaValueText:l,size:u=`medium`,variant:d=`success`,children:f,id:p,"aria-label":m,"aria-labelledby":h,...g}=e,_=`${Y(p)}-label`,[v,y]=xr(f,{label:GK,value:ZK,track:JK}),b=IK(Number.isNaN(a)?o:a,o,s),x=IK(QK(b,o,s),0,100),S=$K(b,x,c),C=l?l(S,a):S,w=h??(v.label&&!m?_:void 0),T={value:b,percentage:x,formattedValue:S,labelId:_};return(0,q.jsx)(zK.Provider,{value:T,children:(0,q.jsxs)(n,{ref:t,id:p,role:`meter`,"aria-valuenow":b,"aria-valuemin":o,"aria-valuemax":s,"aria-valuetext":C,"aria-label":m,"aria-labelledby":w,className:G(tq({size:u,variant:d}),r),style:{...i,"--meter-percentage":`${x}%`},"data-component":`Meter`,"data-size":u,"data-variant":d,"data-value":b,...g,children:[v.label||v.value?(0,q.jsxs)(`span`,{className:eq.header,children:[v.label,v.value]}):null,v.track??(0,q.jsx)(JK,{children:(0,q.jsx)(HK,{})}),y,(0,q.jsx)(`span`,{role:`presentation`,className:eq.hidden,children:`x`})]})})}nq.displayName=`Meter`;var rq=K(nq);const iq=Object.assign(rq,{Label:GK,Value:ZK,Track:JK,Indicator:HK});function aq(e,t){return(0,q.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}aq.displayName=`NativeSelect.OptGroup`;var oq=K(aq);function sq(e,t){return(0,q.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}sq.displayName=`NativeSelect.Option`;var cq=K(sq);const lq=Object.assign(Rx,{Option:cq,OptGroup:oq}),uq={root:`navigation-list-heading`,hidden:`sr-only`};function dq(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(Tr,{as:t,size:`small`,className:G(n?uq.hidden:uq.root,r),"data-component":`NavigationList.Heading`,...i})}dq.displayName=`NavigationList.Heading`;const fq=l.createContext(null),pq=l.createContext({depth:0}),mq=l.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),hq=e=>Number.parseInt(e.slice(1),10),gq=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},_q={heading:dq},vq={container:`NavigationList`};function yq(e,t){let{children:n,className:r,"aria-label":i,"aria-labelledby":a,...o}=e,[s,c]=xr(n,_q),u=Y(),d=s.heading,f=d?d.props.id??u:void 0,p=d?hq(d.props.as??`h2`):null;return(0,q.jsx)(`nav`,{ref:t,"aria-label":i,"aria-labelledby":a??(i?void 0:f),className:G(r),"data-component":`NavigationList`,...o,children:(0,q.jsxs)(fq.Provider,{value:p,children:[d?l.cloneElement(d,{id:f}):null,(0,q.jsx)(Ar.Provider,{value:vq,children:(0,q.jsx)(ji,{children:c})})]})})}yq.displayName=`NavigationList`;var bq=l.forwardRef(yq);function xq(e){let{title:t,children:n,hideDivider:r=!1,...i}=e,a=l.useContext(fq);return(0,q.jsxs)(q.Fragment,{children:[r?null:(0,q.jsx)(ji.Divider,{}),(0,q.jsxs)(ji.Group,{"data-component":`NavigationList.Group`,...i,children:[t?(0,q.jsx)(ji.GroupHeading,{as:gq(a),children:t}):null,n]})]})}xq.displayName=`NavigationList.Group`;const Sq={chevron:`navigation-list-chevron`},Cq={trailingVisual:ji.TrailingVisual},wq=e=>{if(!l.isValidElement(e))return!1;let t=e.props[`aria-current`];return t&&t!==`false`?!0:l.Children.toArray(e.props.children).some(wq)};function Tq(e){let{children:t,subNavigation:n,defaultOpen:r,className:i}=e,a=Y(),o=Y(),s=l.useRef(null),c=l.useMemo(()=>wq(n),[n]),[u,d]=l.useState(r??c),[f,p]=l.useState(c);rr(()=>{let e=c||!!s.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[c,n]);let m=l.useMemo(()=>({buttonId:a,subNavigationId:o,isOpen:u}),[a,o,u]),[h,g]=xr(t,Cq);return(0,q.jsx)(mq.Provider,{value:m,children:(0,q.jsxs)(ji.Item,{id:a,active:!u&&f,"aria-expanded":u,"aria-controls":o,onSelect:()=>d(e=>!e),className:i,"data-component":`NavigationList.Item`,children:[g,(0,q.jsxs)(ji.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,q.jsx)(Qt,{className:Sq.chevron})]}),(0,q.jsx)(ji.SubItem,{children:l.cloneElement(n,{ref:s})})]})})}Tq.displayName=`NavigationList.ItemWithSubNavigation`;const Eq={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function Dq(e,t){let{className:n,children:r,...i}=e,{buttonId:a,subNavigationId:o,isOpen:s}=l.useContext(mq),{depth:c}=l.useContext(pq),u=l.useMemo(()=>({depth:c+1}),[c]);return!a||!o||c>=4?null:(0,q.jsx)(pq.Provider,{value:u,children:(0,q.jsx)(`ul`,{ref:t,id:o,hidden:!s,"aria-labelledby":a,className:G(Eq.root,Eq.items,n),"data-component":`NavigationList.SubNavigation`,"data-depth":c+1,...i,children:r})})}Dq.displayName=`NavigationList.SubNavigation`;var Oq=K(Dq);const kq={subNavigation:Oq},Aq=ji.LinkItem;function jq(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=xr(r,kq);return c.subNavigation?(0,q.jsx)(Tq,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,q.jsx)(Aq,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}jq.displayName=`NavigationList.Item`;var Mq=K(jq);const Nq=e=>typeof e==`string`||!(0,f.isValidElementType)(e)?e:(0,q.jsx)(e,{});function Pq(e,t){let{label:n=`Show more`,pages:r=0,items:i,renderItem:a,...o}=e,[s,c]=l.useState(0),u=Y(),d=i.length/r,f=r===0?i.length:Math.ceil(d*s),p=s===1?0:f-Math.floor(d);return rr(()=>{s!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[s,u]),(0,q.jsxs)(q.Fragment,{children:[s>0?i.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:o,...s}=e,c=t===p?u:void 0;return a?a({...e,"data-expand-focus-target":c}):(0,q.jsxs)(Mq,{"data-expand-focus-target":c,...s,children:[r?(0,q.jsx)(ji.LeadingVisual,{children:(0,q.jsx)(r,{})}):null,n,i?(0,q.jsx)(ji.TrailingVisual,{children:Nq(i)}):null,o?(0,q.jsx)(ji.TrailingAction,{...o}):null]},e.id??t)}):null,s<r||s===0?(0,q.jsxs)(ji.Item,{ref:t,as:`button`,"aria-expanded":!1,onSelect:()=>c(e=>e+1),"data-component":`NavigationList.GroupExpand`,...o,children:[n,(0,q.jsx)(ji.TrailingVisual,{children:(0,q.jsx)(Pt,{})})]}):null]})}Pq.displayName=`NavigationList.GroupExpand`;var Fq=l.forwardRef(Pq);const Iq={root:`navigation-list-group-heading`};function Lq(e){let{as:t,className:n,...r}=e,i=l.useContext(fq);return(0,q.jsx)(ji.GroupHeading,{as:t??gq(i),className:G(Iq.root,n),"data-component":`NavigationList.GroupHeading`,...r})}Lq.displayName=`NavigationList.GroupHeading`;const Rq=yr(Lq,Hr),zq=Object.assign(bq,{Heading:dq,Item:Mq,SubNavigation:Oq,Group:xq,GroupHeading:Rq,GroupExpand:Fq,Description:Rr,LeadingVisual:ni,TrailingVisual:bi,TrailingAction:yi,Divider:Br}),Bq={root:`navigation-menu-heading`,hidden:`sr-only`};function Vq(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(Tr,{as:t,size:`small`,className:G(n?Bq.hidden:Bq.root,r),"data-component":`NavigationMenu.Heading`,...i})}Vq.displayName=`NavigationMenu.Heading`;const Hq=(0,l.createContext)({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),Uq=(0,l.createContext)({value:``,triggerId:``,contentId:``,isOpen:!1}),Wq=(0,l.createContext)({linkId:``,descriptionId:``}),Gq=(0,l.createContext)(null),Kq=(0,l.createContext)({depth:0}),qq=e=>Number.parseInt(e.slice(1),10),Jq=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},Yq={root:`navigation-menu`},Xq={heading:Vq};function Zq(e,t){let{children:n,className:r,value:i,defaultValue:a=null,onValueChange:o,orientation:s=`horizontal`,openOn:c=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=e,g=l.useRef(null),_=ar(t,g),[v,y]=xr(n,Xq),b=Y(),x=v.heading,S=x?x.props.id??b:void 0,C=x?qq(x.props.as??`h2`):null,w=m??(p?void 0:S),T=i!==void 0,[E,D]=l.useState(a),O=T?i:E,k=l.useRef(o);rr(()=>{k.current=o},[o]);let A=l.useRef(null),j=l.useRef(null),M=l.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);l.useEffect(()=>M,[M]);let N=l.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=l.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=l.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);Hi(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),l.useEffect(()=>{if(O===null)return;let e=e=>{let{target:t}=e;!(t instanceof Node)||g.current?.contains(t)||N(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[O,N]);let I=e=>{f?.(e),O!==null&&(e.relatedTarget instanceof Node&&g.current?.contains(e.relatedTarget)||N(null))},L=l.useMemo(()=>({openValue:O,setOpenValue:N,orientation:s,openOn:c,openAfterDelay:P,closeAfterDelay:F}),[O,N,s,c,P,F]);return(0,q.jsx)(Hq.Provider,{value:L,children:(0,q.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:G(Yq.root,r),"data-component":`NavigationMenu`,"data-orientation":s,...h,onBlur:I,children:(0,q.jsxs)(Gq.Provider,{value:C,children:[x?l.cloneElement(x,{id:S}):null,y]})})})}Zq.displayName=`NavigationMenu`;var Qq=l.forwardRef(Zq);const $q=W(`navigation-menu-content`,{variants:{open:{true:`motion-safe:data-[orientation=horizontal]:animate-in motion-safe:data-[orientation=horizontal]:fade-in motion-safe:data-[orientation=horizontal]:duration-short motion-safe:data-[orientation=horizontal]:slide-in-from-top-1`,false:``},align:{start:`navigation-menu-content-align-start`,center:`navigation-menu-content-align-center`,end:`navigation-menu-content-align-end`}}});function eJ(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e,{orientation:o}=l.useContext(Hq),{triggerId:s,contentId:c,isOpen:u}=l.useContext(Uq);if(!c)return null;let d=o===`vertical`?void 0:i;return(0,q.jsx)(n,{ref:t,id:c,hidden:!u,"aria-labelledby":s,className:G($q({open:u,align:d}),r),"data-component":`NavigationMenu.Content`,"data-orientation":o,"data-align":d,"data-open":u?``:void 0,...a})}eJ.displayName=`NavigationMenu.Content`;var tJ=K(eJ);const nJ={root:`navigation-menu-description`};function rJ(e){let{className:t,...n}=e,{descriptionId:r}=l.useContext(Wq);return(0,q.jsx)(`span`,{id:r,className:G(nJ.root,t),"data-component":`NavigationMenu.Description`,...n})}rJ.displayName=`NavigationMenu.Description`;const iJ={root:`navigation-menu-divider`};function aJ(e){let{className:t,...n}=e;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:G(iJ.root,t),"data-component":`NavigationMenu.Divider`,...n})}aJ.displayName=`NavigationMenu.Divider`;const oJ={root:`navigation-menu-group-heading`};function sJ(e){let{as:t,className:n,...r}=e,i=l.useContext(Gq),a=t??Jq(i);return(0,q.jsx)(a,{className:G(oJ.root,n),"data-component":`NavigationMenu.GroupHeading`,...r})}sJ.displayName=`NavigationMenu.GroupHeading`;const cJ={root:`navigation-menu-group`},lJ={groupHeading:sJ};function uJ(e){let{title:t,children:n,className:r,hideDivider:i=!1,...a}=e,o=Y(),[s,c]=xr(n,lJ),u=s.groupHeading??(t?(0,q.jsx)(sJ,{children:t}):null),d=u?u.props.id??o:void 0;return(0,q.jsxs)(q.Fragment,{children:[i?null:(0,q.jsx)(aJ,{}),(0,q.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:G(cJ.root,r),"data-component":`NavigationMenu.Group`,...a,children:[u?l.cloneElement(u,{id:d}):null,c]})]})}uJ.displayName=`NavigationMenu.Group`;const dJ={root:`navigation-menu-item`};function fJ(e,t){let{children:n,className:r,value:i,onPointerEnter:a,onPointerLeave:o,...s}=e,c=Y(),u=i??c,d=Y(),f=Y(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=l.useContext(Hq),_=p===u,v=e=>{a?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=l.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,q.jsx)(Uq.Provider,{value:b,children:(0,q.jsx)(`li`,{ref:t,className:G(dJ.root,r),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...s,onPointerEnter:v,onPointerLeave:y,children:n})})}fJ.displayName=`NavigationMenu.Item`;var pJ=l.forwardRef(fJ);const mJ={root:`navigation-menu-visual`},hJ=({className:e,...t})=>(0,q.jsx)(`span`,{className:G(mJ.root,e),...t});function gJ(e){return(0,q.jsx)(hJ,{"data-component":`NavigationMenu.LeadingVisual`,...e})}gJ.displayName=`NavigationMenu.LeadingVisual`;const _J={root:`navigation-menu-sub-navigation`};function vJ(e,t){let{className:n,children:r,...i}=e,{linkId:a}=l.useContext(Wq),{depth:o}=l.useContext(Kq),s=l.useMemo(()=>({depth:o+1}),[o]);return!a||o>=4?null:(0,q.jsx)(Kq.Provider,{value:s,children:(0,q.jsx)(`ul`,{ref:t,"aria-labelledby":a,className:G(_J.root,n),"data-component":`NavigationMenu.SubNavigation`,"data-depth":o+1,...i,children:r})})}vJ.displayName=`NavigationMenu.SubNavigation`;var yJ=K(vJ);const bJ={root:`navigation-menu-visual-trailing`};function xJ(e){let{className:t,...n}=e;return(0,q.jsx)(hJ,{className:G(bJ.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}xJ.displayName=`NavigationMenu.TrailingVisual`;const SJ={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},CJ={leadingVisual:gJ,trailingVisual:xJ,description:rJ,subNavigation:yJ};function wJ(e,t){let{as:n=`a`,id:r,className:i,active:a,children:o,onClick:s,...c}=e,{setOpenValue:u}=l.useContext(Hq),{depth:d}=l.useContext(Kq),f=Y(r),p=Y(),[m,h]=xr(o,CJ),g=l.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{s?.(e),!e.defaultPrevented&&u(null)},v=(0,q.jsxs)(n,{ref:t,id:f,"aria-current":a?`page`:void 0,"aria-describedby":m.description?p:void 0,className:G(SJ.root,a&&SJ.active,i),"data-component":`NavigationMenu.Link`,"data-active":a?``:void 0,"data-has-description":m.description?``:void 0,...c,onClick:_,children:[m.leadingVisual,(0,q.jsxs)(`span`,{className:SJ.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,q.jsxs)(Wq.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,q.jsx)(`li`,{className:SJ.item,children:y})}wJ.displayName=`NavigationMenu.Link`;var TJ=K(wJ);const EJ={root:`navigation-menu-list`},DJ=(e,t)=>Array.from(e.querySelectorAll(`[data-component='NavigationMenu.Trigger'], [data-component='NavigationMenu.Link']`)).filter(e=>{let n=e.closest(`[data-component='NavigationMenu.Content']`);return n&&(t===`horizontal`||n.hasAttribute(`hidden`))?!1:!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-disabled`)!==`true`});function OJ(e,t){let{children:n,className:r,onKeyDown:i,...a}=e,{orientation:o,openValue:s,setOpenValue:c}=l.useContext(Hq),u=l.useRef(null),d=ar(t,u),f=e=>{i?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=o===`vertical`,r=n?`ArrowDown`:`ArrowRight`,a=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(s===null||!(n instanceof HTMLElement)||!t.contains(n))return;e.preventDefault(),e.stopPropagation(),n.closest(`[data-component='NavigationMenu.Content']`)?.closest(`li`)?.querySelector(`[data-component='NavigationMenu.Trigger']`)?.focus(),c(null);return}let l=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===a?-1:0;if(d===0&&!l)return;let f=DJ(t,o),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&s!==null&&c(null),l){f[e.key===`Home`?0:f.length-1].focus();return}f[(p+d+f.length)%f.length].focus()}};return(0,q.jsx)(`ul`,{ref:d,className:G(EJ.root,r),"data-component":`NavigationMenu.List`,"data-orientation":o,...a,onKeyDown:f,children:n})}OJ.displayName=`NavigationMenu.List`;var kJ=l.forwardRef(OJ);const AJ={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function jJ(e,t){let{children:n,className:r,onClick:i,onKeyDown:a,...o}=e,{setOpenValue:s,orientation:c}=l.useContext(Hq),{value:u,triggerId:d,contentId:f,isOpen:p}=l.useContext(Uq),m=l.useRef(!1);if(rr(()=>{!p||!m.current||(m.current=!1,mr(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{i?.(e),!e.defaultPrevented&&s(p?null:u)},g=e=>{if(a?.(e),e.defaultPrevented)return;let t=c===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,s(u);return}mr(document.getElementById(f))[0]?.focus()}};return(0,q.jsxs)(`button`,{ref:t,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:G(AJ.root,r),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...o,onClick:h,onKeyDown:g,children:[n,(0,q.jsx)(Qt,{className:AJ.chevron})]})}jJ.displayName=`NavigationMenu.Trigger`;var MJ=l.forwardRef(jJ);const NJ=Object.assign(Qq,{Heading:Vq,List:kJ,Item:pJ,Trigger:MJ,Content:tJ,Link:TJ,SubNavigation:yJ,Group:uJ,GroupHeading:sJ,Description:rJ,LeadingVisual:gJ,TrailingVisual:xJ,Divider:aJ}),PJ={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},FJ=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,q.jsxs)(`span`,{className:PJ.stepper,"data-component":`NumberInput.Stepper`,children:[(0,q.jsx)(gi,{type:`button`,variant:`invisible`,size:`small`,icon:tn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:PJ.step,"data-component":`NumberInput.Increment`}),(0,q.jsx)(gi,{type:`button`,variant:`invisible`,size:`small`,icon:Qt,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:PJ.step,"data-component":`NumberInput.Decrement`})]});function IJ(e,t){let{className:n,value:r,defaultValue:i,min:a,max:o,step:s=1,disabled:c,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=e,g=l.useRef(null),_=ar(t,g),v=r!==void 0,[y,b]=l.useState(i??null),x=v?r:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(RK(e.target),e)},w=e=>{let t=LK(x,e,{step:s,min:a,max:o});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&o!==void 0&&x>=o,E=x!=null&&a!==void 0&&x<=a,D=!!c||!!u;return(0,q.jsx)(qo,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:i,min:a,max:o,step:s,disabled:c,readOnly:u,onChange:C,className:G(PJ.root,n),trailingAction:d?void 0:(0,q.jsx)(FJ,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}IJ.displayName=`NumberInput`;var LJ=K(IJ);const RJ={current:null},zJ=(0,l.createContext)({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:RJ,contentWrapperRef:RJ,sidebarRef:RJ,sidebarContentWrapperRef:RJ}),BJ={root:`page-layout-horizontal-divider`};function VJ(e,t){let{className:n,style:r,variant:i=`none`,position:a,...o}=e,{padding:s}=l.useContext(zJ);return(0,q.jsx)(`div`,{ref:t,className:G(BJ.root,n),style:{"--spacing-divider":`var(--page-layout-spacing-${s})`,...r},"data-component":`PageLayout.HorizontalDivider`,...Ui(`variant`,i),...Ui(`position`,a),...o})}VJ.displayName=`PageLayout.HorizontalDivider`;var HJ=K(VJ);const UJ={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function WJ(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(zJ);return(0,q.jsxs)(`footer`,{ref:t,className:G(UJ.root,UJ.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Footer`,...Ui(`hidden`,s),...c,children:[(0,q.jsx)(HJ,{variant:o,className:UJ.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,q.jsx)(`div`,{className:UJ.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i})]})}WJ.displayName=`PageLayout.Footer`;var GJ=K(WJ);const KJ={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function qJ(e,t){let{className:n,style:r,children:i,padding:a=`none`,divider:o=`none`,hidden:s=!1,...c}=e,{rowGap:u}=l.useContext(zJ);return(0,q.jsxs)(`header`,{ref:t,className:G(KJ.root,KJ.hidden,n),style:{"--spacing":`var(--page-layout-spacing-${u})`,...r},"data-component":`PageLayout.Header`,...Ui(`hidden`,s),...c,children:[(0,q.jsx)(`div`,{className:KJ.content,style:{"--spacing":`var(--page-layout-spacing-${a})`},children:i}),(0,q.jsx)(HJ,{variant:o,className:KJ.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}qJ.displayName=`PageLayout.Header`;var JJ=K(qJ);const YJ=1280,XJ={small:256,medium:296,large:320},ZJ=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,QJ=e=>e===`small`||e===`medium`||e===`large`,$J=e=>QJ(e)?XJ[e]:ZJ(e)?parseInt(e.default,10):0,eY=()=>$n&&window.innerWidth>=1280?959:511,tY=e=>`Pane width ${e} pixels`,nY=(e,t,n=tY)=>{e&&(t.min!==void 0&&e.setAttribute(`aria-valuemin`,String(t.min)),t.max!==void 0&&e.setAttribute(`aria-valuemax`,String(t.max)),t.current!==void 0&&(e.setAttribute(`aria-valuenow`,String(t.current)),e.setAttribute(`aria-valuetext`,n(t.current))))},rY=({handle:e,pane:t,contentWrapper:n})=>{e?.style.setProperty(`--drag-handle-background-color`,`var(--background-color-accent-emphasis)`),e?.style.setProperty(`--drag-handle-opacity`,`1`),e?.style.setProperty(`--drag-handle-transition`,`none`),t?.setAttribute(`data-dragging`,`true`),n?.setAttribute(`data-dragging`,`true`)},iY=({handle:e,pane:t,contentWrapper:n})=>{e?.style.removeProperty(`--drag-handle-background-color`),e?.style.removeProperty(`--drag-handle-opacity`),e?.style.removeProperty(`--drag-handle-transition`),t?.removeAttribute(`data-dragging`),n?.removeAttribute(`data-dragging`)},aY={save:(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},get:e=>{try{let t=localStorage.getItem(e);if(t!==null){let e=Number(t);if(!Number.isNaN(e)&&e>0)return Math.round(e)}}catch{}return null}},oY={root:`page-layout-drag-handle`},sY=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,cY=e=>e===`ArrowLeft`||e===`ArrowDown`;function lY(e){let{className:t,handleRef:n,onDragStart:r,onDrag:i,onDragEnd:a,onDoubleClick:o,"aria-label":s,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=tY}=e,g=l.useRef({onDragStart:r,onDrag:i,onDragEnd:a});l.useEffect(()=>{g.current={onDragStart:r,onDrag:i,onDragEnd:a}});let _=l.useRef(!1),v=l.useRef(null),y=l.useRef(null),b=l.useCallback(()=>{_.current||=(rY({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[n,p,m]),x=l.useCallback(()=>{_.current&&=(iY({handle:n.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[n,p,m]);return l.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,q.jsx)(`div`,{ref:n,role:`slider`,tabIndex:0,"aria-label":c?void 0:s??`Draggable pane splitter`,"aria-labelledby":c,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:G(oY.root,t),onPointerDown:e=>{if(e.button===0){e.preventDefault();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}g.current.onDragStart(e.clientX),b()}},onPointerMove:e=>{_.current&&(e.preventDefault(),y.current=e.clientX,v.current===null&&(v.current=requestAnimationFrame(()=>{v.current=null,y.current!==null&&(g.current.onDrag(y.current,!1),y.current=null)})))},onPointerUp:e=>{_.current&&e.preventDefault()},onLostPointerCapture:()=>{_.current&&(v.current!==null&&(cancelAnimationFrame(v.current),v.current=null,y.current=null),x(),g.current.onDragEnd())},onKeyDown:e=>{sY(e.key)&&(e.preventDefault(),b(),g.current.onDrag(cY(e.key)?-3:3,!0))},onKeyUp:e=>{sY(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:o,"data-component":`PageLayout.DragHandle`})}lY.displayName=`PageLayout.DragHandle`;const uY={root:`page-layout-vertical-divider`};function dY(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,q.jsx)(`div`,{ref:t,className:G(uY.root,n),"data-component":`PageLayout.VerticalDivider`,...Ui(`variant`,r),...Ui(`position`,i),...a})}dY.displayName=`PageLayout.VerticalDivider`;var fY=K(dY);const pY=({width:e,minWidth:t,resizable:n,widthStorageKey:r,paneRef:i,handleRef:a,contentWrapperRef:o,constrainToViewport:s=!1,onResizeEnd:c,currentWidth:u,formatValueText:d})=>{let f=ZJ(e),p=f?parseInt(e.min,10):t,m=f?parseInt(e.max,10):null,h=l.useMemo(()=>$J(e),[e]),g=l.useRef(r),_=l.useRef(c),v=l.useRef(d);rr(()=>{g.current=r,_.current=c,v.current=d});let y=l.useRef(s?256:511),b=l.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:s?Math.min(m,t):m},[m,p,s]),[x,S]=l.useState(()=>typeof u==`number`?u:c===void 0&&n===!0&&r!==void 0?aY.get(r)??h:h),[C,w]=l.useState(h),[T,E]=l.useState(u),D=u!==T;D&&(E(u),typeof u==`number`?S(u):T!==void 0&&S(h)),h!==C&&(w(h),u===void 0&&!D&&S(h));let O=u??x,k=l.useRef(O),[A,j]=l.useState(()=>m??600),M=l.useRef(A);rr(()=>{k.current=O},[O]);let N=l.useCallback(()=>$J(e),[e]),P=l.useCallback(e=>{let t=Math.round(e);if(k.current=t,l.startTransition(()=>{S(t)}),_.current){try{_.current(t)}catch{}return}n&&g.current&&aY.save(g.current,t)},[n]),F=l.useRef(b);return rr(()=>{F.current=b}),rr(()=>{if(!n)return;let e=window.innerWidth,t=()=>{let t=window.innerWidth,n=e<YJ!=t<YJ;e=t,n&&(y.current=eY());let r=F.current();i.current?.style.setProperty(`--pane-max-width`,`${r}px`);let o=k.current>r;o&&(k.current=r,i.current?.style.setProperty(`--pane-width`,`${r}px`)),nY(a.current,{max:r,current:k.current},v.current),(r!==M.current||o)&&(M.current=r,l.startTransition(()=>{j(r),o&&S(r)}))};y.current=eY();let r=F.current();if(M.current=r,i.current?.style.setProperty(`--pane-max-width`,`${r}px`),nY(a.current,{min:p,max:r,current:k.current},v.current),l.startTransition(()=>{j(r)}),m!==null&&!s)return;let c=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,i.current?.setAttribute(`data-dragging`,`true`),o?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,i.current?.removeAttribute(`data-dragging`),o?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-c>=16?(c=e,t()):u===null&&(u=requestAnimationFrame(()=>{u=null,c=performance.now(),t()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[n,m,s,p,i,a,o]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},mY={wrapper:`page-layout-sidebar-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-sidebar-position`,sticky:`page-layout-sidebar-sticky`,fullscreen:`page-layout-sidebar-fullscreen`,sidebar:`page-layout-sidebar`,sidebarResizable:`page-layout-sidebar-resizable`,dragging:`page-layout-dragging`,sidebarFullscreen:`page-layout-sidebar-fullscreen-inner`,divider:`page-layout-sidebar-divider`};function hY(e,t){let{className:n,style:r,children:i,id:a,position:o=`start`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,responsiveVariant:_=`default`,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=l.useContext(zJ),T=l.useRef(null),E=l.useRef(0),D=l.useRef(0),O=l.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=pY({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=ar(t,C),L=Tp(C),ee=Y(a),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},z=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},te=(0,q.jsx)(fY,{variant:h?`line`:m,position:o,className:mY.divider,children:h?(0,q.jsx)(lY,{handleRef:T,dragTargetRef:C,contentWrapperRef:w,"aria-valuemin":j,"aria-valuemax":M,"aria-valuenow":k,onDragStart:e=>{E.current=e,D.current=C.current?.getBoundingClientRect().width??A.current,O.current=N()},onDrag:(e,t)=>{let n=t?N():O.current;if(t){let t=o===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(z(r),nY(T.current,{current:r,max:n}));return}if(!C.current)return;let r=e-E.current,i=Math.max(j,Math.min(n,D.current+(o===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(z(i),nY(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();z(e),nY(T.current,{current:e}),F(e)}}):null});return(0,q.jsxs)(`div`,{className:G(mY.wrapper,mY.hidden,mY.position,mY.sticky,mY.fullscreen,n),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...r},"data-position":o,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...Ui(`is-hidden`,v),children:[o===`end`?te:null,(0,q.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:G(mY.sidebar,mY.sidebarResizable,mY.sidebarFullscreen,mY.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":ZJ(s)?s.min:`${c}px`,"--pane-max-width":ZJ(s)?s.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":ZJ(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${QJ(s)?s:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...a?{id:ee}:{},...x,children:i}),o===`start`?te:null]})}hY.displayName=`PageLayout.Sidebar`;var gY=K(hY);const _Y={content:`page-layout-content-row`},vY=W(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),yY=W(`page-layout-wrapper`,{variants:{width:{full:`page-layout-width-full`,medium:`page-layout-width-medium`,large:`page-layout-width-large`,xlarge:`page-layout-width-xlarge`}}});function bY(e,t){let{className:n,style:r,children:i,containerWidth:a=`xlarge`,padding:o=`normal`,rowGap:s=`normal`,columnGap:c=`normal`,...u}=e,d=l.useRef(null),f=l.useRef(null),p=l.useRef(null),m=l.useRef(null),[h,g]=xr(i,{header:JJ,footer:GJ,sidebar:gY}),_=l.useMemo(()=>({padding:o,rowGap:s,columnGap:c,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[o,s,c]);return(0,q.jsx)(zJ.Provider,{value:_,children:(0,q.jsxs)(`div`,{ref:t,className:G(vY({hasSidebar:!!h.sidebar}),n),style:{"--spacing":`var(--page-layout-spacing-${o})`,...r},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,q.jsxs)(`div`,{ref:m,className:G(yY({width:a})),"data-page-layout-wrapper":``,"data-width":a,children:[h.header,(0,q.jsx)(`div`,{className:_Y.content,children:g}),h.footer]})]})})}bY.displayName=`PageLayout`;var xY=K(bY);const SY={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},CY=W(`page-layout-content`,{variants:{width:{full:`page-layout-content-width-full`,medium:`page-layout-content-width-medium`,large:`page-layout-content-width-large`,xlarge:`page-layout-content-width-xlarge`}}});function wY(e,t){let{as:n=`main`,className:r,children:i,width:a=`full`,padding:o=`none`,hidden:s=!1,...c}=e,{contentWrapperRef:u}=l.useContext(zJ),d=ar(t,u);return(0,q.jsx)(n,{ref:d,className:G(SY.wrapper,SY.hidden,SY.dragging,r),"data-component":`PageLayout.Content`,...Ui(`is-hidden`,s),...c,children:(0,q.jsx)(`div`,{className:G(CY({width:a})),"data-width":a,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:i})})}wY.displayName=`PageLayout.Content`;var TY=K(wY);const EY={wrapper:`page-layout-pane-wrapper`,hidden:`page-layout-hidden`,position:`page-layout-pane-position`,sticky:`page-layout-pane-sticky`,pane:`page-layout-pane`,paneResizable:`page-layout-pane-resizable`,dragging:`page-layout-dragging`,horizontalDivider:`page-layout-pane-horizontal-divider`,verticalDivider:`page-layout-pane-vertical-divider`};function DY(e,t){let{className:n,style:r,children:i,id:a,position:o=`end`,width:s=`medium`,minWidth:c=256,currentWidth:u,onResizeEnd:d,widthStorageKey:f=`paneWidth`,padding:p=`none`,divider:m=`none`,resizable:h=!1,sticky:g=!1,offsetHeader:_=0,hidden:v=!1,"aria-label":y,"aria-labelledby":b,...x}=e,S=ls(o)?`end`:o,C=ls(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=l.useContext(zJ),O=l.useRef(null),k=l.useRef(0),A=l.useRef(0),j=l.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=pY({width:s,minWidth:c,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=ar(t,E),z=Tp(E),te=Y(a),ne=z?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},B=e=>{E.current?.style.setProperty(`--pane-width`,`${e}px`),N.current=e};return(0,q.jsxs)(`div`,{className:G(EY.wrapper,EY.hidden,EY.position,EY.sticky,n),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...r},"data-sticky":g||void 0,...Ui(`is-hidden`,v),...Ui(`position`,o),children:[(0,q.jsx)(HJ,{variant:ls(m)?m:{narrow:C,regular:`none`},position:o,className:EY.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,q.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:G(EY.pane,EY.paneResizable,EY.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":ZJ(s)?s.min:`${c}px`,"--pane-max-width":ZJ(s)?s.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":ZJ(s)?s.default:void 0,"--pane-width-size":`var(--pane-width-${QJ(s)?s:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...a?{id:te}:{},...x,children:i}),(0,q.jsx)(fY,{variant:ls(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:o,className:EY.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,q.jsx)(lY,{handleRef:O,dragTargetRef:E,contentWrapperRef:D,"aria-valuemin":P,"aria-valuemax":F,"aria-valuenow":M,onDragStart:e=>{k.current=e,A.current=E.current?.getBoundingClientRect().width??N.current,j.current=I()},onDrag:(e,t)=>{let n=t?I():j.current;if(t){let t=Math.max(P,Math.min(n,N.current+e));t!==N.current&&(B(t),nY(O.current,{current:t,max:n}));return}if(!E.current)return;let r=e-k.current,i=Math.max(P,Math.min(n,A.current+(S===`end`?-r:r)));Math.round(i)!==Math.round(N.current)&&(B(i),nY(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();B(e),nY(O.current,{current:e}),ee(e)}}):null})]})}DY.displayName=`PageLayout.Pane`;var OY=K(DY);const kY=Object.assign(xY,{Header:JJ,Content:TY,Pane:OY,Sidebar:gY,Footer:GJ}),AY=[`narrow`,`regular`,`wide`],jY={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},MY=W(`pagination-step`,{variants:{step:{previous:`pagination-step-previous`,next:`pagination-step-next`},current:{true:`pagination-step-current`,false:``},inert:{true:`pagination-step-inert`,false:``}}}),NY=e=>typeof e==`object`?AY.filter(t=>e[t]===!1):e?[]:[...AY],PY=({page:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[e.type===`previous`?(0,q.jsx)($t,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,q.jsx)(en,{"data-component":`Pagination.NextPageIcon`}):null]}),FY=e=>`#${e}`;function IY(e,t){let{as:n=`nav`,className:r,pageCount:i,currentPage:a,onPageChange:o,hrefBuilder:s=FY,marginPageCount:c=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=e,m=l.useMemo(()=>e_(i,a,!!d,c,u),[i,a,d,c,u]),h=NY(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=t_(e,s,t=>o?.(t,e.num)),a=e.type===`previous`||e.type===`next`,c=!!r||!!i[`aria-hidden`],l=G(MY({step:a?e.type:void 0,current:e.selected,inert:c}));if(f&&!r)return f({key:t,children:(0,q.jsx)(PY,{page:e,children:n}),number:e.num,className:l,"data-component":`Pagination.Page`,...i});let u=r?`span`:`a`,d=a?e.type===`previous`?`Pagination.PreviousPage`:`Pagination.NextPage`:`Pagination.Page`;return(0,q.jsx)(u,{role:r?`presentation`:void 0,className:l,"data-component":d,...i,children:(0,q.jsx)(PY,{page:e,children:n})},t)});return(0,q.jsx)(n,{ref:t,"aria-label":`Pagination`,className:G(jY.root,r),"data-component":`Pagination`,...p,children:(0,q.jsx)(`div`,{className:G(jY.steps,h.map(e=>jY.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}IY.displayName=`Pagination`;var LY=K(IY);const RY={root:`password-input`,toggle:`password-input-toggle`};function zY(e,t){let{className:n,visible:r,defaultVisible:i=!1,onVisibilityChange:a,hideToggle:o=!1,showLabel:s=`Show password`,hideLabel:c=`Hide password`,disabled:u,...d}=e,f=r!==void 0,[p,m]=l.useState(i),h=f?r:p;return(0,q.jsx)(qo,{ref:t,type:h?`text`:`password`,disabled:u,className:G(RY.root,n),trailingAction:o?void 0:(0,q.jsx)(qo.Action,{icon:h?pn:mn,"aria-label":h?c:s,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),a?.(t)},className:RY.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}zY.displayName=`PasswordInput`;var BY=K(zY);const VY={root:`pin-input`},HY=W(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),UY={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},WY=(e,t)=>Array.from(e).filter(e=>UY[t].test(e)).join(``);function GY(e,t){let{className:n,length:r=6,value:i,defaultValue:a=``,type:o=`numeric`,mask:s=!1,size:c=`medium`,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m,autoComplete:h,boxLabel:g=`Digit`,onChange:_,onComplete:v,"aria-label":y,"aria-labelledby":b,...x}=e,S=l.useRef([]),C=i!==void 0,[w,T]=l.useState(()=>WY(a,o).slice(0,r)),E=C?i:w,D=Array.from({length:r},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=l.useRef(!1),A=e=>{let t=S.current[e];k.current=!0,t?.focus(),t?.select(),k.current=!1},j=e=>{C||T(e),_?.(e),e.length===r&&v?.(e)},M=(e,t)=>{let n=WY(t,o);if(n.length===0)return;let i=O===-1?e:Math.min(e,O),a=[...D],s=i;Array.from(n).forEach(e=>{s<r&&(a[s]=e,s+=1)}),j(a.join(``)),A(Math.min(s,r-1))},N=e=>{let t=[...D];t[e]=``,j(t.join(``))},P=e=>{if(k.current)return;let t=O===-1?e:Math.min(e,O);t!==e&&A(t)},F=(e,t)=>{if(t.target.value===``){N(e);return}M(e,t.target.value)},I=(e,t)=>{u||d||(t.preventDefault(),M(e,t.clipboardData.getData(`text`)))},L=(e,t)=>{if(!(u||d)){if(t.key===`Backspace`){if(t.preventDefault(),D[e]!==``){N(e);return}e>0&&(N(e-1),A(e-1));return}if(t.key===`Delete`){t.preventDefault(),N(e);return}if(t.key===`ArrowLeft`&&e>0){t.preventDefault(),A(e-1);return}if(t.key===`ArrowRight`&&e<r-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(r-1))}};return(0,q.jsx)(`div`,{ref:t,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:G(VY.root,n),"data-component":`PINInput`,"data-size":c,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,q.jsx)(qo,{ref:e=>{S.current[t]=e},type:s?`password`:`text`,inputMode:o===`numeric`?`numeric`:`text`,size:c,value:e,maxLength:1,disabled:u,readOnly:d,required:f,validationStatus:p,autoFocus:m&&t===0,autoComplete:t===0?h:`off`,"aria-label":`${g} ${t+1} of ${r}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:G(HY({size:c})),"data-component":`PINInput.Box`},t))})}GY.displayName=`PINInput`;var KY=K(GY);const qY={root:`placeholder`};function JY(e,t){let{as:n=`div`,className:r,width:i,height:a,label:o,style:s,children:c,...l}=e;return(0,q.jsx)(n,{ref:t,className:G(qY.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}JY.displayName=`Placeholder`;var YY=K(JY);const XY=(0,l.createContext)({}),ZY=W(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function QY(e,t){let{as:n=`div`,className:r,caret:i=`top`,open:a=!1,relative:o=!1,...s}=e,c={open:a,caret:i};return(0,q.jsx)(XY.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(ZY({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}QY.displayName=`Popover`;var $Y=K(QY);const eX=W(`popover-content`,{variants:{caret:{top:`popover-content-caret-top`,bottom:`popover-content-caret-bottom`,left:`popover-content-caret-left`,right:`popover-content-caret-right`,"top-left":`popover-content-caret-top-left`,"top-right":`popover-content-caret-top-right`,"bottom-left":`popover-content-caret-bottom-left`,"bottom-right":`popover-content-caret-bottom-right`,"left-top":`popover-content-caret-left-top`,"left-bottom":`popover-content-caret-left-bottom`,"right-top":`popover-content-caret-right-top`,"right-bottom":`popover-content-caret-right-bottom`},width:{xsmall:`popover-content-width-xsmall`,small:`popover-content-width-small`,medium:`popover-content-width-medium`,large:`popover-content-width-large`,xlarge:`popover-content-width-xlarge`,auto:`popover-content-width-auto`},height:{small:`popover-content-height-small`,medium:`popover-content-height-medium`,large:`popover-content-height-large`,xlarge:`popover-content-height-xlarge`,auto:`popover-content-height-auto`,"fit-content":`popover-content-height-fit-content`},overflow:{auto:`popover-content-overflow-auto`,hidden:`popover-content-overflow-hidden`,scroll:`popover-content-overflow-scroll`,visible:`popover-content-overflow-visible`}}}),tX=[];function nX(e,t){let{as:n=`div`,className:r,width:i=`small`,height:a=`fit-content`,overflow:o=`visible`,onClickOutside:s,onEscape:c,ignoreClickRefs:u=tX,...d}=e,{open:f=!1,caret:p=`top`}=l.useContext(XY),m=l.useRef(null),h=ar(t,m);return l.useEffect(()=>{if(!f||!s)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(m.current?.contains(t)||u.some(({current:e})=>e?.contains(t))||s(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,s,u]),Hi(e=>{!f||!c||(c(e),e.preventDefault())}),(0,q.jsx)(n,{ref:h,className:G(eX({caret:p,width:i,height:a,overflow:o}),r),"data-component":`Popover.Content`,"data-caret":p,"data-width":i,"data-height":a,"data-overflow":o,...d})}nX.displayName=`Popover.Content`;var rX=K(nX);const iX=Object.assign($Y,{Content:rX}),aX={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},oX=W(`progress-circle`,{variants:{size:{small:`progress-circle-small`,medium:`progress-circle-medium`,large:`progress-circle-large`},variant:{accent:`progress-circle-accent`,attention:`progress-circle-attention`,danger:`progress-circle-danger`,done:`progress-circle-done`,neutral:`progress-circle-neutral`,severe:`progress-circle-severe`,sponsors:`progress-circle-sponsors`,success:`progress-circle-success`}}});function sX(e,t){let{as:n=`span`,className:r,progress:i=0,size:a=`medium`,variant:o=`success`,style:s,children:c,"aria-valuenow":u,...d}=e,f=Math.min(Math.max(i,0),100),p=l.Children.toArray(c).length>0;return(0,q.jsxs)(n,{ref:t,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:G(oX({size:a,variant:o}),r),style:{...s,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":a,"data-variant":o,...d,children:[(0,q.jsxs)(`svg`,{className:aX.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:aX.track,cx:16,cy:16,r:14,pathLength:100}),(0,q.jsx)(`circle`,{className:aX.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,q.jsx)(`span`,{className:aX.label,children:c}):null]})}sX.displayName=`ProgressCircle`;var cX=K(sX);const lX={L:1,M:0,Q:3,H:2},uX={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},dX={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function fX(e,t){let n=dX[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const pX={L:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:19,ecCodewordsPerBlock:7,group1Blocks:1,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:34,group2Blocks:0,group2DataCW:0},{totalDataCodewords:55,ecCodewordsPerBlock:15,group1Blocks:1,group1DataCW:55,group2Blocks:0,group2DataCW:0},{totalDataCodewords:80,ecCodewordsPerBlock:20,group1Blocks:1,group1DataCW:80,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:108,group2Blocks:0,group2DataCW:0},{totalDataCodewords:136,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:0,group2DataCW:0},{totalDataCodewords:156,ecCodewordsPerBlock:20,group1Blocks:2,group1DataCW:78,group2Blocks:0,group2DataCW:0},{totalDataCodewords:194,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:97,group2Blocks:0,group2DataCW:0},{totalDataCodewords:232,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:116,group2Blocks:0,group2DataCW:0},{totalDataCodewords:274,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:68,group2Blocks:2,group2DataCW:69},{totalDataCodewords:324,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:81,group2Blocks:0,group2DataCW:0},{totalDataCodewords:370,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:92,group2Blocks:2,group2DataCW:93},{totalDataCodewords:428,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:107,group2Blocks:0,group2DataCW:0},{totalDataCodewords:461,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:523,ecCodewordsPerBlock:22,group1Blocks:5,group1DataCW:87,group2Blocks:1,group2DataCW:88},{totalDataCodewords:589,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:98,group2Blocks:1,group2DataCW:99},{totalDataCodewords:647,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:721,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:120,group2Blocks:1,group2DataCW:121},{totalDataCodewords:795,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:113,group2Blocks:4,group2DataCW:114},{totalDataCodewords:861,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:107,group2Blocks:5,group2DataCW:108},{totalDataCodewords:932,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:116,group2Blocks:4,group2DataCW:117},{totalDataCodewords:1006,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:111,group2Blocks:7,group2DataCW:112},{totalDataCodewords:1094,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:121,group2Blocks:5,group2DataCW:122},{totalDataCodewords:1174,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:1276,ecCodewordsPerBlock:26,group1Blocks:8,group1DataCW:106,group2Blocks:4,group2DataCW:107},{totalDataCodewords:1370,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:114,group2Blocks:2,group2DataCW:115},{totalDataCodewords:1468,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:1531,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:117,group2Blocks:10,group2DataCW:118},{totalDataCodewords:1631,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:116,group2Blocks:7,group2DataCW:117},{totalDataCodewords:1735,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:115,group2Blocks:10,group2DataCW:116},{totalDataCodewords:1843,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:3,group2DataCW:116},{totalDataCodewords:1955,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:0,group2DataCW:0},{totalDataCodewords:2071,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:115,group2Blocks:1,group2DataCW:116},{totalDataCodewords:2191,ecCodewordsPerBlock:30,group1Blocks:13,group1DataCW:115,group2Blocks:6,group2DataCW:116},{totalDataCodewords:2306,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:121,group2Blocks:7,group2DataCW:122},{totalDataCodewords:2434,ecCodewordsPerBlock:30,group1Blocks:6,group1DataCW:121,group2Blocks:14,group2DataCW:122},{totalDataCodewords:2566,ecCodewordsPerBlock:30,group1Blocks:17,group1DataCW:122,group2Blocks:4,group2DataCW:123},{totalDataCodewords:2702,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:122,group2Blocks:18,group2DataCW:123},{totalDataCodewords:2812,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:117,group2Blocks:4,group2DataCW:118},{totalDataCodewords:2956,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:118,group2Blocks:6,group2DataCW:119}],M:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:10,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:28,ecCodewordsPerBlock:16,group1Blocks:1,group1DataCW:28,group2Blocks:0,group2DataCW:0},{totalDataCodewords:44,ecCodewordsPerBlock:26,group1Blocks:1,group1DataCW:44,group2Blocks:0,group2DataCW:0},{totalDataCodewords:64,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:32,group2Blocks:0,group2DataCW:0},{totalDataCodewords:86,ecCodewordsPerBlock:24,group1Blocks:2,group1DataCW:43,group2Blocks:0,group2DataCW:0},{totalDataCodewords:108,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:27,group2Blocks:0,group2DataCW:0},{totalDataCodewords:124,ecCodewordsPerBlock:18,group1Blocks:4,group1DataCW:31,group2Blocks:0,group2DataCW:0},{totalDataCodewords:154,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:38,group2Blocks:2,group2DataCW:39},{totalDataCodewords:182,ecCodewordsPerBlock:22,group1Blocks:3,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:216,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:43,group2Blocks:1,group2DataCW:44},{totalDataCodewords:254,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:50,group2Blocks:4,group2DataCW:51},{totalDataCodewords:290,ecCodewordsPerBlock:22,group1Blocks:6,group1DataCW:36,group2Blocks:2,group2DataCW:37},{totalDataCodewords:334,ecCodewordsPerBlock:22,group1Blocks:8,group1DataCW:37,group2Blocks:1,group2DataCW:38},{totalDataCodewords:365,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:40,group2Blocks:5,group2DataCW:41},{totalDataCodewords:415,ecCodewordsPerBlock:24,group1Blocks:5,group1DataCW:41,group2Blocks:5,group2DataCW:42},{totalDataCodewords:453,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:507,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:1,group2DataCW:47},{totalDataCodewords:563,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:43,group2Blocks:4,group2DataCW:44},{totalDataCodewords:627,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:44,group2Blocks:11,group2DataCW:45},{totalDataCodewords:669,ecCodewordsPerBlock:26,group1Blocks:3,group1DataCW:41,group2Blocks:13,group2DataCW:42},{totalDataCodewords:714,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:42,group2Blocks:0,group2DataCW:0},{totalDataCodewords:782,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:46,group2Blocks:0,group2DataCW:0},{totalDataCodewords:860,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:47,group2Blocks:14,group2DataCW:48},{totalDataCodewords:914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:45,group2Blocks:14,group2DataCW:46},{totalDataCodewords:1e3,ecCodewordsPerBlock:28,group1Blocks:8,group1DataCW:47,group2Blocks:13,group2DataCW:48},{totalDataCodewords:1062,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:46,group2Blocks:4,group2DataCW:47},{totalDataCodewords:1128,ecCodewordsPerBlock:28,group1Blocks:22,group1DataCW:45,group2Blocks:3,group2DataCW:46},{totalDataCodewords:1193,ecCodewordsPerBlock:28,group1Blocks:3,group1DataCW:45,group2Blocks:23,group2DataCW:46},{totalDataCodewords:1267,ecCodewordsPerBlock:28,group1Blocks:21,group1DataCW:45,group2Blocks:7,group2DataCW:46},{totalDataCodewords:1373,ecCodewordsPerBlock:28,group1Blocks:19,group1DataCW:47,group2Blocks:10,group2DataCW:48},{totalDataCodewords:1455,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:46,group2Blocks:29,group2DataCW:47},{totalDataCodewords:1541,ecCodewordsPerBlock:28,group1Blocks:10,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1631,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:21,group2DataCW:47},{totalDataCodewords:1725,ecCodewordsPerBlock:28,group1Blocks:14,group1DataCW:46,group2Blocks:23,group2DataCW:47},{totalDataCodewords:1812,ecCodewordsPerBlock:28,group1Blocks:12,group1DataCW:47,group2Blocks:26,group2DataCW:48},{totalDataCodewords:1914,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:47,group2Blocks:34,group2DataCW:48},{totalDataCodewords:1992,ecCodewordsPerBlock:28,group1Blocks:29,group1DataCW:46,group2Blocks:14,group2DataCW:47},{totalDataCodewords:2102,ecCodewordsPerBlock:28,group1Blocks:13,group1DataCW:46,group2Blocks:32,group2DataCW:47},{totalDataCodewords:2216,ecCodewordsPerBlock:28,group1Blocks:40,group1DataCW:47,group2Blocks:7,group2DataCW:48},{totalDataCodewords:2334,ecCodewordsPerBlock:28,group1Blocks:18,group1DataCW:47,group2Blocks:31,group2DataCW:48}],Q:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:13,ecCodewordsPerBlock:13,group1Blocks:1,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:22,ecCodewordsPerBlock:22,group1Blocks:1,group1DataCW:22,group2Blocks:0,group2DataCW:0},{totalDataCodewords:34,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:17,group2Blocks:0,group2DataCW:0},{totalDataCodewords:48,ecCodewordsPerBlock:26,group1Blocks:2,group1DataCW:24,group2Blocks:0,group2DataCW:0},{totalDataCodewords:62,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:76,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:19,group2Blocks:0,group2DataCW:0},{totalDataCodewords:88,ecCodewordsPerBlock:18,group1Blocks:2,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:110,ecCodewordsPerBlock:22,group1Blocks:4,group1DataCW:18,group2Blocks:2,group2DataCW:19},{totalDataCodewords:132,ecCodewordsPerBlock:20,group1Blocks:4,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:154,ecCodewordsPerBlock:24,group1Blocks:6,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:180,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:22,group2Blocks:4,group2DataCW:23},{totalDataCodewords:206,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:20,group2Blocks:6,group2DataCW:21},{totalDataCodewords:244,ecCodewordsPerBlock:24,group1Blocks:8,group1DataCW:20,group2Blocks:4,group2DataCW:21},{totalDataCodewords:261,ecCodewordsPerBlock:20,group1Blocks:11,group1DataCW:16,group2Blocks:5,group2DataCW:17},{totalDataCodewords:295,ecCodewordsPerBlock:30,group1Blocks:5,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:325,ecCodewordsPerBlock:24,group1Blocks:15,group1DataCW:19,group2Blocks:2,group2DataCW:20},{totalDataCodewords:367,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:22,group2Blocks:15,group2DataCW:23},{totalDataCodewords:397,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:1,group2DataCW:23},{totalDataCodewords:445,ecCodewordsPerBlock:26,group1Blocks:17,group1DataCW:21,group2Blocks:4,group2DataCW:22},{totalDataCodewords:485,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:5,group2DataCW:25},{totalDataCodewords:512,ecCodewordsPerBlock:28,group1Blocks:17,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:568,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:614,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:664,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:24,group2Blocks:16,group2DataCW:25},{totalDataCodewords:718,ecCodewordsPerBlock:30,group1Blocks:7,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:754,ecCodewordsPerBlock:28,group1Blocks:28,group1DataCW:22,group2Blocks:6,group2DataCW:23},{totalDataCodewords:808,ecCodewordsPerBlock:30,group1Blocks:8,group1DataCW:23,group2Blocks:26,group2DataCW:24},{totalDataCodewords:871,ecCodewordsPerBlock:30,group1Blocks:4,group1DataCW:24,group2Blocks:31,group2DataCW:25},{totalDataCodewords:911,ecCodewordsPerBlock:30,group1Blocks:1,group1DataCW:23,group2Blocks:37,group2DataCW:24},{totalDataCodewords:985,ecCodewordsPerBlock:30,group1Blocks:15,group1DataCW:24,group2Blocks:25,group2DataCW:25},{totalDataCodewords:1033,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:24,group2Blocks:1,group2DataCW:25},{totalDataCodewords:1115,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:24,group2Blocks:35,group2DataCW:25},{totalDataCodewords:1171,ecCodewordsPerBlock:30,group1Blocks:29,group1DataCW:24,group2Blocks:19,group2DataCW:25},{totalDataCodewords:1231,ecCodewordsPerBlock:30,group1Blocks:44,group1DataCW:24,group2Blocks:7,group2DataCW:25},{totalDataCodewords:1286,ecCodewordsPerBlock:30,group1Blocks:39,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1354,ecCodewordsPerBlock:30,group1Blocks:46,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1426,ecCodewordsPerBlock:30,group1Blocks:49,group1DataCW:24,group2Blocks:10,group2DataCW:25},{totalDataCodewords:1502,ecCodewordsPerBlock:30,group1Blocks:48,group1DataCW:24,group2Blocks:14,group2DataCW:25},{totalDataCodewords:1582,ecCodewordsPerBlock:30,group1Blocks:43,group1DataCW:24,group2Blocks:22,group2DataCW:25},{totalDataCodewords:1666,ecCodewordsPerBlock:30,group1Blocks:34,group1DataCW:24,group2Blocks:34,group2DataCW:25}],H:[{totalDataCodewords:0,ecCodewordsPerBlock:0,group1Blocks:0,group1DataCW:0,group2Blocks:0,group2DataCW:0},{totalDataCodewords:9,ecCodewordsPerBlock:17,group1Blocks:1,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:16,ecCodewordsPerBlock:28,group1Blocks:1,group1DataCW:16,group2Blocks:0,group2DataCW:0},{totalDataCodewords:26,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:36,ecCodewordsPerBlock:16,group1Blocks:4,group1DataCW:9,group2Blocks:0,group2DataCW:0},{totalDataCodewords:46,ecCodewordsPerBlock:22,group1Blocks:2,group1DataCW:11,group2Blocks:2,group2DataCW:12},{totalDataCodewords:60,ecCodewordsPerBlock:28,group1Blocks:4,group1DataCW:15,group2Blocks:0,group2DataCW:0},{totalDataCodewords:66,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:13,group2Blocks:1,group2DataCW:14},{totalDataCodewords:86,ecCodewordsPerBlock:26,group1Blocks:4,group1DataCW:14,group2Blocks:2,group2DataCW:15},{totalDataCodewords:100,ecCodewordsPerBlock:24,group1Blocks:4,group1DataCW:12,group2Blocks:4,group2DataCW:13},{totalDataCodewords:122,ecCodewordsPerBlock:28,group1Blocks:6,group1DataCW:15,group2Blocks:2,group2DataCW:16},{totalDataCodewords:140,ecCodewordsPerBlock:24,group1Blocks:3,group1DataCW:12,group2Blocks:8,group2DataCW:13},{totalDataCodewords:158,ecCodewordsPerBlock:28,group1Blocks:7,group1DataCW:14,group2Blocks:4,group2DataCW:15},{totalDataCodewords:180,ecCodewordsPerBlock:22,group1Blocks:12,group1DataCW:11,group2Blocks:4,group2DataCW:12},{totalDataCodewords:197,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:5,group2DataCW:13},{totalDataCodewords:223,ecCodewordsPerBlock:24,group1Blocks:11,group1DataCW:12,group2Blocks:7,group2DataCW:13},{totalDataCodewords:253,ecCodewordsPerBlock:30,group1Blocks:3,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:283,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:17,group2DataCW:15},{totalDataCodewords:313,ecCodewordsPerBlock:28,group1Blocks:2,group1DataCW:14,group2Blocks:19,group2DataCW:15},{totalDataCodewords:341,ecCodewordsPerBlock:26,group1Blocks:9,group1DataCW:13,group2Blocks:16,group2DataCW:14},{totalDataCodewords:385,ecCodewordsPerBlock:28,group1Blocks:15,group1DataCW:15,group2Blocks:10,group2DataCW:16},{totalDataCodewords:406,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:16,group2Blocks:6,group2DataCW:17},{totalDataCodewords:442,ecCodewordsPerBlock:24,group1Blocks:34,group1DataCW:13,group2Blocks:0,group2DataCW:0},{totalDataCodewords:464,ecCodewordsPerBlock:30,group1Blocks:16,group1DataCW:15,group2Blocks:14,group2DataCW:16},{totalDataCodewords:514,ecCodewordsPerBlock:30,group1Blocks:30,group1DataCW:16,group2Blocks:2,group2DataCW:17},{totalDataCodewords:538,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:13,group2DataCW:16},{totalDataCodewords:596,ecCodewordsPerBlock:30,group1Blocks:33,group1DataCW:16,group2Blocks:4,group2DataCW:17},{totalDataCodewords:628,ecCodewordsPerBlock:30,group1Blocks:12,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:661,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:31,group2DataCW:16},{totalDataCodewords:701,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:26,group2DataCW:16},{totalDataCodewords:745,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:25,group2DataCW:16},{totalDataCodewords:793,ecCodewordsPerBlock:30,group1Blocks:23,group1DataCW:15,group2Blocks:28,group2DataCW:16},{totalDataCodewords:845,ecCodewordsPerBlock:30,group1Blocks:19,group1DataCW:15,group2Blocks:35,group2DataCW:16},{totalDataCodewords:901,ecCodewordsPerBlock:30,group1Blocks:11,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:961,ecCodewordsPerBlock:30,group1Blocks:59,group1DataCW:16,group2Blocks:1,group2DataCW:17},{totalDataCodewords:986,ecCodewordsPerBlock:30,group1Blocks:22,group1DataCW:15,group2Blocks:41,group2DataCW:16},{totalDataCodewords:1054,ecCodewordsPerBlock:30,group1Blocks:2,group1DataCW:15,group2Blocks:64,group2DataCW:16},{totalDataCodewords:1096,ecCodewordsPerBlock:30,group1Blocks:24,group1DataCW:15,group2Blocks:46,group2DataCW:16},{totalDataCodewords:1142,ecCodewordsPerBlock:30,group1Blocks:42,group1DataCW:15,group2Blocks:32,group2DataCW:16},{totalDataCodewords:1222,ecCodewordsPerBlock:30,group1Blocks:10,group1DataCW:15,group2Blocks:67,group2DataCW:16},{totalDataCodewords:1276,ecCodewordsPerBlock:30,group1Blocks:20,group1DataCW:15,group2Blocks:61,group2DataCW:16}]};function mX(e,t){return pX[t][e]}const hX=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],gX=[0,0,0,0,0,0,0,31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017];function _X(e){return/^\d+$/.test(e)}function vX(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function yX(e){return _X(e)?`numeric`:vX(e)?`alphanumeric`:`byte`}function bX(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function xX(e){let t=[],n=0;for(;n+2<e.length;)EX(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(EX(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&EX(t,Number.parseInt(e[n],10),4),t}function SX(e){let t=[],n=0;for(;n+1<e.length;)EX(t,bX(e[n])*45+bX(e[n+1]),11),n+=2;return n<e.length&&EX(t,bX(e[n]),6),t}function CX(e){let t=[];for(let n of e)EX(t,n,8);return t}function wX(e){let t=[];for(let n of e){let e;if(n>=33088&&n<=40956)e=n-33088;else if(n>=57408&&n<=60351)e=n-49472;else throw Error(`Invalid Shift JIS kanji value: 0x${n.toString(16)}`);let r=e>>8&255,i=e&255;EX(t,r*192+i,13)}return t}function TX(e){let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>=12288&&r<=40959){let e=33088+(r-12288);e<=40956?t.push(e):t.push(57408+(r-12288-7868))}else throw Error(`Character U+${r.toString(16)} cannot be encoded as Kanji`)}return t}function EX(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function DX(e,t){return mX(e,t).totalDataCodewords*8}function OX(e,t,n,r){let i=n===`auto`||!n?yX(e):n,a=new TextEncoder().encode(e);if(r){let n=DX(r,t);if(kX(e,a,i,r)>n)throw Error(`Data too long for QR version ${r} with EC level ${t}`);return r}for(let n=1;n<=40;n++){let r=DX(n,t);if(kX(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function kX(e,t,n,r){let i=fX(r,n),a;switch(n){case`numeric`:return a=Math.floor(e.length/3)*10+(e.length%3==2?7:e.length%3==1?4:0),4+i+a;case`alphanumeric`:return a=Math.floor(e.length/2)*11+(e.length%2==1?6:0),4+i+a;case`byte`:return 4+i+t.length*8;case`kanji`:return 4+i+e.length*13;default:return 4+i+t.length*8}}function AX(e,t){return t&&t!==`auto`?t:_X(e)?`numeric`:vX(e)?`alphanumeric`:`byte`}const jX=new Uint8Array(512),MX=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)jX[t]=e,MX[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)jX[e]=jX[e-255]})();function NX(e,t){return e===0||t===0?0:jX[(MX[e]+MX[t])%255]}function PX(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,jX[e]]),r=new Uint8Array(n.length+1);for(let e=0;e<n.length;e++)for(let i=0;i<t.length;i++)r[e+i]^=NX(n[e],t[i]);n=r}let r=Array.from({length:t},()=>0);for(let i of e){let e=i^r[0];for(let i=0;i<t-1;i++)r[i]=r[i+1]^NX(e,n[i+1]);r[t-1]=NX(e,n[t])}return r}function FX(e,t,n,r,i,a){let o=[],s=[],c=0;for(let i=0;i<n;i++){let n=e.slice(c,c+r);o.push(n),s.push(PX(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(PX(n,t)),c+=a}let l=[],u=Math.max(r,a);for(let e=0;e<u;e++)for(let t of o)e<t.length&&l.push(t[e]);for(let e=0;e<t;e++)for(let t of s)e<t.length&&l.push(t[e]);return l}function IX(e,t={}){let n=t.ecLevel??`M`,r=AX(e,t.mode),i=OX(e,n,r,t.version),a=mX(i,n),o=FX(RX(LX(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)EX(s,e,8);return{version:i,ecLevel:n,bits:s}}function LX(e,t,n,r){let i=[],a=fX(n,t),o=new TextEncoder().encode(e);switch(EX(i,uX[t],4),EX(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...xX(e));break;case`alphanumeric`:i.push(...SX(e));break;case`byte`:i.push(...CX(o));break;case`kanji`:{let t=TX(e);i.push(...wX(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&EX(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)EX(i,l?236:17,8),l=!l;return i}function RX(e){let t=[];for(let n=0;n<e.length;n+=8){let r=0;for(let t=0;t<8&&n+t<e.length;t++)r=r<<1|e[n+t];t.push(r)}return t}function zX(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function BX(e,t){let n=e.length;VX(e,0,0),VX(e,n-7,0),VX(e,0,n-7),UX(e,n),WX(e,t),e[4*t+9][8]=!0,KX(e,n),t>=7&&qX(e,n)}function VX(e,t,n){let r=e.length;for(let r=0;r<7;r++)for(let i=0;i<7;i++){let a=r===0||r===6||i===0||i===6,o=r>=2&&r<=4&&i>=2&&i<=4;e[t+r][n+i]=a||o}for(let i=-1;i<=7;i++)HX(e,t-1,n+i,!1,r),HX(e,t+7,n+i,!1,r),HX(e,t+i,n-1,!1,r),HX(e,t+i,n+7,!1,r)}function HX(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function UX(e,t){for(let n=8;n<t-8;n++)e[6][n]===null&&(e[6][n]=n%2==0),e[n][6]===null&&(e[n][6]=n%2==0)}function WX(e,t){if(t<2)return;let n=hX[t-1],r=n.length-1;for(let t=0;t<n.length;t++)for(let i=0;i<n.length;i++)(t!==0||i!==0)&&(t!==0||i!==r)&&(t!==r||i!==0)&&GX(e,n[t],n[i])}function GX(e,t,n){for(let r=-2;r<=2;r++)for(let i=-2;i<=2;i++){let a=Math.abs(r)===2||Math.abs(i)===2,o=r===0&&i===0;e[t+r][n+i]=a||o}}function KX(e,t){for(let n=0;n<=8;n++)n<t&&e[8][n]===null&&(e[8][n]=!1),n<t&&e[n][8]===null&&(e[n][8]=!1);for(let n=0;n<7;n++)e[t-1-n][8]===null&&(e[t-1-n][8]=!1);for(let n=0;n<8;n++)e[8][t-1-n]===null&&(e[8][t-1-n]=!1)}function qX(e,t){for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[t-11+r][n]===null&&(e[t-11+r][n]=!1);for(let n=0;n<6;n++)for(let r=0;r<3;r++)e[n][t-11+r]===null&&(e[n][t-11+r]=!1)}function JX(e,t,n){let r=e.length,i=0,a=!0;for(let n=r-1;n>=1;n-=2){n===6&&(n=5);let o=a?Array.from({length:r},(e,t)=>r-1-t):Array.from({length:r},(e,t)=>t);for(let r of o)for(let a of[n,n-1])e[r][a]===null&&(e[r][a]=i<t.length&&t[i]===1,i++);a=!a}}function YX(e,t,n,r){if(e<9&&t<9||e<9&&t>=n-8||e>=n-8&&t<9||e===6||t===6)return!1;if(r>=2){let i=hX[r-1];for(let r of i)for(let a of i)if(!(r<9&&a<9)&&!(r<9&&a>=n-8)&&!(r>=n-8&&a<9)&&e>=r-2&&e<=r+2&&t>=a-2&&t<=a+2)return!1}return!(r>=7&&(e<6&&t>=n-11&&t<=n-9||t<6&&e>=n-11&&e<=n-9)||e===8||t===8||e>=n-8&&t===8||e===8&&t>=n-8)}function XX(e){switch(e){case 0:return(e,t)=>(e+t)%2==0;case 1:return e=>e%2==0;case 2:return(e,t)=>t%3==0;case 3:return(e,t)=>(e+t)%3==0;case 4:return(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0;case 5:return(e,t)=>e*t%2+e*t%3==0;case 6:return(e,t)=>(e*t%2+e*t%3)%2==0;case 7:return(e,t)=>((e+t)%2+e*t%3)%2==0;default:return()=>!1}}function ZX(e,t,n,r){let i=XX(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)YX(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function QX(e,t,n,r){if(r!==void 0&&r>=0&&r<=7)return r;let i=0,a=1/0;for(let r=0;r<8;r++){let o=e.map(e=>[...e]);ZX(o,r,t,n);let s=$X(o,t);s<a&&(a=s,i=r)}return i}function $X(e,t){return eZ(e,t)+tZ(e,t)+nZ(e,t)+rZ(e,t)}function eZ(e,t){let n=0;for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[r][a]==!!e[r][a-1]?(i++,i===5?n+=3:i>5&&n++):i=1}for(let r=0;r<t;r++){let i=1;for(let a=1;a<t;a++)!!e[a][r]==!!e[a-1][r]?(i++,i===5?n+=3:i>5&&n++):i=1}return n}function tZ(e,t){let n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=!!e[r][i];t===!!e[r][i+1]&&t===!!e[r+1][i]&&t===!!e[r+1][i+1]&&(n+=3)}return n}function nZ(e,t){let n=0,r=[!0,!1,!0,!0,!0,!1,!0,!1,!1,!1,!1],i=[!1,!1,!1,!1,!0,!1,!0,!0,!0,!1,!0];for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[a][o+n]!==r[n]&&(t=!1),!!e[a][o+n]!==i[n]&&(s=!1);(t||s)&&(n+=40)}for(let a=0;a<t;a++)for(let o=0;o<=t-11;o++){let t=!0,s=!0;for(let n=0;n<11;n++)!!e[o+n][a]!==r[n]&&(t=!1),!!e[o+n][a]!==i[n]&&(s=!1);(t||s)&&(n+=40)}return n}function rZ(e,t){let n=0,r=t*t;for(let r=0;r<t;r++)for(let i=0;i<t;i++)e[r][i]&&n++;let i=n/r,a=Math.floor(i*20)*5,o=Math.ceil(i*20)*5;return Math.min(Math.abs(a-50),Math.abs(o-50))*2}function iZ(e,t){let n=lX[e]<<3|t,r=n<<10;for(let e=4;e>=0;e--)r&1<<e+10&&(r^=1335<<e);return(n<<10|r)^21522}function aZ(e,t,n){let r=e.length,i=iZ(t,n),a=[[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,7],[8,8],[7,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8]];for(let t=0;t<15;t++){let n=(i>>14-t&1)==1,[r,o]=a[t];e[r][o]=n}for(let t=0;t<7;t++){let n=(i>>14-t&1)==1;e[r-1-t][8]=n}for(let t=0;t<8;t++){let n=(i>>7-t&1)==1;e[8][r-8+t]=n}}function oZ(e,t){if(t<7)return;let n=e.length,r=gX[t];for(let t=0;t<18;t++){let i=(r>>t&1)==1,a=Math.floor(t/3),o=t%3;e[n-11+o][a]=i,e[a][n-11+o]=i}}var sZ=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},cZ=class extends sZ{constructor(...e){super(...e),this.name=`InvalidInputError`}};function lZ(e,t={}){let{version:n,ecLevel:r,bits:i}=IX(e,t),a=n*4+17,o=zX(a);BX(o,n),JX(o,i,n);let s=QX(o,a,n,t.mask);return ZX(o,s,a,n),aZ(o,r,s),n>=7&&oZ(o,n),o.map(e=>e.map(e=>e===!0))}function uZ(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}const dZ=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function fZ(e){let t=4294967295;for(let n=0;n<e.length;n++)t=dZ[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function pZ(e){let t=1,n=0;for(let r=0;r<e.length;r++)t=(t+e[r])%65521,n=(n+t)%65521;return(n<<16|t)>>>0}function mZ(e){let t=65535,n=Math.ceil(e.length/t)||1,r=new Uint8Array(n*5+e.length),i=0,a=0;for(;a<e.length||i===0;){let n=e.length-a,o=Math.min(n,t),s=a+o>=e.length;r[i++]=+!!s,r[i++]=o&255,r[i++]=o>>8&255,r[i++]=~o&255,r[i++]=~o>>8&255,r.set(e.subarray(a,a+o),i),i+=o,a+=o}return r.subarray(0,i)}function hZ(e){let t=mZ(e),n=pZ(e),r=new Uint8Array(2+t.length+4);r[0]=120,r[1]=1,r.set(t,2);let i=2+t.length;return r[i]=n>>24&255,r[i+1]=n>>16&255,r[i+2]=n>>8&255,r[i+3]=n&255,r}const gZ=new Uint8Array([137,80,78,71,13,10,26,10]);function _Z(e,t){let n=new Uint8Array([e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]),r=new Uint8Array(8+t.length+4),i=new DataView(r.buffer);i.setUint32(0,t.length),r.set(n,4),r.set(t,8);let a=new Uint8Array(4+t.length);return a.set(n,0),a.set(t,4),i.setUint32(8+t.length,fZ(a)),r}function vZ(e,t,n){let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,e),i.setUint32(4,t),r[8]=8,r[9]=6,r[10]=0,r[11]=0,r[12]=0;let a=e*4,o=t*(1+a),s=new Uint8Array(o),c=0;for(let e=0;e<t;e++)s[c++]=0,s.set(n.subarray(e*a,e*a+a),c),c+=a;let l=hZ(s),u=_Z(`IHDR`,r),d=_Z(`IDAT`,l),f=_Z(`IEND`,new Uint8Array),p=gZ.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(gZ,h),h+=gZ.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function yZ(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.getUint16(0,!0),r=t.getUint16(2,!0),i=t.getUint16(4,!0);if(n!==0||r!==1&&r!==2||i===0)throw Error(`Invalid ICO file`);let a;for(let e=0;e<i;e++){let n=6+e*16,r=t.getUint8(n)||256,i=t.getUint8(n+1)||256,o=t.getUint32(n+8,!0),s=t.getUint32(n+12,!0);(!a||r*i>a.width*a.height)&&(a={width:r,height:i,size:o,offset:s})}let o=a,s=e.subarray(o.offset,o.offset+o.size);return s.length>=4&&t.getUint32(o.offset)===2303741511?`data:image/png;base64,${DZ(s)}`:bZ(s,o.width,o.height)}function bZ(e,t,n){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=r.getUint32(0,!0),a=r.getInt32(4,!0)||t,o=n,s=r.getUint16(14,!0),c=r.getUint32(16,!0);if(c!==0&&c!==3)throw Error(`Unsupported BMP compression: ${c}`);let l=new Uint8Array(a*o*4);if(s===32)xZ(e,i,a,o,l);else if(s===24)SZ(e,i,a,o,l);else if(s<=8)CZ(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=TZ(a,o,s),n=i+wZ(e,i,s)+t;n<e.length&&EZ(e,n,a,o,l)}return`data:image/png;base64,${DZ(vZ(a,o,l))}`}function xZ(e,t,n,r,i){let a=t,o=n*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*4,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=e[n+3]}}}function SZ(e,t,n,r,i){let a=t+wZ(e,t,24),o=Math.ceil(n*3/4)*4;for(let t=0;t<r;t++){let s=a+(r-1-t)*o,c=t*n*4;for(let t=0;t<n;t++){let n=s+t*3,r=c+t*4;i[r]=e[n+2],i[r+1]=e[n+1],i[r+2]=e[n],i[r+3]=255}}}function CZ(e,t,n,r,i,a){let o=wZ(e,t,i),s=e.subarray(t,t+o),c=t+o,l=Math.ceil(n*i/32)*4;for(let t=0;t<r;t++){let o=c+(r-1-t)*l,u=t*n*4;for(let t=0;t<n;t++){let n;if(i===8)n=e[o+t];else if(i===4){let r=e[o+(t>>1)];n=t&1?r&15:r>>4&15}else n=e[o+(t>>3)]>>7-(t&7)&1;let r=n*4,c=u+t*4;a[c]=s[r+2],a[c+1]=s[r+1],a[c+2]=s[r],a[c+3]=255}}}function wZ(e,t,n){if(n>=16)return 0;let r=new DataView(e.buffer,e.byteOffset,e.byteLength);return((t>=36?r.getUint32(32,!0):0)||1<<n)*4}function TZ(e,t,n){return Math.ceil(e*n/32)*4*t}function EZ(e,t,n,r,i){let a=Math.ceil(n/32)*4;for(let o=0;o<r;o++){let s=t+(r-1-o)*a,c=o*n*4;for(let t=0;t<n;t++){let n=s+(t>>3);if(n>=e.length)return;(e[n]>>7-(t&7)&1)==1&&(i[c+t*4+3]=0)}}}function DZ(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const OZ=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function kZ(e,t,n,r){let i=e.size??.3,a=e.margin??0,o=e.hideBackgroundDots??!0,s=t*n,c=s*i,l=r*n+(s-c)/2,u=r*n+(s-c)/2,d=new Set;if(o){let e=Math.floor((t-t*i)/2-a/n),r=Math.ceil((t+t*i)/2+a/n);for(let n=Math.max(0,e);n<Math.min(t,r);n++)for(let i=Math.max(0,e);i<Math.min(t,r);i++)d.add(`${n},${i}`)}let f=``;if(e.backgroundColor){let t=a,n=c+2*t,r=`x="${l-t}" y="${u-t}"`,i=`fill="${uZ(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(OZ.test(e.svg))throw new cZ(`logo.svg contains potentially dangerous content (script, event handlers, or foreignObject)`);let t=`x="${l}" y="${u}"`,n=`width="${c}" height="${c}"`;f+=`<svg ${t} ${n} viewBox="0 0 1 1">`,f+=`<g transform="scale(1)">${e.svg}</g></svg>`}else if(e.path){let t=uZ(e.path),n=`translate(${l},${u}) scale(${c/100})`;f+=`<path d="${t}" transform="${n}" fill="currentColor"/>`}else if(e.imageUrl){if(!/^(https?:|data:image\/)/i.test(e.imageUrl))throw new cZ(`imageUrl must use https:, http:, or data:image/ scheme`);let t=e.imageUrl.match(/^data:image\/(x-icon|vnd\.microsoft\.icon);base64,(.+)$/i),n=e.imageUrl;if(t){let e=atob(t[2]),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);n=yZ(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${uZ(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function AZ(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return jZ(e+o,t+o,a);case`rounded`:return MZ(e+o,t+o,a,a*.25);case`dots`:return NZ(e+n/2,t+n/2,a/2);case`diamond`:return PZ(e+n/2,t+n/2,a);case`classy`:return FZ(e+o,t+o,a);case`classy-rounded`:return IZ(e+o,t+o,a);case`extra-rounded`:return MZ(e+o,t+o,a,a*.5);case`vertical-line`:return LZ(e+o,t,n,a);case`horizontal-line`:return RZ(e,t+o,n,a);case`small-square`:return jZ(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return jZ(e+n*.25,t+n*.25,n*.5);default:return jZ(e+o,t+o,a)}}function jZ(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function MZ(e,t,n,r){return r=Math.min(r,n/2),`M${e+r},${t}h${n-2*r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-2*r}a${r},${r},0,0,1,-${r},-${r}v-${n-2*r}a${r},${r},0,0,1,${r},-${r}z`}function NZ(e,t,n){return`M${e-n},${t}a${n},${n},0,1,0,${2*n},0a${n},${n},0,1,0,-${2*n},0z`}function PZ(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function FZ(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-r}h-${n}v-${n}z`}function IZ(e,t,n){let r=n*.35;return`M${e},${t}h${n-r}a${r},${r},0,0,1,${r},${r}v${n-2*r}a${r},${r},0,0,1,-${r},${r}h-${n-r}v-${n}z`}function LZ(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function RZ(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function zZ(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return VZ(e,t,i,i,r)+HZ(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return NZ(e+r,t+r,r)+NZ(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return VZ(e,t,i,i,r)+HZ(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return VZ(e,t,i,i,r)+HZ(e+n,t+n,i-2*n,i-2*n,r*.5)}default:{let r=i-2*n;return`M${e},${t}h${i}v${i}h-${i}zM${e+n},${t+n}v${r}h${r}v-${r}z`}}}function BZ(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return NZ(a,o,i/2);case`rounded`:return MZ(e+n*2,t+n*2,i,n*.75);default:return jZ(e+n*2,t+n*2,i)}}function VZ(e,t,n,r,i){return`M${e+i},${t}h${n-2*i}a${i},${i},0,0,1,${i},${i}v${r-2*i}a${i},${i},0,0,1,-${i},${i}h-${n-2*i}a${i},${i},0,0,1,-${i},-${i}v-${r-2*i}a${i},${i},0,0,1,${i},-${i}z`}function HZ(e,t,n,r,i){return VZ(e,t,n,r,i)}const UZ={root:`qr-code`,canvas:`qr-code-canvas`,background:`qr-code-background`,modules:`qr-code-modules`,corner:`qr-code-corner`,logo:`qr-code-logo`,fallback:`qr-code-fallback`},WZ=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function GZ(e,t){let{value:n,size:r=200,margin:i=4,ecLevel:a,version:o,mode:s,mask:c,dotType:u=`square`,dotSize:d=1,corners:f,color:p,background:m,logo:h,logoSize:g=.3,label:_,fallback:v=null,className:y,style:b,...x}=e,S=a??(h?`H`:void 0),C=l.useMemo(()=>{if(!n)return null;try{return lZ(n,{ecLevel:S,version:o,mode:s,mask:c})}catch{return null}},[n,S,o,s,c]);if(!C)return(0,q.jsx)(`div`,{ref:t,className:G(UZ.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,q.jsx)(`span`,{className:UZ.fallback,children:v}):null});let w=C.length,T=w+i*2,E=r/T,D=h?kZ({size:g},w,E,i).hiddenModules:void 0,O=WZ(w),k=new Set;if(f)for(let e of O)for(let t=0;t<7;t++)for(let n=0;n<7;n++)k.add(`${e.row+t},${e.col+n}`);let A=[];for(let e=0;e<w;e++)for(let t=0;t<w;t++){if(!C[e][t])continue;let n=`${e},${t}`;D?.has(n)||k.has(n)||A.push(AZ((t+i)*E,(e+i)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+i)*E,a=(t+i)*E;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{className:UZ.corner,d:zZ(r,a,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,q.jsx)(`path`,{className:UZ.corner,d:BZ(r,a,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,q.jsxs)(`div`,{ref:t,role:`img`,"aria-label":_??n,className:G(UZ.root,y),style:{...b,"--qr-code-color":p,"--qr-code-background":m,"--qr-code-logo-size":h?`${M*100}%`:void 0},"data-component":`QRCode`,"data-dot-type":u,...x,children:[(0,q.jsxs)(`svg`,{className:UZ.canvas,width:r,height:r,viewBox:`0 0 ${r} ${r}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,q.jsx)(`rect`,{className:UZ.background,width:`100%`,height:`100%`}),f?O.map(e=>(0,q.jsx)(l.Fragment,{children:j(f[e.key],e.row,e.col)},e.key)):null,A.length>0?(0,q.jsx)(`path`,{className:UZ.modules,d:A.join(``)}):null]}),h?(0,q.jsx)(`span`,{className:UZ.logo,"aria-hidden":`true`,children:h}):null]})}GZ.displayName=`QRCode`;var KZ=K(GZ);const qZ=(0,l.createContext)({}),JZ={root:`radio-card-description`};function YZ(e,t){let{className:n,id:r,...i}=e,{descriptionId:a}=l.useContext(qZ);return(0,q.jsx)(`span`,{ref:t,id:r??a,className:G(JZ.root,n),"data-component":`RadioCard.Description`,...i})}YZ.displayName=`RadioCard.Description`;var XZ=K(YZ);const ZZ={root:`radio-card-label`};function QZ(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(qZ);return(0,q.jsx)(`span`,{ref:t,id:r??a,className:G(ZZ.root,n),"data-component":`RadioCard.Label`,...i})}QZ.displayName=`RadioCard.Label`;var $Z=K(QZ);const eQ={root:`radio-card-leading-visual`};function tQ(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(eQ.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}tQ.displayName=`RadioCard.LeadingVisual`;var nQ=K(tQ);const rQ={body:`radio-card-body`,control:`radio-card-control`},iQ=W(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function aQ(e,t){let{className:n,children:r,value:i,name:a,checked:o,defaultChecked:s,disabled:c,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=e,v=l.useContext(zx).disabled||c,y=Y(p),b=`${y}-label`,x=`${y}-description`,[S,C]=xr(r,{leadingVisual:nQ,label:$Z,description:XZ}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,q.jsx)(qZ.Provider,{value:{labelId:b,descriptionId:x},children:(0,q.jsxs)(`label`,{ref:t,className:G(iQ({disabled:!!v,validation:d}),n),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,q.jsxs)(`div`,{className:rQ.body,children:[S.label,S.description,C]}),(0,q.jsx)(Hx,{id:y,value:i,name:a,checked:o,defaultChecked:s,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:rQ.control})]})})}aQ.displayName=`RadioCard`;var oQ=K(aQ);const sQ=Object.assign(oQ,{LeadingVisual:nQ,Label:$Z,Description:XZ}),cQ={root:`radio-group-caption`};function lQ(e,t){let{className:n,...r}=e,{captionId:i}=l.useContext(zx);return(0,q.jsx)(`span`,{ref:t,id:i,className:G(cQ.root,n),"data-component":`RadioGroup.Caption`,...r})}lQ.displayName=`RadioGroup.Caption`;var uQ=K(lQ);const dQ={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function fQ(e,t){let{className:n,children:r,visuallyHidden:i,...a}=e,{disabled:o,required:s}=l.useContext(zx);return(0,q.jsxs)(`span`,{ref:t,title:s?`required field`:void 0,className:G(dQ.root,o&&dQ.disabled,i&&dQ.hidden,n),"data-component":`RadioGroup.Label`,"data-label-disabled":o,...a,children:[r,s?(0,q.jsx)(`span`,{className:dQ.required,children:`*`}):null]})}fQ.displayName=`RadioGroup.Label`;var pQ=K(fQ);const mQ={success:Xt,error:fn},hQ={icon:`radio-group-validation-icon`},gQ=W(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function _Q(e,t){let{className:n,children:r,variant:i,...a}=e,{validationMessageId:o}=l.useContext(zx),s=mQ[i];return(0,q.jsxs)(`span`,{ref:t,className:G(gQ({variant:i}),n),"data-component":`RadioGroup.Validation`,"data-validation-status":i,...a,children:[(0,q.jsx)(s,{className:hQ.icon,"aria-hidden":`true`}),(0,q.jsx)(`span`,{id:o,children:r})]})}_Q.displayName=`RadioGroup.Validation`;var vQ=K(_Q);const yQ={root:`radio-group`,legend:`radio-group-legend`,legendVisible:`radio-group-legend-visible`,body:`radio-group-body`,validation:`radio-group-validation-slot`,hidden:`sr-only`};function bQ(e,t){let{as:n=`fieldset`,className:r,children:i,name:a,disabled:o,required:s,onChange:c,id:u,"aria-labelledby":d,...f}=e,[p,m]=xr(i,{label:pQ,caption:uQ,validation:vQ}),h=Y(u),g=p.caption?`${h}-caption`:void 0,_=p.validation?`${h}-validation`:void 0,v=e=>{let{value:t,checked:n}=e.currentTarget;n&&c?.(t,e)},y=l.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:a,disabled:o,required:s,captionId:g,validationMessageId:_,onChange:v};return(0,q.jsx)(zx.Provider,{value:b,children:(0,q.jsxs)(n,{ref:t,id:h,disabled:o,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:G(yQ.root,r),"data-component":`RadioGroup`,"data-disabled":o,"data-required":s,...f,children:[p.label?(0,q.jsxs)(`legend`,{className:G(yQ.legend,y&&yQ.legendVisible),children:[p.label,s?(0,q.jsx)(`span`,{className:yQ.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,q.jsx)(`div`,{className:yQ.body,children:m}),p.validation?(0,q.jsx)(`div`,{className:yQ.validation,children:p.validation}):null]})})}bQ.displayName=`RadioGroup`;var xQ=K(bQ);const SQ=Object.assign(xQ,{Label:pQ,Caption:uQ,Validation:vQ}),CQ={item:`rating-item`,input:`rating-input`,srOnly:`sr-only`,star:`rating-star`,starTrack:`rating-star-track`,starFill:`rating-star-fill`,starFillIcon:`rating-star-fill-icon`},wQ=W(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),TQ=e=>e===1?`1 star`:`${e} stars`,EQ=(e,t)=>`${e} out of ${t} stars`,DQ=({className:e})=>(0,q.jsx)(`svg`,{className:e,"aria-hidden":`true`,viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.jsx)(`path`,{d:`M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z`})});function OQ(e,t){let{className:n,style:r,count:i=5,value:a,defaultValue:o,size:s=`medium`,readOnly:c,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=TQ,valueLabel:h=EQ,"aria-label":g,..._}=e,v=a!==void 0,[y,b]=l.useState(()=>o??0),x=v?a:y,S=Math.max(Math.trunc(i),0),C=Math.min(Math.max(x,0),S),w=Y(f),T=!c&&!u,E=e=>{T&&(v||b(e),p?.(e))},D=e=>{E(Number(e.currentTarget.value))},O=e=>{d&&Number(e.currentTarget.value)===C&&E(0)},k=c?`span`:`label`;return(0,q.jsx)(`span`,{ref:t,role:c?`img`:`radiogroup`,"aria-label":c?g??h(C,S):g,className:G(wQ({size:s,interactive:T,disabled:!!u}),n),style:{...r,"--rating-value":C},"data-component":`Rating`,"data-size":s,"data-value":C,"data-count":S,"data-readonly":c,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,q.jsxs)(k,{className:CQ.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[c?null:(0,q.jsx)(`input`,{type:`radio`,className:G(CQ.input,CQ.srOnly),name:w,value:n,checked:n===C,disabled:u,"aria-label":m(n,S),onChange:D,onClick:O,"data-component":`Rating.Input`}),(0,q.jsxs)(`span`,{className:CQ.star,"aria-hidden":`true`,children:[(0,q.jsx)(DQ,{className:CQ.starTrack}),(0,q.jsx)(`span`,{className:CQ.starFill,children:(0,q.jsx)(DQ,{className:CQ.starFillIcon})})]})]},n)})})}OQ.displayName=`Rating`;var kQ=K(OQ);const AQ=1e3,jQ=60*AQ,MQ=60*jQ,NQ=24*MQ,PQ=7*NQ,FQ=30*NQ,IQ=12*FQ,LQ=`P30D`,RQ=[{unit:`year`,length:IQ},{unit:`month`,length:FQ},{unit:`week`,length:PQ},{unit:`day`,length:NQ},{unit:`hour`,length:MQ},{unit:`minute`,length:jQ},{unit:`second`,length:AQ}],zQ=[`year`,`month`,`day`,`hour`,`minute`,`second`],BQ={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},VQ=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),HQ=e=>{let t=VQ.exec(e);if(!t||t.slice(1).every(e=>e===void 0))return null;let[,n,r,i,a,o,s,c]=t;return Number(n??0)*IQ+Number(r??0)*FQ+Number(i??0)*PQ+Number(a??0)*NQ+Number(o??0)*MQ+Number(s??0)*jQ+Number(c??0)*AQ},UQ=e=>{let t=Math.abs(e),{unit:n,length:r}=RQ.find(({length:e})=>t>=e)??RQ[RQ.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},WQ=(e,t)=>{let n=Math.floor(Math.abs(e)/AQ),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24),o=Math.floor(a/30),s=Math.floor(o/12),c={year:s,month:o-s*12,day:a-o*30,hour:i-a*24,minute:r-i*60,second:n-r*60};return zQ.slice(0,zQ.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},GQ=e=>{let{value:t,unit:n}=UQ(e);return n===`second`?`1m`:`${Math.abs(t)}${BQ[n]}`},KQ=(e,t)=>{let n=WQ(e,t).filter(({count:e})=>e>0);return n.length===0?`0${BQ[t]}`:n.map(({unit:e,count:t})=>`${t}${BQ[e]}`).join(` `)},qQ=(e,t)=>{let{value:n,unit:r}=UQ(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},JQ=(e,t,n)=>{let r=e.getFullYear()===new Date(t).getFullYear();return{weekday:n.weekday,year:n.year??(r?void 0:`numeric`),month:n.month??`short`,day:n.day??`numeric`,hour:n.hour,minute:n.minute,second:n.second,timeZoneName:n.timeZoneName}},YQ=(e,t,n,r)=>new Intl.DateTimeFormat(r,JQ(e,t,n)).format(e),XQ=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),ZQ=(e,t,n)=>{let{format:r,tense:i,precision:a,threshold:o,prefix:s,dateOptions:c,locale:l}=n,u=e.getTime()-t;if(r===`elapsed`)return{text:KQ(u,a),updateDelay:RQ.find(({unit:e})=>e===a)?.length??AQ};let d=HQ(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=UQ(u);return{text:r===`micro`?GQ(u):qQ(u,l),updateDelay:e}}let f=YQ(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},QQ=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function $Q(e,t){let{as:n=`time`,children:r,date:i,datetime:a,format:o=`auto`,tense:s=`auto`,precision:c=`second`,threshold:u=LQ,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=e,S=QQ(i,a),[C,w]=l.useState(()=>Date.now()),{text:T,updateDelay:E}=S?ZQ(S,C,{format:o,tense:s,precision:c,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return l.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,q.jsx)(n,{ref:t,dateTime:S?.toISOString(),title:f||!S?void 0:XQ(S),"data-component":`RelativeTime`,"data-format":o,"data-tense":s,...x,children:r??T})}$Q.displayName=`RelativeTime`;var e$=K($Q);const t$={root:`resizable`};function n$(e,t){let{className:n,orientation:r=`horizontal`,resizableRef:i,...a}=e;return(0,q.jsx)(w.Group,{elementRef:t,groupRef:i,orientation:r,className:G(t$.root,n),"data-component":`Resizable`,"data-orientation":r,...a})}n$.displayName=`Resizable`;var r$=K(n$);const i$={root:`resizable-panel`};function a$(e,t){let{className:n,...r}=e;return(0,q.jsx)(w.Panel,{elementRef:t,className:G(i$.root,n),"data-component":`Resizable.Panel`,...r})}a$.displayName=`Resizable.Panel`;var o$=K(a$);const s$={root:`resizable-resize-trigger`};function c$(e,t){let{className:n,...r}=e;return(0,q.jsx)(w.Separator,{elementRef:t,className:G(s$.root,n),"data-component":`Resizable.ResizeTrigger`,...r})}c$.displayName=`Resizable.ResizeTrigger`;var l$=K(c$);const u$={root:`resizable-resize-trigger-indicator`};function d$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(u$.root,n),"data-component":`Resizable.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}d$.displayName=`Resizable.ResizeTriggerIndicator`;var f$=K(d$);const p$={root:`resizable-resize-trigger-separator`};function m$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(p$.root,n),"data-component":`Resizable.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}m$.displayName=`Resizable.ResizeTriggerSeparator`;var h$=K(m$);const g$=Object.assign(r$,{Panel:o$,ResizeTrigger:l$,ResizeTriggerSeparator:h$,ResizeTriggerIndicator:f$}),_$=(0,l.createContext)({}),v$=`RichTextEditor`,y$=[C.HeadingNode,C.QuoteNode,S.ListNode,S.ListItemNode,x.LinkNode,x.AutoLinkNode],b$={paragraph:`rich-text-editor-paragraph`,heading:{h1:`rich-text-editor-heading-1`,h2:`rich-text-editor-heading-2`,h3:`rich-text-editor-heading-3`},quote:`rich-text-editor-quote`,link:`rich-text-editor-link`,list:{ul:`rich-text-editor-list-bullet`,ol:`rich-text-editor-list-number`,listitem:`rich-text-editor-list-item`,nested:{listitem:`rich-text-editor-list-item-nested`}},text:{bold:`rich-text-editor-bold`,italic:`rich-text-editor-italic`,underline:`rich-text-editor-underline`,strikethrough:`rich-text-editor-strikethrough`,underlineStrikethrough:`rich-text-editor-underline-strikethrough`,code:`rich-text-editor-inline-code`},ltr:`rich-text-editor-ltr`,rtl:`rich-text-editor-rtl`},x$={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},S$=({readOnly:e})=>{let[t]=(0,y.useLexicalComposerContext)();return l.useEffect(()=>{t.setEditable(!e)},[t,e]),null};function C$(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=v$,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,...g}=e,v={namespace:l,theme:b$,nodes:c?[...y$,...c]:y$,editable:!s,editorState:i,onError:u??(e=>{throw e})},y={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,q.jsx)(`div`,{ref:t,className:G(x$.root,s&&x$.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,...g,children:(0,q.jsx)(_.LexicalComposer,{initialConfig:v,children:(0,q.jsxs)(_$.Provider,{value:y,children:[(0,q.jsx)(T.HistoryPlugin,{}),(0,q.jsx)(D.ListPlugin,{}),(0,q.jsx)(E.LinkPlugin,{}),(0,q.jsx)(k.TabIndentationPlugin,{}),(0,q.jsx)(S$,{readOnly:s}),a?(0,q.jsx)(O.OnChangePlugin,{onChange:(e,t)=>a(e,t)}):null,r]})})})}C$.displayName=`RichTextEditor`;var w$=K(C$);const T$={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function E$(e,t){let{className:n,style:r,...i}=e,{placeholder:a,minHeight:o,maxHeight:s,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d}=l.useContext(_$),f=(0,q.jsx)(`div`,{className:T$.scroll,style:{minHeight:o===void 0?void 0:`${o}px`,maxHeight:s===void 0?void 0:`${s}px`},"data-component":`RichTextEditor.Scroll`,children:a?(0,q.jsx)(A.ContentEditable,{ref:t,className:G(T$.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":a,placeholder:(0,q.jsx)(`div`,{className:T$.placeholder,children:a}),"data-component":`RichTextEditor.Content`,...i}):(0,q.jsx)(A.ContentEditable,{ref:t,className:G(T$.content,n),style:r,ariaLabel:c,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...i})});return(0,q.jsx)(M.RichTextPlugin,{contentEditable:f,ErrorBoundary:j.LexicalErrorBoundary})}E$.displayName=`RichTextEditor.Content`;var D$=K(E$);const O$=[`history`,`inline`,`block`,`list`,`link`],k$={root:`rich-text-editor-toolbar`,controls:`rich-text-editor-toolbar-controls`,group:`rich-text-editor-toolbar-group`,divider:`rich-text-editor-toolbar-divider`,linkField:`rich-text-editor-link-field`,linkInput:`rich-text-editor-link-input`},A$=[{format:`bold`,icon:Fn,label:`Bold`},{format:`italic`,icon:Bn,label:`Italic`},{format:`underline`,icon:Wn,label:`Underline`},{format:`strikethrough`,icon:Un,label:`Strikethrough`},{format:`code`,icon:sn,label:`Code`}],j$=[{tag:`h1`,icon:Ln,label:`Heading 1`},{tag:`h2`,icon:Rn,label:`Heading 2`},{tag:`h3`,icon:zn,label:`Heading 3`}],M$={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function N$(e){let{className:t,children:n,controls:r=O$,"aria-label":i=`Formatting`,...a}=e,[o]=(0,y.useLexicalComposerContext)(),{readOnly:s}=l.useContext(_$),c=l.useRef(null);_r({containerRef:c,direction:`horizontal`,wrap:!0});let[u,d]=l.useState(M$),[f,p]=l.useState(`paragraph`),[m,h]=l.useState(!1),[g,_]=l.useState(!1),[v,b]=l.useState(!1),[w,T]=l.useState(null),E=l.useCallback(()=>{let e=(0,F.$getSelection)();if(!(0,F.$isRangeSelection)(e))return;d({bold:e.hasFormat(`bold`),italic:e.hasFormat(`italic`),underline:e.hasFormat(`underline`),strikethrough:e.hasFormat(`strikethrough`),code:e.hasFormat(`code`)});let t=e.anchor.getNode(),n=t.getKey()===`root`?t:t.getTopLevelElement();if((0,S.$isListNode)(n))p(n.getListType()===`number`?`number`:`bullet`);else if((0,C.$isHeadingNode)(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else(0,C.$isQuoteNode)(n)?p(`quote`):p(`paragraph`);h((0,x.$isLinkNode)(t)||(0,x.$isLinkNode)(t.getParent()))},[]);l.useEffect(()=>(0,P.mergeRegister)(o.registerUpdateListener(({editorState:e})=>{e.read(E)}),o.registerCommand(F.SELECTION_CHANGE_COMMAND,()=>(E(),!1),F.COMMAND_PRIORITY_CRITICAL),o.registerCommand(F.CAN_UNDO_COMMAND,e=>(_(e),!1),F.COMMAND_PRIORITY_CRITICAL),o.registerCommand(F.CAN_REDO_COMMAND,e=>(b(e),!1),F.COMMAND_PRIORITY_CRITICAL)),[o,E]);let D=e=>{o.update(()=>{let t=(0,F.$getSelection)();if((0,F.$isRangeSelection)(t)){if(f===e){(0,N.$setBlocksType)(t,()=>(0,F.$createParagraphNode)());return}(0,N.$setBlocksType)(t,()=>e===`quote`?(0,C.$createQuoteNode)():(0,C.$createHeadingNode)(e))}})},O=e=>{if(f===e){o.dispatchCommand(S.REMOVE_LIST_COMMAND,void 0);return}o.dispatchCommand(e===`bullet`?S.INSERT_UNORDERED_LIST_COMMAND:S.INSERT_ORDERED_LIST_COMMAND,void 0)},k=()=>{if(m){o.dispatchCommand(x.TOGGLE_LINK_COMMAND,null);return}T(e=>e===null?``:null)},A=()=>{w&&o.dispatchCommand(x.TOGGLE_LINK_COMMAND,w),T(null),o.focus()},j=(e,t,n,r,i,a)=>(0,q.jsx)(gi,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:s||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),M={history:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(gi,{icon:Gt,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:s||!g,onClick:()=>o.dispatchCommand(F.UNDO_COMMAND,void 0),"data-component":`RichTextEditor.Undo`}),(0,q.jsx)(gi,{icon:Ht,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:s||!v,onClick:()=>o.dispatchCommand(F.REDO_COMMAND,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,q.jsx)(q.Fragment,{children:A$.map(({format:e,icon:t,label:n})=>j(n,n,t,u[e],()=>o.dispatchCommand(F.FORMAT_TEXT_COMMAND,e)))}),block:(0,q.jsxs)(q.Fragment,{children:[j$.map(({tag:e,icon:t,label:n})=>j(n,n,t,f===e,()=>D(e))),j(`Quote`,`Quote`,Hn,f===`quote`,()=>D(`quote`))]}),list:(0,q.jsxs)(q.Fragment,{children:[j(`Bulleted list`,`Bulleted list`,In,f===`bullet`,()=>O(`bullet`)),j(`Numbered list`,`Numbered list`,Vn,f===`number`,()=>O(`number`))]}),link:j(`Link`,m?`Remove link`:`Link`,xn,m||w!==null,k)};return(0,q.jsxs)(`div`,{className:G(k$.root,t),"data-component":`RichTextEditor.Toolbar`,children:[(0,q.jsxs)(`div`,{ref:c,role:`toolbar`,"aria-label":i,"aria-orientation":`horizontal`,className:k$.controls,...a,children:[r.map((e,t)=>(0,q.jsxs)(l.Fragment,{children:[t>0?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:k$.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,q.jsx)(`div`,{className:k$.group,"data-control":e,children:M[e]})]},e)),n]}),w===null?null:(0,q.jsxs)(`div`,{className:k$.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,q.jsx)(qo,{autoFocus:!0,size:`small`,type:`url`,value:w,placeholder:`https://example.com`,"aria-label":`Link address`,className:k$.linkInput,onChange:e=>T(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),A()),e.key===`Escape`&&(T(null),o.focus())}}),(0,q.jsx)(pi,{size:`small`,onClick:A,children:`Apply`})]})]})}N$.displayName=`RichTextEditor.Toolbar`;const P$=Object.assign(w$,{Toolbar:N$,Content:D$}),F$={item:`segmented-control-segment`,separator:`segmented-control-segment-separator`,separatorHidden:`segmented-control-segment-separator-hidden`,button:`segmented-control-button`,buttonSelected:`segmented-control-button-selected`,buttonDisabled:`segmented-control-button-disabled`,content:`segmented-control-content`,contentSelected:`segmented-control-content-selected`,contentInteractive:`segmented-control-content-interactive`},I$=e=>{let t=e;return l.isValidElement(e)?e:(0,q.jsx)(t,{})};function L$(e){let{component:t,className:n,children:r,selected:i,disabled:a,tooltip:o,tooltipType:s,tooltipDirection:c,"aria-disabled":l,...u}=e,d=!!a||l===!0||l===`true`,f=(0,q.jsx)(`button`,{type:`button`,"aria-pressed":i,"aria-disabled":d||void 0,className:G(F$.button,i&&F$.buttonSelected,d&&!i&&F$.buttonDisabled,n),...u,children:(0,q.jsx)(`span`,{className:G(F$.content,i&&F$.contentSelected,!i&&!d&&F$.contentInteractive),children:r})});return(0,q.jsx)(`li`,{className:G(F$.item,F$.separator,F$.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,q.jsx)(lT,{text:o,type:s,direction:c,children:f}):f})}L$.displayName=`SegmentedControlSegment`;const R$={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function z$(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,q.jsxs)(L$,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,q.jsx)(`span`,{className:G(R$.visual,o&&R$.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:I$(i)}):null,(0,q.jsx)(`span`,{className:G(R$.text,R$.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,q.jsx)(`span`,{className:R$.counter,children:(0,q.jsx)(si,{children:r})})]})}z$.displayName=`SegmentedControl.Button`;const B$={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function V$(e){let{"aria-label":t,className:n,description:r,icon:i,selected:a,disabled:o,tooltipDirection:s,defaultSelected:c,...l}=e;return(0,q.jsx)(L$,{component:`SegmentedControl.IconButton`,className:G(B$.button,n),selected:a,disabled:o,"aria-label":r?t:void 0,tooltip:r??t,tooltipType:r?void 0:`label`,tooltipDirection:s,...l,children:(0,q.jsx)(`span`,{className:G(B$.visual,o&&B$.visualDisabled),"data-component":`SegmentedControl.Icon`,children:I$(i)})})}V$.displayName=`SegmentedControl.IconButton`;const H$={dropdown:`segmented-control-dropdown`},U$=W(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),W$=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),G$=e=>e.type===z$,K$=e=>e.type===V$,q$=e=>{if(e!==void 0)return G$(e)?e.props.children:K$(e)?e.props[`aria-label`]:void 0},J$=e=>e===void 0?null:G$(e)?e.props.leadingVisual??null:K$(e)?e.props.icon:null,Y$=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function X$(e){let{"aria-label":t,"aria-labelledby":n,className:r,children:i,fullWidth:a,onChange:o,size:s=`medium`,variant:c=`default`,...u}=e,d=W$(i),f=o===void 0||d.some(e=>e.props.defaultSelected!==void 0),p=d.findIndex(e=>e.props.defaultSelected||e.props.selected),m=p===-1?0:p,[h,g]=l.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{Y$(t)||(f&&g(e),o?.(e),t.props.onClick?.(n))},b=(0,q.jsx)(`ul`,{"aria-label":t,"aria-labelledby":n,className:G(U$({size:s}),r),"data-component":`SegmentedControl`,"data-size":s,...Ui(`full-width`,a),...Ui(`variant`,c),...u,children:d.map((e,t)=>l.cloneElement(e,{selected:t===_,onClick:n=>y(t,e,n)}))});return ls(c)&&Object.values(c).includes(`dropdown`)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:H$.dropdown,"data-component":`SegmentedControl.Dropdown`,...Ui(`variant`,c),children:(0,q.jsxs)(ma,{children:[(0,q.jsx)(ma.Button,{"aria-label":t&&`${q$(v)}, ${t}`,leadingVisual:J$(v),children:q$(v)}),(0,q.jsx)(ma.Overlay,{"aria-labelledby":n,children:(0,q.jsx)(ji,{selectionVariant:`single`,children:d.map((e,t)=>{let n=J$(e);return(0,q.jsxs)(ji.Item,{selected:t===_,disabled:Y$(e),onSelect:n=>y(t,e,n),children:[n?(0,q.jsx)(ji.LeadingVisual,{children:I$(n)}):null,q$(e)]},t)})})})]})}),b]}):b}X$.displayName=`SegmentedControl`;const Z$=Object.assign(X$,{Button:z$,IconButton:V$}),Q$=Object.assign(lS,{Option:Zx,OptGroup:qx});function $$(e,t){let{className:n,children:r,...i}=e,{required:a,...o}=Xf(i),{labelId:s}=l.useContext(Yf),c=Y();return(0,q.jsx)(pi,{ref:t,type:`button`,"aria-labelledby":s?`${c} ${s}`:void 0,className:G(n),"data-component":`SelectPanel.Button`,...o,children:s?(0,q.jsx)(`span`,{id:c,children:r}):r})}$$.displayName=`SelectPanel.Button`;var e1=K($$);const t1=(0,l.createContext)({}),n1={root:`select-panel-footer`,rootWithoutActions:`select-panel-footer-without-actions`,content:`select-panel-footer-content`,contentWithoutActions:`select-panel-footer-content-without-actions`,actions:`select-panel-footer-actions`};function r1(e,t){let{className:n,children:r,...i}=e,{selectionVariant:a,onCancel:o}=l.useContext(t1),s=a!==`instant`;return!s&&!r?null:(0,q.jsxs)(`div`,{ref:t,className:G(n1.root,!s&&n1.rootWithoutActions,n),"data-component":`SelectPanel.Footer`,"data-has-actions":s?``:void 0,...i,children:[(0,q.jsx)(`div`,{className:G(n1.content,!s&&n1.contentWithoutActions),children:r}),s?(0,q.jsxs)(`div`,{className:n1.actions,children:[(0,q.jsx)(pi,{type:`button`,size:`small`,onClick:o,children:`Cancel`}),(0,q.jsx)(pi,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}r1.displayName=`SelectPanel.Footer`;var i1=K(r1);const a1={root:`select-panel-search-input`};function o1(e,t){let{className:n,value:r,onChange:i,onKeyDown:a,...o}=e,{searchQuery:s,setSearchQuery:c,searchInputRef:u,moveFocusToList:d}=l.useContext(t1),f=l.useRef(null),p=ar(u,f),m=ar(t,p),h=r??s??``;return(0,q.jsx)(qo,{ref:m,block:!0,leadingVisual:On,placeholder:`Search`,value:h,onChange:e=>{c?.(e.currentTarget.value),i?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),a?.(e)},trailingAction:h?(0,q.jsx)(qo.Action,{icon:ln,"aria-label":`Clear`,onClick:()=>{c?.(``),i?.(``,null),f.current?.focus()}}):void 0,className:G(a1.root,n),"data-component":`SelectPanel.SearchInput`,...o})}o1.displayName=`SelectPanel.SearchInput`;var s1=K(o1);const c1={root:`select-panel-header`,content:`select-panel-header-content`,contentWithSearchInput:`select-panel-header-content-with-search`,titleRow:`select-panel-header-title-row`,title:`select-panel-header-title`,heading:`select-panel-header-heading`,description:`select-panel-header-description`,actions:`select-panel-header-actions`},l1={searchInput:s1};function u1(e,t){let{className:n,children:r,onBack:i,...a}=e,[o,s]=xr(r,l1),{panelId:c,title:u,description:d,onCancel:f,onClearSelection:p}=l.useContext(t1);return(0,q.jsxs)(`div`,{ref:t,className:G(c1.root,n),"data-component":`SelectPanel.Header`,...a,children:[(0,q.jsxs)(`div`,{className:G(c1.content,o.searchInput&&c1.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":o.searchInput?``:void 0,children:[(0,q.jsxs)(`div`,{className:c1.titleRow,children:[i?(0,q.jsx)(gi,{type:`button`,variant:`invisible`,icon:Rt,"aria-label":`Back`,onClick:i,"data-component":`SelectPanel.BackButton`}):null,(0,q.jsxs)(`div`,{className:c1.title,"data-has-description":d?``:void 0,"data-has-back":i?``:void 0,children:[(0,q.jsx)(Tr,{as:`h1`,id:c?`${c}-title`:void 0,className:c1.heading,children:u}),d?(0,q.jsx)(`span`,{id:c?`${c}-description`:void 0,className:c1.description,children:d}):null]})]}),(0,q.jsxs)(`div`,{className:c1.actions,children:[p?(0,q.jsx)(gi,{type:`button`,variant:`invisible`,icon:hn,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,q.jsx)(gi,{type:`button`,variant:`invisible`,icon:un,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),o.searchInput,s]})}u1.displayName=`SelectPanel.Header`;var d1=K(u1);const f1={form:`select-panel-form`,container:`select-panel-container`},p1=W(`select-panel-backdrop`,{variants:{variant:{anchored:``,modal:`select-panel-backdrop-modal motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`},narrowVariant:{anchored:``,modal:`select-panel-backdrop-narrow-modal`,"full-screen":``,"bottom-sheet":`select-panel-backdrop-narrow-bottom-sheet`}}}),m1=W(`select-panel motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`,{variants:{width:{small:`select-panel-width-small`,medium:`select-panel-width-medium`,large:`select-panel-width-large`,xlarge:`select-panel-width-xlarge`,auto:`select-panel-width-auto`},maxHeight:{small:`select-panel-max-height-small`,medium:`select-panel-max-height-medium`,large:`select-panel-max-height-large`,xlarge:`select-panel-max-height-xlarge`,"fit-content":`select-panel-max-height-fit-content`},variant:{anchored:`select-panel-anchored`,modal:``},narrowVariant:{anchored:`select-panel-narrow-anchored`,modal:`select-panel-narrow-modal`,"full-screen":`select-panel-narrow-full-screen`,"bottom-sheet":`select-panel-narrow-bottom-sheet`},unplaced:{true:`invisible`,false:``}}}),h1={regular:`anchored`,narrow:`full-screen`},g1=e=>l.isValidElement(e)&&e.type===e1,_1=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function v1(e,t){let{className:n,children:r,title:i,description:a,variant:o=h1,selectionVariant:s=`multiple`,id:c,defaultOpen:u=!1,open:d,anchorRef:f,side:p=`outside-bottom`,align:m=`start`,onCancel:h,onClearSelection:g,onSubmit:_,width:v=`medium`,maxHeight:y=`large`,...b}=e,x=Y(c),S=l.useRef(null),C=f??S,w=l.useRef(null),T=ar(t,w),E=l.useRef(null),D=d!==void 0,[O,k]=l.useState(u),A=D?d:O,j=l.useCallback(()=>{D||k(!1)},[D]),M=l.useCallback(()=>{j(),h?.()},[j,h]),N=l.useCallback(()=>g?.(),[g]),P=l.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=l.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=l.useCallback(()=>{s===`instant`&&P()},[s,P]),[L,ee]=l.useState(``),R=l.Children.toArray(r),z=R.find(g1),[te,ne]=xr(R.filter(e=>e!==z),{header:d1,footer:i1}),B=z?.props.onClick,re=z?l.cloneElement(z,{ref:C,onClick:e=>{B?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,V={...h1,...typeof o==`string`?{regular:o}:o},ie=V.regular??`anchored`,ae=V.narrow,oe=ie===`anchored`||ae===`anchored`,se=l.useRef(null),[ce,le]=l.useState(null),ue=l.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=aa(t,e,{side:p,align:m});se.current&&_1(se.current,n)||(se.current=n,le(n))},[C,p,m]);rr(()=>{if(!A||!oe){se.current=null,le(null);return}ue();let e=new ResizeObserver(ue);return w.current&&e.observe(w.current),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{e.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[A,oe,ue]),zi({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),l.useEffect(()=>{A&&!E.current&&F()},[A,F]),Hi(e=>{A&&(e.preventDefault(),M())});let de=l.useMemo(()=>({panelId:x,title:i,description:a,selectionVariant:s,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,i,a,s,L,M,g,N,F]),fe=l.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:s===`instant`?`single`:s,afterSelect:I,enableFocusZone:!0}),[x,s,I]);return(0,q.jsxs)(q.Fragment,{children:[re,A?(0,q.jsx)(ea,{children:(0,q.jsx)(`div`,{className:G(p1({variant:ie,narrowVariant:ae})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...Ui(`variant`,V),children:(0,q.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":a?`${x}-description`:void 0,className:G(m1({width:v,maxHeight:y,variant:ie,narrowVariant:ae,unplaced:oe&&!ce}),n),style:{"--select-panel-top":`${ce?.top??0}px`,"--select-panel-left":`${ce?.left??0}px`},"data-component":`SelectPanel`,"data-width":v,"data-max-height":y,"data-side":ce?.anchorSide??p,"data-align":ce?.anchorAlign??m,...Ui(`variant`,V),...b,children:(0,q.jsx)(`form`,{className:f1.form,onSubmit:P,children:(0,q.jsxs)(t1.Provider,{value:de,children:[te.header??(0,q.jsx)(d1,{}),(0,q.jsx)(`div`,{className:f1.container,children:(0,q.jsx)(Ar.Provider,{value:fe,children:ne})}),te.footer]})})})})}):null]})}v1.displayName=`SelectPanel`;var y1=K(v1);const b1={root:`select-panel-loading`,text:`select-panel-loading-text`};function x1(e,t){let{className:n,children:r=`Fetching items...`,...i}=e;return(0,q.jsxs)(`div`,{ref:t,role:`status`,"aria-live":`polite`,className:G(b1.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,q.jsx)($r,{size:`medium`,srText:null,role:`presentation`}),(0,q.jsx)(`span`,{className:b1.text,children:r})]})}x1.displayName=`SelectPanel.Loading`;var S1=K(x1);const C1={full:`select-panel-message-full`,fullIcon:`select-panel-message-full-icon`,fullTitle:`select-panel-message-full-title`,fullContent:`select-panel-message-full-content`,inline:`select-panel-message-inline`,inlineIcon:`select-panel-message-inline-icon`,variant:{warning:`select-panel-message-warning`,error:`select-panel-message-error`,empty:``},inlineVariant:{warning:`select-panel-message-inline-warning`,error:`select-panel-message-inline-error`,empty:``}};function w1(e,t){let{className:n,children:r,variant:i,size:a,title:o,...s}=e,c=a??(i===`empty`?`full`:`inline`),l=i===`empty`?void 0:{role:`status`,"aria-live":`polite`};return c===`full`?(0,q.jsxs)(`div`,{ref:t,className:G(C1.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,q.jsx)(Gn,{className:G(C1.fullIcon,C1.variant[i]),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:C1.fullTitle,children:o}),(0,q.jsx)(`span`,{className:C1.fullContent,children:r})]}):(0,q.jsxs)(`div`,{ref:t,className:G(C1.inline,C1.variant[i],C1.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,q.jsx)(Gn,{className:C1.inlineIcon,"aria-hidden":`true`}),(0,q.jsx)(`div`,{children:r})]})}w1.displayName=`SelectPanel.Message`;var T1=K(w1);const E1={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},D1=e=>{let{id:t,children:n,className:r,...i}=e,a=Y(t);return(0,q.jsxs)(`span`,{className:E1.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,q.jsx)($d,{id:a,className:G(E1.box,r),...i}),(0,q.jsx)(`label`,{htmlFor:a,className:E1.small,children:n})]})};function O1(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,q.jsx)(D1,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,q.jsx)($c,{className:G(E1.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,q.jsx)(pi,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}O1.displayName=`SelectPanel.SecondaryAction`;const k1=Object.assign(y1,{Button:e1,Header:d1,SearchInput:s1,Footer:i1,SecondaryAction:O1,Loading:S1,Message:T1}),A1=W(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function j1(e,t){let{as:n=`div`,className:r,orientation:i=`horizontal`,variant:a=`default`,...o}=e;return(0,q.jsx)(n,{ref:t,role:`separator`,"aria-orientation":i,className:G(A1({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}j1.displayName=`Separator`;var M1=K(j1);const N1=W(`slider`,{variants:{size:{small:`slider-small`,medium:`slider-medium`,large:`slider-large`},orientation:{horizontal:`slider-horizontal`,vertical:`slider-vertical`},block:{true:``,false:``}},compoundVariants:[{block:!0,orientation:`horizontal`,class:`slider-block-horizontal`},{block:!0,orientation:`vertical`,class:`slider-block-vertical`}]}),P1=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function F1(e,t){let{className:n,style:r,size:i=`medium`,orientation:a=`horizontal`,block:o,min:s=0,max:c=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=e,g=d!==void 0,[_,v]=l.useState(()=>f??s),y=g?d:_;return(0,q.jsx)(`input`,{ref:t,type:`range`,min:s,max:c,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:G(N1({size:i,orientation:a,block:o}),n),style:{...r,"--slider-fill":`${P1(y,s,c)}%`},"aria-orientation":a===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":i,"data-orientation":a,"data-block":o,"data-disabled":p,...h})}F1.displayName=`Slider`;var I1=K(F1);const L1={open:`open`,issueOpened:`open`,pullOpened:`open`,alertOpened:`open`,closed:`done`,issueClosed:`done`,pullMerged:`done`,alertFixed:`done`,pullClosed:`closed`,alertClosed:`closed`,issueClosedNotPlanned:`neutral`,unavailable:`neutral`,archived:`neutral`,pullQueued:`attention`,draft:`draft`,issueDraft:`draft`,alertDismissed:`draft`},R1={open:null,closed:null,draft:nn,archived:Ft,unavailable:Gn,issueOpened:Dn,issueClosed:Xt,issueClosedNotPlanned:En,issueDraft:nn,pullOpened:Jt,pullClosed:ln,pullMerged:Sn,pullQueued:on,alertOpened:Nn,alertClosed:Mn,alertFixed:An,alertDismissed:jn},z1={open:``,closed:``,draft:`Pull request`,archived:`Archived`,unavailable:``,issueOpened:`Issue`,issueClosed:`Issue`,issueClosedNotPlanned:`Issue, not planned`,issueDraft:`Issue`,pullOpened:`Pull request`,pullClosed:`Pull request`,pullMerged:`Pull request`,pullQueued:`Pull request`,alertOpened:`Alert`,alertClosed:`Alert`,alertFixed:`Alert`,alertDismissed:`Alert`},B1=W(`state-label`,{variants:{size:{small:`state-label-small`,medium:`state-label-medium`},tone:{open:`state-label-open`,closed:`state-label-closed`,done:`state-label-done`,draft:`state-label-draft`,attention:`state-label-attention`,neutral:`state-label-neutral`}}}),V1=W(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function H1(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=R1[i],l=z1[i];return(0,q.jsxs)(n,{ref:t,className:G(B1({size:a,tone:L1[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,q.jsx)(c,{className:G(V1({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}H1.displayName=`StateLabel`;var U1=K(H1);const W1=(0,l.createContext)({}),G1={root:`statistic-card-description`};function K1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(G1.root,n),"data-component":`StatisticCard.Description`,...r})}K1.displayName=`StatisticCard.Description`;var q1=K(K1);const J1={root:`statistic-card-label`};function Y1(e,t){let{className:n,id:r,...i}=e,{labelId:a}=l.useContext(W1);return(0,q.jsx)(`span`,{ref:t,id:r??a,className:G(J1.root,n),"data-component":`StatisticCard.Label`,...i})}Y1.displayName=`StatisticCard.Label`;var X1=K(Y1);const Z1={root:`statistic-card-trailing-visual`};function Q1(e,t){let{className:n,"aria-label":r,...i}=e;return(0,q.jsx)(`span`,{ref:t,role:r?`img`:void 0,"aria-label":r,"aria-hidden":!r||void 0,className:G(Z1.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}Q1.displayName=`StatisticCard.TrailingVisual`;var $1=K(Q1);const e0={hidden:`sr-only`},t0={increase:Kt,decrease:Lt,neutral:Pn},n0={increase:`Up`,decrease:`Down`,neutral:`No change`},r0={increase:`positive`,decrease:`negative`,neutral:`neutral`},i0=W(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function a0(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=t0[i],c=a??r0[i];return(0,q.jsxs)(`span`,{ref:t,className:G(i0({sentiment:c}),n),"data-component":`StatisticCard.Trend`,"data-direction":i,"data-sentiment":c,...o,children:[(0,q.jsx)(s,{"aria-hidden":!0}),(0,q.jsx)(`span`,{className:e0.hidden,children:n0[i]}),r]})}a0.displayName=`StatisticCard.Trend`;var o0=K(a0);const s0={root:`statistic-card-value`};function c0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(s0.root,n),"data-component":`StatisticCard.Value`,...r})}c0.displayName=`StatisticCard.Value`;var l0=K(c0);const u0={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function d0(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${Y(i)}-label`,[l,u]=xr(r,{trailingVisual:$1,label:X1,value:l0,trend:o0,description:q1}),d=o??(l.label&&!a?c:void 0);return(0,q.jsx)(W1.Provider,{value:{labelId:c},children:(0,q.jsxs)(`div`,{ref:t,id:i,role:d||a?`group`:void 0,"aria-label":a,"aria-labelledby":d,className:G(u0.root,n),"data-component":`StatisticCard`,...s,children:[(0,q.jsxs)(`div`,{className:u0.body,children:[l.label,l.value||l.trend?(0,q.jsxs)(`div`,{className:u0.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}d0.displayName=`StatisticCard`;var f0=K(d0);const p0=Object.assign(f0,{Label:X1,Value:l0,Trend:o0,Description:q1,TrailingVisual:$1}),m0=(0,l.createContext)({}),h0={srOnly:`sr-only`},g0=W(`status`,{variants:{variant:{accent:`status-accent`,success:`status-success`,attention:`status-attention`,severe:`status-severe`,danger:`status-danger`,done:`status-done`,neutral:`status-neutral`},size:{small:`status-small`,medium:`status-medium`,large:`status-large`}}});function _0(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,q.jsx)(m0.Provider,{value:{variant:i,size:a},children:(0,q.jsxs)(n,{ref:t,className:G(g0({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,q.jsx)(`span`,{className:h0.srOnly,children:o}):null,s]})})}_0.displayName=`Status`;var v0=K(_0);const y0=W(`status-indicator`,{variants:{variant:{accent:`status-indicator-accent`,success:`status-indicator-success`,attention:`status-indicator-attention`,severe:`status-indicator-severe`,danger:`status-indicator-danger`,done:`status-indicator-done`,neutral:`status-indicator-neutral`},size:{small:`status-indicator-small`,medium:`status-indicator-medium`,large:`status-indicator-large`}}});function b0(e,t){let{className:n,variant:r,size:i,...a}=e,o=l.useContext(m0),s=r??o.variant??`neutral`,c=i??o.size??`medium`;return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(y0({variant:s,size:c}),n),"data-component":`Status.Indicator`,"data-variant":s,"data-size":c,...a})}b0.displayName=`Status.Indicator`;var x0=K(b0);const S0=Object.assign(v0,{Indicator:x0}),C0=(0,l.createContext)(null),w0=W(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),T0=e=>l.Children.toArray(e).filter(e=>l.isValidElement(e)),E0=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function D0(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=T0(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(w0({orientation:a,size:o}),n),"data-component":`Steps`,"data-orientation":a,"data-size":o,"data-count":c.length,...s,children:c.map((e,t)=>(0,q.jsx)(C0.Provider,{value:{index:t,status:E0(t,i)},children:e},e.key))})}D0.displayName=`Steps`;var O0=K(D0);const k0={root:`steps-body`};function A0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(k0.root,n),"data-component":`Steps.Body`,...r})}A0.displayName=`Steps.Body`;var j0=K(A0);const M0={root:`steps-description`};function N0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(M0.root,n),"data-component":`Steps.Description`,...r})}N0.displayName=`Steps.Description`;var P0=K(N0);const F0=()=>{let e=(0,l.useContext)(C0);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},I0={root:`steps-indicator`,icon:`steps-indicator-icon`};function L0(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=F0();return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(I0.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,q.jsx)(Zt,{className:I0.icon}):a+1)})}L0.displayName=`Steps.Indicator`;var R0=K(L0);const z0={root:`steps-item`,status:`sr-only`},B0={complete:`Completed`,current:``,incomplete:`Not completed`};function V0(e,t){let{className:n,children:r,status:i,statusLabel:a,...o}=e,{index:s,status:c}=F0(),u=i??c,d=a??B0[u],f=l.useMemo(()=>({index:s,status:u}),[s,u]);return(0,q.jsx)(C0.Provider,{value:f,children:(0,q.jsxs)(`li`,{ref:t,"aria-current":u===`current`?`step`:void 0,className:G(z0.root,n),"data-component":`Steps.Item`,"data-status":u,"data-index":s,...o,children:[r,d?(0,q.jsx)(`span`,{className:z0.status,children:d}):null]})})}V0.displayName=`Steps.Item`;var H0=K(V0);const U0={root:`steps-title`};function W0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(U0.root,n),"data-component":`Steps.Title`,...r})}W0.displayName=`Steps.Title`;var G0=K(W0);const K0=Object.assign(O0,{Item:H0,Indicator:R0,Body:j0,Title:G0,Description:P0}),q0=W(`strong`,{variants:{size:{large:`strong-size-large`,medium:`strong-size-medium`,small:`strong-size-small`}}});function J0(e,t){let{as:n=`strong`,className:r,size:i,...a}=e;return(0,q.jsx)(n,{ref:t,className:G(q0({size:i}),r),"data-component":`Strong`,"data-size":i,...a})}J0.displayName=`Strong`;var Y0=K(J0);const X0=(0,l.createContext)({}),Z0=W(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function Q0(e,t){let{as:n=`span`,className:r,swap:i=!1,transition:a=`fade`,children:o,...s}=e,c=l.useMemo(()=>({swap:i}),[i]);return(0,q.jsx)(X0.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(Z0({transition:a}),r),"data-component":`Swap`,"data-swap":i?`on`:`off`,"data-transition":a,...s,children:o})})}Q0.displayName=`Swap`;var $0=K(Q0);const e2={root:`swap-indicator`,active:`swap-indicator-active`};function t2(e,t){let{as:n=`span`,className:r,type:i,...a}=e,{swap:o}=l.useContext(X0),s=i===(o?`on`:`off`);return(0,q.jsx)(n,{ref:t,"aria-hidden":s?void 0:`true`,className:G(e2.root,s&&e2.active,r),"data-component":`Swap.Indicator`,"data-type":i,"data-active":s,...a})}t2.displayName=`Swap.Indicator`;var n2=K(t2);const r2=Object.assign($0,{Indicator:n2}),i2=(0,l.createContext)({}),a2=()=>(0,l.useContext)(i2),o2=({checked:e,disabled:t,readOnly:n,required:r,invalid:i})=>({"data-state":e?`checked`:`unchecked`,"data-disabled":t||void 0,"data-readonly":n||void 0,"data-required":r||void 0,"data-invalid":i||void 0}),s2={root:`switch`};function c2(e,t){let{className:n,value:r,onClick:i,...a}=e,o=l.useRef(r.checked),s={...r,initialChecked:o.current};return(0,q.jsx)(i2.Provider,{value:s,children:(0,q.jsx)(`label`,{ref:t,id:r.ids.root,htmlFor:r.ids.hiddenInput,className:G(s2.root,n),onClick:e=>{i?.(e),e.target.id===r.ids.hiddenInput&&e.stopPropagation()},"data-component":`Switch`,...o2(r),...a})})}c2.displayName=`Switch.RootProvider`;var l2=K(c2);const u2=(e={})=>{let{checked:t,defaultChecked:n,disabled:r,readOnly:i,required:a,invalid:o,name:s,value:c,form:u,id:d,ids:f,onCheckedChange:p}=e,m=l.useContext(Yf),h=t!==void 0,[g,_]=l.useState(!!n),v=h?t:g,y=Y(d),b=e=>{h||_(e),p?.(e)};return{checked:v,disabled:!!(r??m.disabled),readOnly:!!i,required:!!(a??m.required),invalid:!!o,name:s,value:c,form:u,ids:{root:f?.root??y,label:f?.label??`${y}-label`,control:f?.control??`${y}-control`,thumb:f?.thumb??`${y}-thumb`,hiddenInput:f?.hiddenInput??m.id??`${y}-input`},describedBy:[m.validationMessageId,m.captionId].filter(Boolean).join(` `)||void 0,setChecked:b,toggleChecked:()=>b(!v)}};function d2(e,t){let{checked:n,defaultChecked:r,disabled:i,readOnly:a,required:o,invalid:s,name:c,value:l,form:u,id:d,ids:f,onCheckedChange:p,...m}=e,h=u2({checked:n,defaultChecked:r,disabled:i,readOnly:a,required:o,invalid:s,name:c,value:l,form:u,id:d,ids:f,onCheckedChange:p});return(0,q.jsx)(l2,{ref:t,value:h,...m})}d2.displayName=`Switch`;var f2=K(d2);const p2={root:`switch-control`};function m2(e,t){let{className:n,...r}=e,i=l.useContext(i2);return(0,q.jsx)(`span`,{ref:t,id:i.ids?.control,className:G(p2.root,n),"aria-hidden":`true`,"data-component":`Switch.Control`,...o2(i),...r})}m2.displayName=`Switch.Control`;var h2=K(m2);const g2={root:`switch-hidden-input`,hidden:`sr-only`};function _2(e,t){let{className:n,onChange:r,...i}=e,{checked:a=!1,disabled:o,readOnly:s,required:c,invalid:u,name:d,value:f,form:p,ids:m,describedBy:h,initialChecked:g,setChecked:_}=l.useContext(i2),v=l.useRef(null),y=ar(t,v),b=l.useRef(()=>{});return l.useEffect(()=>{b.current=()=>_?.(!!g)},[g,_]),l.useEffect(()=>{let e=v.current?.form;if(!e)return;let t=()=>b.current();return e.addEventListener(`reset`,t),()=>{e.removeEventListener(`reset`,t)}},[p]),(0,q.jsx)(`input`,{ref:y,id:m?.hiddenInput,type:`checkbox`,role:`switch`,className:G(g2.root,g2.hidden,n),checked:a,disabled:o,required:c,name:d,value:f,form:p,"aria-labelledby":m?.label,"aria-describedby":h,"aria-invalid":u||void 0,onChange:e=>{r?.(e),!(s||e.nativeEvent.defaultPrevented)&&_?.(e.currentTarget.checked)},"data-component":`Switch.HiddenInput`,...i})}_2.displayName=`Switch.HiddenInput`;var v2=K(_2);const y2={root:`switch-label`};function b2(e,t){let{className:n,...r}=e,i=l.useContext(i2);return(0,q.jsx)(`span`,{ref:t,id:i.ids?.label,className:G(y2.root,n),"data-component":`Switch.Label`,...o2(i),...r})}b2.displayName=`Switch.Label`;var x2=K(b2);const S2={root:`switch-thumb`};function C2(e,t){let{className:n,...r}=e,i=l.useContext(i2);return(0,q.jsx)(`span`,{ref:t,id:i.ids?.thumb,className:G(S2.root,n),"aria-hidden":`true`,"data-component":`Switch.Thumb`,...o2(i),...r})}C2.displayName=`Switch.Thumb`;var w2=K(C2);const T2=Object.assign(f2,{Root:f2,RootProvider:l2,Control:h2,Thumb:w2,Label:x2,HiddenInput:v2}),E2=(0,l.createContext)({}),D2=()=>(0,l.useContext)(E2),O2=(0,l.createContext)(null),k2=()=>(0,l.useContext)(O2),A2=e=>typeof document>`u`?null:document.getElementById(e),j2=(e,t={})=>{let{scrollElement:n,behavior:r}=t,i=A2(e);if(!i)return!1;if(!n)return i.scrollIntoView?.({behavior:r,block:`start`}),!0;if(!n.contains(i))return!1;let a=i.getBoundingClientRect(),o=n.getBoundingClientRect(),s=L2(getComputedStyle(n).scrollPaddingBlockStart||getComputedStyle(n).scrollPaddingTop),c=L2(getComputedStyle(i).scrollMarginBlockStart||getComputedStyle(i).scrollMarginTop),l=a.top-o.top+n.scrollTop-s-c;return n.scrollTo({top:l,...r&&{behavior:r}}),!0},M2=e=>{let t=e.getAttribute(`href`);if(!t)return null;let n=new URL(t,window.location.href);if(n.origin!==window.location.origin||n.pathname!==window.location.pathname||n.search!==window.location.search)return null;try{return decodeURIComponent(n.hash.slice(1))||null}catch{return null}},N2=e=>{let t=window.location.href;window.history.pushState(null,``,`#${e}`),window.dispatchEvent(new HashChangeEvent(`hashchange`,{oldURL:t,newURL:window.location.href}))},P2=e=>{if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.currentTarget;if(t.hasAttribute(`download`))return!1;let n=t.getAttribute(`target`);return n===null||n===``||n===`_self`},F2=e=>e===null||e.x===0&&e.y===0&&e.width===0&&e.height===0,I2=(e,t)=>e!==null&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,L2=e=>{let t=Number.parseFloat(e);return Number.isNaN(t)?0:t},R2=`-20px 0% -40% 0%`,z2=[],B2=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),V2=(e={})=>{let{items:t=z2,activeIds:n,defaultActiveIds:r,onActiveChange:i,rootMargin:a=R2,threshold:o=0,scrollElement:s=null,scrollBehavior:c=`smooth`}=e,u=n!==void 0,[d,f]=l.useState(r??[]),p=u?n:d,m=t.filter(e=>p.includes(e.value)),h=l.useRef({items:t,currentActiveIds:p,onActiveChange:i,isControlled:u});l.useEffect(()=>{h.current={items:t,currentActiveIds:p,onActiveChange:i,isControlled:u}});let g=l.useCallback(e=>{let t=h.current;B2(t.currentActiveIds,e)||(t.isControlled||f(e),t.onActiveChange?.({activeIds:e,activeItems:t.items.filter(t=>e.includes(t.value))}))},[]),_=t.map(e=>e.value).join(),v=Array.isArray(o)?o.join():String(o);return l.useEffect(()=>{let e=h.current.items;if(e.length===0||typeof IntersectionObserver>`u`)return;let t=new Map,n=new IntersectionObserver(e=>{for(let n of e)t.set(n.target.id,n.isIntersecting);let n=h.current.items.filter(e=>t.get(e.value)).map(e=>e.value);n.length!==0&&g(n)},{rootMargin:a,threshold:o,root:s});for(let t of e){let e=A2(t.value);e&&n.observe(e)}return()=>{n.disconnect()}},[_,a,v,s,g]),{items:t,activeIds:p,activeItems:m,setActiveIds:g,scrollTo:(e,t)=>j2(e,{scrollElement:s,behavior:t?.behavior??c}),getItemState:e=>({active:p.includes(e.value),first:e.value===p[0],last:e.value===p[p.length-1],depth:e.depth})}},H2={root:`table-of-contents`};function U2(e,t){let{as:n=`div`,className:r,id:i,items:a,activeIds:o,defaultActiveIds:s,rootMargin:c,threshold:u,scrollElement:d,scrollBehavior:f=`smooth`,autoScroll:p=!0,onActiveChange:m,children:h,...g}=e,_=Y(i),v=l.useMemo(()=>({root:_,title:`${_}-title`,list:`${_}-list`,indicator:`${_}-indicator`,item:e=>`${_}-item-${e}`,link:e=>`${_}-link-${e}`}),[_]),[y,b]=l.useState(null),x=d===void 0?y:d,[S,C]=l.useState(!1),w=V2({items:a,activeIds:o,defaultActiveIds:s,onActiveChange:m,rootMargin:c,threshold:u,scrollElement:x,scrollBehavior:f}),T=w.activeIds[0];l.useEffect(()=>{!p||T===void 0||document.getElementById(v.item(T))?.scrollIntoView?.({behavior:f,block:`nearest`})},[p,T,v,f]);let E={...w,ids:v,scrollElement:x,setScrollElement:b,hasTitle:S,setHasTitle:C};return(0,q.jsx)(E2.Provider,{value:E,children:(0,q.jsx)(n,{ref:t,id:v.root,className:G(H2.root,r),"data-component":`TableOfContents`,...g,children:h})})}U2.displayName=`TableOfContents`;var W2=K(U2);const G2={root:`table-of-contents-content`};function K2(e,t){let{as:n=`article`,className:r,...i}=e,{setScrollElement:a}=D2(),o=ar(t,a);return(0,q.jsx)(n,{ref:o,className:G(G2.root,r),"data-component":`TableOfContents.Content`,...i})}K2.displayName=`TableOfContents.Content`;var q2=K(K2);const J2={root:`table-of-contents-indicator`},Y2=e=>e===void 0?void 0:`${e}px`;function X2(e,t){let{as:n=`div`,className:r,style:i,...a}=e,{ids:o,activeIds:s}=D2(),[c,u]=l.useState(null),d=s?.join()??``;return rr(()=>{let e=s??[];if(!o||e.length===0){u(null);return}let t=document.getElementById(o.list),n=document.getElementById(o.item(e[0])),r=document.getElementById(o.item(e[e.length-1]));if(!n){u(null);return}let i=()=>{let e=n.getBoundingClientRect(),i=t?.getBoundingClientRect(),a=t&&i?e.left-i.left+t.scrollLeft:0,o=t&&i?e.top-i.top+t.scrollTop:0,s=r&&r!==n?r.getBoundingClientRect().bottom-e.top:e.height,c={x:a,y:o,width:e.width,height:s};u(e=>I2(e,c)?e:c)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),r&&r!==n&&a.observe(r),t&&a.observe(t),()=>{a.disconnect()}},[d,o]),(0,q.jsx)(n,{ref:t,id:o?.indicator,"aria-hidden":`true`,hidden:F2(c),className:G(J2.root,r),style:{...i,"--table-of-contents-indicator-x":Y2(c?.x),"--table-of-contents-indicator-y":Y2(c?.y),"--table-of-contents-indicator-width":Y2(c?.width),"--table-of-contents-indicator-height":Y2(c?.height)},"data-component":`TableOfContents.Indicator`,...a})}X2.displayName=`TableOfContents.Indicator`;var Z2=K(X2);const Q2={root:`table-of-contents-item`};function $2(e,t){let{as:n=`li`,className:r,item:i,style:a,...o}=e,{ids:s,getItemState:c}=D2(),l=c?.(i);return(0,q.jsx)(O2.Provider,{value:i,children:(0,q.jsx)(n,{ref:t,id:s?.item(i.value),className:G(Q2.root,r),style:{...a,"--table-of-contents-item-depth":i.depth},"data-component":`TableOfContents.Item`,"data-value":i.value,"data-depth":i.depth,"data-active":l?.active?``:void 0,"data-first":l?.first?``:void 0,"data-last":l?.last?``:void 0,...o})})}$2.displayName=`TableOfContents.Item`;var e4=K($2);const t4={root:`table-of-contents-link`};function n4(e,t){let{as:n=`a`,className:r,onClick:i,...a}=e,{ids:o,scrollElement:s,scrollTo:c,getItemState:l}=D2(),u=k2(),d=u&&l?.(u);return(0,q.jsx)(n,{ref:t,id:u?o?.link(u.value):void 0,className:G(t4.root,r),"aria-current":d?.active?`location`:void 0,"data-component":`TableOfContents.Link`,"data-value":u?.value,"data-active":d?.active?``:void 0,onClick:e=>{if(i?.(e),e.defaultPrevented||!s||!P2(e))return;let t=M2(e.currentTarget);!t||!c?.(t)||(e.preventDefault(),N2(t))},...a})}n4.displayName=`TableOfContents.Link`;var r4=K(n4);const i4={root:`table-of-contents-list`};function a4(e,t){let{as:n=`ul`,className:r,...i}=e,{ids:a}=D2();return(0,q.jsx)(n,{ref:t,id:a?.list,className:G(i4.root,r),"data-component":`TableOfContents.List`,...i})}a4.displayName=`TableOfContents.List`;var o4=K(a4);const s4={root:`table-of-contents-nav`};function c4(e,t){let{as:n=`nav`,className:r,placement:i,...a}=e,{ids:o,hasTitle:s}=D2();return(0,q.jsx)(n,{ref:t,"aria-labelledby":s?o?.title:void 0,className:G(s4.root,r),"data-component":`TableOfContents.Nav`,"data-placement":i,...a})}c4.displayName=`TableOfContents.Nav`;var l4=K(c4);const u4={root:`table-of-contents-title`};function d4(e,t){let{as:n=`h2`,className:r,...i}=e,{ids:a,setHasTitle:o}=D2();return rr(()=>(o?.(!0),()=>o?.(!1)),[o]),(0,q.jsx)(n,{ref:t,id:a?.title,className:G(u4.root,r),"data-component":`TableOfContents.Title`,...i})}d4.displayName=`TableOfContents.Title`;var f4=K(d4);const p4=Object.assign(W2,{Root:W2,Content:q2,Nav:l4,Title:f4,List:o4,Item:e4,Link:r4,Indicator:Z2}),m4=(0,l.createContext)(null);function h4(e){let{children:t,id:n,value:r,defaultValue:i,onChange:a}=e,o=Y(n),s=r!==void 0,[c,u]=l.useState(i),d=s?r:c,f=l.useRef(a);rr(()=>{f.current=a},[a]);let p=l.useMemo(()=>({groupId:o,selectedValue:d,selectTab:e=>{s||u(e),f.current?.(e)}}),[o,d,s]);return(0,q.jsx)(m4.Provider,{value:p,children:t})}h4.displayName=`Tabs`;const g4=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},_4=()=>{let e=(0,l.useContext)(m4);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},v4=e=>{let{value:t,disabled:n}=e,r=_4(),i=r.selectedValue===t;return{selected:i,tabProps:{id:`${r.groupId}-tab-${t}`,role:`tab`,"aria-controls":`${r.groupId}-panel-${t}`,"aria-selected":i,"aria-disabled":n?!0:void 0,tabIndex:i?0:-1,onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&r.selectTab(t)},onMouseDown:e=>{if(n||e.button!==0||e.ctrlKey){e.preventDefault();return}r.selectTab(t)},onFocus:()=>{!i&&!n&&r.selectTab(t)}}}},y4={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function b4(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=v4({value:r,disabled:i});return(0,q.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:g4(a,u.onKeyDown),onMouseDown:g4(o,u.onMouseDown),onFocus:g4(s,u.onFocus),className:G(y4.root,y4.vertical,y4.hover,l&&y4.selected,i&&y4.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}b4.displayName=`Tabs.Tab`;var x4=K(b4);const S4=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),C4=e=>{let{"aria-label":t,"aria-labelledby":n,"aria-orientation":r,ref:i}=e,a=l.useRef(null),o=ar(i,a),s=r??`horizontal`;return{tabListProps:{ref:o,role:`tablist`,"aria-label":t,"aria-labelledby":n,"aria-orientation":s,onKeyDown:e=>{let t=a.current;if(!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,o=e.key===`Home`||e.key===`End`,c=e.key===r?1:e.key===i?-1:0;if(c===0&&!o)return;e.preventDefault(),e.stopPropagation();let l=S4(t);if(l.length===0)return;if(o){l[e.key===`Home`?0:l.length-1].focus();return}let u=l.findIndex(e=>e.getAttribute(`aria-selected`)===`true`);l[u===-1?0:(u+c+l.length)%l.length].focus()}}}},w4={root:`tab-list`,vertical:`tab-list-vertical`};function T4(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=C4({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,q.jsx)(`div`,{...s,...c,onKeyDown:g4(r,c.onKeyDown),className:G(w4.root,l&&w4.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}T4.displayName=`Tabs.List`;var E4=K(T4);const D4=e=>{let{value:t}=e,n=_4(),r=n.selectedValue===t;return{tabPanelProps:{id:`${n.groupId}-panel-${t}`,role:`tabpanel`,"aria-labelledby":`${n.groupId}-tab-${t}`,hidden:!r,"data-selected":r?``:void 0}}};function O4(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=D4({value:r});return(0,q.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}O4.displayName=`Tabs.Panel`;var k4=K(O4);const A4=Object.assign(h4,{List:E4,Tab:x4,Panel:k4}),j4={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},M4=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function N4(e,t){let{className:n,clipSidebar:r,...i}=e,a=M4(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(j4.root,(a===`start`||a===`both`)&&j4.clipStart,(a===`end`||a===`both`)&&j4.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}N4.displayName=`Timeline`;var P4=K(N4);const F4={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function I4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(F4.root,F4.narrow,n),"data-component":`Timeline.Actions`,...r})}I4.displayName=`Timeline.Actions`;var L4=K(I4);const R4={root:`timeline-avatar`};function z4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(R4.root,n),"data-component":`Timeline.Avatar`,...r})}z4.displayName=`Timeline.Avatar`;var B4=K(z4);const V4={wrapper:`timeline-badge-wrapper`},H4=W(`timeline-badge`,{variants:{variant:{accent:`timeline-badge-accent`,success:`timeline-badge-success`,attention:`timeline-badge-attention`,severe:`timeline-badge-severe`,danger:`timeline-badge-danger`,done:`timeline-badge-done`,open:`timeline-badge-open`,closed:`timeline-badge-closed`,sponsors:`timeline-badge-sponsors`}}});function U4(e,t){let{className:n,variant:r,...i}=e;return(0,q.jsx)(`div`,{className:V4.wrapper,children:(0,q.jsx)(`div`,{ref:t,className:G(H4({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}U4.displayName=`Timeline.Badge`;var W4=K(U4);const G4={root:`timeline-body`};function K4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(G4.root,n),"data-component":`Timeline.Body`,...r})}K4.displayName=`Timeline.Body`;var q4=K(K4);const J4={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function Y4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`li`,{ref:t,role:`presentation`,className:G(J4.root,J4.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}Y4.displayName=`Timeline.Break`;var X4=K(Y4);const Z4={root:`timeline-item`,rail:`timeline-item-rail`,condensed:`timeline-item-condensed`,condensedBadge:`timeline-item-condensed-badge`,condensedAvatar:`timeline-item-condensed-avatar`,narrow:`timeline-item-narrow`};function Q4(e,t){let{className:n,condensed:r,...i}=e;return(0,q.jsx)(`li`,{ref:t,className:G(Z4.root,Z4.rail,Z4.narrow,r&&Z4.condensed,r&&Z4.condensedBadge,r&&Z4.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}Q4.displayName=`Timeline.Item`;var $4=K(Q4);const e3=Object.assign(P4,{Item:$4,Avatar:B4,Badge:W4,Body:q4,Break:X4,Actions:L4}),t3=(0,l.createContext)({}),n3=()=>(0,l.useContext)(t3);var r3=c(o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))}))());eu.default.extend(r3.default);const i3=e=>{let t=eu.default.duration(Math.max(e,0));return{days:Math.floor(t.asDays()),hours:Math.floor(t.asHours())%24,minutes:Math.floor(t.asMinutes())%60,seconds:Math.floor(t.asSeconds())%60,milliseconds:Math.floor(t.asMilliseconds())%1e3}},a3=e=>{let t=eu.default.duration(e);return{days:t.format(`DD`),hours:t.format(`HH`),minutes:t.format(`mm`),seconds:t.format(`ss`),milliseconds:t.format(`SSS`)}},o3=()=>(0,eu.default)(),s3=1e3,c3=(e,t)=>t>0?Math.floor(e/t)*t:e,l3=(e,t,n,r)=>r?Math.max(t-e,n??0):n===void 0?t+e:Math.min(t+e,n),u3=(e={})=>{let{countdown:t=!1,startMs:n=0,targetMs:r,interval:i=s3,autoStart:a=!1,onTick:o,onComplete:s}=e,[c,u]=l.useState(a?`running`:`idle`),[d,f]=l.useState(0),[p,m]=l.useState(o3),h=t?r??0:r,g=l3(c3(d,i),n,h,t),_=i3(g),v=a3(_),y=h!==void 0&&(t?g<=h:g>=h),b=l.useRef(o),x=l.useRef(s);return l.useEffect(()=>{b.current=o,x.current=s},[o,s]),l.useEffect(()=>{if(c!==`running`)return;let e=window.setInterval(()=>{let e=o3().diff(p),r=l3(c3(e,i),n,h,t),a=i3(r);f(e),b.current?.({value:r,time:a,formattedTime:a3(a)})},i);return()=>{window.clearInterval(e)}},[c,i,p,n,h,t]),l.useEffect(()=>{c!==`running`||!y||(u(`completed`),x.current?.())},[c,y]),{value:g,time:_,formattedTime:v,status:c,running:c===`running`,paused:c===`paused`,completed:c===`completed`,start:()=>{m(o3()),f(0),u(`running`)},pause:()=>{c===`running`&&(f(o3().diff(p)),u(`paused`))},resume:()=>{c===`paused`&&(m(o3().subtract(d,`millisecond`)),u(`running`))},reset:()=>{m(o3()),f(0),u(`idle`)}}},d3={root:`timer`};function f3(e,t){let{as:n=`div`,className:r,countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u,children:d,...f}=e,p=u3({countdown:i,startMs:a,targetMs:o,interval:s,autoStart:c,onTick:l,onComplete:u});return(0,q.jsx)(t3.Provider,{value:p,children:(0,q.jsx)(n,{ref:t,className:G(d3.root,r),"data-component":`Timer`,"data-status":p.status,...f,children:d})})}f3.displayName=`Timer`;var p3=K(f3);const m3={root:`timer-action-trigger`},h3={start:e=>e!==`running`,pause:e=>e===`running`,resume:e=>e===`paused`,reset:e=>e!==`idle`};function g3(e,t){let{className:n,action:r,disabled:i,onClick:a,children:o,...s}=e,c=l.useContext(t3),u=c.status??`idle`,d={start:c.start,pause:c.pause,resume:c.resume,reset:c.reset}[r];return(0,q.jsx)(pi,{ref:t,disabled:i??!h3[r](u),onClick:e=>{a?.(e),!e.defaultPrevented&&d?.()},className:G(m3.root,n),"data-component":`Timer.ActionTrigger`,"data-action":r,...s,children:o})}g3.displayName=`Timer.ActionTrigger`;var _3=K(g3);const v3={root:`timer-area`};function y3(e,t){let{as:n=`div`,className:r,...i}=e,{status:a}=l.useContext(t3);return(0,q.jsx)(n,{ref:t,role:`timer`,className:G(v3.root,r),"data-component":`Timer.Area`,"data-status":a,...i})}y3.displayName=`Timer.Area`;var b3=K(y3);const x3={root:`timer-control`};function S3(e,t){let{as:n=`div`,className:r,...i}=e,{status:a}=l.useContext(t3);return(0,q.jsx)(n,{ref:t,className:G(x3.root,r),"data-component":`Timer.Control`,"data-status":a,...i})}S3.displayName=`Timer.Control`;var C3=K(S3);const w3={root:`timer-item`};function T3(e,t){let{as:n=`div`,className:r,type:i,children:a,...o}=e,{formattedTime:s}=l.useContext(t3);return(0,q.jsx)(n,{ref:t,className:G(w3.root,r),"data-component":`Timer.Item`,"data-unit":i,...o,children:a??s?.[i]})}T3.displayName=`Timer.Item`;var E3=K(T3);const D3={root:`timer-separator`};function O3(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,"aria-hidden":`true`,className:G(D3.root,r),"data-component":`Timer.Separator`,...i})}O3.displayName=`Timer.Separator`;var k3=K(O3);const A3=Object.assign(p3,{Root:p3,Area:b3,Item:E3,Separator:k3,Control:C3,ActionTrigger:_3});let j3=[],M3=0;const N3=new Set,P3=()=>{for(let e of N3)e()},F3=e=>(N3.add(e),()=>{N3.delete(e)}),I3=()=>j3,L3=[],R3=()=>L3,z3=e=>(j3=j3.some(t=>t.id===e.id)?j3.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...j3],P3(),e.id),B3=e=>(j3=j3.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),P3(),e),V3=e=>{j3=j3.filter(t=>t.id!==e),P3()},H3=()=>`toast-${++M3}`,U3=(e,t,n={})=>z3({...n,id:n.id??H3(),title:t,variant:e}),W3=(e,t)=>typeof e==`function`?e(t):e,G3=(e,t,n={})=>{let r=n.id??H3();U3(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){B3(r);return}U3(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,W3(t.success,e)),e=>i(`error`,W3(t.error,e))),r},K3=(e,t)=>U3(`default`,e,t),q3=Object.assign(K3,{message:K3,success:(e,t)=>U3(`success`,e,t),error:(e,t)=>U3(`error`,e,t),warning:(e,t)=>U3(`warning`,e,t),info:(e,t)=>U3(`info`,e,t),loading:(e,t)=>U3(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>z3({...t,id:t.id??H3(),variant:`default`,render:e}),promise:G3,dismiss:B3,getToasts:I3}),J3={root:`toast`,animated:`motion-safe:[transition:transform_var(--motion-transition-state-change),opacity_var(--motion-transition-state-change),height_var(--motion-transition-state-change)]`,grabbable:`toast-grabbable`,lift:{top:`toast-lift-top`,bottom:`toast-lift-bottom`},bridge:`toast-bridge`,bridgeTop:`toast-bridge-top`,bridgeBottom:`toast-bridge-bottom`,card:`toast-card`,iconColor:{default:``,success:`toast-icon-success`,error:`toast-icon-error`,warning:`toast-icon-warning`,info:`toast-icon-info`,loading:``},richColors:{default:``,success:`toast-rich-success`,error:`toast-rich-error`,warning:`toast-rich-warning`,info:`toast-rich-info`,loading:``},hidden:`opacity-0`,waiting:`pointer-events-none`,dragging:`select-none`,body:`toast-body motion-safe:[transition:opacity_var(--motion-transition-state-change)]`,bodyStacked:`opacity-0`,icon:`toast-icon`,content:`toast-content`,title:`toast-title`,description:`toast-description`,actions:`toast-actions`},Y3={default:null,success:Xt,error:fn,warning:Gn,info:vn,loading:null},X3=e=>typeof e==`object`&&!!e&&`label`in e&&!l.isValidElement(e);function Z3(e){let{toast:t,place:n,position:r,height:i,frontHeight:a,stackSize:o,expanded:s,visible:c,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=e,{id:h,variant:g,title:_,description:v,render:y}=t,b=t.duration??p.duration,x=t.dismissible??p.dismissible,S=t.closeButton??p.closeButton,C=t.richColors??p.richColors,w=t.important??p.important??!1,T=l.useRef(null),[E,D]=l.useState(!1),[O,k]=l.useState({x:0,y:0}),[A,j]=l.useState(!1),[M,N]=l.useState(!1),P=l.useRef(null),F=!!t.dismissed,I=n.index===0,L=E&&!s&&!I,ee=!!y,R=r.startsWith(`top`)?`top`:`bottom`,z=e=>{t.dismissed||(B3(h),e===`timeout`?t.onAutoClose?.(t):t.onDismiss?.(t))};l.useEffect(()=>{D(!0)},[]);let te=l.useRef({revision:-1,time:b});l.useEffect(()=>{if(te.current.revision!==t.revision&&(te.current={revision:t.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),n=window.setTimeout(()=>z(`timeout`),Math.max(te.current.time,0));return()=>{window.clearTimeout(n),te.current.time-=Date.now()-e}},[t,b,u,F]),l.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>V3(h),200);return()=>{window.clearTimeout(e)}},[F,h]),rr(()=>{let e=T.current;if(!e)return;let t=e.style.height;e.style.height=`auto`;let n=e.getBoundingClientRect().height;e.style.height=t,m(h,n)},[m,h,t.revision,_,v,s]);let ne=e=>d.includes(e),B=(e,t,n)=>e<0?ne(t)?e:0:ne(n)?e:0,re=e=>{!x||e.button!==0||e.target.closest(`button`)||(P.current={pointerId:e.pointerId,x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture?.(e.pointerId),j(!0))},V=e=>{let t=P.current;!t||t.pointerId!==e.pointerId||k({x:B(e.clientX-t.x,`left`,`right`),y:B(e.clientY-t.y,`top`,`bottom`)})},ie=e=>{let t=P.current;if(!t||t.pointerId!==e.pointerId)return;if(P.current=null,j(!1),Math.max(Math.abs(O.x),Math.abs(O.y))<45){k({x:0,y:0});return}let n=e.currentTarget.getBoundingClientRect(),r=(e,t)=>e===0?0:Math.sign(e)*(t+32);k({x:r(O.x,n.width),y:r(O.y,n.height)}),N(!0),z(`swipe`)},ae=()=>{P.current=null,j(!1),k({x:0,y:0})},oe=s?`calc(var(--toast-lift) * var(--toast-offset))`:`calc(var(--toast-lift) * var(--toaster-gap) * var(--toast-index))`,se=`calc(var(--toast-lift) * -100%)`,ce={"--toast-index":n.index,"--toast-offset":`${n.offset}px`,"--toast-z-index":o-n.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?a:i),"--toast-shift":E?!F||M?oe:I?se:s?`calc(${oe} + ${se})`:oe:se,"--toast-scale":L?Math.max(1-n.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},le=Y3[g],ue=t.icon===void 0?f?.[g]:t.icon,de=ue===void 0?g===`loading`?(0,q.jsx)($r,{size:`small`,srText:null}):le?(0,q.jsx)(le,{}):null:ue,fe=(e,t,n)=>X3(e)?(0,q.jsx)(pi,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||z(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,pe=t.action!==void 0||t.cancel!==void 0;return(0,q.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:G(J3.root,J3.lift[R],J3.bridge,R===`top`?J3.bridgeTop:J3.bridgeBottom,x&&J3.grabbable,!ee&&J3.card,!ee&&J3.iconColor[g],!ee&&C&&J3.richColors[g],(!E||F||!c)&&J3.hidden,!c&&J3.waiting,A?J3.dragging:J3.animated,p.className,t.className),style:ce,"data-component":`Toast`,"data-variant":g,"data-position":r,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":s,"data-stacked":L,"data-visible":c,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:V,onPointerUp:ie,onPointerCancel:ae,children:ee?y?.(t):(0,q.jsxs)(`div`,{className:G(J3.body,L&&J3.bodyStacked),"data-component":`Toast.Body`,children:[de===null?null:(0,q.jsx)(`span`,{className:J3.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:de}),(0,q.jsxs)(`div`,{className:J3.content,"data-component":`Toast.Content`,children:[(0,q.jsx)(`div`,{className:J3.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,q.jsx)(`div`,{className:J3.description,"data-component":`Toast.Description`,children:v})]}),pe?(0,q.jsxs)(`div`,{className:J3.actions,"data-component":`Toast.Actions`,children:[fe(t.cancel,`cancel`,`invisible`),fe(t.action,`action`,`default`)]}):null,S&&x?(0,q.jsx)(gi,{icon:un,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>z(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}Z3.displayName=`Toast`;const Q3=W(`toaster z-popover`,{variants:{position:{"top-left":`toaster-top-left`,"top-center":`toaster-top-center`,"top-right":`toaster-top-right`,"bottom-left":`toaster-bottom-left`,"bottom-center":`toaster-bottom-center`,"bottom-right":`toaster-bottom-right`}}}),$3=[`altKey`,`KeyT`],e6=e=>typeof e==`number`?`${e}px`:e,t6=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},n6=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),r6=()=>document.visibilityState===`hidden`,i6=()=>!1;function a6(e,t){let{position:n=`bottom-right`,expand:r=!1,visibleToasts:i=3,toastOptions:a,duration:o=4e3,closeButton:s=!1,richColors:c=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=$3,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=e,x=l.useSyncExternalStore(F3,I3,R3),S=l.useSyncExternalStore(n6,r6,i6),C=l.useRef(null),w=ar(t,C),[T,E]=l.useState({}),[D,O]=l.useState(!1),k=r||D,A=l.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);l.useEffect(()=>{E(e=>{let t=Object.keys(e).filter(e=>x.some(t=>t.id===e));return t.length===Object.keys(e).length?e:Object.fromEntries(t.map(t=>[t,e[t]]))})},[x]);let j=x.filter(e=>!e.dismissed),M=new Map,N=0;j.forEach((e,t)=>{M.set(e.id,{index:t,offset:N}),N+=(T[e.id]??0)+u});let P=l.useRef(M);for(let e of x)if(!M.has(e.id)){let t=P.current.get(e.id);t&&M.set(e.id,t)}P.current=M;let F=j.length>0?T[j[0].id]??0:0;l.useEffect(()=>{let e=e=>{let t=C.current,n=t!==null&&(document.activeElement===t||t.contains(document.activeElement));if(e.code===`Escape`&&n){O(!1);return}m.every(t=>!!e[t]||e.code===t)&&(O(!0),C.current?.focus())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[m]);let I={duration:o,closeButton:s,richColors:c,dismissible:!0,...a},L=h??t6(n);return(0,q.jsx)(ea,{children:(0,q.jsx)(`section`,{"aria-label":_,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,tabIndex:-1,"data-component":`Toaster.Region`,children:(0,q.jsx)(`ol`,{ref:w,tabIndex:-1,className:G(Q3({position:n}),v),style:{...y,"--toaster-width":e6(p),"--toaster-viewport-offset":e6(d),"--toaster-mobile-offset":e6(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":n,"data-expanded":k,onPointerEnter:()=>O(!0),onPointerLeave:()=>O(!1),onFocus:()=>O(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||O(!1)},...b,children:x.map(e=>{let t=M.get(e.id)??{index:0,offset:0};return(0,q.jsx)(Z3,{toast:e,place:t,position:n,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<i,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}a6.displayName=`Toaster`;var o6=K(a6);const s6=W(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),c6=`medium`,l6=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function u6(e,t){let{as:n=`span`,className:r,size:i=c6,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=l6({as:n,onClick:c.onClick,onFocus:c.onFocus,tabIndex:c.tabIndex,disabled:c.disabled});return(0,q.jsx)(n,{ref:t,onKeyDown:e=>{s?.(e),(e.key===`Backspace`||e.key===`Delete`)&&o?.()},className:G(s6({size:i,interactive:l}),r),"data-component":`Token`,"data-size":i,"data-interactive":l?``:void 0,"data-selected":a?``:void 0,...n===`button`?{type:`button`}:{},...c})}u6.displayName=`TokenBase`;var d6=K(u6);const f6=W(`token-remove-button`,{variants:{size:{small:`token-remove-button-small`,medium:`token-remove-button-medium`,large:`token-remove-button-large`,xlarge:`token-remove-button-xlarge`},raised:{true:`token-remove-button-raised`,false:``}}});function p6(e){let{className:t,size:n=c6,isParentInteractive:r,...i}=e,a=G(f6({size:n,raised:r}),t);return r?(0,q.jsx)(`span`,{"aria-hidden":`true`,tabIndex:-1,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(un,{})}):(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(un,{})})}p6.displayName=`Token.RemoveButton`;const m6={root:`token-text`,interactive:`token-text-interactive`};function h6(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,q.jsx)(n,{ref:t,className:G(m6.root,i&&m6.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}h6.displayName=`Token.Text`;var g6=K(h6);const _6={srOnly:`sr-only`},v6=W(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),y6=W(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),b6=e=>l.isValidElement(e)?e:(0,q.jsx)(e,{});function x6(e,t){let{as:n,className:r,text:i,size:a=c6,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=l6({as:n,onClick:d,onFocus:f.onFocus,tabIndex:f.tabIndex,disabled:f.disabled}),m=!!s&&!c,h=p&&m,g={as:n,href:u,onClick:d},_=e=>{e.stopPropagation(),s?.()};return(0,q.jsxs)(d6,{ref:t,size:a,isSelected:l,onRemove:s,className:G(v6({interactive:p,selected:l,withRemoveButton:m}),r),"data-has-remove-button":m?``:void 0,...h?{}:g,...f,children:[o&&a!==`small`?(0,q.jsx)(`span`,{className:G(y6({size:a})),"data-component":`Token.LeadingVisual`,children:b6(o)}):null,(0,q.jsxs)(g6,{interactive:h,...h?g:{},children:[i,s?(0,q.jsx)(`span`,{className:_6.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,q.jsx)(p6,{size:a,isParentInteractive:p,onClick:_}):null]})}x6.displayName=`Token`;var S6=K(x6);const C6=`#999999`,w6=.6,T6=(e,t,n)=>Math.max(t,Math.min(e,n)),E6=e=>T6(Math.round(e),0,100),D6=e=>{let t=e.trim();if(t.startsWith(`#`)){let e=t.slice(1);if(e.length===3){let[t,n,r]=[...e].map(e=>parseInt(e+e,16));return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}if(e.length===6){let t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),r=parseInt(e.slice(4,6),16);return Number.isNaN(t+n+r)?null:{r:t,g:n,b:r}}return null}let n=t.match(/^rgba?\(([^)]+)\)$/i);if(!n)return null;let r=n[1].split(/[\s,/]+/).filter(Boolean).map(Number);if(r.length<3||r.slice(0,3).some(Number.isNaN))return null;let[i,a,o]=r;return{r:i,g:a,b:o}},O6=({r:e,g:t,b:n})=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2;if(c===0)return{h:0,s:0,l:Math.round(l*100)};let u=c/(1-Math.abs(2*l-1)),d;return d=o===r?(i-a)/c%6:o===i?(a-r)/c+2:(r-i)/c+4,d=Math.round(d*60),{h:d<0?d+360:d,s:Math.round(u*100),l:Math.round(l*100)}},k6=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,A6=e=>{let t=D6(e)??D6(`#999999`),{h:n,s:r,l:i}=O6(t),a=k6(t),{r:o,g:s,b:c}=t,l=T6(1/(.453-a),0,1),u=T6((a-.96)*100,0,1),d=(w6-a)*100*T6(1/(w6-a),0,1),f=E6(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${E6(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${E6(i-5)}%)`},dark:{background:`rgba(${o}, ${s}, ${c}, 0.18)`,foreground:`hsl(${n}deg, ${r}%, ${f}%)`,border:`hsla(${n}deg, ${r}%, ${f}%, 0.3)`,ring:`hsl(${n}deg, ${r}%, ${f}%)`,backgroundHover:`hsla(${n}deg, ${r}%, ${E6(i+10)}%, 0.3)`}}},j6={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function M6(e,t){let{as:n,className:r,style:i,text:a,size:o=c6,fillColor:s=C6,onRemove:c,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=e,h=l.useMemo(()=>A6(s),[s]),g=l6({as:n,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!c&&!u,v=g&&_,y={as:n,href:f,onClick:p},b=e=>{e.stopPropagation(),c?.()};return(0,q.jsxs)(d6,{ref:t,size:o,isSelected:d,onRemove:c,className:G(j6.root,g&&j6.interactive,d&&j6.selected,_&&j6.withRemoveButton,r),style:{...i,"--issue-label-background":h.light.background,"--issue-label-foreground":h.light.foreground,"--issue-label-border":h.light.border,"--issue-label-ring":h.light.ring,"--issue-label-background-hover":h.light.backgroundHover,"--issue-label-dark-background":h.dark.background,"--issue-label-dark-foreground":h.dark.foreground,"--issue-label-dark-border":h.dark.border,"--issue-label-dark-ring":h.dark.ring,"--issue-label-dark-background-hover":h.dark.backgroundHover},"data-component":`IssueLabelToken`,"data-has-remove-button":_?``:void 0,...v?{}:y,...m,children:[(0,q.jsxs)(g6,{interactive:v,...v?y:{},children:[a,c?(0,q.jsx)(`span`,{className:j6.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,q.jsx)(p6,{size:o,isParentInteractive:g,onClick:b}):null]})}M6.displayName=`IssueLabelToken`;var N6=K(M6);const P6={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function F6(e,t){let{as:n=`a`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(P6.root,P6.interactive,P6.hover,r),"data-component":`TopicTag`,...i})}F6.displayName=`TopicTag`;var I6=K(F6);const L6={root:`topic-tag-group`};function R6(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(L6.root,r),"data-component":`TopicTag.Group`,...i})}R6.displayName=`TopicTag.Group`;var z6=K(R6);const B6=Object.assign(I6,{Group:z6}),V6=(0,l.createContext)(null),H6=(0,l.createContext)(null),U6=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,W6=e=>e!==null&&e.effect===void 0,G6=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function K6(e){let{steps:t,step:n,defaultStep:r=null,onStepChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,onStatusChange:c,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=e,_=Y(h),v=`${_}-title`,y=`${_}-description`,b=l.useRef(null),x=a!==void 0,[S,C]=l.useState(o),w=x?a:S,T=n!==void 0,[E,D]=l.useState(r),O=T?n:E,k=t.length,A=t.findIndex(e=>e.id===O),j=A===-1?null:t[A],M=l.useCallback(e=>{T||D(e),i?.({stepId:e,stepIndex:t.findIndex(t=>t.id===e),count:t.length})},[T,i,t]),N=l.useCallback(e=>{x||C(e),s?.(e)},[x,s]),P=l.useCallback(e=>{let n=e??t[0]?.id??null;M(n),N(!0),c?.({status:`started`})},[N,M,c,t]),F=l.useCallback(e=>{t.some(t=>t.id===e)&&M(e)},[M,t]),I=l.useCallback(()=>{M(null),N(!1)},[N,M]),L=l.useCallback(()=>{I(),c?.({status:`dismissed`})},[I,c]),ee=l.useCallback(()=>{let e=t[A+1];if(!e){I(),c?.({status:`completed`});return}M(e.id)},[M,I,c,A,t]),R=l.useCallback(()=>{let e=A>0?t[A-1]:void 0;e&&M(e.id)},[M,A,t]),[z,te]=l.useState(()=>({stepId:O,ready:W6(j),patch:null}));z.stepId!==O&&te({stepId:O,ready:W6(j),patch:null});let ne=z.stepId===O?z:null,B=ne?.ready??W6(j),re=ne?.patch??null,V=l.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ie=U6(V),ae=l.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});rr(()=>{ae.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let oe=l.useMemo(()=>({next:()=>ae.current.next(),prev:()=>ae.current.prev(),goto:e=>ae.current.goto(e),dismiss:()=>ae.current.dismiss(),show:()=>te(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>te(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>ae.current.step?.target?.()??null}),[O]);l.useEffect(()=>{if(w)return ae.current.step?.effect?.(oe)??void 0},[oe,w]);let se=l.useCallback(()=>ae.current.step?.target?.()??null,[]),[ce,le]=l.useState(null),ue=l.useCallback(()=>{let e=se();if(!e){le(null);return}let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect(),a={top:t,left:n,width:r,height:i};le(e=>e&&G6(e,a)?e:a)},[se]);rr(()=>{if(!w||!B){le(null);return}ue();let e=se();e?.scrollIntoView?.({block:`center`,inline:`nearest`});let t=new ResizeObserver(ue);return e&&t.observe(e),window.addEventListener(`resize`,ue),window.addEventListener(`scroll`,ue,!0),()=>{t.disconnect(),window.removeEventListener(`resize`,ue),window.removeEventListener(`scroll`,ue,!0)}},[se,ue,w,B,O]),Hi(e=>{!w||!d||(e.preventDefault(),L())}),l.useEffect(()=>{if(!w||!B||!u)return;let e=e=>{e.defaultPrevented||(e.key===`ArrowRight`?(e.preventDefault(),ee()):e.key===`ArrowLeft`&&(e.preventDefault(),R()))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u,ee,w,R,B]),l.useEffect(()=>{if(!w||!B||!f)return;let e=e=>{if(e instanceof MouseEvent&&e.button>0)return;let{target:t}=e;t instanceof Node&&(b.current?.contains(t)||se()?.contains(t)||L())};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,L,se,w,B]),l.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let de=l.useMemo(()=>({open:w,step:V,stepIndex:A,steps:t,start:P,next:ee,prev:R,goto:F,dismiss:L,progressText:`${A+1} of ${k}`,progressPercent:k===0?0:(A+1)/k*100,hasNext:A>-1&&A<k-1,hasPrev:A>0}),[k,L,F,ee,w,R,P,V,A,t]),fe=l.useMemo(()=>({...de,titleId:v,descriptionId:y,stepType:ie,ready:B,targetRect:ce,getTarget:se,spotlightOffset:p,spotlightRadius:m,contentRef:b}),[de,y,se,B,p,m,ie,ce,v]);return(0,q.jsx)(V6.Provider,{value:fe,children:g})}K6.displayName=`Tour`;const q6=[];function J6(e){let t=l.useContext(V6);return(0,q.jsx)(q.Fragment,{children:e.children(t?.step?.actions??q6)})}J6.displayName=`Tour.Actions`;const Y6={root:`tour-action-trigger`};function X6(e,t){let{action:n,className:r,children:i,onClick:a,variant:o=`default`,...s}=e,c=l.useContext(V6);return c?(0,q.jsx)(pi,{ref:t,variant:o,className:G(Y6.root,r),onClick:e=>{if(a?.(e),!e.defaultPrevented){if(typeof n.action==`function`){n.action(c);return}n.action===`next`?c.next():n.action===`prev`?c.prev():c.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof n.action==`string`?n.action:`custom`,...s,children:i??n.label}):null}X6.displayName=`Tour.ActionTrigger`;var Z6=K(X6);const Q6={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},$6={top:{start:`-left`,center:``,end:`-right`},bottom:{start:`-left`,center:``,end:`-right`},left:{start:`-top`,center:``,end:`-bottom`},right:{start:`-top`,center:``,end:`-bottom`}};function e8(e,t){let n=l.useContext(V6),r=l.useContext(H6);if(!n||!r||n.stepType!==`tooltip`||n.step?.arrow===!1)return null;let i=Q6[r.side],a=`${i}${$6[i][r.align]}`;return(0,q.jsx)(nd,{ref:t,location:a,"data-component":`Tour.Arrow`,...e})}e8.displayName=`Tour.Arrow`;var t8=K(e8);const n8=W([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function r8(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(V6);if(!o||!o.open||!o.ready||o.step?.backdrop===!1)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,q.jsx)(ea,{containerName:i,children:(0,q.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:G(n8({spotlit:s!==null}),n),style:{...r,"--tour-target-top":`${(s?.top??0)-c}px`,"--tour-target-left":`${(s?.left??0)-c}px`,"--tour-target-width":`${(s?.width??0)+c*2}px`,"--tour-target-height":`${(s?.height??0)+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":s?``:void 0,...a})})}r8.displayName=`Tour.Backdrop`;var i8=K(r8);const a8={root:`tour-close-trigger`};function o8(e,t){let{className:n,icon:r=un,onClick:i,"aria-label":a=`Close tour`,...o}=e,s=l.useContext(V6);return s?(0,q.jsx)(gi,{ref:t,icon:r,variant:`invisible`,size:`small`,"aria-label":a,className:G(a8.root,n),onClick:e=>{i?.(e),!e.defaultPrevented&&s.dismiss()},"data-component":`Tour.CloseTrigger`,...o}):null}o8.displayName=`Tour.CloseTrigger`;var s8=K(o8);const c8={root:`tour-content`};function l8(e,t){let{className:n,...r}=e,i=l.useContext(V6),a=ar(t,i?.contentRef??null),o=i?.step?.id??null,s=i?.ready??!1,c=i?.contentRef;return l.useEffect(()=>{!s||!o||c?.current?.focus()},[c,s,o]),!i||!i.open||!i.ready||!i.step?null:(0,q.jsx)(`div`,{ref:a,role:`dialog`,"aria-labelledby":i.step.title?i.titleId:void 0,"aria-describedby":i.step.description?i.descriptionId:void 0,tabIndex:-1,className:G(c8.root,n),"data-component":`Tour.Content`,"data-type":i.stepType,"data-step":i.step.id,...r})}l8.displayName=`Tour.Content`;var u8=K(l8);const d8={root:`tour-control`};function f8(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(d8.root,n),"data-component":`Tour.Control`,...r})}f8.displayName=`Tour.Control`;var p8=K(f8);const m8={root:`tour-description`};function h8(e,t){let{className:n,children:r,...i}=e,a=l.useContext(V6);return a?(0,q.jsx)(`div`,{ref:t,id:a.descriptionId,className:G(m8.root,n),"data-component":`Tour.Description`,...i,children:r??a.step?.description}):null}h8.displayName=`Tour.Description`;var g8=K(h8);const _8=W([`tour-positioner`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short motion-safe:data-[side=outside-bottom]:slide-in-from-top-2 motion-safe:data-[side=outside-top]:slide-in-from-bottom-2 motion-safe:data-[side=outside-right]:slide-in-from-left-2 motion-safe:data-[side=outside-left]:slide-in-from-right-2`],{variants:{type:{dialog:`tour-positioner-dialog`,tooltip:`tour-positioner-tooltip`,floating:`tour-positioner-floating`},unplaced:{true:`invisible`,false:``}}}),v8=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function y8(e,t){let{side:n=`outside-bottom`,align:r=`center`,placement:i=`bottom-end`,portalContainerName:a,className:o,style:s,children:c,...u}=e,d=l.useContext(V6),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??n,g=f?.align??r,_=f?.placement??i,v=!!(d?.open&&d.ready&&f),y=l.useRef(null),b=ar(t,y),x=l.useRef(null),[S,C]=l.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=l.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=aa(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&v8(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return rr(()=>{if(!v||!m){x.current=null,C(null);return}E();let e=new ResizeObserver(E);return y.current&&e.observe(y.current),()=>{e.disconnect()}},[m,v,d?.targetRect,E]),!d||!v?null:(0,q.jsx)(ea,{containerName:a,children:(0,q.jsx)(`div`,{ref:b,className:G(_8({type:p,unplaced:m&&!S}),o),style:{...s,"--tour-positioner-top":`${S?.top??0}px`,"--tour-positioner-left":`${S?.left??0}px`},"data-component":`Tour.Positioner`,"data-type":p,"data-side":S?.anchorSide??h,"data-align":S?.anchorAlign??g,"data-placement":p===`floating`?_:void 0,...u,children:(0,q.jsx)(H6.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:c})})})}y8.displayName=`Tour.Positioner`;var b8=K(y8);const x8={root:`tour-progress-text`};function S8(e,t){let{className:n,children:r,...i}=e,a=l.useContext(V6);return a?(0,q.jsx)(`div`,{ref:t,className:G(x8.root,n),"data-component":`Tour.ProgressText`,...i,children:r??a.progressText}):null}S8.displayName=`Tour.ProgressText`;var C8=K(S8);const w8={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function T8(e,t){let{className:n,style:r,portalContainerName:i,...a}=e,o=l.useContext(V6);if(!o||!o.open||!o.ready||!o.targetRect)return null;let{targetRect:s,spotlightOffset:c,spotlightRadius:u}=o;return(0,q.jsx)(ea,{containerName:i,children:(0,q.jsx)(`div`,{ref:t,"aria-hidden":`true`,className:G(w8.root,n),style:{...r,"--tour-target-top":`${s.top-c}px`,"--tour-target-left":`${s.left-c}px`,"--tour-target-width":`${s.width+c*2}px`,"--tour-target-height":`${s.height+c*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...a})})}T8.displayName=`Tour.Spotlight`;var E8=K(T8);const D8={root:`tour-title`};function O8(e,t){let{className:n,children:r,...i}=e,a=l.useContext(V6);return a?(0,q.jsx)(`h2`,{ref:t,id:a.titleId,className:G(D8.root,n),"data-component":`Tour.Title`,...i,children:r??a.step?.title}):null}O8.displayName=`Tour.Title`;var k8=K(O8);const A8=()=>{let e=(0,l.useContext)(V6);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},j8=(e,{timeout:t=1e4}={})=>{let n=null,r=!1,i=()=>{r=!0,n!==null&&(cancelAnimationFrame(n),n=null)};return[new Promise(a=>{let o=Date.now()+t,s=()=>{if(r)return;let t=e();if(t){i(),a(t);return}if(Date.now()>=o){i(),a(null);return}n=requestAnimationFrame(s)};s()}),i]},M8=(e,t,n={})=>{let{predicate:r,...i}=n,a=()=>{};return[new Promise(n=>{let o=e?.();if(!o){n(null);return}let s=e=>{r&&!r(o)||(a(),n(e))};o.addEventListener(t,s,i),a=()=>o.removeEventListener(t,s,i)}),()=>a()]},N8=(e,t)=>j8(e,t),P8=(e,t,n)=>j8(()=>{let n=e();return n&&n.value===t?n:null},n),F8=Object.assign(K6,{Backdrop:i8,Spotlight:E8,Positioner:b8,Content:u8,Arrow:t8,CloseTrigger:s8,ProgressText:C8,Title:k8,Description:g8,Control:p8,Actions:J6,ActionTrigger:Z6}),I8={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function L8(e,t){let{as:n=`div`,className:r,title:i,maxWidth:a=125,inline:o,expandable:s,style:c,...l}=e;return(0,q.jsx)(n,{ref:t,title:i,className:G(I8.root,o?I8.inline:I8.block,s&&I8.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}L8.displayName=`Truncate`;var R8=K(L8);const z8=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=(0,l.useState)(e),[a,o]=(0,l.useState)(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},B8=(0,l.createContext)({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),V8=()=>(0,l.useContext)(B8),H8=(e,t)=>{let{colorScheme:n}=V8();return(n?e[n]:void 0)??t},U8=`(prefers-color-scheme: dark)`,W8=e=>{let t=window?.matchMedia?.(U8);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},G8=()=>window?.matchMedia?.(U8)?.matches?`night`:`day`,K8=()=>`day`,q8=()=>l.useSyncExternalStore(W8,G8,K8),J8=(e,t)=>e===`auto`?t:e,Y8=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function X8({children:e,className:t,contextOnly:n,...r}){let{colorMode:i,dayScheme:a,nightScheme:o}=V8(),[s,c]=z8(r.colorMode??i??`day`),[u,d]=z8(r.dayScheme??a??`light`),[f,p]=z8(r.nightScheme??o??`dark`),m=q8(),h=J8(s,m),g=Y8(h,u,f),_=l.useMemo(()=>({colorScheme:g,colorMode:s,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:c,setDayScheme:d,setNightScheme:p}),[g,s,h,u,f,c,d,p]);return n?(0,q.jsx)(B8.Provider,{value:_,children:e}):(0,q.jsx)(B8.Provider,{value:_,children:(0,q.jsx)(`div`,{className:t,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":s,children:e})})}X8.displayName=`ThemeProvider`,exports.ARROW_KEY_STEP=3,exports.AUTO_LOCALE=`auto`,exports.Accordion=ur,exports.AccordionContext=Dt,exports.AccordionHeader=Yn,exports.AccordionItem=Qn,exports.AccordionItemContext=Kn,exports.AccordionPanel=lr,exports.ActionBar=qa,exports.ActionBarButton=Ka,exports.ActionBarContext=ya,exports.ActionBarDivider=wa,exports.ActionBarGroup=Da,exports.ActionBarIconButton=Aa,exports.ActionBarItemContext=ba,exports.ActionBarMenu=Fa,exports.ActionList=ji,exports.ActionListContainerContext=Ar,exports.ActionListContext=Er,exports.ActionListDescription=Rr,exports.ActionListDivider=Br,exports.ActionListGroup=Yr,exports.ActionListGroupContext=Vr,exports.ActionListGroupHeading=Kr,exports.ActionListHeading=kr,exports.ActionListItem=Oi,exports.ActionListItemContext=Ir,exports.ActionListLeadingVisual=ni,exports.ActionListLinkItem=Ai,exports.ActionListSubItem=ri,exports.ActionListTrailingAction=yi,exports.ActionListTrailingVisual=bi,exports.ActionMenu=ma,exports.ActionMenuAnchor=Ni,exports.ActionMenuButton=Pi,exports.ActionMenuContext=Mi,exports.ActionMenuOverlay=pa,exports.Alert=Xa,exports.AnchoredOverlay=da,exports.AspectRatio=$a,exports.Attachment=ko,exports.AttachmentAction=oo,exports.AttachmentActions=lo,exports.AttachmentContent=po,exports.AttachmentContext=eo,exports.AttachmentDescription=go,exports.AttachmentGroup=yo,exports.AttachmentMedia=So,exports.AttachmentTitle=To,exports.AttachmentTrigger=Oo,exports.Autocomplete=cs,exports.AutocompleteContext=Ao,exports.AutocompleteDeferredInputContext=Mo,exports.AutocompleteInput=Zo,exports.AutocompleteInputContext=jo,exports.AutocompleteMenu=rs,exports.AutocompleteOverlay=ss,exports.Avatar=ec,exports.AvatarContext=us,exports.AvatarFallback=Xs,exports.AvatarImage=$s,exports.AvatarStack=lc,exports.Badge=mc,exports.Banner=Ic,exports.BannerContext=hc,exports.BannerDescription=_c,exports.BannerPrimaryAction=Nc,exports.BannerSecondaryAction=Fc,exports.BannerTitle=bc,exports.Blankslate=al,exports.BlankslateDescription=Hc,exports.BlankslateHeading=Gc,exports.BlankslatePrimaryAction=Xc,exports.BlankslateSecondaryAction=tl,exports.BlankslateVisual=il,exports.Blockquote=cl,exports.Box=dl,exports.Breadcrumbs=Sl,exports.BreadcrumbsContext=pl,exports.BreadcrumbsItem=xl,exports.Bubble=Rl,exports.BubbleContent=jl,exports.BubbleContext=wl,exports.BubbleGroup=Pl,exports.BubbleGroupContext=Tl,exports.BubbleReactions=Ll,exports.Button=pi,exports.ButtonGroup=Gl,exports.CHART_COLORS=Pd,exports.CHART_OVERFLOW_COLOR=Nd,exports.CHART_SERIES_COLORS=Md,exports.Calendar=Tu,exports.CalendarDay=Jl,exports.Card=Zu,exports.CardAction=Ou,exports.CardDescription=Mu,exports.CardHeading=Fu,exports.CardIcon=Ru,exports.CardImage=Vu,exports.CardMetadata=Wu,exports.Caret=nd,exports.Carousel=Td,exports.CarouselContext=id,exports.CarouselControls=_d,exports.CarouselIndicators=cd,exports.CarouselNextButton=ud,exports.CarouselPlayButton=fd,exports.CarouselPreviousButton=md,exports.CarouselSlide=bd,exports.CarouselSlideContext=ad,exports.Chart=Jd,exports.ChartContext=Ed,exports.ChartGradient=jd,exports.ChartLegend=Hd,exports.ChartRadialText=Gd,exports.ChartTooltip=qd,exports.Checkbox=$d,exports.CheckboxCard=hf,exports.CheckboxCardContext=ef,exports.CheckboxCardDescription=rf,exports.CheckboxCardLabel=sf,exports.CheckboxCardLeadingVisual=uf,exports.CheckboxGroup=jf,exports.CheckboxGroupCaption=vf,exports.CheckboxGroupContext=Yd,exports.CheckboxGroupLabel=xf,exports.CheckboxGroupValidation=Ef,exports.Clipboard=lp,exports.ClipboardContext=Mf,exports.ClipboardControl=Hf,exports.ClipboardCopyText=Gf,exports.ClipboardIndicator=Jf,exports.ClipboardInput=$f,exports.ClipboardLabel=np,exports.ClipboardTrigger=ap,exports.ClipboardValueText=cp,exports.Code=fp,exports.CodeBlock=Fp,exports.CodeBlockCode=wp,exports.CodeBlockContent=Op,exports.CodeBlockContext=pp,exports.CodeBlockHeader=jp,exports.CodeBlockTitle=Pp,exports.Collapsible=Kp,exports.CollapsibleContent=Hp,exports.CollapsiblePanel=Hp,exports.CollapsibleContext=Ip,exports.CollapsibleTrigger=Gp,exports.Combobox=Gm,exports.ComboboxClearTrigger=tm,exports.ComboboxContent=im,exports.ComboboxContext=qp,exports.ComboboxControl=sm,exports.ComboboxEmpty=um,exports.ComboboxInput=hm,exports.ComboboxItem=ym,exports.ComboboxItemContext=Yp,exports.ComboboxItemGroup=Sm,exports.ComboboxItemGroupContext=Jp,exports.ComboboxItemGroupLabel=Tm,exports.ComboboxItemIndicator=Om,exports.ComboboxItemText=jm,exports.ComboboxLabel=Pm,exports.ComboboxList=Lm,exports.ComboboxPositioner=Vm,exports.ComboboxTrigger=Wm,exports.CommandPalette=kh,exports.CommandPaletteContext=Ym,exports.CommandPaletteDialog=sh,exports.CommandPaletteEmpty=uh,exports.CommandPaletteGroup=ph,exports.CommandPaletteGroupContext=Xm,exports.CommandPaletteInput=gh,exports.CommandPaletteItem=yh,exports.CommandPaletteList=Sh,exports.CommandPaletteLoading=Th,exports.CommandPaletteSeparator=Oh,exports.ConfirmationDialog=fg,exports.ContextMenu=Sg,exports.ContextMenuContext=hg,exports.ContextMenuOverlay=yg,exports.ContextMenuTrigger=xg,exports.CounterLabel=si,exports.DAYS_IN_WEEK=7,exports.DAY_KEY_FORMAT=au,exports.DEFAULT_AVATAR_SIZE=20,exports.DEFAULT_COLOR_MODE=`day`,exports.DEFAULT_CURRENT_STEP=1,exports.DEFAULT_DIRECTION=`ltr`,exports.DEFAULT_FLOATING_PANEL_MIN_SIZE=fb,exports.DEFAULT_FLOATING_PANEL_POSITION=db,exports.DEFAULT_FLOATING_PANEL_SIZE=ub,exports.DEFAULT_ISSUE_LABEL_FILL_COLOR=C6,exports.DEFAULT_LOCALE=ms,exports.DEFAULT_MAP_LATITUDE=NG,exports.DEFAULT_MAP_LONGITUDE=PG,exports.DEFAULT_MAP_ZOOM=16,exports.DEFAULT_MARKDOWN_NAMESPACE=UG,exports.DEFAULT_MARKER_COLOR=hB,exports.DEFAULT_MARQUEE_SPEED=50,exports.DEFAULT_MAX_PREVIEW_ITEMS=5,exports.DEFAULT_RATING_COUNT=5,exports.DEFAULT_RELATIVE_TIME_PREFIX=`on`,exports.DEFAULT_RELATIVE_TIME_THRESHOLD=LQ,exports.DEFAULT_RICH_TEXT_EDITOR_CONTROLS=O$,exports.DEFAULT_RICH_TEXT_EDITOR_NAMESPACE=v$,exports.DEFAULT_SORT_DIRECTION=`ASC`,exports.DEFAULT_SPOTLIGHT_OFFSET=4,exports.DEFAULT_SPOTLIGHT_RADIUS=8,exports.DEFAULT_TABLE_OF_CONTENTS_ROOT_MARGIN=R2,exports.DEFAULT_TABLE_PAGE_SIZE=25,exports.DEFAULT_TABLE_SKELETON_ROWS=10,exports.DEFAULT_TEXTAREA_COLS=30,exports.DEFAULT_TEXTAREA_RESIZE=uS,exports.DEFAULT_TEXTAREA_ROWS=7,exports.DEFAULT_TIMER_INTERVAL=s3,exports.DEFAULT_TOKEN_SIZE=c6,exports.DEFAULT_TRUNCATE_MAX_WIDTH=125,exports.DataTable=G_,exports.DatePicker=X_,exports.Details=rv,exports.DetailsSummary=nv,exports.Dialog=iv,exports.DialogBody=Fh,exports.DialogButtons=Lh,exports.DialogCloseButton=zh,exports.DialogContext=Ih,exports.DialogFooter=Hh,exports.DialogHeader=Gh,exports.DialogSubtitle=Jh,exports.DialogTitle=Zh,exports.DirectionContext=Is,exports.DirectionProvider=eE,exports.DragHandle=lY,exports.Drawer=kv,exports.DrawerBody=sv,exports.DrawerCloseButton=dv,exports.DrawerContext=cv,exports.DrawerFooter=mv,exports.DrawerHeader=_v,exports.DrawerSubtitle=bv,exports.DrawerTitle=Cv,exports.Em=Mv,exports.EmptyState=Lv,exports.FLOATING_PANEL_LARGE_STEP=40,exports.FLOATING_PANEL_STEP=8,exports.FRAME_ROOT_CLASS=HS,exports.FileUpload=yy,exports.FileUploadContext=Uv,exports.FileUploadDescription=Kv,exports.FileUploadIcon=Yv,exports.FileUploadItem=vy,exports.FileUploadLabel=Qv,exports.FileUploadList=ty,exports.FilteredActionList=lb,exports.FilteredActionListBodyLoader=ib,exports.FilteredActionListInput=Gy,exports.FilteredActionListItem=Jy,exports.FloatingPanel=ax,exports.FloatingPanelBody=Eb,exports.FloatingPanelCloseTrigger=Ob,exports.FloatingPanelContent=Mb,exports.FloatingPanelContext=xb,exports.FloatingPanelControl=Fb,exports.FloatingPanelDragTrigger=Rb,exports.FloatingPanelHeader=Vb,exports.FloatingPanelPositioner=Wb,exports.FloatingPanelResizeTrigger=Yb,exports.FloatingPanelStageTrigger=Qb,exports.FloatingPanelTitle=tx,exports.FloatingPanelTrigger=ix,exports.Flow=Px,exports.FlowContext=dx,exports.FlowList=mx,exports.FlowNode=_x,exports.FlowParallel=bx,exports.FormControl=FS,exports.FormControlCaption=vS,exports.FormControlContext=Yf,exports.FormControlLabel=xS,exports.FormControlLeadingVisual=wS,exports.FormControlValidation=kS,exports.FormatByte=LS,exports.FormatNumber=zS,exports.Frame=KS,exports.Header=nC,exports.HeaderItem=QS,exports.HeaderLink=tC,exports.Heading=Tr,exports.Hidden=aC,exports.Highlight=fC,exports.HoverCard=xC,exports.HoverCardContent=gC,exports.HoverCardContext=pC,exports.HoverCardTrigger=_C,exports.IconButton=gi,exports.Image=wC,exports.InlineMessage=AC,exports.IssueLabelToken=N6,exports.JSONTreeView=JT,exports.JSONTreeViewContext=yT,exports.KeybindingHint=Pw,exports.Label=ZT,exports.LabelGroup=cE,exports.LayerCard=yE,exports.LayerCardPrimary=dE,exports.LayerCardSecondary=mE,exports.Link=$c,exports.LinkButton=xE,exports.List=OE,exports.ListItem=DE,exports.LocaleContext=Ls,exports.LocaleProvider=Hs,exports.MARKDOWN_NODES=WG,exports.MARKDOWN_TRANSFORMERS=GG,exports.Map=zG,exports.MapAttributionControl=yU,exports.MapDragRotateAndZoomInteraction=lG,exports.MapDrawControl=tG,exports.MapFullScreenControl=OU,exports.MapGraticuleLayer=FB,exports.MapHeatmapLayer=pU,exports.MapImageLayer=NB,exports.MapLayerGroup=OB,exports.MapLayersControl=iG,exports.MapLinkInteraction=jG,exports.MapMarker=SB,exports.MapMousePositionControl=LU,exports.MapOverlay=wB,exports.MapOverviewMapControl=VU,exports.MapPointerInteraction=mG,exports.MapScaleLineControl=NU,exports.MapSearchControl=oG,exports.MapSelectInteraction=wG,exports.MapTileLayer=kB,exports.MapTranslateInteraction=pG,exports.MapVectorLayer=PB,exports.MapView=cB,exports.MapWebGLTileLayer=gU,exports.Mark=cC,exports.Markdown=JG,exports.Marquee=mK,exports.MarqueeContent=iK,exports.MarqueeContext=YG,exports.MarqueeEdge=sK,exports.MarqueeItem=uK,exports.MarqueeViewport=pK,exports.Message=PK,exports.MessageAvatar=xK,exports.MessageContent=wK,exports.MessageContext=Cl,exports.MessageFooter=DK,exports.MessageGroup=AK,exports.MessageGroupContext=hK,exports.MessageHeader=NK,exports.Meter=iq,exports.MeterContext=zK,exports.MeterIndicator=HK,exports.MeterLabel=GK,exports.MeterTrack=JK,exports.MeterValue=ZK,exports.NativeSelect=lq,exports.NativeSelectOptGroup=oq,exports.NativeSelectOption=cq,exports.NavigationList=zq,exports.NavigationListGroup=xq,exports.NavigationListGroupExpand=Fq,exports.NavigationListGroupHeading=Rq,exports.NavigationListHeading=dq,exports.NavigationListItem=Mq,exports.NavigationListSubNavigation=Oq,exports.NavigationMenu=NJ,exports.NavigationMenuContent=tJ,exports.NavigationMenuContext=Hq,exports.NavigationMenuDepthContext=Kq,exports.NavigationMenuDescription=rJ,exports.NavigationMenuDivider=aJ,exports.NavigationMenuGroup=uJ,exports.NavigationMenuGroupHeading=sJ,exports.NavigationMenuHeading=Vq,exports.NavigationMenuHeadingLevelContext=Gq,exports.NavigationMenuItem=pJ,exports.NavigationMenuItemContext=Uq,exports.NavigationMenuLeadingVisual=gJ,exports.NavigationMenuLink=TJ,exports.NavigationMenuLinkContext=Wq,exports.NavigationMenuList=kJ,exports.NavigationMenuSubNavigation=yJ,exports.NavigationMenuTrailingVisual=xJ,exports.NavigationMenuTrigger=MJ,exports.NumberInput=LJ,exports.OverflowObserverContext=ha,exports.OverflowObserverProvider=ga,exports.PINInput=KY,exports.PageLayout=kY,exports.PageLayoutContent=TY,exports.PageLayoutContext=zJ,exports.PageLayoutFooter=GJ,exports.PageLayoutHeader=JJ,exports.PageLayoutPane=OY,exports.PageLayoutSidebar=gY,exports.Pagination=LY,exports.PasswordInput=BY,exports.Placeholder=YY,exports.PlatformContext=Sw,exports.Popover=iX,exports.PopoverContent=rX,exports.PopoverContext=XY,exports.Portal=ea,exports.PortalContext=Gi,exports.ProgressBar=my,exports.ProgressBarItem=uy,exports.ProgressCircle=cX,exports.QRCode=KZ,exports.RICH_TEXT_EDITOR_NODES=y$,exports.Radio=Hx,exports.RadioCard=sQ,exports.RadioCardContext=qZ,exports.RadioCardDescription=XZ,exports.RadioCardLabel=$Z,exports.RadioCardLeadingVisual=nQ,exports.RadioGroup=SQ,exports.RadioGroupCaption=uQ,exports.RadioGroupContext=zx,exports.RadioGroupLabel=pQ,exports.RadioGroupValidation=vQ,exports.Rating=kQ,exports.RelativeTime=e$,exports.Resizable=g$,exports.ResizablePanel=o$,exports.ResizableResizeTrigger=l$,exports.ResizableResizeTriggerIndicator=f$,exports.ResizableResizeTriggerSeparator=h$,exports.RichTextEditor=P$,exports.RichTextEditorContent=D$,exports.RichTextEditorToolbar=N$,exports.SCREEN_READER_DELAY=500,exports.ScrollableRegion=Mh,exports.SegmentedControl=Z$,exports.SegmentedControlButton=z$,exports.SegmentedControlIconButton=V$,exports.Select=Q$,exports.SelectContext=Ux,exports.SelectOptGroup=qx,exports.SelectOptGroupContext=Wx,exports.SelectOption=Zx,exports.SelectPanel=k1,exports.SelectPanelButton=e1,exports.SelectPanelContext=t1,exports.SelectPanelFooter=i1,exports.SelectPanelHeader=d1,exports.SelectPanelLoading=S1,exports.SelectPanelMessage=T1,exports.SelectPanelSearchInput=s1,exports.SelectPanelSecondaryAction=O1,exports.Separator=M1,exports.SkeletonAvatar=Kw,exports.SkeletonBox=g_,exports.SkeletonText=y_,exports.Slider=I1,exports.Spinner=$r,exports.Stack=tb,exports.StackItem=eb,exports.StateLabel=U1,exports.StatisticCard=p0,exports.StatisticCardContext=W1,exports.StatisticCardDescription=q1,exports.StatisticCardLabel=X1,exports.StatisticCardTrailingVisual=$1,exports.StatisticCardTrend=o0,exports.StatisticCardValue=l0,exports.Status=S0,exports.StatusIndicator=x0,exports.Steps=K0,exports.StepsBody=j0,exports.StepsDescription=P0,exports.StepsIndicator=R0,exports.StepsItem=H0,exports.StepsItemContext=C0,exports.StepsTitle=G0,exports.Strong=Y0,exports.Swap=r2,exports.SwapContext=X0,exports.SwapIndicator=n2,exports.Switch=T2,exports.SwitchContext=i2,exports.SwitchControl=h2,exports.SwitchHiddenInput=v2,exports.SwitchLabel=x2,exports.SwitchRootProvider=l2,exports.SwitchThumb=w2,exports.Tab=x4,exports.TabList=E4,exports.TabPanel=k4,exports.Table=q_,exports.TableActions=kg,exports.TableBody=Pg,exports.TableCell=Lg,exports.TableCellPlaceholder=Bg,exports.TableContainer=Ug,exports.TableDivider=Kg,exports.TableErrorDialog=Jg,exports.TableHead=Xg,exports.TableHeader=$g,exports.TableOfContents=p4,exports.TableOfContentsContent=q2,exports.TableOfContentsContext=E2,exports.TableOfContentsIndicator=Z2,exports.TableOfContentsItem=e4,exports.TableOfContentsItemContext=O2,exports.TableOfContentsLink=r4,exports.TableOfContentsList=o4,exports.TableOfContentsNav=l4,exports.TableOfContentsTitle=f4,exports.TablePagination=d_,exports.TableRow=p_,exports.TableSkeleton=S_,exports.TableSortHeader=T_,exports.TableSubtitle=O_,exports.TableTitle=j_,exports.Tabs=A4,exports.TabsContext=m4,exports.Text=Io,exports.TextInput=qo,exports.TextInputAction=Ko,exports.Textarea=hS,exports.ThemeContext=B8,exports.ThemeProvider=X8,exports.Timeline=e3,exports.TimelineActions=L4,exports.TimelineAvatar=B4,exports.TimelineBadge=W4,exports.TimelineBody=q4,exports.TimelineBreak=X4,exports.TimelineItem=$4,exports.Timer=A3,exports.TimerActionTrigger=_3,exports.TimerArea=b3,exports.TimerContext=t3,exports.TimerControl=C3,exports.TimerItem=E3,exports.TimerSeparator=k3,exports.Toaster=o6,exports.Token=S6,exports.TokenBase=d6,exports.TokenRemoveButton=p6,exports.TokenText=g6,exports.Tooltip=lT,exports.TooltipContext=eT,exports.TopicTag=B6,exports.TopicTagGroup=z6,exports.Tour=F8,exports.TourActionTrigger=Z6,exports.TourActions=J6,exports.TourArrow=t8,exports.TourBackdrop=i8,exports.TourCloseTrigger=s8,exports.TourContent=u8,exports.TourContext=V6,exports.TourControl=p8,exports.TourDescription=g8,exports.TourPositioner=b8,exports.TourPositionerContext=H6,exports.TourProgressText=C8,exports.TourSpotlight=E8,exports.TourTitle=k8,exports.TreeView=vT,exports.TreeViewDirectoryIcon=aw,exports.TreeViewErrorDialog=sw,exports.TreeViewItem=_T,exports.TreeViewItemContext=MC,exports.TreeViewLeadingAction=Uw,exports.TreeViewLeadingVisual=Ww,exports.TreeViewRootContext=jC,exports.TreeViewSubTree=$w,exports.TreeViewTrailingVisual=fT,exports.Truncate=R8,exports.buildPaginationModel=e_,exports.buildPaginationPageData=t_,exports.clampToRange=IK,exports.commandScore=Jm,exports.computeEdges=Ox,exports.computeFlowRect=kx,exports.computePositions=Cx,exports.connectorPath=sx,exports.copyText=Ff,exports.createColumnHelper=K_,exports.defaultPaneWidth=XJ,exports.entryIds=wx,exports.exitIds=Tx,exports.extendRange=yu,exports.formatFileSize=Bv,exports.formatMeterValue=$K,exports.formatRelativeTime=ZQ,exports.formatTime=a3,exports.formatTitle=XQ,exports.getAccessibleKeybindingHintString=xw,exports.getAddress=fB,exports.getAnchoredPosition=aa,exports.getCharacterCount=Lo,exports.getFirstDayOfWeek=du,exports.getIssueLabelColors=A6,exports.getLonLat=pB,exports.getMonthWeeks=mu,exports.getPlatform=Tw,exports.getProp=Ld,exports.getRangePosition=vu,exports.getSeriesColor=Fd,exports.getWeekdays=fu,exports.isDateSelectable=hu,exports.isDateWithinRange=_u,exports.isFileAccepted=Vv,exports.isTokenInteractive=l6,exports.markdownTheme=KG,exports.nodeIds=Ex,exports.parseDate=bu,exports.registerPortalRoot=Xi,exports.richTextEditorTheme=b$,exports.scrollToHeading=j2,exports.sortStrategies=L_,exports.splitHighlightChunks=uC,exports.splitTime=i3,exports.startOfWeek=pu,exports.stepValue=LK,exports.toDayKey=cu,exports.toJSONNodes=NT,exports.toValueTokens=BT,exports.toast=q3,exports.transitionSortDirection=M_,exports.triageFiles=Hv,exports.updateAriaValues=nY,exports.useAnnouncements=ab,exports.useChart=Bd,exports.useChartContext=Dd,exports.useClipboard=If,exports.useClipboardContext=Nf,exports.useClippedChildren=rE,exports.useCollator=Us,exports.useColorSchemeVar=H8,exports.useConfirm=mg,exports.useDateFormatter=Ws,exports.useDirection=QT,exports.useFilter=Gs,exports.useFloatingPanelContext=Sb,exports.useFormControlForwardedProps=Xf,exports.useIsRtl=$T,exports.useJSONTreeViewContext=bT,exports.useLocaleContext=Rs,exports.useMap=sB,exports.useMarquee=ZG,exports.useMarqueeContext=XG,exports.useNumberFormatter=Ks,exports.useOverflowObserver=_a,exports.usePaneWidth=pY,exports.usePlatform=Dw,exports.useStepsItem=F0,exports.useSwitch=u2,exports.useSwitchContext=a2,exports.useTab=v4,exports.useTabList=C4,exports.useTabPanel=D4,exports.useTableOfContents=V2,exports.useTableOfContentsContext=D2,exports.useTableOfContentsItemContext=k2,exports.useTabs=_4,exports.useTheme=V8,exports.useTimer=u3,exports.useTimerContext=n3,exports.useTour=A8,exports.valueToPercent=QK,exports.waitForElement=N8,exports.waitForElementValue=P8,exports.waitForEvent=M8;
|