@gamecrafters/base-ui 0.0.28 → 0.0.29
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/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.esm.js
CHANGED
|
@@ -799,4 +799,4 @@ ${this.fragmentDiscardExpression_?` if (${this.fragmentDiscardExpression_}) { d
|
|
|
799
799
|
gl_FragColor = color;
|
|
800
800
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
801
801
|
gl_FragColor *= ${gB.TRANSITION_ALPHA};
|
|
802
|
-
}`,uniforms:o,paletteTextures:i.paletteTextures}}var iH=class extends vR{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(bI.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&&!AO(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,rH(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 yB(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()}};iH.prototype.dispose;function aH({name:e,...t}){return gz(()=>new iH(t),e),null}aH.displayName=`MapWebGLTileLayer`;const oH=t=>{let n=XR(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addControl(i),()=>{n.removeControl(i)}},[n,i]),i},sH=(t,n,r)=>{let i=e.useRef(null);if(!i.current){let e=document.createElement(`div`);e.setAttribute(`data-component`,t),i.current=e}let a=i.current;return oH(()=>new VI({element:a,target:r})),e.useEffect(()=>{a.className=G(`ol-unselectable ol-control`,n)},[a,n]),a};function cH(e){return oH(()=>new HI(e)),null}cH.displayName=`MapAttributionControl`;const lH=[`fullscreenchange`,`webkitfullscreenchange`],uH={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var dH=class extends VI{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(TT.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(fH(t)){if(pH(t))gH(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?hH(n):mH(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=pH(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(FA(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(uH.ENTERFULLSCREEN)):(FA(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(uH.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(LI.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(LI.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)wT(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();fH(n)?this.element.classList.remove(Nj):this.element.classList.add(Nj);for(let t=0,r=lH.length;t<r;++t)e.push(ST(n,lH[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function fH(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function pH(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function mH(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function hH(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():mH(e)}function gH(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function _H(e){return oH(()=>new dH(e)),null}_H.displayName=`MapFullScreenControl`;const vH=`units`,yH=[1,2,5],bH=25.4/.28;var xH=class extends VI{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(vH,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(vH)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(vH,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=CO(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||bH)/bH,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||bH)/bH,c=o*a,l=``;if(r==`degrees`){let e=wD.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=yH[(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=CO(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||bH;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function SH(e){return oH(()=>new xH(e)),null}SH.displayName=`MapScaleLineControl`;const CH=`projection`,wH=`coordinateFormat`;var TH=class extends VI{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(CH,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(wH)}getProjection(){return this.get(CH)}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(ST(t,PI.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(ST(t,PI.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(wH,e)}setProjection(e){this.set(CH,SO(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?jO(this.mapProjection_,e):yO}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=FO();e&&(this.transform_=jO(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&xD(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 EH(e){return oH(()=>new TH(e)),null}EH.displayName=`MapMousePositionControl`;const DH=.75,OH=.1;var kH=class extends VI{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(TT.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new LL({view:e.view,controls:new XT,interactions:new XT});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 BL({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(ST(e,yT.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===LI.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===LI.TARGET||e.key===LI.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new pI({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(tI.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(tI.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_&&hE(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(ME(r)),s=t.getPixelFromCoordinateInternal(wE(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*OH||l<d*OH||c>u*DH||l>d*DH?this.resetExtent_():sE(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();RE(r,1/(2**(Math.log(DH/OH)/Math.LN2/2)*OH)),i.fitInternal(lA(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_||=CT(this.ovmap_,II.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(Pj),this.collapsed_?FA(this.collapseLabel_,this.label_):FA(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 AH(e){return oH(()=>new kH(e)),null}AH.displayName=`MapOverviewMapControl`;var jH=class e extends pk{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 dE(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(FE(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||xE(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=Dk(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(sk(n,0,n.length,r,e,t,n)),this.changed()}};jH.prototype.transform;var MH=class e extends fk{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(wT),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(ST(e[t],TT.CHANGE,this.changed,this))}clone(){let t=new e(NH(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<aE(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){fE(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)_E(e,t[n].getExtent());return e}getGeometries(){return NH(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||=TE(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(NH(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 NH(e){return e.map(e=>e.clone())}function PH(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function FH(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 IH={index:-1,endIndex:NaN,closestTargetDistance:1/0};function LH(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=WH(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=FH(l.coordinates,c);yD(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=HH(e,n,r);HH(e,n,r-t)<i&&(c-=t)}else{let i=HH(e,n,r);HH(e,n,r+t)<i&&(c+=t)}}return IH.index=s,IH.endIndex=c,IH.closestTargetDistance=o,IH}function RH(e,t){let n=[];for(let r=0;r<t.length;++r)zH(e,t[r].getGeometry(),n);return n}function zH(e,t,n){if(t instanceof qA){BH(e,t.getCoordinates(),!1,n);return}if(t instanceof DM){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)BH(e,r[t],!1,n);return}if(t instanceof cA){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)BH(e,r[t],!0,n);return}if(t instanceof AM){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)BH(e,i[t],!0,n)}return}if(t instanceof MH){let r=t.getGeometries();for(let t=0;t<r.length;++t)zH(e,r[t],n);return}}function BH(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=WH(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 VH(e,t){return KE(e[0],e[1],t[0],t[1])}function HH(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 VH(FH(e,r),FH(e,i));let s=0;if(r<a){let t=FH(e,r),n=PH(e,a);s+=VH(t,n)}if(o<i){let t=PH(e,o),n=FH(e,i);s+=VH(t,n)}for(let t=a;t<o-1;++t){let n=PH(e,t),r=PH(e,t+1);s+=VH(n,r)}return s}const UH={along:0,squaredDistance:0};function WH(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=WE(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),UH.along=u,UH.squaredDistance=QE(KE(e,t,d,f),10),UH}const GH={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var KH=class extends BT{constructor(e,t){super(e),this.feature=t}},qH=class extends fL{constructor(e){let t=e;t.stopDown||=IT,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_=YH(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:FT,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 jH([NaN,NaN]),i=LO(e[0],n),a=vD(i,LO(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=FO();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=Qk:e===`LineString`?t=qA:e===`Polygon`&&(t=cA),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 DI({source:new nN({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:JH(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:oL,this.freehandCondition_,this.freehandCondition_=e.freehand?nL:e.freehandCondition?e.freehandCondition:cL,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(KI.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?nL:e:iL,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?nL:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:cL}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===TT.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===NI.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===NI.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===NI.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===NI.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===NI.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===NI.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===NI.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 MI(NI.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=tE([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=RH(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(PH(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(PH(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&yD(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=LH(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=FH(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 QT(new Qk(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new QT;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new qA(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=hk(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 QT(new qA(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new QT,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new KH(GH.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=hk(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 OM([t])):this.type_===`MultiLineString`?e.setGeometry(new DM([t])):this.type_===`MultiPolygon`&&e.setGeometry(new AM([t])),this.dispatchEvent(new KH(GH.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 KH(GH.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 QT(new Qk(n)),this.updateSketchFeatures_(),this.dispatchEvent(new KH(GH.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 JH(){let e=hN();return function(t,n){return e[t.getGeometry().getType()]}}function YH(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 XH=[0,0,0,0],ZH=[],QH={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function $H(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 eU=class extends BT{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},tU=class extends fL{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:dL,this.defaultDeleteCondition_=function(e){return QI(e)&&aL(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:nL,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new ZM,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new DI({source:new nN({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:aU(),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:hD,!(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(vT.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(vT.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(eN.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(eN.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(yT.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?nL:e:iL,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 XT;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 eU(QH.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(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(yT.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(yT.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(tE(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(tE(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(tE(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(tE(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(pE(n),r);let o=t,s=FO();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=uA(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 QT(new Qk(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==NI.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=NI.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==NI.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=tE([r]),a=this.rBush_.getInExtent(i),o={};a.sort(nU);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=iU(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&&yD(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=LH(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=FH(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=tE([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=RH(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||NT(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();$H(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(PH(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(PH(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();$H(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=yD(LO(t.getCenter(),n),LO(e,n)),i=FO();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];yD(pD(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(pE(n),a);let s=t,c=FO();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=uA(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(tE(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 eU(QH.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 rU(e,t,r)-rU(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 Qk(IO(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof QT&&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=RO(rE(zO(pE(e,XH),r),t.getView().getResolution()*this.pixelTolerance_,XH),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=iU(e,s,r),u=t.getPixelFromCoordinate(l),d=yD(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=vD(u,e),o=vD(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(tE(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(tE(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?IO(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(tE([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=LO(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=NI.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new eU(QH.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(tE(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(tE([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?LO(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||NT(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(vT.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(vT.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(yT.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(eN.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(eN.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(yT.PROPERTYCHANGE,this.handleFeatureChange_)}}};function nU(e,t){return e.index-t.index}function rU(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=FO();t&&(i=i.clone().transform(t,n));let r=vD(i.getCenter(),LO(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=LO(e,n);return ZH[0]=LO(t.segment[0],n),ZH[1]=LO(t.segment[1],n),bD(i,ZH)}function iU(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=FO();return i&&(t=t.clone().transform(i,n)),IO(t.getClosestPoint(LO(e,n)),n)}let i=LO(e,n);return ZH[0]=LO(t.segment[0],n),ZH[1]=LO(t.segment[1],n),IO(pD(i,ZH),n)}function aU(){let e=hN();return function(t,n){return e.Point}}const oU={SNAP:`snap`,UNSNAP:`unsnap`};var sU=class extends BT{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const cU={Circle(e,t){let n=e,r=FO();r&&(n=n.clone().transform(r,t));let i=uA(n);return r&&i.transform(t,r),cU.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 lU(e){return e.feature?e.feature:e.element?e.element:null}const uU=[],dU=[],fU=[];var pU=class extends fL{constructor(e){e||={},super({handleDownEvent:FT,stopDown:IT}),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 ZM,this.snapped_=null,this.segmenters_=Object.assign({},cU,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(uE());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];dU[t]=tE(n),fU[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=dU[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!FE(r,dU[o]))continue;let s=zk(n,t);if(!s)continue;let c=[s];dU[a]=tE(c),fU[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(dU[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=zk(n,r);if(!i)continue;let s=[i];dU[a]=tE(s),fU[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(dU[0],fU[0]):(dU.length=a,fU.length=a,this.rBush_.load(dU,fU))}}t&&(this.featureChangeListenerKeys_[n]&&wT(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=ST(e,TT.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 sU(oU.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new sU(oU.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new sU(oU.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=lU(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=lU(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);bT(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&&(wT(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(wT),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(wT),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(ST(this.features_,vT.ADD,this.handleFeatureAdd_,this),ST(this.features_,vT.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(ST(this.source_,eN.ADDFEATURE,this.handleFeatureAdd_,this),ST(this.source_,eN.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=LO(t,r),a=RO(rE(tE([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 vD(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=vD(i,LO(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=FO();a&&(e=e.clone().transform(a,r)),t=fD(i,e)}else{let[e,a]=n.segment;a&&(uU[0]=LO(e,r),uU[1]=LO(a,r),t=pD(i,uU))}if(t){let e=vD(i,t);e<l&&(c=IO(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)}},mU=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=QT,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?SO(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=SO(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 WT()}readFeature(e,t){return WT()}readFeatures(e,t){return WT()}readGeometry(e,t){return WT()}readProjection(e){return WT()}writeFeature(e,t){return WT()}writeFeatures(e,t){return WT()}writeGeometry(e,t){return WT()}};function hU(e,t,n){let r=n?SO(n.featureProjection):null,i=n?SO(n.dataProjection):null,a=e;if(r&&i&&!AO(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(NO(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 gU={Point:Qk,LineString:qA,Polygon:cA,MultiPoint:OM,MultiLineString:DM,MultiPolygon:AM};function _U(e,t,n){return Array.isArray(t[0])?(iA(e,0,t,n)||(e=e.slice(),oA(e,0,t,n)),e):(rA(e,0,t,n)||(e=e.slice(),aA(e,0,t,n)),e)}function vU(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>vU({...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 hU(new MM(r,r===`Polygon`?_U(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function yU(e,t){if(!e)return null;if(Array.isArray(e))return new MH(e.map(e=>yU(e,t)));let n=gU[e.type];return hU(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var bU=class extends mU{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(xU(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(xU(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return WT()}readFeaturesFromObject(e,t){return WT()}readGeometry(e,t){return this.readGeometryFromObject(xU(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return WT()}readProjection(e){return this.readProjectionFromObject(xU(e))}readProjectionFromObject(e){return WT()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return WT()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return WT()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return WT()}};function xU(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var SU=class extends bU{constructor(e){e||={},super(),this.dataProjection=SO(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=SO(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=CU(n.geometry,t);if(this.featureClass===MM)return vU({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(yU(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 wU(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=SO(t.properties.name);else if(t.type===`EPSG`)n=SO(`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=MU(a,t),delete i[e.getGeometryName()]),xT(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 MU(e,this.adaptOptions(t))}};function CU(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=EU(e);break;case`LineString`:n=DU(e);break;case`Polygon`:n=jU(e);break;case`MultiPoint`:n=kU(e);break;case`MultiLineString`:n=OU(e);break;case`MultiPolygon`:n=AU(e);break;case`GeometryCollection`:n=TU(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function wU(e,t){return yU(CU(e,t),t)}function TU(e,t){return e.geometries.map(function(e){return CU(e,t)})}function EU(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:mk(t.length)}}function DU(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:mk(t[0]?.length||2)}}function OU(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:kk(r,0,t,n),layout:mk(n)}}function kU(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:mk(t[0]?.length||2)}}function AU(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:Ak(n,0,t,r),layout:mk(r)}}function jU(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:kk(n,0,t,r),layout:mk(r)}}function MU(e,t){e=hU(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=RU(e,t);break;case`LineString`:r=PU(e,t);break;case`Polygon`:r=zU(e,t);break;case`MultiPoint`:r=IU(e,t);break;case`MultiLineString`:r=FU(e,t);break;case`MultiPolygon`:r=LU(e,t);break;case`GeometryCollection`:r=NU(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function NU(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return MU(e,t)})}}function PU(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function FU(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function IU(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function LU(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function RU(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function zU(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const BU={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},VU={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},HU={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},UU=[{shape:`Point`,label:`Draw a point`,Icon:$n},{shape:`LineString`,label:`Draw a line`,Icon:mr},{shape:`Circle`,label:`Draw a circle`,Icon:Qn}];function WU({target:t,className:n,fileName:r=`react-openlayers-geojson.json`}){let i=XR(),a=sH(`MapDrawControl`,G(BU.root,n),t),[o,s]=e.useState(!1),[c,l]=e.useState(null),u=e.useRef(null),d=e.useRef(null);if(!u.current){let e=new nN;u.current={source:e,layer:new DI({source:e,style:VU,properties:{key:`drawLayer`}}),modify:new tU({source:e})}}let f=u.current,p=e.useCallback(()=>{let e=f.source.getFeatures(),t=new SU().writeFeaturesObject(e,HU),n=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=r,a.click(),URL.revokeObjectURL(i)},[f,r]);e.useEffect(()=>{if(!(!i||!o))return i.addLayer(f.layer),i.addInteraction(f.modify),()=>{i.removeInteraction(f.modify),i.removeLayer(f.layer)}},[i,o,f]),e.useEffect(()=>{if(!i||!o||!c)return;let e=c===`LineString`?new qH({source:f.source,type:c,maxPoints:2}):new qH({source:f.source,type:c}),t=new pU({source:f.source});return d.current=e,i.addInteraction(e),i.addInteraction(t),()=>{i.removeInteraction(t),i.removeInteraction(e),d.current=null}},[i,o,c,f]),e.useEffect(()=>{if(!i||!o)return;let e=i.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?d.current?.abortDrawing():e.shiftKey&&e.key===`S`&&p()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,o,p]);let h=()=>{s(e=>!e),l(null)},g=e=>{l(t=>t===e?null:e)};return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:BU.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":o,onClick:h,children:(0,q.jsx)(Cr,{size:12})}),o?(0,q.jsxs)(`div`,{className:BU.shapes,children:[UU.map(({shape:e,label:t,Icon:n})=>(0,q.jsx)(`button`,{type:`button`,className:BU.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":c===e,onClick:()=>g(e),children:(0,q.jsx)(n,{size:12})},e)),(0,q.jsx)(`button`,{type:`button`,className:BU.shape,title:`Move and reshape what has been drawn`,"aria-pressed":c===null,onClick:()=>g(null),children:(0,q.jsx)(In,{size:12})})]}):null]}),a)}WU.displayName=`MapDrawControl`;const GU={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},KU=(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 jL?KU(e.getLayers().getArray(),`${r}.`):[]}});function qU({target:t,className:n}){let r=XR(),i=sH(`MapLayersControl`,G(GU.root,n),t),[a,o]=e.useState(!1),[s,c]=e.useState(0),l=e.useMemo(()=>r&&a?KU(r.getLayers().getArray(),``):[],[r,a,s]),u=(e,t)=>{e.setVisible(t),c(e=>e+1)},d=e=>(0,q.jsx)(`ul`,{className:GU.list,children:e.map(e=>(0,q.jsxs)(`li`,{className:GU.item,children:[(0,q.jsxs)(`label`,{className:GU.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?d(e.children):null]},e.key))});return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:GU.toggle,title:`Click here to switch layers`,"aria-expanded":a,onClick:()=>o(e=>!e),children:(0,q.jsx)(pr,{size:24})}),a?(0,q.jsx)(`div`,{className:GU.layers,children:d(l)}):null]}),i)}qU.displayName=`MapLayersControl`;const JU={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function YU({target:t,className:n,zoom:r=18,color:i=iz,placeholder:a=`Search for a place`}){let o=XR(),s=sH(`MapSearchControl`,G(JU.root,n),t),[c,l]=e.useState(!1),[u,d]=e.useState(``);return m((0,q.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!o||!u)return;let[t]=await nz(u,1);if(!t)return;let n=[Number(t.lon),Number(t.lat)];sz(o,n,i).set(`address`,t.display_name),o.getView().setCenter(OO(n)),o.getView().setZoom(r)},children:[(0,q.jsx)(`button`,{type:`button`,className:JU.toggle,title:a,"aria-expanded":c,onClick:()=>l(e=>!e),children:(0,q.jsx)(Sr,{size:24})}),c?(0,q.jsx)(`input`,{type:`search`,className:JU.input,value:u,placeholder:a,"aria-label":a,autoComplete:`off`,onChange:e=>d(e.target.value)}):null]}),s)}YU.displayName=`MapSearchControl`;const XU=t=>{let n=XR(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addInteraction(i),()=>{n.removeInteraction(i)}},[n,i]),i};var ZU=class extends fL{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:cL,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!uL(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(!uL(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 uL(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function QU(e){return XU(()=>new ZU(e)),null}QU.displayName=`MapDragRotateAndZoomInteraction`;const $U={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var eW=class extends BT{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},tW=class extends fL{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=FT;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:FT,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:nL,this.lastFeature_=null,this.addChangeListener(KI.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 XT([this.lastFeature_]);return this.dispatchEvent(new eW($U.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 XT([this.lastFeature_]);return this.dispatchEvent(new eW($U.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=LO(t,n),i=LO(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new XT([this.lastFeature_]),c=FO();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 eW($U.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 QT)||!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 nW(e){return XU(()=>new tW(e)),null}nW.displayName=`MapTranslateInteraction`;function rW(t){let n=e.useRef(null),r=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return t instanceof QT&&(n.current={feature:t,coordinate:e.coordinate},!0)},i=e=>{let t=n.current;if(!t)return;let r=t.feature.getGeometry();r&&(r.translate(e.coordinate[0]-t.coordinate[0],e.coordinate[1]-t.coordinate[1]),t.coordinate=e.coordinate)},a=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},o=()=>(n.current=null,!1);return XU(()=>new fL({handleDownEvent:r,handleDragEvent:i,handleMoveEvent:a,handleUpEvent:o,...t})),null}rW.displayName=`MapPointerInteraction`;const iW={SELECT:`select`};var aW=class extends BT{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const oW={};var sW=class e extends qI{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:aL,this.addCondition_=e.addCondition?e.addCondition:iL,this.removeCondition_=e.removeCondition?e.removeCondition:iL,this.toggleCondition_=e.toggleCondition?e.toggleCondition:cL,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:FT,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?cW():e.style,this.features_=e.features||new XT;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=FT;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(vT.ADD,this.boundAddFeature_),this.features_.addEventListener(vT.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(vT.ADD,this.boundAddFeature_),this.features_.removeEventListener(vT.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 DI&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in oW||(oW[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(oW[r]),delete oW[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 aW(iW.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 aW(iW.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 aW(iW.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 QT)||!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 QT)||!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 aW(iW.SELECT,c,s,e)),!0}};function cW(){let e=hN();return MT(e.Polygon,e.LineString),MT(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const lW=`#ff0000`,uW=`rgba(255, 0, 0, 0.4)`,dW=e=>new _N({text:e,font:`12px Calibri,sans-serif`,fill:new rN({color:`#000`}),stroke:new iN({color:`#fff`,width:3}),offsetY:-10}),fW=e=>{let t=e.getGeometry();if(!(t instanceof fk))return;let n=t.getType();if(n===`Point`)return new dN({image:new uN({radius:6,fill:new rN({color:uW}),stroke:new iN({color:lW,width:2})})});if(n===`LineString`){let e=new dN({stroke:new iN({color:lW,width:3})}),n=iD(t)/1e3;return n>0&&e.setText(dW(`Length: ${n.toFixed(2)} km`)),e}let r=new dN({fill:new rN({color:uW}),stroke:new iN({color:lW,width:2})});try{let e=oD(t)/1e6;e>0&&r.setText(dW(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function pW({onSelect:t,style:n=fW,...r}){let i=XR(),a=XU(()=>new sW({...r,style:n})),o=e.useRef(t);return e.useEffect(()=>{o.current=t},[t]),e.useEffect(()=>{let e=a.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&o.current?.(e)});return()=>UT(e)},[a]),e.useEffect(()=>{if(!i)return;let e=i.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=a.getFeatures();t.forEach(e=>{a.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,a]),null}pW.displayName=`MapSelectInteraction`;function mW(e){return QE(e,5)}function hW(e){return parseFloat(e)}function gW(e){return mW(e).toString()}function _W(e,t){return!isNaN(e)&&e!==hW(gW(t))}function vW(e,t){return _W(e[0],t[0])||_W(e[1],t[1])}var yW=class extends qI{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(ST(e,II.MOVEEND,this.updateUrl_,this),ST(e.getLayerGroup(),TT.CHANGE,this.updateUrl_,this),ST(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)wT(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=hW(this.get_(e,`z`));`z`in this.params_&&_W(a,n.getZoom())&&(r=!0,i.zoom=a);let o=hW(this.get_(e,`r`));`r`in this.params_&&_W(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[hW(this.get_(e,`x`)),hW(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&vW(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`,gW(n[0])),this.set_(c,`y`,gW(n[1])),this.set_(c,`z`,gW(r)),this.set_(c,`r`,gW(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 bW(e){return XU(()=>new yW(e)),null}bW.displayName=`MapLinkInteraction`;const xW={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},SW=37.7649804,CW=-122.4323829,wW=16,TW=[];function EW({latitude:t,longitude:n,zoom:r,marker:i,markerColor:a,markerLabel:o}){let s=XR(),c=e.useRef(!1);return e.useEffect(()=>{if(!s)return;let e=s.getView(),i=OO([n,t]);if(c.current){e.animate({center:i,zoom:r,duration:500});return}c.current=!0,e.setCenter(i),e.setZoom(r)},[s,t,n,r]),e.useEffect(()=>{if(!s||!i)return;let e=sz(s,[n,t],a,o);return()=>cz(s,e)},[s,t,n,i,a,o]),null}EW.displayName=`MapLocation`;function DW(t,n){let{latitude:r=SW,longitude:i=CW,zoom:a=16,width:o,height:s,controls:c=TW,marker:l=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=t,y=Y(f),b=e.useRef(null),x=Be(n,b),S=e.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=xW.toolbar,S.current=e}let C=S.current;e.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,q.jsx)(SH,{},e);case`fullScreen`:return(0,q.jsx)(_H,{target:C,source:y},e);case`search`:return(0,q.jsx)(YU,{target:C},e);case`layers`:return(0,q.jsx)(qU,{target:C},e);case`draw`:return(0,q.jsx)(WU,{target:C},e)}};return(0,q.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:G(xW.root,p),style:{...m,"--map-width":typeof o==`number`?`${o}px`:o,"--map-height":typeof s==`number`?`${s}px`:s},"data-component":`Map`,...v,children:(0,q.jsxs)(YR,{className:xW.surface,keyboardEventTarget:y,children:[(0,q.jsx)(EW,{latitude:r,longitude:i,zoom:a,marker:l,markerColor:u,markerLabel:d}),c.map(T),h]})})}DW.displayName=`Map`;var OW=K(DW);const kW=Object.assign(OW,{View:ZR,Marker:dz,Overlay:pz,LayerGroup:_z,TileLayer:vz,ImageLayer:Sz,VectorLayer:Cz,GraticuleLayer:wz,HeatmapLayer:nH,WebGLTileLayer:aH,AttributionControl:cH,DrawControl:WU,FullScreenControl:_H,LayersControl:qU,MousePositionControl:EH,OverviewMapControl:AH,ScaleLineControl:SH,SearchControl:YU,DragRotateAndZoomInteraction:QU,LinkInteraction:bW,PointerInteraction:rW,SelectInteraction:pW,TranslateInteraction:nW}),AW={root:`markdown`};function jW(t,n){let{className:r,source:i,transformers:a,preserveNewLines:o=!1,...s}=t,[c]=w(),l=e.useCallback(e=>{c.setRootElement(e)},[c]),u=Be(n,l);return Ea(()=>{c.update(()=>{x(i,a,void 0,o)},{discrete:!0})},[c,i,a,o]),(0,q.jsx)(`div`,{ref:u,className:G(AW.root,r),"data-component":`Markdown`,...s})}jW.displayName=`MarkdownProse`;var MW=K(jW);const NW=`Markdown`,PW=[z,ne,F,P,k,E,T],FW=[S,...C],IW={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 LW(e,t){let{className:n,children:r=``,transformers:i=FW,preserveNewLines:a=!1,namespace:o=NW,onError:s,...c}=e;return(0,q.jsx)(b,{initialConfig:{namespace:o,theme:IW,nodes:PW,editable:!1,onError:s??(e=>{throw e})},children:(0,q.jsx)(MW,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}LW.displayName=`Markdown`;var RW=K(LW);const zW={slow:30,medium:60,fast:120},BW={start:`inline`,end:`inline`,top:`block`,bottom:`block`},VW=2,HW=({side:t=`start`,speed:n=`medium`}={})=>{let r=e.useRef(null),i=e.useRef(null),[a,o]=e.useState(0),[s,c]=e.useState(2),l=BW[t];Ea(()=>{let e=r.current,t=i.current;if(!e||!t)return;let n=()=>{let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=l===`inline`?n.width:n.height,a=l===`inline`?r.width:r.height;o(i),c(i>0?Math.max(2,Math.ceil(a/i)+1):2)};if(n(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(n);return a.observe(e),a.observe(t),()=>{a.disconnect()}},[l]);let u=a>0?a/zW[n]:0;return{rootRef:r,groupRef:i,axis:l,copies:s,distance:a,duration:u,style:{"--marquee-distance":`${a}px`,"--marquee-duration":`${u}s`}}},UW={track:`marquee-track`,group:`marquee-group`},WW=W(`marquee`,{variants:{side:{start:`marquee-inline`,end:`marquee-inline marquee-reversed`,top:`marquee-block`,bottom:`marquee-block marquee-reversed`},spacing:{none:`marquee-spacing-none`,tight:`marquee-spacing-tight`,condensed:`marquee-spacing-condensed`,cozy:`marquee-spacing-cozy`,normal:`marquee-spacing-normal`,spacious:`marquee-spacing-spacious`},pauseOnHover:{true:`marquee-pause-on-hover`,false:``},paused:{true:`marquee-paused`,false:``}}});function GW(e,t){let{className:n,children:r,style:i,side:a=`start`,speed:o=`medium`,spacing:s,pauseOnHover:c=!0,paused:l=!1,...u}=e,{rootRef:d,groupRef:f,axis:p,copies:m,style:h}=HW({side:a,speed:o}),g=Be(t,d);return(0,q.jsx)(`div`,{ref:g,className:G(WW({side:a,spacing:s,pauseOnHover:c,paused:l}),n),style:{...i,...h},"data-component":`Marquee`,"data-side":a,"data-axis":p,"data-speed":o,"data-spacing":s,"data-paused":l,...u,children:(0,q.jsx)(`div`,{className:UW.track,children:Array.from({length:m},(e,t)=>(0,q.jsx)(`div`,{ref:t===0?f:void 0,"aria-hidden":t!==0||void 0,className:UW.group,"data-component":`Marquee.Group`,children:r},t))})})}GW.displayName=`Marquee`;var KW=K(GW);const qW=n({}),JW=W(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function YW(t,n){let{as:r=`div`,className:i,align:a,...o}=t,{align:s}=e.useContext(qW),c=a??s??`start`,l={align:c};return(0,q.jsx)(lu.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G(JW({align:c}),i),"data-component":`Message`,"data-align":c,...o})})}YW.displayName=`Message`;var XW=K(YW);const ZW={root:`message-avatar`};function QW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(ZW.root,r),"data-component":`Message.Avatar`,...i})}QW.displayName=`Message.Avatar`;var $W=K(QW);const eG={root:`message-content`};function tG(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(eG.root,r),"data-component":`Message.Content`,...i})}tG.displayName=`Message.Content`;var nG=K(tG);const rG={root:`message-footer`};function iG(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(rG.root,r),"data-component":`Message.Footer`,...i})}iG.displayName=`Message.Footer`;var aG=K(iG);const oG={root:`message-group`};function sG(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,q.jsx)(qW.Provider,{value:{align:i},children:(0,q.jsx)(n,{ref:t,className:G(oG.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}sG.displayName=`Message.Group`;var cG=K(sG);const lG={root:`message-header`};function uG(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(lG.root,r),"data-component":`Message.Header`,...i})}uG.displayName=`Message.Header`;var dG=K(uG);const fG=Object.assign(XW,{Group:cG,Avatar:$W,Content:nG,Header:dG,Footer:aG}),pG=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},mG=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,hG=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return mG(r??0,r,i);let a=e+t*n,o=Math.max(pG(n),pG(e)),s=o===0?a:Number(a.toFixed(o));return mG(s,r,i)},gG=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},_G=n({}),vG={root:`meter-indicator`};function yG(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(vG.root,r),"data-component":`Meter.Indicator`,...i})}yG.displayName=`Meter.Indicator`;var bG=K(yG);const xG={root:`meter-label`};function SG(t,n){let{as:r=`span`,className:i,id:a,...o}=t,{labelId:s}=e.useContext(_G);return(0,q.jsx)(r,{ref:n,id:a??s,className:G(xG.root,i),"data-component":`Meter.Label`,...o})}SG.displayName=`Meter.Label`;var CG=K(SG);const wG={root:`meter-track`};function TG(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(wG.root,r),"data-component":`Meter.Track`,...i})}TG.displayName=`Meter.Track`;var EG=K(TG);const DG={root:`meter-value`};function OG(t,n){let{className:r,children:i,...a}=t,{formattedValue:o=``,value:s=0}=e.useContext(_G);return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(DG.root,r),"data-component":`Meter.Value`,...a,children:typeof i==`function`?i({formattedValue:o,value:s}):i??o})}OG.displayName=`Meter.Value`;var kG=K(OG);const AG=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,jG=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),MG={header:`meter-header`,hidden:`sr-only`},NG=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 PG(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]=si(f,{label:CG,value:kG,track:EG}),b=mG(Number.isNaN(a)?o:a,o,s),x=mG(AG(b,o,s),0,100),S=jG(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)(_G.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(NG({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:MG.header,children:[v.label,v.value]}):null,v.track??(0,q.jsx)(EG,{children:(0,q.jsx)(bG,{})}),y,(0,q.jsx)(`span`,{role:`presentation`,className:MG.hidden,children:`x`})]})})}PG.displayName=`Meter`;var FG=K(PG);const IG=Object.assign(FG,{Label:CG,Value:kG,Track:EG,Indicator:bG});function LG(e,t){return(0,q.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}LG.displayName=`NativeSelect.OptGroup`;var RG=K(LG);function zG(e,t){return(0,q.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}zG.displayName=`NativeSelect.Option`;var BG=K(zG);const VG=Object.assign(gS,{Option:BG,OptGroup:RG}),HG={root:`navigation-list-heading`,hidden:`sr-only`};function UG(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?HG.hidden:HG.root,r),"data-component":`NavigationList.Heading`,...i})}UG.displayName=`NavigationList.Heading`;const WG=e.createContext(null),GG=e.createContext({depth:0}),KG=e.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),qG=e=>Number.parseInt(e.slice(1),10),JG=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},YG={heading:UG},XG={container:`NavigationList`};function ZG(t,n){let{children:r,className:i,"aria-label":a,"aria-labelledby":o,...s}=t,[c,l]=si(r,YG),u=Y(),d=c.heading,f=d?d.props.id??u:void 0,p=d?qG(d.props.as??`h2`):null;return(0,q.jsx)(`nav`,{ref:n,"aria-label":a,"aria-labelledby":o??(a?void 0:f),className:G(i),"data-component":`NavigationList`,...s,children:(0,q.jsxs)(WG.Provider,{value:p,children:[d?e.cloneElement(d,{id:f}):null,(0,q.jsx)(gi.Provider,{value:XG,children:(0,q.jsx)(_a,{children:l})})]})})}ZG.displayName=`NavigationList`;var QG=e.forwardRef(ZG);function $G(t){let{title:n,children:r,hideDivider:i=!1,...a}=t,o=e.useContext(WG);return(0,q.jsxs)(q.Fragment,{children:[i?null:(0,q.jsx)(_a.Divider,{}),(0,q.jsxs)(_a.Group,{"data-component":`NavigationList.Group`,...a,children:[n?(0,q.jsx)(_a.GroupHeading,{as:JG(o),children:n}):null,r]})]})}$G.displayName=`NavigationList.Group`;const eK={chevron:`navigation-list-chevron`},tK={trailingVisual:_a.TrailingVisual},nK=t=>{if(!e.isValidElement(t))return!1;let n=t.props[`aria-current`];return n&&n!==`false`?!0:e.Children.toArray(t.props.children).some(nK)};function rK(t){let{children:n,subNavigation:r,defaultOpen:i,className:a}=t,o=Y(),s=Y(),c=e.useRef(null),l=e.useMemo(()=>nK(r),[r]),[u,d]=e.useState(i??l),[f,p]=e.useState(l);Ea(()=>{let e=l||!!c.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[l,r]);let m=e.useMemo(()=>({buttonId:o,subNavigationId:s,isOpen:u}),[o,s,u]),[h,g]=si(n,tK);return(0,q.jsx)(KG.Provider,{value:m,children:(0,q.jsxs)(_a.Item,{id:o,active:!u&&f,"aria-expanded":u,"aria-controls":s,onSelect:()=>d(e=>!e),className:a,"data-component":`NavigationList.Item`,children:[g,(0,q.jsxs)(_a.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,q.jsx)(qn,{className:eK.chevron})]}),(0,q.jsx)(_a.SubItem,{children:e.cloneElement(r,{ref:c})})]})})}rK.displayName=`NavigationList.ItemWithSubNavigation`;const iK={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function aK(t,n){let{className:r,children:i,...a}=t,{buttonId:o,subNavigationId:s,isOpen:c}=e.useContext(KG),{depth:l}=e.useContext(GG),u=e.useMemo(()=>({depth:l+1}),[l]);return!o||!s||l>=4?null:(0,q.jsx)(GG.Provider,{value:u,children:(0,q.jsx)(`ul`,{ref:n,id:s,hidden:!c,"aria-labelledby":o,className:G(iK.root,iK.items,r),"data-component":`NavigationList.SubNavigation`,"data-depth":l+1,...a,children:i})})}aK.displayName=`NavigationList.SubNavigation`;var oK=K(aK);const sK={subNavigation:oK},cK=_a.LinkItem;function lK(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=si(r,sK);return c.subNavigation?(0,q.jsx)(rK,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,q.jsx)(cK,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}lK.displayName=`NavigationList.Item`;var uK=K(lK);const dK=e=>typeof e==`string`||!g(e)?e:(0,q.jsx)(e,{});function fK(t,n){let{label:r=`Show more`,pages:i=0,items:a,renderItem:o,...s}=t,[c,l]=e.useState(0),u=Y(),d=a.length/i,f=i===0?a.length:Math.ceil(d*c),p=c===1?0:f-Math.floor(d);return Ea(()=>{c!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[c,u]),(0,q.jsxs)(q.Fragment,{children:[c>0?a.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:a,...s}=e,c=t===p?u:void 0;return o?o({...e,"data-expand-focus-target":c}):(0,q.jsxs)(uK,{"data-expand-focus-target":c,...s,children:[r?(0,q.jsx)(_a.LeadingVisual,{children:(0,q.jsx)(r,{})}):null,n,i?(0,q.jsx)(_a.TrailingVisual,{children:dK(i)}):null,a?(0,q.jsx)(_a.TrailingAction,{...a}):null]},e.id??t)}):null,c<i||c===0?(0,q.jsxs)(_a.Item,{ref:n,as:`button`,"aria-expanded":!1,onSelect:()=>l(e=>e+1),"data-component":`NavigationList.GroupExpand`,...s,children:[r,(0,q.jsx)(_a.TrailingVisual,{children:(0,q.jsx)(kn,{})})]}):null]})}fK.displayName=`NavigationList.GroupExpand`;var pK=e.forwardRef(fK);const mK={root:`navigation-list-group-heading`};function hK(t){let{as:n,className:r,...i}=t,a=e.useContext(WG);return(0,q.jsx)(_a.GroupHeading,{as:n??JG(a),className:G(mK.root,r),"data-component":`NavigationList.GroupHeading`,...i})}hK.displayName=`NavigationList.GroupHeading`;const gK=ai(hK,Oi),_K=Object.assign(QG,{Heading:UG,Item:uK,SubNavigation:oK,Group:$G,GroupHeading:gK,GroupExpand:pK,Description:wi,LeadingVisual:Hi,TrailingVisual:oa,TrailingAction:aa,Divider:Ei}),vK={root:`navigation-menu-heading`,hidden:`sr-only`};function yK(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?vK.hidden:vK.root,r),"data-component":`NavigationMenu.Heading`,...i})}yK.displayName=`NavigationMenu.Heading`;const bK=n({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),xK=n({value:``,triggerId:``,contentId:``,isOpen:!1}),SK=n({linkId:``,descriptionId:``}),CK=n(null),wK=n({depth:0}),TK=e=>Number.parseInt(e.slice(1),10),EK=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},DK={root:`navigation-menu`},OK={heading:yK};function kK(t,n){let{children:r,className:i,value:a,defaultValue:o=null,onValueChange:s,orientation:c=`horizontal`,openOn:l=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=t,g=e.useRef(null),_=Be(n,g),[v,y]=si(r,OK),b=Y(),x=v.heading,S=x?x.props.id??b:void 0,C=x?TK(x.props.as??`h2`):null,w=m??(p?void 0:S),T=a!==void 0,[E,D]=e.useState(o),O=T?a:E,k=e.useRef(s);Ea(()=>{k.current=s},[s]);let A=e.useRef(null),j=e.useRef(null),M=e.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);e.useEffect(()=>M,[M]);let N=e.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=e.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=e.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);ka(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),e.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=e.useMemo(()=>({openValue:O,setOpenValue:N,orientation:c,openOn:l,openAfterDelay:P,closeAfterDelay:F}),[O,N,c,l,P,F]);return(0,q.jsx)(bK.Provider,{value:L,children:(0,q.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:G(DK.root,i),"data-component":`NavigationMenu`,"data-orientation":c,...h,onBlur:I,children:(0,q.jsxs)(CK.Provider,{value:C,children:[x?e.cloneElement(x,{id:S}):null,y]})})})}kK.displayName=`NavigationMenu`;var AK=e.forwardRef(kK);const jK=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 MK(t,n){let{as:r=`div`,className:i,align:a=`start`,...o}=t,{orientation:s}=e.useContext(bK),{triggerId:c,contentId:l,isOpen:u}=e.useContext(xK);if(!l)return null;let d=s===`vertical`?void 0:a;return(0,q.jsx)(r,{ref:n,id:l,hidden:!u,"aria-labelledby":c,className:G(jK({open:u,align:d}),i),"data-component":`NavigationMenu.Content`,"data-orientation":s,"data-align":d,"data-open":u?``:void 0,...o})}MK.displayName=`NavigationMenu.Content`;var NK=K(MK);const PK={root:`navigation-menu-description`};function FK(t){let{className:n,...r}=t,{descriptionId:i}=e.useContext(SK);return(0,q.jsx)(`span`,{id:i,className:G(PK.root,n),"data-component":`NavigationMenu.Description`,...r})}FK.displayName=`NavigationMenu.Description`;const IK={root:`navigation-menu-divider`};function LK(e){let{className:t,...n}=e;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:G(IK.root,t),"data-component":`NavigationMenu.Divider`,...n})}LK.displayName=`NavigationMenu.Divider`;const RK={root:`navigation-menu-group-heading`};function zK(t){let{as:n,className:r,...i}=t,a=e.useContext(CK),o=n??EK(a);return(0,q.jsx)(o,{className:G(RK.root,r),"data-component":`NavigationMenu.GroupHeading`,...i})}zK.displayName=`NavigationMenu.GroupHeading`;const BK={root:`navigation-menu-group`},VK={groupHeading:zK};function HK(t){let{title:n,children:r,className:i,hideDivider:a=!1,...o}=t,s=Y(),[c,l]=si(r,VK),u=c.groupHeading??(n?(0,q.jsx)(zK,{children:n}):null),d=u?u.props.id??s:void 0;return(0,q.jsxs)(q.Fragment,{children:[a?null:(0,q.jsx)(LK,{}),(0,q.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:G(BK.root,i),"data-component":`NavigationMenu.Group`,...o,children:[u?e.cloneElement(u,{id:d}):null,l]})]})}HK.displayName=`NavigationMenu.Group`;const UK={root:`navigation-menu-item`};function WK(t,n){let{children:r,className:i,value:a,onPointerEnter:o,onPointerLeave:s,...c}=t,l=Y(),u=a??l,d=Y(),f=Y(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=e.useContext(bK),_=p===u,v=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{s?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=e.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,q.jsx)(xK.Provider,{value:b,children:(0,q.jsx)(`li`,{ref:n,className:G(UK.root,i),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...c,onPointerEnter:v,onPointerLeave:y,children:r})})}WK.displayName=`NavigationMenu.Item`;var GK=e.forwardRef(WK);const KK={root:`navigation-menu-visual`},qK=({className:e,...t})=>(0,q.jsx)(`span`,{className:G(KK.root,e),...t});function JK(e){return(0,q.jsx)(qK,{"data-component":`NavigationMenu.LeadingVisual`,...e})}JK.displayName=`NavigationMenu.LeadingVisual`;const YK={root:`navigation-menu-sub-navigation`};function XK(t,n){let{className:r,children:i,...a}=t,{linkId:o}=e.useContext(SK),{depth:s}=e.useContext(wK),c=e.useMemo(()=>({depth:s+1}),[s]);return!o||s>=4?null:(0,q.jsx)(wK.Provider,{value:c,children:(0,q.jsx)(`ul`,{ref:n,"aria-labelledby":o,className:G(YK.root,r),"data-component":`NavigationMenu.SubNavigation`,"data-depth":s+1,...a,children:i})})}XK.displayName=`NavigationMenu.SubNavigation`;var ZK=K(XK);const QK={root:`navigation-menu-visual-trailing`};function $K(e){let{className:t,...n}=e;return(0,q.jsx)(qK,{className:G(QK.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}$K.displayName=`NavigationMenu.TrailingVisual`;const eq={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},tq={leadingVisual:JK,trailingVisual:$K,description:FK,subNavigation:ZK};function nq(t,n){let{as:r=`a`,id:i,className:a,active:o,children:s,onClick:c,...l}=t,{setOpenValue:u}=e.useContext(bK),{depth:d}=e.useContext(wK),f=Y(i),p=Y(),[m,h]=si(s,tq),g=e.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{c?.(e),!e.defaultPrevented&&u(null)},v=(0,q.jsxs)(r,{ref:n,id:f,"aria-current":o?`page`:void 0,"aria-describedby":m.description?p:void 0,className:G(eq.root,o&&eq.active,a),"data-component":`NavigationMenu.Link`,"data-active":o?``:void 0,"data-has-description":m.description?``:void 0,...l,onClick:_,children:[m.leadingVisual,(0,q.jsxs)(`span`,{className:eq.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,q.jsxs)(SK.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,q.jsx)(`li`,{className:eq.item,children:y})}nq.displayName=`NavigationMenu.Link`;var rq=K(nq);const iq={root:`navigation-menu-list`},aq=(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 oq(t,n){let{children:r,className:i,onKeyDown:a,...o}=t,{orientation:s,openValue:c,setOpenValue:l}=e.useContext(bK),u=e.useRef(null),d=Be(n,u),f=e=>{a?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(c===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(),l(null);return}let o=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===i?-1:0;if(d===0&&!o)return;let f=aq(t,s),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&c!==null&&l(null),o){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(iq.root,i),"data-component":`NavigationMenu.List`,"data-orientation":s,...o,onKeyDown:f,children:r})}oq.displayName=`NavigationMenu.List`;var sq=e.forwardRef(oq);const cq={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function lq(t,n){let{children:r,className:i,onClick:a,onKeyDown:o,...s}=t,{setOpenValue:c,orientation:l}=e.useContext(bK),{value:u,triggerId:d,contentId:f,isOpen:p}=e.useContext(xK),m=e.useRef(!1);if(Ea(()=>{!p||!m.current||(m.current=!1,ei(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{a?.(e),!e.defaultPrevented&&c(p?null:u)},g=e=>{if(o?.(e),e.defaultPrevented)return;let t=l===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,c(u);return}ei(document.getElementById(f))[0]?.focus()}};return(0,q.jsxs)(`button`,{ref:n,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:G(cq.root,i),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...s,onClick:h,onKeyDown:g,children:[r,(0,q.jsx)(qn,{className:cq.chevron})]})}lq.displayName=`NavigationMenu.Trigger`;var uq=e.forwardRef(lq);const dq=Object.assign(AK,{Heading:yK,List:sq,Item:GK,Trigger:uq,Content:NK,Link:rq,SubNavigation:ZK,Group:HK,GroupHeading:zK,Description:FK,LeadingVisual:JK,TrailingVisual:$K,Divider:LK}),fq={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},pq=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,q.jsxs)(`span`,{className:fq.stepper,"data-component":`NumberInput.Stepper`,children:[(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:Xn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:fq.step,"data-component":`NumberInput.Increment`}),(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:qn,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:fq.step,"data-component":`NumberInput.Decrement`})]});function mq(t,n){let{className:r,value:i,defaultValue:a,min:o,max:s,step:c=1,disabled:l,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=t,g=e.useRef(null),_=Be(n,g),v=i!==void 0,[y,b]=e.useState(a??null),x=v?i:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(gG(e.target),e)},w=e=>{let t=hG(x,e,{step:c,min:o,max:s});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&s!==void 0&&x>=s,E=x!=null&&o!==void 0&&x<=o,D=!!l||!!u;return(0,q.jsx)(Fs,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:a,min:o,max:s,step:c,disabled:l,readOnly:u,onChange:C,className:G(fq.root,r),trailingAction:d?void 0:(0,q.jsx)(pq,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}mq.displayName=`NumberInput`;var hq=K(mq);const gq={current:null},_q=n({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:gq,contentWrapperRef:gq,sidebarRef:gq,sidebarContentWrapperRef:gq}),vq={root:`page-layout-horizontal-divider`};function yq(t,n){let{className:r,style:i,variant:a=`none`,position:o,...s}=t,{padding:c}=e.useContext(_q);return(0,q.jsx)(`div`,{ref:n,className:G(vq.root,r),style:{"--spacing-divider":`var(--page-layout-spacing-${c})`,...i},"data-component":`PageLayout.HorizontalDivider`,...Aa(`variant`,a),...Aa(`position`,o),...s})}yq.displayName=`PageLayout.HorizontalDivider`;var bq=K(yq);const xq={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function Sq(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(_q);return(0,q.jsxs)(`footer`,{ref:n,className:G(xq.root,xq.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Footer`,...Aa(`hidden`,c),...l,children:[(0,q.jsx)(bq,{variant:s,className:xq.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,q.jsx)(`div`,{className:xq.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a})]})}Sq.displayName=`PageLayout.Footer`;var Cq=K(Sq);const wq={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function Tq(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(_q);return(0,q.jsxs)(`header`,{ref:n,className:G(wq.root,wq.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Header`,...Aa(`hidden`,c),...l,children:[(0,q.jsx)(`div`,{className:wq.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a}),(0,q.jsx)(bq,{variant:s,className:wq.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}Tq.displayName=`PageLayout.Header`;var Eq=K(Tq);const Dq=1280,Oq=3,kq={small:256,medium:296,large:320},Aq=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,jq=e=>e===`small`||e===`medium`||e===`large`,Mq=e=>jq(e)?kq[e]:Aq(e)?parseInt(e.default,10):0,Nq=()=>Fe&&window.innerWidth>=1280?959:511,Pq=e=>`Pane width ${e} pixels`,Fq=(e,t,n=Pq)=>{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))))},Iq=({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`)},Lq=({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`)},Rq={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}},zq={root:`page-layout-drag-handle`},Bq=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,Vq=e=>e===`ArrowLeft`||e===`ArrowDown`;function Hq(t){let{className:n,handleRef:r,onDragStart:i,onDrag:a,onDragEnd:o,onDoubleClick:s,"aria-label":c,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=Pq}=t,g=e.useRef({onDragStart:i,onDrag:a,onDragEnd:o});e.useEffect(()=>{g.current={onDragStart:i,onDrag:a,onDragEnd:o}});let _=e.useRef(!1),v=e.useRef(null),y=e.useRef(null),b=e.useCallback(()=>{_.current||=(Iq({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[r,p,m]),x=e.useCallback(()=>{_.current&&=(Lq({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[r,p,m]);return e.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,q.jsx)(`div`,{ref:r,role:`slider`,tabIndex:0,"aria-label":l?void 0:c??`Draggable pane splitter`,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:G(zq.root,n),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=>{Bq(e.key)&&(e.preventDefault(),b(),g.current.onDrag(Vq(e.key)?-3:3,!0))},onKeyUp:e=>{Bq(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:s,"data-component":`PageLayout.DragHandle`})}Hq.displayName=`PageLayout.DragHandle`;const Uq={root:`page-layout-vertical-divider`};function Wq(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,q.jsx)(`div`,{ref:t,className:G(Uq.root,n),"data-component":`PageLayout.VerticalDivider`,...Aa(`variant`,r),...Aa(`position`,i),...a})}Wq.displayName=`PageLayout.VerticalDivider`;var Gq=K(Wq);const Kq=({width:t,minWidth:n,resizable:r,widthStorageKey:i,paneRef:a,handleRef:o,contentWrapperRef:s,constrainToViewport:c=!1,onResizeEnd:l,currentWidth:u,formatValueText:d})=>{let f=Aq(t),p=f?parseInt(t.min,10):n,m=f?parseInt(t.max,10):null,h=e.useMemo(()=>Mq(t),[t]),g=e.useRef(i),_=e.useRef(l),v=e.useRef(d);Ea(()=>{g.current=i,_.current=l,v.current=d});let y=e.useRef(c?256:511),b=e.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:c?Math.min(m,t):m},[m,p,c]),[x,S]=e.useState(()=>typeof u==`number`?u:l===void 0&&r===!0&&i!==void 0?Rq.get(i)??h:h),[C,w]=e.useState(h),[T,E]=e.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=e.useRef(O),[A,j]=e.useState(()=>m??600),M=e.useRef(A);Ea(()=>{k.current=O},[O]);let N=e.useCallback(()=>Mq(t),[t]),P=e.useCallback(t=>{let n=Math.round(t);if(k.current=n,e.startTransition(()=>{S(n)}),_.current){try{_.current(n)}catch{}return}r&&g.current&&Rq.save(g.current,n)},[r]),F=e.useRef(b);return Ea(()=>{F.current=b}),Ea(()=>{if(!r)return;let t=window.innerWidth,n=()=>{let n=window.innerWidth,r=t<Dq!=n<Dq;t=n,r&&(y.current=Nq());let i=F.current();a.current?.style.setProperty(`--pane-max-width`,`${i}px`);let s=k.current>i;s&&(k.current=i,a.current?.style.setProperty(`--pane-width`,`${i}px`)),Fq(o.current,{max:i,current:k.current},v.current),(i!==M.current||s)&&(M.current=i,e.startTransition(()=>{j(i),s&&S(i)}))};y.current=Nq();let i=F.current();if(M.current=i,a.current?.style.setProperty(`--pane-max-width`,`${i}px`),Fq(o.current,{min:p,max:i,current:k.current},v.current),e.startTransition(()=>{j(i)}),m!==null&&!c)return;let l=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,a.current?.setAttribute(`data-dragging`,`true`),s?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,a.current?.removeAttribute(`data-dragging`),s?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-l>=16?(l=e,n()):u===null&&(u=requestAnimationFrame(()=>{u=null,l=performance.now(),n()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[r,m,c,p,a,o,s]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},qq={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 Jq(t,n){let{className:r,style:i,children:a,id:o,position:s=`start`,width:c=`medium`,minWidth:l=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}=t,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=e.useContext(_q),T=e.useRef(null),E=e.useRef(0),D=e.useRef(0),O=e.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=Kq({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=Be(n,C),L=Qp(C),ee=Y(o),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},te=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},z=(0,q.jsx)(Gq,{variant:h?`line`:m,position:s,className:qq.divider,style:{"--spacing-column":`var(--page-layout-spacing-${S})`},children:h?(0,q.jsx)(Hq,{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=s===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(te(r),Fq(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+(s===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(te(i),Fq(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();te(e),Fq(T.current,{current:e}),F(e)}}):null});return(0,q.jsxs)(`div`,{className:G(qq.wrapper,qq.hidden,qq.position,qq.sticky,qq.fullscreen,r),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...i},"data-position":s,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...Aa(`is-hidden`,v),children:[s===`end`?z:null,(0,q.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:G(qq.sidebar,qq.sidebarResizable,qq.sidebarFullscreen,qq.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":Aq(c)?c.min:`${l}px`,"--pane-max-width":Aq(c)?c.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":Aq(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${jq(c)?c:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...o?{id:ee}:{},...x,children:a}),s===`start`?z:null]})}Jq.displayName=`PageLayout.Sidebar`;var Yq=K(Jq);const Xq={content:`page-layout-content-row`},Zq=W(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),Qq=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 $q(t,n){let{className:r,style:i,children:a,containerWidth:o=`xlarge`,padding:s=`normal`,rowGap:c=`normal`,columnGap:l=`normal`,...u}=t,d=e.useRef(null),f=e.useRef(null),p=e.useRef(null),m=e.useRef(null),[h,g]=si(a,{header:Eq,footer:Cq,sidebar:Yq}),_=e.useMemo(()=>({padding:s,rowGap:c,columnGap:l,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[s,c,l]);return(0,q.jsx)(_q.Provider,{value:_,children:(0,q.jsxs)(`div`,{ref:n,className:G(Zq({hasSidebar:!!h.sidebar}),r),style:{"--spacing":`var(--page-layout-spacing-${s})`,...i},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,q.jsxs)(`div`,{ref:m,className:G(Qq({width:o})),"data-page-layout-wrapper":``,"data-width":o,children:[h.header,(0,q.jsx)(`div`,{className:Xq.content,children:g}),h.footer]})]})})}$q.displayName=`PageLayout`;var eJ=K($q);const tJ={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},nJ=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 rJ(t,n){let{as:r=`main`,className:i,children:a,width:o=`full`,padding:s=`none`,hidden:c=!1,...l}=t,{contentWrapperRef:u}=e.useContext(_q),d=Be(n,u);return(0,q.jsx)(r,{ref:d,className:G(tJ.wrapper,tJ.hidden,tJ.dragging,i),"data-component":`PageLayout.Content`,...Aa(`is-hidden`,c),...l,children:(0,q.jsx)(`div`,{className:G(nJ({width:o})),"data-width":o,style:{"--spacing":`var(--page-layout-spacing-${s})`},children:a})})}rJ.displayName=`PageLayout.Content`;var iJ=K(rJ);const aJ={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 oJ(t,n){let{className:r,style:i,children:a,id:o,position:s=`end`,width:c=`medium`,minWidth:l=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}=t,S=Zs(s)?`end`:s,C=Zs(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=e.useContext(_q),O=e.useRef(null),k=e.useRef(0),A=e.useRef(0),j=e.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=Kq({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=Be(n,E),te=Qp(E),z=Y(o),ne=te?{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(aJ.wrapper,aJ.hidden,aJ.position,aJ.sticky,r),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...i},"data-sticky":g||void 0,...Aa(`is-hidden`,v),...Aa(`position`,s),children:[(0,q.jsx)(bq,{variant:Zs(m)?m:{narrow:C,regular:`none`},position:s,className:aJ.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,q.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:G(aJ.pane,aJ.paneResizable,aJ.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":Aq(c)?c.min:`${l}px`,"--pane-max-width":Aq(c)?c.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":Aq(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${jq(c)?c:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...o?{id:z}:{},...x,children:a}),(0,q.jsx)(Gq,{variant:Zs(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:s,className:aJ.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,q.jsx)(Hq,{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),Fq(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),Fq(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();B(e),Fq(O.current,{current:e}),ee(e)}}):null})]})}oJ.displayName=`PageLayout.Pane`;var sJ=K(oJ);const cJ=Object.assign(eJ,{Header:Eq,Content:iJ,Pane:sJ,Sidebar:Yq,Footer:Cq}),lJ=[`narrow`,`regular`,`wide`],uJ={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},dJ=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:``}}}),fJ=e=>typeof e==`object`?lJ.filter(t=>e[t]===!1):e?[]:[...lJ],pJ=({page:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[e.type===`previous`?(0,q.jsx)(Jn,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,q.jsx)(Yn,{"data-component":`Pagination.NextPageIcon`}):null]}),mJ=e=>`#${e}`;function hJ(t,n){let{as:r=`nav`,className:i,pageCount:a,currentPage:o,onPageChange:s,hrefBuilder:c=mJ,marginPageCount:l=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=t,m=e.useMemo(()=>D_(a,o,!!d,l,u),[a,o,d,l,u]),h=fJ(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=O_(e,c,t=>s?.(t,e.num)),a=e.type===`previous`||e.type===`next`,o=!!r||!!i[`aria-hidden`],l=G(dJ({step:a?e.type:void 0,current:e.selected,inert:o}));if(f&&!r)return f({key:t,children:(0,q.jsx)(pJ,{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)(pJ,{page:e,children:n})},t)});return(0,q.jsx)(r,{ref:n,"aria-label":`Pagination`,className:G(uJ.root,i),"data-component":`Pagination`,...p,children:(0,q.jsx)(`div`,{className:G(uJ.steps,h.map(e=>uJ.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}hJ.displayName=`Pagination`;var gJ=K(hJ);const _J={root:`password-input`,toggle:`password-input-toggle`};function vJ(t,n){let{className:r,visible:i,defaultVisible:a=!1,onVisibilityChange:o,hideToggle:s=!1,showLabel:c=`Show password`,hideLabel:l=`Hide password`,disabled:u,...d}=t,f=i!==void 0,[p,m]=e.useState(a),h=f?i:p;return(0,q.jsx)(Fs,{ref:n,type:h?`text`:`password`,disabled:u,className:G(_J.root,r),trailingAction:s?void 0:(0,q.jsx)(Fs.Action,{icon:h?sr:cr,"aria-label":h?l:c,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),o?.(t)},className:_J.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}vJ.displayName=`PasswordInput`;var yJ=K(vJ);const bJ={root:`pin-input`},xJ=W(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),SJ={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},CJ=(e,t)=>Array.from(e).filter(e=>SJ[t].test(e)).join(``);function wJ(t,n){let{className:r,length:i=6,value:a,defaultValue:o=``,type:s=`numeric`,mask:c=!1,size:l=`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}=t,S=e.useRef([]),C=a!==void 0,[w,T]=e.useState(()=>CJ(o,s).slice(0,i)),E=C?a:w,D=Array.from({length:i},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=e.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===i&&v?.(e)},M=(e,t)=>{let n=CJ(t,s);if(n.length===0)return;let r=O===-1?e:Math.min(e,O),a=[...D],o=r;Array.from(n).forEach(e=>{o<i&&(a[o]=e,o+=1)}),j(a.join(``)),A(Math.min(o,i-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<i-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(i-1))}};return(0,q.jsx)(`div`,{ref:n,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:G(bJ.root,r),"data-component":`PINInput`,"data-size":l,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,q.jsx)(Fs,{ref:e=>{S.current[t]=e},type:c?`password`:`text`,inputMode:s===`numeric`?`numeric`:`text`,size:l,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 ${i}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:G(xJ({size:l})),"data-component":`PINInput.Box`},t))})}wJ.displayName=`PINInput`;var TJ=K(wJ);const EJ={root:`placeholder`};function DJ(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(EJ.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}DJ.displayName=`Placeholder`;var OJ=K(DJ);const kJ=n({}),AJ=W(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function jJ(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)(kJ.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(AJ({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}jJ.displayName=`Popover`;var MJ=K(jJ);const NJ=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`}}}),PJ=[];function FJ(t,n){let{as:r=`div`,className:i,width:a=`small`,height:o=`fit-content`,overflow:s=`visible`,onClickOutside:c,onEscape:l,ignoreClickRefs:u=PJ,...d}=t,{open:f=!1,caret:p=`top`}=e.useContext(kJ),m=e.useRef(null),h=Be(n,m);return e.useEffect(()=>{if(!f||!c)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))||c(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,c,u]),ka(e=>{!f||!l||(l(e),e.preventDefault())}),(0,q.jsx)(r,{ref:h,className:G(NJ({caret:p,width:a,height:o,overflow:s}),i),"data-component":`Popover.Content`,"data-caret":p,"data-width":a,"data-height":o,"data-overflow":s,...d})}FJ.displayName=`Popover.Content`;var IJ=K(FJ);const LJ=Object.assign(MJ,{Content:IJ}),RJ={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},zJ=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 BJ(t,n){let{as:r=`span`,className:i,progress:a=0,size:o=`medium`,variant:s=`success`,style:c,children:l,"aria-valuenow":u,...d}=t,f=Math.min(Math.max(a,0),100),p=e.Children.toArray(l).length>0;return(0,q.jsxs)(r,{ref:n,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:G(zJ({size:o,variant:s}),i),style:{...c,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":o,"data-variant":s,...d,children:[(0,q.jsxs)(`svg`,{className:RJ.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:RJ.track,cx:16,cy:16,r:14,pathLength:100}),(0,q.jsx)(`circle`,{className:RJ.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,q.jsx)(`span`,{className:RJ.label,children:l}):null]})}BJ.displayName=`ProgressCircle`;var VJ=K(BJ);const HJ={L:1,M:0,Q:3,H:2},UJ={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},WJ={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function GJ(e,t){let n=WJ[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const KJ={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 qJ(e,t){return KJ[t][e]}const JJ=[[],[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]],YJ=[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 XJ(e){return/^\d+$/.test(e)}function ZJ(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function QJ(e){return XJ(e)?`numeric`:ZJ(e)?`alphanumeric`:`byte`}function $J(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function eY(e){let t=[],n=0;for(;n+2<e.length;)aY(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(aY(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&aY(t,Number.parseInt(e[n],10),4),t}function tY(e){let t=[],n=0;for(;n+1<e.length;)aY(t,$J(e[n])*45+$J(e[n+1]),11),n+=2;return n<e.length&&aY(t,$J(e[n]),6),t}function nY(e){let t=[];for(let n of e)aY(t,n,8);return t}function rY(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;aY(t,r*192+i,13)}return t}function iY(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 aY(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function oY(e,t){return qJ(e,t).totalDataCodewords*8}function sY(e,t,n,r){let i=n===`auto`||!n?QJ(e):n,a=new TextEncoder().encode(e);if(r){let n=oY(r,t);if(cY(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=oY(n,t);if(cY(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function cY(e,t,n,r){let i=GJ(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 lY(e,t){return t&&t!==`auto`?t:XJ(e)?`numeric`:ZJ(e)?`alphanumeric`:`byte`}const uY=new Uint8Array(512),dY=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)uY[t]=e,dY[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)uY[e]=uY[e-255]})();function fY(e,t){return e===0||t===0?0:uY[(dY[e]+dY[t])%255]}function pY(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,uY[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]^=fY(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]^fY(e,n[i+1]);r[t-1]=fY(e,n[t])}return r}function mY(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(pY(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(pY(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 hY(e,t={}){let n=t.ecLevel??`M`,r=lY(e,t.mode),i=sY(e,n,r,t.version),a=qJ(i,n),o=mY(_Y(gY(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)aY(s,e,8);return{version:i,ecLevel:n,bits:s}}function gY(e,t,n,r){let i=[],a=GJ(n,t),o=new TextEncoder().encode(e);switch(aY(i,UJ[t],4),aY(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...eY(e));break;case`alphanumeric`:i.push(...tY(e));break;case`byte`:i.push(...nY(o));break;case`kanji`:{let t=iY(e);i.push(...rY(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&aY(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)aY(i,l?236:17,8),l=!l;return i}function _Y(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 vY(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function yY(e,t){let n=e.length;bY(e,0,0),bY(e,n-7,0),bY(e,0,n-7),SY(e,n),CY(e,t),e[4*t+9][8]=!0,TY(e,n),t>=7&&EY(e,n)}function bY(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++)xY(e,t-1,n+i,!1,r),xY(e,t+7,n+i,!1,r),xY(e,t+i,n-1,!1,r),xY(e,t+i,n+7,!1,r)}function xY(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function SY(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 CY(e,t){if(t<2)return;let n=JJ[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)&&wY(e,n[t],n[i])}function wY(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 TY(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 EY(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 DY(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 OY(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=JJ[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 kY(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 AY(e,t,n,r){let i=kY(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)OY(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function jY(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]);AY(o,r,t,n);let s=MY(o,t);s<a&&(a=s,i=r)}return i}function MY(e,t){return NY(e,t)+PY(e,t)+FY(e,t)+IY(e,t)}function NY(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 PY(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 FY(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 IY(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 LY(e,t){let n=HJ[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 RY(e,t,n){let r=e.length,i=LY(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 zY(e,t){if(t<7)return;let n=e.length,r=YJ[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 BY=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},VY=class extends BY{constructor(...e){super(...e),this.name=`InvalidInputError`}};function HY(e,t={}){let{version:n,ecLevel:r,bits:i}=hY(e,t),a=n*4+17,o=vY(a);yY(o,n),DY(o,i,n);let s=jY(o,a,n,t.mask);return AY(o,s,a,n),RY(o,r,s),n>=7&&zY(o,n),o.map(e=>e.map(e=>e===!0))}function UY(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}const WY=(()=>{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 GY(e){let t=4294967295;for(let n=0;n<e.length;n++)t=WY[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function KY(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 qY(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 JY(e){let t=qY(e),n=KY(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 YY=new Uint8Array([137,80,78,71,13,10,26,10]);function XY(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,GY(a)),r}function ZY(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=JY(s),u=XY(`IHDR`,r),d=XY(`IDAT`,l),f=XY(`IEND`,new Uint8Array),p=YY.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(YY,h),h+=YY.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function QY(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,${oX(s)}`:$Y(s,o.width,o.height)}function $Y(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)eX(e,i,a,o,l);else if(s===24)tX(e,i,a,o,l);else if(s<=8)nX(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=iX(a,o,s),n=i+rX(e,i,s)+t;n<e.length&&aX(e,n,a,o,l)}return`data:image/png;base64,${oX(ZY(a,o,l))}`}function eX(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 tX(e,t,n,r,i){let a=t+rX(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 nX(e,t,n,r,i,a){let o=rX(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 rX(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 iX(e,t,n){return Math.ceil(e*n/32)*4*t}function aX(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 oX(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const sX=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function cX(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="${UY(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(sX.test(e.svg))throw new VY(`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=UY(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 VY(`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=QY(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${UY(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function lX(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return uX(e+o,t+o,a);case`rounded`:return dX(e+o,t+o,a,a*.25);case`dots`:return fX(e+n/2,t+n/2,a/2);case`diamond`:return pX(e+n/2,t+n/2,a);case`classy`:return mX(e+o,t+o,a);case`classy-rounded`:return hX(e+o,t+o,a);case`extra-rounded`:return dX(e+o,t+o,a,a*.5);case`vertical-line`:return gX(e+o,t,n,a);case`horizontal-line`:return _X(e,t+o,n,a);case`small-square`:return uX(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return uX(e+n*.25,t+n*.25,n*.5);default:return uX(e+o,t+o,a)}}function uX(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function dX(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 fX(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 pX(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function mX(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 hX(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 gX(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function _X(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function vX(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return bX(e,t,i,i,r)+xX(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return fX(e+r,t+r,r)+fX(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return bX(e,t,i,i,r)+xX(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return bX(e,t,i,i,r)+xX(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 yX(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return fX(a,o,i/2);case`rounded`:return dX(e+n*2,t+n*2,i,n*.75);default:return uX(e+n*2,t+n*2,i)}}function bX(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 xX(e,t,n,r,i){return bX(e,t,n,r,i)}const SX={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`},CX=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function wX(t,n){let{value:r,size:i=200,margin:a=4,ecLevel:o,version:s,mode:c,mask:l,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}=t,S=o??(h?`H`:void 0),C=e.useMemo(()=>{if(!r)return null;try{return HY(r,{ecLevel:S,version:s,mode:c,mask:l})}catch{return null}},[r,S,s,c,l]);if(!C)return(0,q.jsx)(`div`,{ref:n,className:G(SX.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,q.jsx)(`span`,{className:SX.fallback,children:v}):null});let w=C.length,T=w+a*2,E=i/T,D=h?cX({size:g},w,E,a).hiddenModules:void 0,O=CX(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(lX((t+a)*E,(e+a)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+a)*E,i=(t+a)*E;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{className:SX.corner,d:vX(r,i,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,q.jsx)(`path`,{className:SX.corner,d:yX(r,i,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,q.jsxs)(`div`,{ref:n,role:`img`,"aria-label":_??r,className:G(SX.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:SX.canvas,width:i,height:i,viewBox:`0 0 ${i} ${i}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,q.jsx)(`rect`,{className:SX.background,width:`100%`,height:`100%`}),f?O.map(t=>(0,q.jsx)(e.Fragment,{children:j(f[t.key],t.row,t.col)},t.key)):null,A.length>0?(0,q.jsx)(`path`,{className:SX.modules,d:A.join(``)}):null]}),h?(0,q.jsx)(`span`,{className:SX.logo,"aria-hidden":`true`,children:h}):null]})}wX.displayName=`QRCode`;var TX=K(wX);const EX=n({}),DX={root:`radio-card-description`};function OX(t,n){let{className:r,id:i,...a}=t,{descriptionId:o}=e.useContext(EX);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(DX.root,r),"data-component":`RadioCard.Description`,...a})}OX.displayName=`RadioCard.Description`;var kX=K(OX);const AX={root:`radio-card-label`};function jX(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(EX);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(AX.root,r),"data-component":`RadioCard.Label`,...a})}jX.displayName=`RadioCard.Label`;var MX=K(jX);const NX={root:`radio-card-leading-visual`};function PX(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(NX.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}PX.displayName=`RadioCard.LeadingVisual`;var FX=K(PX);const IX={body:`radio-card-body`,control:`radio-card-control`},LX=W(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function RX(t,n){let{className:r,children:i,value:a,name:o,checked:s,defaultChecked:c,disabled:l,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=t,v=e.useContext(_S).disabled||l,y=Y(p),b=`${y}-label`,x=`${y}-description`,[S,C]=si(i,{leadingVisual:FX,label:MX,description:kX}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,q.jsx)(EX.Provider,{value:{labelId:b,descriptionId:x},children:(0,q.jsxs)(`label`,{ref:n,className:G(LX({disabled:!!v,validation:d}),r),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,q.jsxs)(`div`,{className:IX.body,children:[S.label,S.description,C]}),(0,q.jsx)(bS,{id:y,value:a,name:o,checked:s,defaultChecked:c,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:IX.control})]})})}RX.displayName=`RadioCard`;var zX=K(RX);const BX=Object.assign(zX,{LeadingVisual:FX,Label:MX,Description:kX}),VX={root:`radio-group-caption`};function HX(t,n){let{className:r,...i}=t,{captionId:a}=e.useContext(_S);return(0,q.jsx)(`span`,{ref:n,id:a,className:G(VX.root,r),"data-component":`RadioGroup.Caption`,...i})}HX.displayName=`RadioGroup.Caption`;var UX=K(HX);const WX={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function GX(t,n){let{className:r,children:i,visuallyHidden:a,...o}=t,{disabled:s,required:c}=e.useContext(_S);return(0,q.jsxs)(`span`,{ref:n,title:c?`required field`:void 0,className:G(WX.root,s&&WX.disabled,a&&WX.hidden,r),"data-component":`RadioGroup.Label`,"data-label-disabled":s,...o,children:[i,c?(0,q.jsx)(`span`,{className:WX.required,children:`*`}):null]})}GX.displayName=`RadioGroup.Label`;var KX=K(GX);const qX={success:Gn,error:or},JX={icon:`radio-group-validation-icon`},YX=W(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function XX(t,n){let{className:r,children:i,variant:a,...o}=t,{validationMessageId:s}=e.useContext(_S),c=qX[a];return(0,q.jsxs)(`span`,{ref:n,className:G(YX({variant:a}),r),"data-component":`RadioGroup.Validation`,"data-validation-status":a,...o,children:[(0,q.jsx)(c,{className:JX.icon,"aria-hidden":`true`}),(0,q.jsx)(`span`,{id:s,children:i})]})}XX.displayName=`RadioGroup.Validation`;var ZX=K(XX);const QX={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 $X(t,n){let{as:r=`fieldset`,className:i,children:a,name:o,disabled:s,required:c,onChange:l,id:u,"aria-labelledby":d,...f}=t,[p,m]=si(a,{label:KX,caption:UX,validation:ZX}),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&&l?.(t,e)},y=e.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:o,disabled:s,required:c,captionId:g,validationMessageId:_,onChange:v};return(0,q.jsx)(_S.Provider,{value:b,children:(0,q.jsxs)(r,{ref:n,id:h,disabled:s,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:G(QX.root,i),"data-component":`RadioGroup`,"data-disabled":s,"data-required":c,...f,children:[p.label?(0,q.jsxs)(`legend`,{className:G(QX.legend,y&&QX.legendVisible),children:[p.label,c?(0,q.jsx)(`span`,{className:QX.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,q.jsx)(`div`,{className:QX.body,children:m}),p.validation?(0,q.jsx)(`div`,{className:QX.validation,children:p.validation}):null]})})}$X.displayName=`RadioGroup`;var eZ=K($X);const tZ=Object.assign(eZ,{Label:KX,Caption:UX,Validation:ZX}),nZ=5,rZ={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`},iZ=W(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),aZ=e=>e===1?`1 star`:`${e} stars`,oZ=(e,t)=>`${e} out of ${t} stars`,sZ=({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 cZ(t,n){let{className:r,style:i,count:a=5,value:o,defaultValue:s,size:c=`medium`,readOnly:l,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=aZ,valueLabel:h=oZ,"aria-label":g,..._}=t,v=o!==void 0,[y,b]=e.useState(()=>s??0),x=v?o:y,S=Math.max(Math.trunc(a),0),C=Math.min(Math.max(x,0),S),w=Y(f),T=!l&&!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=l?`span`:`label`;return(0,q.jsx)(`span`,{ref:n,role:l?`img`:`radiogroup`,"aria-label":l?g??h(C,S):g,className:G(iZ({size:c,interactive:T,disabled:!!u}),r),style:{...i,"--rating-value":C},"data-component":`Rating`,"data-size":c,"data-value":C,"data-count":S,"data-readonly":l,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,q.jsxs)(k,{className:rZ.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[l?null:(0,q.jsx)(`input`,{type:`radio`,className:G(rZ.input,rZ.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:rZ.star,"aria-hidden":`true`,children:[(0,q.jsx)(sZ,{className:rZ.starTrack}),(0,q.jsx)(`span`,{className:rZ.starFill,children:(0,q.jsx)(sZ,{className:rZ.starFillIcon})})]})]},n)})})}cZ.displayName=`Rating`;var lZ=K(cZ);const uZ=1e3,dZ=60*uZ,fZ=60*dZ,pZ=24*fZ,mZ=7*pZ,hZ=30*pZ,gZ=12*hZ,_Z=`P30D`,vZ=`on`,yZ=[{unit:`year`,length:gZ},{unit:`month`,length:hZ},{unit:`week`,length:mZ},{unit:`day`,length:pZ},{unit:`hour`,length:fZ},{unit:`minute`,length:dZ},{unit:`second`,length:uZ}],bZ=[`year`,`month`,`day`,`hour`,`minute`,`second`],xZ={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},SZ=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),CZ=e=>{let t=SZ.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)*gZ+Number(r??0)*hZ+Number(i??0)*mZ+Number(a??0)*pZ+Number(o??0)*fZ+Number(s??0)*dZ+Number(c??0)*uZ},wZ=e=>{let t=Math.abs(e),{unit:n,length:r}=yZ.find(({length:e})=>t>=e)??yZ[yZ.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},TZ=(e,t)=>{let n=Math.floor(Math.abs(e)/uZ),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 bZ.slice(0,bZ.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},EZ=e=>{let{value:t,unit:n}=wZ(e);return n===`second`?`1m`:`${Math.abs(t)}${xZ[n]}`},DZ=(e,t)=>{let n=TZ(e,t).filter(({count:e})=>e>0);return n.length===0?`0${xZ[t]}`:n.map(({unit:e,count:t})=>`${t}${xZ[e]}`).join(` `)},OZ=(e,t)=>{let{value:n,unit:r}=wZ(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},kZ=(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}},AZ=(e,t,n,r)=>new Intl.DateTimeFormat(r,kZ(e,t,n)).format(e),jZ=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),MZ=(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:DZ(u,a),updateDelay:yZ.find(({unit:e})=>e===a)?.length??uZ};let d=CZ(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=wZ(u);return{text:r===`micro`?EZ(u):OZ(u,l),updateDelay:e}}let f=AZ(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},NZ=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function PZ(t,n){let{as:r=`time`,children:i,date:a,datetime:o,format:s=`auto`,tense:c=`auto`,precision:l=`second`,threshold:u=_Z,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=t,S=NZ(a,o),[C,w]=e.useState(()=>Date.now()),{text:T,updateDelay:E}=S?MZ(S,C,{format:s,tense:c,precision:l,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return e.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,q.jsx)(r,{ref:n,dateTime:S?.toISOString(),title:f||!S?void 0:jZ(S),"data-component":`RelativeTime`,"data-format":s,"data-tense":c,...x,children:i??T})}PZ.displayName=`RelativeTime`;var FZ=K(PZ);const IZ=n({}),LZ=`RichTextEditor`,RZ=[z,ne,F,P,k,O],zZ={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`},BZ={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},VZ=({readOnly:t})=>{let[n]=w();return e.useEffect(()=>{n.setEditable(!t)},[n,t]),null};function HZ(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=LZ,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,...g}=e,_={namespace:l,theme:zZ,nodes:c?[...RZ,...c]:RZ,editable:!s,editorState:i,onError:u??(e=>{throw e})},v={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,q.jsx)(`div`,{ref:t,className:G(BZ.root,s&&BZ.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,...g,children:(0,q.jsx)(b,{initialConfig:_,children:(0,q.jsxs)(IZ.Provider,{value:v,children:[(0,q.jsx)(B,{}),(0,q.jsx)(V,{}),(0,q.jsx)(re,{}),(0,q.jsx)(ae,{}),(0,q.jsx)(VZ,{readOnly:s}),a?(0,q.jsx)(ie,{onChange:(e,t)=>a(e,t)}):null,r]})})})}HZ.displayName=`RichTextEditor`;var UZ=K(HZ);const WZ={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function GZ(t,n){let{className:r,style:i,...a}=t,{placeholder:o,minHeight:s,maxHeight:c,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d}=e.useContext(IZ),f=(0,q.jsx)(`div`,{className:WZ.scroll,style:{minHeight:s===void 0?void 0:`${s}px`,maxHeight:c===void 0?void 0:`${c}px`},"data-component":`RichTextEditor.Scroll`,children:o?(0,q.jsx)(oe,{ref:n,className:G(WZ.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":o,placeholder:(0,q.jsx)(`div`,{className:WZ.placeholder,children:o}),"data-component":`RichTextEditor.Content`,...a}):(0,q.jsx)(oe,{ref:n,className:G(WZ.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...a})});return(0,q.jsx)(ce,{contentEditable:f,ErrorBoundary:se})}GZ.displayName=`RichTextEditor.Content`;var KZ=K(GZ);const qZ=[`history`,`inline`,`block`,`list`,`link`],JZ={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`},YZ=[{format:`bold`,icon:kr,label:`Bold`},{format:`italic`,icon:Pr,label:`Italic`},{format:`underline`,icon:Rr,label:`Underline`},{format:`strikethrough`,icon:Lr,label:`Strikethrough`},{format:`code`,icon:tr,label:`Code`}],XZ=[{tag:`h1`,icon:jr,label:`Heading 1`},{tag:`h2`,icon:Mr,label:`Heading 2`},{tag:`h3`,icon:Nr,label:`Heading 3`}],ZZ={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function QZ(t){let{className:n,children:r,controls:i=qZ,"aria-label":a=`Formatting`,...o}=t,[s]=w(),{readOnly:c}=e.useContext(IZ),l=e.useRef(null);ri({containerRef:l,direction:`horizontal`,wrap:!0});let[u,d]=e.useState(ZZ),[f,p]=e.useState(`paragraph`),[m,h]=e.useState(!1),[g,_]=e.useState(!1),[v,y]=e.useState(!1),[b,x]=e.useState(null),S=e.useCallback(()=>{let e=fe();if(!pe(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(j(n))p(n.getListType()===`number`?`number`:`bullet`);else if(R(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else te(n)?p(`quote`):p(`paragraph`);h(D(t)||D(t.getParent()))},[]);e.useEffect(()=>ue(s.registerUpdateListener(({editorState:e})=>{e.read(S)}),s.registerCommand(ye,()=>(S(),!1),ge),s.registerCommand(he,e=>(_(e),!1),ge),s.registerCommand(me,e=>(y(e),!1),ge)),[s,S]);let C=e=>{s.update(()=>{let t=fe();if(pe(t)){if(f===e){le(t,()=>de());return}le(t,()=>e===`quote`?ee():L(e))}})},T=e=>{if(f===e){s.dispatchCommand(I,void 0);return}s.dispatchCommand(e===`bullet`?N:M,void 0)},E=()=>{if(m){s.dispatchCommand(A,null);return}x(e=>e===null?``:null)},O=()=>{b&&s.dispatchCommand(A,b),x(null),s.focus()},k=(e,t,n,r,i,a)=>(0,q.jsx)(na,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:c||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),P={history:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(na,{icon:Bn,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:c||!g,onClick:()=>s.dispatchCommand(be,void 0),"data-component":`RichTextEditor.Undo`}),(0,q.jsx)(na,{icon:Ln,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:c||!v,onClick:()=>s.dispatchCommand(ve,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,q.jsx)(q.Fragment,{children:YZ.map(({format:e,icon:t,label:n})=>k(n,n,t,u[e],()=>s.dispatchCommand(_e,e)))}),block:(0,q.jsxs)(q.Fragment,{children:[XZ.map(({tag:e,icon:t,label:n})=>k(n,n,t,f===e,()=>C(e))),k(`Quote`,`Quote`,Ir,f===`quote`,()=>C(`quote`))]}),list:(0,q.jsxs)(q.Fragment,{children:[k(`Bulleted list`,`Bulleted list`,Ar,f===`bullet`,()=>T(`bullet`)),k(`Numbered list`,`Numbered list`,Fr,f===`number`,()=>T(`number`))]}),link:k(`Link`,m?`Remove link`:`Link`,hr,m||b!==null,E)};return(0,q.jsxs)(`div`,{className:G(JZ.root,n),"data-component":`RichTextEditor.Toolbar`,children:[(0,q.jsxs)(`div`,{ref:l,role:`toolbar`,"aria-label":a,"aria-orientation":`horizontal`,className:JZ.controls,...o,children:[i.map((t,n)=>(0,q.jsxs)(e.Fragment,{children:[n>0?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:JZ.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,q.jsx)(`div`,{className:JZ.group,"data-control":t,children:P[t]})]},t)),r]}),b===null?null:(0,q.jsxs)(`div`,{className:JZ.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,q.jsx)(Fs,{autoFocus:!0,size:`small`,type:`url`,value:b,placeholder:`https://example.com`,"aria-label":`Link address`,className:JZ.linkInput,onChange:e=>x(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),O()),e.key===`Escape`&&(x(null),s.focus())}}),(0,q.jsx)($i,{size:`small`,onClick:O,children:`Apply`})]})]})}QZ.displayName=`RichTextEditor.Toolbar`;const $Z=Object.assign(UZ,{Toolbar:QZ,Content:KZ}),eQ=n({}),tQ={root:`tooltip`,open:`tooltip-open motion-safe:[&:popover-open]:animate-in motion-safe:[&:popover-open]:fade-in motion-safe:[&:popover-open]:duration-100`,openPolyfilled:`tooltip-open-polyfilled motion-safe:[&[class~=':popover-open']]:animate-in motion-safe:[&[class~=':popover-open']]:fade-in motion-safe:[&[class~=':popover-open']]:duration-100`,bridge:`tooltip-bridge`,bridgeVertical:`tooltip-bridge-vertical`,bridgeHorizontal:`tooltip-bridge-horizontal`},nQ={nw:{side:`outside-top`,align:`end`},n:{side:`outside-top`,align:`center`},ne:{side:`outside-top`,align:`start`},e:{side:`outside-right`,align:`center`},se:{side:`outside-bottom`,align:`start`},s:{side:`outside-bottom`,align:`center`},sw:{side:`outside-bottom`,align:`end`},w:{side:`outside-left`,align:`center`}},rQ={"outside-top-end":`nw`,"outside-top-center":`n`,"outside-top-start":`ne`,"outside-right-center":`e`,"outside-bottom-start":`se`,"outside-bottom-center":`s`,"outside-bottom-end":`sw`,"outside-left-center":`w`},iQ={short:50,medium:400,long:1200},aQ=[`a[href]`,`button:not([disabled])`,`summary`,`select`,`input:not([type=hidden])`,`textarea`],oQ=e=>aQ.some(t=>e.matches(t))||e.getAttribute(`role`)===`button`,sQ=e=>oQ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&oQ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&oQ(e)));function cQ(t,n){let{className:r,children:i,text:a,id:o,direction:s=`s`,type:c=`description`,delay:l=`short`,...u}=t,d=Y(o),f=e.Children.only(i),p=e.useRef(null),m=Be(n,p),h=e.useRef(null),g=e.useRef(null),_=e.useRef(null),[v,y]=e.useState(!1),[b,x]=e.useState(s),S=()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)};e.useEffect(()=>S,[]);let C=()=>{let e=h.current,t=p.current;if(!e||!t)return;try{e.showPopover()}catch{return}y(!0);let{side:n,align:r}=nQ[s],{top:i,left:a,anchorSide:o,anchorAlign:c}=Ka(e,t,{side:n,align:r});x(rQ[`${o}-${c}`]??s),e.style.top=`${i}px`,e.style.left=`${a}px`},w=()=>{S(),y(!1);try{h.current?.hidePopover()}catch{}};e.useEffect(()=>{let e=h.current,t=p.current;if(!(!e||!t)){if(!sQ(t))throw Error("The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or an equivalent element instead.");typeof window<`u`&&!Se()&&xe(),e.setAttribute(`popover`,`manual`)}},[]),ka(e=>{v&&(e.preventDefault(),w())});let T=e.useMemo(()=>({tooltipId:d}),[d]);if(!e.isValidElement(f))return null;let E=f.props,D=e.cloneElement(f,{ref:m,"aria-describedby":c===`description`?[E[`aria-describedby`],d].filter(Boolean).join(` `):E[`aria-describedby`],"aria-labelledby":c===`label`?d:E[`aria-labelledby`],onFocus:e=>{try{if(!e.target.matches(`:focus-visible`))return}catch{}C(),E.onFocus?.(e)},onBlur:e=>{w(),E.onBlur?.(e)},onMouseOverCapture:e=>{g.current=window.setTimeout(()=>{g.current!==null&&(C(),E.onMouseEnter?.(e))},iQ[l])},onMouseLeave:e=>{w(),E.onMouseLeave?.(e)},onTouchEnd:e=>{E.onTouchEnd?.(e),_.current=window.setTimeout(w,10)}});return(0,q.jsxs)(eQ.Provider,{value:T,children:[D,(0,q.jsx)(`span`,{ref:h,id:d,role:c===`description`?`tooltip`:void 0,"aria-hidden":`true`,className:G(tQ.root,tQ.open,tQ.openPolyfilled,tQ.bridge,tQ.bridgeVertical,tQ.bridgeHorizontal,r),onMouseEnter:C,onMouseLeave:w,"data-component":`Tooltip`,"data-direction":b,...u,children:a})]})}cQ.displayName=`Tooltip`;var lQ=K(cQ);const uQ={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`},dQ=t=>{let n=t;return e.isValidElement(t)?t:(0,q.jsx)(n,{})};function fQ(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(uQ.button,i&&uQ.buttonSelected,d&&!i&&uQ.buttonDisabled,n),...u,children:(0,q.jsx)(`span`,{className:G(uQ.content,i&&uQ.contentSelected,!i&&!d&&uQ.contentInteractive),children:r})});return(0,q.jsx)(`li`,{className:G(uQ.item,uQ.separator,uQ.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,q.jsx)(lQ,{text:o,type:s,direction:c,children:f}):f})}fQ.displayName=`SegmentedControlSegment`;const pQ={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function mQ(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,q.jsxs)(fQ,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,q.jsx)(`span`,{className:G(pQ.visual,o&&pQ.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:dQ(i)}):null,(0,q.jsx)(`span`,{className:G(pQ.text,pQ.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,q.jsx)(`span`,{className:pQ.counter,children:(0,q.jsx)(qi,{children:r})})]})}mQ.displayName=`SegmentedControl.Button`;const hQ={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function gQ(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)(fQ,{component:`SegmentedControl.IconButton`,className:G(hQ.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(hQ.visual,o&&hQ.visualDisabled),"data-component":`SegmentedControl.Icon`,children:dQ(i)})})}gQ.displayName=`SegmentedControl.IconButton`;const _Q={dropdown:`segmented-control-dropdown`},vQ=W(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),yQ=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),bQ=e=>e.type===mQ,xQ=e=>e.type===gQ,SQ=e=>{if(e!==void 0)return bQ(e)?e.props.children:xQ(e)?e.props[`aria-label`]:void 0},CQ=e=>e===void 0?null:bQ(e)?e.props.leadingVisual??null:xQ(e)?e.props.icon:null,wQ=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function TQ(t){let{"aria-label":n,"aria-labelledby":r,className:i,children:a,fullWidth:o,onChange:s,size:c=`medium`,variant:l=`default`,...u}=t,d=yQ(a),f=s===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]=e.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{wQ(t)||(f&&g(e),s?.(e),t.props.onClick?.(n))},b=(0,q.jsx)(`ul`,{"aria-label":n,"aria-labelledby":r,className:G(vQ({size:c}),i),"data-component":`SegmentedControl`,"data-size":c,...Aa(`full-width`,o),...Aa(`variant`,l),...u,children:d.map((t,n)=>e.cloneElement(t,{selected:n===_,onClick:e=>y(n,t,e)}))});return Zs(l)&&Object.values(l).includes(`dropdown`)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:_Q.dropdown,"data-component":`SegmentedControl.Dropdown`,...Aa(`variant`,l),children:(0,q.jsxs)(to,{children:[(0,q.jsx)(to.Button,{"aria-label":n&&`${SQ(v)}, ${n}`,leadingVisual:CQ(v),children:SQ(v)}),(0,q.jsx)(to.Overlay,{"aria-labelledby":r,children:(0,q.jsx)(_a,{selectionVariant:`single`,children:d.map((e,t)=>{let n=CQ(e);return(0,q.jsxs)(_a.Item,{selected:t===_,disabled:wQ(e),onSelect:n=>y(t,e,n),children:[n?(0,q.jsx)(_a.LeadingVisual,{children:dQ(n)}):null,SQ(e)]},t)})})})]})}),b]}):b}TQ.displayName=`SegmentedControl`;const EQ=Object.assign(TQ,{Button:mQ,IconButton:gQ}),DQ=Object.assign(VS,{Option:kS,OptGroup:TS});function OQ(t,n){let{className:r,children:i,...a}=t,{required:o,...s}=kp(a),{labelId:c}=e.useContext(Op),l=Y();return(0,q.jsx)($i,{ref:n,type:`button`,"aria-labelledby":c?`${l} ${c}`:void 0,className:G(r),"data-component":`SelectPanel.Button`,...s,children:c?(0,q.jsx)(`span`,{id:l,children:i}):i})}OQ.displayName=`SelectPanel.Button`;var kQ=K(OQ);const AQ=n({}),jQ={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 MQ(t,n){let{className:r,children:i,...a}=t,{selectionVariant:o,onCancel:s}=e.useContext(AQ),c=o!==`instant`;return!c&&!i?null:(0,q.jsxs)(`div`,{ref:n,className:G(jQ.root,!c&&jQ.rootWithoutActions,r),"data-component":`SelectPanel.Footer`,"data-has-actions":c?``:void 0,...a,children:[(0,q.jsx)(`div`,{className:G(jQ.content,!c&&jQ.contentWithoutActions),children:i}),c?(0,q.jsxs)(`div`,{className:jQ.actions,children:[(0,q.jsx)($i,{type:`button`,size:`small`,onClick:s,children:`Cancel`}),(0,q.jsx)($i,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}MQ.displayName=`SelectPanel.Footer`;var NQ=K(MQ);const PQ={root:`select-panel-search-input`};function FQ(t,n){let{className:r,value:i,onChange:a,onKeyDown:o,...s}=t,{searchQuery:c,setSearchQuery:l,searchInputRef:u,moveFocusToList:d}=e.useContext(AQ),f=e.useRef(null),p=Be(u,f),m=Be(n,p),h=i??c??``;return(0,q.jsx)(Fs,{ref:m,block:!0,leadingVisual:Sr,placeholder:`Search`,value:h,onChange:e=>{l?.(e.currentTarget.value),a?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),o?.(e)},trailingAction:h?(0,q.jsx)(Fs.Action,{icon:rr,"aria-label":`Clear`,onClick:()=>{l?.(``),a?.(``,null),f.current?.focus()}}):void 0,className:G(PQ.root,r),"data-component":`SelectPanel.SearchInput`,...s})}FQ.displayName=`SelectPanel.SearchInput`;var IQ=K(FQ);const LQ={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`},RQ={searchInput:IQ};function zQ(t,n){let{className:r,children:i,onBack:a,...o}=t,[s,c]=si(i,RQ),{panelId:l,title:u,description:d,onCancel:f,onClearSelection:p}=e.useContext(AQ);return(0,q.jsxs)(`div`,{ref:n,className:G(LQ.root,r),"data-component":`SelectPanel.Header`,...o,children:[(0,q.jsxs)(`div`,{className:G(LQ.content,s.searchInput&&LQ.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":s.searchInput?``:void 0,children:[(0,q.jsxs)(`div`,{className:LQ.titleRow,children:[a?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:Nn,"aria-label":`Back`,onClick:a,"data-component":`SelectPanel.BackButton`}):null,(0,q.jsxs)(`div`,{className:LQ.title,"data-has-description":d?``:void 0,"data-has-back":a?``:void 0,children:[(0,q.jsx)(di,{as:`h1`,id:l?`${l}-title`:void 0,className:LQ.heading,children:u}),d?(0,q.jsx)(`span`,{id:l?`${l}-description`:void 0,className:LQ.description,children:d}):null]})]}),(0,q.jsxs)(`div`,{className:LQ.actions,children:[p?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:lr,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:ir,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),s.searchInput,c]})}zQ.displayName=`SelectPanel.Header`;var BQ=K(zQ);const VQ={form:`select-panel-form`,container:`select-panel-container`},HQ=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`}}}),UQ=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:``}}}),WQ={regular:`anchored`,narrow:`full-screen`},GQ=t=>e.isValidElement(t)&&t.type===kQ,KQ=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function qQ(t,n){let{className:r,children:i,title:a,description:o,variant:s=WQ,selectionVariant:c=`multiple`,id:l,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}=t,x=Y(l),S=e.useRef(null),C=f??S,w=e.useRef(null),T=Be(n,w),E=e.useRef(null),D=d!==void 0,[O,k]=e.useState(u),A=D?d:O,j=e.useCallback(()=>{D||k(!1)},[D]),M=e.useCallback(()=>{j(),h?.()},[j,h]),N=e.useCallback(()=>g?.(),[g]),P=e.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=e.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=e.useCallback(()=>{c===`instant`&&P()},[c,P]),[L,ee]=e.useState(``),R=e.Children.toArray(i),te=R.find(GQ),[z,ne]=si(R.filter(e=>e!==te),{header:BQ,footer:NQ}),B=te?.props.onClick,re=te?e.cloneElement(te,{ref:C,onClick:e=>{B?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,V={...WQ,...typeof s==`string`?{regular:s}:s},ie=V.regular??`anchored`,ae=V.narrow,oe=ie===`anchored`||ae===`anchored`,se=e.useRef(null),[ce,le]=e.useState(null),ue=e.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=Ka(t,e,{side:p,align:m});se.current&&KQ(se.current,n)||(se.current=n,le(n))},[C,p,m]);Ea(()=>{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]),Ta({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),e.useEffect(()=>{A&&!E.current&&F()},[A,F]),ka(e=>{A&&(e.preventDefault(),M())});let de=e.useMemo(()=>({panelId:x,title:a,description:o,selectionVariant:c,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,a,o,c,L,M,g,N,F]),fe=e.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:c===`instant`?`single`:c,afterSelect:I,enableFocusZone:!0}),[x,c,I]);return(0,q.jsxs)(q.Fragment,{children:[re,A?(0,q.jsx)(Va,{children:(0,q.jsx)(`div`,{className:G(HQ({variant:ie,narrowVariant:ae})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...Aa(`variant`,V),children:(0,q.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":o?`${x}-description`:void 0,className:G(UQ({width:v,maxHeight:y,variant:ie,narrowVariant:ae,unplaced:oe&&!ce}),r),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,...Aa(`variant`,V),...b,children:(0,q.jsx)(`form`,{className:VQ.form,onSubmit:P,children:(0,q.jsxs)(AQ.Provider,{value:de,children:[z.header??(0,q.jsx)(BQ,{}),(0,q.jsx)(`div`,{className:VQ.container,children:(0,q.jsx)(gi.Provider,{value:fe,children:ne})}),z.footer]})})})})}):null]})}qQ.displayName=`SelectPanel`;var JQ=K(qQ);const YQ={root:`select-panel-loading`,text:`select-panel-loading-text`};function XQ(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(YQ.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,q.jsx)(zi,{size:`medium`,srText:null,role:`presentation`}),(0,q.jsx)(`span`,{className:YQ.text,children:r})]})}XQ.displayName=`SelectPanel.Loading`;var ZQ=K(XQ);const QQ={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 $Q(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(QQ.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,q.jsx)(zr,{className:G(QQ.fullIcon,QQ.variant[i]),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:QQ.fullTitle,children:o}),(0,q.jsx)(`span`,{className:QQ.fullContent,children:r})]}):(0,q.jsxs)(`div`,{ref:t,className:G(QQ.inline,QQ.variant[i],QQ.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,q.jsx)(zr,{className:QQ.inlineIcon,"aria-hidden":`true`}),(0,q.jsx)(`div`,{children:r})]})}$Q.displayName=`SelectPanel.Message`;var e$=K($Q);const t$={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},n$=e=>{let{id:t,children:n,className:r,...i}=e,a=Y(t);return(0,q.jsxs)(`span`,{className:t$.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,q.jsx)(Vf,{id:a,className:G(t$.box,r),...i}),(0,q.jsx)(`label`,{htmlFor:a,className:t$.small,children:n})]})};function r$(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,q.jsx)(n$,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,q.jsx)(zl,{className:G(t$.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,q.jsx)($i,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}r$.displayName=`SelectPanel.SecondaryAction`;const i$=Object.assign(JQ,{Button:kQ,Header:BQ,SearchInput:IQ,Footer:NQ,SecondaryAction:r$,Loading:ZQ,Message:e$}),a$=W(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function o$(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(a$({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}o$.displayName=`Separator`;var s$=K(o$);const c$=W(`skeleton-avatar`,{variants:{shape:{circle:`skeleton-avatar-circle`,square:`skeleton-avatar-square`},responsive:{true:`skeleton-avatar-responsive`,false:``}}});function l$({size:e=20,shape:t=`circle`,className:n,style:r,...i}){let a=Zs(e),o={"--avatar-size-regular":`20px`};if(a)for(let[t,n]of Object.entries(e))n!==void 0&&(o[`--avatar-size-${t}`]=`${n}px`);else o[`--avatar-size-regular`]=`${e}px`;return(0,q.jsx)(W_,{width:`var(--avatar-size-regular)`,height:`var(--avatar-size-regular)`,className:G(c$({shape:t,responsive:a}),n),style:{...r,...o},...i,"data-component":`SkeletonAvatar`,"data-responsive":a||void 0,"data-shape":t})}l$.displayName=`SkeletonAvatar`;const u$=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`}]}),d$=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function f$(t,n){let{className:r,style:i,size:a=`medium`,orientation:o=`horizontal`,block:s,min:c=0,max:l=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=t,g=d!==void 0,[_,v]=e.useState(()=>f??c),y=g?d:_;return(0,q.jsx)(`input`,{ref:n,type:`range`,min:c,max:l,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:G(u$({size:a,orientation:o,block:s}),r),style:{...i,"--slider-fill":`${d$(y,c,l)}%`},"aria-orientation":o===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":a,"data-orientation":o,"data-block":s,"data-disabled":p,...h})}f$.displayName=`Slider`;var p$=K(f$);const m$={root:`splitter`};function h$(e,t){let{className:n,orientation:r=`horizontal`,splitterRef:i,...a}=e;return(0,q.jsx)(Ce,{elementRef:t,groupRef:i,orientation:r,className:G(m$.root,n),"data-component":`Splitter`,"data-orientation":r,...a})}h$.displayName=`Splitter`;var g$=K(h$);const _$={root:`splitter-panel`};function v$(e,t){let{className:n,...r}=e;return(0,q.jsx)(we,{elementRef:t,className:G(_$.root,n),"data-component":`Splitter.Panel`,...r})}v$.displayName=`Splitter.Panel`;var y$=K(v$);const b$={root:`splitter-resize-trigger`};function x$(e,t){let{className:n,...r}=e;return(0,q.jsx)(Te,{elementRef:t,className:G(b$.root,n),"data-component":`Splitter.ResizeTrigger`,...r})}x$.displayName=`Splitter.ResizeTrigger`;var S$=K(x$);const C$={root:`splitter-resize-trigger-indicator`};function w$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(C$.root,n),"data-component":`Splitter.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}w$.displayName=`Splitter.ResizeTriggerIndicator`;var T$=K(w$);const E$={root:`splitter-resize-trigger-separator`};function D$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(E$.root,n),"data-component":`Splitter.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}D$.displayName=`Splitter.ResizeTriggerSeparator`;var O$=K(D$);const k$=Object.assign(g$,{Panel:y$,ResizeTrigger:S$,ResizeTriggerSeparator:O$,ResizeTriggerIndicator:T$}),A$={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`},j$={open:null,closed:null,draft:Zn,archived:An,unavailable:zr,issueOpened:xr,issueClosed:Gn,issueClosedNotPlanned:br,issueDraft:Zn,pullOpened:Un,pullClosed:rr,pullMerged:gr,pullQueued:er,alertOpened:Dr,alertClosed:Er,alertFixed:wr,alertDismissed:Tr},M$={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`},N$=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`}}}),P$=W(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function F$(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=j$[i],l=M$[i];return(0,q.jsxs)(n,{ref:t,className:G(N$({size:a,tone:A$[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,q.jsx)(c,{className:G(P$({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}F$.displayName=`StateLabel`;var I$=K(F$);const L$=n({}),R$={root:`statistic-card-description`};function z$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(R$.root,n),"data-component":`StatisticCard.Description`,...r})}z$.displayName=`StatisticCard.Description`;var B$=K(z$);const V$={root:`statistic-card-label`};function H$(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(L$);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(V$.root,r),"data-component":`StatisticCard.Label`,...a})}H$.displayName=`StatisticCard.Label`;var U$=K(H$);const W$={root:`statistic-card-trailing-visual`};function G$(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(W$.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}G$.displayName=`StatisticCard.TrailingVisual`;var K$=K(G$);const q$={hidden:`sr-only`},J$={increase:Vn,decrease:Mn,neutral:Or},Y$={increase:`Up`,decrease:`Down`,neutral:`No change`},X$={increase:`positive`,decrease:`negative`,neutral:`neutral`},Z$=W(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function Q$(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=J$[i],c=a??X$[i];return(0,q.jsxs)(`span`,{ref:t,className:G(Z$({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:q$.hidden,children:Y$[i]}),r]})}Q$.displayName=`StatisticCard.Trend`;var $$=K(Q$);const e1={root:`statistic-card-value`};function t1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(e1.root,n),"data-component":`StatisticCard.Value`,...r})}t1.displayName=`StatisticCard.Value`;var n1=K(t1);const r1={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function i1(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${Y(i)}-label`,[l,u]=si(r,{trailingVisual:K$,label:U$,value:n1,trend:$$,description:B$}),d=o??(l.label&&!a?c:void 0);return(0,q.jsx)(L$.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(r1.root,n),"data-component":`StatisticCard`,...s,children:[(0,q.jsxs)(`div`,{className:r1.body,children:[l.label,l.value||l.trend?(0,q.jsxs)(`div`,{className:r1.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}i1.displayName=`StatisticCard`;var a1=K(i1);const o1=Object.assign(a1,{Label:U$,Value:n1,Trend:$$,Description:B$,TrailingVisual:K$}),s1=n({}),c1={srOnly:`sr-only`},l1=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 u1(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,q.jsx)(s1.Provider,{value:{variant:i,size:a},children:(0,q.jsxs)(n,{ref:t,className:G(l1({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,q.jsx)(`span`,{className:c1.srOnly,children:o}):null,s]})})}u1.displayName=`Status`;var d1=K(u1);const f1=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 p1(t,n){let{className:r,variant:i,size:a,...o}=t,s=e.useContext(s1),c=i??s.variant??`neutral`,l=a??s.size??`medium`;return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(f1({variant:c,size:l}),r),"data-component":`Status.Indicator`,"data-variant":c,"data-size":l,...o})}p1.displayName=`Status.Indicator`;var m1=K(p1);const h1=Object.assign(d1,{Indicator:m1}),g1=n(null),_1=1,v1=W(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),y1=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),b1=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function x1(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=y1(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(v1({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)(g1.Provider,{value:{index:t,status:b1(t,i)},children:e},e.key))})}x1.displayName=`Steps`;var S1=K(x1);const C1={root:`steps-body`};function w1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(C1.root,n),"data-component":`Steps.Body`,...r})}w1.displayName=`Steps.Body`;var T1=K(w1);const E1={root:`steps-description`};function D1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(E1.root,n),"data-component":`Steps.Description`,...r})}D1.displayName=`Steps.Description`;var O1=K(D1);const k1=()=>{let e=o(g1);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},A1={root:`steps-indicator`,icon:`steps-indicator-icon`};function j1(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=k1();return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(A1.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,q.jsx)(Kn,{className:A1.icon}):a+1)})}j1.displayName=`Steps.Indicator`;var M1=K(j1);const N1={root:`steps-item`,status:`sr-only`},P1={complete:`Completed`,current:``,incomplete:`Not completed`};function F1(t,n){let{className:r,children:i,status:a,statusLabel:o,...s}=t,{index:c,status:l}=k1(),u=a??l,d=o??P1[u],f=e.useMemo(()=>({index:c,status:u}),[c,u]);return(0,q.jsx)(g1.Provider,{value:f,children:(0,q.jsxs)(`li`,{ref:n,"aria-current":u===`current`?`step`:void 0,className:G(N1.root,r),"data-component":`Steps.Item`,"data-status":u,"data-index":c,...s,children:[i,d?(0,q.jsx)(`span`,{className:N1.status,children:d}):null]})})}F1.displayName=`Steps.Item`;var I1=K(F1);const L1={root:`steps-title`};function R1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(L1.root,n),"data-component":`Steps.Title`,...r})}R1.displayName=`Steps.Title`;var z1=K(R1);const B1=Object.assign(S1,{Item:I1,Indicator:M1,Body:T1,Title:z1,Description:O1}),V1=n({}),H1=W(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function U1(t,n){let{as:r=`span`,className:i,swap:a=!1,transition:o=`fade`,children:s,...c}=t,l=e.useMemo(()=>({swap:a}),[a]);return(0,q.jsx)(V1.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G(H1({transition:o}),i),"data-component":`Swap`,"data-swap":a?`on`:`off`,"data-transition":o,...c,children:s})})}U1.displayName=`Swap`;var W1=K(U1);const G1={root:`swap-indicator`,active:`swap-indicator-active`};function K1(t,n){let{as:r=`span`,className:i,type:a,...o}=t,{swap:s}=e.useContext(V1),c=a===(s?`on`:`off`);return(0,q.jsx)(r,{ref:n,"aria-hidden":c?void 0:`true`,className:G(G1.root,c&&G1.active,i),"data-component":`Swap.Indicator`,"data-type":a,"data-active":c,...o})}K1.displayName=`Swap.Indicator`;var q1=K(K1);const J1=Object.assign(W1,{Indicator:q1}),Y1={root:`table-of-contents`};function X1(e,t){let{className:n,"aria-label":r,"aria-labelledby":i,...a}=e;return(0,q.jsx)(`nav`,{ref:t,"aria-label":r||i?r:`Table of contents`,"aria-labelledby":i,className:G(Y1.root,n),"data-component":`TableOfContents`,...a})}X1.displayName=`TableOfContents`;var Z1=K(X1);const Q1={root:`table-of-contents-list`};function $1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`ul`,{ref:t,role:`list`,className:G(Q1.root,n),"data-component":`TableOfContents.List`,...r})}$1.displayName=`TableOfContents.List`;var e0=K($1);const t0={root:`table-of-contents-group`,label:`table-of-contents-group-label`,link:`table-of-contents-link`,active:`table-of-contents-link-active`,list:`table-of-contents-group-list`};function n0(e,t){let{label:n,href:r,active:i=!1,className:a,children:o,onClick:s,...c}=e;return(0,q.jsxs)(`li`,{ref:t,className:G(t0.root,a),"data-component":`TableOfContents.Group`,...c,children:[r?(0,q.jsx)(`a`,{href:r,onClick:s,"aria-current":i?`true`:void 0,className:G(t0.link,i&&t0.active),"data-component":`TableOfContents.Group.Label`,children:n}):(0,q.jsx)(`p`,{className:t0.label,"data-component":`TableOfContents.Group.Label`,children:n}),(0,q.jsx)(e0,{className:t0.list,children:o})]})}n0.displayName=`TableOfContents.Group`;var r0=K(n0);const i0={item:`table-of-contents-item`,link:`table-of-contents-link`,active:`table-of-contents-link-active`};function a0(e,t){let{as:n=`a`,active:r=!1,className:i,...a}=e;return(0,q.jsx)(`li`,{className:i0.item,children:(0,q.jsx)(n,{ref:t,"aria-current":r?`true`:void 0,className:G(i0.link,r&&i0.active,i),"data-component":`TableOfContents.Item`,...a})})}a0.displayName=`TableOfContents.Item`;var o0=K(a0);const s0={root:`table-of-contents-title`};function c0(e,t){let{as:n=`p`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(s0.root,r),"data-component":`TableOfContents.Title`,...i})}c0.displayName=`TableOfContents.Title`;var l0=K(c0);const u0=({ids:t,offset:n=0,root:r=null,trackHash:i=!0})=>{let[a,o]=e.useState(null),s=e.useRef(!1),c=t.join(`\0`);e.useEffect(()=>{if(typeof IntersectionObserver>`u`)return;let e=c.split(`\0`).map(e=>document.getElementById(e)).filter(e=>e!==null);if(e.length===0)return;let t=new Set,i=new IntersectionObserver(n=>{for(let e of n)e.isIntersecting?t.add(e.target):t.delete(e.target);let r=e.find(e=>t.has(e));r&&!s.current&&o(r.id)},{root:r,rootMargin:`-${n}px 0px 0px 0px`});for(let t of e)i.observe(t);return()=>{i.disconnect()}},[c,n,r]);let l=e.useRef(void 0),u=e.useRef(null),d=e.useCallback(e=>{u.current?.(),s.current=!0,o(e);let t=r??window,n=()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>{u.current?.(),s.current=!1},150)};t.addEventListener(`scroll`,n,{passive:!0}),u.current=()=>{window.clearTimeout(l.current),t.removeEventListener(`scroll`,n),u.current=null},n()},[r]);return e.useEffect(()=>()=>u.current?.(),[]),e.useEffect(()=>{if(!i)return;let e=new Set(c.split(`\0`)),t=()=>{let t=decodeURIComponent(window.location.hash.slice(1));t&&e.has(t)&&d(t)};return t(),window.addEventListener(`hashchange`,t),()=>{window.removeEventListener(`hashchange`,t)}},[i,c,d]),{activeId:a,selectSection:d}},d0=Object.assign(Z1,{Title:l0,List:e0,Item:o0,Group:r0}),f0=n(null);function p0(t){let{children:n,id:r,value:i,defaultValue:a,onChange:o}=t,s=Y(r),c=i!==void 0,[l,u]=e.useState(a),d=c?i:l,f=e.useRef(o);Ea(()=>{f.current=o},[o]);let p=e.useMemo(()=>({groupId:s,selectedValue:d,selectTab:e=>{c||u(e),f.current?.(e)}}),[s,d,c]);return(0,q.jsx)(f0.Provider,{value:p,children:n})}p0.displayName=`Tabs`;const m0=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},h0=()=>{let e=o(f0);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},g0=e=>{let{value:t,disabled:n}=e,r=h0(),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)}}}},_0={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function v0(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=g0({value:r,disabled:i});return(0,q.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:m0(a,u.onKeyDown),onMouseDown:m0(o,u.onMouseDown),onFocus:m0(s,u.onFocus),className:G(_0.root,_0.vertical,_0.hover,l&&_0.selected,i&&_0.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}v0.displayName=`Tabs.Tab`;var y0=K(v0);const b0=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),x0=t=>{let{"aria-label":n,"aria-labelledby":r,"aria-orientation":i,ref:a}=t,o=e.useRef(null),s=Be(a,o),c=i??`horizontal`;return{tabListProps:{ref:s,role:`tablist`,"aria-label":n,"aria-labelledby":r,"aria-orientation":c,onKeyDown:e=>{let t=o.current;if(!t)return;let n=c===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,a=e.key===`Home`||e.key===`End`,s=e.key===r?1:e.key===i?-1:0;if(s===0&&!a)return;e.preventDefault(),e.stopPropagation();let l=b0(t);if(l.length===0)return;if(a){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+s+l.length)%l.length].focus()}}}},S0={root:`tab-list`,vertical:`tab-list-vertical`};function C0(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=x0({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,q.jsx)(`div`,{...s,...c,onKeyDown:m0(r,c.onKeyDown),className:G(S0.root,l&&S0.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}C0.displayName=`Tabs.List`;var w0=K(C0);const T0=e=>{let{value:t}=e,n=h0(),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 E0(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=T0({value:r});return(0,q.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}E0.displayName=`Tabs.Panel`;var D0=K(E0);const O0=Object.assign(p0,{List:w0,Tab:y0,Panel:D0}),k0={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},A0=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function j0(e,t){let{className:n,clipSidebar:r,...i}=e,a=A0(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(k0.root,(a===`start`||a===`both`)&&k0.clipStart,(a===`end`||a===`both`)&&k0.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}j0.displayName=`Timeline`;var M0=K(j0);const N0={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function P0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(N0.root,N0.narrow,n),"data-component":`Timeline.Actions`,...r})}P0.displayName=`Timeline.Actions`;var F0=K(P0);const I0={root:`timeline-avatar`};function L0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(I0.root,n),"data-component":`Timeline.Avatar`,...r})}L0.displayName=`Timeline.Avatar`;var R0=K(L0);const z0={wrapper:`timeline-badge-wrapper`},B0=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 V0(e,t){let{className:n,variant:r,...i}=e;return(0,q.jsx)(`div`,{className:z0.wrapper,children:(0,q.jsx)(`div`,{ref:t,className:G(B0({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}V0.displayName=`Timeline.Badge`;var H0=K(V0);const U0={root:`timeline-body`};function W0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(U0.root,n),"data-component":`Timeline.Body`,...r})}W0.displayName=`Timeline.Body`;var G0=K(W0);const K0={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function q0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`li`,{ref:t,role:`presentation`,className:G(K0.root,K0.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}q0.displayName=`Timeline.Break`;var J0=K(q0);const Y0={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 X0(e,t){let{className:n,condensed:r,...i}=e;return(0,q.jsx)(`li`,{ref:t,className:G(Y0.root,Y0.rail,Y0.narrow,r&&Y0.condensed,r&&Y0.condensedBadge,r&&Y0.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}X0.displayName=`Timeline.Item`;var Z0=K(X0);const Q0=Object.assign(M0,{Item:Z0,Avatar:R0,Badge:H0,Body:G0,Break:J0,Actions:F0});let $0=[],e2=0;const t2=new Set,n2=()=>{for(let e of t2)e()},r2=e=>(t2.add(e),()=>{t2.delete(e)}),i2=()=>$0,a2=[],o2=()=>a2,s2=e=>($0=$0.some(t=>t.id===e.id)?$0.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...$0],n2(),e.id),c2=e=>($0=$0.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),n2(),e),l2=e=>{$0=$0.filter(t=>t.id!==e),n2()},u2=()=>`toast-${++e2}`,d2=(e,t,n={})=>s2({...n,id:n.id??u2(),title:t,variant:e}),f2=(e,t)=>typeof e==`function`?e(t):e,p2=(e,t,n={})=>{let r=n.id??u2();d2(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){c2(r);return}d2(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,f2(t.success,e)),e=>i(`error`,f2(t.error,e))),r},m2=(e,t)=>d2(`default`,e,t),h2=Object.assign(m2,{message:m2,success:(e,t)=>d2(`success`,e,t),error:(e,t)=>d2(`error`,e,t),warning:(e,t)=>d2(`warning`,e,t),info:(e,t)=>d2(`info`,e,t),loading:(e,t)=>d2(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>s2({...t,id:t.id??u2(),variant:`default`,render:e}),promise:p2,dismiss:c2,getToasts:i2}),g2={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`},_2={default:null,success:Gn,error:or,warning:zr,info:fr,loading:null},v2=t=>typeof t==`object`&&!!t&&`label`in t&&!e.isValidElement(t);function y2(t){let{toast:n,place:r,position:i,height:a,frontHeight:o,stackSize:s,expanded:c,visible:l,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=t,{id:h,variant:g,title:_,description:v,render:y}=n,b=n.duration??p.duration,x=n.dismissible??p.dismissible,S=n.closeButton??p.closeButton,C=n.richColors??p.richColors,w=n.important??p.important??!1,T=e.useRef(null),[E,D]=e.useState(!1),[O,k]=e.useState({x:0,y:0}),[A,j]=e.useState(!1),[M,N]=e.useState(!1),P=e.useRef(null),F=!!n.dismissed,I=r.index===0,L=E&&!c&&!I,ee=!!y,R=i.startsWith(`top`)?`top`:`bottom`,te=e=>{n.dismissed||(c2(h),e===`timeout`?n.onAutoClose?.(n):n.onDismiss?.(n))};e.useEffect(()=>{D(!0)},[]);let z=e.useRef({revision:-1,time:b});e.useEffect(()=>{if(z.current.revision!==n.revision&&(z.current={revision:n.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),t=window.setTimeout(()=>te(`timeout`),Math.max(z.current.time,0));return()=>{window.clearTimeout(t),z.current.time-=Date.now()-e}},[n,b,u,F]),e.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>l2(h),200);return()=>{window.clearTimeout(e)}},[F,h]),Ea(()=>{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,n.revision,_,v,c]);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),te(`swipe`)},ae=()=>{P.current=null,j(!1),k({x:0,y:0})},oe=c?`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":r.index,"--toast-offset":`${r.offset}px`,"--toast-z-index":s-r.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?o:a),"--toast-shift":E?!F||M?oe:I?se:c?`calc(${oe} + ${se})`:oe:se,"--toast-scale":L?Math.max(1-r.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},le=_2[g],ue=n.icon===void 0?f?.[g]:n.icon,de=ue===void 0?g===`loading`?(0,q.jsx)(zi,{size:`small`,srText:null}):le?(0,q.jsx)(le,{}):null:ue,fe=(e,t,n)=>v2(e)?(0,q.jsx)($i,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||te(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,pe=n.action!==void 0||n.cancel!==void 0;return(0,q.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:G(g2.root,g2.lift[R],g2.bridge,R===`top`?g2.bridgeTop:g2.bridgeBottom,x&&g2.grabbable,!ee&&g2.card,!ee&&g2.iconColor[g],!ee&&C&&g2.richColors[g],(!E||F||!l)&&g2.hidden,!l&&g2.waiting,A?g2.dragging:g2.animated,p.className,n.className),style:ce,"data-component":`Toast`,"data-variant":g,"data-position":i,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":c,"data-stacked":L,"data-visible":l,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:V,onPointerUp:ie,onPointerCancel:ae,children:ee?y?.(n):(0,q.jsxs)(`div`,{className:G(g2.body,L&&g2.bodyStacked),"data-component":`Toast.Body`,children:[de===null?null:(0,q.jsx)(`span`,{className:g2.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:de}),(0,q.jsxs)(`div`,{className:g2.content,"data-component":`Toast.Content`,children:[(0,q.jsx)(`div`,{className:g2.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,q.jsx)(`div`,{className:g2.description,"data-component":`Toast.Description`,children:v})]}),pe?(0,q.jsxs)(`div`,{className:g2.actions,"data-component":`Toast.Actions`,children:[fe(n.cancel,`cancel`,`invisible`),fe(n.action,`action`,`default`)]}):null,S&&x?(0,q.jsx)(na,{icon:ir,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>te(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}y2.displayName=`Toast`;const b2=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`}}}),x2=[`altKey`,`KeyT`],S2=e=>typeof e==`number`?`${e}px`:e,C2=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},w2=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),T2=()=>document.visibilityState===`hidden`,E2=()=>!1;function D2(t,n){let{position:r=`bottom-right`,expand:i=!1,visibleToasts:a=3,toastOptions:o,duration:s=4e3,closeButton:c=!1,richColors:l=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=x2,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=t,x=e.useSyncExternalStore(r2,i2,o2),S=e.useSyncExternalStore(w2,T2,E2),C=e.useRef(null),w=Be(n,C),[T,E]=e.useState({}),[D,O]=e.useState(!1),k=i||D,A=e.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);e.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=e.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;e.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:s,closeButton:c,richColors:l,dismissible:!0,...o},L=h??C2(r);return(0,q.jsx)(Va,{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(b2({position:r}),v),style:{...y,"--toaster-width":S2(p),"--toaster-viewport-offset":S2(d),"--toaster-mobile-offset":S2(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":r,"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)(y2,{toast:e,place:t,position:r,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<a,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}D2.displayName=`Toaster`;var O2=K(D2);const k2=2e3,A2={content:`toggle-switch-content`,srOnly:`sr-only`},j2=`toggle-switch-icon`,M2=W(`toggle-switch`,{variants:{statusLabelPosition:{start:`toggle-switch-label-start`,end:`toggle-switch-label-end`}}}),N2=W(`toggle-switch-status`,{variants:{statusLabelPosition:{start:``,end:`toggle-switch-status-end`}}}),P2=W(`toggle-switch-status-label`,{variants:{size:{small:`toggle-switch-status-label-small`,medium:`toggle-switch-status-label-medium`},disabled:{true:`toggle-switch-status-label-disabled`,false:``}}}),F2=W(`toggle-switch-status-text`,{variants:{hidden:{true:`toggle-switch-status-text-hidden`,false:``}}}),I2=W(`toggle-switch-track`,{variants:{size:{small:`toggle-switch-track-small`,medium:`toggle-switch-track-medium`},track:{off:`toggle-switch-track-off`,on:`toggle-switch-track-on`,disabled:`toggle-switch-track-disabled`}}}),L2=W(j2,{variants:{disabled:{true:`toggle-switch-circle-icon-disabled`,false:`toggle-switch-circle-icon`},checked:{true:`translate-x-0`,false:`-translate-x-full`}}}),R2=W(j2,{variants:{disabled:{true:`toggle-switch-line-icon-disabled`,false:`toggle-switch-line-icon`},checked:{true:`translate-x-full`,false:`translate-x-0`}}}),z2=W(`toggle-switch-knob`,{variants:{checked:{true:`toggle-switch-knob-checked`,false:`translate-x-0`},disabled:{true:`toggle-switch-knob-disabled`,false:``}}}),B2={small:12,medium:16},V2=({size:e})=>(0,q.jsx)(`svg`,{"aria-hidden":`true`,width:B2[e],height:B2[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,d:`M8 12.5a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12Z`})}),H2=({size:e})=>(0,q.jsx)(`svg`,{"aria-hidden":`true`,width:B2[e],height:B2[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,d:`M8 2a.75.75 0 0 1 .75.75v11.5a.75.75 0 0 1-1.5 0V2.75A.75.75 0 0 1 8 2Z`})});function U2(t,n){let{className:r,checked:i,defaultChecked:a,disabled:o,loading:s,onChange:c,onClick:l,size:u=`medium`,statusLabelPosition:d=`start`,buttonType:f=`button`,loadingLabel:p=`Loading`,loadingLabelDelay:m=k2,buttonLabelOn:h=`On`,buttonLabelOff:g=`Off`,"aria-labelledby":_,"aria-describedby":v,...y}=t,b=i!==void 0,[x,S]=e.useState(!!a),C=b?i:x,w=!o&&!s,T=`${Y()}-loading-label`,[E,D]=e.useState(!1);e.useEffect(()=>{if(!s){D(!1);return}let e=window.setTimeout(()=>{D(!0)},m);return()=>{window.clearTimeout(e)}},[s,m]);let O=e=>{w&&(b||S(!C),c?.(!C),l?.(e))},k=[E?T:void 0,v].filter(Boolean).join(` `);return(0,q.jsxs)(`div`,{className:G(M2({statusLabelPosition:d}),r),"data-component":`ToggleSwitch`,"data-size":u,"data-status-label-position":d,"data-checked":C,"data-disabled":!w,"data-loading":s?`true`:void 0,...y,children:[(0,q.jsx)(`span`,{id:T,role:`status`,className:A2.srOnly,children:E?p:``}),s?(0,q.jsx)(`span`,{className:G(N2({statusLabelPosition:d})),"data-component":`ToggleSwitch.LoadingSpinner`,children:(0,q.jsx)(zi,{size:`small`,srText:null,role:`presentation`})}):null,(0,q.jsxs)(`span`,{className:G(P2({size:u,disabled:!w})),"aria-hidden":`true`,onClick:O,"data-component":`ToggleSwitch.StatusText`,children:[(0,q.jsx)(`span`,{className:G(F2({hidden:!C})),children:h}),(0,q.jsx)(`span`,{className:G(F2({hidden:C})),children:g})]}),(0,q.jsxs)(`button`,{ref:n,type:f,className:G(I2({size:u,track:w?C?`on`:`off`:`disabled`})),onClick:O,"aria-labelledby":_,"aria-describedby":k||void 0,"aria-pressed":C,"aria-disabled":!w,"data-component":`ToggleSwitch.SwitchButton`,children:[(0,q.jsxs)(`span`,{className:A2.content,"aria-hidden":`true`,children:[(0,q.jsx)(`span`,{className:G(L2({disabled:!w,checked:C})),"data-component":`ToggleSwitch.LineIcon`,children:(0,q.jsx)(H2,{size:u})}),(0,q.jsx)(`span`,{className:G(R2({disabled:!w,checked:C})),"data-component":`ToggleSwitch.CircleIcon`,children:(0,q.jsx)(V2,{size:u})})]}),(0,q.jsx)(`span`,{className:G(z2({checked:C,disabled:!w})),"aria-hidden":`true`,"data-component":`ToggleSwitch.ToggleKnob`})]})]})}U2.displayName=`ToggleSwitch`;var W2=K(U2);const G2=W(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),K2=`medium`,q2=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function J2(e,t){let{as:n=`span`,className:r,size:i=K2,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=q2({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(G2({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})}J2.displayName=`TokenBase`;var Y2=K(J2);const X2=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 Z2(e){let{className:t,size:n=K2,isParentInteractive:r,...i}=e,a=G(X2({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)(ir,{})}):(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(ir,{})})}Z2.displayName=`Token.RemoveButton`;const Q2={root:`token-text`,interactive:`token-text-interactive`};function $2(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,q.jsx)(n,{ref:t,className:G(Q2.root,i&&Q2.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}$2.displayName=`Token.Text`;var e4=K($2);const t4={srOnly:`sr-only`},n4=W(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),r4=W(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),i4=t=>e.isValidElement(t)?t:(0,q.jsx)(t,{});function a4(e,t){let{as:n,className:r,text:i,size:a=K2,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=q2({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)(Y2,{ref:t,size:a,isSelected:l,onRemove:s,className:G(n4({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(r4({size:a})),"data-component":`Token.LeadingVisual`,children:i4(o)}):null,(0,q.jsxs)(e4,{interactive:h,...h?g:{},children:[i,s?(0,q.jsx)(`span`,{className:t4.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,q.jsx)(Z2,{size:a,isParentInteractive:p,onClick:_}):null]})}a4.displayName=`Token`;var o4=K(a4);const s4=`#999999`,c4=.6,l4=(e,t,n)=>Math.max(t,Math.min(e,n)),u4=e=>l4(Math.round(e),0,100),d4=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}},f4=({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)}},p4=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,m4=e=>{let t=d4(e)??d4(`#999999`),{h:n,s:r,l:i}=f4(t),a=p4(t),{r:o,g:s,b:c}=t,l=l4(1/(.453-a),0,1),u=l4((a-.96)*100,0,1),d=(c4-a)*100*l4(1/(c4-a),0,1),f=u4(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${u4(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${u4(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}%, ${u4(i+10)}%, 0.3)`}}},h4={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function g4(t,n){let{as:r,className:i,style:a,text:o,size:s=K2,fillColor:c=s4,onRemove:l,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=t,h=e.useMemo(()=>m4(c),[c]),g=q2({as:r,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!l&&!u,v=g&&_,y={as:r,href:f,onClick:p},b=e=>{e.stopPropagation(),l?.()};return(0,q.jsxs)(Y2,{ref:n,size:s,isSelected:d,onRemove:l,className:G(h4.root,g&&h4.interactive,d&&h4.selected,_&&h4.withRemoveButton,i),style:{...a,"--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)(e4,{interactive:v,...v?y:{},children:[o,l?(0,q.jsx)(`span`,{className:h4.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,q.jsx)(Z2,{size:s,isParentInteractive:g,onClick:b}):null]})}g4.displayName=`IssueLabelToken`;var _4=K(g4);const v4={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function y4(e,t){let{as:n=`a`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(v4.root,v4.interactive,v4.hover,r),"data-component":`TopicTag`,...i})}y4.displayName=`TopicTag`;var b4=K(y4);const x4={root:`topic-tag-group`};function S4(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(x4.root,r),"data-component":`TopicTag.Group`,...i})}S4.displayName=`TopicTag.Group`;var C4=K(S4);const w4=Object.assign(b4,{Group:C4}),T4=n(null),E4=n(null),D4=4,O4=8,k4=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,A4=e=>e!==null&&e.effect===void 0,j4=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function M4(t){let{steps:n,step:r,defaultStep:i=null,onStepChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,onStatusChange:l,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=t,_=Y(h),v=`${_}-title`,y=`${_}-description`,b=e.useRef(null),x=o!==void 0,[S,C]=e.useState(s),w=x?o:S,T=r!==void 0,[E,D]=e.useState(i),O=T?r:E,k=n.length,A=n.findIndex(e=>e.id===O),j=A===-1?null:n[A],M=e.useCallback(e=>{T||D(e),a?.({stepId:e,stepIndex:n.findIndex(t=>t.id===e),count:n.length})},[T,a,n]),N=e.useCallback(e=>{x||C(e),c?.(e)},[x,c]),P=e.useCallback(e=>{let t=e??n[0]?.id??null;M(t),N(!0),l?.({status:`started`})},[N,M,l,n]),F=e.useCallback(e=>{n.some(t=>t.id===e)&&M(e)},[M,n]),I=e.useCallback(()=>{M(null),N(!1)},[N,M]),L=e.useCallback(()=>{I(),l?.({status:`dismissed`})},[I,l]),ee=e.useCallback(()=>{let e=n[A+1];if(!e){I(),l?.({status:`completed`});return}M(e.id)},[M,I,l,A,n]),R=e.useCallback(()=>{let e=A>0?n[A-1]:void 0;e&&M(e.id)},[M,A,n]),[te,z]=e.useState(()=>({stepId:O,ready:A4(j),patch:null}));te.stepId!==O&&z({stepId:O,ready:A4(j),patch:null});let ne=te.stepId===O?te:null,B=ne?.ready??A4(j),re=ne?.patch??null,V=e.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ie=k4(V),ae=e.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});Ea(()=>{ae.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let oe=e.useMemo(()=>({next:()=>ae.current.next(),prev:()=>ae.current.prev(),goto:e=>ae.current.goto(e),dismiss:()=>ae.current.dismiss(),show:()=>z(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>z(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>ae.current.step?.target?.()??null}),[O]);e.useEffect(()=>{if(w)return ae.current.step?.effect?.(oe)??void 0},[oe,w]);let se=e.useCallback(()=>ae.current.step?.target?.()??null,[]),[ce,le]=e.useState(null),ue=e.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&&j4(e,a)?e:a)},[se]);Ea(()=>{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]),ka(e=>{!w||!d||(e.preventDefault(),L())}),e.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]),e.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]),e.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let de=e.useMemo(()=>({open:w,step:V,stepIndex:A,steps:n,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,n]),fe=e.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)(T4.Provider,{value:fe,children:g})}M4.displayName=`Tour`;const N4=[];function P4(t){let n=e.useContext(T4);return(0,q.jsx)(q.Fragment,{children:t.children(n?.step?.actions??N4)})}P4.displayName=`Tour.Actions`;const F4={root:`tour-action-trigger`};function I4(t,n){let{action:r,className:i,children:a,onClick:o,variant:s=`default`,...c}=t,l=e.useContext(T4);return l?(0,q.jsx)($i,{ref:n,variant:s,className:G(F4.root,i),onClick:e=>{if(o?.(e),!e.defaultPrevented){if(typeof r.action==`function`){r.action(l);return}r.action===`next`?l.next():r.action===`prev`?l.prev():l.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof r.action==`string`?r.action:`custom`,...c,children:a??r.label}):null}I4.displayName=`Tour.ActionTrigger`;var L4=K(I4);const R4={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},z4={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 B4(t,n){let r=e.useContext(T4),i=e.useContext(E4);if(!r||!i||r.stepType!==`tooltip`||r.step?.arrow===!1)return null;let a=R4[i.side],o=`${a}${z4[a][i.align]}`;return(0,q.jsx)(Ud,{ref:n,location:o,"data-component":`Tour.Arrow`,...t})}B4.displayName=`Tour.Arrow`;var V4=K(B4);const H4=W([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function U4(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(T4);if(!s||!s.open||!s.ready||s.step?.backdrop===!1)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Va,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(H4({spotlit:c!==null}),r),style:{...i,"--tour-target-top":`${(c?.top??0)-l}px`,"--tour-target-left":`${(c?.left??0)-l}px`,"--tour-target-width":`${(c?.width??0)+l*2}px`,"--tour-target-height":`${(c?.height??0)+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":c?``:void 0,...o})})}U4.displayName=`Tour.Backdrop`;var W4=K(U4);const G4={root:`tour-close-trigger`};function K4(t,n){let{className:r,icon:i=ir,onClick:a,"aria-label":o=`Close tour`,...s}=t,c=e.useContext(T4);return c?(0,q.jsx)(na,{ref:n,icon:i,variant:`invisible`,size:`small`,"aria-label":o,className:G(G4.root,r),onClick:e=>{a?.(e),!e.defaultPrevented&&c.dismiss()},"data-component":`Tour.CloseTrigger`,...s}):null}K4.displayName=`Tour.CloseTrigger`;var q4=K(K4);const J4={root:`tour-content`};function Y4(t,n){let{className:r,...i}=t,a=e.useContext(T4),o=Be(n,a?.contentRef??null),s=a?.step?.id??null,c=a?.ready??!1,l=a?.contentRef;return e.useEffect(()=>{!c||!s||l?.current?.focus()},[l,c,s]),!a||!a.open||!a.ready||!a.step?null:(0,q.jsx)(`div`,{ref:o,role:`dialog`,"aria-labelledby":a.step.title?a.titleId:void 0,"aria-describedby":a.step.description?a.descriptionId:void 0,tabIndex:-1,className:G(J4.root,r),"data-component":`Tour.Content`,"data-type":a.stepType,"data-step":a.step.id,...i})}Y4.displayName=`Tour.Content`;var X4=K(Y4);const Z4={root:`tour-control`};function Q4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(Z4.root,n),"data-component":`Tour.Control`,...r})}Q4.displayName=`Tour.Control`;var $4=K(Q4);const e3={root:`tour-description`};function t3(t,n){let{className:r,children:i,...a}=t,o=e.useContext(T4);return o?(0,q.jsx)(`div`,{ref:n,id:o.descriptionId,className:G(e3.root,r),"data-component":`Tour.Description`,...a,children:i??o.step?.description}):null}t3.displayName=`Tour.Description`;var n3=K(t3);const r3=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:``}}}),i3=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function a3(t,n){let{side:r=`outside-bottom`,align:i=`center`,placement:a=`bottom-end`,portalContainerName:o,className:s,style:c,children:l,...u}=t,d=e.useContext(T4),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??r,g=f?.align??i,_=f?.placement??a,v=!!(d?.open&&d.ready&&f),y=e.useRef(null),b=Be(n,y),x=e.useRef(null),[S,C]=e.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=e.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=Ka(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&i3(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return Ea(()=>{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)(Va,{containerName:o,children:(0,q.jsx)(`div`,{ref:b,className:G(r3({type:p,unplaced:m&&!S}),s),style:{...c,"--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)(E4.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:l})})})}a3.displayName=`Tour.Positioner`;var o3=K(a3);const s3={root:`tour-progress-text`};function c3(t,n){let{className:r,children:i,...a}=t,o=e.useContext(T4);return o?(0,q.jsx)(`div`,{ref:n,className:G(s3.root,r),"data-component":`Tour.ProgressText`,...a,children:i??o.progressText}):null}c3.displayName=`Tour.ProgressText`;var l3=K(c3);const u3={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function d3(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(T4);if(!s||!s.open||!s.ready||!s.targetRect)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Va,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(u3.root,r),style:{...i,"--tour-target-top":`${c.top-l}px`,"--tour-target-left":`${c.left-l}px`,"--tour-target-width":`${c.width+l*2}px`,"--tour-target-height":`${c.height+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...o})})}d3.displayName=`Tour.Spotlight`;var f3=K(d3);const p3={root:`tour-title`};function m3(t,n){let{className:r,children:i,...a}=t,o=e.useContext(T4);return o?(0,q.jsx)(`h2`,{ref:n,id:o.titleId,className:G(p3.root,r),"data-component":`Tour.Title`,...a,children:i??o.step?.title}):null}m3.displayName=`Tour.Title`;var h3=K(m3);const g3=()=>{let e=o(T4);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},_3=(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]},v3=(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()]},y3=(e,t)=>_3(e,t),b3=(e,t,n)=>_3(()=>{let n=e();return n&&n.value===t?n:null},n),x3=Object.assign(M4,{Backdrop:W4,Spotlight:f3,Positioner:o3,Content:X4,Arrow:V4,CloseTrigger:q4,ProgressText:l3,Title:h3,Description:n3,Control:$4,Actions:P4,ActionTrigger:L4}),S3=e.createContext({announceUpdate:()=>{},expandedStateCache:{current:new Map},scrollElementIntoView:()=>{}}),C3=e.createContext({itemId:``,level:1,isSubTreeEmpty:!1,setIsSubTreeEmpty:()=>{},isExpanded:!1,setIsExpanded:()=>{},leadingVisualId:``,trailingVisualId:``,trailingActionId:``}),w3=e.createContext(!1),T3=`[role=tree]`,E3=`[role=treeitem]`,D3=e=>{let t=e.getAttribute(`aria-label`);if(t)return t;let n=e.getAttribute(`aria-labelledby`);return n?document.getElementById(n)?.textContent??``:e.textContent??``},O3=e=>{let t=e.getAttribute(`aria-expanded`);return t===`true`?`open`:t===`false`?`closed`:`end`},k3=e=>!!e.parentElement?.closest(`[role=treeitem][aria-expanded=false]`),A3=e=>{let t=e.querySelector(E3);return t instanceof HTMLElement?t:void 0},j3=e=>{let t=e.closest(`[role=group]`)?.closest(E3);return t instanceof HTMLElement?t:void 0},M3=e=>{let t=e.closest(T3)?.querySelector(E3);return t instanceof HTMLElement?t:void 0},N3=e=>{let t=e.closest(T3);if(!t)return;let n=Array.from(t.querySelectorAll(E3));for(let e=n.length-1;e>=0;e--)if(!k3(n[e]))return n[e]},P3=(e,t)=>{let n=e.closest(T3);if(!n)return;let r=Array.from(n.querySelectorAll(E3)),i=t===`next`?1:-1;for(let t=r.indexOf(e)+i;t>=0&&t<r.length;t+=i)if(!k3(r[t]))return r[t]},F3=e=>{let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`)return t;t=t.parentElement}},I3=(e,t)=>{let n=t?.getBoundingClientRect().height||32,r=F3(e)?.clientHeight??window.innerHeight;return Math.max(Math.floor(r/n),1)},L3=(e,t)=>{let n=e.closest(T3);if(!n)return;let r=Array.from(n.querySelectorAll(E3));if(r.length===0)return;let i=I3(n,r[0].firstElementChild),a=r.indexOf(e),o=Math.floor(a/i),s=a-i*o,c=(o+(t===`next`?1:-1))*i+s;return r[Math.min(Math.max(c,0),r.length-1)]},R3={"open ArrowRight":A3,"closed ArrowLeft":j3,"end ArrowLeft":j3},z3=new Set([`ArrowLeft`,`ArrowRight`]),B3={ArrowUp:e=>P3(e,`previous`),ArrowDown:e=>P3(e,`next`),Backspace:j3,Home:M3,End:N3,PageUp:e=>L3(e,`previous`),PageDown:e=>L3(e,`next`)},V3=(e,t)=>z3.has(t)?R3[`${O3(e)} ${t}`]?.(e):B3[t]?.(e),H3=`[role=treeitem]`,U3=({containerRef:e})=>{Ea(()=>{let t=e.current;if(!t)return;let n=e=>{let n=Array.from(t.querySelectorAll(H3));if(n.length===0)return;let r=(e instanceof HTMLElement&&t.contains(e)?e.closest(H3):null)??n.find(e=>e.tabIndex===0)??n.find(e=>e.getAttribute(`aria-current`)===`true`)??n[0];for(let e of n)e.tabIndex=e===r?0:-1};n();let r=e=>{n(e.target)},i=e=>{if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let n=e.target?.closest(H3);if(!n||!t.contains(n))return;let r=V3(n,e.key);r&&(e.preventDefault(),r.focus())},a=new MutationObserver(()=>n(document.activeElement));return a.observe(t,{childList:!0,subtree:!0}),t.addEventListener(`focusin`,r),t.addEventListener(`keydown`,i),()=>{a.disconnect(),t.removeEventListener(`focusin`,r),t.removeEventListener(`keydown`,i)}},[e])},W3=(e,t)=>e.map((n,r)=>e[(t+r)%e.length]),G3=({containerRef:t,onFocusChange:n})=>{let r=e.useRef(``),i=e.useRef(0),a=e.useRef(n);e.useEffect(()=>{a.current=n},[n]),e.useEffect(()=>{let e=t.current;if(!e)return;let n=null,o=()=>(n??=Array.from(e.querySelectorAll(`[role=treeitem]`)),n),s=new MutationObserver(()=>{n=null});s.observe(e,{childList:!0,subtree:!0});let c=e=>{if(!e.key||e.key.length>1||e.key===` `||e.ctrlKey||e.altKey||e.metaKey)return;r.current+=e.key;let t=o(),n=t.findIndex(e=>e===document.activeElement),s=W3(t,Math.max(n,0)),c=r.current.length===1?s.slice(1):s,l=r.current.toLowerCase(),u=c.find(e=>D3(e).trim().toLowerCase().startsWith(l));u&&a.current(u),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{r.current=``},300),e.preventDefault(),e.stopPropagation()};return e.addEventListener(`keydown`,c),()=>{s.disconnect(),e.removeEventListener(`keydown`,c),window.clearTimeout(i.current)}},[t])},K3={root:`tree-view`,hover:`tree-view-hover`,coarse:`tree-view-coarse`,hidden:`sr-only`};function q3(t,n){let{children:r,className:i,flat:a,truncate:o=!0,...s}=t,c=e.useRef(null),l=Be(n,c),[u,d]=e.useState(``),f=e.useCallback(e=>d(e),[]);U3({containerRef:c}),G3({containerRef:c,onFocusChange:e=>e.focus()});let p=e.useRef(null),m=e.useCallback(e=>{e&&(p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,e.isConnected&&e.scrollIntoView({block:`nearest`,inline:`nearest`})}))},[]);e.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current)},[]);let h=e.useRef(null);h.current??=new Map;let g=e.useMemo(()=>({announceUpdate:f,expandedStateCache:h,scrollElementIntoView:m}),[f,m]);return(0,q.jsxs)(S3.Provider,{value:g,children:[(0,q.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:K3.hidden,"data-component":`TreeView.Announcement`,children:u}),(0,q.jsx)(`ul`,{ref:l,role:`tree`,className:G(K3.root,K3.hover,K3.coarse,i),"data-component":`TreeView`,"data-omit-spacer":a?`true`:void 0,"data-truncate-text":o?`true`:`false`,...s,children:r})]})}q3.displayName=`TreeView`;var J3=e.forwardRef(q3);const Y3={root:`tree-view-directory-icon`};function X3(){let{isExpanded:t}=e.useContext(C3),n=t?ur:dr;return(0,q.jsx)(`span`,{className:Y3.root,"data-component":`TreeView.DirectoryIcon`,children:(0,q.jsx)(n,{})})}X3.displayName=`TreeView.DirectoryIcon`;const Z3=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`];function Q3(t){let{title:n=`Error`,children:r,onRetry:i,onDismiss:a}=t,{itemId:o,setIsExpanded:s}=e.useContext(C3);return(0,q.jsx)(`div`,{onKeyDown:e=>{Z3.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ErrorDialog`,children:(0,q.jsx)(zg,{title:n,confirmButtonContent:`Retry`,cancelButtonContent:`Dismiss`,onClose:e=>{if(window.setTimeout(()=>document.getElementById(o)?.focus()),e===`confirm`){i?.();return}s(!1),a?.()},children:r})})}Q3.displayName=`TreeView.ErrorDialog`;const $3={hidden:`sr-only`},e6=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`],t6=e=>g(e)?(0,q.jsx)(e,{}):e;function n6(t){let{items:n,onClose:r}=t,{itemId:i}=e.useContext(C3);return(0,q.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>{e6.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ActionDialog`,children:(0,q.jsx)(Pv,{title:`Supplemental actions`,onClose:()=>{r?.(),window.setTimeout(()=>document.getElementById(i)?.focus())},children:(0,q.jsx)(_a,{children:n.map(({label:e,onClick:t,icon:n,count:r},i)=>(0,q.jsxs)(_a.Item,{onSelect:t,children:[(0,q.jsx)(_a.LeadingVisual,{children:t6(n)}),e,r?(0,q.jsxs)(_a.TrailingVisual,{children:[r,(0,q.jsx)(`span`,{className:$3.hidden,children:` items`})]}):null]},i))})})})}n6.displayName=`TreeView.ActionDialog`;const r6={visual:`tree-view-visual`,hidden:`sr-only`},i6=(e,t)=>typeof e==`function`?e({isExpanded:t}):e,a6=t=>{let{children:n,label:r,labelId:i,className:a,"data-component":o}=t,{isExpanded:s}=e.useContext(C3);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{id:i,className:r6.hidden,"aria-hidden":`true`,children:r}),(0,q.jsx)(`span`,{className:a,"aria-hidden":`true`,"data-component":o,children:i6(n,s)})]})},o6={root:`tree-view-leading-action`};function s6(e){return(0,q.jsx)(a6,{label:e.label,className:o6.root,"data-component":`TreeView.LeadingAction`,children:e.children})}s6.displayName=`TreeView.LeadingAction`;function c6(t){let{leadingVisualId:n}=e.useContext(C3);return(0,q.jsx)(a6,{label:t.label,labelId:n,className:r6.visual,"data-component":`TreeView.LeadingVisual`,children:t.children})}c6.displayName=`TreeView.LeadingVisual`;const l6={root:`tree-view-sub-tree`,skeletonRow:`tree-view-skeleton-row`,skeletonText:`tree-view-skeleton-text`,muted:`tree-view-muted`,hidden:`sr-only`},u6=[`67%`,`47%`,`73%`,`64%`,`50%`],d6=t=>{let n=e.useRef(t);return e.useEffect(()=>{n.current=t},[t]),n.current},f6=({index:e})=>(0,q.jsxs)(`span`,{className:l6.skeletonRow,style:{"--tree-view-skeleton-width":u6[e%u6.length]},"aria-hidden":`true`,children:[(0,q.jsx)(l$,{size:16,shape:`square`}),(0,q.jsx)(q_,{className:l6.skeletonText})]}),p6=e.forwardRef(({count:e},t)=>{let n=Y();return(0,q.jsx)(w3.Provider,{value:!0,children:(0,q.jsx)(C6,{ref:t,id:n,children:e?(0,q.jsxs)(q.Fragment,{children:[Array.from({length:e},(e,t)=>(0,q.jsx)(f6,{index:t},t)),(0,q.jsxs)(`span`,{className:l6.hidden,children:[`Loading `,e,` items`]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(c6,{children:(0,q.jsx)(zi,{size:`small`,srText:null})}),(0,q.jsx)(Cs,{className:l6.muted,children:`Loading...`})]})})})});p6.displayName=`TreeView.LoadingItem`;const m6=()=>(0,q.jsx)(C6,{id:Y(),expanded:null,children:(0,q.jsx)(Cs,{className:l6.muted,children:`No items found`})});function h6(t){let{count:n,state:r,children:i,"aria-label":a}=t,{announceUpdate:o}=e.useContext(S3),{itemId:s,isExpanded:c,isSubTreeEmpty:l,setIsSubTreeEmpty:u}=e.useContext(C3),d=e.useRef(null),f=e.useRef(null),[p,m]=e.useState(!1),[h,g]=e.useState(``),_=d6(r);return e.useEffect(()=>{(r===void 0||r===`done`)&&u(!i)},[r,i,u]),e.useEffect(()=>{let e=document.getElementById(s);if(!e)return;let t=D3(e);if(g(t),r===`loading`){o(`${t} content loading`);return}if(_!==`loading`||r!==`done`||(o(d.current?.childElementCount?`${t} content loaded`:`${t} is empty`),!p))return;let n=window.setTimeout(()=>{(A3(e)??e).focus()});return m(!1),()=>{window.clearTimeout(n)}},[s,r,_,p,o]),e.useEffect(()=>{let e=f.current;if(!e)return;let t=()=>m(!0),n=e=>{e.relatedTarget&&m(!1)};return e.addEventListener(`focus`,t),e.addEventListener(`blur`,n),()=>{e.removeEventListener(`focus`,t),e.removeEventListener(`blur`,n)}},[r]),c?(0,q.jsxs)(`ul`,{ref:d,role:`group`,"aria-label":a||h,className:G(l6.root),"data-component":`TreeView.SubTree`,children:[r===`loading`?(0,q.jsx)(p6,{ref:f,count:n}):i,l&&r!==`loading`?(0,q.jsx)(m6,{}):null]}):null}h6.displayName=`TreeView.SubTree`;const g6={root:`tree-view-trailing-action`,button:`shrink`,hidden:`sr-only`};function _6(t){let{items:n,shortcutText:r}=t,{itemId:i,trailingActionId:a}=e.useContext(C3),o=()=>{document.getElementById(i)?.focus()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{id:a,className:g6.hidden,children:r}),(0,q.jsx)(`span`,{className:g6.root,"aria-hidden":`true`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),"data-component":`TreeView.TrailingAction`,children:n.map(({label:e,onClick:t,icon:n,count:r,className:i},a)=>r?(0,q.jsx)(lQ,{text:e,children:(0,q.jsx)($i,{variant:`invisible`,leadingVisual:n,count:r,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:o,className:G(g6.button,i)})},a):(0,q.jsx)(na,{icon:n,variant:`invisible`,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:o,className:G(g6.button,i)},a))})]})}_6.displayName=`TreeView.TrailingAction`;function v6(t){let{trailingVisualId:n}=e.useContext(C3);return(0,q.jsx)(a6,{label:t.label,labelId:n,className:r6.visual,"data-component":`TreeView.TrailingVisual`,children:t.children})}v6.displayName=`TreeView.TrailingVisual`;const y6={root:`tree-view-item`,container:`tree-view-item-container`,flat:`tree-view-item-container-flat`,hasLeadingAction:`tree-view-item-container-has-leading-action`,current:`tree-view-item-container-current`,loading:`tree-view-item-container-loading`,spacer:`tree-view-item-spacer`,levelLines:`tree-view-item-level-lines`,levelLine:`tree-view-item-level-line`,toggle:`tree-view-item-toggle`,toggleHover:`tree-view-item-toggle-hover`,toggleEnd:`tree-view-item-toggle-end`,content:`tree-view-item-content`,label:`tree-view-item-label`},b6=e=>si(e,{leadingAction:s6,leadingVisual:c6,trailingVisual:v6,subTree:h6}),x6=({level:e})=>(0,q.jsx)(`span`,{className:y6.levelLines,children:Array.from({length:e-1},(e,t)=>(0,q.jsx)(`span`,{className:y6.levelLine},t))});function S6(t,n){let{as:r,id:i,children:a,className:o,current:s=!1,defaultExpanded:c,expanded:l,onExpandedChange:u,onSelect:d,containIntrinsicSize:f,secondaryActions:p,"aria-label":m,"aria-labelledby":h,...g}=t,{expandedStateCache:_,scrollElementIntoView:v}=e.useContext(S3),{level:y}=e.useContext(C3),b=e.useContext(w3),x=Aw(),[S,C]=b6(a),w=!!S.subTree,T=Y(),E=Y(),D=Y(),O=Y(),k=l!==void 0,[A,j]=e.useState(()=>_.current?.get(i)??c??s),M=k?l===!0:A,[N,P]=e.useState(!w),[F,I]=e.useState(!1),[L,ee]=e.useState(!1),R=e.useCallback(e=>{j(e),_.current?.set(i,e),u?.(e)},[i,_,u]),te=e.useCallback(e=>{R(!M),e?.stopPropagation()},[M,R]),z=e.useCallback(()=>{if(p?.length){if(p.length===1){p[0].onClick();return}ee(!0)}},[p]),ne=e=>{switch(e.key){case`Enter`:case` `:d?d(e):te(e),e.stopPropagation();break;case`ArrowRight`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!0);break;case`ArrowLeft`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!1);break;case`U`:case`u`:if(!(e.shiftKey&&(e.metaKey||e.ctrlKey)))return;z()}},B=e=>{d?d(e):te(e),e.stopPropagation()},re=`Press (${ww(`Shift+${x===`apple`?`Meta`:`Control`}+U`,x)}) for more actions.`,V=[S.leadingVisual?E:void 0,S.trailingVisual?D:void 0].filter(Boolean),ie=e.useMemo(()=>({itemId:i,level:y+1,isSubTreeEmpty:N,setIsSubTreeEmpty:P,isExpanded:M,setIsExpanded:R,leadingVisualId:E,trailingVisualId:D,trailingActionId:O}),[i,y,N,M,R,E,D,O]),ae=N&&(!M||!w)||l===null?void 0:M,oe=r??`li`,se=r!==void 0&&r!==`li`,ce=(0,q.jsxs)(oe,{ref:n,id:i,role:`treeitem`,tabIndex:-1,"aria-label":p&&m?`${m}. ${re}`:m,"aria-labelledby":m?void 0:`${h||T} ${p?O:``}`.trim(),"aria-describedby":V.length>0?V.join(` `):void 0,"aria-level":y,"aria-expanded":ae,"aria-current":s?`true`:void 0,"aria-selected":F?`true`:`false`,className:G(y6.root,o),"data-component":`TreeView.Item`,"data-has-leading-action":S.leadingAction?``:void 0,"data-loading":b?``:void 0,onKeyDown:ne,onClick:B,onAuxClick:e=>{d&&e.button===1&&d(e),e.stopPropagation()},onFocus:e=>{v(e.currentTarget.firstElementChild),I(!0),e.stopPropagation()},onBlur:()=>I(!1),...g,children:[(0,q.jsxs)(`span`,{className:G(y6.container,y6.flat,S.leadingAction&&y6.hasLeadingAction,s&&y6.current,b&&y6.loading),style:{"--tree-view-level":y,contentVisibility:f?`auto`:void 0,containIntrinsicSize:f},children:[(0,q.jsx)(`span`,{className:y6.spacer,children:(0,q.jsx)(x6,{level:y})}),S.leadingAction,w?(0,q.jsx)(`span`,{className:G(y6.toggle,d&&y6.toggleHover,y===1&&y6.toggleEnd),onClick:e=>{d&&te(e)},"data-component":`TreeView.Item.Toggle`,children:M?(0,q.jsx)(qn,{width:12,height:12}):(0,q.jsx)(Yn,{width:12,height:12})}):null,(0,q.jsxs)(`span`,{id:T,className:y6.content,children:[S.leadingVisual,(0,q.jsx)(`span`,{className:y6.label,"data-component":`TreeView.Item.Label`,children:C}),S.trailingVisual]}),p?.length?(0,q.jsx)(_6,{items:p,shortcutText:re}):null]}),S.subTree,L&&p?(0,q.jsx)(n6,{items:p,onClose:()=>ee(!1)}):null]});return(0,q.jsx)(C3.Provider,{value:ie,children:se?(0,q.jsx)(`li`,{role:`none`,children:ce}):ce})}S6.displayName=`TreeView.Item`;var C6=K(S6);const w6=Object.assign(J3,{Item:C6,SubTree:h6,LeadingAction:s6,LeadingVisual:c6,TrailingVisual:v6,DirectoryIcon:X3,ErrorDialog:Q3}),T6=125,E6={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function D6(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(E6.root,o?E6.inline:E6.block,s&&E6.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}D6.displayName=`Truncate`;var O6=K(D6);const k6=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=d(e),[a,o]=d(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},A6=n({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),j6=()=>o(A6),M6=(e,t)=>{let{colorScheme:n}=j6();return(n?e[n]:void 0)??t},N6=`day`,P6=`(prefers-color-scheme: dark)`,F6=e=>{let t=window?.matchMedia?.(P6);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},I6=()=>window?.matchMedia?.(P6)?.matches?`night`:`day`,L6=()=>`day`,R6=()=>e.useSyncExternalStore(F6,I6,L6),z6=(e,t)=>e===`auto`?t:e,B6=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function V6({children:t,className:n,contextOnly:r,...i}){let{colorMode:a,dayScheme:o,nightScheme:s}=j6(),[c,l]=k6(i.colorMode??a??`day`),[u,d]=k6(i.dayScheme??o??`light`),[f,p]=k6(i.nightScheme??s??`dark`),m=R6(),h=z6(c,m),g=B6(h,u,f),_=e.useMemo(()=>({colorScheme:g,colorMode:c,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:l,setDayScheme:d,setNightScheme:p}),[g,c,h,u,f,l,d,p]);return r?(0,q.jsx)(A6.Provider,{value:_,children:t}):(0,q.jsx)(A6.Provider,{value:_,children:(0,q.jsx)(`div`,{className:n,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":c,children:t})})}V6.displayName=`ThemeProvider`;export{Oq as ARROW_KEY_STEP,kc as AUTO_LOCALE,Xr as Accordion,Sn as AccordionContext,Ur as AccordionHeader,Kr as AccordionItem,Br as AccordionItemContext,Yr as AccordionPanel,Fo as ActionBar,Po as ActionBarButton,oo as ActionBarContext,fo as ActionBarDivider,ho as ActionBarGroup,vo as ActionBarIconButton,so as ActionBarItemContext,Co as ActionBarMenu,_a as ActionList,gi as ActionListContainerContext,fi as ActionListContext,wi as ActionListDescription,Ei as ActionListDivider,Fi as ActionListGroup,Di as ActionListGroupContext,Mi as ActionListGroupHeading,hi as ActionListHeading,ma as ActionListItem,Si as ActionListItemContext,Hi as ActionListLeadingVisual,ga as ActionListLinkItem,Ui as ActionListSubItem,aa as ActionListTrailingAction,oa as ActionListTrailingVisual,to as ActionMenu,ya as ActionMenuAnchor,ba as ActionMenuButton,va as ActionMenuContext,eo as ActionMenuOverlay,Ro as Alert,Qa as AnchoredOverlay,Vo as AspectRatio,gs as Attachment,Jo as AttachmentAction,Zo as AttachmentActions,es as AttachmentContent,Ho as AttachmentContext,rs as AttachmentDescription,os as AttachmentGroup,ls as AttachmentMedia,fs as AttachmentTitle,hs as AttachmentTrigger,Xs as Autocomplete,_s as AutocompleteContext,ys as AutocompleteDeferredInputContext,zs as AutocompleteInput,vs as AutocompleteInputContext,Gs as AutocompleteMenu,Ys as AutocompleteOverlay,Gc as Avatar,Qs as AvatarContext,Vc as AvatarFallback,Wc as AvatarImage,el as AvatarStack,Sl as Banner,tl as BannerContext,rl as BannerDescription,yl as BannerPrimaryAction,xl as BannerSecondaryAction,ol as BannerTitle,Gl as Blankslate,Ol as BlankslateDescription,jl as BlankslateHeading,Il as BlankslatePrimaryAction,Vl as BlankslateSecondaryAction,Wl as BlankslateVisual,Jl as Blockquote,Zl as Box,cu as Breadcrumbs,$l as BreadcrumbsContext,su as BreadcrumbsItem,wu as Bubble,_u as BubbleContent,uu as BubbleContext,bu as BubbleGroup,du as BubbleGroupContext,Cu as BubbleReactions,$i as Button,ju as ButtonGroup,Sf as CHART_COLORS,xf as CHART_OVERFLOW_COLOR,bf as CHART_SERIES_COLORS,fd as Calendar,Pu as CalendarDay,Rd as Card,hd as CardAction,yd as CardDescription,Sd as CardHeading,Td as CardIcon,Od as CardImage,jd as CardMetadata,Ud as Caret,pf as Carousel,Gd as CarouselContext,af as CarouselControls,Yd as CarouselIndicators,Zd as CarouselNextButton,$d as CarouselPlayButton,tf as CarouselPreviousButton,cf as CarouselSlide,Kd as CarouselSlideContext,If as Chart,mf as ChartContext,yf as ChartGradient,Af as ChartLegend,Nf as ChartRadialText,Ff as ChartTooltip,Vf as Checkbox,np as CheckboxCard,Hf as CheckboxCardContext,Gf as CheckboxCardDescription,Jf as CheckboxCardLabel,Zf as CheckboxCardLeadingVisual,vp as CheckboxGroup,ap as CheckboxGroupCaption,Lf as CheckboxGroupContext,cp as CheckboxGroupLabel,pp as CheckboxGroupValidation,Ip as Clipboard,yp as ClipboardContext,Dp as ClipboardIndicator,Mp as ClipboardInput,Fp as ClipboardTrigger,zp as Code,cm as CodeBlock,Zp as CodeBlockCode,tm as CodeBlockContent,Bp as CodeBlockContext,im as CodeBlockHeader,sm as CodeBlockTitle,ym as Collapsible,hm as CollapsibleContent,lm as CollapsibleContext,vm as CollapsibleTrigger,vh as Combobox,Om as ComboboxClearTrigger,jm as ComboboxContent,bm as ComboboxContext,Pm as ComboboxControl,Lm as ComboboxEmpty,Hm as ComboboxInput,Km as ComboboxItem,Sm as ComboboxItemContext,Ym as ComboboxItemGroup,xm as ComboboxItemGroupContext,Qm as ComboboxItemGroupLabel,th as ComboboxItemIndicator,ih as ComboboxItemText,sh as ComboboxLabel,uh as ComboboxList,mh as ComboboxPositioner,_h as ComboboxTrigger,ng as CommandPalette,Sh as CommandPaletteContext,Ph as CommandPaletteDialog,Lh as CommandPaletteEmpty,Bh as CommandPaletteGroup,Ch as CommandPaletteGroupContext,Uh as CommandPaletteInput,Kh as CommandPaletteItem,Yh as CommandPaletteList,Qh as CommandPaletteLoading,tg as CommandPaletteSeparator,zg as ConfirmationDialog,Yg as ContextMenu,Hg as ContextMenuContext,Kg as ContextMenuOverlay,Jg as ContextMenuTrigger,qi as CounterLabel,Gu as DAYS_IN_WEEK,Ku as DAY_KEY_FORMAT,$s as DEFAULT_AVATAR_SIZE,N6 as DEFAULT_COLOR_MODE,_1 as DEFAULT_CURRENT_STEP,Tc as DEFAULT_DIRECTION,Hb as DEFAULT_FLOATING_PANEL_MIN_SIZE,Vb as DEFAULT_FLOATING_PANEL_POSITION,Bb as DEFAULT_FLOATING_PANEL_SIZE,s4 as DEFAULT_ISSUE_LABEL_FILL_COLOR,rc as DEFAULT_LOCALE,SW as DEFAULT_MAP_LATITUDE,CW as DEFAULT_MAP_LONGITUDE,wW as DEFAULT_MAP_ZOOM,NW as DEFAULT_MARKDOWN_NAMESPACE,iz as DEFAULT_MARKER_COLOR,nZ as DEFAULT_RATING_COUNT,vZ as DEFAULT_RELATIVE_TIME_PREFIX,_Z as DEFAULT_RELATIVE_TIME_THRESHOLD,qZ as DEFAULT_RICH_TEXT_EDITOR_CONTROLS,LZ as DEFAULT_RICH_TEXT_EDITOR_NAMESPACE,sv as DEFAULT_SORT_DIRECTION,D4 as DEFAULT_SPOTLIGHT_OFFSET,O4 as DEFAULT_SPOTLIGHT_RADIUS,A_ as DEFAULT_TABLE_PAGE_SIZE,Y_ as DEFAULT_TABLE_SKELETON_ROWS,US as DEFAULT_TEXTAREA_COLS,WS as DEFAULT_TEXTAREA_RESIZE,HS as DEFAULT_TEXTAREA_ROWS,k2 as DEFAULT_TOGGLE_SWITCH_LOADING_LABEL_DELAY,K2 as DEFAULT_TOKEN_SIZE,T6 as DEFAULT_TRUNCATE_MAX_WIDTH,xv as DataTable,Ev as DatePicker,Nv as Details,Mv as DetailsSummary,Pv as Dialog,cg as DialogBody,ug as DialogButtons,fg as DialogCloseButton,lg as DialogContext,hg as DialogFooter,vg as DialogHeader,xg as DialogSubtitle,wg as DialogTitle,Ec as DirectionContext,Uw as DirectionProvider,Hq as DragHandle,ay as Drawer,Lv as DrawerBody,Vv as DrawerCloseButton,Rv as DrawerContext,Wv as DrawerFooter,qv as DrawerHeader,Xv as DrawerSubtitle,$v as DrawerTitle,cy as Em,py as EmptyState,Wb as FLOATING_PANEL_LARGE_STEP,Ub as FLOATING_PANEL_STEP,SC as FRAME_ROOT_CLASS,Yy as FileUpload,yy as FileUploadContext,Sy as FileUploadDescription,Ty as FileUploadIcon,Jy as FileUploadItem,Oy as FileUploadLabel,jy as FileUploadList,zb as FilteredActionList,Pb as FilteredActionListBodyLoader,xb as FilteredActionListInput,wb as FilteredActionListItem,Lx as FloatingPanel,ix as FloatingPanelBody,ox as FloatingPanelCloseTrigger,ux as FloatingPanelContent,$b as FloatingPanelContext,px as FloatingPanelControl,gx as FloatingPanelDragTrigger,yx as FloatingPanelHeader,Sx as FloatingPanelPositioner,Dx as FloatingPanelResizeTrigger,Ax as FloatingPanelStageTrigger,Nx as FloatingPanelTitle,Ix as FloatingPanelTrigger,fS as Flow,Ux as FlowContext,Kx as FlowList,Yx as FlowNode,Qx as FlowParallel,hC as FormControl,QS as FormControlCaption,Op as FormControlContext,tC as FormControlLabel,iC as FormControlLeadingVisual,lC as FormControlValidation,_C as FormatByte,yC as FormatNumber,EC as Frame,IC as Header,MC as HeaderItem,FC as HeaderLink,di as Heading,zC as Hidden,KC as Highlight,tw as HoverCard,XC as HoverCardContent,qC as HoverCardContext,ZC as HoverCardTrigger,na as IconButton,iw as Image,uw as InlineMessage,_4 as IssueLabelToken,Lw as KeybindingHint,Bw as Label,Zw as LabelGroup,cT as LayerCard,eT as LayerCardPrimary,rT as LayerCardSecondary,zl as Link,uT as LinkButton,_T as List,gT as ListItem,Dc as LocaleContext,Nc as LocaleProvider,PW as MARKDOWN_NODES,FW as MARKDOWN_TRANSFORMERS,VW as MARQUEE_MINIMUM_COPIES,zW as MARQUEE_SPEEDS,kW as Map,cH as MapAttributionControl,QU as MapDragRotateAndZoomInteraction,WU as MapDrawControl,_H as MapFullScreenControl,wz as MapGraticuleLayer,nH as MapHeatmapLayer,Sz as MapImageLayer,_z as MapLayerGroup,qU as MapLayersControl,bW as MapLinkInteraction,dz as MapMarker,EH as MapMousePositionControl,pz as MapOverlay,AH as MapOverviewMapControl,rW as MapPointerInteraction,SH as MapScaleLineControl,YU as MapSearchControl,pW as MapSelectInteraction,vz as MapTileLayer,nW as MapTranslateInteraction,Cz as MapVectorLayer,ZR as MapView,aH as MapWebGLTileLayer,HC as Mark,RW as Markdown,KW as Marquee,fG as Message,$W as MessageAvatar,nG as MessageContent,lu as MessageContext,aG as MessageFooter,cG as MessageGroup,qW as MessageGroupContext,dG as MessageHeader,IG as Meter,_G as MeterContext,bG as MeterIndicator,CG as MeterLabel,EG as MeterTrack,kG as MeterValue,VG as NativeSelect,RG as NativeSelectOptGroup,BG as NativeSelectOption,_K as NavigationList,$G as NavigationListGroup,pK as NavigationListGroupExpand,gK as NavigationListGroupHeading,UG as NavigationListHeading,uK as NavigationListItem,oK as NavigationListSubNavigation,dq as NavigationMenu,NK as NavigationMenuContent,bK as NavigationMenuContext,wK as NavigationMenuDepthContext,FK as NavigationMenuDescription,LK as NavigationMenuDivider,HK as NavigationMenuGroup,zK as NavigationMenuGroupHeading,yK as NavigationMenuHeading,CK as NavigationMenuHeadingLevelContext,GK as NavigationMenuItem,xK as NavigationMenuItemContext,JK as NavigationMenuLeadingVisual,rq as NavigationMenuLink,SK as NavigationMenuLinkContext,sq as NavigationMenuList,ZK as NavigationMenuSubNavigation,$K as NavigationMenuTrailingVisual,uq as NavigationMenuTrigger,hq as NumberInput,no as OverflowObserverContext,ro as OverflowObserverProvider,TJ as PINInput,cJ as PageLayout,iJ as PageLayoutContent,_q as PageLayoutContext,Cq as PageLayoutFooter,Eq as PageLayoutHeader,sJ as PageLayoutPane,Yq as PageLayoutSidebar,gJ as Pagination,yJ as PasswordInput,OJ as Placeholder,Tw as PlatformContext,LJ as Popover,IJ as PopoverContent,kJ as PopoverContext,Va as Portal,Ma as PortalContext,Wy as ProgressBar,By as ProgressBarItem,VJ as ProgressCircle,TX as QRCode,RZ as RICH_TEXT_EDITOR_NODES,bS as Radio,BX as RadioCard,EX as RadioCardContext,kX as RadioCardDescription,MX as RadioCardLabel,FX as RadioCardLeadingVisual,tZ as RadioGroup,UX as RadioGroupCaption,_S as RadioGroupContext,KX as RadioGroupLabel,ZX as RadioGroupValidation,lZ as Rating,FZ as RelativeTime,$Z as RichTextEditor,KZ as RichTextEditorContent,QZ as RichTextEditorToolbar,ws as SCREEN_READER_DELAY,ag as ScrollableRegion,EQ as SegmentedControl,mQ as SegmentedControlButton,gQ as SegmentedControlIconButton,DQ as Select,xS as SelectContext,TS as SelectOptGroup,SS as SelectOptGroupContext,kS as SelectOption,i$ as SelectPanel,kQ as SelectPanelButton,AQ as SelectPanelContext,NQ as SelectPanelFooter,BQ as SelectPanelHeader,ZQ as SelectPanelLoading,e$ as SelectPanelMessage,IQ as SelectPanelSearchInput,r$ as SelectPanelSecondaryAction,s$ as Separator,l$ as SkeletonAvatar,W_ as SkeletonBox,q_ as SkeletonText,p$ as Slider,zi as Spinner,k$ as Splitter,y$ as SplitterPanel,S$ as SplitterResizeTrigger,T$ as SplitterResizeTriggerIndicator,O$ as SplitterResizeTriggerSeparator,jb as Stack,Ab as StackItem,I$ as StateLabel,o1 as StatisticCard,L$ as StatisticCardContext,B$ as StatisticCardDescription,U$ as StatisticCardLabel,K$ as StatisticCardTrailingVisual,$$ as StatisticCardTrend,n1 as StatisticCardValue,h1 as Status,m1 as StatusIndicator,B1 as Steps,T1 as StepsBody,O1 as StepsDescription,M1 as StepsIndicator,I1 as StepsItem,g1 as StepsItemContext,z1 as StepsTitle,J1 as Swap,V1 as SwapContext,q1 as SwapIndicator,y0 as Tab,w0 as TabList,D0 as TabPanel,Cv as Table,n_ as TableActions,s_ as TableBody,u_ as TableCell,p_ as TableCellPlaceholder,g_ as TableContainer,y_ as TableDivider,x_ as TableErrorDialog,C_ as TableHead,E_ as TableHeader,d0 as TableOfContents,r0 as TableOfContentsGroup,o0 as TableOfContentsItem,e0 as TableOfContentsList,l0 as TableOfContentsTitle,z_ as TablePagination,V_ as TableRow,Z_ as TableSkeleton,ev as TableSortHeader,rv as TableSubtitle,ov as TableTitle,O0 as Tabs,f0 as TabsContext,Cs as Text,Fs as TextInput,Ps as TextInputAction,YS as Textarea,A6 as ThemeContext,V6 as ThemeProvider,Q0 as Timeline,F0 as TimelineActions,R0 as TimelineAvatar,H0 as TimelineBadge,G0 as TimelineBody,J0 as TimelineBreak,Z0 as TimelineItem,O2 as Toaster,W2 as ToggleSwitch,o4 as Token,Y2 as TokenBase,Z2 as TokenRemoveButton,e4 as TokenText,lQ as Tooltip,eQ as TooltipContext,w4 as TopicTag,C4 as TopicTagGroup,x3 as Tour,L4 as TourActionTrigger,P4 as TourActions,V4 as TourArrow,W4 as TourBackdrop,q4 as TourCloseTrigger,X4 as TourContent,T4 as TourContext,$4 as TourControl,n3 as TourDescription,o3 as TourPositioner,E4 as TourPositionerContext,l3 as TourProgressText,f3 as TourSpotlight,h3 as TourTitle,w6 as TreeView,X3 as TreeViewDirectoryIcon,Q3 as TreeViewErrorDialog,C6 as TreeViewItem,C3 as TreeViewItemContext,s6 as TreeViewLeadingAction,c6 as TreeViewLeadingVisual,S3 as TreeViewRootContext,h6 as TreeViewSubTree,v6 as TreeViewTrailingVisual,O6 as Truncate,D_ as buildPaginationModel,O_ as buildPaginationPageData,mG as clampToRange,xh as commandScore,oS as computeEdges,sS as computeFlowRect,tS as computePositions,zx as connectorPath,xp as copyText,Sv as createColumnHelper,kq as defaultPaneWidth,nS as entryIds,rS as exitIds,od as extendRange,gy as formatFileSize,jG as formatMeterValue,MZ as formatRelativeTime,jZ as formatTitle,ww as getAccessibleKeybindingHintString,tz as getAddress,Ka as getAnchoredPosition,Ts as getCharacterCount,Qu as getFirstDayOfWeek,m4 as getIssueLabelColors,nz as getLonLat,td as getMonthWeeks,Ow as getPlatform,Tf as getProp,ad as getRangePosition,Cf as getSeriesColor,$u as getWeekdays,nd as isDateSelectable,id as isDateWithinRange,_y as isFileAccepted,q2 as isTokenInteractive,IW as markdownTheme,iS as nodeIds,sd as parseDate,La as registerPortalRoot,zZ as richTextEditorTheme,pv as sortStrategies,WC as splitHighlightChunks,ed as startOfWeek,hG as stepValue,Yu as toDayKey,h2 as toast,cv as transitionSortDirection,vy as triageFiles,Fq as updateAriaValues,Fb as useAnnouncements,Of as useChart,hf as useChartContext,Kw as useClippedChildren,Pc as useCollator,M6 as useColorSchemeVar,Vg as useConfirm,Fc as useDateFormatter,Vw as useDirection,Ic as useFilter,ex as useFloatingPanelContext,kp as useFormControlForwardedProps,Hw as useIsRtl,Oc as useLocaleContext,XR as useMap,HW as useMarquee,Lc as useNumberFormatter,io as useOverflowObserver,Kq as usePaneWidth,Aw as usePlatform,k1 as useStepsItem,g0 as useTab,x0 as useTabList,T0 as useTabPanel,u0 as useTableOfContentsActiveId,h0 as useTabs,j6 as useTheme,g3 as useTour,AG as valueToPercent,y3 as waitForElement,b3 as waitForElementValue,v3 as waitForEvent};
|
|
802
|
+
}`,uniforms:o,paletteTextures:i.paletteTextures}}var iH=class extends vR{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(bI.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&&!AO(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,rH(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 yB(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()}};iH.prototype.dispose;function aH({name:e,...t}){return gz(()=>new iH(t),e),null}aH.displayName=`MapWebGLTileLayer`;const oH=t=>{let n=XR(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addControl(i),()=>{n.removeControl(i)}},[n,i]),i},sH=(t,n,r)=>{let i=e.useRef(null);if(!i.current){let e=document.createElement(`div`);e.setAttribute(`data-component`,t),i.current=e}let a=i.current;return oH(()=>new VI({element:a,target:r})),e.useEffect(()=>{a.className=G(`ol-unselectable ol-control`,n)},[a,n]),a};function cH(e){return oH(()=>new HI(e)),null}cH.displayName=`MapAttributionControl`;const lH=[`fullscreenchange`,`webkitfullscreenchange`],uH={ENTERFULLSCREEN:`enterfullscreen`,LEAVEFULLSCREEN:`leavefullscreen`};var dH=class extends VI{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(TT.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(fH(t)){if(pH(t))gH(t);else{let n;n=this.source_?typeof this.source_==`string`?t.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?hH(n):mH(n)}}}handleFullScreenChange_(){let e=this.getMap();if(!e)return;let t=this.isInFullscreen_;this.isInFullscreen_=pH(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(FA(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(uH.ENTERFULLSCREEN)):(FA(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(uH.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(LI.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(LI.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){let e=this.documentListeners_;for(let t=0,n=e.length;t<n;++t)wT(e[t]);e.length=0;let t=this.getMap();if(t){let n=t.getOwnerDocument();fH(n)?this.element.classList.remove(Nj):this.element.classList.add(Nj);for(let t=0,r=lH.length;t<r;++t)e.push(ST(n,lH[t],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}};function fH(e){let t=e.body;return!!(t.webkitRequestFullscreen||t.requestFullscreen&&e.fullscreenEnabled)}function pH(e){return!!(e.webkitIsFullScreen||e.fullscreenElement)}function mH(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function hH(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():mH(e)}function gH(e){e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen&&e.webkitExitFullscreen()}function _H(e){return oH(()=>new dH(e)),null}_H.displayName=`MapFullScreenControl`;const vH=`units`,yH=[1,2,5],bH=25.4/.28;var xH=class extends VI{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(vH,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(vH)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(vH,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=CO(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||bH)/bH,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||bH)/bH,c=o*a,l=``;if(r==`degrees`){let e=wD.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=yH[(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=CO(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||bH;return 1e3/25.4*e*t}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}};function SH(e){return oH(()=>new xH(e)),null}SH.displayName=`MapScaleLineControl`;const CH=`projection`,wH=`coordinateFormat`;var TH=class extends VI{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(CH,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(wH)}getProjection(){return this.get(CH)}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(ST(t,PI.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(ST(t,PI.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(wH,e)}setProjection(e){this.set(CH,SO(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){let e=this.getProjection();this.transform_=e?jO(this.mapProjection_,e):yO}let n=this.getMap().getCoordinateFromPixelInternal(e);if(n){let e=FO();e&&(this.transform_=jO(this.mapProjection_,e)),this.transform_(n,n),this.wrapX_&&xD(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 EH(e){return oH(()=>new TH(e)),null}EH.displayName=`MapMousePositionControl`;const DH=.75,OH=.1;var kH=class extends VI{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(TT.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement(`div`),this.ovmapDiv_.className=`ol-overviewmap-map`,this.view_=e.view;let s=new LL({view:e.view,controls:new XT,interactions:new XT});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 BL({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(ST(e,yT.PROPERTYCHANGE,this.handleMapPropertyChange_,this));let t=e.getView();t&&this.bindView_(t),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===LI.VIEW){let t=e.oldValue;t&&this.unbindView_(t);let n=this.getMap().getView();this.bindView_(n)}else!this.ovmap_.isRendered()&&(e.key===LI.TARGET||e.key===LI.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){let t=new pI({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(tI.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(e){e.removeChangeListener(tI.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_&&hE(r,this.viewExtent_))return;this.viewExtent_=r;let i=t.getSize(),a=t.getView().calculateExtentInternal(i),o=t.getPixelFromCoordinateInternal(ME(r)),s=t.getPixelFromCoordinateInternal(wE(r)),c=Math.abs(o[0]-s[0]),l=Math.abs(o[1]-s[1]),u=i[0],d=i[1];c<u*OH||l<d*OH||c>u*DH||l>d*DH?this.resetExtent_():sE(a,r)||this.recenter_()}resetExtent_(){let e=this.getMap(),t=this.ovmap_,n=e.getSize(),r=e.getView().calculateExtentInternal(n),i=t.getView();RE(r,1/(2**(Math.log(DH/OH)/Math.LN2/2)*OH)),i.fitInternal(lA(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_||=CT(this.ovmap_,II.POSTRENDER,e=>{delete this.ovmapPostrenderKey_,this.updateBox_()})}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(Pj),this.collapsed_?FA(this.collapseLabel_,this.label_):FA(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 AH(e){return oH(()=>new kH(e)),null}AH.displayName=`MapOverviewMapControl`;var jH=class e extends pk{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 dE(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(FE(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||xE(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=Dk(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(sk(n,0,n.length,r,e,t,n)),this.changed()}};jH.prototype.transform;var MH=class e extends fk{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(wT),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(ST(e[t],TT.CHANGE,this.changed,this))}clone(){let t=new e(NH(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<aE(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){fE(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)_E(e,t[n].getExtent());return e}getGeometries(){return NH(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||=TE(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(NH(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 NH(e){return e.map(e=>e.clone())}function PH(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function FH(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 IH={index:-1,endIndex:NaN,closestTargetDistance:1/0};function LH(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=WH(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=FH(l.coordinates,c);yD(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=HH(e,n,r);HH(e,n,r-t)<i&&(c-=t)}else{let i=HH(e,n,r);HH(e,n,r+t)<i&&(c+=t)}}return IH.index=s,IH.endIndex=c,IH.closestTargetDistance=o,IH}function RH(e,t){let n=[];for(let r=0;r<t.length;++r)zH(e,t[r].getGeometry(),n);return n}function zH(e,t,n){if(t instanceof qA){BH(e,t.getCoordinates(),!1,n);return}if(t instanceof DM){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)BH(e,r[t],!1,n);return}if(t instanceof cA){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)BH(e,r[t],!0,n);return}if(t instanceof AM){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)BH(e,i[t],!0,n)}return}if(t instanceof MH){let r=t.getGeometries();for(let t=0;t<r.length;++t)zH(e,r[t],n);return}}function BH(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=WH(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 VH(e,t){return KE(e[0],e[1],t[0],t[1])}function HH(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 VH(FH(e,r),FH(e,i));let s=0;if(r<a){let t=FH(e,r),n=PH(e,a);s+=VH(t,n)}if(o<i){let t=PH(e,o),n=FH(e,i);s+=VH(t,n)}for(let t=a;t<o-1;++t){let n=PH(e,t),r=PH(e,t+1);s+=VH(n,r)}return s}const UH={along:0,squaredDistance:0};function WH(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=WE(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),UH.along=u,UH.squaredDistance=QE(KE(e,t,d,f),10),UH}const GH={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`};var KH=class extends BT{constructor(e,t){super(e),this.feature=t}},qH=class extends fL{constructor(e){let t=e;t.stopDown||=IT,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_=YH(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:FT,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 jH([NaN,NaN]),i=LO(e[0],n),a=vD(i,LO(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=FO();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=Qk:e===`LineString`?t=qA:e===`Polygon`&&(t=cA),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 DI({source:new nN({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:JH(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:oL,this.freehandCondition_,this.freehandCondition_=e.freehand?nL:e.freehandCondition?e.freehandCondition:cL,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(KI.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?nL:e:iL,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehandCondition_=this.freehand_?nL:this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:cL}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===TT.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===NI.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===NI.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===NI.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===NI.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===NI.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===NI.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===NI.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 MI(NI.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=tE([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=RH(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(PH(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(PH(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&yD(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=LH(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=FH(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 QT(new Qk(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new QT;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new qA(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=hk(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 QT(new qA(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new QT,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new KH(GH.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=hk(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 OM([t])):this.type_===`MultiLineString`?e.setGeometry(new DM([t])):this.type_===`MultiPolygon`&&e.setGeometry(new AM([t])),this.dispatchEvent(new KH(GH.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 KH(GH.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 QT(new Qk(n)),this.updateSketchFeatures_(),this.dispatchEvent(new KH(GH.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 JH(){let e=hN();return function(t,n){return e[t.getGeometry().getType()]}}function YH(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 XH=[0,0,0,0],ZH=[],QH={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function $H(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 eU=class extends BT{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},tU=class extends fL{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:dL,this.defaultDeleteCondition_=function(e){return QI(e)&&aL(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:nL,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new ZM,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new DI({source:new nN({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:aU(),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:hD,!(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(vT.ADD,this.handleExternalCollectionAdd_),e.features.addEventListener(vT.REMOVE,this.handleExternalCollectionRemove_),this.featuresCollection_=e.features):e.source&&(t=e.source.getFeatures(),e.source.addEventListener(eN.ADDFEATURE,this.handleSourceAdd_),e.source.addEventListener(eN.REMOVEFEATURE,this.handleSourceRemove_),this.source_=e.source),t.forEach(e=>{e.addEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(yT.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?nL:e:iL,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 XT;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 eU(QH.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(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.addEventListener(yT.PROPERTYCHANGE,this.handleFeatureChange_),this.filter_(e)&&this.addFeature_(e)}externalRemoveFeatureHandler_(e){e.removeEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(yT.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(tE(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(tE(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(tE(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(tE(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(pE(n),r);let o=t,s=FO();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=uA(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 QT(new Qk(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==NI.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=NI.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==NI.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=tE([r]),a=this.rBush_.getInExtent(i),o={};a.sort(nU);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=iU(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&&yD(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=LH(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=FH(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=tE([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=RH(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||NT(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();$H(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(PH(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(PH(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();$H(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=yD(LO(t.getCenter(),n),LO(e,n)),i=FO();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];yD(pD(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(pE(n),a);let s=t,c=FO();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=uA(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(tE(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 eU(QH.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 rU(e,t,r)-rU(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 Qk(IO(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof QT&&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=RO(rE(zO(pE(e,XH),r),t.getView().getResolution()*this.pixelTolerance_,XH),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=iU(e,s,r),u=t.getPixelFromCoordinate(l),d=yD(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=vD(u,e),o=vD(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(tE(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(tE(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?IO(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(tE([e])).some(({segment:t})=>this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e))}removePoint(e){if(e&&(e=LO(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=NI.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new eU(QH.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(tE(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(tE([e])).some(({segment:t})=>!(this.coordinatesEqual_(t[0],e)||this.coordinatesEqual_(t[1],e)))}insertPoint(e){let t=e?LO(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||NT(i.depth,n))&&i.index>t&&(i.index+=r)})}disposeInternal(){if(super.disposeInternal(),this.featuresCollection_){this.featuresCollection_.removeEventListener(vT.ADD,this.handleExternalCollectionAdd_),this.featuresCollection_.removeEventListener(vT.REMOVE,this.handleExternalCollectionRemove_);for(let e of this.featuresCollection_.getArray())e.removeEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(yT.PROPERTYCHANGE,this.handleFeatureChange_)}else if(this.source_){this.source_.removeEventListener(eN.ADDFEATURE,this.handleSourceAdd_),this.source_.removeEventListener(eN.REMOVEFEATURE,this.handleSourceRemove_);for(let e of this.source_.getFeatures())e.removeEventListener(TT.CHANGE,this.handleFeatureChange_),this.filterFunctionWasSupplied_&&e.removeEventListener(yT.PROPERTYCHANGE,this.handleFeatureChange_)}}};function nU(e,t){return e.index-t.index}function rU(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===1){let t=FO();t&&(i=i.clone().transform(t,n));let r=vD(i.getCenter(),LO(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=LO(e,n);return ZH[0]=LO(t.segment[0],n),ZH[1]=LO(t.segment[1],n),bD(i,ZH)}function iU(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===1){let t=r,i=FO();return i&&(t=t.clone().transform(i,n)),IO(t.getClosestPoint(LO(e,n)),n)}let i=LO(e,n);return ZH[0]=LO(t.segment[0],n),ZH[1]=LO(t.segment[1],n),IO(pD(i,ZH),n)}function aU(){let e=hN();return function(t,n){return e.Point}}const oU={SNAP:`snap`,UNSNAP:`unsnap`};var sU=class extends BT{constructor(e,t){super(e),this.vertex=t.vertex,this.vertexPixel=t.vertexPixel,this.feature=t.feature,this.segment=t.segment}};const cU={Circle(e,t){let n=e,r=FO();r&&(n=n.clone().transform(r,t));let i=uA(n);return r&&i.transform(t,r),cU.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 lU(e){return e.feature?e.feature:e.element?e.element:null}const uU=[],dU=[],fU=[];var pU=class extends fL{constructor(e){e||={},super({handleDownEvent:FT,stopDown:IT}),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 ZM,this.snapped_=null,this.segmenters_=Object.assign({},cU,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(uE());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];dU[t]=tE(n),fU[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=dU[t];for(let o=0,s=t-1;o<s;++o){let t=i[o];if(t.length===1||!FE(r,dU[o]))continue;let s=zk(n,t);if(!s)continue;let c=[s];dU[a]=tE(c),fU[a++]={feature:e,intersectionFeature:e,segment:c}}let o=this.rBush_.getInExtent(dU[t]);for(let t=0,r=o.length;t<r;++t){let r=o[t].segment;if(r.length===1)continue;let i=zk(n,r);if(!i)continue;let s=[i];dU[a]=tE(s),fU[a++]={feature:e,intersectionFeature:o[t].feature,segment:s}}}a===1?this.rBush_.insert(dU[0],fU[0]):(dU.length=a,fU.length=a,this.rBush_.load(dU,fU))}}t&&(this.featureChangeListenerKeys_[n]&&wT(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=ST(e,TT.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 sU(oU.UNSNAP,this.snapped_)),this.snapped_={vertex:e.coordinate,vertexPixel:e.pixel,feature:t.feature,segment:t.segment},this.dispatchEvent(new sU(oU.SNAP,this.snapped_))):this.snapped_&&=(this.dispatchEvent(new sU(oU.UNSNAP,this.snapped_)),null),super.handleEvent(e)}handleFeatureAdd_(e){let t=lU(e);t&&this.addFeature(t)}handleFeatureRemove_(e){let t=lU(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);bT(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&&(wT(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(wT),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(wT),this.featureChangeListenerKeys_={}),super.setMap(e),e){this.features_?n.push(ST(this.features_,vT.ADD,this.handleFeatureAdd_,this),ST(this.features_,vT.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(ST(this.source_,eN.ADDFEATURE,this.handleFeatureAdd_,this),ST(this.source_,eN.REMOVEFEATURE,this.handleFeatureRemove_,this));for(let e of r)this.addFeature(e)}}snapTo(e,t,n){let r=n.getView().getProjection(),i=LO(t,r),a=RO(rE(tE([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 vD(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=vD(i,LO(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=FO();a&&(e=e.clone().transform(a,r)),t=fD(i,e)}else{let[e,a]=n.segment;a&&(uU[0]=LO(e,r),uU[1]=LO(a,r),t=pD(i,uU))}if(t){let e=vD(i,t);e<l&&(c=IO(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)}},mU=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=QT,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?SO(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=SO(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 WT()}readFeature(e,t){return WT()}readFeatures(e,t){return WT()}readGeometry(e,t){return WT()}readProjection(e){return WT()}writeFeature(e,t){return WT()}writeFeatures(e,t){return WT()}writeGeometry(e,t){return WT()}};function hU(e,t,n){let r=n?SO(n.featureProjection):null,i=n?SO(n.dataProjection):null,a=e;if(r&&i&&!AO(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(NO(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 gU={Point:Qk,LineString:qA,Polygon:cA,MultiPoint:OM,MultiLineString:DM,MultiPolygon:AM};function _U(e,t,n){return Array.isArray(t[0])?(iA(e,0,t,n)||(e=e.slice(),oA(e,0,t,n)),e):(rA(e,0,t,n)||(e=e.slice(),aA(e,0,t,n)),e)}function vU(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>vU({...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 hU(new MM(r,r===`Polygon`?_U(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function yU(e,t){if(!e)return null;if(Array.isArray(e))return new MH(e.map(e=>yU(e,t)));let n=gU[e.type];return hU(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var bU=class extends mU{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(xU(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(xU(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return WT()}readFeaturesFromObject(e,t){return WT()}readGeometry(e,t){return this.readGeometryFromObject(xU(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return WT()}readProjection(e){return this.readProjectionFromObject(xU(e))}readProjectionFromObject(e){return WT()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return WT()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return WT()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return WT()}};function xU(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var SU=class extends bU{constructor(e){e||={},super(),this.dataProjection=SO(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=SO(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=CU(n.geometry,t);if(this.featureClass===MM)return vU({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(yU(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 wU(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t){if(t.type==`name`)n=SO(t.properties.name);else if(t.type===`EPSG`)n=SO(`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=MU(a,t),delete i[e.getGeometryName()]),xT(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 MU(e,this.adaptOptions(t))}};function CU(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=EU(e);break;case`LineString`:n=DU(e);break;case`Polygon`:n=jU(e);break;case`MultiPoint`:n=kU(e);break;case`MultiLineString`:n=OU(e);break;case`MultiPolygon`:n=AU(e);break;case`GeometryCollection`:n=TU(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function wU(e,t){return yU(CU(e,t),t)}function TU(e,t){return e.geometries.map(function(e){return CU(e,t)})}function EU(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:mk(t.length)}}function DU(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:mk(t[0]?.length||2)}}function OU(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:kk(r,0,t,n),layout:mk(n)}}function kU(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:mk(t[0]?.length||2)}}function AU(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:Ak(n,0,t,r),layout:mk(r)}}function jU(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:kk(n,0,t,r),layout:mk(r)}}function MU(e,t){e=hU(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=RU(e,t);break;case`LineString`:r=PU(e,t);break;case`Polygon`:r=zU(e,t);break;case`MultiPoint`:r=IU(e,t);break;case`MultiLineString`:r=FU(e,t);break;case`MultiPolygon`:r=LU(e,t);break;case`GeometryCollection`:r=NU(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function NU(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return MU(e,t)})}}function PU(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function FU(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function IU(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function LU(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function RU(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function zU(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}const BU={root:`draw-control`,toggle:`draw-control-toggle`,shapes:`draw-control-shapes`,shape:`draw-control-shape`},VU={"fill-color":`rgba(255, 255, 255, 0.2)`,"stroke-color":`#8c62ff`,"stroke-width":2,"circle-radius":7,"circle-fill-color":`#8c62ff`},HU={dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`},UU=[{shape:`Point`,label:`Draw a point`,Icon:$n},{shape:`LineString`,label:`Draw a line`,Icon:mr},{shape:`Circle`,label:`Draw a circle`,Icon:Qn}];function WU({target:t,className:n,fileName:r=`react-openlayers-geojson.json`}){let i=XR(),a=sH(`MapDrawControl`,G(BU.root,n),t),[o,s]=e.useState(!1),[c,l]=e.useState(null),u=e.useRef(null),d=e.useRef(null);if(!u.current){let e=new nN;u.current={source:e,layer:new DI({source:e,style:VU,properties:{key:`drawLayer`}}),modify:new tU({source:e})}}let f=u.current,p=e.useCallback(()=>{let e=f.source.getFeatures(),t=new SU().writeFeaturesObject(e,HU),n=new Blob([JSON.stringify(t)],{type:`application/json`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=r,a.click(),URL.revokeObjectURL(i)},[f,r]);e.useEffect(()=>{if(!(!i||!o))return i.addLayer(f.layer),i.addInteraction(f.modify),()=>{i.removeInteraction(f.modify),i.removeLayer(f.layer)}},[i,o,f]),e.useEffect(()=>{if(!i||!o||!c)return;let e=c===`LineString`?new qH({source:f.source,type:c,maxPoints:2}):new qH({source:f.source,type:c}),t=new pU({source:f.source});return d.current=e,i.addInteraction(e),i.addInteraction(t),()=>{i.removeInteraction(t),i.removeInteraction(e),d.current=null}},[i,o,c,f]),e.useEffect(()=>{if(!i||!o)return;let e=i.getTargetElement();if(!e)return;let t=e=>{e.key===`Escape`?d.current?.abortDrawing():e.shiftKey&&e.key===`S`&&p()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,o,p]);let h=()=>{s(e=>!e),l(null)},g=e=>{l(t=>t===e?null:e)};return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:BU.toggle,title:`Click here to start drawing. Shift+S to save as GeoJSON`,"aria-expanded":o,onClick:h,children:(0,q.jsx)(Cr,{size:12})}),o?(0,q.jsxs)(`div`,{className:BU.shapes,children:[UU.map(({shape:e,label:t,Icon:n})=>(0,q.jsx)(`button`,{type:`button`,className:BU.shape,title:`${t}. Hold shift to draw freehand`,"aria-pressed":c===e,onClick:()=>g(e),children:(0,q.jsx)(n,{size:12})},e)),(0,q.jsx)(`button`,{type:`button`,className:BU.shape,title:`Move and reshape what has been drawn`,"aria-pressed":c===null,onClick:()=>g(null),children:(0,q.jsx)(In,{size:12})})]}):null]}),a)}WU.displayName=`MapDrawControl`;const GU={root:`layers-control`,toggle:`layers-control-toggle`,layers:`layers-control-layers`,list:`layers-control-list`,item:`layers-control-item`,label:`layers-control-label`},KU=(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 jL?KU(e.getLayers().getArray(),`${r}.`):[]}});function qU({target:t,className:n}){let r=XR(),i=sH(`MapLayersControl`,G(GU.root,n),t),[a,o]=e.useState(!1),[s,c]=e.useState(0),l=e.useMemo(()=>r&&a?KU(r.getLayers().getArray(),``):[],[r,a,s]),u=(e,t)=>{e.setVisible(t),c(e=>e+1)},d=e=>(0,q.jsx)(`ul`,{className:GU.list,children:e.map(e=>(0,q.jsxs)(`li`,{className:GU.item,children:[(0,q.jsxs)(`label`,{className:GU.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?d(e.children):null]},e.key))});return m((0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:GU.toggle,title:`Click here to switch layers`,"aria-expanded":a,onClick:()=>o(e=>!e),children:(0,q.jsx)(pr,{size:24})}),a?(0,q.jsx)(`div`,{className:GU.layers,children:d(l)}):null]}),i)}qU.displayName=`MapLayersControl`;const JU={root:`search-control`,toggle:`search-control-toggle`,input:`search-control-input`};function YU({target:t,className:n,zoom:r=18,color:i=iz,placeholder:a=`Search for a place`}){let o=XR(),s=sH(`MapSearchControl`,G(JU.root,n),t),[c,l]=e.useState(!1),[u,d]=e.useState(``);return m((0,q.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!o||!u)return;let[t]=await nz(u,1);if(!t)return;let n=[Number(t.lon),Number(t.lat)];sz(o,n,i).set(`address`,t.display_name),o.getView().setCenter(OO(n)),o.getView().setZoom(r)},children:[(0,q.jsx)(`button`,{type:`button`,className:JU.toggle,title:a,"aria-expanded":c,onClick:()=>l(e=>!e),children:(0,q.jsx)(Sr,{size:24})}),c?(0,q.jsx)(`input`,{type:`search`,className:JU.input,value:u,placeholder:a,"aria-label":a,autoComplete:`off`,onChange:e=>d(e.target.value)}):null]}),s)}YU.displayName=`MapSearchControl`;const XU=t=>{let n=XR(),r=e.useRef(null);r.current||=t();let i=r.current;return e.useEffect(()=>{if(n)return n.addInteraction(i),()=>{n.removeInteraction(i)}},[n,i]),i};var ZU=class extends fL{constructor(e){e||={},super(e),this.condition_=e.condition?e.condition:cL,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=e.duration===void 0?400:e.duration}handleDragEvent(e){if(!uL(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(!uL(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 uL(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}};function QU(e){return XU(()=>new ZU(e)),null}QU.displayName=`MapDragRotateAndZoomInteraction`;const $U={TRANSLATESTART:`translatestart`,TRANSLATING:`translating`,TRANSLATEEND:`translateend`};var eW=class extends BT{constructor(e,t,n,r,i){super(e),this.features=t,this.coordinate=n,this.startCoordinate=r,this.mapBrowserEvent=i}},tW=class extends fL{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=FT;this.layerFilter_=t,this.filter_=e.filter&&!this.features_?e.filter:FT,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.condition_=e.condition?e.condition:nL,this.lastFeature_=null,this.addChangeListener(KI.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 XT([this.lastFeature_]);return this.dispatchEvent(new eW($U.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 XT([this.lastFeature_]);return this.dispatchEvent(new eW($U.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=LO(t,n),i=LO(this.lastCoordinate_,n),a=r[0]-i[0],o=r[1]-i[1],s=this.features_||new XT([this.lastFeature_]),c=FO();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 eW($U.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 QT)||!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 nW(e){return XU(()=>new tW(e)),null}nW.displayName=`MapTranslateInteraction`;function rW(t){let n=e.useRef(null),r=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e);return t instanceof QT&&(n.current={feature:t,coordinate:e.coordinate},!0)},i=e=>{let t=n.current;if(!t)return;let r=t.feature.getGeometry();r&&(r.translate(e.coordinate[0]-t.coordinate[0],e.coordinate[1]-t.coordinate[1]),t.coordinate=e.coordinate)},a=e=>{let t=e.map.forEachFeatureAtPixel(e.pixel,e=>e),n=e.map.getTargetElement();n&&(n.style.cursor=t?`pointer`:``)},o=()=>(n.current=null,!1);return XU(()=>new fL({handleDownEvent:r,handleDragEvent:i,handleMoveEvent:a,handleUpEvent:o,...t})),null}rW.displayName=`MapPointerInteraction`;const iW={SELECT:`select`};var aW=class extends BT{constructor(e,t,n,r){super(e),this.selected=t,this.deselected=n,this.mapBrowserEvent=r}};const oW={};var sW=class e extends qI{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:aL,this.addCondition_=e.addCondition?e.addCondition:iL,this.removeCondition_=e.removeCondition?e.removeCondition:iL,this.toggleCondition_=e.toggleCondition?e.toggleCondition:cL,this.multi_=e.multi?e.multi:!1,this.filter_=e.filter?e.filter:FT,this.hitTolerance_=e.hitTolerance?e.hitTolerance:0,this.style_=e.style===void 0?cW():e.style,this.features_=e.features||new XT;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=FT;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(vT.ADD,this.boundAddFeature_),this.features_.addEventListener(vT.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(vT.ADD,this.boundAddFeature_),this.features_.removeEventListener(vT.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 DI&&t.getSource()&&t.getSource().hasFeature(e))return t})}getStyle(){return this.style_}applySelectedStyle_(e){let t=X(e);t in oW||(oW[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(oW[r]),delete oW[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 aW(iW.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 aW(iW.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 aW(iW.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 QT)||!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 QT)||!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 aW(iW.SELECT,c,s,e)),!0}};function cW(){let e=hN();return MT(e.Polygon,e.LineString),MT(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const lW=`#ff0000`,uW=`rgba(255, 0, 0, 0.4)`,dW=e=>new _N({text:e,font:`12px Calibri,sans-serif`,fill:new rN({color:`#000`}),stroke:new iN({color:`#fff`,width:3}),offsetY:-10}),fW=e=>{let t=e.getGeometry();if(!(t instanceof fk))return;let n=t.getType();if(n===`Point`)return new dN({image:new uN({radius:6,fill:new rN({color:uW}),stroke:new iN({color:lW,width:2})})});if(n===`LineString`){let e=new dN({stroke:new iN({color:lW,width:3})}),n=iD(t)/1e3;return n>0&&e.setText(dW(`Length: ${n.toFixed(2)} km`)),e}let r=new dN({fill:new rN({color:uW}),stroke:new iN({color:lW,width:2})});try{let e=oD(t)/1e6;e>0&&r.setText(dW(`Area: ${e.toFixed(2)} km²`))}catch{}return r};function pW({onSelect:t,style:n=fW,...r}){let i=XR(),a=XU(()=>new sW({...r,style:n})),o=e.useRef(t);return e.useEffect(()=>{o.current=t},[t]),e.useEffect(()=>{let e=a.on(`select`,e=>{e.deselected.forEach(e=>e.setStyle(void 0)),e.selected.length>0&&o.current?.(e)});return()=>UT(e)},[a]),e.useEffect(()=>{if(!i)return;let e=i.getTargetElement();if(!e)return;let t=e=>{if(e.key!==`Backspace`)return;let t=a.getFeatures();t.forEach(e=>{a.getLayer(e)?.getSource()?.removeFeature(e)}),t.clear()};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[i,a]),null}pW.displayName=`MapSelectInteraction`;function mW(e){return QE(e,5)}function hW(e){return parseFloat(e)}function gW(e){return mW(e).toString()}function _W(e,t){return!isNaN(e)&&e!==hW(gW(t))}function vW(e,t){return _W(e[0],t[0])||_W(e[1],t[1])}var yW=class extends qI{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(ST(e,II.MOVEEND,this.updateUrl_,this),ST(e.getLayerGroup(),TT.CHANGE,this.updateUrl_,this),ST(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)wT(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=hW(this.get_(e,`z`));`z`in this.params_&&_W(a,n.getZoom())&&(r=!0,i.zoom=a);let o=hW(this.get_(e,`r`));`r`in this.params_&&_W(o,n.getRotation())&&(r=!0,i.rotation=o);let s=[hW(this.get_(e,`x`)),hW(this.get_(e,`y`))];(`x`in this.params_||`y`in this.params_)&&vW(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`,gW(n[0])),this.set_(c,`y`,gW(n[1])),this.set_(c,`z`,gW(r)),this.set_(c,`r`,gW(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 bW(e){return XU(()=>new yW(e)),null}bW.displayName=`MapLinkInteraction`;const xW={root:`map`,surface:`map-surface`,toolbar:`map-toolbar`},SW=37.7649804,CW=-122.4323829,wW=16,TW=[];function EW({latitude:t,longitude:n,zoom:r,marker:i,markerColor:a,markerLabel:o}){let s=XR(),c=e.useRef(!1);return e.useEffect(()=>{if(!s)return;let e=s.getView(),i=OO([n,t]);if(c.current){e.animate({center:i,zoom:r,duration:500});return}c.current=!0,e.setCenter(i),e.setZoom(r)},[s,t,n,r]),e.useEffect(()=>{if(!s||!i)return;let e=sz(s,[n,t],a,o);return()=>cz(s,e)},[s,t,n,i,a,o]),null}EW.displayName=`MapLocation`;function DW(t,n){let{latitude:r=SW,longitude:i=CW,zoom:a=16,width:o,height:s,controls:c=TW,marker:l=!0,markerColor:u,markerLabel:d,id:f,className:p,style:m,children:h,"aria-label":g,"aria-labelledby":_,...v}=t,y=Y(f),b=e.useRef(null),x=Be(n,b),S=e.useRef(null);if(!S.current){let e=document.createElement(`div`);e.className=xW.toolbar,S.current=e}let C=S.current;e.useEffect(()=>(b.current?.append(C),()=>C.remove()),[C]);let w=_?void 0:g??`Map`,T=e=>{switch(e){case`scaleLine`:return(0,q.jsx)(SH,{},e);case`fullScreen`:return(0,q.jsx)(_H,{target:C,source:y},e);case`search`:return(0,q.jsx)(YU,{target:C},e);case`layers`:return(0,q.jsx)(qU,{target:C},e);case`draw`:return(0,q.jsx)(WU,{target:C},e)}};return(0,q.jsx)(`div`,{ref:x,id:y,role:`region`,tabIndex:0,"aria-label":w,"aria-labelledby":_,className:G(xW.root,p),style:{...m,"--map-width":typeof o==`number`?`${o}px`:o,"--map-height":typeof s==`number`?`${s}px`:s},"data-component":`Map`,...v,children:(0,q.jsxs)(YR,{className:xW.surface,keyboardEventTarget:y,children:[(0,q.jsx)(EW,{latitude:r,longitude:i,zoom:a,marker:l,markerColor:u,markerLabel:d}),c.map(T),h]})})}DW.displayName=`Map`;var OW=K(DW);const kW=Object.assign(OW,{View:ZR,Marker:dz,Overlay:pz,LayerGroup:_z,TileLayer:vz,ImageLayer:Sz,VectorLayer:Cz,GraticuleLayer:wz,HeatmapLayer:nH,WebGLTileLayer:aH,AttributionControl:cH,DrawControl:WU,FullScreenControl:_H,LayersControl:qU,MousePositionControl:EH,OverviewMapControl:AH,ScaleLineControl:SH,SearchControl:YU,DragRotateAndZoomInteraction:QU,LinkInteraction:bW,PointerInteraction:rW,SelectInteraction:pW,TranslateInteraction:nW}),AW={root:`markdown`};function jW(t,n){let{className:r,source:i,transformers:a,preserveNewLines:o=!1,...s}=t,[c]=w(),l=e.useCallback(e=>{c.setRootElement(e)},[c]),u=Be(n,l);return Ea(()=>{c.update(()=>{x(i,a,void 0,o)},{discrete:!0})},[c,i,a,o]),(0,q.jsx)(`div`,{ref:u,className:G(AW.root,r),"data-component":`Markdown`,...s})}jW.displayName=`MarkdownProse`;var MW=K(jW);const NW=`Markdown`,PW=[z,ne,F,P,k,E,T],FW=[S,...C],IW={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 LW(e,t){let{className:n,children:r=``,transformers:i=FW,preserveNewLines:a=!1,namespace:o=NW,onError:s,...c}=e;return(0,q.jsx)(b,{initialConfig:{namespace:o,theme:IW,nodes:PW,editable:!1,onError:s??(e=>{throw e})},children:(0,q.jsx)(MW,{ref:t,className:n,source:r,transformers:i,preserveNewLines:a,...c})})}LW.displayName=`Markdown`;var RW=K(LW);const zW={slow:30,medium:60,fast:120},BW={start:`inline`,end:`inline`,top:`block`,bottom:`block`},VW=2,HW=({side:t=`start`,speed:n=`medium`}={})=>{let r=e.useRef(null),i=e.useRef(null),[a,o]=e.useState(0),[s,c]=e.useState(2),l=BW[t];Ea(()=>{let e=r.current,t=i.current;if(!e||!t)return;let n=()=>{let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=l===`inline`?n.width:n.height,a=l===`inline`?r.width:r.height;o(i),c(i>0?Math.max(2,Math.ceil(a/i)+1):2)};if(n(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(n);return a.observe(e),a.observe(t),()=>{a.disconnect()}},[l]);let u=a>0?a/zW[n]:0;return{rootRef:r,groupRef:i,axis:l,copies:s,distance:a,duration:u,style:{"--marquee-distance":`${a}px`,"--marquee-duration":`${u}s`}}},UW={track:`marquee-track`,group:`marquee-group`},WW=W(`marquee`,{variants:{side:{start:`marquee-inline`,end:`marquee-inline marquee-reversed`,top:`marquee-block`,bottom:`marquee-block marquee-reversed`},spacing:{none:`marquee-spacing-none`,tight:`marquee-spacing-tight`,condensed:`marquee-spacing-condensed`,cozy:`marquee-spacing-cozy`,normal:`marquee-spacing-normal`,spacious:`marquee-spacing-spacious`},pauseOnHover:{true:`marquee-pause-on-hover`,false:``},paused:{true:`marquee-paused`,false:``}}});function GW(e,t){let{className:n,children:r,style:i,side:a=`start`,speed:o=`medium`,spacing:s,pauseOnHover:c=!0,paused:l=!1,...u}=e,{rootRef:d,groupRef:f,axis:p,copies:m,style:h}=HW({side:a,speed:o}),g=Be(t,d);return(0,q.jsx)(`div`,{ref:g,className:G(WW({side:a,spacing:s,pauseOnHover:c,paused:l}),n),style:{...i,...h},"data-component":`Marquee`,"data-side":a,"data-axis":p,"data-speed":o,"data-spacing":s,"data-paused":l,...u,children:(0,q.jsx)(`div`,{className:UW.track,children:Array.from({length:m},(e,t)=>(0,q.jsx)(`div`,{ref:t===0?f:void 0,"aria-hidden":t!==0||void 0,className:UW.group,"data-component":`Marquee.Group`,children:r},t))})})}GW.displayName=`Marquee`;var KW=K(GW);const qW=n({}),JW=W(`message`,{variants:{align:{start:`message-align-start`,end:`message-align-end`}}});function YW(t,n){let{as:r=`div`,className:i,align:a,...o}=t,{align:s}=e.useContext(qW),c=a??s??`start`,l={align:c};return(0,q.jsx)(lu.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G(JW({align:c}),i),"data-component":`Message`,"data-align":c,...o})})}YW.displayName=`Message`;var XW=K(YW);const ZW={root:`message-avatar`};function QW(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(ZW.root,r),"data-component":`Message.Avatar`,...i})}QW.displayName=`Message.Avatar`;var $W=K(QW);const eG={root:`message-content`};function tG(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(eG.root,r),"data-component":`Message.Content`,...i})}tG.displayName=`Message.Content`;var nG=K(tG);const rG={root:`message-footer`};function iG(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(rG.root,r),"data-component":`Message.Footer`,...i})}iG.displayName=`Message.Footer`;var aG=K(iG);const oG={root:`message-group`};function sG(e,t){let{as:n=`div`,className:r,align:i=`start`,...a}=e;return(0,q.jsx)(qW.Provider,{value:{align:i},children:(0,q.jsx)(n,{ref:t,className:G(oG.root,r),"data-component":`Message.Group`,"data-align":i,...a})})}sG.displayName=`Message.Group`;var cG=K(sG);const lG={root:`message-header`};function uG(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(lG.root,r),"data-component":`Message.Header`,...i})}uG.displayName=`Message.Header`;var dG=K(uG);const fG=Object.assign(XW,{Group:cG,Avatar:$W,Content:nG,Header:dG,Footer:aG}),pG=e=>{let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1},mG=(e,t,n)=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e,hG=(e,t,{step:n=1,min:r,max:i}={})=>{if(e===null)return mG(r??0,r,i);let a=e+t*n,o=Math.max(pG(n),pG(e)),s=o===0?a:Number(a.toFixed(o));return mG(s,r,i)},gG=e=>{if(e.value===``)return null;let t=Number(e.value);return Number.isNaN(t)?null:t},_G=n({}),vG={root:`meter-indicator`};function yG(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(vG.root,r),"data-component":`Meter.Indicator`,...i})}yG.displayName=`Meter.Indicator`;var bG=K(yG);const xG={root:`meter-label`};function SG(t,n){let{as:r=`span`,className:i,id:a,...o}=t,{labelId:s}=e.useContext(_G);return(0,q.jsx)(r,{ref:n,id:a??s,className:G(xG.root,i),"data-component":`Meter.Label`,...o})}SG.displayName=`Meter.Label`;var CG=K(SG);const wG={root:`meter-track`};function TG(e,t){let{as:n=`span`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(wG.root,r),"data-component":`Meter.Track`,...i})}TG.displayName=`Meter.Track`;var EG=K(TG);const DG={root:`meter-value`};function OG(t,n){let{className:r,children:i,...a}=t,{formattedValue:o=``,value:s=0}=e.useContext(_G);return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(DG.root,r),"data-component":`Meter.Value`,...a,children:typeof i==`function`?i({formattedValue:o,value:s}):i??o})}OG.displayName=`Meter.Value`;var kG=K(OG);const AG=(e,t,n)=>n===t?0:(e-t)/(n-t)*100,jG=(e,t,n)=>n?new Intl.NumberFormat(void 0,n).format(e):new Intl.NumberFormat(void 0,{style:`percent`}).format(t/100),MG={header:`meter-header`,hidden:`sr-only`},NG=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 PG(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]=si(f,{label:CG,value:kG,track:EG}),b=mG(Number.isNaN(a)?o:a,o,s),x=mG(AG(b,o,s),0,100),S=jG(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)(_G.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(NG({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:MG.header,children:[v.label,v.value]}):null,v.track??(0,q.jsx)(EG,{children:(0,q.jsx)(bG,{})}),y,(0,q.jsx)(`span`,{role:`presentation`,className:MG.hidden,children:`x`})]})})}PG.displayName=`Meter`;var FG=K(PG);const IG=Object.assign(FG,{Label:CG,Value:kG,Track:EG,Indicator:bG});function LG(e,t){return(0,q.jsx)(`optgroup`,{ref:t,"data-component":`NativeSelect.OptGroup`,...e})}LG.displayName=`NativeSelect.OptGroup`;var RG=K(LG);function zG(e,t){return(0,q.jsx)(`option`,{ref:t,"data-component":`NativeSelect.Option`,...e})}zG.displayName=`NativeSelect.Option`;var BG=K(zG);const VG=Object.assign(gS,{Option:BG,OptGroup:RG}),HG={root:`navigation-list-heading`,hidden:`sr-only`};function UG(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?HG.hidden:HG.root,r),"data-component":`NavigationList.Heading`,...i})}UG.displayName=`NavigationList.Heading`;const WG=e.createContext(null),GG=e.createContext({depth:0}),KG=e.createContext({buttonId:``,subNavigationId:``,isOpen:!1}),qG=e=>Number.parseInt(e.slice(1),10),JG=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},YG={heading:UG},XG={container:`NavigationList`};function ZG(t,n){let{children:r,className:i,"aria-label":a,"aria-labelledby":o,...s}=t,[c,l]=si(r,YG),u=Y(),d=c.heading,f=d?d.props.id??u:void 0,p=d?qG(d.props.as??`h2`):null;return(0,q.jsx)(`nav`,{ref:n,"aria-label":a,"aria-labelledby":o??(a?void 0:f),className:G(i),"data-component":`NavigationList`,...s,children:(0,q.jsxs)(WG.Provider,{value:p,children:[d?e.cloneElement(d,{id:f}):null,(0,q.jsx)(gi.Provider,{value:XG,children:(0,q.jsx)(_a,{children:l})})]})})}ZG.displayName=`NavigationList`;var QG=e.forwardRef(ZG);function $G(t){let{title:n,children:r,hideDivider:i=!1,...a}=t,o=e.useContext(WG);return(0,q.jsxs)(q.Fragment,{children:[i?null:(0,q.jsx)(_a.Divider,{}),(0,q.jsxs)(_a.Group,{"data-component":`NavigationList.Group`,...a,children:[n?(0,q.jsx)(_a.GroupHeading,{as:JG(o),children:n}):null,r]})]})}$G.displayName=`NavigationList.Group`;const eK={chevron:`navigation-list-chevron`},tK={trailingVisual:_a.TrailingVisual},nK=t=>{if(!e.isValidElement(t))return!1;let n=t.props[`aria-current`];return n&&n!==`false`?!0:e.Children.toArray(t.props.children).some(nK)};function rK(t){let{children:n,subNavigation:r,defaultOpen:i,className:a}=t,o=Y(),s=Y(),c=e.useRef(null),l=e.useMemo(()=>nK(r),[r]),[u,d]=e.useState(i??l),[f,p]=e.useState(l);Ea(()=>{let e=l||!!c.current?.querySelector(`[aria-current]:not([aria-current='false'])`);p(e),e&&d(!0)},[l,r]);let m=e.useMemo(()=>({buttonId:o,subNavigationId:s,isOpen:u}),[o,s,u]),[h,g]=si(n,tK);return(0,q.jsx)(KG.Provider,{value:m,children:(0,q.jsxs)(_a.Item,{id:o,active:!u&&f,"aria-expanded":u,"aria-controls":s,onSelect:()=>d(e=>!e),className:a,"data-component":`NavigationList.Item`,children:[g,(0,q.jsxs)(_a.TrailingVisual,{children:[h.trailingVisual?.props.children,(0,q.jsx)(qn,{className:eK.chevron})]}),(0,q.jsx)(_a.SubItem,{children:e.cloneElement(r,{ref:c})})]})})}rK.displayName=`NavigationList.ItemWithSubNavigation`;const iK={root:`navigation-list-sub-navigation`,items:`navigation-list-sub-navigation-items`};function aK(t,n){let{className:r,children:i,...a}=t,{buttonId:o,subNavigationId:s,isOpen:c}=e.useContext(KG),{depth:l}=e.useContext(GG),u=e.useMemo(()=>({depth:l+1}),[l]);return!o||!s||l>=4?null:(0,q.jsx)(GG.Provider,{value:u,children:(0,q.jsx)(`ul`,{ref:n,id:s,hidden:!c,"aria-labelledby":o,className:G(iK.root,iK.items,r),"data-component":`NavigationList.SubNavigation`,"data-depth":l+1,...a,children:i})})}aK.displayName=`NavigationList.SubNavigation`;var oK=K(aK);const sK={subNavigation:oK},cK=_a.LinkItem;function lK(e,t){let{as:n,children:r,className:i,defaultOpen:a,"aria-current":o,...s}=e,[c,l]=si(r,sK);return c.subNavigation?(0,q.jsx)(rK,{subNavigation:c.subNavigation,defaultOpen:a,className:i,children:l}):(0,q.jsx)(cK,{ref:t,as:n,"aria-current":o,active:!!o&&o!==`false`,className:i,"data-component":`NavigationList.Item`,...s,children:r})}lK.displayName=`NavigationList.Item`;var uK=K(lK);const dK=e=>typeof e==`string`||!g(e)?e:(0,q.jsx)(e,{});function fK(t,n){let{label:r=`Show more`,pages:i=0,items:a,renderItem:o,...s}=t,[c,l]=e.useState(0),u=Y(),d=a.length/i,f=i===0?a.length:Math.ceil(d*c),p=c===1?0:f-Math.floor(d);return Ea(()=>{c!==0&&document.querySelector(`[data-expand-focus-target="${u}"]`)?.focus()},[c,u]),(0,q.jsxs)(q.Fragment,{children:[c>0?a.slice(0,f).map((e,t)=>{let{text:n,leadingVisual:r,trailingVisual:i,trailingAction:a,...s}=e,c=t===p?u:void 0;return o?o({...e,"data-expand-focus-target":c}):(0,q.jsxs)(uK,{"data-expand-focus-target":c,...s,children:[r?(0,q.jsx)(_a.LeadingVisual,{children:(0,q.jsx)(r,{})}):null,n,i?(0,q.jsx)(_a.TrailingVisual,{children:dK(i)}):null,a?(0,q.jsx)(_a.TrailingAction,{...a}):null]},e.id??t)}):null,c<i||c===0?(0,q.jsxs)(_a.Item,{ref:n,as:`button`,"aria-expanded":!1,onSelect:()=>l(e=>e+1),"data-component":`NavigationList.GroupExpand`,...s,children:[r,(0,q.jsx)(_a.TrailingVisual,{children:(0,q.jsx)(kn,{})})]}):null]})}fK.displayName=`NavigationList.GroupExpand`;var pK=e.forwardRef(fK);const mK={root:`navigation-list-group-heading`};function hK(t){let{as:n,className:r,...i}=t,a=e.useContext(WG);return(0,q.jsx)(_a.GroupHeading,{as:n??JG(a),className:G(mK.root,r),"data-component":`NavigationList.GroupHeading`,...i})}hK.displayName=`NavigationList.GroupHeading`;const gK=ai(hK,Oi),_K=Object.assign(QG,{Heading:UG,Item:uK,SubNavigation:oK,Group:$G,GroupHeading:gK,GroupExpand:pK,Description:wi,LeadingVisual:Hi,TrailingVisual:oa,TrailingAction:aa,Divider:Ei}),vK={root:`navigation-menu-heading`,hidden:`sr-only`};function yK(e){let{as:t=`h2`,visuallyHidden:n=!1,className:r,...i}=e;return(0,q.jsx)(di,{as:t,size:`small`,className:G(n?vK.hidden:vK.root,r),"data-component":`NavigationMenu.Heading`,...i})}yK.displayName=`NavigationMenu.Heading`;const bK=n({openValue:null,setOpenValue:()=>{},orientation:`horizontal`,openOn:`click`,openAfterDelay:()=>{},closeAfterDelay:()=>{}}),xK=n({value:``,triggerId:``,contentId:``,isOpen:!1}),SK=n({linkId:``,descriptionId:``}),CK=n(null),wK=n({depth:0}),TK=e=>Number.parseInt(e.slice(1),10),EK=e=>{let t=e===null?3:e+1;return`h${Math.min(Math.max(t,1),4)}`},DK={root:`navigation-menu`},OK={heading:yK};function kK(t,n){let{children:r,className:i,value:a,defaultValue:o=null,onValueChange:s,orientation:c=`horizontal`,openOn:l=`click`,openDelay:u=200,closeDelay:d=300,onBlur:f,"aria-label":p,"aria-labelledby":m,...h}=t,g=e.useRef(null),_=Be(n,g),[v,y]=si(r,OK),b=Y(),x=v.heading,S=x?x.props.id??b:void 0,C=x?TK(x.props.as??`h2`):null,w=m??(p?void 0:S),T=a!==void 0,[E,D]=e.useState(o),O=T?a:E,k=e.useRef(s);Ea(()=>{k.current=s},[s]);let A=e.useRef(null),j=e.useRef(null),M=e.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null),j.current!==null&&(window.clearTimeout(j.current),j.current=null)},[]);e.useEffect(()=>M,[M]);let N=e.useCallback(e=>{M(),T||D(e),k.current?.(e)},[M,T]),P=e.useCallback(e=>{if(M(),O!==null){N(e);return}A.current=window.setTimeout(()=>{A.current=null,N(e)},u)},[M,u,O,N]),F=e.useCallback(()=>{M(),j.current=window.setTimeout(()=>{j.current=null,N(null)},d)},[M,d,N]);ka(e=>{if(O===null)return;let t=g.current?.querySelector(`[aria-expanded='true']`);N(null),t?.focus(),e.preventDefault()}),e.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=e.useMemo(()=>({openValue:O,setOpenValue:N,orientation:c,openOn:l,openAfterDelay:P,closeAfterDelay:F}),[O,N,c,l,P,F]);return(0,q.jsx)(bK.Provider,{value:L,children:(0,q.jsx)(`nav`,{ref:_,"aria-label":p,"aria-labelledby":w,className:G(DK.root,i),"data-component":`NavigationMenu`,"data-orientation":c,...h,onBlur:I,children:(0,q.jsxs)(CK.Provider,{value:C,children:[x?e.cloneElement(x,{id:S}):null,y]})})})}kK.displayName=`NavigationMenu`;var AK=e.forwardRef(kK);const jK=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 MK(t,n){let{as:r=`div`,className:i,align:a=`start`,...o}=t,{orientation:s}=e.useContext(bK),{triggerId:c,contentId:l,isOpen:u}=e.useContext(xK);if(!l)return null;let d=s===`vertical`?void 0:a;return(0,q.jsx)(r,{ref:n,id:l,hidden:!u,"aria-labelledby":c,className:G(jK({open:u,align:d}),i),"data-component":`NavigationMenu.Content`,"data-orientation":s,"data-align":d,"data-open":u?``:void 0,...o})}MK.displayName=`NavigationMenu.Content`;var NK=K(MK);const PK={root:`navigation-menu-description`};function FK(t){let{className:n,...r}=t,{descriptionId:i}=e.useContext(SK);return(0,q.jsx)(`span`,{id:i,className:G(PK.root,n),"data-component":`NavigationMenu.Description`,...r})}FK.displayName=`NavigationMenu.Description`;const IK={root:`navigation-menu-divider`};function LK(e){let{className:t,...n}=e;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:G(IK.root,t),"data-component":`NavigationMenu.Divider`,...n})}LK.displayName=`NavigationMenu.Divider`;const RK={root:`navigation-menu-group-heading`};function zK(t){let{as:n,className:r,...i}=t,a=e.useContext(CK),o=n??EK(a);return(0,q.jsx)(o,{className:G(RK.root,r),"data-component":`NavigationMenu.GroupHeading`,...i})}zK.displayName=`NavigationMenu.GroupHeading`;const BK={root:`navigation-menu-group`},VK={groupHeading:zK};function HK(t){let{title:n,children:r,className:i,hideDivider:a=!1,...o}=t,s=Y(),[c,l]=si(r,VK),u=c.groupHeading??(n?(0,q.jsx)(zK,{children:n}):null),d=u?u.props.id??s:void 0;return(0,q.jsxs)(q.Fragment,{children:[a?null:(0,q.jsx)(LK,{}),(0,q.jsxs)(`div`,{role:`group`,"aria-labelledby":d,className:G(BK.root,i),"data-component":`NavigationMenu.Group`,...o,children:[u?e.cloneElement(u,{id:d}):null,l]})]})}HK.displayName=`NavigationMenu.Group`;const UK={root:`navigation-menu-item`};function WK(t,n){let{children:r,className:i,value:a,onPointerEnter:o,onPointerLeave:s,...c}=t,l=Y(),u=a??l,d=Y(),f=Y(),{openValue:p,openOn:m,openAfterDelay:h,closeAfterDelay:g}=e.useContext(bK),_=p===u,v=e=>{o?.(e),m===`hover`&&e.pointerType!==`touch`&&h(u)},y=e=>{s?.(e),m===`hover`&&e.pointerType!==`touch`&&g()},b=e.useMemo(()=>({value:u,triggerId:d,contentId:f,isOpen:_}),[u,d,f,_]);return(0,q.jsx)(xK.Provider,{value:b,children:(0,q.jsx)(`li`,{ref:n,className:G(UK.root,i),"data-component":`NavigationMenu.Item`,"data-open":_?``:void 0,...c,onPointerEnter:v,onPointerLeave:y,children:r})})}WK.displayName=`NavigationMenu.Item`;var GK=e.forwardRef(WK);const KK={root:`navigation-menu-visual`},qK=({className:e,...t})=>(0,q.jsx)(`span`,{className:G(KK.root,e),...t});function JK(e){return(0,q.jsx)(qK,{"data-component":`NavigationMenu.LeadingVisual`,...e})}JK.displayName=`NavigationMenu.LeadingVisual`;const YK={root:`navigation-menu-sub-navigation`};function XK(t,n){let{className:r,children:i,...a}=t,{linkId:o}=e.useContext(SK),{depth:s}=e.useContext(wK),c=e.useMemo(()=>({depth:s+1}),[s]);return!o||s>=4?null:(0,q.jsx)(wK.Provider,{value:c,children:(0,q.jsx)(`ul`,{ref:n,"aria-labelledby":o,className:G(YK.root,r),"data-component":`NavigationMenu.SubNavigation`,"data-depth":s+1,...a,children:i})})}XK.displayName=`NavigationMenu.SubNavigation`;var ZK=K(XK);const QK={root:`navigation-menu-visual-trailing`};function $K(e){let{className:t,...n}=e;return(0,q.jsx)(qK,{className:G(QK.root,t),"data-component":`NavigationMenu.TrailingVisual`,...n})}$K.displayName=`NavigationMenu.TrailingVisual`;const eq={root:`navigation-menu-link`,active:`navigation-menu-link-active`,label:`navigation-menu-link-label`,item:`navigation-menu-sub-navigation-item`},tq={leadingVisual:JK,trailingVisual:$K,description:FK,subNavigation:ZK};function nq(t,n){let{as:r=`a`,id:i,className:a,active:o,children:s,onClick:c,...l}=t,{setOpenValue:u}=e.useContext(bK),{depth:d}=e.useContext(wK),f=Y(i),p=Y(),[m,h]=si(s,tq),g=e.useMemo(()=>({linkId:f,descriptionId:p}),[f,p]),_=e=>{c?.(e),!e.defaultPrevented&&u(null)},v=(0,q.jsxs)(r,{ref:n,id:f,"aria-current":o?`page`:void 0,"aria-describedby":m.description?p:void 0,className:G(eq.root,o&&eq.active,a),"data-component":`NavigationMenu.Link`,"data-active":o?``:void 0,"data-has-description":m.description?``:void 0,...l,onClick:_,children:[m.leadingVisual,(0,q.jsxs)(`span`,{className:eq.label,children:[h,m.description]}),m.trailingVisual]}),y=(0,q.jsxs)(SK.Provider,{value:g,children:[v,m.subNavigation]});return d===0?y:(0,q.jsx)(`li`,{className:eq.item,children:y})}nq.displayName=`NavigationMenu.Link`;var rq=K(nq);const iq={root:`navigation-menu-list`},aq=(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 oq(t,n){let{children:r,className:i,onKeyDown:a,...o}=t,{orientation:s,openValue:c,setOpenValue:l}=e.useContext(bK),u=e.useRef(null),d=Be(n,u),f=e=>{a?.(e);let t=u.current;if(e.defaultPrevented||!t)return;let n=s===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`;if(n&&e.key===`ArrowLeft`){let n=document.activeElement;if(c===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(),l(null);return}let o=e.key===`Home`||e.key===`End`,d=e.key===r?1:e.key===i?-1:0;if(d===0&&!o)return;let f=aq(t,s),p=f.indexOf(document.activeElement);if(p!==-1){if(e.preventDefault(),e.stopPropagation(),!n&&c!==null&&l(null),o){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(iq.root,i),"data-component":`NavigationMenu.List`,"data-orientation":s,...o,onKeyDown:f,children:r})}oq.displayName=`NavigationMenu.List`;var sq=e.forwardRef(oq);const cq={root:`navigation-menu-trigger`,chevron:`navigation-menu-chevron`};function lq(t,n){let{children:r,className:i,onClick:a,onKeyDown:o,...s}=t,{setOpenValue:c,orientation:l}=e.useContext(bK),{value:u,triggerId:d,contentId:f,isOpen:p}=e.useContext(xK),m=e.useRef(!1);if(Ea(()=>{!p||!m.current||(m.current=!1,ei(document.getElementById(f))[0]?.focus())},[p,f]),!d)return null;let h=e=>{a?.(e),!e.defaultPrevented&&c(p?null:u)},g=e=>{if(o?.(e),e.defaultPrevented)return;let t=l===`vertical`?`ArrowRight`:`ArrowDown`;if(e.key===t){if(e.preventDefault(),!p){m.current=!0,c(u);return}ei(document.getElementById(f))[0]?.focus()}};return(0,q.jsxs)(`button`,{ref:n,type:`button`,id:d,"aria-expanded":p,"aria-controls":f,className:G(cq.root,i),"data-component":`NavigationMenu.Trigger`,"data-open":p?``:void 0,...s,onClick:h,onKeyDown:g,children:[r,(0,q.jsx)(qn,{className:cq.chevron})]})}lq.displayName=`NavigationMenu.Trigger`;var uq=e.forwardRef(lq);const dq=Object.assign(AK,{Heading:yK,List:sq,Item:GK,Trigger:uq,Content:NK,Link:rq,SubNavigation:ZK,Group:HK,GroupHeading:zK,Description:FK,LeadingVisual:JK,TrailingVisual:$K,Divider:LK}),fq={root:`number-input`,stepper:`number-input-stepper`,step:`number-input-step`},pq=({incrementLabel:e,decrementLabel:t,canIncrement:n,canDecrement:r,onIncrement:i,onDecrement:a})=>(0,q.jsxs)(`span`,{className:fq.stepper,"data-component":`NumberInput.Stepper`,children:[(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:Xn,"aria-label":e,disabled:!n,tabIndex:-1,onClick:i,className:fq.step,"data-component":`NumberInput.Increment`}),(0,q.jsx)(na,{type:`button`,variant:`invisible`,size:`small`,icon:qn,"aria-label":t,disabled:!r,tabIndex:-1,onClick:a,className:fq.step,"data-component":`NumberInput.Decrement`})]});function mq(t,n){let{className:r,value:i,defaultValue:a,min:o,max:s,step:c=1,disabled:l,readOnly:u,hideStepper:d=!1,incrementLabel:f=`Increase`,decrementLabel:p=`Decrease`,onChange:m,...h}=t,g=e.useRef(null),_=Be(n,g),v=i!==void 0,[y,b]=e.useState(a??null),x=v?i:y,S=(e,t)=>{v||b(e),m?.(e,t)},C=e=>{S(gG(e.target),e)},w=e=>{let t=hG(x,e,{step:c,min:o,max:s});!v&&g.current&&(g.current.value=String(t)),S(t),g.current?.focus()},T=x!=null&&s!==void 0&&x>=s,E=x!=null&&o!==void 0&&x<=o,D=!!l||!!u;return(0,q.jsx)(Fs,{ref:_,type:`number`,value:v?x??``:void 0,defaultValue:v?void 0:a,min:o,max:s,step:c,disabled:l,readOnly:u,onChange:C,className:G(fq.root,r),trailingAction:d?void 0:(0,q.jsx)(pq,{incrementLabel:f,decrementLabel:p,canIncrement:!D&&!T,canDecrement:!D&&!E,onIncrement:()=>w(1),onDecrement:()=>w(-1)}),"data-component":`NumberInput`,...h})}mq.displayName=`NumberInput`;var hq=K(mq);const gq={current:null},_q=n({padding:`normal`,rowGap:`normal`,columnGap:`normal`,paneRef:gq,contentWrapperRef:gq,sidebarRef:gq,sidebarContentWrapperRef:gq}),vq={root:`page-layout-horizontal-divider`};function yq(t,n){let{className:r,style:i,variant:a=`none`,position:o,...s}=t,{padding:c}=e.useContext(_q);return(0,q.jsx)(`div`,{ref:n,className:G(vq.root,r),style:{"--spacing-divider":`var(--page-layout-spacing-${c})`,...i},"data-component":`PageLayout.HorizontalDivider`,...Aa(`variant`,a),...Aa(`position`,o),...s})}yq.displayName=`PageLayout.HorizontalDivider`;var bq=K(yq);const xq={root:`page-layout-footer`,hidden:`page-layout-hidden`,divider:`page-layout-footer-divider`,content:`page-layout-region-content`};function Sq(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(_q);return(0,q.jsxs)(`footer`,{ref:n,className:G(xq.root,xq.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Footer`,...Aa(`hidden`,c),...l,children:[(0,q.jsx)(bq,{variant:s,className:xq.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}}),(0,q.jsx)(`div`,{className:xq.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a})]})}Sq.displayName=`PageLayout.Footer`;var Cq=K(Sq);const wq={root:`page-layout-header`,hidden:`page-layout-hidden`,content:`page-layout-region-content`,divider:`page-layout-header-divider`};function Tq(t,n){let{className:r,style:i,children:a,padding:o=`none`,divider:s=`none`,hidden:c=!1,...l}=t,{rowGap:u}=e.useContext(_q);return(0,q.jsxs)(`header`,{ref:n,className:G(wq.root,wq.hidden,r),style:{"--spacing":`var(--page-layout-spacing-${u})`,...i},"data-component":`PageLayout.Header`,...Aa(`hidden`,c),...l,children:[(0,q.jsx)(`div`,{className:wq.content,style:{"--spacing":`var(--page-layout-spacing-${o})`},children:a}),(0,q.jsx)(bq,{variant:s,className:wq.divider,style:{"--spacing":`var(--page-layout-spacing-${u})`}})]})}Tq.displayName=`PageLayout.Header`;var Eq=K(Tq);const Dq=1280,Oq=3,kq={small:256,medium:296,large:320},Aq=e=>typeof e==`object`&&`min`in e&&`default`in e&&`max`in e,jq=e=>e===`small`||e===`medium`||e===`large`,Mq=e=>jq(e)?kq[e]:Aq(e)?parseInt(e.default,10):0,Nq=()=>Fe&&window.innerWidth>=1280?959:511,Pq=e=>`Pane width ${e} pixels`,Fq=(e,t,n=Pq)=>{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))))},Iq=({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`)},Lq=({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`)},Rq={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}},zq={root:`page-layout-drag-handle`},Bq=e=>e===`ArrowLeft`||e===`ArrowRight`||e===`ArrowUp`||e===`ArrowDown`,Vq=e=>e===`ArrowLeft`||e===`ArrowDown`;function Hq(t){let{className:n,handleRef:r,onDragStart:i,onDrag:a,onDragEnd:o,onDoubleClick:s,"aria-label":c,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,dragTargetRef:p,contentWrapperRef:m,formatValueText:h=Pq}=t,g=e.useRef({onDragStart:i,onDrag:a,onDragEnd:o});e.useEffect(()=>{g.current={onDragStart:i,onDrag:a,onDragEnd:o}});let _=e.useRef(!1),v=e.useRef(null),y=e.useRef(null),b=e.useCallback(()=>{_.current||=(Iq({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!0)},[r,p,m]),x=e.useCallback(()=>{_.current&&=(Lq({handle:r.current,pane:p?.current??null,contentWrapper:m?.current??null}),!1)},[r,p,m]);return e.useEffect(()=>()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)},[]),(0,q.jsx)(`div`,{ref:r,role:`slider`,tabIndex:0,"aria-label":l?void 0:c??`Draggable pane splitter`,"aria-labelledby":l,"aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":f,"aria-valuetext":f===void 0?void 0:h(f),className:G(zq.root,n),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=>{Bq(e.key)&&(e.preventDefault(),b(),g.current.onDrag(Vq(e.key)?-3:3,!0))},onKeyUp:e=>{Bq(e.key)&&(e.preventDefault(),x(),g.current.onDragEnd())},onDoubleClick:s,"data-component":`PageLayout.DragHandle`})}Hq.displayName=`PageLayout.DragHandle`;const Uq={root:`page-layout-vertical-divider`};function Wq(e,t){let{className:n,variant:r=`none`,position:i,...a}=e;return(0,q.jsx)(`div`,{ref:t,className:G(Uq.root,n),"data-component":`PageLayout.VerticalDivider`,...Aa(`variant`,r),...Aa(`position`,i),...a})}Wq.displayName=`PageLayout.VerticalDivider`;var Gq=K(Wq);const Kq=({width:t,minWidth:n,resizable:r,widthStorageKey:i,paneRef:a,handleRef:o,contentWrapperRef:s,constrainToViewport:c=!1,onResizeEnd:l,currentWidth:u,formatValueText:d})=>{let f=Aq(t),p=f?parseInt(t.min,10):n,m=f?parseInt(t.max,10):null,h=e.useMemo(()=>Mq(t),[t]),g=e.useRef(i),_=e.useRef(l),v=e.useRef(d);Ea(()=>{g.current=i,_.current=l,v.current=d});let y=e.useRef(c?256:511),b=e.useCallback(()=>{let e=window.innerWidth,t=e>0?Math.max(p,e-y.current):p;return m===null?t:c?Math.min(m,t):m},[m,p,c]),[x,S]=e.useState(()=>typeof u==`number`?u:l===void 0&&r===!0&&i!==void 0?Rq.get(i)??h:h),[C,w]=e.useState(h),[T,E]=e.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=e.useRef(O),[A,j]=e.useState(()=>m??600),M=e.useRef(A);Ea(()=>{k.current=O},[O]);let N=e.useCallback(()=>Mq(t),[t]),P=e.useCallback(t=>{let n=Math.round(t);if(k.current=n,e.startTransition(()=>{S(n)}),_.current){try{_.current(n)}catch{}return}r&&g.current&&Rq.save(g.current,n)},[r]),F=e.useRef(b);return Ea(()=>{F.current=b}),Ea(()=>{if(!r)return;let t=window.innerWidth,n=()=>{let n=window.innerWidth,r=t<Dq!=n<Dq;t=n,r&&(y.current=Nq());let i=F.current();a.current?.style.setProperty(`--pane-max-width`,`${i}px`);let s=k.current>i;s&&(k.current=i,a.current?.style.setProperty(`--pane-width`,`${i}px`)),Fq(o.current,{max:i,current:k.current},v.current),(i!==M.current||s)&&(M.current=i,e.startTransition(()=>{j(i),s&&S(i)}))};y.current=Nq();let i=F.current();if(M.current=i,a.current?.style.setProperty(`--pane-max-width`,`${i}px`),Fq(o.current,{min:p,max:i,current:k.current},v.current),e.startTransition(()=>{j(i)}),m!==null&&!c)return;let l=0,u=null,d=null,f=!1,h=()=>{f||(f=!0,a.current?.setAttribute(`data-dragging`,`true`),s?.current?.setAttribute(`data-dragging`,`true`))},g=()=>{f&&(f=!1,a.current?.removeAttribute(`data-dragging`),s?.current?.removeAttribute(`data-dragging`))},_=()=>{h();let e=performance.now();e-l>=16?(l=e,n()):u===null&&(u=requestAnimationFrame(()=>{u=null,l=performance.now(),n()})),d!==null&&clearTimeout(d),d=setTimeout(g,150)};return window.addEventListener(`resize`,_),()=>{u!==null&&cancelAnimationFrame(u),d!==null&&clearTimeout(d),g(),window.removeEventListener(`resize`,_)}},[r,m,c,p,a,o,s]),{currentWidth:O,currentWidthRef:k,minPaneWidth:p,maxPaneWidth:A,getMaxPaneWidth:b,getDefaultWidth:N,saveWidth:P}},qq={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 Jq(t,n){let{className:r,style:i,children:a,id:o,position:s=`start`,width:c=`medium`,minWidth:l=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}=t,{columnGap:S,sidebarRef:C,sidebarContentWrapperRef:w}=e.useContext(_q),T=e.useRef(null),E=e.useRef(0),D=e.useRef(0),O=e.useRef(0),{currentWidth:k,currentWidthRef:A,minPaneWidth:j,maxPaneWidth:M,getMaxPaneWidth:N,getDefaultWidth:P,saveWidth:F}=Kq({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:C,handleRef:T,contentWrapperRef:w,constrainToViewport:!0,onResizeEnd:d,currentWidth:u}),I=Be(n,C),L=Qp(C),ee=Y(o),R=L?{role:`region`,tabIndex:0,...b?{"aria-labelledby":b}:y?{"aria-label":y}:{}}:{},te=e=>{C.current?.style.setProperty(`--pane-width`,`${e}px`),A.current=e},z=(0,q.jsx)(Gq,{variant:h?`line`:m,position:s,className:qq.divider,children:h?(0,q.jsx)(Hq,{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=s===`end`?-e:e,r=Math.max(j,Math.min(n,A.current+t));r!==A.current&&(te(r),Fq(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+(s===`end`?-r:r)));Math.round(i)!==Math.round(A.current)&&(te(i),Fq(T.current,{current:Math.round(i),max:n}))},onDragEnd:()=>F(A.current),onDoubleClick:()=>{let e=P();te(e),Fq(T.current,{current:e}),F(e)}}):null});return(0,q.jsxs)(`div`,{className:G(qq.wrapper,qq.hidden,qq.position,qq.sticky,qq.fullscreen,r),style:{"--spacing-column":`var(--page-layout-spacing-${S})`,...i},"data-position":s,"data-sticky":g||void 0,"data-responsive-variant":_==="default"?void 0:_,...Aa(`is-hidden`,v),children:[s===`end`?z:null,(0,q.jsx)(`div`,{ref:I,suppressHydrationWarning:h&&!!f&&!d,className:G(qq.sidebar,qq.sidebarResizable,qq.sidebarFullscreen,qq.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":Aq(c)?c.min:`${l}px`,"--pane-max-width":Aq(c)?c.max:`calc(100vw - var(--sidebar-max-width-diff))`,"--pane-width-custom":Aq(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${jq(c)?c:`custom`})`,"--pane-width":`${k}px`},"data-component":`PageLayout.Sidebar`,"data-resizable":h||void 0,...R,...o?{id:ee}:{},...x,children:a}),s===`start`?z:null]})}Jq.displayName=`PageLayout.Sidebar`;var Yq=K(Jq);const Xq={content:`page-layout-content-row`},Zq=W(`page-layout`,{variants:{hasSidebar:{true:`page-layout-has-sidebar`,false:``}}}),Qq=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 $q(t,n){let{className:r,style:i,children:a,containerWidth:o=`xlarge`,padding:s=`normal`,rowGap:c=`normal`,columnGap:l=`normal`,...u}=t,d=e.useRef(null),f=e.useRef(null),p=e.useRef(null),m=e.useRef(null),[h,g]=si(a,{header:Eq,footer:Cq,sidebar:Yq}),_=e.useMemo(()=>({padding:s,rowGap:c,columnGap:l,paneRef:d,contentWrapperRef:f,sidebarRef:p,sidebarContentWrapperRef:m}),[s,c,l]);return(0,q.jsx)(_q.Provider,{value:_,children:(0,q.jsxs)(`div`,{ref:n,className:G(Zq({hasSidebar:!!h.sidebar}),r),style:{"--spacing":`var(--page-layout-spacing-${s})`,...i},"data-component":`PageLayout`,"data-has-sidebar":h.sidebar?``:void 0,...u,children:[h.sidebar,(0,q.jsxs)(`div`,{ref:m,className:G(Qq({width:o})),"data-page-layout-wrapper":``,"data-width":o,children:[h.header,(0,q.jsx)(`div`,{className:Xq.content,children:g}),h.footer]})]})})}$q.displayName=`PageLayout`;var eJ=K($q);const tJ={wrapper:`page-layout-content-wrapper`,hidden:`page-layout-hidden`,dragging:`page-layout-dragging`},nJ=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 rJ(t,n){let{as:r=`main`,className:i,children:a,width:o=`full`,padding:s=`none`,hidden:c=!1,...l}=t,{contentWrapperRef:u}=e.useContext(_q),d=Be(n,u);return(0,q.jsx)(r,{ref:d,className:G(tJ.wrapper,tJ.hidden,tJ.dragging,i),"data-component":`PageLayout.Content`,...Aa(`is-hidden`,c),...l,children:(0,q.jsx)(`div`,{className:G(nJ({width:o})),"data-width":o,style:{"--spacing":`var(--page-layout-spacing-${s})`},children:a})})}rJ.displayName=`PageLayout.Content`;var iJ=K(rJ);const aJ={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 oJ(t,n){let{className:r,style:i,children:a,id:o,position:s=`end`,width:c=`medium`,minWidth:l=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}=t,S=Zs(s)?`end`:s,C=Zs(m)?`none`:m,{rowGap:w,columnGap:T,paneRef:E,contentWrapperRef:D}=e.useContext(_q),O=e.useRef(null),k=e.useRef(0),A=e.useRef(0),j=e.useRef(0),{currentWidth:M,currentWidthRef:N,minPaneWidth:P,maxPaneWidth:F,getMaxPaneWidth:I,getDefaultWidth:L,saveWidth:ee}=Kq({width:c,minWidth:l,resizable:h,widthStorageKey:f,paneRef:E,handleRef:O,contentWrapperRef:D,onResizeEnd:d,currentWidth:u}),R=Be(n,E),te=Qp(E),z=Y(o),ne=te?{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(aJ.wrapper,aJ.hidden,aJ.position,aJ.sticky,r),style:{"--offset-header":typeof _==`number`?`${_}px`:_,"--spacing-row":`var(--page-layout-spacing-${w})`,"--spacing-column":`var(--page-layout-spacing-${T})`,...i},"data-sticky":g||void 0,...Aa(`is-hidden`,v),...Aa(`position`,s),children:[(0,q.jsx)(bq,{variant:Zs(m)?m:{narrow:C,regular:`none`},position:s,className:aJ.horizontalDivider,style:{"--spacing":`var(--page-layout-spacing-${w})`}}),(0,q.jsx)(`div`,{ref:R,suppressHydrationWarning:h&&!d,className:G(aJ.pane,aJ.paneResizable,aJ.dragging),style:{"--spacing":`var(--page-layout-spacing-${p})`,"--pane-min-width":Aq(c)?c.min:`${l}px`,"--pane-max-width":Aq(c)?c.max:`calc(100vw - var(--pane-max-width-diff))`,"--pane-width-custom":Aq(c)?c.default:void 0,"--pane-width-size":`var(--pane-width-${jq(c)?c:`custom`})`,"--pane-width":`${M}px`},"data-component":`PageLayout.Pane`,"data-resizable":h||void 0,...ne,...o?{id:z}:{},...x,children:a}),(0,q.jsx)(Gq,{variant:Zs(m)?{narrow:`none`,regular:h?`line`:m.regular??`none`,wide:h?`line`:m.wide??m.regular??`none`}:{narrow:`none`,regular:h?`line`:C},position:s,className:aJ.verticalDivider,style:{"--spacing":`var(--page-layout-spacing-${T})`},children:h?(0,q.jsx)(Hq,{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),Fq(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),Fq(O.current,{current:Math.round(i),max:n}))},onDragEnd:()=>ee(N.current),onDoubleClick:()=>{let e=L();B(e),Fq(O.current,{current:e}),ee(e)}}):null})]})}oJ.displayName=`PageLayout.Pane`;var sJ=K(oJ);const cJ=Object.assign(eJ,{Header:Eq,Content:iJ,Pane:sJ,Sidebar:Yq,Footer:Cq}),lJ=[`narrow`,`regular`,`wide`],uJ={root:`pagination`,steps:`pagination-steps`,hidden:{narrow:`pagination-hidden-narrow`,regular:`pagination-hidden-regular`,wide:`pagination-hidden-wide`}},dJ=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:``}}}),fJ=e=>typeof e==`object`?lJ.filter(t=>e[t]===!1):e?[]:[...lJ],pJ=({page:e,children:t})=>(0,q.jsxs)(q.Fragment,{children:[e.type===`previous`?(0,q.jsx)(Jn,{"data-component":`Pagination.PreviousPageIcon`}):null,t,e.type===`next`?(0,q.jsx)(Yn,{"data-component":`Pagination.NextPageIcon`}):null]}),mJ=e=>`#${e}`;function hJ(t,n){let{as:r=`nav`,className:i,pageCount:a,currentPage:o,onPageChange:s,hrefBuilder:c=mJ,marginPageCount:l=1,surroundingPageCount:u=2,showPages:d=!0,renderPage:f,...p}=t,m=e.useMemo(()=>D_(a,o,!!d,l,u),[a,o,d,l,u]),h=fJ(d),g=m.map(e=>{let{key:t,content:n,presentational:r,props:i}=O_(e,c,t=>s?.(t,e.num)),a=e.type===`previous`||e.type===`next`,o=!!r||!!i[`aria-hidden`],l=G(dJ({step:a?e.type:void 0,current:e.selected,inert:o}));if(f&&!r)return f({key:t,children:(0,q.jsx)(pJ,{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)(pJ,{page:e,children:n})},t)});return(0,q.jsx)(r,{ref:n,"aria-label":`Pagination`,className:G(uJ.root,i),"data-component":`Pagination`,...p,children:(0,q.jsx)(`div`,{className:G(uJ.steps,h.map(e=>uJ.hidden[e])),"data-hidden-viewport-ranges":h.join(` `)||void 0,children:g})})}hJ.displayName=`Pagination`;var gJ=K(hJ);const _J={root:`password-input`,toggle:`password-input-toggle`};function vJ(t,n){let{className:r,visible:i,defaultVisible:a=!1,onVisibilityChange:o,hideToggle:s=!1,showLabel:c=`Show password`,hideLabel:l=`Hide password`,disabled:u,...d}=t,f=i!==void 0,[p,m]=e.useState(a),h=f?i:p;return(0,q.jsx)(Fs,{ref:n,type:h?`text`:`password`,disabled:u,className:G(_J.root,r),trailingAction:s?void 0:(0,q.jsx)(Fs.Action,{icon:h?sr:cr,"aria-label":h?l:c,disabled:u,onClick:e=>{e.stopPropagation();let t=!h;f||m(t),o?.(t)},className:_J.toggle,"data-component":`PasswordInput.Toggle`}),"data-component":`PasswordInput`,...d})}vJ.displayName=`PasswordInput`;var yJ=K(vJ);const bJ={root:`pin-input`},xJ=W(`pin-input-box`,{variants:{size:{small:`pin-input-box-small`,medium:`pin-input-box-medium`,large:`pin-input-box-large`}}}),SJ={numeric:/[0-9]/,alphanumeric:/[0-9a-zA-Z]/},CJ=(e,t)=>Array.from(e).filter(e=>SJ[t].test(e)).join(``);function wJ(t,n){let{className:r,length:i=6,value:a,defaultValue:o=``,type:s=`numeric`,mask:c=!1,size:l=`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}=t,S=e.useRef([]),C=a!==void 0,[w,T]=e.useState(()=>CJ(o,s).slice(0,i)),E=C?a:w,D=Array.from({length:i},(e,t)=>E[t]??``),O=D.findIndex(e=>e===``),k=e.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===i&&v?.(e)},M=(e,t)=>{let n=CJ(t,s);if(n.length===0)return;let r=O===-1?e:Math.min(e,O),a=[...D],o=r;Array.from(n).forEach(e=>{o<i&&(a[o]=e,o+=1)}),j(a.join(``)),A(Math.min(o,i-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<i-1){t.preventDefault(),A(e+1);return}if(t.key===`Home`){t.preventDefault(),A(0);return}t.key===`End`&&(t.preventDefault(),A(i-1))}};return(0,q.jsx)(`div`,{ref:n,role:y||b?`group`:void 0,"aria-label":y,"aria-labelledby":b,className:G(bJ.root,r),"data-component":`PINInput`,"data-size":l,"data-disabled":u,"data-validation":p,...x,children:D.map((e,t)=>(0,q.jsx)(Fs,{ref:e=>{S.current[t]=e},type:c?`password`:`text`,inputMode:s===`numeric`?`numeric`:`text`,size:l,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 ${i}`,onChange:e=>F(t,e),onKeyDown:e=>L(t,e),onPaste:e=>I(t,e),onFocus:()=>P(t),className:G(xJ({size:l})),"data-component":`PINInput.Box`},t))})}wJ.displayName=`PINInput`;var TJ=K(wJ);const EJ={root:`placeholder`};function DJ(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(EJ.root,r),style:{...s,"--placeholder-width":i,"--placeholder-height":a},"data-component":`Placeholder`,...l,children:c??o})}DJ.displayName=`Placeholder`;var OJ=K(DJ);const kJ=n({}),AJ=W(`popover`,{variants:{open:{true:`popover-open`,false:``},relative:{true:`popover-relative`,false:``}}});function jJ(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)(kJ.Provider,{value:c,children:(0,q.jsx)(n,{ref:t,className:G(AJ({open:a,relative:o}),r),"data-component":`Popover`,"data-caret":i,"data-open":a?``:void 0,"data-relative":o?``:void 0,...s})})}jJ.displayName=`Popover`;var MJ=K(jJ);const NJ=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`}}}),PJ=[];function FJ(t,n){let{as:r=`div`,className:i,width:a=`small`,height:o=`fit-content`,overflow:s=`visible`,onClickOutside:c,onEscape:l,ignoreClickRefs:u=PJ,...d}=t,{open:f=!1,caret:p=`top`}=e.useContext(kJ),m=e.useRef(null),h=Be(n,m);return e.useEffect(()=>{if(!f||!c)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))||c(e))};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[f,c,u]),ka(e=>{!f||!l||(l(e),e.preventDefault())}),(0,q.jsx)(r,{ref:h,className:G(NJ({caret:p,width:a,height:o,overflow:s}),i),"data-component":`Popover.Content`,"data-caret":p,"data-width":a,"data-height":o,"data-overflow":s,...d})}FJ.displayName=`Popover.Content`;var IJ=K(FJ);const LJ=Object.assign(MJ,{Content:IJ}),RJ={ring:`progress-circle-ring`,track:`progress-circle-track`,indicator:`progress-circle-indicator`,label:`progress-circle-label`},zJ=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 BJ(t,n){let{as:r=`span`,className:i,progress:a=0,size:o=`medium`,variant:s=`success`,style:c,children:l,"aria-valuenow":u,...d}=t,f=Math.min(Math.max(a,0),100),p=e.Children.toArray(l).length>0;return(0,q.jsxs)(r,{ref:n,role:`progressbar`,"aria-valuenow":u??Math.round(f),"aria-valuemin":0,"aria-valuemax":100,className:G(zJ({size:o,variant:s}),i),style:{...c,"--progress-circle-progress":f},"data-component":`ProgressCircle`,"data-size":o,"data-variant":s,...d,children:[(0,q.jsxs)(`svg`,{className:RJ.ring,viewBox:`0 0 32 32`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:RJ.track,cx:16,cy:16,r:14,pathLength:100}),(0,q.jsx)(`circle`,{className:RJ.indicator,cx:16,cy:16,r:14,pathLength:100})]}),p?(0,q.jsx)(`span`,{className:RJ.label,children:l}):null]})}BJ.displayName=`ProgressCircle`;var VJ=K(BJ);const HJ={L:1,M:0,Q:3,H:2},UJ={numeric:1,alphanumeric:2,byte:4,kanji:8,eci:7,structuredAppend:3,fnc1First:5,fnc1Second:9,terminator:0},WJ={numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12]};function GJ(e,t){let n=WJ[t];return n?e<=9?n[0]:e<=26?n[1]:n[2]:8}const KJ={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 qJ(e,t){return KJ[t][e]}const JJ=[[],[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]],YJ=[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 XJ(e){return/^\d+$/.test(e)}function ZJ(e){for(let t=0;t<e.length;t++)if(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e[t])===-1)return!1;return!0}function QJ(e){return XJ(e)?`numeric`:ZJ(e)?`alphanumeric`:`byte`}function $J(e){let t=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.indexOf(e);if(t===-1)throw Error(`Invalid alphanumeric character: ${e}`);return t}function eY(e){let t=[],n=0;for(;n+2<e.length;)aY(t,Number.parseInt(e.substring(n,n+3),10),10),n+=3;return n+1<e.length&&(aY(t,Number.parseInt(e.substring(n,n+2),10),7),n+=2),n<e.length&&aY(t,Number.parseInt(e[n],10),4),t}function tY(e){let t=[],n=0;for(;n+1<e.length;)aY(t,$J(e[n])*45+$J(e[n+1]),11),n+=2;return n<e.length&&aY(t,$J(e[n]),6),t}function nY(e){let t=[];for(let n of e)aY(t,n,8);return t}function rY(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;aY(t,r*192+i,13)}return t}function iY(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 aY(e,t,n){for(let r=n-1;r>=0;r--)e.push(t>>r&1)}function oY(e,t){return qJ(e,t).totalDataCodewords*8}function sY(e,t,n,r){let i=n===`auto`||!n?QJ(e):n,a=new TextEncoder().encode(e);if(r){let n=oY(r,t);if(cY(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=oY(n,t);if(cY(e,a,i,n)<=r)return n}throw Error(`Data too long for any QR code version with EC level ${t}`)}function cY(e,t,n,r){let i=GJ(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 lY(e,t){return t&&t!==`auto`?t:XJ(e)?`numeric`:ZJ(e)?`alphanumeric`:`byte`}const uY=new Uint8Array(512),dY=new Uint8Array(256);(function(){let e=1;for(let t=0;t<255;t++)uY[t]=e,dY[e]=t,e<<=1,e>=256&&(e^=285);for(let e=255;e<512;e++)uY[e]=uY[e-255]})();function fY(e,t){return e===0||t===0?0:uY[(dY[e]+dY[t])%255]}function pY(e,t){let n=new Uint8Array([1]);for(let e=0;e<t;e++){let t=new Uint8Array([1,uY[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]^=fY(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]^fY(e,n[i+1]);r[t-1]=fY(e,n[t])}return r}function mY(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(pY(n,t)),c+=r}for(let n=0;n<i;n++){let n=e.slice(c,c+a);o.push(n),s.push(pY(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 hY(e,t={}){let n=t.ecLevel??`M`,r=lY(e,t.mode),i=sY(e,n,r,t.version),a=qJ(i,n),o=mY(_Y(gY(e,r,i,a.totalDataCodewords)),a.ecCodewordsPerBlock,a.group1Blocks,a.group1DataCW,a.group2Blocks,a.group2DataCW),s=[];for(let e of o)aY(s,e,8);return{version:i,ecLevel:n,bits:s}}function gY(e,t,n,r){let i=[],a=GJ(n,t),o=new TextEncoder().encode(e);switch(aY(i,UJ[t],4),aY(i,t===`byte`?o.length:e.length,a),t){case`numeric`:i.push(...eY(e));break;case`alphanumeric`:i.push(...tY(e));break;case`byte`:i.push(...nY(o));break;case`kanji`:{let t=iY(e);i.push(...rY(t));break}}let s=r*8,c=Math.min(4,s-i.length);for(c>0&&aY(i,0,c);i.length%8!=0;)i.push(0);let l=!0;for(;i.length<s;)aY(i,l?236:17,8),l=!l;return i}function _Y(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 vY(e){return Array.from({length:e},()=>Array.from({length:e}).fill(null))}function yY(e,t){let n=e.length;bY(e,0,0),bY(e,n-7,0),bY(e,0,n-7),SY(e,n),CY(e,t),e[4*t+9][8]=!0,TY(e,n),t>=7&&EY(e,n)}function bY(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++)xY(e,t-1,n+i,!1,r),xY(e,t+7,n+i,!1,r),xY(e,t+i,n-1,!1,r),xY(e,t+i,n+7,!1,r)}function xY(e,t,n,r,i){t>=0&&t<i&&n>=0&&n<i&&(e[t][n]=r)}function SY(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 CY(e,t){if(t<2)return;let n=JJ[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)&&wY(e,n[t],n[i])}function wY(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 TY(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 EY(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 DY(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 OY(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=JJ[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 kY(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 AY(e,t,n,r){let i=kY(t);for(let t=0;t<n;t++)for(let a=0;a<n;a++)OY(t,a,n,r)&&i(t,a)&&(e[t][a]=!e[t][a])}function jY(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]);AY(o,r,t,n);let s=MY(o,t);s<a&&(a=s,i=r)}return i}function MY(e,t){return NY(e,t)+PY(e,t)+FY(e,t)+IY(e,t)}function NY(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 PY(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 FY(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 IY(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 LY(e,t){let n=HJ[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 RY(e,t,n){let r=e.length,i=LY(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 zY(e,t){if(t<7)return;let n=e.length,r=YJ[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 BY=class extends Error{constructor(...e){super(...e),this.name=`QRCodeError`}},VY=class extends BY{constructor(...e){super(...e),this.name=`InvalidInputError`}};function HY(e,t={}){let{version:n,ecLevel:r,bits:i}=hY(e,t),a=n*4+17,o=vY(a);yY(o,n),DY(o,i,n);let s=jY(o,a,n,t.mask);return AY(o,s,a,n),RY(o,r,s),n>=7&&zY(o,n),o.map(e=>e.map(e=>e===!0))}function UY(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}const WY=(()=>{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 GY(e){let t=4294967295;for(let n=0;n<e.length;n++)t=WY[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function KY(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 qY(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 JY(e){let t=qY(e),n=KY(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 YY=new Uint8Array([137,80,78,71,13,10,26,10]);function XY(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,GY(a)),r}function ZY(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=JY(s),u=XY(`IHDR`,r),d=XY(`IDAT`,l),f=XY(`IEND`,new Uint8Array),p=YY.length+u.length+d.length+f.length,m=new Uint8Array(p),h=0;return m.set(YY,h),h+=YY.length,m.set(u,h),h+=u.length,m.set(d,h),h+=d.length,m.set(f,h),m}function QY(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,${oX(s)}`:$Y(s,o.width,o.height)}function $Y(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)eX(e,i,a,o,l);else if(s===24)tX(e,i,a,o,l);else if(s<=8)nX(e,i,a,o,s,l);else throw Error(`Unsupported BMP bit depth: ${s}`);if(s<32){let t=iX(a,o,s),n=i+rX(e,i,s)+t;n<e.length&&aX(e,n,a,o,l)}return`data:image/png;base64,${oX(ZY(a,o,l))}`}function eX(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 tX(e,t,n,r,i){let a=t+rX(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 nX(e,t,n,r,i,a){let o=rX(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 rX(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 iX(e,t,n){return Math.ceil(e*n/32)*4*t}function aX(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 oX(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const sX=/<script[\s>]|javascript:|on[a-z]+\s*=|<foreignObject[\s>]/i;function cX(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="${UY(e.backgroundColor)}"`;f+=`<rect ${r} width="${n}" height="${n}" ${i} rx="4"/>`}if(e.svg){if(sX.test(e.svg))throw new VY(`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=UY(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 VY(`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=QY(r)}let r=e.imageWidth??c,i=e.imageHeight??c,a=l+(c-r)/2,o=u+(c-i)/2,s=`href="${UY(n)}"`,d=`x="${a}" y="${o}"`;f+=`<image ${s} ${d} width="${r}" height="${i}"/>`}return{svg:f,hiddenModules:d}}function lX(e,t,n,r,i=1){let a=n*i,o=(n-a)/2;switch(r){case`square`:return uX(e+o,t+o,a);case`rounded`:return dX(e+o,t+o,a,a*.25);case`dots`:return fX(e+n/2,t+n/2,a/2);case`diamond`:return pX(e+n/2,t+n/2,a);case`classy`:return mX(e+o,t+o,a);case`classy-rounded`:return hX(e+o,t+o,a);case`extra-rounded`:return dX(e+o,t+o,a,a*.5);case`vertical-line`:return gX(e+o,t,n,a);case`horizontal-line`:return _X(e,t+o,n,a);case`small-square`:return uX(e+n*.15,t+n*.15,n*.7);case`tiny-square`:return uX(e+n*.25,t+n*.25,n*.5);default:return uX(e+o,t+o,a)}}function uX(e,t,n){return`M${e},${t}h${n}v${n}h-${n}z`}function dX(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 fX(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 pX(e,t,n){let r=n/2;return`M${e},${t-r}l${r},${r}l-${r},${r}l-${r},-${r}z`}function mX(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 hX(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 gX(e,t,n,r){return`M${e},${t}h${r}v${n}h-${r}z`}function _X(e,t,n,r){return`M${e},${t}h${n}v${r}h-${n}z`}function vX(e,t,n,r=`square`){let i=n*7;switch(r){case`rounded`:{let r=n*1.5;return bX(e,t,i,i,r)+xX(e+n,t+n,i-2*n,i-2*n,r*.5)}case`dots`:{let r=i/2,a=r-n;return fX(e+r,t+r,r)+fX(e+r,t+r,a)}case`extra-rounded`:{let r=n*2.5;return bX(e,t,i,i,r)+xX(e+n,t+n,i-2*n,i-2*n,r*.6)}case`classy`:{let r=n*1.5;return bX(e,t,i,i,r)+xX(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 yX(e,t,n,r=`square`){let i=n*3,a=e+n*3.5,o=t+n*3.5;switch(r){case`dots`:return fX(a,o,i/2);case`rounded`:return dX(e+n*2,t+n*2,i,n*.75);default:return uX(e+n*2,t+n*2,i)}}function bX(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 xX(e,t,n,r,i){return bX(e,t,n,r,i)}const SX={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`},CX=e=>[{key:`topLeft`,row:0,col:0},{key:`topRight`,row:0,col:e-7},{key:`bottomLeft`,row:e-7,col:0}];function wX(t,n){let{value:r,size:i=200,margin:a=4,ecLevel:o,version:s,mode:c,mask:l,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}=t,S=o??(h?`H`:void 0),C=e.useMemo(()=>{if(!r)return null;try{return HY(r,{ecLevel:S,version:s,mode:c,mask:l})}catch{return null}},[r,S,s,c,l]);if(!C)return(0,q.jsx)(`div`,{ref:n,className:G(SX.root,y),style:b,"data-component":`QRCode`,"data-empty":`true`,...x,children:v?(0,q.jsx)(`span`,{className:SX.fallback,children:v}):null});let w=C.length,T=w+a*2,E=i/T,D=h?cX({size:g},w,E,a).hiddenModules:void 0,O=CX(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(lX((t+a)*E,(e+a)*E,E,u,d))}let j=(e,t,n)=>{let r=(n+a)*E,i=(t+a)*E;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`path`,{className:SX.corner,d:vX(r,i,E,e?.outerShape),fillRule:`evenodd`,style:{fill:e?.outerColor}}),(0,q.jsx)(`path`,{className:SX.corner,d:yX(r,i,E,e?.innerShape),style:{fill:e?.innerColor}})]})},M=g*w/T;return(0,q.jsxs)(`div`,{ref:n,role:`img`,"aria-label":_??r,className:G(SX.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:SX.canvas,width:i,height:i,viewBox:`0 0 ${i} ${i}`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:[(0,q.jsx)(`rect`,{className:SX.background,width:`100%`,height:`100%`}),f?O.map(t=>(0,q.jsx)(e.Fragment,{children:j(f[t.key],t.row,t.col)},t.key)):null,A.length>0?(0,q.jsx)(`path`,{className:SX.modules,d:A.join(``)}):null]}),h?(0,q.jsx)(`span`,{className:SX.logo,"aria-hidden":`true`,children:h}):null]})}wX.displayName=`QRCode`;var TX=K(wX);const EX=n({}),DX={root:`radio-card-description`};function OX(t,n){let{className:r,id:i,...a}=t,{descriptionId:o}=e.useContext(EX);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(DX.root,r),"data-component":`RadioCard.Description`,...a})}OX.displayName=`RadioCard.Description`;var kX=K(OX);const AX={root:`radio-card-label`};function jX(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(EX);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(AX.root,r),"data-component":`RadioCard.Label`,...a})}jX.displayName=`RadioCard.Label`;var MX=K(jX);const NX={root:`radio-card-leading-visual`};function PX(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(NX.root,n),"data-component":`RadioCard.LeadingVisual`,...i})}PX.displayName=`RadioCard.LeadingVisual`;var FX=K(PX);const IX={body:`radio-card-body`,control:`radio-card-control`},LX=W(`radio-card`,{variants:{disabled:{true:`radio-card-disabled`,false:`radio-card-interactive`},validation:{error:`radio-card-error`,success:`radio-card-success`}}});function RX(t,n){let{className:r,children:i,value:a,name:o,checked:s,defaultChecked:c,disabled:l,required:u,validationStatus:d,onChange:f,id:p,"aria-label":m,"aria-labelledby":h,"aria-describedby":g,..._}=t,v=e.useContext(_S).disabled||l,y=Y(p),b=`${y}-label`,x=`${y}-description`,[S,C]=si(i,{leadingVisual:FX,label:MX,description:kX}),w=h??(S.label&&!m?b:void 0),T=[S.description?x:void 0,g].filter(Boolean).join(` `)||void 0;return(0,q.jsx)(EX.Provider,{value:{labelId:b,descriptionId:x},children:(0,q.jsxs)(`label`,{ref:n,className:G(LX({disabled:!!v,validation:d}),r),"data-component":`RadioCard`,"data-disabled":v,"data-required":u,"data-validation":d,..._,children:[S.leadingVisual,(0,q.jsxs)(`div`,{className:IX.body,children:[S.label,S.description,C]}),(0,q.jsx)(bS,{id:y,value:a,name:o,checked:s,defaultChecked:c,disabled:v,required:u,validationStatus:d,onChange:f,"aria-label":m,"aria-labelledby":w,"aria-describedby":T,className:IX.control})]})})}RX.displayName=`RadioCard`;var zX=K(RX);const BX=Object.assign(zX,{LeadingVisual:FX,Label:MX,Description:kX}),VX={root:`radio-group-caption`};function HX(t,n){let{className:r,...i}=t,{captionId:a}=e.useContext(_S);return(0,q.jsx)(`span`,{ref:n,id:a,className:G(VX.root,r),"data-component":`RadioGroup.Caption`,...i})}HX.displayName=`RadioGroup.Caption`;var UX=K(HX);const WX={root:`radio-group-label`,disabled:`radio-group-label-disabled`,hidden:`sr-only`,required:`radio-group-label-required`};function GX(t,n){let{className:r,children:i,visuallyHidden:a,...o}=t,{disabled:s,required:c}=e.useContext(_S);return(0,q.jsxs)(`span`,{ref:n,title:c?`required field`:void 0,className:G(WX.root,s&&WX.disabled,a&&WX.hidden,r),"data-component":`RadioGroup.Label`,"data-label-disabled":s,...o,children:[i,c?(0,q.jsx)(`span`,{className:WX.required,children:`*`}):null]})}GX.displayName=`RadioGroup.Label`;var KX=K(GX);const qX={success:Gn,error:or},JX={icon:`radio-group-validation-icon`},YX=W(`radio-group-validation`,{variants:{variant:{success:`radio-group-validation-success`,error:`radio-group-validation-error`}}});function XX(t,n){let{className:r,children:i,variant:a,...o}=t,{validationMessageId:s}=e.useContext(_S),c=qX[a];return(0,q.jsxs)(`span`,{ref:n,className:G(YX({variant:a}),r),"data-component":`RadioGroup.Validation`,"data-validation-status":a,...o,children:[(0,q.jsx)(c,{className:JX.icon,"aria-hidden":`true`}),(0,q.jsx)(`span`,{id:s,children:i})]})}XX.displayName=`RadioGroup.Validation`;var ZX=K(XX);const QX={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 $X(t,n){let{as:r=`fieldset`,className:i,children:a,name:o,disabled:s,required:c,onChange:l,id:u,"aria-labelledby":d,...f}=t,[p,m]=si(a,{label:KX,caption:UX,validation:ZX}),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&&l?.(t,e)},y=e.isValidElement(p.label)?!p.label.props.visuallyHidden:!1,b={name:o,disabled:s,required:c,captionId:g,validationMessageId:_,onChange:v};return(0,q.jsx)(_S.Provider,{value:b,children:(0,q.jsxs)(r,{ref:n,id:h,disabled:s,"aria-labelledby":p.label?void 0:d,"aria-describedby":[_,g].filter(Boolean).join(` `)||void 0,className:G(QX.root,i),"data-component":`RadioGroup`,"data-disabled":s,"data-required":c,...f,children:[p.label?(0,q.jsxs)(`legend`,{className:G(QX.legend,y&&QX.legendVisible),children:[p.label,c?(0,q.jsx)(`span`,{className:QX.hidden,children:`, required`}):null,p.caption]}):p.caption,(0,q.jsx)(`div`,{className:QX.body,children:m}),p.validation?(0,q.jsx)(`div`,{className:QX.validation,children:p.validation}):null]})})}$X.displayName=`RadioGroup`;var eZ=K($X);const tZ=Object.assign(eZ,{Label:KX,Caption:UX,Validation:ZX}),nZ=5,rZ={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`},iZ=W(`rating`,{variants:{size:{small:`rating-small`,medium:`rating-medium`,large:`rating-large`},interactive:{true:`rating-interactive`,false:``},disabled:{true:`rating-disabled`,false:``}}}),aZ=e=>e===1?`1 star`:`${e} stars`,oZ=(e,t)=>`${e} out of ${t} stars`,sZ=({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 cZ(t,n){let{className:r,style:i,count:a=5,value:o,defaultValue:s,size:c=`medium`,readOnly:l,disabled:u,clearable:d,name:f,onChange:p,itemLabel:m=aZ,valueLabel:h=oZ,"aria-label":g,..._}=t,v=o!==void 0,[y,b]=e.useState(()=>s??0),x=v?o:y,S=Math.max(Math.trunc(a),0),C=Math.min(Math.max(x,0),S),w=Y(f),T=!l&&!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=l?`span`:`label`;return(0,q.jsx)(`span`,{ref:n,role:l?`img`:`radiogroup`,"aria-label":l?g??h(C,S):g,className:G(iZ({size:c,interactive:T,disabled:!!u}),r),style:{...i,"--rating-value":C},"data-component":`Rating`,"data-size":c,"data-value":C,"data-count":S,"data-readonly":l,"data-disabled":u,..._,children:Array.from({length:S},(e,t)=>{let n=t+1;return(0,q.jsxs)(k,{className:rZ.item,style:{"--rating-item-index":t},"data-component":`Rating.Item`,children:[l?null:(0,q.jsx)(`input`,{type:`radio`,className:G(rZ.input,rZ.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:rZ.star,"aria-hidden":`true`,children:[(0,q.jsx)(sZ,{className:rZ.starTrack}),(0,q.jsx)(`span`,{className:rZ.starFill,children:(0,q.jsx)(sZ,{className:rZ.starFillIcon})})]})]},n)})})}cZ.displayName=`Rating`;var lZ=K(cZ);const uZ=1e3,dZ=60*uZ,fZ=60*dZ,pZ=24*fZ,mZ=7*pZ,hZ=30*pZ,gZ=12*hZ,_Z=`P30D`,vZ=`on`,yZ=[{unit:`year`,length:gZ},{unit:`month`,length:hZ},{unit:`week`,length:mZ},{unit:`day`,length:pZ},{unit:`hour`,length:fZ},{unit:`minute`,length:dZ},{unit:`second`,length:uZ}],bZ=[`year`,`month`,`day`,`hour`,`minute`,`second`],xZ={year:`y`,month:`mo`,week:`w`,day:`d`,hour:`h`,minute:`m`,second:`s`},SZ=RegExp(`^P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$`),CZ=e=>{let t=SZ.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)*gZ+Number(r??0)*hZ+Number(i??0)*mZ+Number(a??0)*pZ+Number(o??0)*fZ+Number(s??0)*dZ+Number(c??0)*uZ},wZ=e=>{let t=Math.abs(e),{unit:n,length:r}=yZ.find(({length:e})=>t>=e)??yZ[yZ.length-1];return{value:Math.sign(e)*Math.round(t/r),unit:n,length:r}},TZ=(e,t)=>{let n=Math.floor(Math.abs(e)/uZ),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 bZ.slice(0,bZ.indexOf(t)+1).map(e=>({unit:e,count:c[e]}))},EZ=e=>{let{value:t,unit:n}=wZ(e);return n===`second`?`1m`:`${Math.abs(t)}${xZ[n]}`},DZ=(e,t)=>{let n=TZ(e,t).filter(({count:e})=>e>0);return n.length===0?`0${xZ[t]}`:n.map(({unit:e,count:t})=>`${t}${xZ[e]}`).join(` `)},OZ=(e,t)=>{let{value:n,unit:r}=wZ(e);return new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(n,r)},kZ=(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}},AZ=(e,t,n,r)=>new Intl.DateTimeFormat(r,kZ(e,t,n)).format(e),jZ=(e,t)=>new Intl.DateTimeFormat(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`numeric`,minute:`2-digit`,timeZoneName:`short`}).format(e),MZ=(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:DZ(u,a),updateDelay:yZ.find(({unit:e})=>e===a)?.length??uZ};let d=CZ(o)??2592e6;if(Math.abs(u)<=d&&(i===`auto`||i===`past`&&u<=0||i===`future`&&u>=0)){let{length:e}=wZ(u);return{text:r===`micro`?EZ(u):OZ(u,l),updateDelay:e}}let f=AZ(e,t,c,l),p=u-d;return{text:s?`${s} ${f}`:f,updateDelay:u<=0?null:p>0?p:u}},NZ=(e,t)=>{let n=e??(t===void 0?void 0:new Date(t));return n&&!Number.isNaN(n.getTime())?n:void 0};function PZ(t,n){let{as:r=`time`,children:i,date:a,datetime:o,format:s=`auto`,tense:c=`auto`,precision:l=`second`,threshold:u=_Z,prefix:d=`on`,noTitle:f,weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b,...x}=t,S=NZ(a,o),[C,w]=e.useState(()=>Date.now()),{text:T,updateDelay:E}=S?MZ(S,C,{format:s,tense:c,precision:l,threshold:u,prefix:d,dateOptions:{weekday:p,year:m,month:h,day:g,hour:_,minute:v,second:y,timeZoneName:b}}):{text:``,updateDelay:null};return e.useEffect(()=>{if(E===null)return;let e=window.setTimeout(()=>{w(Date.now())},E);return()=>{window.clearTimeout(e)}},[C,E]),(0,q.jsx)(r,{ref:n,dateTime:S?.toISOString(),title:f||!S?void 0:jZ(S),"data-component":`RelativeTime`,"data-format":s,"data-tense":c,...x,children:i??T})}PZ.displayName=`RelativeTime`;var FZ=K(PZ);const IZ=n({}),LZ=`RichTextEditor`,RZ=[z,ne,F,P,k,O],zZ={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`},BZ={root:`rich-text-editor`,readOnly:`rich-text-editor-read-only`},VZ=({readOnly:t})=>{let[n]=w();return e.useEffect(()=>{n.setEditable(!t)},[n,t]),null};function HZ(e,t){let{className:n,children:r,defaultValue:i,onChange:a,placeholder:o,readOnly:s,nodes:c,namespace:l=LZ,onError:u,minHeight:d,maxHeight:f,"aria-label":p,"aria-labelledby":m,"aria-describedby":h,...g}=e,_={namespace:l,theme:zZ,nodes:c?[...RZ,...c]:RZ,editable:!s,editorState:i,onError:u??(e=>{throw e})},v={readOnly:s,placeholder:o,minHeight:d,maxHeight:f,ariaLabel:p,ariaLabelledBy:m,ariaDescribedBy:h};return(0,q.jsx)(`div`,{ref:t,className:G(BZ.root,s&&BZ.readOnly,n),"data-component":`RichTextEditor`,"data-read-only":s,...g,children:(0,q.jsx)(b,{initialConfig:_,children:(0,q.jsxs)(IZ.Provider,{value:v,children:[(0,q.jsx)(B,{}),(0,q.jsx)(V,{}),(0,q.jsx)(re,{}),(0,q.jsx)(ae,{}),(0,q.jsx)(VZ,{readOnly:s}),a?(0,q.jsx)(ie,{onChange:(e,t)=>a(e,t)}):null,r]})})})}HZ.displayName=`RichTextEditor`;var UZ=K(HZ);const WZ={scroll:`rich-text-editor-scroll`,content:`rich-text-editor-content`,placeholder:`rich-text-editor-placeholder`};function GZ(t,n){let{className:r,style:i,...a}=t,{placeholder:o,minHeight:s,maxHeight:c,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d}=e.useContext(IZ),f=(0,q.jsx)(`div`,{className:WZ.scroll,style:{minHeight:s===void 0?void 0:`${s}px`,maxHeight:c===void 0?void 0:`${c}px`},"data-component":`RichTextEditor.Scroll`,children:o?(0,q.jsx)(oe,{ref:n,className:G(WZ.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,"aria-placeholder":o,placeholder:(0,q.jsx)(`div`,{className:WZ.placeholder,children:o}),"data-component":`RichTextEditor.Content`,...a}):(0,q.jsx)(oe,{ref:n,className:G(WZ.content,r),style:i,ariaLabel:l,ariaLabelledBy:u,ariaDescribedBy:d,placeholder:null,"data-component":`RichTextEditor.Content`,...a})});return(0,q.jsx)(ce,{contentEditable:f,ErrorBoundary:se})}GZ.displayName=`RichTextEditor.Content`;var KZ=K(GZ);const qZ=[`history`,`inline`,`block`,`list`,`link`],JZ={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`},YZ=[{format:`bold`,icon:kr,label:`Bold`},{format:`italic`,icon:Pr,label:`Italic`},{format:`underline`,icon:Rr,label:`Underline`},{format:`strikethrough`,icon:Lr,label:`Strikethrough`},{format:`code`,icon:tr,label:`Code`}],XZ=[{tag:`h1`,icon:jr,label:`Heading 1`},{tag:`h2`,icon:Mr,label:`Heading 2`},{tag:`h3`,icon:Nr,label:`Heading 3`}],ZZ={bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1};function QZ(t){let{className:n,children:r,controls:i=qZ,"aria-label":a=`Formatting`,...o}=t,[s]=w(),{readOnly:c}=e.useContext(IZ),l=e.useRef(null);ri({containerRef:l,direction:`horizontal`,wrap:!0});let[u,d]=e.useState(ZZ),[f,p]=e.useState(`paragraph`),[m,h]=e.useState(!1),[g,_]=e.useState(!1),[v,y]=e.useState(!1),[b,x]=e.useState(null),S=e.useCallback(()=>{let e=fe();if(!pe(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(j(n))p(n.getListType()===`number`?`number`:`bullet`);else if(R(n)){let e=n.getTag();p(e===`h1`||e===`h2`||e===`h3`?e:`paragraph`)}else te(n)?p(`quote`):p(`paragraph`);h(D(t)||D(t.getParent()))},[]);e.useEffect(()=>ue(s.registerUpdateListener(({editorState:e})=>{e.read(S)}),s.registerCommand(ye,()=>(S(),!1),ge),s.registerCommand(he,e=>(_(e),!1),ge),s.registerCommand(me,e=>(y(e),!1),ge)),[s,S]);let C=e=>{s.update(()=>{let t=fe();if(pe(t)){if(f===e){le(t,()=>de());return}le(t,()=>e===`quote`?ee():L(e))}})},T=e=>{if(f===e){s.dispatchCommand(I,void 0);return}s.dispatchCommand(e===`bullet`?N:M,void 0)},E=()=>{if(m){s.dispatchCommand(A,null);return}x(e=>e===null?``:null)},O=()=>{b&&s.dispatchCommand(A,b),x(null),s.focus()},k=(e,t,n,r,i,a)=>(0,q.jsx)(na,{icon:n,size:`small`,variant:`invisible`,"aria-label":t,"aria-pressed":r,disabled:c||a,onClick:i,"data-component":`RichTextEditor.${e}`},e),P={history:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(na,{icon:Bn,size:`small`,variant:`invisible`,"aria-label":`Undo`,disabled:c||!g,onClick:()=>s.dispatchCommand(be,void 0),"data-component":`RichTextEditor.Undo`}),(0,q.jsx)(na,{icon:Ln,size:`small`,variant:`invisible`,"aria-label":`Redo`,disabled:c||!v,onClick:()=>s.dispatchCommand(ve,void 0),"data-component":`RichTextEditor.Redo`})]}),inline:(0,q.jsx)(q.Fragment,{children:YZ.map(({format:e,icon:t,label:n})=>k(n,n,t,u[e],()=>s.dispatchCommand(_e,e)))}),block:(0,q.jsxs)(q.Fragment,{children:[XZ.map(({tag:e,icon:t,label:n})=>k(n,n,t,f===e,()=>C(e))),k(`Quote`,`Quote`,Ir,f===`quote`,()=>C(`quote`))]}),list:(0,q.jsxs)(q.Fragment,{children:[k(`Bulleted list`,`Bulleted list`,Ar,f===`bullet`,()=>T(`bullet`)),k(`Numbered list`,`Numbered list`,Fr,f===`number`,()=>T(`number`))]}),link:k(`Link`,m?`Remove link`:`Link`,hr,m||b!==null,E)};return(0,q.jsxs)(`div`,{className:G(JZ.root,n),"data-component":`RichTextEditor.Toolbar`,children:[(0,q.jsxs)(`div`,{ref:l,role:`toolbar`,"aria-label":a,"aria-orientation":`horizontal`,className:JZ.controls,...o,children:[i.map((t,n)=>(0,q.jsxs)(e.Fragment,{children:[n>0?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:JZ.divider,"data-component":`RichTextEditor.ToolbarDivider`}):null,(0,q.jsx)(`div`,{className:JZ.group,"data-control":t,children:P[t]})]},t)),r]}),b===null?null:(0,q.jsxs)(`div`,{className:JZ.linkField,"data-component":`RichTextEditor.LinkField`,children:[(0,q.jsx)(Fs,{autoFocus:!0,size:`small`,type:`url`,value:b,placeholder:`https://example.com`,"aria-label":`Link address`,className:JZ.linkInput,onChange:e=>x(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),O()),e.key===`Escape`&&(x(null),s.focus())}}),(0,q.jsx)($i,{size:`small`,onClick:O,children:`Apply`})]})]})}QZ.displayName=`RichTextEditor.Toolbar`;const $Z=Object.assign(UZ,{Toolbar:QZ,Content:KZ}),eQ=n({}),tQ={root:`tooltip`,open:`tooltip-open motion-safe:[&:popover-open]:animate-in motion-safe:[&:popover-open]:fade-in motion-safe:[&:popover-open]:duration-100`,openPolyfilled:`tooltip-open-polyfilled motion-safe:[&[class~=':popover-open']]:animate-in motion-safe:[&[class~=':popover-open']]:fade-in motion-safe:[&[class~=':popover-open']]:duration-100`,bridge:`tooltip-bridge`,bridgeVertical:`tooltip-bridge-vertical`,bridgeHorizontal:`tooltip-bridge-horizontal`},nQ={nw:{side:`outside-top`,align:`end`},n:{side:`outside-top`,align:`center`},ne:{side:`outside-top`,align:`start`},e:{side:`outside-right`,align:`center`},se:{side:`outside-bottom`,align:`start`},s:{side:`outside-bottom`,align:`center`},sw:{side:`outside-bottom`,align:`end`},w:{side:`outside-left`,align:`center`}},rQ={"outside-top-end":`nw`,"outside-top-center":`n`,"outside-top-start":`ne`,"outside-right-center":`e`,"outside-bottom-start":`se`,"outside-bottom-center":`s`,"outside-bottom-end":`sw`,"outside-left-center":`w`},iQ={short:50,medium:400,long:1200},aQ=[`a[href]`,`button:not([disabled])`,`summary`,`select`,`input:not([type=hidden])`,`textarea`],oQ=e=>aQ.some(t=>e.matches(t))||e.getAttribute(`role`)===`button`,sQ=e=>oQ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&oQ(e)||Array.from(e.childNodes).some(e=>e instanceof HTMLElement&&oQ(e)));function cQ(t,n){let{className:r,children:i,text:a,id:o,direction:s=`s`,type:c=`description`,delay:l=`short`,...u}=t,d=Y(o),f=e.Children.only(i),p=e.useRef(null),m=Be(n,p),h=e.useRef(null),g=e.useRef(null),_=e.useRef(null),[v,y]=e.useState(!1),[b,x]=e.useState(s),S=()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.clearTimeout(_.current),_.current=null)};e.useEffect(()=>S,[]);let C=()=>{let e=h.current,t=p.current;if(!e||!t)return;try{e.showPopover()}catch{return}y(!0);let{side:n,align:r}=nQ[s],{top:i,left:a,anchorSide:o,anchorAlign:c}=Ka(e,t,{side:n,align:r});x(rQ[`${o}-${c}`]??s),e.style.top=`${i}px`,e.style.left=`${a}px`},w=()=>{S(),y(!1);try{h.current?.hidePopover()}catch{}};e.useEffect(()=>{let e=h.current,t=p.current;if(!(!e||!t)){if(!sQ(t))throw Error("The `Tooltip` component expects a single React element that contains interactive content. Consider using a `<button>` or an equivalent element instead.");typeof window<`u`&&!Se()&&xe(),e.setAttribute(`popover`,`manual`)}},[]),ka(e=>{v&&(e.preventDefault(),w())});let T=e.useMemo(()=>({tooltipId:d}),[d]);if(!e.isValidElement(f))return null;let E=f.props,D=e.cloneElement(f,{ref:m,"aria-describedby":c===`description`?[E[`aria-describedby`],d].filter(Boolean).join(` `):E[`aria-describedby`],"aria-labelledby":c===`label`?d:E[`aria-labelledby`],onFocus:e=>{try{if(!e.target.matches(`:focus-visible`))return}catch{}C(),E.onFocus?.(e)},onBlur:e=>{w(),E.onBlur?.(e)},onMouseOverCapture:e=>{g.current=window.setTimeout(()=>{g.current!==null&&(C(),E.onMouseEnter?.(e))},iQ[l])},onMouseLeave:e=>{w(),E.onMouseLeave?.(e)},onTouchEnd:e=>{E.onTouchEnd?.(e),_.current=window.setTimeout(w,10)}});return(0,q.jsxs)(eQ.Provider,{value:T,children:[D,(0,q.jsx)(`span`,{ref:h,id:d,role:c===`description`?`tooltip`:void 0,"aria-hidden":`true`,className:G(tQ.root,tQ.open,tQ.openPolyfilled,tQ.bridge,tQ.bridgeVertical,tQ.bridgeHorizontal,r),onMouseEnter:C,onMouseLeave:w,"data-component":`Tooltip`,"data-direction":b,...u,children:a})]})}cQ.displayName=`Tooltip`;var lQ=K(cQ);const uQ={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`},dQ=t=>{let n=t;return e.isValidElement(t)?t:(0,q.jsx)(n,{})};function fQ(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(uQ.button,i&&uQ.buttonSelected,d&&!i&&uQ.buttonDisabled,n),...u,children:(0,q.jsx)(`span`,{className:G(uQ.content,i&&uQ.contentSelected,!i&&!d&&uQ.contentInteractive),children:r})});return(0,q.jsx)(`li`,{className:G(uQ.item,uQ.separator,uQ.separatorHidden),"data-component":t,"data-selected":i?``:void 0,children:o?(0,q.jsx)(lQ,{text:o,type:s,direction:c,children:f}):f})}fQ.displayName=`SegmentedControlSegment`;const pQ={visual:`segmented-control-visual`,visualDisabled:`segmented-control-visual-disabled`,text:`segmented-control-text`,textHidden:`segmented-control-text-hidden`,counter:`segmented-control-counter`};function mQ(e){let{children:t,className:n,count:r,leadingVisual:i,selected:a,disabled:o,defaultSelected:s,...c}=e;return(0,q.jsxs)(fQ,{component:`SegmentedControl.Button`,className:n,selected:a,disabled:o,...c,children:[i?(0,q.jsx)(`span`,{className:G(pQ.visual,o&&pQ.visualDisabled),"data-component":`SegmentedControl.LeadingVisual`,children:dQ(i)}):null,(0,q.jsx)(`span`,{className:G(pQ.text,pQ.textHidden),"data-component":`SegmentedControl.Text`,"data-text":t,children:t}),r===void 0?null:(0,q.jsx)(`span`,{className:pQ.counter,children:(0,q.jsx)(qi,{children:r})})]})}mQ.displayName=`SegmentedControl.Button`;const hQ={button:`segmented-control-icon-button`,visual:`segmented-control-icon-visual`,visualDisabled:`segmented-control-visual-disabled`};function gQ(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)(fQ,{component:`SegmentedControl.IconButton`,className:G(hQ.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(hQ.visual,o&&hQ.visualDisabled),"data-component":`SegmentedControl.Icon`,children:dQ(i)})})}gQ.displayName=`SegmentedControl.IconButton`;const _Q={dropdown:`segmented-control-dropdown`},vQ=W(`segmented-control`,{variants:{size:{small:`segmented-control-small`,medium:``}}}),yQ=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),bQ=e=>e.type===mQ,xQ=e=>e.type===gQ,SQ=e=>{if(e!==void 0)return bQ(e)?e.props.children:xQ(e)?e.props[`aria-label`]:void 0},CQ=e=>e===void 0?null:bQ(e)?e.props.leadingVisual??null:xQ(e)?e.props.icon:null,wQ=e=>{let t=e.props[`aria-disabled`];return e.props.disabled===!0||t===!0||t===`true`};function TQ(t){let{"aria-label":n,"aria-labelledby":r,className:i,children:a,fullWidth:o,onChange:s,size:c=`medium`,variant:l=`default`,...u}=t,d=yQ(a),f=s===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]=e.useState(m),_=f?h:m,v=d[_],y=(e,t,n)=>{wQ(t)||(f&&g(e),s?.(e),t.props.onClick?.(n))},b=(0,q.jsx)(`ul`,{"aria-label":n,"aria-labelledby":r,className:G(vQ({size:c}),i),"data-component":`SegmentedControl`,"data-size":c,...Aa(`full-width`,o),...Aa(`variant`,l),...u,children:d.map((t,n)=>e.cloneElement(t,{selected:n===_,onClick:e=>y(n,t,e)}))});return Zs(l)&&Object.values(l).includes(`dropdown`)?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:_Q.dropdown,"data-component":`SegmentedControl.Dropdown`,...Aa(`variant`,l),children:(0,q.jsxs)(to,{children:[(0,q.jsx)(to.Button,{"aria-label":n&&`${SQ(v)}, ${n}`,leadingVisual:CQ(v),children:SQ(v)}),(0,q.jsx)(to.Overlay,{"aria-labelledby":r,children:(0,q.jsx)(_a,{selectionVariant:`single`,children:d.map((e,t)=>{let n=CQ(e);return(0,q.jsxs)(_a.Item,{selected:t===_,disabled:wQ(e),onSelect:n=>y(t,e,n),children:[n?(0,q.jsx)(_a.LeadingVisual,{children:dQ(n)}):null,SQ(e)]},t)})})})]})}),b]}):b}TQ.displayName=`SegmentedControl`;const EQ=Object.assign(TQ,{Button:mQ,IconButton:gQ}),DQ=Object.assign(VS,{Option:kS,OptGroup:TS});function OQ(t,n){let{className:r,children:i,...a}=t,{required:o,...s}=kp(a),{labelId:c}=e.useContext(Op),l=Y();return(0,q.jsx)($i,{ref:n,type:`button`,"aria-labelledby":c?`${l} ${c}`:void 0,className:G(r),"data-component":`SelectPanel.Button`,...s,children:c?(0,q.jsx)(`span`,{id:l,children:i}):i})}OQ.displayName=`SelectPanel.Button`;var kQ=K(OQ);const AQ=n({}),jQ={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 MQ(t,n){let{className:r,children:i,...a}=t,{selectionVariant:o,onCancel:s}=e.useContext(AQ),c=o!==`instant`;return!c&&!i?null:(0,q.jsxs)(`div`,{ref:n,className:G(jQ.root,!c&&jQ.rootWithoutActions,r),"data-component":`SelectPanel.Footer`,"data-has-actions":c?``:void 0,...a,children:[(0,q.jsx)(`div`,{className:G(jQ.content,!c&&jQ.contentWithoutActions),children:i}),c?(0,q.jsxs)(`div`,{className:jQ.actions,children:[(0,q.jsx)($i,{type:`button`,size:`small`,onClick:s,children:`Cancel`}),(0,q.jsx)($i,{type:`submit`,size:`small`,variant:`primary`,children:`Save`})]}):null]})}MQ.displayName=`SelectPanel.Footer`;var NQ=K(MQ);const PQ={root:`select-panel-search-input`};function FQ(t,n){let{className:r,value:i,onChange:a,onKeyDown:o,...s}=t,{searchQuery:c,setSearchQuery:l,searchInputRef:u,moveFocusToList:d}=e.useContext(AQ),f=e.useRef(null),p=Be(u,f),m=Be(n,p),h=i??c??``;return(0,q.jsx)(Fs,{ref:m,block:!0,leadingVisual:Sr,placeholder:`Search`,value:h,onChange:e=>{l?.(e.currentTarget.value),a?.(e.currentTarget.value,e)},onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d?.()),o?.(e)},trailingAction:h?(0,q.jsx)(Fs.Action,{icon:rr,"aria-label":`Clear`,onClick:()=>{l?.(``),a?.(``,null),f.current?.focus()}}):void 0,className:G(PQ.root,r),"data-component":`SelectPanel.SearchInput`,...s})}FQ.displayName=`SelectPanel.SearchInput`;var IQ=K(FQ);const LQ={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`},RQ={searchInput:IQ};function zQ(t,n){let{className:r,children:i,onBack:a,...o}=t,[s,c]=si(i,RQ),{panelId:l,title:u,description:d,onCancel:f,onClearSelection:p}=e.useContext(AQ);return(0,q.jsxs)(`div`,{ref:n,className:G(LQ.root,r),"data-component":`SelectPanel.Header`,...o,children:[(0,q.jsxs)(`div`,{className:G(LQ.content,s.searchInput&&LQ.contentWithSearchInput),"data-has-description":d?``:void 0,"data-has-search-input":s.searchInput?``:void 0,children:[(0,q.jsxs)(`div`,{className:LQ.titleRow,children:[a?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:Nn,"aria-label":`Back`,onClick:a,"data-component":`SelectPanel.BackButton`}):null,(0,q.jsxs)(`div`,{className:LQ.title,"data-has-description":d?``:void 0,"data-has-back":a?``:void 0,children:[(0,q.jsx)(di,{as:`h1`,id:l?`${l}-title`:void 0,className:LQ.heading,children:u}),d?(0,q.jsx)(`span`,{id:l?`${l}-description`:void 0,className:LQ.description,children:d}):null]})]}),(0,q.jsxs)(`div`,{className:LQ.actions,children:[p?(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:lr,"aria-label":`Clear selection`,onClick:p,"data-component":`SelectPanel.ClearSelectionButton`}):null,(0,q.jsx)(na,{type:`button`,variant:`invisible`,icon:ir,"aria-label":`Close`,onClick:f,"data-component":`SelectPanel.CloseButton`})]})]}),s.searchInput,c]})}zQ.displayName=`SelectPanel.Header`;var BQ=K(zQ);const VQ={form:`select-panel-form`,container:`select-panel-container`},HQ=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`}}}),UQ=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:``}}}),WQ={regular:`anchored`,narrow:`full-screen`},GQ=t=>e.isValidElement(t)&&t.type===kQ,KQ=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function qQ(t,n){let{className:r,children:i,title:a,description:o,variant:s=WQ,selectionVariant:c=`multiple`,id:l,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}=t,x=Y(l),S=e.useRef(null),C=f??S,w=e.useRef(null),T=Be(n,w),E=e.useRef(null),D=d!==void 0,[O,k]=e.useState(u),A=D?d:O,j=e.useCallback(()=>{D||k(!1)},[D]),M=e.useCallback(()=>{j(),h?.()},[j,h]),N=e.useCallback(()=>g?.(),[g]),P=e.useCallback(e=>{e?.preventDefault(),j(),_?.(e)},[j,_]),F=e.useCallback(()=>{w.current?.querySelector(`[role="option"]`)?.focus()},[]),I=e.useCallback(()=>{c===`instant`&&P()},[c,P]),[L,ee]=e.useState(``),R=e.Children.toArray(i),te=R.find(GQ),[z,ne]=si(R.filter(e=>e!==te),{header:BQ,footer:NQ}),B=te?.props.onClick,re=te?e.cloneElement(te,{ref:C,onClick:e=>{B?.(e),!e.defaultPrevented&&(A?M():D||k(!0))},"aria-haspopup":!0,"aria-expanded":A}):null,V={...WQ,...typeof s==`string`?{regular:s}:s},ie=V.regular??`anchored`,ae=V.narrow,oe=ie===`anchored`||ae===`anchored`,se=e.useRef(null),[ce,le]=e.useState(null),ue=e.useCallback(()=>{let e=C.current,t=w.current;if(!e||!t)return;let n=Ka(t,e,{side:p,align:m});se.current&&KQ(se.current,n)||(se.current=n,le(n))},[C,p,m]);Ea(()=>{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]),Ta({containerRef:w,initialFocusRef:E,returnFocusRef:C,disabled:!A}),e.useEffect(()=>{A&&!E.current&&F()},[A,F]),ka(e=>{A&&(e.preventDefault(),M())});let de=e.useMemo(()=>({panelId:x,title:a,description:o,selectionVariant:c,searchQuery:L,setSearchQuery:ee,searchInputRef:E,onCancel:M,onClearSelection:g?N:void 0,moveFocusToList:F}),[x,a,o,c,L,M,g,N,F]),fe=e.useMemo(()=>({container:`SelectPanel`,listRole:`listbox`,listLabelledBy:`${x}-title`,selectionAttribute:`aria-selected`,selectionVariant:c===`instant`?`single`:c,afterSelect:I,enableFocusZone:!0}),[x,c,I]);return(0,q.jsxs)(q.Fragment,{children:[re,A?(0,q.jsx)(Va,{children:(0,q.jsx)(`div`,{className:G(HQ({variant:ie,narrowVariant:ae})),onClick:e=>{e.target===e.currentTarget&&M()},"data-component":`SelectPanel.Backdrop`,...Aa(`variant`,V),children:(0,q.jsx)(`div`,{ref:T,role:`dialog`,"aria-modal":!0,"aria-labelledby":`${x}-title`,"aria-describedby":o?`${x}-description`:void 0,className:G(UQ({width:v,maxHeight:y,variant:ie,narrowVariant:ae,unplaced:oe&&!ce}),r),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,...Aa(`variant`,V),...b,children:(0,q.jsx)(`form`,{className:VQ.form,onSubmit:P,children:(0,q.jsxs)(AQ.Provider,{value:de,children:[z.header??(0,q.jsx)(BQ,{}),(0,q.jsx)(`div`,{className:VQ.container,children:(0,q.jsx)(gi.Provider,{value:fe,children:ne})}),z.footer]})})})})}):null]})}qQ.displayName=`SelectPanel`;var JQ=K(qQ);const YQ={root:`select-panel-loading`,text:`select-panel-loading-text`};function XQ(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(YQ.root,n),"data-component":`SelectPanel.Loading`,...i,children:[(0,q.jsx)(zi,{size:`medium`,srText:null,role:`presentation`}),(0,q.jsx)(`span`,{className:YQ.text,children:r})]})}XQ.displayName=`SelectPanel.Loading`;var ZQ=K(XQ);const QQ={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 $Q(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(QQ.full,n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`full`,...l,...s,children:[i===`empty`?null:(0,q.jsx)(zr,{className:G(QQ.fullIcon,QQ.variant[i]),"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:QQ.fullTitle,children:o}),(0,q.jsx)(`span`,{className:QQ.fullContent,children:r})]}):(0,q.jsxs)(`div`,{ref:t,className:G(QQ.inline,QQ.variant[i],QQ.inlineVariant[i],n),"data-component":`SelectPanel.Message`,"data-variant":i,"data-size":`inline`,...l,...s,children:[(0,q.jsx)(zr,{className:QQ.inlineIcon,"aria-hidden":`true`}),(0,q.jsx)(`div`,{children:r})]})}$Q.displayName=`SelectPanel.Message`;var e$=K($Q);const t$={small:`select-panel-secondary-action-small`,checkbox:`select-panel-secondary-action-checkbox`,box:`select-panel-secondary-action-box`},n$=e=>{let{id:t,children:n,className:r,...i}=e,a=Y(t);return(0,q.jsxs)(`span`,{className:t$.checkbox,"data-component":`SelectPanel.SecondaryAction`,children:[(0,q.jsx)(Vf,{id:a,className:G(t$.box,r),...i}),(0,q.jsx)(`label`,{htmlFor:a,className:t$.small,children:n})]})};function r$(e){if(e.variant===`checkbox`){let{variant:t,...n}=e;return(0,q.jsx)(n$,{...n})}if(e.variant===`link`){let{variant:t,className:n,...r}=e;return(0,q.jsx)(zl,{className:G(t$.small,n),"data-component":`SelectPanel.SecondaryAction`,...r})}let{variant:t,...n}=e;return(0,q.jsx)($i,{type:`button`,size:`small`,block:!0,"data-component":`SelectPanel.SecondaryAction`,...n})}r$.displayName=`SelectPanel.SecondaryAction`;const i$=Object.assign(JQ,{Button:kQ,Header:BQ,SearchInput:IQ,Footer:NQ,SecondaryAction:r$,Loading:ZQ,Message:e$}),a$=W(`separator`,{variants:{orientation:{horizontal:`separator-horizontal`,vertical:`separator-vertical`},variant:{subtle:`separator-subtle`,default:`separator-default`,emphasis:`separator-emphasis`}}});function o$(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(a$({orientation:i,variant:a}),r),"data-component":`Separator`,"data-orientation":i,"data-variant":a,...o})}o$.displayName=`Separator`;var s$=K(o$);const c$=W(`skeleton-avatar`,{variants:{shape:{circle:`skeleton-avatar-circle`,square:`skeleton-avatar-square`},responsive:{true:`skeleton-avatar-responsive`,false:``}}});function l$({size:e=20,shape:t=`circle`,className:n,style:r,...i}){let a=Zs(e),o={"--avatar-size-regular":`20px`};if(a)for(let[t,n]of Object.entries(e))n!==void 0&&(o[`--avatar-size-${t}`]=`${n}px`);else o[`--avatar-size-regular`]=`${e}px`;return(0,q.jsx)(W_,{width:`var(--avatar-size-regular)`,height:`var(--avatar-size-regular)`,className:G(c$({shape:t,responsive:a}),n),style:{...r,...o},...i,"data-component":`SkeletonAvatar`,"data-responsive":a||void 0,"data-shape":t})}l$.displayName=`SkeletonAvatar`;const u$=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`}]}),d$=(e,t,n)=>{if(n<=t)return 0;let r=(e-t)/(n-t)*100;return Math.min(Math.max(r,0),100)};function f$(t,n){let{className:r,style:i,size:a=`medium`,orientation:o=`horizontal`,block:s,min:c=0,max:l=100,step:u=1,value:d,defaultValue:f,disabled:p,onChange:m,...h}=t,g=d!==void 0,[_,v]=e.useState(()=>f??c),y=g?d:_;return(0,q.jsx)(`input`,{ref:n,type:`range`,min:c,max:l,step:u,value:y,disabled:p,onChange:e=>{let t=Number(e.currentTarget.value);g||v(t),m?.(t,e)},className:G(u$({size:a,orientation:o,block:s}),r),style:{...i,"--slider-fill":`${d$(y,c,l)}%`},"aria-orientation":o===`vertical`?`vertical`:void 0,"data-component":`Slider`,"data-size":a,"data-orientation":o,"data-block":s,"data-disabled":p,...h})}f$.displayName=`Slider`;var p$=K(f$);const m$={root:`splitter`};function h$(e,t){let{className:n,orientation:r=`horizontal`,splitterRef:i,...a}=e;return(0,q.jsx)(Ce,{elementRef:t,groupRef:i,orientation:r,className:G(m$.root,n),"data-component":`Splitter`,"data-orientation":r,...a})}h$.displayName=`Splitter`;var g$=K(h$);const _$={root:`splitter-panel`};function v$(e,t){let{className:n,...r}=e;return(0,q.jsx)(we,{elementRef:t,className:G(_$.root,n),"data-component":`Splitter.Panel`,...r})}v$.displayName=`Splitter.Panel`;var y$=K(v$);const b$={root:`splitter-resize-trigger`};function x$(e,t){let{className:n,...r}=e;return(0,q.jsx)(Te,{elementRef:t,className:G(b$.root,n),"data-component":`Splitter.ResizeTrigger`,...r})}x$.displayName=`Splitter.ResizeTrigger`;var S$=K(x$);const C$={root:`splitter-resize-trigger-indicator`};function w$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(C$.root,n),"data-component":`Splitter.ResizeTriggerIndicator`,"aria-hidden":`true`,...r})}w$.displayName=`Splitter.ResizeTriggerIndicator`;var T$=K(w$);const E$={root:`splitter-resize-trigger-separator`};function D$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(E$.root,n),"data-component":`Splitter.ResizeTriggerSeparator`,"aria-hidden":`true`,...r})}D$.displayName=`Splitter.ResizeTriggerSeparator`;var O$=K(D$);const k$=Object.assign(g$,{Panel:y$,ResizeTrigger:S$,ResizeTriggerSeparator:O$,ResizeTriggerIndicator:T$}),A$={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`},j$={open:null,closed:null,draft:Zn,archived:An,unavailable:zr,issueOpened:xr,issueClosed:Gn,issueClosedNotPlanned:br,issueDraft:Zn,pullOpened:Un,pullClosed:rr,pullMerged:gr,pullQueued:er,alertOpened:Dr,alertClosed:Er,alertFixed:wr,alertDismissed:Tr},M$={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`},N$=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`}}}),P$=W(`state-label-visual`,{variants:{size:{small:`state-label-visual-small`,medium:`state-label-visual-medium`}}});function F$(e,t){let{as:n=`span`,className:r,status:i,size:a=`medium`,children:o,...s}=e,c=j$[i],l=M$[i];return(0,q.jsxs)(n,{ref:t,className:G(N$({size:a,tone:A$[i]}),r),"data-component":`StateLabel`,"data-status":i,"data-size":a,...s,children:[c?(0,q.jsx)(c,{className:G(P$({size:a})),role:l?`img`:void 0,"aria-label":l||void 0,"aria-hidden":!l||void 0}):null,o]})}F$.displayName=`StateLabel`;var I$=K(F$);const L$=n({}),R$={root:`statistic-card-description`};function z$(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(R$.root,n),"data-component":`StatisticCard.Description`,...r})}z$.displayName=`StatisticCard.Description`;var B$=K(z$);const V$={root:`statistic-card-label`};function H$(t,n){let{className:r,id:i,...a}=t,{labelId:o}=e.useContext(L$);return(0,q.jsx)(`span`,{ref:n,id:i??o,className:G(V$.root,r),"data-component":`StatisticCard.Label`,...a})}H$.displayName=`StatisticCard.Label`;var U$=K(H$);const W$={root:`statistic-card-trailing-visual`};function G$(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(W$.root,n),"data-component":`StatisticCard.TrailingVisual`,...i})}G$.displayName=`StatisticCard.TrailingVisual`;var K$=K(G$);const q$={hidden:`sr-only`},J$={increase:Vn,decrease:Mn,neutral:Or},Y$={increase:`Up`,decrease:`Down`,neutral:`No change`},X$={increase:`positive`,decrease:`negative`,neutral:`neutral`},Z$=W(`statistic-card-trend`,{variants:{sentiment:{positive:`statistic-card-trend-positive`,negative:`statistic-card-trend-negative`,neutral:`statistic-card-trend-neutral`}}});function Q$(e,t){let{className:n,children:r,direction:i,sentiment:a,...o}=e,s=J$[i],c=a??X$[i];return(0,q.jsxs)(`span`,{ref:t,className:G(Z$({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:q$.hidden,children:Y$[i]}),r]})}Q$.displayName=`StatisticCard.Trend`;var $$=K(Q$);const e1={root:`statistic-card-value`};function t1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(e1.root,n),"data-component":`StatisticCard.Value`,...r})}t1.displayName=`StatisticCard.Value`;var n1=K(t1);const r1={root:`statistic-card`,body:`statistic-card-body`,figure:`statistic-card-figure`};function i1(e,t){let{className:n,children:r,id:i,"aria-label":a,"aria-labelledby":o,...s}=e,c=`${Y(i)}-label`,[l,u]=si(r,{trailingVisual:K$,label:U$,value:n1,trend:$$,description:B$}),d=o??(l.label&&!a?c:void 0);return(0,q.jsx)(L$.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(r1.root,n),"data-component":`StatisticCard`,...s,children:[(0,q.jsxs)(`div`,{className:r1.body,children:[l.label,l.value||l.trend?(0,q.jsxs)(`div`,{className:r1.figure,children:[l.value,l.trend]}):null,l.description,u]}),l.trailingVisual]})})}i1.displayName=`StatisticCard`;var a1=K(i1);const o1=Object.assign(a1,{Label:U$,Value:n1,Trend:$$,Description:B$,TrailingVisual:K$}),s1=n({}),c1={srOnly:`sr-only`},l1=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 u1(e,t){let{as:n=`span`,className:r,variant:i=`neutral`,size:a=`medium`,srText:o,children:s,...c}=e;return(0,q.jsx)(s1.Provider,{value:{variant:i,size:a},children:(0,q.jsxs)(n,{ref:t,className:G(l1({variant:i,size:a}),r),"data-component":`Status`,"data-variant":i,"data-size":a,...c,children:[o?(0,q.jsx)(`span`,{className:c1.srOnly,children:o}):null,s]})})}u1.displayName=`Status`;var d1=K(u1);const f1=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 p1(t,n){let{className:r,variant:i,size:a,...o}=t,s=e.useContext(s1),c=i??s.variant??`neutral`,l=a??s.size??`medium`;return(0,q.jsx)(`span`,{ref:n,"aria-hidden":`true`,className:G(f1({variant:c,size:l}),r),"data-component":`Status.Indicator`,"data-variant":c,"data-size":l,...o})}p1.displayName=`Status.Indicator`;var m1=K(p1);const h1=Object.assign(d1,{Indicator:m1}),g1=n(null),_1=1,v1=W(`steps`,{variants:{orientation:{horizontal:`steps-horizontal`,vertical:`steps-vertical`},size:{small:`steps-small`,medium:``}}}),y1=t=>e.Children.toArray(t).filter(t=>e.isValidElement(t)),b1=(e,t)=>{let n=e+1;return n<t?`complete`:n===t?`current`:`incomplete`};function x1(e,t){let{className:n,children:r,currentStep:i=1,orientation:a=`horizontal`,size:o=`medium`,...s}=e,c=y1(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(v1({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)(g1.Provider,{value:{index:t,status:b1(t,i)},children:e},e.key))})}x1.displayName=`Steps`;var S1=K(x1);const C1={root:`steps-body`};function w1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(C1.root,n),"data-component":`Steps.Body`,...r})}w1.displayName=`Steps.Body`;var T1=K(w1);const E1={root:`steps-description`};function D1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(E1.root,n),"data-component":`Steps.Description`,...r})}D1.displayName=`Steps.Description`;var O1=K(D1);const k1=()=>{let e=o(g1);if(!e)throw Error("A step and its parts all have to stand within a `Steps` component.");return e},A1={root:`steps-indicator`,icon:`steps-indicator-icon`};function j1(e,t){let{className:n,children:r,...i}=e,{index:a,status:o}=k1();return(0,q.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:G(A1.root,n),"data-component":`Steps.Indicator`,"data-status":o,...i,children:r??(o===`complete`?(0,q.jsx)(Kn,{className:A1.icon}):a+1)})}j1.displayName=`Steps.Indicator`;var M1=K(j1);const N1={root:`steps-item`,status:`sr-only`},P1={complete:`Completed`,current:``,incomplete:`Not completed`};function F1(t,n){let{className:r,children:i,status:a,statusLabel:o,...s}=t,{index:c,status:l}=k1(),u=a??l,d=o??P1[u],f=e.useMemo(()=>({index:c,status:u}),[c,u]);return(0,q.jsx)(g1.Provider,{value:f,children:(0,q.jsxs)(`li`,{ref:n,"aria-current":u===`current`?`step`:void 0,className:G(N1.root,r),"data-component":`Steps.Item`,"data-status":u,"data-index":c,...s,children:[i,d?(0,q.jsx)(`span`,{className:N1.status,children:d}):null]})})}F1.displayName=`Steps.Item`;var I1=K(F1);const L1={root:`steps-title`};function R1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`span`,{ref:t,className:G(L1.root,n),"data-component":`Steps.Title`,...r})}R1.displayName=`Steps.Title`;var z1=K(R1);const B1=Object.assign(S1,{Item:I1,Indicator:M1,Body:T1,Title:z1,Description:O1}),V1=n({}),H1=W(`swap`,{variants:{transition:{fade:`swap-fade`,flip:`swap-flip`,rotate:`swap-rotate`,scale:`swap-scale`,none:`swap-none`}}});function U1(t,n){let{as:r=`span`,className:i,swap:a=!1,transition:o=`fade`,children:s,...c}=t,l=e.useMemo(()=>({swap:a}),[a]);return(0,q.jsx)(V1.Provider,{value:l,children:(0,q.jsx)(r,{ref:n,className:G(H1({transition:o}),i),"data-component":`Swap`,"data-swap":a?`on`:`off`,"data-transition":o,...c,children:s})})}U1.displayName=`Swap`;var W1=K(U1);const G1={root:`swap-indicator`,active:`swap-indicator-active`};function K1(t,n){let{as:r=`span`,className:i,type:a,...o}=t,{swap:s}=e.useContext(V1),c=a===(s?`on`:`off`);return(0,q.jsx)(r,{ref:n,"aria-hidden":c?void 0:`true`,className:G(G1.root,c&&G1.active,i),"data-component":`Swap.Indicator`,"data-type":a,"data-active":c,...o})}K1.displayName=`Swap.Indicator`;var q1=K(K1);const J1=Object.assign(W1,{Indicator:q1}),Y1={root:`table-of-contents`};function X1(e,t){let{className:n,"aria-label":r,"aria-labelledby":i,...a}=e;return(0,q.jsx)(`nav`,{ref:t,"aria-label":r||i?r:`Table of contents`,"aria-labelledby":i,className:G(Y1.root,n),"data-component":`TableOfContents`,...a})}X1.displayName=`TableOfContents`;var Z1=K(X1);const Q1={root:`table-of-contents-list`};function $1(e,t){let{className:n,...r}=e;return(0,q.jsx)(`ul`,{ref:t,role:`list`,className:G(Q1.root,n),"data-component":`TableOfContents.List`,...r})}$1.displayName=`TableOfContents.List`;var e0=K($1);const t0={root:`table-of-contents-group`,label:`table-of-contents-group-label`,link:`table-of-contents-link`,active:`table-of-contents-link-active`,list:`table-of-contents-group-list`};function n0(e,t){let{label:n,href:r,active:i=!1,className:a,children:o,onClick:s,...c}=e;return(0,q.jsxs)(`li`,{ref:t,className:G(t0.root,a),"data-component":`TableOfContents.Group`,...c,children:[r?(0,q.jsx)(`a`,{href:r,onClick:s,"aria-current":i?`true`:void 0,className:G(t0.link,i&&t0.active),"data-component":`TableOfContents.Group.Label`,children:n}):(0,q.jsx)(`p`,{className:t0.label,"data-component":`TableOfContents.Group.Label`,children:n}),(0,q.jsx)(e0,{className:t0.list,children:o})]})}n0.displayName=`TableOfContents.Group`;var r0=K(n0);const i0={item:`table-of-contents-item`,link:`table-of-contents-link`,active:`table-of-contents-link-active`};function a0(e,t){let{as:n=`a`,active:r=!1,className:i,...a}=e;return(0,q.jsx)(`li`,{className:i0.item,children:(0,q.jsx)(n,{ref:t,"aria-current":r?`true`:void 0,className:G(i0.link,r&&i0.active,i),"data-component":`TableOfContents.Item`,...a})})}a0.displayName=`TableOfContents.Item`;var o0=K(a0);const s0={root:`table-of-contents-title`};function c0(e,t){let{as:n=`p`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(s0.root,r),"data-component":`TableOfContents.Title`,...i})}c0.displayName=`TableOfContents.Title`;var l0=K(c0);const u0=({ids:t,offset:n=0,root:r=null,trackHash:i=!0})=>{let[a,o]=e.useState(null),s=e.useRef(!1),c=t.join(`\0`);e.useEffect(()=>{if(typeof IntersectionObserver>`u`)return;let e=c.split(`\0`).map(e=>document.getElementById(e)).filter(e=>e!==null);if(e.length===0)return;let t=new Set,i=new IntersectionObserver(n=>{for(let e of n)e.isIntersecting?t.add(e.target):t.delete(e.target);let r=e.find(e=>t.has(e));r&&!s.current&&o(r.id)},{root:r,rootMargin:`-${n}px 0px 0px 0px`});for(let t of e)i.observe(t);return()=>{i.disconnect()}},[c,n,r]);let l=e.useRef(void 0),u=e.useRef(null),d=e.useCallback(e=>{u.current?.(),s.current=!0,o(e);let t=r??window,n=()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>{u.current?.(),s.current=!1},150)};t.addEventListener(`scroll`,n,{passive:!0}),u.current=()=>{window.clearTimeout(l.current),t.removeEventListener(`scroll`,n),u.current=null},n()},[r]);return e.useEffect(()=>()=>u.current?.(),[]),e.useEffect(()=>{if(!i)return;let e=new Set(c.split(`\0`)),t=()=>{let t=decodeURIComponent(window.location.hash.slice(1));t&&e.has(t)&&d(t)};return t(),window.addEventListener(`hashchange`,t),()=>{window.removeEventListener(`hashchange`,t)}},[i,c,d]),{activeId:a,selectSection:d}},d0=Object.assign(Z1,{Title:l0,List:e0,Item:o0,Group:r0}),f0=n(null);function p0(t){let{children:n,id:r,value:i,defaultValue:a,onChange:o}=t,s=Y(r),c=i!==void 0,[l,u]=e.useState(a),d=c?i:l,f=e.useRef(o);Ea(()=>{f.current=o},[o]);let p=e.useMemo(()=>({groupId:s,selectedValue:d,selectTab:e=>{c||u(e),f.current?.(e)}}),[s,d,c]);return(0,q.jsx)(f0.Provider,{value:p,children:n})}p0.displayName=`Tabs`;const m0=(...e)=>t=>{for(let n of e)if(n?.(t),t.defaultPrevented)break},h0=()=>{let e=o(f0);if(!e)throw Error("A tablist, a tab and a panel all have to stand within a `Tabs` component.");return e},g0=e=>{let{value:t,disabled:n}=e,r=h0(),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)}}}},_0={root:`tab`,vertical:`tab-vertical`,hover:`tab-hover`,selected:`tab-selected`,disabled:`tab-disabled`};function v0(e,t){let{className:n,value:r,disabled:i,onKeyDown:a,onMouseDown:o,onFocus:s,...c}=e,{selected:l,tabProps:u}=g0({value:r,disabled:i});return(0,q.jsx)(`button`,{...c,...u,ref:t,type:`button`,onKeyDown:m0(a,u.onKeyDown),onMouseDown:m0(o,u.onMouseDown),onFocus:m0(s,u.onFocus),className:G(_0.root,_0.vertical,_0.hover,l&&_0.selected,i&&_0.disabled,n),"data-component":`Tabs.Tab`,"data-value":r,"data-selected":l?``:void 0})}v0.displayName=`Tabs.Tab`;var y0=K(v0);const b0=e=>Array.from(e.querySelectorAll(`[role='tab']:not([aria-disabled])`)),x0=t=>{let{"aria-label":n,"aria-labelledby":r,"aria-orientation":i,ref:a}=t,o=e.useRef(null),s=Be(a,o),c=i??`horizontal`;return{tabListProps:{ref:s,role:`tablist`,"aria-label":n,"aria-labelledby":r,"aria-orientation":c,onKeyDown:e=>{let t=o.current;if(!t)return;let n=c===`vertical`,r=n?`ArrowDown`:`ArrowRight`,i=n?`ArrowUp`:`ArrowLeft`,a=e.key===`Home`||e.key===`End`,s=e.key===r?1:e.key===i?-1:0;if(s===0&&!a)return;e.preventDefault(),e.stopPropagation();let l=b0(t);if(l.length===0)return;if(a){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+s+l.length)%l.length].focus()}}}},S0={root:`tab-list`,vertical:`tab-list-vertical`};function C0(e,t){let{className:n,onKeyDown:r,"aria-label":i,"aria-labelledby":a,"aria-orientation":o,...s}=e,{tabListProps:c}=x0({"aria-label":i,"aria-labelledby":a,"aria-orientation":o,ref:t}),l=c[`aria-orientation`]===`vertical`;return(0,q.jsx)(`div`,{...s,...c,onKeyDown:m0(r,c.onKeyDown),className:G(S0.root,l&&S0.vertical,n),"data-component":`Tabs.List`,"data-orientation":c[`aria-orientation`]})}C0.displayName=`Tabs.List`;var w0=K(C0);const T0=e=>{let{value:t}=e,n=h0(),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 E0(e,t){let{className:n,value:r,...i}=e,{tabPanelProps:a}=T0({value:r});return(0,q.jsx)(`div`,{...i,...a,ref:t,className:n,"data-component":`Tabs.Panel`,"data-value":r})}E0.displayName=`Tabs.Panel`;var D0=K(E0);const O0=Object.assign(p0,{List:w0,Tab:y0,Panel:D0}),k0={root:`timeline`,clipStart:`timeline-clip-start`,clipEnd:`timeline-clip-end`},A0=e=>{if(e===!0||e===`both`)return`both`;if(e===`start`||e===`end`)return e};function j0(e,t){let{className:n,clipSidebar:r,...i}=e,a=A0(r);return(0,q.jsx)(`ol`,{ref:t,role:`list`,className:G(k0.root,(a===`start`||a===`both`)&&k0.clipStart,(a===`end`||a===`both`)&&k0.clipEnd,n),"data-component":`Timeline`,"data-clip-sidebar":a,...i})}j0.displayName=`Timeline`;var M0=K(j0);const N0={root:`timeline-actions`,narrow:`timeline-actions-narrow`};function P0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(N0.root,N0.narrow,n),"data-component":`Timeline.Actions`,...r})}P0.displayName=`Timeline.Actions`;var F0=K(P0);const I0={root:`timeline-avatar`};function L0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(I0.root,n),"data-component":`Timeline.Avatar`,...r})}L0.displayName=`Timeline.Avatar`;var R0=K(L0);const z0={wrapper:`timeline-badge-wrapper`},B0=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 V0(e,t){let{className:n,variant:r,...i}=e;return(0,q.jsx)(`div`,{className:z0.wrapper,children:(0,q.jsx)(`div`,{ref:t,className:G(B0({variant:r}),n),"data-component":`Timeline.Badge`,"data-variant":r,...i})})}V0.displayName=`Timeline.Badge`;var H0=K(V0);const U0={root:`timeline-body`};function W0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(U0.root,n),"data-component":`Timeline.Body`,...r})}W0.displayName=`Timeline.Body`;var G0=K(W0);const K0={root:`timeline-break`,beforeCondensed:`timeline-break-before-condensed`};function q0(e,t){let{className:n,...r}=e;return(0,q.jsx)(`li`,{ref:t,role:`presentation`,className:G(K0.root,K0.beforeCondensed,n),"data-component":`Timeline.Break`,...r})}q0.displayName=`Timeline.Break`;var J0=K(q0);const Y0={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 X0(e,t){let{className:n,condensed:r,...i}=e;return(0,q.jsx)(`li`,{ref:t,className:G(Y0.root,Y0.rail,Y0.narrow,r&&Y0.condensed,r&&Y0.condensedBadge,r&&Y0.condensedAvatar,n),"data-component":`Timeline.Item`,"data-timeline-item":``,"data-condensed":r?``:void 0,...i})}X0.displayName=`Timeline.Item`;var Z0=K(X0);const Q0=Object.assign(M0,{Item:Z0,Avatar:R0,Badge:H0,Body:G0,Break:J0,Actions:F0});let $0=[],e2=0;const t2=new Set,n2=()=>{for(let e of t2)e()},r2=e=>(t2.add(e),()=>{t2.delete(e)}),i2=()=>$0,a2=[],o2=()=>a2,s2=e=>($0=$0.some(t=>t.id===e.id)?$0.map(t=>t.id===e.id?{...t,...e,dismissed:!1,revision:t.revision+1}:t):[{...e,revision:0},...$0],n2(),e.id),c2=e=>($0=$0.map(t=>e===void 0||t.id===e?{...t,dismissed:!0}:t),n2(),e),l2=e=>{$0=$0.filter(t=>t.id!==e),n2()},u2=()=>`toast-${++e2}`,d2=(e,t,n={})=>s2({...n,id:n.id??u2(),title:t,variant:e}),f2=(e,t)=>typeof e==`function`?e(t):e,p2=(e,t,n={})=>{let r=n.id??u2();d2(`loading`,t.loading,{...n,id:r,duration:1/0});let i=(e,t)=>{if(t==null){c2(r);return}d2(e,t,{...n,id:r,duration:n.duration})};return(typeof e==`function`?e():e).then(e=>i(`success`,f2(t.success,e)),e=>i(`error`,f2(t.error,e))),r},m2=(e,t)=>d2(`default`,e,t),h2=Object.assign(m2,{message:m2,success:(e,t)=>d2(`success`,e,t),error:(e,t)=>d2(`error`,e,t),warning:(e,t)=>d2(`warning`,e,t),info:(e,t)=>d2(`info`,e,t),loading:(e,t)=>d2(`loading`,e,{duration:1/0,...t}),custom:(e,t={})=>s2({...t,id:t.id??u2(),variant:`default`,render:e}),promise:p2,dismiss:c2,getToasts:i2}),g2={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`},_2={default:null,success:Gn,error:or,warning:zr,info:fr,loading:null},v2=t=>typeof t==`object`&&!!t&&`label`in t&&!e.isValidElement(t);function y2(t){let{toast:n,place:r,position:i,height:a,frontHeight:o,stackSize:s,expanded:c,visible:l,paused:u,swipeDirections:d,icons:f,defaults:p,onHeight:m}=t,{id:h,variant:g,title:_,description:v,render:y}=n,b=n.duration??p.duration,x=n.dismissible??p.dismissible,S=n.closeButton??p.closeButton,C=n.richColors??p.richColors,w=n.important??p.important??!1,T=e.useRef(null),[E,D]=e.useState(!1),[O,k]=e.useState({x:0,y:0}),[A,j]=e.useState(!1),[M,N]=e.useState(!1),P=e.useRef(null),F=!!n.dismissed,I=r.index===0,L=E&&!c&&!I,ee=!!y,R=i.startsWith(`top`)?`top`:`bottom`,te=e=>{n.dismissed||(c2(h),e===`timeout`?n.onAutoClose?.(n):n.onDismiss?.(n))};e.useEffect(()=>{D(!0)},[]);let z=e.useRef({revision:-1,time:b});e.useEffect(()=>{if(z.current.revision!==n.revision&&(z.current={revision:n.revision,time:b}),u||F||b===1/0)return;let e=Date.now(),t=window.setTimeout(()=>te(`timeout`),Math.max(z.current.time,0));return()=>{window.clearTimeout(t),z.current.time-=Date.now()-e}},[n,b,u,F]),e.useEffect(()=>{if(!F)return;let e=window.setTimeout(()=>l2(h),200);return()=>{window.clearTimeout(e)}},[F,h]),Ea(()=>{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,n.revision,_,v,c]);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),te(`swipe`)},ae=()=>{P.current=null,j(!1),k({x:0,y:0})},oe=c?`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":r.index,"--toast-offset":`${r.offset}px`,"--toast-z-index":s-r.index,"--toast-height":(e=>e>0?`${e}px`:`auto`)(L?o:a),"--toast-shift":E?!F||M?oe:I?se:c?`calc(${oe} + ${se})`:oe:se,"--toast-scale":L?Math.max(1-r.index*.05,0):1,"--toast-swipe-x":`${O.x}px`,"--toast-swipe-y":`${O.y}px`},le=_2[g],ue=n.icon===void 0?f?.[g]:n.icon,de=ue===void 0?g===`loading`?(0,q.jsx)(zi,{size:`small`,srText:null}):le?(0,q.jsx)(le,{}):null:ue,fe=(e,t,n)=>v2(e)?(0,q.jsx)($i,{size:`small`,variant:n,onClick:n=>{e.onClick?.(n),n.defaultPrevented||te(t)},"data-component":`Toast.${t===`action`?`Action`:`Cancel`}`,children:e.label}):e,pe=n.action!==void 0||n.cancel!==void 0;return(0,q.jsx)(`li`,{ref:T,role:w?`alert`:`status`,"aria-live":w?`assertive`:`polite`,"aria-atomic":`true`,className:G(g2.root,g2.lift[R],g2.bridge,R===`top`?g2.bridgeTop:g2.bridgeBottom,x&&g2.grabbable,!ee&&g2.card,!ee&&g2.iconColor[g],!ee&&C&&g2.richColors[g],(!E||F||!l)&&g2.hidden,!l&&g2.waiting,A?g2.dragging:g2.animated,p.className,n.className),style:ce,"data-component":`Toast`,"data-variant":g,"data-position":i,"data-mounted":E,"data-removed":F,"data-front":I,"data-expanded":c,"data-stacked":L,"data-visible":l,"data-dragging":A,"data-swiped-out":M,"data-rich-colors":C||void 0,onPointerDown:re,onPointerMove:V,onPointerUp:ie,onPointerCancel:ae,children:ee?y?.(n):(0,q.jsxs)(`div`,{className:G(g2.body,L&&g2.bodyStacked),"data-component":`Toast.Body`,children:[de===null?null:(0,q.jsx)(`span`,{className:g2.icon,"aria-hidden":`true`,"data-component":`Toast.Icon`,children:de}),(0,q.jsxs)(`div`,{className:g2.content,"data-component":`Toast.Content`,children:[(0,q.jsx)(`div`,{className:g2.title,"data-component":`Toast.Title`,children:_}),v===void 0?null:(0,q.jsx)(`div`,{className:g2.description,"data-component":`Toast.Description`,children:v})]}),pe?(0,q.jsxs)(`div`,{className:g2.actions,"data-component":`Toast.Actions`,children:[fe(n.cancel,`cancel`,`invisible`),fe(n.action,`action`,`default`)]}):null,S&&x?(0,q.jsx)(na,{icon:ir,"aria-label":`Close`,variant:`invisible`,size:`small`,onClick:()=>te(`close-button`),"data-component":`Toast.CloseButton`}):null]})})}y2.displayName=`Toast`;const b2=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`}}}),x2=[`altKey`,`KeyT`],S2=e=>typeof e==`number`?`${e}px`:e,C2=e=>{let[t,n]=e.split(`-`),r=[t];return(n===`left`||n===`right`)&&r.push(n),r},w2=e=>(document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}),T2=()=>document.visibilityState===`hidden`,E2=()=>!1;function D2(t,n){let{position:r=`bottom-right`,expand:i=!1,visibleToasts:a=3,toastOptions:o,duration:s=4e3,closeButton:c=!1,richColors:l=!1,gap:u=14,offset:d=24,mobileOffset:f=16,width:p=356,hotkey:m=x2,swipeDirections:h,icons:g,containerAriaLabel:_=`Notifications`,className:v,style:y,...b}=t,x=e.useSyncExternalStore(r2,i2,o2),S=e.useSyncExternalStore(w2,T2,E2),C=e.useRef(null),w=Be(n,C),[T,E]=e.useState({}),[D,O]=e.useState(!1),k=i||D,A=e.useCallback((e,t)=>{E(n=>n[e]===t?n:{...n,[e]:t})},[]);e.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=e.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;e.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:s,closeButton:c,richColors:l,dismissible:!0,...o},L=h??C2(r);return(0,q.jsx)(Va,{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(b2({position:r}),v),style:{...y,"--toaster-width":S2(p),"--toaster-viewport-offset":S2(d),"--toaster-mobile-offset":S2(f),"--toaster-gap":`${u}px`},"data-component":`Toaster`,"data-position":r,"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)(y2,{toast:e,place:t,position:r,height:T[e.id]??0,frontHeight:F,stackSize:x.length,expanded:k,visible:t.index<a,paused:D||S,swipeDirections:L,icons:g,defaults:I,onHeight:A},e.id)})})})})}D2.displayName=`Toaster`;var O2=K(D2);const k2=2e3,A2={content:`toggle-switch-content`,srOnly:`sr-only`},j2=`toggle-switch-icon`,M2=W(`toggle-switch`,{variants:{statusLabelPosition:{start:`toggle-switch-label-start`,end:`toggle-switch-label-end`}}}),N2=W(`toggle-switch-status`,{variants:{statusLabelPosition:{start:``,end:`toggle-switch-status-end`}}}),P2=W(`toggle-switch-status-label`,{variants:{size:{small:`toggle-switch-status-label-small`,medium:`toggle-switch-status-label-medium`},disabled:{true:`toggle-switch-status-label-disabled`,false:``}}}),F2=W(`toggle-switch-status-text`,{variants:{hidden:{true:`toggle-switch-status-text-hidden`,false:``}}}),I2=W(`toggle-switch-track`,{variants:{size:{small:`toggle-switch-track-small`,medium:`toggle-switch-track-medium`},track:{off:`toggle-switch-track-off`,on:`toggle-switch-track-on`,disabled:`toggle-switch-track-disabled`}}}),L2=W(j2,{variants:{disabled:{true:`toggle-switch-circle-icon-disabled`,false:`toggle-switch-circle-icon`},checked:{true:`translate-x-0`,false:`-translate-x-full`}}}),R2=W(j2,{variants:{disabled:{true:`toggle-switch-line-icon-disabled`,false:`toggle-switch-line-icon`},checked:{true:`translate-x-full`,false:`translate-x-0`}}}),z2=W(`toggle-switch-knob`,{variants:{checked:{true:`toggle-switch-knob-checked`,false:`translate-x-0`},disabled:{true:`toggle-switch-knob-disabled`,false:``}}}),B2={small:12,medium:16},V2=({size:e})=>(0,q.jsx)(`svg`,{"aria-hidden":`true`,width:B2[e],height:B2[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,d:`M8 12.5a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9ZM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12Z`})}),H2=({size:e})=>(0,q.jsx)(`svg`,{"aria-hidden":`true`,width:B2[e],height:B2[e],viewBox:`0 0 16 16`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,d:`M8 2a.75.75 0 0 1 .75.75v11.5a.75.75 0 0 1-1.5 0V2.75A.75.75 0 0 1 8 2Z`})});function U2(t,n){let{className:r,checked:i,defaultChecked:a,disabled:o,loading:s,onChange:c,onClick:l,size:u=`medium`,statusLabelPosition:d=`start`,buttonType:f=`button`,loadingLabel:p=`Loading`,loadingLabelDelay:m=k2,buttonLabelOn:h=`On`,buttonLabelOff:g=`Off`,"aria-labelledby":_,"aria-describedby":v,...y}=t,b=i!==void 0,[x,S]=e.useState(!!a),C=b?i:x,w=!o&&!s,T=`${Y()}-loading-label`,[E,D]=e.useState(!1);e.useEffect(()=>{if(!s){D(!1);return}let e=window.setTimeout(()=>{D(!0)},m);return()=>{window.clearTimeout(e)}},[s,m]);let O=e=>{w&&(b||S(!C),c?.(!C),l?.(e))},k=[E?T:void 0,v].filter(Boolean).join(` `);return(0,q.jsxs)(`div`,{className:G(M2({statusLabelPosition:d}),r),"data-component":`ToggleSwitch`,"data-size":u,"data-status-label-position":d,"data-checked":C,"data-disabled":!w,"data-loading":s?`true`:void 0,...y,children:[(0,q.jsx)(`span`,{id:T,role:`status`,className:A2.srOnly,children:E?p:``}),s?(0,q.jsx)(`span`,{className:G(N2({statusLabelPosition:d})),"data-component":`ToggleSwitch.LoadingSpinner`,children:(0,q.jsx)(zi,{size:`small`,srText:null,role:`presentation`})}):null,(0,q.jsxs)(`span`,{className:G(P2({size:u,disabled:!w})),"aria-hidden":`true`,onClick:O,"data-component":`ToggleSwitch.StatusText`,children:[(0,q.jsx)(`span`,{className:G(F2({hidden:!C})),children:h}),(0,q.jsx)(`span`,{className:G(F2({hidden:C})),children:g})]}),(0,q.jsxs)(`button`,{ref:n,type:f,className:G(I2({size:u,track:w?C?`on`:`off`:`disabled`})),onClick:O,"aria-labelledby":_,"aria-describedby":k||void 0,"aria-pressed":C,"aria-disabled":!w,"data-component":`ToggleSwitch.SwitchButton`,children:[(0,q.jsxs)(`span`,{className:A2.content,"aria-hidden":`true`,children:[(0,q.jsx)(`span`,{className:G(L2({disabled:!w,checked:C})),"data-component":`ToggleSwitch.LineIcon`,children:(0,q.jsx)(H2,{size:u})}),(0,q.jsx)(`span`,{className:G(R2({disabled:!w,checked:C})),"data-component":`ToggleSwitch.CircleIcon`,children:(0,q.jsx)(V2,{size:u})})]}),(0,q.jsx)(`span`,{className:G(z2({checked:C,disabled:!w})),"aria-hidden":`true`,"data-component":`ToggleSwitch.ToggleKnob`})]})]})}U2.displayName=`ToggleSwitch`;var W2=K(U2);const G2=W(`token`,{variants:{size:{small:`token-small`,medium:`token-medium`,large:`token-large`,xlarge:`token-xlarge`},interactive:{true:`token-interactive`,false:`token-static`}}}),K2=`medium`,q2=({as:e=`span`,onClick:t,onFocus:n,tabIndex:r=-1,disabled:i})=>!i&&!!(n||t||r>-1||e===`a`||e===`button`);function J2(e,t){let{as:n=`span`,className:r,size:i=K2,isSelected:a,onRemove:o,onKeyDown:s,...c}=e,l=q2({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(G2({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})}J2.displayName=`TokenBase`;var Y2=K(J2);const X2=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 Z2(e){let{className:t,size:n=K2,isParentInteractive:r,...i}=e,a=G(X2({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)(ir,{})}):(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove token`,className:a,"data-component":`Token.RemoveButton`,"data-size":n,...i,children:(0,q.jsx)(ir,{})})}Z2.displayName=`Token.RemoveButton`;const Q2={root:`token-text`,interactive:`token-text-interactive`};function $2(e,t){let{as:n=`span`,className:r,interactive:i,...a}=e;return(0,q.jsx)(n,{ref:t,className:G(Q2.root,i&&Q2.interactive,r),"data-component":`Token.Text`,...n===`button`?{type:`button`}:{},...a})}$2.displayName=`Token.Text`;var e4=K($2);const t4={srOnly:`sr-only`},n4=W(`token-default`,{variants:{interactive:{true:`token-default-interactive`,false:``},selected:{true:`token-default-selected`,false:``},withRemoveButton:{true:`token-with-remove-button`,false:``}}}),r4=W(`token-visual`,{variants:{size:{small:``,medium:`token-visual-medium`,large:`token-visual-large`,xlarge:`token-visual-xlarge`}}}),i4=t=>e.isValidElement(t)?t:(0,q.jsx)(t,{});function a4(e,t){let{as:n,className:r,text:i,size:a=K2,leadingVisual:o,onRemove:s,hideRemoveButton:c,isSelected:l,href:u,onClick:d,...f}=e,p=q2({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)(Y2,{ref:t,size:a,isSelected:l,onRemove:s,className:G(n4({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(r4({size:a})),"data-component":`Token.LeadingVisual`,children:i4(o)}):null,(0,q.jsxs)(e4,{interactive:h,...h?g:{},children:[i,s?(0,q.jsx)(`span`,{className:t4.srOnly,children:` (press backspace or delete to remove)`}):null]}),m?(0,q.jsx)(Z2,{size:a,isParentInteractive:p,onClick:_}):null]})}a4.displayName=`Token`;var o4=K(a4);const s4=`#999999`,c4=.6,l4=(e,t,n)=>Math.max(t,Math.min(e,n)),u4=e=>l4(Math.round(e),0,100),d4=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}},f4=({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)}},p4=({r:e,g:t,b:n})=>(e*.2126+t*.7152+n*.0722)/255,m4=e=>{let t=d4(e)??d4(`#999999`),{h:n,s:r,l:i}=f4(t),a=p4(t),{r:o,g:s,b:c}=t,l=l4(1/(.453-a),0,1),u=l4((a-.96)*100,0,1),d=(c4-a)*100*l4(1/(c4-a),0,1),f=u4(i+d);return{light:{background:`rgb(${o}, ${s}, ${c})`,foreground:`hsl(0deg, 0%, ${Math.round(l*100)}%)`,border:`hsla(${n}deg, ${r}%, ${u4(i-25)}%, ${u})`,ring:`rgb(${o}, ${s}, ${c})`,backgroundHover:`hsl(${n}deg, ${r}%, ${u4(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}%, ${u4(i+10)}%, 0.3)`}}},h4={root:`issue-label-token`,interactive:`issue-label-token-interactive`,selected:`issue-label-token-selected`,withRemoveButton:`token-with-remove-button`,srOnly:`sr-only`};function g4(t,n){let{as:r,className:i,style:a,text:o,size:s=K2,fillColor:c=s4,onRemove:l,hideRemoveButton:u,isSelected:d,href:f,onClick:p,...m}=t,h=e.useMemo(()=>m4(c),[c]),g=q2({as:r,onClick:p,onFocus:m.onFocus,tabIndex:m.tabIndex,disabled:m.disabled}),_=!!l&&!u,v=g&&_,y={as:r,href:f,onClick:p},b=e=>{e.stopPropagation(),l?.()};return(0,q.jsxs)(Y2,{ref:n,size:s,isSelected:d,onRemove:l,className:G(h4.root,g&&h4.interactive,d&&h4.selected,_&&h4.withRemoveButton,i),style:{...a,"--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)(e4,{interactive:v,...v?y:{},children:[o,l?(0,q.jsx)(`span`,{className:h4.srOnly,children:` (press backspace or delete to remove)`}):null]}),_?(0,q.jsx)(Z2,{size:s,isParentInteractive:g,onClick:b}):null]})}g4.displayName=`IssueLabelToken`;var _4=K(g4);const v4={root:`topic-tag`,interactive:`topic-tag-interactive`,hover:`topic-tag-hover`};function y4(e,t){let{as:n=`a`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(v4.root,v4.interactive,v4.hover,r),"data-component":`TopicTag`,...i})}y4.displayName=`TopicTag`;var b4=K(y4);const x4={root:`topic-tag-group`};function S4(e,t){let{as:n=`div`,className:r,...i}=e;return(0,q.jsx)(n,{ref:t,className:G(x4.root,r),"data-component":`TopicTag.Group`,...i})}S4.displayName=`TopicTag.Group`;var C4=K(S4);const w4=Object.assign(b4,{Group:C4}),T4=n(null),E4=n(null),D4=4,O4=8,k4=e=>e?e.type??(e.target?`tooltip`:`dialog`):`dialog`,A4=e=>e!==null&&e.effect===void 0,j4=(e,t)=>e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height;function M4(t){let{steps:n,step:r,defaultStep:i=null,onStepChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,onStatusChange:l,keyboardNavigation:u=!1,closeOnEscape:d=!0,closeOnInteractOutside:f=!0,spotlightOffset:p=4,spotlightRadius:m=8,id:h,children:g}=t,_=Y(h),v=`${_}-title`,y=`${_}-description`,b=e.useRef(null),x=o!==void 0,[S,C]=e.useState(s),w=x?o:S,T=r!==void 0,[E,D]=e.useState(i),O=T?r:E,k=n.length,A=n.findIndex(e=>e.id===O),j=A===-1?null:n[A],M=e.useCallback(e=>{T||D(e),a?.({stepId:e,stepIndex:n.findIndex(t=>t.id===e),count:n.length})},[T,a,n]),N=e.useCallback(e=>{x||C(e),c?.(e)},[x,c]),P=e.useCallback(e=>{let t=e??n[0]?.id??null;M(t),N(!0),l?.({status:`started`})},[N,M,l,n]),F=e.useCallback(e=>{n.some(t=>t.id===e)&&M(e)},[M,n]),I=e.useCallback(()=>{M(null),N(!1)},[N,M]),L=e.useCallback(()=>{I(),l?.({status:`dismissed`})},[I,l]),ee=e.useCallback(()=>{let e=n[A+1];if(!e){I(),l?.({status:`completed`});return}M(e.id)},[M,I,l,A,n]),R=e.useCallback(()=>{let e=A>0?n[A-1]:void 0;e&&M(e.id)},[M,A,n]),[te,z]=e.useState(()=>({stepId:O,ready:A4(j),patch:null}));te.stepId!==O&&z({stepId:O,ready:A4(j),patch:null});let ne=te.stepId===O?te:null,B=ne?.ready??A4(j),re=ne?.patch??null,V=e.useMemo(()=>j&&re?{...j,...re}:j,[j,re]),ie=k4(V),ae=e.useRef({next:ee,prev:R,goto:F,dismiss:L,step:j});Ea(()=>{ae.current={next:ee,prev:R,goto:F,dismiss:L,step:j}});let oe=e.useMemo(()=>({next:()=>ae.current.next(),prev:()=>ae.current.prev(),goto:e=>ae.current.goto(e),dismiss:()=>ae.current.dismiss(),show:()=>z(e=>e.stepId===O?{...e,ready:!0}:e),update:e=>z(t=>t.stepId===O?{...t,patch:{...t.patch,...e}}:t),target:()=>ae.current.step?.target?.()??null}),[O]);e.useEffect(()=>{if(w)return ae.current.step?.effect?.(oe)??void 0},[oe,w]);let se=e.useCallback(()=>ae.current.step?.target?.()??null,[]),[ce,le]=e.useState(null),ue=e.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&&j4(e,a)?e:a)},[se]);Ea(()=>{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]),ka(e=>{!w||!d||(e.preventDefault(),L())}),e.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]),e.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]),e.useEffect(()=>{if(!w)return;let e=document.activeElement;return()=>{e instanceof HTMLElement&&e.focus()}},[w]);let de=e.useMemo(()=>({open:w,step:V,stepIndex:A,steps:n,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,n]),fe=e.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)(T4.Provider,{value:fe,children:g})}M4.displayName=`Tour`;const N4=[];function P4(t){let n=e.useContext(T4);return(0,q.jsx)(q.Fragment,{children:t.children(n?.step?.actions??N4)})}P4.displayName=`Tour.Actions`;const F4={root:`tour-action-trigger`};function I4(t,n){let{action:r,className:i,children:a,onClick:o,variant:s=`default`,...c}=t,l=e.useContext(T4);return l?(0,q.jsx)($i,{ref:n,variant:s,className:G(F4.root,i),onClick:e=>{if(o?.(e),!e.defaultPrevented){if(typeof r.action==`function`){r.action(l);return}r.action===`next`?l.next():r.action===`prev`?l.prev():l.dismiss()}},"data-component":`Tour.ActionTrigger`,"data-action":typeof r.action==`string`?r.action:`custom`,...c,children:a??r.label}):null}I4.displayName=`Tour.ActionTrigger`;var L4=K(I4);const R4={"outside-top":`bottom`,"outside-bottom":`top`,"outside-left":`right`,"outside-right":`left`},z4={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 B4(t,n){let r=e.useContext(T4),i=e.useContext(E4);if(!r||!i||r.stepType!==`tooltip`||r.step?.arrow===!1)return null;let a=R4[i.side],o=`${a}${z4[a][i.align]}`;return(0,q.jsx)(Ud,{ref:n,location:o,"data-component":`Tour.Arrow`,...t})}B4.displayName=`Tour.Arrow`;var V4=K(B4);const H4=W([`tour-backdrop`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`],{variants:{spotlit:{true:`tour-backdrop-spotlit`,false:``}}});function U4(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(T4);if(!s||!s.open||!s.ready||s.step?.backdrop===!1)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Va,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(H4({spotlit:c!==null}),r),style:{...i,"--tour-target-top":`${(c?.top??0)-l}px`,"--tour-target-left":`${(c?.left??0)-l}px`,"--tour-target-width":`${(c?.width??0)+l*2}px`,"--tour-target-height":`${(c?.height??0)+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Backdrop`,"data-spotlit":c?``:void 0,...o})})}U4.displayName=`Tour.Backdrop`;var W4=K(U4);const G4={root:`tour-close-trigger`};function K4(t,n){let{className:r,icon:i=ir,onClick:a,"aria-label":o=`Close tour`,...s}=t,c=e.useContext(T4);return c?(0,q.jsx)(na,{ref:n,icon:i,variant:`invisible`,size:`small`,"aria-label":o,className:G(G4.root,r),onClick:e=>{a?.(e),!e.defaultPrevented&&c.dismiss()},"data-component":`Tour.CloseTrigger`,...s}):null}K4.displayName=`Tour.CloseTrigger`;var q4=K(K4);const J4={root:`tour-content`};function Y4(t,n){let{className:r,...i}=t,a=e.useContext(T4),o=Be(n,a?.contentRef??null),s=a?.step?.id??null,c=a?.ready??!1,l=a?.contentRef;return e.useEffect(()=>{!c||!s||l?.current?.focus()},[l,c,s]),!a||!a.open||!a.ready||!a.step?null:(0,q.jsx)(`div`,{ref:o,role:`dialog`,"aria-labelledby":a.step.title?a.titleId:void 0,"aria-describedby":a.step.description?a.descriptionId:void 0,tabIndex:-1,className:G(J4.root,r),"data-component":`Tour.Content`,"data-type":a.stepType,"data-step":a.step.id,...i})}Y4.displayName=`Tour.Content`;var X4=K(Y4);const Z4={root:`tour-control`};function Q4(e,t){let{className:n,...r}=e;return(0,q.jsx)(`div`,{ref:t,className:G(Z4.root,n),"data-component":`Tour.Control`,...r})}Q4.displayName=`Tour.Control`;var $4=K(Q4);const e3={root:`tour-description`};function t3(t,n){let{className:r,children:i,...a}=t,o=e.useContext(T4);return o?(0,q.jsx)(`div`,{ref:n,id:o.descriptionId,className:G(e3.root,r),"data-component":`Tour.Description`,...a,children:i??o.step?.description}):null}t3.displayName=`Tour.Description`;var n3=K(t3);const r3=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:``}}}),i3=(e,t)=>e.top===t.top&&e.left===t.left&&e.anchorSide===t.anchorSide&&e.anchorAlign===t.anchorAlign;function a3(t,n){let{side:r=`outside-bottom`,align:i=`center`,placement:a=`bottom-end`,portalContainerName:o,className:s,style:c,children:l,...u}=t,d=e.useContext(T4),f=d?.step??null,p=d?.stepType??`dialog`,m=p===`tooltip`,h=f?.side??r,g=f?.align??i,_=f?.placement??a,v=!!(d?.open&&d.ready&&f),y=e.useRef(null),b=Be(n,y),x=e.useRef(null),[S,C]=e.useState(null),w=d?.getTarget,T=d?.spotlightOffset??0,E=e.useCallback(()=>{let e=w?.(),t=y.current;if(!e||!t)return;let n=Ka(t,e,{side:h,align:g,anchorOffset:T+8});x.current&&i3(x.current,n)||(x.current=n,C(n))},[g,w,h,T]);return Ea(()=>{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)(Va,{containerName:o,children:(0,q.jsx)(`div`,{ref:b,className:G(r3({type:p,unplaced:m&&!S}),s),style:{...c,"--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)(E4.Provider,{value:{side:S?.anchorSide??h,align:S?.anchorAlign??g},children:l})})})}a3.displayName=`Tour.Positioner`;var o3=K(a3);const s3={root:`tour-progress-text`};function c3(t,n){let{className:r,children:i,...a}=t,o=e.useContext(T4);return o?(0,q.jsx)(`div`,{ref:n,className:G(s3.root,r),"data-component":`Tour.ProgressText`,...a,children:i??o.progressText}):null}c3.displayName=`Tour.ProgressText`;var l3=K(c3);const u3={root:[`tour-spotlight`,`motion-safe:animate-in motion-safe:fade-in motion-safe:duration-short`]};function d3(t,n){let{className:r,style:i,portalContainerName:a,...o}=t,s=e.useContext(T4);if(!s||!s.open||!s.ready||!s.targetRect)return null;let{targetRect:c,spotlightOffset:l,spotlightRadius:u}=s;return(0,q.jsx)(Va,{containerName:a,children:(0,q.jsx)(`div`,{ref:n,"aria-hidden":`true`,className:G(u3.root,r),style:{...i,"--tour-target-top":`${c.top-l}px`,"--tour-target-left":`${c.left-l}px`,"--tour-target-width":`${c.width+l*2}px`,"--tour-target-height":`${c.height+l*2}px`,"--tour-target-radius":`${u}px`},"data-component":`Tour.Spotlight`,...o})})}d3.displayName=`Tour.Spotlight`;var f3=K(d3);const p3={root:`tour-title`};function m3(t,n){let{className:r,children:i,...a}=t,o=e.useContext(T4);return o?(0,q.jsx)(`h2`,{ref:n,id:o.titleId,className:G(p3.root,r),"data-component":`Tour.Title`,...a,children:i??o.step?.title}):null}m3.displayName=`Tour.Title`;var h3=K(m3);const g3=()=>{let e=o(T4);if(!e)throw Error("`useTour` has to be called from within a `Tour` component.");return e},_3=(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]},v3=(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()]},y3=(e,t)=>_3(e,t),b3=(e,t,n)=>_3(()=>{let n=e();return n&&n.value===t?n:null},n),x3=Object.assign(M4,{Backdrop:W4,Spotlight:f3,Positioner:o3,Content:X4,Arrow:V4,CloseTrigger:q4,ProgressText:l3,Title:h3,Description:n3,Control:$4,Actions:P4,ActionTrigger:L4}),S3=e.createContext({announceUpdate:()=>{},expandedStateCache:{current:new Map},scrollElementIntoView:()=>{}}),C3=e.createContext({itemId:``,level:1,isSubTreeEmpty:!1,setIsSubTreeEmpty:()=>{},isExpanded:!1,setIsExpanded:()=>{},leadingVisualId:``,trailingVisualId:``,trailingActionId:``}),w3=e.createContext(!1),T3=`[role=tree]`,E3=`[role=treeitem]`,D3=e=>{let t=e.getAttribute(`aria-label`);if(t)return t;let n=e.getAttribute(`aria-labelledby`);return n?document.getElementById(n)?.textContent??``:e.textContent??``},O3=e=>{let t=e.getAttribute(`aria-expanded`);return t===`true`?`open`:t===`false`?`closed`:`end`},k3=e=>!!e.parentElement?.closest(`[role=treeitem][aria-expanded=false]`),A3=e=>{let t=e.querySelector(E3);return t instanceof HTMLElement?t:void 0},j3=e=>{let t=e.closest(`[role=group]`)?.closest(E3);return t instanceof HTMLElement?t:void 0},M3=e=>{let t=e.closest(T3)?.querySelector(E3);return t instanceof HTMLElement?t:void 0},N3=e=>{let t=e.closest(T3);if(!t)return;let n=Array.from(t.querySelectorAll(E3));for(let e=n.length-1;e>=0;e--)if(!k3(n[e]))return n[e]},P3=(e,t)=>{let n=e.closest(T3);if(!n)return;let r=Array.from(n.querySelectorAll(E3)),i=t===`next`?1:-1;for(let t=r.indexOf(e)+i;t>=0&&t<r.length;t+=i)if(!k3(r[t]))return r[t]},F3=e=>{let t=e.parentElement;for(;t;){let{overflowY:e}=getComputedStyle(t);if(e===`auto`||e===`scroll`)return t;t=t.parentElement}},I3=(e,t)=>{let n=t?.getBoundingClientRect().height||32,r=F3(e)?.clientHeight??window.innerHeight;return Math.max(Math.floor(r/n),1)},L3=(e,t)=>{let n=e.closest(T3);if(!n)return;let r=Array.from(n.querySelectorAll(E3));if(r.length===0)return;let i=I3(n,r[0].firstElementChild),a=r.indexOf(e),o=Math.floor(a/i),s=a-i*o,c=(o+(t===`next`?1:-1))*i+s;return r[Math.min(Math.max(c,0),r.length-1)]},R3={"open ArrowRight":A3,"closed ArrowLeft":j3,"end ArrowLeft":j3},z3=new Set([`ArrowLeft`,`ArrowRight`]),B3={ArrowUp:e=>P3(e,`previous`),ArrowDown:e=>P3(e,`next`),Backspace:j3,Home:M3,End:N3,PageUp:e=>L3(e,`previous`),PageDown:e=>L3(e,`next`)},V3=(e,t)=>z3.has(t)?R3[`${O3(e)} ${t}`]?.(e):B3[t]?.(e),H3=`[role=treeitem]`,U3=({containerRef:e})=>{Ea(()=>{let t=e.current;if(!t)return;let n=e=>{let n=Array.from(t.querySelectorAll(H3));if(n.length===0)return;let r=(e instanceof HTMLElement&&t.contains(e)?e.closest(H3):null)??n.find(e=>e.tabIndex===0)??n.find(e=>e.getAttribute(`aria-current`)===`true`)??n[0];for(let e of n)e.tabIndex=e===r?0:-1};n();let r=e=>{n(e.target)},i=e=>{if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let n=e.target?.closest(H3);if(!n||!t.contains(n))return;let r=V3(n,e.key);r&&(e.preventDefault(),r.focus())},a=new MutationObserver(()=>n(document.activeElement));return a.observe(t,{childList:!0,subtree:!0}),t.addEventListener(`focusin`,r),t.addEventListener(`keydown`,i),()=>{a.disconnect(),t.removeEventListener(`focusin`,r),t.removeEventListener(`keydown`,i)}},[e])},W3=(e,t)=>e.map((n,r)=>e[(t+r)%e.length]),G3=({containerRef:t,onFocusChange:n})=>{let r=e.useRef(``),i=e.useRef(0),a=e.useRef(n);e.useEffect(()=>{a.current=n},[n]),e.useEffect(()=>{let e=t.current;if(!e)return;let n=null,o=()=>(n??=Array.from(e.querySelectorAll(`[role=treeitem]`)),n),s=new MutationObserver(()=>{n=null});s.observe(e,{childList:!0,subtree:!0});let c=e=>{if(!e.key||e.key.length>1||e.key===` `||e.ctrlKey||e.altKey||e.metaKey)return;r.current+=e.key;let t=o(),n=t.findIndex(e=>e===document.activeElement),s=W3(t,Math.max(n,0)),c=r.current.length===1?s.slice(1):s,l=r.current.toLowerCase(),u=c.find(e=>D3(e).trim().toLowerCase().startsWith(l));u&&a.current(u),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{r.current=``},300),e.preventDefault(),e.stopPropagation()};return e.addEventListener(`keydown`,c),()=>{s.disconnect(),e.removeEventListener(`keydown`,c),window.clearTimeout(i.current)}},[t])},K3={root:`tree-view`,hover:`tree-view-hover`,coarse:`tree-view-coarse`,hidden:`sr-only`};function q3(t,n){let{children:r,className:i,flat:a,truncate:o=!0,...s}=t,c=e.useRef(null),l=Be(n,c),[u,d]=e.useState(``),f=e.useCallback(e=>d(e),[]);U3({containerRef:c}),G3({containerRef:c,onFocusChange:e=>e.focus()});let p=e.useRef(null),m=e.useCallback(e=>{e&&(p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,e.isConnected&&e.scrollIntoView({block:`nearest`,inline:`nearest`})}))},[]);e.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current)},[]);let h=e.useRef(null);h.current??=new Map;let g=e.useMemo(()=>({announceUpdate:f,expandedStateCache:h,scrollElementIntoView:m}),[f,m]);return(0,q.jsxs)(S3.Provider,{value:g,children:[(0,q.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:K3.hidden,"data-component":`TreeView.Announcement`,children:u}),(0,q.jsx)(`ul`,{ref:l,role:`tree`,className:G(K3.root,K3.hover,K3.coarse,i),"data-component":`TreeView`,"data-omit-spacer":a?`true`:void 0,"data-truncate-text":o?`true`:`false`,...s,children:r})]})}q3.displayName=`TreeView`;var J3=e.forwardRef(q3);const Y3={root:`tree-view-directory-icon`};function X3(){let{isExpanded:t}=e.useContext(C3),n=t?ur:dr;return(0,q.jsx)(`span`,{className:Y3.root,"data-component":`TreeView.DirectoryIcon`,children:(0,q.jsx)(n,{})})}X3.displayName=`TreeView.DirectoryIcon`;const Z3=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`];function Q3(t){let{title:n=`Error`,children:r,onRetry:i,onDismiss:a}=t,{itemId:o,setIsExpanded:s}=e.useContext(C3);return(0,q.jsx)(`div`,{onKeyDown:e=>{Z3.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ErrorDialog`,children:(0,q.jsx)(zg,{title:n,confirmButtonContent:`Retry`,cancelButtonContent:`Dismiss`,onClose:e=>{if(window.setTimeout(()=>document.getElementById(o)?.focus()),e===`confirm`){i?.();return}s(!1),a?.()},children:r})})}Q3.displayName=`TreeView.ErrorDialog`;const $3={hidden:`sr-only`},e6=[`Backspace`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Enter`],t6=e=>g(e)?(0,q.jsx)(e,{}):e;function n6(t){let{items:n,onClose:r}=t,{itemId:i}=e.useContext(C3);return(0,q.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>{e6.includes(e.key)&&e.stopPropagation()},"data-component":`TreeView.ActionDialog`,children:(0,q.jsx)(Pv,{title:`Supplemental actions`,onClose:()=>{r?.(),window.setTimeout(()=>document.getElementById(i)?.focus())},children:(0,q.jsx)(_a,{children:n.map(({label:e,onClick:t,icon:n,count:r},i)=>(0,q.jsxs)(_a.Item,{onSelect:t,children:[(0,q.jsx)(_a.LeadingVisual,{children:t6(n)}),e,r?(0,q.jsxs)(_a.TrailingVisual,{children:[r,(0,q.jsx)(`span`,{className:$3.hidden,children:` items`})]}):null]},i))})})})}n6.displayName=`TreeView.ActionDialog`;const r6={visual:`tree-view-visual`,hidden:`sr-only`},i6=(e,t)=>typeof e==`function`?e({isExpanded:t}):e,a6=t=>{let{children:n,label:r,labelId:i,className:a,"data-component":o}=t,{isExpanded:s}=e.useContext(C3);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{id:i,className:r6.hidden,"aria-hidden":`true`,children:r}),(0,q.jsx)(`span`,{className:a,"aria-hidden":`true`,"data-component":o,children:i6(n,s)})]})},o6={root:`tree-view-leading-action`};function s6(e){return(0,q.jsx)(a6,{label:e.label,className:o6.root,"data-component":`TreeView.LeadingAction`,children:e.children})}s6.displayName=`TreeView.LeadingAction`;function c6(t){let{leadingVisualId:n}=e.useContext(C3);return(0,q.jsx)(a6,{label:t.label,labelId:n,className:r6.visual,"data-component":`TreeView.LeadingVisual`,children:t.children})}c6.displayName=`TreeView.LeadingVisual`;const l6={root:`tree-view-sub-tree`,skeletonRow:`tree-view-skeleton-row`,skeletonText:`tree-view-skeleton-text`,muted:`tree-view-muted`,hidden:`sr-only`},u6=[`67%`,`47%`,`73%`,`64%`,`50%`],d6=t=>{let n=e.useRef(t);return e.useEffect(()=>{n.current=t},[t]),n.current},f6=({index:e})=>(0,q.jsxs)(`span`,{className:l6.skeletonRow,style:{"--tree-view-skeleton-width":u6[e%u6.length]},"aria-hidden":`true`,children:[(0,q.jsx)(l$,{size:16,shape:`square`}),(0,q.jsx)(q_,{className:l6.skeletonText})]}),p6=e.forwardRef(({count:e},t)=>{let n=Y();return(0,q.jsx)(w3.Provider,{value:!0,children:(0,q.jsx)(C6,{ref:t,id:n,children:e?(0,q.jsxs)(q.Fragment,{children:[Array.from({length:e},(e,t)=>(0,q.jsx)(f6,{index:t},t)),(0,q.jsxs)(`span`,{className:l6.hidden,children:[`Loading `,e,` items`]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(c6,{children:(0,q.jsx)(zi,{size:`small`,srText:null})}),(0,q.jsx)(Cs,{className:l6.muted,children:`Loading...`})]})})})});p6.displayName=`TreeView.LoadingItem`;const m6=()=>(0,q.jsx)(C6,{id:Y(),expanded:null,children:(0,q.jsx)(Cs,{className:l6.muted,children:`No items found`})});function h6(t){let{count:n,state:r,children:i,"aria-label":a}=t,{announceUpdate:o}=e.useContext(S3),{itemId:s,isExpanded:c,isSubTreeEmpty:l,setIsSubTreeEmpty:u}=e.useContext(C3),d=e.useRef(null),f=e.useRef(null),[p,m]=e.useState(!1),[h,g]=e.useState(``),_=d6(r);return e.useEffect(()=>{(r===void 0||r===`done`)&&u(!i)},[r,i,u]),e.useEffect(()=>{let e=document.getElementById(s);if(!e)return;let t=D3(e);if(g(t),r===`loading`){o(`${t} content loading`);return}if(_!==`loading`||r!==`done`||(o(d.current?.childElementCount?`${t} content loaded`:`${t} is empty`),!p))return;let n=window.setTimeout(()=>{(A3(e)??e).focus()});return m(!1),()=>{window.clearTimeout(n)}},[s,r,_,p,o]),e.useEffect(()=>{let e=f.current;if(!e)return;let t=()=>m(!0),n=e=>{e.relatedTarget&&m(!1)};return e.addEventListener(`focus`,t),e.addEventListener(`blur`,n),()=>{e.removeEventListener(`focus`,t),e.removeEventListener(`blur`,n)}},[r]),c?(0,q.jsxs)(`ul`,{ref:d,role:`group`,"aria-label":a||h,className:G(l6.root),"data-component":`TreeView.SubTree`,children:[r===`loading`?(0,q.jsx)(p6,{ref:f,count:n}):i,l&&r!==`loading`?(0,q.jsx)(m6,{}):null]}):null}h6.displayName=`TreeView.SubTree`;const g6={root:`tree-view-trailing-action`,button:`shrink`,hidden:`sr-only`};function _6(t){let{items:n,shortcutText:r}=t,{itemId:i,trailingActionId:a}=e.useContext(C3),o=()=>{document.getElementById(i)?.focus()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{id:a,className:g6.hidden,children:r}),(0,q.jsx)(`span`,{className:g6.root,"aria-hidden":`true`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),"data-component":`TreeView.TrailingAction`,children:n.map(({label:e,onClick:t,icon:n,count:r,className:i},a)=>r?(0,q.jsx)(lQ,{text:e,children:(0,q.jsx)($i,{variant:`invisible`,leadingVisual:n,count:r,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:o,className:G(g6.button,i)})},a):(0,q.jsx)(na,{icon:n,variant:`invisible`,"aria-label":e,"aria-hidden":`true`,tabIndex:-1,onClick:t,onKeyDown:o,className:G(g6.button,i)},a))})]})}_6.displayName=`TreeView.TrailingAction`;function v6(t){let{trailingVisualId:n}=e.useContext(C3);return(0,q.jsx)(a6,{label:t.label,labelId:n,className:r6.visual,"data-component":`TreeView.TrailingVisual`,children:t.children})}v6.displayName=`TreeView.TrailingVisual`;const y6={root:`tree-view-item`,container:`tree-view-item-container`,flat:`tree-view-item-container-flat`,hasLeadingAction:`tree-view-item-container-has-leading-action`,current:`tree-view-item-container-current`,loading:`tree-view-item-container-loading`,spacer:`tree-view-item-spacer`,levelLines:`tree-view-item-level-lines`,levelLine:`tree-view-item-level-line`,toggle:`tree-view-item-toggle`,toggleHover:`tree-view-item-toggle-hover`,toggleEnd:`tree-view-item-toggle-end`,content:`tree-view-item-content`,label:`tree-view-item-label`},b6=e=>si(e,{leadingAction:s6,leadingVisual:c6,trailingVisual:v6,subTree:h6}),x6=({level:e})=>(0,q.jsx)(`span`,{className:y6.levelLines,children:Array.from({length:e-1},(e,t)=>(0,q.jsx)(`span`,{className:y6.levelLine},t))});function S6(t,n){let{as:r,id:i,children:a,className:o,current:s=!1,defaultExpanded:c,expanded:l,onExpandedChange:u,onSelect:d,containIntrinsicSize:f,secondaryActions:p,"aria-label":m,"aria-labelledby":h,...g}=t,{expandedStateCache:_,scrollElementIntoView:v}=e.useContext(S3),{level:y}=e.useContext(C3),b=e.useContext(w3),x=Aw(),[S,C]=b6(a),w=!!S.subTree,T=Y(),E=Y(),D=Y(),O=Y(),k=l!==void 0,[A,j]=e.useState(()=>_.current?.get(i)??c??s),M=k?l===!0:A,[N,P]=e.useState(!w),[F,I]=e.useState(!1),[L,ee]=e.useState(!1),R=e.useCallback(e=>{j(e),_.current?.set(i,e),u?.(e)},[i,_,u]),te=e.useCallback(e=>{R(!M),e?.stopPropagation()},[M,R]),z=e.useCallback(()=>{if(p?.length){if(p.length===1){p[0].onClick();return}ee(!0)}},[p]),ne=e=>{switch(e.key){case`Enter`:case` `:d?d(e):te(e),e.stopPropagation();break;case`ArrowRight`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!0);break;case`ArrowLeft`:if(e.altKey||e.metaKey)return;e.preventDefault(),e.stopPropagation(),R(!1);break;case`U`:case`u`:if(!(e.shiftKey&&(e.metaKey||e.ctrlKey)))return;z()}},B=e=>{d?d(e):te(e),e.stopPropagation()},re=`Press (${ww(`Shift+${x===`apple`?`Meta`:`Control`}+U`,x)}) for more actions.`,V=[S.leadingVisual?E:void 0,S.trailingVisual?D:void 0].filter(Boolean),ie=e.useMemo(()=>({itemId:i,level:y+1,isSubTreeEmpty:N,setIsSubTreeEmpty:P,isExpanded:M,setIsExpanded:R,leadingVisualId:E,trailingVisualId:D,trailingActionId:O}),[i,y,N,M,R,E,D,O]),ae=N&&(!M||!w)||l===null?void 0:M,oe=r??`li`,se=r!==void 0&&r!==`li`,ce=(0,q.jsxs)(oe,{ref:n,id:i,role:`treeitem`,tabIndex:-1,"aria-label":p&&m?`${m}. ${re}`:m,"aria-labelledby":m?void 0:`${h||T} ${p?O:``}`.trim(),"aria-describedby":V.length>0?V.join(` `):void 0,"aria-level":y,"aria-expanded":ae,"aria-current":s?`true`:void 0,"aria-selected":F?`true`:`false`,className:G(y6.root,o),"data-component":`TreeView.Item`,"data-has-leading-action":S.leadingAction?``:void 0,"data-loading":b?``:void 0,onKeyDown:ne,onClick:B,onAuxClick:e=>{d&&e.button===1&&d(e),e.stopPropagation()},onFocus:e=>{v(e.currentTarget.firstElementChild),I(!0),e.stopPropagation()},onBlur:()=>I(!1),...g,children:[(0,q.jsxs)(`span`,{className:G(y6.container,y6.flat,S.leadingAction&&y6.hasLeadingAction,s&&y6.current,b&&y6.loading),style:{"--tree-view-level":y,contentVisibility:f?`auto`:void 0,containIntrinsicSize:f},children:[(0,q.jsx)(`span`,{className:y6.spacer,children:(0,q.jsx)(x6,{level:y})}),S.leadingAction,w?(0,q.jsx)(`span`,{className:G(y6.toggle,d&&y6.toggleHover,y===1&&y6.toggleEnd),onClick:e=>{d&&te(e)},"data-component":`TreeView.Item.Toggle`,children:M?(0,q.jsx)(qn,{width:12,height:12}):(0,q.jsx)(Yn,{width:12,height:12})}):null,(0,q.jsxs)(`span`,{id:T,className:y6.content,children:[S.leadingVisual,(0,q.jsx)(`span`,{className:y6.label,"data-component":`TreeView.Item.Label`,children:C}),S.trailingVisual]}),p?.length?(0,q.jsx)(_6,{items:p,shortcutText:re}):null]}),S.subTree,L&&p?(0,q.jsx)(n6,{items:p,onClose:()=>ee(!1)}):null]});return(0,q.jsx)(C3.Provider,{value:ie,children:se?(0,q.jsx)(`li`,{role:`none`,children:ce}):ce})}S6.displayName=`TreeView.Item`;var C6=K(S6);const w6=Object.assign(J3,{Item:C6,SubTree:h6,LeadingAction:s6,LeadingVisual:c6,TrailingVisual:v6,DirectoryIcon:X3,ErrorDialog:Q3}),T6=125,E6={root:`truncate-text`,block:`truncate-text-block`,inline:`inline-block align-top`,expandable:`truncate-text-expandable`};function D6(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(E6.root,o?E6.inline:E6.block,s&&E6.expandable,r),style:{...c,"--truncate-max-width":typeof a==`number`?`${a}px`:a},"data-component":`Truncate`,"data-inline":o,"data-expandable":s,...l})}D6.displayName=`Truncate`;var O6=K(D6);const k6=(e,{isPropUpdateDisabled:t=!1,isEqual:n=Object.is}={})=>{let[r,i]=d(e),[a,o]=d(e),s=e instanceof Function?e():e;return!t&&!n(a,s)&&(o(s),i(s)),[r,i]},A6=n({setColorMode:()=>null,setDayScheme:()=>null,setNightScheme:()=>null}),j6=()=>o(A6),M6=(e,t)=>{let{colorScheme:n}=j6();return(n?e[n]:void 0)??t},N6=`day`,P6=`(prefers-color-scheme: dark)`,F6=e=>{let t=window?.matchMedia?.(P6);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},I6=()=>window?.matchMedia?.(P6)?.matches?`night`:`day`,L6=()=>`day`,R6=()=>e.useSyncExternalStore(F6,I6,L6),z6=(e,t)=>e===`auto`?t:e,B6=(e,t,n)=>{switch(e){case`day`:case`light`:return t;case`night`:case`dark`:return n}};function V6({children:t,className:n,contextOnly:r,...i}){let{colorMode:a,dayScheme:o,nightScheme:s}=j6(),[c,l]=k6(i.colorMode??a??`day`),[u,d]=k6(i.dayScheme??o??`light`),[f,p]=k6(i.nightScheme??s??`dark`),m=R6(),h=z6(c,m),g=B6(h,u,f),_=e.useMemo(()=>({colorScheme:g,colorMode:c,resolvedColorMode:h,dayScheme:u,nightScheme:f,setColorMode:l,setDayScheme:d,setNightScheme:p}),[g,c,h,u,f,l,d,p]);return r?(0,q.jsx)(A6.Provider,{value:_,children:t}):(0,q.jsx)(A6.Provider,{value:_,children:(0,q.jsx)(`div`,{className:n,"data-component":`ThemeProvider`,"data-theme":g,"data-color-mode":c,children:t})})}V6.displayName=`ThemeProvider`;export{Oq as ARROW_KEY_STEP,kc as AUTO_LOCALE,Xr as Accordion,Sn as AccordionContext,Ur as AccordionHeader,Kr as AccordionItem,Br as AccordionItemContext,Yr as AccordionPanel,Fo as ActionBar,Po as ActionBarButton,oo as ActionBarContext,fo as ActionBarDivider,ho as ActionBarGroup,vo as ActionBarIconButton,so as ActionBarItemContext,Co as ActionBarMenu,_a as ActionList,gi as ActionListContainerContext,fi as ActionListContext,wi as ActionListDescription,Ei as ActionListDivider,Fi as ActionListGroup,Di as ActionListGroupContext,Mi as ActionListGroupHeading,hi as ActionListHeading,ma as ActionListItem,Si as ActionListItemContext,Hi as ActionListLeadingVisual,ga as ActionListLinkItem,Ui as ActionListSubItem,aa as ActionListTrailingAction,oa as ActionListTrailingVisual,to as ActionMenu,ya as ActionMenuAnchor,ba as ActionMenuButton,va as ActionMenuContext,eo as ActionMenuOverlay,Ro as Alert,Qa as AnchoredOverlay,Vo as AspectRatio,gs as Attachment,Jo as AttachmentAction,Zo as AttachmentActions,es as AttachmentContent,Ho as AttachmentContext,rs as AttachmentDescription,os as AttachmentGroup,ls as AttachmentMedia,fs as AttachmentTitle,hs as AttachmentTrigger,Xs as Autocomplete,_s as AutocompleteContext,ys as AutocompleteDeferredInputContext,zs as AutocompleteInput,vs as AutocompleteInputContext,Gs as AutocompleteMenu,Ys as AutocompleteOverlay,Gc as Avatar,Qs as AvatarContext,Vc as AvatarFallback,Wc as AvatarImage,el as AvatarStack,Sl as Banner,tl as BannerContext,rl as BannerDescription,yl as BannerPrimaryAction,xl as BannerSecondaryAction,ol as BannerTitle,Gl as Blankslate,Ol as BlankslateDescription,jl as BlankslateHeading,Il as BlankslatePrimaryAction,Vl as BlankslateSecondaryAction,Wl as BlankslateVisual,Jl as Blockquote,Zl as Box,cu as Breadcrumbs,$l as BreadcrumbsContext,su as BreadcrumbsItem,wu as Bubble,_u as BubbleContent,uu as BubbleContext,bu as BubbleGroup,du as BubbleGroupContext,Cu as BubbleReactions,$i as Button,ju as ButtonGroup,Sf as CHART_COLORS,xf as CHART_OVERFLOW_COLOR,bf as CHART_SERIES_COLORS,fd as Calendar,Pu as CalendarDay,Rd as Card,hd as CardAction,yd as CardDescription,Sd as CardHeading,Td as CardIcon,Od as CardImage,jd as CardMetadata,Ud as Caret,pf as Carousel,Gd as CarouselContext,af as CarouselControls,Yd as CarouselIndicators,Zd as CarouselNextButton,$d as CarouselPlayButton,tf as CarouselPreviousButton,cf as CarouselSlide,Kd as CarouselSlideContext,If as Chart,mf as ChartContext,yf as ChartGradient,Af as ChartLegend,Nf as ChartRadialText,Ff as ChartTooltip,Vf as Checkbox,np as CheckboxCard,Hf as CheckboxCardContext,Gf as CheckboxCardDescription,Jf as CheckboxCardLabel,Zf as CheckboxCardLeadingVisual,vp as CheckboxGroup,ap as CheckboxGroupCaption,Lf as CheckboxGroupContext,cp as CheckboxGroupLabel,pp as CheckboxGroupValidation,Ip as Clipboard,yp as ClipboardContext,Dp as ClipboardIndicator,Mp as ClipboardInput,Fp as ClipboardTrigger,zp as Code,cm as CodeBlock,Zp as CodeBlockCode,tm as CodeBlockContent,Bp as CodeBlockContext,im as CodeBlockHeader,sm as CodeBlockTitle,ym as Collapsible,hm as CollapsibleContent,lm as CollapsibleContext,vm as CollapsibleTrigger,vh as Combobox,Om as ComboboxClearTrigger,jm as ComboboxContent,bm as ComboboxContext,Pm as ComboboxControl,Lm as ComboboxEmpty,Hm as ComboboxInput,Km as ComboboxItem,Sm as ComboboxItemContext,Ym as ComboboxItemGroup,xm as ComboboxItemGroupContext,Qm as ComboboxItemGroupLabel,th as ComboboxItemIndicator,ih as ComboboxItemText,sh as ComboboxLabel,uh as ComboboxList,mh as ComboboxPositioner,_h as ComboboxTrigger,ng as CommandPalette,Sh as CommandPaletteContext,Ph as CommandPaletteDialog,Lh as CommandPaletteEmpty,Bh as CommandPaletteGroup,Ch as CommandPaletteGroupContext,Uh as CommandPaletteInput,Kh as CommandPaletteItem,Yh as CommandPaletteList,Qh as CommandPaletteLoading,tg as CommandPaletteSeparator,zg as ConfirmationDialog,Yg as ContextMenu,Hg as ContextMenuContext,Kg as ContextMenuOverlay,Jg as ContextMenuTrigger,qi as CounterLabel,Gu as DAYS_IN_WEEK,Ku as DAY_KEY_FORMAT,$s as DEFAULT_AVATAR_SIZE,N6 as DEFAULT_COLOR_MODE,_1 as DEFAULT_CURRENT_STEP,Tc as DEFAULT_DIRECTION,Hb as DEFAULT_FLOATING_PANEL_MIN_SIZE,Vb as DEFAULT_FLOATING_PANEL_POSITION,Bb as DEFAULT_FLOATING_PANEL_SIZE,s4 as DEFAULT_ISSUE_LABEL_FILL_COLOR,rc as DEFAULT_LOCALE,SW as DEFAULT_MAP_LATITUDE,CW as DEFAULT_MAP_LONGITUDE,wW as DEFAULT_MAP_ZOOM,NW as DEFAULT_MARKDOWN_NAMESPACE,iz as DEFAULT_MARKER_COLOR,nZ as DEFAULT_RATING_COUNT,vZ as DEFAULT_RELATIVE_TIME_PREFIX,_Z as DEFAULT_RELATIVE_TIME_THRESHOLD,qZ as DEFAULT_RICH_TEXT_EDITOR_CONTROLS,LZ as DEFAULT_RICH_TEXT_EDITOR_NAMESPACE,sv as DEFAULT_SORT_DIRECTION,D4 as DEFAULT_SPOTLIGHT_OFFSET,O4 as DEFAULT_SPOTLIGHT_RADIUS,A_ as DEFAULT_TABLE_PAGE_SIZE,Y_ as DEFAULT_TABLE_SKELETON_ROWS,US as DEFAULT_TEXTAREA_COLS,WS as DEFAULT_TEXTAREA_RESIZE,HS as DEFAULT_TEXTAREA_ROWS,k2 as DEFAULT_TOGGLE_SWITCH_LOADING_LABEL_DELAY,K2 as DEFAULT_TOKEN_SIZE,T6 as DEFAULT_TRUNCATE_MAX_WIDTH,xv as DataTable,Ev as DatePicker,Nv as Details,Mv as DetailsSummary,Pv as Dialog,cg as DialogBody,ug as DialogButtons,fg as DialogCloseButton,lg as DialogContext,hg as DialogFooter,vg as DialogHeader,xg as DialogSubtitle,wg as DialogTitle,Ec as DirectionContext,Uw as DirectionProvider,Hq as DragHandle,ay as Drawer,Lv as DrawerBody,Vv as DrawerCloseButton,Rv as DrawerContext,Wv as DrawerFooter,qv as DrawerHeader,Xv as DrawerSubtitle,$v as DrawerTitle,cy as Em,py as EmptyState,Wb as FLOATING_PANEL_LARGE_STEP,Ub as FLOATING_PANEL_STEP,SC as FRAME_ROOT_CLASS,Yy as FileUpload,yy as FileUploadContext,Sy as FileUploadDescription,Ty as FileUploadIcon,Jy as FileUploadItem,Oy as FileUploadLabel,jy as FileUploadList,zb as FilteredActionList,Pb as FilteredActionListBodyLoader,xb as FilteredActionListInput,wb as FilteredActionListItem,Lx as FloatingPanel,ix as FloatingPanelBody,ox as FloatingPanelCloseTrigger,ux as FloatingPanelContent,$b as FloatingPanelContext,px as FloatingPanelControl,gx as FloatingPanelDragTrigger,yx as FloatingPanelHeader,Sx as FloatingPanelPositioner,Dx as FloatingPanelResizeTrigger,Ax as FloatingPanelStageTrigger,Nx as FloatingPanelTitle,Ix as FloatingPanelTrigger,fS as Flow,Ux as FlowContext,Kx as FlowList,Yx as FlowNode,Qx as FlowParallel,hC as FormControl,QS as FormControlCaption,Op as FormControlContext,tC as FormControlLabel,iC as FormControlLeadingVisual,lC as FormControlValidation,_C as FormatByte,yC as FormatNumber,EC as Frame,IC as Header,MC as HeaderItem,FC as HeaderLink,di as Heading,zC as Hidden,KC as Highlight,tw as HoverCard,XC as HoverCardContent,qC as HoverCardContext,ZC as HoverCardTrigger,na as IconButton,iw as Image,uw as InlineMessage,_4 as IssueLabelToken,Lw as KeybindingHint,Bw as Label,Zw as LabelGroup,cT as LayerCard,eT as LayerCardPrimary,rT as LayerCardSecondary,zl as Link,uT as LinkButton,_T as List,gT as ListItem,Dc as LocaleContext,Nc as LocaleProvider,PW as MARKDOWN_NODES,FW as MARKDOWN_TRANSFORMERS,VW as MARQUEE_MINIMUM_COPIES,zW as MARQUEE_SPEEDS,kW as Map,cH as MapAttributionControl,QU as MapDragRotateAndZoomInteraction,WU as MapDrawControl,_H as MapFullScreenControl,wz as MapGraticuleLayer,nH as MapHeatmapLayer,Sz as MapImageLayer,_z as MapLayerGroup,qU as MapLayersControl,bW as MapLinkInteraction,dz as MapMarker,EH as MapMousePositionControl,pz as MapOverlay,AH as MapOverviewMapControl,rW as MapPointerInteraction,SH as MapScaleLineControl,YU as MapSearchControl,pW as MapSelectInteraction,vz as MapTileLayer,nW as MapTranslateInteraction,Cz as MapVectorLayer,ZR as MapView,aH as MapWebGLTileLayer,HC as Mark,RW as Markdown,KW as Marquee,fG as Message,$W as MessageAvatar,nG as MessageContent,lu as MessageContext,aG as MessageFooter,cG as MessageGroup,qW as MessageGroupContext,dG as MessageHeader,IG as Meter,_G as MeterContext,bG as MeterIndicator,CG as MeterLabel,EG as MeterTrack,kG as MeterValue,VG as NativeSelect,RG as NativeSelectOptGroup,BG as NativeSelectOption,_K as NavigationList,$G as NavigationListGroup,pK as NavigationListGroupExpand,gK as NavigationListGroupHeading,UG as NavigationListHeading,uK as NavigationListItem,oK as NavigationListSubNavigation,dq as NavigationMenu,NK as NavigationMenuContent,bK as NavigationMenuContext,wK as NavigationMenuDepthContext,FK as NavigationMenuDescription,LK as NavigationMenuDivider,HK as NavigationMenuGroup,zK as NavigationMenuGroupHeading,yK as NavigationMenuHeading,CK as NavigationMenuHeadingLevelContext,GK as NavigationMenuItem,xK as NavigationMenuItemContext,JK as NavigationMenuLeadingVisual,rq as NavigationMenuLink,SK as NavigationMenuLinkContext,sq as NavigationMenuList,ZK as NavigationMenuSubNavigation,$K as NavigationMenuTrailingVisual,uq as NavigationMenuTrigger,hq as NumberInput,no as OverflowObserverContext,ro as OverflowObserverProvider,TJ as PINInput,cJ as PageLayout,iJ as PageLayoutContent,_q as PageLayoutContext,Cq as PageLayoutFooter,Eq as PageLayoutHeader,sJ as PageLayoutPane,Yq as PageLayoutSidebar,gJ as Pagination,yJ as PasswordInput,OJ as Placeholder,Tw as PlatformContext,LJ as Popover,IJ as PopoverContent,kJ as PopoverContext,Va as Portal,Ma as PortalContext,Wy as ProgressBar,By as ProgressBarItem,VJ as ProgressCircle,TX as QRCode,RZ as RICH_TEXT_EDITOR_NODES,bS as Radio,BX as RadioCard,EX as RadioCardContext,kX as RadioCardDescription,MX as RadioCardLabel,FX as RadioCardLeadingVisual,tZ as RadioGroup,UX as RadioGroupCaption,_S as RadioGroupContext,KX as RadioGroupLabel,ZX as RadioGroupValidation,lZ as Rating,FZ as RelativeTime,$Z as RichTextEditor,KZ as RichTextEditorContent,QZ as RichTextEditorToolbar,ws as SCREEN_READER_DELAY,ag as ScrollableRegion,EQ as SegmentedControl,mQ as SegmentedControlButton,gQ as SegmentedControlIconButton,DQ as Select,xS as SelectContext,TS as SelectOptGroup,SS as SelectOptGroupContext,kS as SelectOption,i$ as SelectPanel,kQ as SelectPanelButton,AQ as SelectPanelContext,NQ as SelectPanelFooter,BQ as SelectPanelHeader,ZQ as SelectPanelLoading,e$ as SelectPanelMessage,IQ as SelectPanelSearchInput,r$ as SelectPanelSecondaryAction,s$ as Separator,l$ as SkeletonAvatar,W_ as SkeletonBox,q_ as SkeletonText,p$ as Slider,zi as Spinner,k$ as Splitter,y$ as SplitterPanel,S$ as SplitterResizeTrigger,T$ as SplitterResizeTriggerIndicator,O$ as SplitterResizeTriggerSeparator,jb as Stack,Ab as StackItem,I$ as StateLabel,o1 as StatisticCard,L$ as StatisticCardContext,B$ as StatisticCardDescription,U$ as StatisticCardLabel,K$ as StatisticCardTrailingVisual,$$ as StatisticCardTrend,n1 as StatisticCardValue,h1 as Status,m1 as StatusIndicator,B1 as Steps,T1 as StepsBody,O1 as StepsDescription,M1 as StepsIndicator,I1 as StepsItem,g1 as StepsItemContext,z1 as StepsTitle,J1 as Swap,V1 as SwapContext,q1 as SwapIndicator,y0 as Tab,w0 as TabList,D0 as TabPanel,Cv as Table,n_ as TableActions,s_ as TableBody,u_ as TableCell,p_ as TableCellPlaceholder,g_ as TableContainer,y_ as TableDivider,x_ as TableErrorDialog,C_ as TableHead,E_ as TableHeader,d0 as TableOfContents,r0 as TableOfContentsGroup,o0 as TableOfContentsItem,e0 as TableOfContentsList,l0 as TableOfContentsTitle,z_ as TablePagination,V_ as TableRow,Z_ as TableSkeleton,ev as TableSortHeader,rv as TableSubtitle,ov as TableTitle,O0 as Tabs,f0 as TabsContext,Cs as Text,Fs as TextInput,Ps as TextInputAction,YS as Textarea,A6 as ThemeContext,V6 as ThemeProvider,Q0 as Timeline,F0 as TimelineActions,R0 as TimelineAvatar,H0 as TimelineBadge,G0 as TimelineBody,J0 as TimelineBreak,Z0 as TimelineItem,O2 as Toaster,W2 as ToggleSwitch,o4 as Token,Y2 as TokenBase,Z2 as TokenRemoveButton,e4 as TokenText,lQ as Tooltip,eQ as TooltipContext,w4 as TopicTag,C4 as TopicTagGroup,x3 as Tour,L4 as TourActionTrigger,P4 as TourActions,V4 as TourArrow,W4 as TourBackdrop,q4 as TourCloseTrigger,X4 as TourContent,T4 as TourContext,$4 as TourControl,n3 as TourDescription,o3 as TourPositioner,E4 as TourPositionerContext,l3 as TourProgressText,f3 as TourSpotlight,h3 as TourTitle,w6 as TreeView,X3 as TreeViewDirectoryIcon,Q3 as TreeViewErrorDialog,C6 as TreeViewItem,C3 as TreeViewItemContext,s6 as TreeViewLeadingAction,c6 as TreeViewLeadingVisual,S3 as TreeViewRootContext,h6 as TreeViewSubTree,v6 as TreeViewTrailingVisual,O6 as Truncate,D_ as buildPaginationModel,O_ as buildPaginationPageData,mG as clampToRange,xh as commandScore,oS as computeEdges,sS as computeFlowRect,tS as computePositions,zx as connectorPath,xp as copyText,Sv as createColumnHelper,kq as defaultPaneWidth,nS as entryIds,rS as exitIds,od as extendRange,gy as formatFileSize,jG as formatMeterValue,MZ as formatRelativeTime,jZ as formatTitle,ww as getAccessibleKeybindingHintString,tz as getAddress,Ka as getAnchoredPosition,Ts as getCharacterCount,Qu as getFirstDayOfWeek,m4 as getIssueLabelColors,nz as getLonLat,td as getMonthWeeks,Ow as getPlatform,Tf as getProp,ad as getRangePosition,Cf as getSeriesColor,$u as getWeekdays,nd as isDateSelectable,id as isDateWithinRange,_y as isFileAccepted,q2 as isTokenInteractive,IW as markdownTheme,iS as nodeIds,sd as parseDate,La as registerPortalRoot,zZ as richTextEditorTheme,pv as sortStrategies,WC as splitHighlightChunks,ed as startOfWeek,hG as stepValue,Yu as toDayKey,h2 as toast,cv as transitionSortDirection,vy as triageFiles,Fq as updateAriaValues,Fb as useAnnouncements,Of as useChart,hf as useChartContext,Kw as useClippedChildren,Pc as useCollator,M6 as useColorSchemeVar,Vg as useConfirm,Fc as useDateFormatter,Vw as useDirection,Ic as useFilter,ex as useFloatingPanelContext,kp as useFormControlForwardedProps,Hw as useIsRtl,Oc as useLocaleContext,XR as useMap,HW as useMarquee,Lc as useNumberFormatter,io as useOverflowObserver,Kq as usePaneWidth,Aw as usePlatform,k1 as useStepsItem,g0 as useTab,x0 as useTabList,T0 as useTabPanel,u0 as useTableOfContentsActiveId,h0 as useTabs,j6 as useTheme,g3 as useTour,AG as valueToPercent,y3 as waitForElement,b3 as waitForElementValue,v3 as waitForEvent};
|