New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@twilio-paste/modal-dialog-primitive

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilio-paste/modal-dialog-primitive - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

dist/index.d.ts

@@ -17,4 +17,4 @@ /**

*/
import { DialogContent as ModalDialogPrimitiveContent, DialogOverlay as ModalDialogPrimitiveOverlay } from '@reach/dialog';
import { DialogContent as ModalDialogPrimitiveContent, DialogOverlay as ModalDialogPrimitiveOverlay } from "@reach/dialog";
export { ModalDialogPrimitiveContent, ModalDialogPrimitiveOverlay };
//# sourceMappingURL=index.d.ts.map
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_ReactPropTypesSecret=__commonJS({"../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports,module){"use strict";var ReactPropTypesSecret="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";module.exports=ReactPropTypesSecret}});var require_factoryWithThrowingShims=__commonJS({"../../../../node_modules/prop-types/factoryWithThrowingShims.js"(exports,module){"use strict";var ReactPropTypesSecret=require_ReactPropTypesSecret();function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;module.exports=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret!==ReactPropTypesSecret){var err=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw err.name="Invariant Violation",err}}shim.isRequired=shim;function getShim(){return shim}var ReactPropTypes={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ReactPropTypes.PropTypes=ReactPropTypes,ReactPropTypes}}});var require_prop_types=__commonJS({"../../../../node_modules/prop-types/index.js"(exports,module){module.exports=require_factoryWithThrowingShims()();var ReactIs,throwOnDirectAccess}});import{forwardRef as forwardRef5,useEffect as useEffect8,createElement as createElement11,useRef as useRef6,useCallback as useCallback5}from"react";import{useRef,createElement}from"react";import{useLayoutEffect,useEffect}from"react";function canUseDOM(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var useIsomorphicLayoutEffect=canUseDOM()?useLayoutEffect:useEffect;import{useState,useCallback}from"react";function useForceUpdate(){var _useState=useState(Object.create(null)),dispatch=_useState[1];return useCallback(function(){dispatch(Object.create(null))},[])}import{createPortal}from"react-dom";var Portal=function(_ref2){var children=_ref2.children,_ref$type=_ref2.type,type=_ref$type===void 0?"reach-portal":_ref$type,containerRef=_ref2.containerRef,mountNode=useRef(null),portalNode=useRef(null),forceUpdate=useForceUpdate();return useIsomorphicLayoutEffect(function(){if(!!mountNode.current){var ownerDocument=mountNode.current.ownerDocument,body=containerRef?.current||ownerDocument.body;return portalNode.current=ownerDocument?.createElement(type),body.appendChild(portalNode.current),forceUpdate(),function(){portalNode.current&&body&&body.removeChild(portalNode.current)}}},[type,forceUpdate,containerRef]),portalNode.current?createPortal(children,portalNode.current):createElement("span",{ref:mountNode})};function getOwnerDocument(element){return canUseDOM()?element?element.ownerDocument:document:null}function isFunction(value){return!!(value&&{}.toString.call(value)=="[object Function]")}function noop(){}import"react";function useCheckStyles(packageName){if(!1)var name}import{useCallback as useCallback2}from"react";function _arrayLikeToArray(arr,len){(len==null||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _unsupportedIterableToArray(o,minLen){if(!!o){if(typeof o=="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}}function _createForOfIteratorHelperLoose(o,allowArrayLike){var it;if(typeof Symbol>"u"||o[Symbol.iterator]==null){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length=="number"){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return it=o[Symbol.iterator](),it.next.bind(it)}function assignRef(ref,value){if(ref!=null)if(isFunction(ref))ref(value);else try{ref.current=value}catch{throw new Error('Cannot assign value "'+value+'" to ref "'+ref+'"')}}function useComposedRefs(){for(var _len=arguments.length,refs=new Array(_len),_key=0;_key<_len;_key++)refs[_key]=arguments[_key];return useCallback2(function(node){for(var _iterator=_createForOfIteratorHelperLoose(refs),_step;!(_step=_iterator()).done;){var ref=_step.value;assignRef(ref,node)}},refs)}function composeEventHandlers(theirHandler,ourHandler){return function(event){if(theirHandler&&theirHandler(event),!event.defaultPrevented)return ourHandler(event)}}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}import*as React6 from"react";import*as React3 from"react";var FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef2(ref,value){return typeof ref=="function"?ref(value):ref&&(ref.current=value),ref}import{useState as useState2}from"react";function useCallbackRef(initialValue,callback){var ref=useState2(function(){return{value:initialValue,callback,facade:{get current(){return ref.value},set current(value){var last=ref.value;last!==value&&(ref.value=value,ref.callback(value,last))}}}})[0];return ref.callback=callback,ref.facade}function useMergeRefs(refs,defaultValue){return useCallbackRef(defaultValue||null,function(newValue){return refs.forEach(function(ref){return assignRef2(ref,newValue)})})}import{useEffect as useEffect5}from"react";import*as React from"react";var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},InFocusGuard=function(_ref2){var children=_ref2.children;return React.createElement(React.Fragment,null,React.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}),children,children&&React.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}))};InFocusGuard.propTypes={};InFocusGuard.defaultProps={children:null};var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t}function __spreadArray(to,from,pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++)(ar||!(i in from))&&(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))}function ItoI(a){return a}function innerCreateMedium(defaults,middleware){middleware===void 0&&(middleware=ItoI);var buffer=[],assigned=!1,medium={read:function(){if(assigned)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return buffer.length?buffer[buffer.length-1]:defaults},useMedium:function(data){var item=middleware(data,assigned);return buffer.push(item),function(){buffer=buffer.filter(function(x){return x!==item})}},assignSyncMedium:function(cb){for(assigned=!0;buffer.length;){var cbs=buffer;buffer=[],cbs.forEach(cb)}buffer={push:function(x){return cb(x)},filter:function(){return buffer}}},assignMedium:function(cb){assigned=!0;var pendingQueue=[];if(buffer.length){var cbs=buffer;buffer=[],cbs.forEach(cb),pendingQueue=buffer}var executeQueue=function(){var cbs2=pendingQueue;pendingQueue=[],cbs2.forEach(cb)},cycle=function(){return Promise.resolve().then(executeQueue)};cycle(),buffer={push:function(x){pendingQueue.push(x),cycle()},filter:function(filter){return pendingQueue=pendingQueue.filter(filter),buffer}}}};return medium}function createMedium(defaults,middleware){return middleware===void 0&&(middleware=ItoI),innerCreateMedium(defaults,middleware)}function createSidecarMedium(options){options===void 0&&(options={});var medium=innerCreateMedium(null);return medium.options=__assign({async:!0,ssr:!1},options),medium}import*as React2 from"react";var SideCar=function(_a){var sideCar2=_a.sideCar,rest=__rest(_a,["sideCar"]);if(!sideCar2)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var Target=sideCar2.read();if(!Target)throw new Error("Sidecar medium not found");return React2.createElement(Target,__assign({},rest))};SideCar.isSideCarExport=!0;function exportSidecar(medium,exported){return medium.useMedium(exported),SideCar}var mediumFocus=createMedium({},function(_ref2){var target=_ref2.target,currentTarget=_ref2.currentTarget;return{target,currentTarget}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0});var emptyArray=[],FocusLock=React3.forwardRef(function(props,parentRef){var _extends22,_React$useState=React3.useState(),realObserved=_React$useState[0],setObserved=_React$useState[1],observed=React3.useRef(),isActive=React3.useRef(!1),originalFocusedElement=React3.useRef(null),children=props.children,disabled=props.disabled,noFocusGuards=props.noFocusGuards,persistentFocus=props.persistentFocus,crossFrame=props.crossFrame,autoFocus=props.autoFocus,allowTextSelection=props.allowTextSelection,group=props.group,className=props.className,whiteList=props.whiteList,hasPositiveIndices=props.hasPositiveIndices,_props$shards=props.shards,shards=_props$shards===void 0?emptyArray:_props$shards,_props$as=props.as,Container=_props$as===void 0?"div":_props$as,_props$lockProps=props.lockProps,containerProps=_props$lockProps===void 0?{}:_props$lockProps,SideCar2=props.sideCar,shouldReturnFocus=props.returnFocus,focusOptions=props.focusOptions,onActivationCallback=props.onActivation,onDeactivationCallback=props.onDeactivation,_React$useState2=React3.useState({}),id=_React$useState2[0],onActivation=React3.useCallback(function(){originalFocusedElement.current=originalFocusedElement.current||document&&document.activeElement,observed.current&&onActivationCallback&&onActivationCallback(observed.current),isActive.current=!0},[onActivationCallback]),onDeactivation=React3.useCallback(function(){isActive.current=!1,onDeactivationCallback&&onDeactivationCallback(observed.current)},[onDeactivationCallback]);useEffect5(function(){disabled||(originalFocusedElement.current=null)},[]);var returnFocus=React3.useCallback(function(allowDefer){var returnFocusTo=originalFocusedElement.current;if(returnFocusTo&&returnFocusTo.focus){var howToReturnFocus=typeof shouldReturnFocus=="function"?shouldReturnFocus(returnFocusTo):shouldReturnFocus;if(howToReturnFocus){var returnFocusOptions=typeof howToReturnFocus=="object"?howToReturnFocus:void 0;originalFocusedElement.current=null,allowDefer?Promise.resolve().then(function(){return returnFocusTo.focus(returnFocusOptions)}):returnFocusTo.focus(returnFocusOptions)}}},[shouldReturnFocus]),onFocus3=React3.useCallback(function(event){isActive.current&&mediumFocus.useMedium(event)},[]),onBlur3=mediumBlur.useMedium,setObserveNode=React3.useCallback(function(newObserved){observed.current!==newObserved&&(observed.current=newObserved,setObserved(newObserved))},[]),lockProps=_extends((_extends22={},_extends22[FOCUS_DISABLED]=disabled&&"disabled",_extends22[FOCUS_GROUP]=group,_extends22),containerProps),hasLeadingGuards=noFocusGuards!==!0,hasTailingGuards=hasLeadingGuards&&noFocusGuards!=="tail",mergedRef=useMergeRefs([parentRef,setObserveNode]);return React3.createElement(React3.Fragment,null,hasLeadingGuards&&[React3.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}),hasPositiveIndices?React3.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:disabled?-1:1,style:hiddenGuard}):null],!disabled&&React3.createElement(SideCar2,{id,sideCar:mediumSidecar,observed:realObserved,disabled,persistentFocus,crossFrame,autoFocus,whiteList,shards,onActivation,onDeactivation,returnFocus,focusOptions}),React3.createElement(Container,_extends({ref:mergedRef},lockProps,{className,onBlur:onBlur3,onFocus:onFocus3}),children),hasTailingGuards&&React3.createElement("div",{"data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}))});FocusLock.propTypes={};FocusLock.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var Lock_default=FocusLock;import*as React5 from"react";function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf||function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}import React4,{PureComponent}from"react";function withSideEffect(reducePropsToState2,handleStateChangeOnClient2){function getDisplayName(WrappedComponent){return WrappedComponent.displayName||WrappedComponent.name||"Component"}return function(WrappedComponent){var mountedInstances=[],state;function emitChange(){state=reducePropsToState2(mountedInstances.map(function(instance){return instance.props})),handleStateChangeOnClient2(state)}var SideEffect=function(_PureComponent){_inheritsLoose(SideEffect2,_PureComponent);function SideEffect2(){return _PureComponent.apply(this,arguments)||this}SideEffect2.peek=function(){return state};var _proto=SideEffect2.prototype;return _proto.componentDidMount=function(){mountedInstances.push(this),emitChange()},_proto.componentDidUpdate=function(){emitChange()},_proto.componentWillUnmount=function(){var index=mountedInstances.indexOf(this);mountedInstances.splice(index,1),emitChange()},_proto.render=function(){return React4.createElement(WrappedComponent,this.props)},SideEffect2}(PureComponent);return _defineProperty(SideEffect,"displayName","SideEffect("+getDisplayName(WrappedComponent)+")"),SideEffect}}var index_es_default=withSideEffect;var toArray=function(a){for(var ret=Array(a.length),i=0;i<a.length;++i)ret[i]=a[i];return ret},asArray=function(a){return Array.isArray(a)?a:[a]},getFirst=function(a){return Array.isArray(a)?a[0]:a};var isElementHidden=function(node){if(node.nodeType!==Node.ELEMENT_NODE)return!1;var computedStyle=window.getComputedStyle(node,null);return!computedStyle||!computedStyle.getPropertyValue?!1:computedStyle.getPropertyValue("display")==="none"||computedStyle.getPropertyValue("visibility")==="hidden"},getParentNode=function(node){return node.parentNode&&node.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?node.parentNode.host:node.parentNode},isTopNode=function(node){return node===document||node&&node.nodeType===Node.DOCUMENT_NODE},isVisibleUncached=function(node,checkParent){return!node||isTopNode(node)||!isElementHidden(node)&&checkParent(getParentNode(node))},isVisibleCached=function(visibilityCache,node){var cached=visibilityCache.get(node);if(cached!==void 0)return cached;var result=isVisibleUncached(node,isVisibleCached.bind(void 0,visibilityCache));return visibilityCache.set(node,result),result},isAutoFocusAllowedUncached=function(node,checkParent){return node&&!isTopNode(node)?isAutoFocusAllowed(node)?checkParent(getParentNode(node)):!1:!0},isAutoFocusAllowedCached=function(cache,node){var cached=cache.get(node);if(cached!==void 0)return cached;var result=isAutoFocusAllowedUncached(node,isAutoFocusAllowedCached.bind(void 0,cache));return cache.set(node,result),result},getDataset=function(node){return node.dataset},isHTMLButtonElement=function(node){return node.tagName==="BUTTON"},isHTMLInputElement=function(node){return node.tagName==="INPUT"},isRadioElement=function(node){return isHTMLInputElement(node)&&node.type==="radio"},notHiddenInput=function(node){return!((isHTMLInputElement(node)||isHTMLButtonElement(node))&&(node.type==="hidden"||node.disabled))},isAutoFocusAllowed=function(node){var attribute=node.getAttribute(FOCUS_NO_AUTOFOCUS);return![!0,"true",""].includes(attribute)},isGuard=function(node){var _a;return Boolean(node&&((_a=getDataset(node))===null||_a===void 0?void 0:_a.focusGuard))},isNotAGuard=function(node){return!isGuard(node)},isDefined=function(x){return Boolean(x)};var tabSort=function(a,b){var tabDiff=a.tabIndex-b.tabIndex,indexDiff=a.index-b.index;if(tabDiff){if(!a.tabIndex)return 1;if(!b.tabIndex)return-1}return tabDiff||indexDiff},orderByTabIndex=function(nodes,filterNegative,keepGuards){return toArray(nodes).map(function(node,index){return{node,index,tabIndex:keepGuards&&node.tabIndex===-1?(node.dataset||{}).focusGuard?0:-1:node.tabIndex}}).filter(function(data){return!filterNegative||data.tabIndex>=0}).sort(tabSort)};var tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"];var queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(parent,withGuards){return toArray((parent.shadowRoot||parent).children).reduce(function(acc,child){return acc.concat(child.matches(withGuards?queryGuardTabbables:queryTabbables)?[child]:[],getFocusablesWithShadowDom(child))},[])},getFocusablesWithIFrame=function(parent,withGuards){var _a;return parent instanceof HTMLIFrameElement&&((_a=parent.contentDocument)===null||_a===void 0?void 0:_a.body)?getFocusables([parent.contentDocument.body],withGuards):[parent]},getFocusables=function(parents,withGuards){return parents.reduce(function(acc,parent){var _a,focusableWithShadowDom=getFocusablesWithShadowDom(parent,withGuards),focusableWithIframes=(_a=[]).concat.apply(_a,focusableWithShadowDom.map(function(node){return getFocusablesWithIFrame(node,withGuards)}));return acc.concat(focusableWithIframes,parent.parentNode?toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function(node){return node===parent}):[])},[])},getParentAutofocusables=function(parent){var parentFocus=parent.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray(parentFocus).map(function(node){return getFocusables([node])}).reduce(function(acc,nodes){return acc.concat(nodes)},[])};var filterFocusable=function(nodes,visibilityCache){return toArray(nodes).filter(function(node){return isVisibleCached(visibilityCache,node)}).filter(function(node){return notHiddenInput(node)})},filterAutoFocusable=function(nodes,cache){return cache===void 0&&(cache=new Map),toArray(nodes).filter(function(node){return isAutoFocusAllowedCached(cache,node)})},getTabbableNodes=function(topNodes,visibilityCache,withGuards){return orderByTabIndex(filterFocusable(getFocusables(topNodes,withGuards),visibilityCache),!0,withGuards)},getAllTabbableNodes=function(topNodes,visibilityCache){return orderByTabIndex(filterFocusable(getFocusables(topNodes),visibilityCache),!1)},parentAutofocusables=function(topNode,visibilityCache){return filterFocusable(getParentAutofocusables(topNode),visibilityCache)},contains=function(scope,element){return scope.shadowRoot?contains(scope.shadowRoot,element):Object.getPrototypeOf(scope).contains!==void 0&&Object.getPrototypeOf(scope).contains.call(scope,element)?!0:toArray(scope.children).some(function(child){var _a;if(child instanceof HTMLIFrameElement){var iframeBody=(_a=child.contentDocument)===null||_a===void 0?void 0:_a.body;return iframeBody?contains(iframeBody,element):!1}return contains(child,element)})};var filterNested=function(nodes){for(var contained=new Set,l=nodes.length,i=0;i<l;i+=1)for(var j=i+1;j<l;j+=1){var position=nodes[i].compareDocumentPosition(nodes[j]);(position&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&contained.add(j),(position&Node.DOCUMENT_POSITION_CONTAINS)>0&&contained.add(i)}return nodes.filter(function(_,index){return!contained.has(index)})},getTopParent=function(node){return node.parentNode?getTopParent(node.parentNode):node},getAllAffectedNodes=function(node){var nodes=asArray(node);return nodes.filter(Boolean).reduce(function(acc,currentNode){var group=currentNode.getAttribute(FOCUS_GROUP);return acc.push.apply(acc,group?filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(group,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[currentNode]),acc},[])};var safeProbe=function(cb){try{return cb()}catch{return}};var getActiveElement=function(inDocument){if(inDocument===void 0&&(inDocument=document),!(!inDocument||!inDocument.activeElement)){var activeElement=inDocument.activeElement;return activeElement.shadowRoot?getActiveElement(activeElement.shadowRoot):activeElement instanceof HTMLIFrameElement&&safeProbe(function(){return activeElement.contentWindow.document})?getActiveElement(activeElement.contentWindow.document):activeElement}};var focusInFrame=function(frame,activeElement){return frame===activeElement},focusInsideIframe=function(topNode,activeElement){return Boolean(toArray(topNode.querySelectorAll("iframe")).some(function(node){return focusInFrame(node,activeElement)}))},focusInside=function(topNode,activeElement){return activeElement===void 0&&(activeElement=getActiveElement(getFirst(topNode).ownerDocument)),!activeElement||activeElement.dataset&&activeElement.dataset.focusGuard?!1:getAllAffectedNodes(topNode).some(function(node){return contains(node,activeElement)||focusInsideIframe(node,activeElement)})};var focusIsHidden=function(inDocument){inDocument===void 0&&(inDocument=document);var activeElement=getActiveElement(inDocument);return activeElement?toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(node){return contains(node,activeElement)}):!1};var findSelectedRadio=function(node,nodes){return nodes.filter(isRadioElement).filter(function(el){return el.name===node.name}).filter(function(el){return el.checked})[0]||node},correctNode=function(node,nodes){return isRadioElement(node)&&node.name?findSelectedRadio(node,nodes):node},correctNodes=function(nodes){var resultSet=new Set;return nodes.forEach(function(node){return resultSet.add(correctNode(node,nodes))}),nodes.filter(function(node){return resultSet.has(node)})};var pickFirstFocus=function(nodes){return nodes[0]&&nodes.length>1?correctNode(nodes[0],nodes):nodes[0]},pickFocusable=function(nodes,index){return nodes.length>1?nodes.indexOf(correctNode(nodes[index],nodes)):index};var NEW_FOCUS="NEW_FOCUS",newFocus=function(innerNodes,outerNodes,activeElement,lastNode){var cnt=innerNodes.length,firstFocus=innerNodes[0],lastFocus=innerNodes[cnt-1],isOnGuard=isGuard(activeElement);if(!(activeElement&&innerNodes.indexOf(activeElement)>=0)){var activeIndex=activeElement!==void 0?outerNodes.indexOf(activeElement):-1,lastIndex=lastNode?outerNodes.indexOf(lastNode):activeIndex,lastNodeInside=lastNode?innerNodes.indexOf(lastNode):-1,indexDiff=activeIndex-lastIndex,firstNodeIndex=outerNodes.indexOf(firstFocus),lastNodeIndex=outerNodes.indexOf(lastFocus),correctedNodes=correctNodes(outerNodes),correctedIndex=activeElement!==void 0?correctedNodes.indexOf(activeElement):-1,correctedIndexDiff=correctedIndex-(lastNode?correctedNodes.indexOf(lastNode):activeIndex),returnFirstNode=pickFocusable(innerNodes,0),returnLastNode=pickFocusable(innerNodes,cnt-1);if(activeIndex===-1||lastNodeInside===-1)return NEW_FOCUS;if(!indexDiff&&lastNodeInside>=0)return lastNodeInside;if(activeIndex<=firstNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnLastNode;if(activeIndex>=lastNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnFirstNode;if(indexDiff&&Math.abs(correctedIndexDiff)>1)return lastNodeInside;if(activeIndex<=firstNodeIndex)return returnLastNode;if(activeIndex>lastNodeIndex)return returnFirstNode;if(indexDiff)return Math.abs(indexDiff)>1?lastNodeInside:(cnt+lastNodeInside+indexDiff)%cnt}};var findAutoFocused=function(autoFocusables){return function(node){var _a,autofocus=(_a=getDataset(node))===null||_a===void 0?void 0:_a.autofocus;return node.autofocus||autofocus!==void 0&&autofocus!=="false"||autoFocusables.indexOf(node)>=0}},pickAutofocus=function(nodesIndexes,orderedNodes,groups){var nodes=nodesIndexes.map(function(_a){var node=_a.node;return node}),autoFocusable=filterAutoFocusable(nodes.filter(findAutoFocused(groups)));return autoFocusable&&autoFocusable.length?pickFirstFocus(autoFocusable):pickFirstFocus(filterAutoFocusable(orderedNodes))};var getParents=function(node,parents){return parents===void 0&&(parents=[]),parents.push(node),node.parentNode&&getParents(node.parentNode.host||node.parentNode,parents),parents},getCommonParent=function(nodeA,nodeB){for(var parentsA=getParents(nodeA),parentsB=getParents(nodeB),i=0;i<parentsA.length;i+=1){var currentParent=parentsA[i];if(parentsB.indexOf(currentParent)>=0)return currentParent}return!1},getTopCommonParent=function(baseActiveElement,leftEntry,rightEntries){var activeElements=asArray(baseActiveElement),leftEntries=asArray(leftEntry),activeElement=activeElements[0],topCommon=!1;return leftEntries.filter(Boolean).forEach(function(entry){topCommon=getCommonParent(topCommon||entry,entry)||topCommon,rightEntries.filter(Boolean).forEach(function(subEntry){var common=getCommonParent(activeElement,subEntry);common&&(!topCommon||contains(common,topCommon)?topCommon=common:topCommon=getCommonParent(common,topCommon))})}),topCommon},allParentAutofocusables=function(entries,visibilityCache){return entries.reduce(function(acc,node){return acc.concat(parentAutofocusables(node,visibilityCache))},[])};var reorderNodes=function(srcNodes,dstNodes){var remap=new Map;return dstNodes.forEach(function(entity){return remap.set(entity.node,entity)}),srcNodes.map(function(node){return remap.get(node)}).filter(isDefined)},getFocusMerge=function(topNode,lastNode){var activeElement=getActiveElement(asArray(topNode).length>0?document:getFirst(topNode).ownerDocument),entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(activeElement||topNode,topNode,entries),visibilityCache=new Map,anyFocusable=getAllTabbableNodes(entries,visibilityCache),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)});if(!(!innerElements[0]&&(innerElements=anyFocusable,!innerElements[0]))){var outerNodes=getAllTabbableNodes([commonParent],visibilityCache).map(function(_a){var node=_a.node;return node}),orderedInnerElements=reorderNodes(outerNodes,innerElements),innerNodes=orderedInnerElements.map(function(_a){var node=_a.node;return node}),newId=newFocus(innerNodes,outerNodes,activeElement,lastNode);if(newId===NEW_FOCUS){var focusNode=pickAutofocus(anyFocusable,innerNodes,allParentAutofocusables(entries,visibilityCache));if(focusNode)return{node:focusNode};console.warn("focus-lock: cannot find any node to move focus into");return}return newId===void 0?newId:orderedInnerElements[newId]}};var getFocusabledIn=function(topNode){var entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(topNode,topNode,entries),visibilityCache=new Map,outerNodes=getTabbableNodes([commonParent],visibilityCache,!0),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)}).map(function(_a){var node=_a.node;return node});return outerNodes.map(function(_a){var node=_a.node,index=_a.index;return{node,index,lockItem:innerElements.indexOf(node)>=0,guard:isGuard(node)}})};var focusOn=function(target,focusOptions){"focus"in target&&target.focus(focusOptions),"contentWindow"in target&&target.contentWindow&&target.contentWindow.focus()},guardCount=0,lockDisabled=!1,setFocus=function(topNode,lastNode,options){options===void 0&&(options={});var focusable=getFocusMerge(topNode,lastNode);if(!lockDisabled&&focusable){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(focusable.node,options.focusOptions),guardCount--}};var es2015_default=setFocus;function deferAction(action){setTimeout(action,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(activeElement){return(lastActiveTrap.whiteList||defaultWhitelist)(activeElement)},recordPortal=function(observerNode,portaledElement){lastPortaledElement={observerNode,portaledElement}},focusIsPortaledPair=function(element){return lastPortaledElement&&lastPortaledElement.portaledElement===element};function autoGuard(startIndex,end,step,allNodes){var lastGuard=null,i=startIndex;do{var item=allNodes[i];if(item.guard)item.node.dataset.focusAutoGuard&&(lastGuard=item);else if(item.lockItem){if(i!==startIndex)return;lastGuard=null}else break}while((i+=step)!==end);lastGuard&&(lastGuard.node.tabIndex=0)}var extractRef=function(ref){return ref&&"current"in ref?ref.current:ref},focusWasOutside=function(crossFrameOption){return crossFrameOption?Boolean(focusWasOutsideWindow):focusWasOutsideWindow==="meanwhile"},checkInHost=function checkInHost2(check,el,boundary){return el&&(el.host===check&&(!el.activeElement||boundary.contains(el.activeElement))||el.parentNode&&checkInHost2(check,el.parentNode,boundary))},withinHost=function(activeElement,workingArea){return workingArea.some(function(area){return checkInHost(activeElement,area,area)})},activateTrap=function(){var result=!1;if(lastActiveTrap){var _lastActiveTrap=lastActiveTrap,observed=_lastActiveTrap.observed,persistentFocus=_lastActiveTrap.persistentFocus,autoFocus=_lastActiveTrap.autoFocus,shards=_lastActiveTrap.shards,crossFrame=_lastActiveTrap.crossFrame,focusOptions=_lastActiveTrap.focusOptions,workingNode=observed||lastPortaledElement&&lastPortaledElement.portaledElement,activeElement=document&&document.activeElement;if(workingNode){var workingArea=[workingNode].concat(shards.map(extractRef).filter(Boolean));if((!activeElement||focusWhitelisted(activeElement))&&(persistentFocus||focusWasOutside(crossFrame)||!isFreeFocus()||!lastActiveFocus&&autoFocus)&&(workingNode&&!(focusInside(workingArea)||activeElement&&withinHost(activeElement,workingArea)||focusIsPortaledPair(activeElement,workingNode))&&(document&&!lastActiveFocus&&activeElement&&!autoFocus?(activeElement.blur&&activeElement.blur(),document.body.focus()):(result=es2015_default(workingArea,lastActiveFocus,{focusOptions}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var newActiveElement=document&&document.activeElement,allNodes=getFocusabledIn(workingArea),focusedIndex=allNodes.map(function(_ref2){var node=_ref2.node;return node}).indexOf(newActiveElement);focusedIndex>-1&&(allNodes.filter(function(_ref2){var guard=_ref2.guard,node=_ref2.node;return guard&&node.dataset.focusAutoGuard}).forEach(function(_ref3){var node=_ref3.node;return node.removeAttribute("tabIndex")}),autoGuard(focusedIndex,allNodes.length,1,allNodes),autoGuard(focusedIndex,-1,-1,allNodes))}}}return result},onTrap=function(event){activateTrap()&&event&&(event.stopPropagation(),event.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(event){var source=event.target,currentNode=event.currentTarget;currentNode.contains(source)||recordPortal(currentNode,source)},FocusWatcher=function(){return null},FocusTrap=function(_ref4){var children=_ref4.children;return React5.createElement("div",{onBlur,onFocus},children)};FocusTrap.propTypes={};var onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(propsList){return propsList.filter(function(_ref5){var disabled=_ref5.disabled;return!disabled})}function handleStateChangeOnClient(traps){var trap=traps.slice(-1)[0];trap&&!lastActiveTrap&&attachHandler();var lastTrap=lastActiveTrap,sameTrap=lastTrap&&trap&&trap.id===lastTrap.id;lastActiveTrap=trap,lastTrap&&!sameTrap&&(lastTrap.onDeactivation(),traps.filter(function(_ref6){var id=_ref6.id;return id===lastTrap.id}).length||lastTrap.returnFocus(!trap)),trap?(lastActiveFocus=null,(!sameTrap||lastTrap.observed!==trap.observed)&&trap.onActivation(),activateTrap(!0),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(cb){return cb({moveFocusInside:es2015_default,focusInside})});var Trap_default=index_es_default(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=React6.forwardRef(function(props,ref){return React6.createElement(Lock_default,_extends({sideCar:Trap_default,ref},props))}),_ref=Lock_default.propTypes||{},sideCar=_ref.sideCar,propTypes=_objectWithoutPropertiesLoose(_ref,["sideCar"]);FocusLockCombination.propTypes={};var Combination_default=FocusLockCombination;var es2015_default2=Combination_default;import*as React11 from"react";import*as React7 from"react";var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";var effectCar=createSidecarMedium();var nothing=function(){},RemoveScroll=React7.forwardRef(function(props,parentRef){var ref=React7.useRef(null),_a=React7.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),callbacks=_a[0],setCallbacks=_a[1],forwardProps=props.forwardProps,children=props.children,className=props.className,removeScrollBar=props.removeScrollBar,enabled=props.enabled,shards=props.shards,sideCar2=props.sideCar,noIsolation=props.noIsolation,inert=props.inert,allowPinchZoom=props.allowPinchZoom,_b=props.as,Container=_b===void 0?"div":_b,gapMode=props.gapMode,rest=__rest(props,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),SideCar2=sideCar2,containerRef=useMergeRefs([ref,parentRef]),containerProps=__assign(__assign({},rest),callbacks);return React7.createElement(React7.Fragment,null,enabled&&React7.createElement(SideCar2,{sideCar:effectCar,removeScrollBar,shards,noIsolation,inert,setCallbacks,allowPinchZoom:!!allowPinchZoom,lockRef:ref,gapMode}),forwardProps?React7.cloneElement(React7.Children.only(children),__assign(__assign({},containerProps),{ref:containerRef})):React7.createElement(Container,__assign({},containerProps,{className,ref:containerRef}),children))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};import*as React10 from"react";import*as React9 from"react";import*as React8 from"react";var currentNonce;var getNonce=function(){if(currentNonce)return currentNonce;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var tag=document.createElement("style");tag.type="text/css";var nonce=getNonce();return nonce&&tag.setAttribute("nonce",nonce),tag}function injectStyles(tag,css){tag.styleSheet?tag.styleSheet.cssText=css:tag.appendChild(document.createTextNode(css))}function insertStyleTag(tag){var head=document.head||document.getElementsByTagName("head")[0];head.appendChild(tag)}var stylesheetSingleton=function(){var counter=0,stylesheet=null;return{add:function(style){counter==0&&(stylesheet=makeStyleTag())&&(injectStyles(stylesheet,style),insertStyleTag(stylesheet)),counter++},remove:function(){counter--,!counter&&stylesheet&&(stylesheet.parentNode&&stylesheet.parentNode.removeChild(stylesheet),stylesheet=null)}}};var styleHookSingleton=function(){var sheet=stylesheetSingleton();return function(styles,isDynamic){React8.useEffect(function(){return sheet.add(styles),function(){sheet.remove()}},[styles&&isDynamic])}};var styleSingleton=function(){var useStyle=styleHookSingleton(),Sheet=function(_a){var styles=_a.styles,dynamic=_a.dynamic;return useStyle(styles,dynamic),null};return Sheet};var zeroGap={left:0,top:0,right:0,gap:0},parse=function(x){return parseInt(x||"",10)||0},getOffset=function(gapMode){var cs=window.getComputedStyle(document.body),left=cs[gapMode==="padding"?"paddingLeft":"marginLeft"],top=cs[gapMode==="padding"?"paddingTop":"marginTop"],right=cs[gapMode==="padding"?"paddingRight":"marginRight"];return[parse(left),parse(top),parse(right)]},getGapWidth=function(gapMode){if(gapMode===void 0&&(gapMode="margin"),typeof window>"u")return zeroGap;var offsets=getOffset(gapMode),documentWidth=document.documentElement.clientWidth,windowWidth=window.innerWidth;return{left:offsets[0],top:offsets[1],right:offsets[2],gap:Math.max(0,windowWidth-documentWidth+offsets[2]-offsets[0])}};var Style=styleSingleton(),getStyles=function(_a,allowRelative,gapMode,important){var left=_a.left,top=_a.top,right=_a.right,gap=_a.gap;return gapMode===void 0&&(gapMode="margin"),`
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return it=o[Symbol.iterator](),it.next.bind(it)}function assignRef(ref,value){if(ref!=null)if(isFunction(ref))ref(value);else try{ref.current=value}catch{throw new Error('Cannot assign value "'+value+'" to ref "'+ref+'"')}}function useComposedRefs(){for(var _len=arguments.length,refs=new Array(_len),_key=0;_key<_len;_key++)refs[_key]=arguments[_key];return useCallback2(function(node){for(var _iterator=_createForOfIteratorHelperLoose(refs),_step;!(_step=_iterator()).done;){var ref=_step.value;assignRef(ref,node)}},refs)}function composeEventHandlers(theirHandler,ourHandler){return function(event){if(theirHandler&&theirHandler(event),!event.defaultPrevented)return ourHandler(event)}}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}import*as React6 from"react";import*as React3 from"react";var FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef2(ref,value){return typeof ref=="function"?ref(value):ref&&(ref.current=value),ref}import{useState as useState2}from"react";function useCallbackRef(initialValue,callback){var ref=useState2(function(){return{value:initialValue,callback,facade:{get current(){return ref.value},set current(value){var last=ref.value;last!==value&&(ref.value=value,ref.callback(value,last))}}}})[0];return ref.callback=callback,ref.facade}function useMergeRefs(refs,defaultValue){return useCallbackRef(defaultValue||null,function(newValue){return refs.forEach(function(ref){return assignRef2(ref,newValue)})})}import{useEffect as useEffect5}from"react";import*as React from"react";var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},InFocusGuard=function(_ref2){var children=_ref2.children;return React.createElement(React.Fragment,null,React.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}),children,children&&React.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}))};InFocusGuard.propTypes={};InFocusGuard.defaultProps={children:null};var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t}function __spreadArray(to,from,pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++)(ar||!(i in from))&&(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))}function ItoI(a){return a}function innerCreateMedium(defaults,middleware){middleware===void 0&&(middleware=ItoI);var buffer=[],assigned=!1,medium={read:function(){if(assigned)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return buffer.length?buffer[buffer.length-1]:defaults},useMedium:function(data){var item=middleware(data,assigned);return buffer.push(item),function(){buffer=buffer.filter(function(x){return x!==item})}},assignSyncMedium:function(cb){for(assigned=!0;buffer.length;){var cbs=buffer;buffer=[],cbs.forEach(cb)}buffer={push:function(x){return cb(x)},filter:function(){return buffer}}},assignMedium:function(cb){assigned=!0;var pendingQueue=[];if(buffer.length){var cbs=buffer;buffer=[],cbs.forEach(cb),pendingQueue=buffer}var executeQueue=function(){var cbs2=pendingQueue;pendingQueue=[],cbs2.forEach(cb)},cycle=function(){return Promise.resolve().then(executeQueue)};cycle(),buffer={push:function(x){pendingQueue.push(x),cycle()},filter:function(filter){return pendingQueue=pendingQueue.filter(filter),buffer}}}};return medium}function createMedium(defaults,middleware){return middleware===void 0&&(middleware=ItoI),innerCreateMedium(defaults,middleware)}function createSidecarMedium(options){options===void 0&&(options={});var medium=innerCreateMedium(null);return medium.options=__assign({async:!0,ssr:!1},options),medium}import*as React2 from"react";var SideCar=function(_a){var sideCar2=_a.sideCar,rest=__rest(_a,["sideCar"]);if(!sideCar2)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var Target=sideCar2.read();if(!Target)throw new Error("Sidecar medium not found");return React2.createElement(Target,__assign({},rest))};SideCar.isSideCarExport=!0;function exportSidecar(medium,exported){return medium.useMedium(exported),SideCar}var mediumFocus=createMedium({},function(_ref2){var target=_ref2.target,currentTarget=_ref2.currentTarget;return{target,currentTarget}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0});var emptyArray=[],FocusLock=React3.forwardRef(function(props,parentRef){var _extends22,_React$useState=React3.useState(),realObserved=_React$useState[0],setObserved=_React$useState[1],observed=React3.useRef(),isActive=React3.useRef(!1),originalFocusedElement=React3.useRef(null),children=props.children,disabled=props.disabled,noFocusGuards=props.noFocusGuards,persistentFocus=props.persistentFocus,crossFrame=props.crossFrame,autoFocus=props.autoFocus,allowTextSelection=props.allowTextSelection,group=props.group,className=props.className,whiteList=props.whiteList,hasPositiveIndices=props.hasPositiveIndices,_props$shards=props.shards,shards=_props$shards===void 0?emptyArray:_props$shards,_props$as=props.as,Container=_props$as===void 0?"div":_props$as,_props$lockProps=props.lockProps,containerProps=_props$lockProps===void 0?{}:_props$lockProps,SideCar2=props.sideCar,shouldReturnFocus=props.returnFocus,focusOptions=props.focusOptions,onActivationCallback=props.onActivation,onDeactivationCallback=props.onDeactivation,_React$useState2=React3.useState({}),id=_React$useState2[0],onActivation=React3.useCallback(function(){originalFocusedElement.current=originalFocusedElement.current||document&&document.activeElement,observed.current&&onActivationCallback&&onActivationCallback(observed.current),isActive.current=!0},[onActivationCallback]),onDeactivation=React3.useCallback(function(){isActive.current=!1,onDeactivationCallback&&onDeactivationCallback(observed.current)},[onDeactivationCallback]);useEffect5(function(){disabled||(originalFocusedElement.current=null)},[]);var returnFocus=React3.useCallback(function(allowDefer){var returnFocusTo=originalFocusedElement.current;if(returnFocusTo&&returnFocusTo.focus){var howToReturnFocus=typeof shouldReturnFocus=="function"?shouldReturnFocus(returnFocusTo):shouldReturnFocus;if(howToReturnFocus){var returnFocusOptions=typeof howToReturnFocus=="object"?howToReturnFocus:void 0;originalFocusedElement.current=null,allowDefer?Promise.resolve().then(function(){return returnFocusTo.focus(returnFocusOptions)}):returnFocusTo.focus(returnFocusOptions)}}},[shouldReturnFocus]),onFocus3=React3.useCallback(function(event){isActive.current&&mediumFocus.useMedium(event)},[]),onBlur3=mediumBlur.useMedium,setObserveNode=React3.useCallback(function(newObserved){observed.current!==newObserved&&(observed.current=newObserved,setObserved(newObserved))},[]),lockProps=_extends((_extends22={},_extends22[FOCUS_DISABLED]=disabled&&"disabled",_extends22[FOCUS_GROUP]=group,_extends22),containerProps),hasLeadingGuards=noFocusGuards!==!0,hasTailingGuards=hasLeadingGuards&&noFocusGuards!=="tail",mergedRef=useMergeRefs([parentRef,setObserveNode]);return React3.createElement(React3.Fragment,null,hasLeadingGuards&&[React3.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}),hasPositiveIndices?React3.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:disabled?-1:1,style:hiddenGuard}):null],!disabled&&React3.createElement(SideCar2,{id,sideCar:mediumSidecar,observed:realObserved,disabled,persistentFocus,crossFrame,autoFocus,whiteList,shards,onActivation,onDeactivation,returnFocus,focusOptions}),React3.createElement(Container,_extends({ref:mergedRef},lockProps,{className,onBlur:onBlur3,onFocus:onFocus3}),children),hasTailingGuards&&React3.createElement("div",{"data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}))});FocusLock.propTypes={};FocusLock.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var Lock_default=FocusLock;import*as React5 from"react";function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _typeof(obj){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(obj2){return typeof obj2}:function(obj2){return obj2&&typeof Symbol=="function"&&obj2.constructor===Symbol&&obj2!==Symbol.prototype?"symbol":typeof obj2},_typeof(obj)}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return(hint==="string"?String:Number)(input)}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key)}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}import React4,{PureComponent}from"react";function withSideEffect(reducePropsToState2,handleStateChangeOnClient2){function getDisplayName(WrappedComponent){return WrappedComponent.displayName||WrappedComponent.name||"Component"}return function(WrappedComponent){var mountedInstances=[],state;function emitChange(){state=reducePropsToState2(mountedInstances.map(function(instance){return instance.props})),handleStateChangeOnClient2(state)}var SideEffect=function(_PureComponent){_inheritsLoose(SideEffect2,_PureComponent);function SideEffect2(){return _PureComponent.apply(this,arguments)||this}SideEffect2.peek=function(){return state};var _proto=SideEffect2.prototype;return _proto.componentDidMount=function(){mountedInstances.push(this),emitChange()},_proto.componentDidUpdate=function(){emitChange()},_proto.componentWillUnmount=function(){var index=mountedInstances.indexOf(this);mountedInstances.splice(index,1),emitChange()},_proto.render=function(){return React4.createElement(WrappedComponent,this.props)},SideEffect2}(PureComponent);return _defineProperty(SideEffect,"displayName","SideEffect("+getDisplayName(WrappedComponent)+")"),SideEffect}}var index_es_default=withSideEffect;var toArray=function(a){for(var ret=Array(a.length),i=0;i<a.length;++i)ret[i]=a[i];return ret},asArray=function(a){return Array.isArray(a)?a:[a]},getFirst=function(a){return Array.isArray(a)?a[0]:a};var isElementHidden=function(node){if(node.nodeType!==Node.ELEMENT_NODE)return!1;var computedStyle=window.getComputedStyle(node,null);return!computedStyle||!computedStyle.getPropertyValue?!1:computedStyle.getPropertyValue("display")==="none"||computedStyle.getPropertyValue("visibility")==="hidden"},getParentNode=function(node){return node.parentNode&&node.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?node.parentNode.host:node.parentNode},isTopNode=function(node){return node===document||node&&node.nodeType===Node.DOCUMENT_NODE},isVisibleUncached=function(node,checkParent){return!node||isTopNode(node)||!isElementHidden(node)&&checkParent(getParentNode(node))},isVisibleCached=function(visibilityCache,node){var cached=visibilityCache.get(node);if(cached!==void 0)return cached;var result=isVisibleUncached(node,isVisibleCached.bind(void 0,visibilityCache));return visibilityCache.set(node,result),result},isAutoFocusAllowedUncached=function(node,checkParent){return node&&!isTopNode(node)?isAutoFocusAllowed(node)?checkParent(getParentNode(node)):!1:!0},isAutoFocusAllowedCached=function(cache,node){var cached=cache.get(node);if(cached!==void 0)return cached;var result=isAutoFocusAllowedUncached(node,isAutoFocusAllowedCached.bind(void 0,cache));return cache.set(node,result),result},getDataset=function(node){return node.dataset},isHTMLButtonElement=function(node){return node.tagName==="BUTTON"},isHTMLInputElement=function(node){return node.tagName==="INPUT"},isRadioElement=function(node){return isHTMLInputElement(node)&&node.type==="radio"},notHiddenInput=function(node){return!((isHTMLInputElement(node)||isHTMLButtonElement(node))&&(node.type==="hidden"||node.disabled))},isAutoFocusAllowed=function(node){var attribute=node.getAttribute(FOCUS_NO_AUTOFOCUS);return![!0,"true",""].includes(attribute)},isGuard=function(node){var _a;return Boolean(node&&((_a=getDataset(node))===null||_a===void 0?void 0:_a.focusGuard))},isNotAGuard=function(node){return!isGuard(node)},isDefined=function(x){return Boolean(x)};var tabSort=function(a,b){var tabDiff=a.tabIndex-b.tabIndex,indexDiff=a.index-b.index;if(tabDiff){if(!a.tabIndex)return 1;if(!b.tabIndex)return-1}return tabDiff||indexDiff},orderByTabIndex=function(nodes,filterNegative,keepGuards){return toArray(nodes).map(function(node,index){return{node,index,tabIndex:keepGuards&&node.tabIndex===-1?(node.dataset||{}).focusGuard?0:-1:node.tabIndex}}).filter(function(data){return!filterNegative||data.tabIndex>=0}).sort(tabSort)};var tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"];var queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(parent,withGuards){return toArray((parent.shadowRoot||parent).children).reduce(function(acc,child){return acc.concat(child.matches(withGuards?queryGuardTabbables:queryTabbables)?[child]:[],getFocusablesWithShadowDom(child))},[])},getFocusablesWithIFrame=function(parent,withGuards){var _a;return parent instanceof HTMLIFrameElement&&((_a=parent.contentDocument)===null||_a===void 0?void 0:_a.body)?getFocusables([parent.contentDocument.body],withGuards):[parent]},getFocusables=function(parents,withGuards){return parents.reduce(function(acc,parent){var _a,focusableWithShadowDom=getFocusablesWithShadowDom(parent,withGuards),focusableWithIframes=(_a=[]).concat.apply(_a,focusableWithShadowDom.map(function(node){return getFocusablesWithIFrame(node,withGuards)}));return acc.concat(focusableWithIframes,parent.parentNode?toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function(node){return node===parent}):[])},[])},getParentAutofocusables=function(parent){var parentFocus=parent.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray(parentFocus).map(function(node){return getFocusables([node])}).reduce(function(acc,nodes){return acc.concat(nodes)},[])};var filterFocusable=function(nodes,visibilityCache){return toArray(nodes).filter(function(node){return isVisibleCached(visibilityCache,node)}).filter(function(node){return notHiddenInput(node)})},filterAutoFocusable=function(nodes,cache){return cache===void 0&&(cache=new Map),toArray(nodes).filter(function(node){return isAutoFocusAllowedCached(cache,node)})},getTabbableNodes=function(topNodes,visibilityCache,withGuards){return orderByTabIndex(filterFocusable(getFocusables(topNodes,withGuards),visibilityCache),!0,withGuards)},getAllTabbableNodes=function(topNodes,visibilityCache){return orderByTabIndex(filterFocusable(getFocusables(topNodes),visibilityCache),!1)},parentAutofocusables=function(topNode,visibilityCache){return filterFocusable(getParentAutofocusables(topNode),visibilityCache)},contains=function(scope,element){return scope.shadowRoot?contains(scope.shadowRoot,element):Object.getPrototypeOf(scope).contains!==void 0&&Object.getPrototypeOf(scope).contains.call(scope,element)?!0:toArray(scope.children).some(function(child){var _a;if(child instanceof HTMLIFrameElement){var iframeBody=(_a=child.contentDocument)===null||_a===void 0?void 0:_a.body;return iframeBody?contains(iframeBody,element):!1}return contains(child,element)})};var filterNested=function(nodes){for(var contained=new Set,l=nodes.length,i=0;i<l;i+=1)for(var j=i+1;j<l;j+=1){var position=nodes[i].compareDocumentPosition(nodes[j]);(position&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&contained.add(j),(position&Node.DOCUMENT_POSITION_CONTAINS)>0&&contained.add(i)}return nodes.filter(function(_,index){return!contained.has(index)})},getTopParent=function(node){return node.parentNode?getTopParent(node.parentNode):node},getAllAffectedNodes=function(node){var nodes=asArray(node);return nodes.filter(Boolean).reduce(function(acc,currentNode){var group=currentNode.getAttribute(FOCUS_GROUP);return acc.push.apply(acc,group?filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(group,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[currentNode]),acc},[])};var safeProbe=function(cb){try{return cb()}catch{return}};var getActiveElement=function(inDocument){if(inDocument===void 0&&(inDocument=document),!(!inDocument||!inDocument.activeElement)){var activeElement=inDocument.activeElement;return activeElement.shadowRoot?getActiveElement(activeElement.shadowRoot):activeElement instanceof HTMLIFrameElement&&safeProbe(function(){return activeElement.contentWindow.document})?getActiveElement(activeElement.contentWindow.document):activeElement}};var focusInFrame=function(frame,activeElement){return frame===activeElement},focusInsideIframe=function(topNode,activeElement){return Boolean(toArray(topNode.querySelectorAll("iframe")).some(function(node){return focusInFrame(node,activeElement)}))},focusInside=function(topNode,activeElement){return activeElement===void 0&&(activeElement=getActiveElement(getFirst(topNode).ownerDocument)),!activeElement||activeElement.dataset&&activeElement.dataset.focusGuard?!1:getAllAffectedNodes(topNode).some(function(node){return contains(node,activeElement)||focusInsideIframe(node,activeElement)})};var focusIsHidden=function(inDocument){inDocument===void 0&&(inDocument=document);var activeElement=getActiveElement(inDocument);return activeElement?toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(node){return contains(node,activeElement)}):!1};var findSelectedRadio=function(node,nodes){return nodes.filter(isRadioElement).filter(function(el){return el.name===node.name}).filter(function(el){return el.checked})[0]||node},correctNode=function(node,nodes){return isRadioElement(node)&&node.name?findSelectedRadio(node,nodes):node},correctNodes=function(nodes){var resultSet=new Set;return nodes.forEach(function(node){return resultSet.add(correctNode(node,nodes))}),nodes.filter(function(node){return resultSet.has(node)})};var pickFirstFocus=function(nodes){return nodes[0]&&nodes.length>1?correctNode(nodes[0],nodes):nodes[0]},pickFocusable=function(nodes,index){return nodes.length>1?nodes.indexOf(correctNode(nodes[index],nodes)):index};var NEW_FOCUS="NEW_FOCUS",newFocus=function(innerNodes,outerNodes,activeElement,lastNode){var cnt=innerNodes.length,firstFocus=innerNodes[0],lastFocus=innerNodes[cnt-1],isOnGuard=isGuard(activeElement);if(!(activeElement&&innerNodes.indexOf(activeElement)>=0)){var activeIndex=activeElement!==void 0?outerNodes.indexOf(activeElement):-1,lastIndex=lastNode?outerNodes.indexOf(lastNode):activeIndex,lastNodeInside=lastNode?innerNodes.indexOf(lastNode):-1,indexDiff=activeIndex-lastIndex,firstNodeIndex=outerNodes.indexOf(firstFocus),lastNodeIndex=outerNodes.indexOf(lastFocus),correctedNodes=correctNodes(outerNodes),correctedIndex=activeElement!==void 0?correctedNodes.indexOf(activeElement):-1,correctedIndexDiff=correctedIndex-(lastNode?correctedNodes.indexOf(lastNode):activeIndex),returnFirstNode=pickFocusable(innerNodes,0),returnLastNode=pickFocusable(innerNodes,cnt-1);if(activeIndex===-1||lastNodeInside===-1)return NEW_FOCUS;if(!indexDiff&&lastNodeInside>=0)return lastNodeInside;if(activeIndex<=firstNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnLastNode;if(activeIndex>=lastNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnFirstNode;if(indexDiff&&Math.abs(correctedIndexDiff)>1)return lastNodeInside;if(activeIndex<=firstNodeIndex)return returnLastNode;if(activeIndex>lastNodeIndex)return returnFirstNode;if(indexDiff)return Math.abs(indexDiff)>1?lastNodeInside:(cnt+lastNodeInside+indexDiff)%cnt}};var findAutoFocused=function(autoFocusables){return function(node){var _a,autofocus=(_a=getDataset(node))===null||_a===void 0?void 0:_a.autofocus;return node.autofocus||autofocus!==void 0&&autofocus!=="false"||autoFocusables.indexOf(node)>=0}},pickAutofocus=function(nodesIndexes,orderedNodes,groups){var nodes=nodesIndexes.map(function(_a){var node=_a.node;return node}),autoFocusable=filterAutoFocusable(nodes.filter(findAutoFocused(groups)));return autoFocusable&&autoFocusable.length?pickFirstFocus(autoFocusable):pickFirstFocus(filterAutoFocusable(orderedNodes))};var getParents=function(node,parents){return parents===void 0&&(parents=[]),parents.push(node),node.parentNode&&getParents(node.parentNode.host||node.parentNode,parents),parents},getCommonParent=function(nodeA,nodeB){for(var parentsA=getParents(nodeA),parentsB=getParents(nodeB),i=0;i<parentsA.length;i+=1){var currentParent=parentsA[i];if(parentsB.indexOf(currentParent)>=0)return currentParent}return!1},getTopCommonParent=function(baseActiveElement,leftEntry,rightEntries){var activeElements=asArray(baseActiveElement),leftEntries=asArray(leftEntry),activeElement=activeElements[0],topCommon=!1;return leftEntries.filter(Boolean).forEach(function(entry){topCommon=getCommonParent(topCommon||entry,entry)||topCommon,rightEntries.filter(Boolean).forEach(function(subEntry){var common=getCommonParent(activeElement,subEntry);common&&(!topCommon||contains(common,topCommon)?topCommon=common:topCommon=getCommonParent(common,topCommon))})}),topCommon},allParentAutofocusables=function(entries,visibilityCache){return entries.reduce(function(acc,node){return acc.concat(parentAutofocusables(node,visibilityCache))},[])};var reorderNodes=function(srcNodes,dstNodes){var remap=new Map;return dstNodes.forEach(function(entity){return remap.set(entity.node,entity)}),srcNodes.map(function(node){return remap.get(node)}).filter(isDefined)},getFocusMerge=function(topNode,lastNode){var activeElement=getActiveElement(asArray(topNode).length>0?document:getFirst(topNode).ownerDocument),entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(activeElement||topNode,topNode,entries),visibilityCache=new Map,anyFocusable=getAllTabbableNodes(entries,visibilityCache),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)});if(!(!innerElements[0]&&(innerElements=anyFocusable,!innerElements[0]))){var outerNodes=getAllTabbableNodes([commonParent],visibilityCache).map(function(_a){var node=_a.node;return node}),orderedInnerElements=reorderNodes(outerNodes,innerElements),innerNodes=orderedInnerElements.map(function(_a){var node=_a.node;return node}),newId=newFocus(innerNodes,outerNodes,activeElement,lastNode);if(newId===NEW_FOCUS){var focusNode=pickAutofocus(anyFocusable,innerNodes,allParentAutofocusables(entries,visibilityCache));if(focusNode)return{node:focusNode};console.warn("focus-lock: cannot find any node to move focus into");return}return newId===void 0?newId:orderedInnerElements[newId]}};var getFocusabledIn=function(topNode){var entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(topNode,topNode,entries),visibilityCache=new Map,outerNodes=getTabbableNodes([commonParent],visibilityCache,!0),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)}).map(function(_a){var node=_a.node;return node});return outerNodes.map(function(_a){var node=_a.node,index=_a.index;return{node,index,lockItem:innerElements.indexOf(node)>=0,guard:isGuard(node)}})};var focusOn=function(target,focusOptions){"focus"in target&&target.focus(focusOptions),"contentWindow"in target&&target.contentWindow&&target.contentWindow.focus()},guardCount=0,lockDisabled=!1,setFocus=function(topNode,lastNode,options){options===void 0&&(options={});var focusable=getFocusMerge(topNode,lastNode);if(!lockDisabled&&focusable){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(focusable.node,options.focusOptions),guardCount--}};var es2015_default=setFocus;function deferAction(action){setTimeout(action,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(activeElement){return(lastActiveTrap.whiteList||defaultWhitelist)(activeElement)},recordPortal=function(observerNode,portaledElement){lastPortaledElement={observerNode,portaledElement}},focusIsPortaledPair=function(element){return lastPortaledElement&&lastPortaledElement.portaledElement===element};function autoGuard(startIndex,end,step,allNodes){var lastGuard=null,i=startIndex;do{var item=allNodes[i];if(item.guard)item.node.dataset.focusAutoGuard&&(lastGuard=item);else if(item.lockItem){if(i!==startIndex)return;lastGuard=null}else break}while((i+=step)!==end);lastGuard&&(lastGuard.node.tabIndex=0)}var extractRef=function(ref){return ref&&"current"in ref?ref.current:ref},focusWasOutside=function(crossFrameOption){return crossFrameOption?Boolean(focusWasOutsideWindow):focusWasOutsideWindow==="meanwhile"},checkInHost=function checkInHost2(check,el,boundary){return el&&(el.host===check&&(!el.activeElement||boundary.contains(el.activeElement))||el.parentNode&&checkInHost2(check,el.parentNode,boundary))},withinHost=function(activeElement,workingArea){return workingArea.some(function(area){return checkInHost(activeElement,area,area)})},activateTrap=function(){var result=!1;if(lastActiveTrap){var _lastActiveTrap=lastActiveTrap,observed=_lastActiveTrap.observed,persistentFocus=_lastActiveTrap.persistentFocus,autoFocus=_lastActiveTrap.autoFocus,shards=_lastActiveTrap.shards,crossFrame=_lastActiveTrap.crossFrame,focusOptions=_lastActiveTrap.focusOptions,workingNode=observed||lastPortaledElement&&lastPortaledElement.portaledElement,activeElement=document&&document.activeElement;if(workingNode){var workingArea=[workingNode].concat(shards.map(extractRef).filter(Boolean));if((!activeElement||focusWhitelisted(activeElement))&&(persistentFocus||focusWasOutside(crossFrame)||!isFreeFocus()||!lastActiveFocus&&autoFocus)&&(workingNode&&!(focusInside(workingArea)||activeElement&&withinHost(activeElement,workingArea)||focusIsPortaledPair(activeElement,workingNode))&&(document&&!lastActiveFocus&&activeElement&&!autoFocus?(activeElement.blur&&activeElement.blur(),document.body.focus()):(result=es2015_default(workingArea,lastActiveFocus,{focusOptions}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var newActiveElement=document&&document.activeElement,allNodes=getFocusabledIn(workingArea),focusedIndex=allNodes.map(function(_ref2){var node=_ref2.node;return node}).indexOf(newActiveElement);focusedIndex>-1&&(allNodes.filter(function(_ref2){var guard=_ref2.guard,node=_ref2.node;return guard&&node.dataset.focusAutoGuard}).forEach(function(_ref3){var node=_ref3.node;return node.removeAttribute("tabIndex")}),autoGuard(focusedIndex,allNodes.length,1,allNodes),autoGuard(focusedIndex,-1,-1,allNodes))}}}return result},onTrap=function(event){activateTrap()&&event&&(event.stopPropagation(),event.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(event){var source=event.target,currentNode=event.currentTarget;currentNode.contains(source)||recordPortal(currentNode,source)},FocusWatcher=function(){return null},FocusTrap=function(_ref4){var children=_ref4.children;return React5.createElement("div",{onBlur,onFocus},children)};FocusTrap.propTypes={};var onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(propsList){return propsList.filter(function(_ref5){var disabled=_ref5.disabled;return!disabled})}function handleStateChangeOnClient(traps){var trap=traps.slice(-1)[0];trap&&!lastActiveTrap&&attachHandler();var lastTrap=lastActiveTrap,sameTrap=lastTrap&&trap&&trap.id===lastTrap.id;lastActiveTrap=trap,lastTrap&&!sameTrap&&(lastTrap.onDeactivation(),traps.filter(function(_ref6){var id=_ref6.id;return id===lastTrap.id}).length||lastTrap.returnFocus(!trap)),trap?(lastActiveFocus=null,(!sameTrap||lastTrap.observed!==trap.observed)&&trap.onActivation(),activateTrap(!0),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(cb){return cb({moveFocusInside:es2015_default,focusInside})});var Trap_default=index_es_default(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=React6.forwardRef(function(props,ref){return React6.createElement(Lock_default,_extends({sideCar:Trap_default,ref},props))}),_ref=Lock_default.propTypes||{},sideCar=_ref.sideCar,propTypes=_objectWithoutPropertiesLoose(_ref,["sideCar"]);FocusLockCombination.propTypes={};var Combination_default=FocusLockCombination;var es2015_default2=Combination_default;import*as React11 from"react";import*as React7 from"react";var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";var effectCar=createSidecarMedium();var nothing=function(){},RemoveScroll=React7.forwardRef(function(props,parentRef){var ref=React7.useRef(null),_a=React7.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),callbacks=_a[0],setCallbacks=_a[1],forwardProps=props.forwardProps,children=props.children,className=props.className,removeScrollBar=props.removeScrollBar,enabled=props.enabled,shards=props.shards,sideCar2=props.sideCar,noIsolation=props.noIsolation,inert=props.inert,allowPinchZoom=props.allowPinchZoom,_b=props.as,Container=_b===void 0?"div":_b,gapMode=props.gapMode,rest=__rest(props,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),SideCar2=sideCar2,containerRef=useMergeRefs([ref,parentRef]),containerProps=__assign(__assign({},rest),callbacks);return React7.createElement(React7.Fragment,null,enabled&&React7.createElement(SideCar2,{sideCar:effectCar,removeScrollBar,shards,noIsolation,inert,setCallbacks,allowPinchZoom:!!allowPinchZoom,lockRef:ref,gapMode}),forwardProps?React7.cloneElement(React7.Children.only(children),__assign(__assign({},containerProps),{ref:containerRef})):React7.createElement(Container,__assign({},containerProps,{className,ref:containerRef}),children))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};import*as React10 from"react";import*as React9 from"react";import*as React8 from"react";var currentNonce;var getNonce=function(){if(currentNonce)return currentNonce;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var tag=document.createElement("style");tag.type="text/css";var nonce=getNonce();return nonce&&tag.setAttribute("nonce",nonce),tag}function injectStyles(tag,css){tag.styleSheet?tag.styleSheet.cssText=css:tag.appendChild(document.createTextNode(css))}function insertStyleTag(tag){var head=document.head||document.getElementsByTagName("head")[0];head.appendChild(tag)}var stylesheetSingleton=function(){var counter=0,stylesheet=null;return{add:function(style){counter==0&&(stylesheet=makeStyleTag())&&(injectStyles(stylesheet,style),insertStyleTag(stylesheet)),counter++},remove:function(){counter--,!counter&&stylesheet&&(stylesheet.parentNode&&stylesheet.parentNode.removeChild(stylesheet),stylesheet=null)}}};var styleHookSingleton=function(){var sheet=stylesheetSingleton();return function(styles,isDynamic){React8.useEffect(function(){return sheet.add(styles),function(){sheet.remove()}},[styles&&isDynamic])}};var styleSingleton=function(){var useStyle=styleHookSingleton(),Sheet=function(_a){var styles=_a.styles,dynamic=_a.dynamic;return useStyle(styles,dynamic),null};return Sheet};var zeroGap={left:0,top:0,right:0,gap:0},parse=function(x){return parseInt(x||"",10)||0},getOffset=function(gapMode){var cs=window.getComputedStyle(document.body),left=cs[gapMode==="padding"?"paddingLeft":"marginLeft"],top=cs[gapMode==="padding"?"paddingTop":"marginTop"],right=cs[gapMode==="padding"?"paddingRight":"marginRight"];return[parse(left),parse(top),parse(right)]},getGapWidth=function(gapMode){if(gapMode===void 0&&(gapMode="margin"),typeof window>"u")return zeroGap;var offsets=getOffset(gapMode),documentWidth=document.documentElement.clientWidth,windowWidth=window.innerWidth;return{left:offsets[0],top:offsets[1],right:offsets[2],gap:Math.max(0,windowWidth-documentWidth+offsets[2]-offsets[0])}};var Style=styleSingleton(),getStyles=function(_a,allowRelative,gapMode,important){var left=_a.left,top=_a.top,right=_a.right,gap=_a.gap;return gapMode===void 0&&(gapMode="margin"),`
.`.concat(noScrollbarsClassName,` {

@@ -4,0 +4,0 @@ overflow: hidden `).concat(important,`;

"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_ReactPropTypesSecret=__commonJS({"../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports,module2){"use strict";var ReactPropTypesSecret="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";module2.exports=ReactPropTypesSecret}});var require_factoryWithThrowingShims=__commonJS({"../../../../node_modules/prop-types/factoryWithThrowingShims.js"(exports,module2){"use strict";var ReactPropTypesSecret=require_ReactPropTypesSecret();function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;module2.exports=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret!==ReactPropTypesSecret){var err=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw err.name="Invariant Violation",err}}shim.isRequired=shim;function getShim(){return shim}var ReactPropTypes={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ReactPropTypes.PropTypes=ReactPropTypes,ReactPropTypes}}});var require_prop_types=__commonJS({"../../../../node_modules/prop-types/index.js"(exports,module2){module2.exports=require_factoryWithThrowingShims()();var ReactIs,throwOnDirectAccess}});var src_exports={};__export(src_exports,{ModalDialogPrimitiveContent:()=>DialogContent,ModalDialogPrimitiveOverlay:()=>DialogOverlay});module.exports=__toCommonJS(src_exports);var import_react9=require("react");var import_react3=require("react");var import_react=require("react");function canUseDOM(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var useIsomorphicLayoutEffect=canUseDOM()?import_react.useLayoutEffect:import_react.useEffect;var import_react2=require("react");function useForceUpdate(){var _useState=(0,import_react2.useState)(Object.create(null)),dispatch=_useState[1];return(0,import_react2.useCallback)(function(){dispatch(Object.create(null))},[])}var import_react_dom=require("react-dom");var Portal=function(_ref2){var children=_ref2.children,_ref$type=_ref2.type,type=_ref$type===void 0?"reach-portal":_ref$type,containerRef=_ref2.containerRef,mountNode=(0,import_react3.useRef)(null),portalNode=(0,import_react3.useRef)(null),forceUpdate=useForceUpdate();return useIsomorphicLayoutEffect(function(){if(!!mountNode.current){var ownerDocument=mountNode.current.ownerDocument,body=containerRef?.current||ownerDocument.body;return portalNode.current=ownerDocument?.createElement(type),body.appendChild(portalNode.current),forceUpdate(),function(){portalNode.current&&body&&body.removeChild(portalNode.current)}}},[type,forceUpdate,containerRef]),portalNode.current?(0,import_react_dom.createPortal)(children,portalNode.current):(0,import_react3.createElement)("span",{ref:mountNode})};function getOwnerDocument(element){return canUseDOM()?element?element.ownerDocument:document:null}function isFunction(value){return!!(value&&{}.toString.call(value)=="[object Function]")}function noop(){}var import_react4=require("react");function useCheckStyles(packageName){if(!1)var name}var import_react5=require("react");function _arrayLikeToArray(arr,len){(len==null||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _unsupportedIterableToArray(o,minLen){if(!!o){if(typeof o=="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}}function _createForOfIteratorHelperLoose(o,allowArrayLike){var it;if(typeof Symbol>"u"||o[Symbol.iterator]==null){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length=="number"){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return it=o[Symbol.iterator](),it.next.bind(it)}function assignRef(ref,value){if(ref!=null)if(isFunction(ref))ref(value);else try{ref.current=value}catch{throw new Error('Cannot assign value "'+value+'" to ref "'+ref+'"')}}function useComposedRefs(){for(var _len=arguments.length,refs=new Array(_len),_key=0;_key<_len;_key++)refs[_key]=arguments[_key];return(0,import_react5.useCallback)(function(node){for(var _iterator=_createForOfIteratorHelperLoose(refs),_step;!(_step=_iterator()).done;){var ref=_step.value;assignRef(ref,node)}},refs)}function composeEventHandlers(theirHandler,ourHandler){return function(event){if(theirHandler&&theirHandler(event),!event.defaultPrevented)return ourHandler(event)}}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}var React6=__toESM(require("react"));var React3=__toESM(require("react"));var FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef2(ref,value){return typeof ref=="function"?ref(value):ref&&(ref.current=value),ref}var import_react6=require("react");function useCallbackRef(initialValue,callback){var ref=(0,import_react6.useState)(function(){return{value:initialValue,callback,facade:{get current(){return ref.value},set current(value){var last=ref.value;last!==value&&(ref.value=value,ref.callback(value,last))}}}})[0];return ref.callback=callback,ref.facade}function useMergeRefs(refs,defaultValue){return useCallbackRef(defaultValue||null,function(newValue){return refs.forEach(function(ref){return assignRef2(ref,newValue)})})}var import_react7=require("react");var React=__toESM(require("react"));var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},InFocusGuard=function(_ref2){var children=_ref2.children;return React.createElement(React.Fragment,null,React.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}),children,children&&React.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}))};InFocusGuard.propTypes={};InFocusGuard.defaultProps={children:null};var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t}function __spreadArray(to,from,pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++)(ar||!(i in from))&&(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))}function ItoI(a){return a}function innerCreateMedium(defaults,middleware){middleware===void 0&&(middleware=ItoI);var buffer=[],assigned=!1,medium={read:function(){if(assigned)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return buffer.length?buffer[buffer.length-1]:defaults},useMedium:function(data){var item=middleware(data,assigned);return buffer.push(item),function(){buffer=buffer.filter(function(x){return x!==item})}},assignSyncMedium:function(cb){for(assigned=!0;buffer.length;){var cbs=buffer;buffer=[],cbs.forEach(cb)}buffer={push:function(x){return cb(x)},filter:function(){return buffer}}},assignMedium:function(cb){assigned=!0;var pendingQueue=[];if(buffer.length){var cbs=buffer;buffer=[],cbs.forEach(cb),pendingQueue=buffer}var executeQueue=function(){var cbs2=pendingQueue;pendingQueue=[],cbs2.forEach(cb)},cycle=function(){return Promise.resolve().then(executeQueue)};cycle(),buffer={push:function(x){pendingQueue.push(x),cycle()},filter:function(filter){return pendingQueue=pendingQueue.filter(filter),buffer}}}};return medium}function createMedium(defaults,middleware){return middleware===void 0&&(middleware=ItoI),innerCreateMedium(defaults,middleware)}function createSidecarMedium(options){options===void 0&&(options={});var medium=innerCreateMedium(null);return medium.options=__assign({async:!0,ssr:!1},options),medium}var React2=__toESM(require("react")),SideCar=function(_a){var sideCar2=_a.sideCar,rest=__rest(_a,["sideCar"]);if(!sideCar2)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var Target=sideCar2.read();if(!Target)throw new Error("Sidecar medium not found");return React2.createElement(Target,__assign({},rest))};SideCar.isSideCarExport=!0;function exportSidecar(medium,exported){return medium.useMedium(exported),SideCar}var mediumFocus=createMedium({},function(_ref2){var target=_ref2.target,currentTarget=_ref2.currentTarget;return{target,currentTarget}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0});var emptyArray=[],FocusLock=React3.forwardRef(function(props,parentRef){var _extends22,_React$useState=React3.useState(),realObserved=_React$useState[0],setObserved=_React$useState[1],observed=React3.useRef(),isActive=React3.useRef(!1),originalFocusedElement=React3.useRef(null),children=props.children,disabled=props.disabled,noFocusGuards=props.noFocusGuards,persistentFocus=props.persistentFocus,crossFrame=props.crossFrame,autoFocus=props.autoFocus,allowTextSelection=props.allowTextSelection,group=props.group,className=props.className,whiteList=props.whiteList,hasPositiveIndices=props.hasPositiveIndices,_props$shards=props.shards,shards=_props$shards===void 0?emptyArray:_props$shards,_props$as=props.as,Container=_props$as===void 0?"div":_props$as,_props$lockProps=props.lockProps,containerProps=_props$lockProps===void 0?{}:_props$lockProps,SideCar2=props.sideCar,shouldReturnFocus=props.returnFocus,focusOptions=props.focusOptions,onActivationCallback=props.onActivation,onDeactivationCallback=props.onDeactivation,_React$useState2=React3.useState({}),id=_React$useState2[0],onActivation=React3.useCallback(function(){originalFocusedElement.current=originalFocusedElement.current||document&&document.activeElement,observed.current&&onActivationCallback&&onActivationCallback(observed.current),isActive.current=!0},[onActivationCallback]),onDeactivation=React3.useCallback(function(){isActive.current=!1,onDeactivationCallback&&onDeactivationCallback(observed.current)},[onDeactivationCallback]);(0,import_react7.useEffect)(function(){disabled||(originalFocusedElement.current=null)},[]);var returnFocus=React3.useCallback(function(allowDefer){var returnFocusTo=originalFocusedElement.current;if(returnFocusTo&&returnFocusTo.focus){var howToReturnFocus=typeof shouldReturnFocus=="function"?shouldReturnFocus(returnFocusTo):shouldReturnFocus;if(howToReturnFocus){var returnFocusOptions=typeof howToReturnFocus=="object"?howToReturnFocus:void 0;originalFocusedElement.current=null,allowDefer?Promise.resolve().then(function(){return returnFocusTo.focus(returnFocusOptions)}):returnFocusTo.focus(returnFocusOptions)}}},[shouldReturnFocus]),onFocus3=React3.useCallback(function(event){isActive.current&&mediumFocus.useMedium(event)},[]),onBlur3=mediumBlur.useMedium,setObserveNode=React3.useCallback(function(newObserved){observed.current!==newObserved&&(observed.current=newObserved,setObserved(newObserved))},[]),lockProps=_extends((_extends22={},_extends22[FOCUS_DISABLED]=disabled&&"disabled",_extends22[FOCUS_GROUP]=group,_extends22),containerProps),hasLeadingGuards=noFocusGuards!==!0,hasTailingGuards=hasLeadingGuards&&noFocusGuards!=="tail",mergedRef=useMergeRefs([parentRef,setObserveNode]);return React3.createElement(React3.Fragment,null,hasLeadingGuards&&[React3.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}),hasPositiveIndices?React3.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:disabled?-1:1,style:hiddenGuard}):null],!disabled&&React3.createElement(SideCar2,{id,sideCar:mediumSidecar,observed:realObserved,disabled,persistentFocus,crossFrame,autoFocus,whiteList,shards,onActivation,onDeactivation,returnFocus,focusOptions}),React3.createElement(Container,_extends({ref:mergedRef},lockProps,{className,onBlur:onBlur3,onFocus:onFocus3}),children),hasTailingGuards&&React3.createElement("div",{"data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}))});FocusLock.propTypes={};FocusLock.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var Lock_default=FocusLock;var React5=__toESM(require("react"));function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf||function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var import_react8=__toESM(require("react"));function withSideEffect(reducePropsToState2,handleStateChangeOnClient2){function getDisplayName(WrappedComponent){return WrappedComponent.displayName||WrappedComponent.name||"Component"}return function(WrappedComponent){var mountedInstances=[],state;function emitChange(){state=reducePropsToState2(mountedInstances.map(function(instance){return instance.props})),handleStateChangeOnClient2(state)}var SideEffect=function(_PureComponent){_inheritsLoose(SideEffect2,_PureComponent);function SideEffect2(){return _PureComponent.apply(this,arguments)||this}SideEffect2.peek=function(){return state};var _proto=SideEffect2.prototype;return _proto.componentDidMount=function(){mountedInstances.push(this),emitChange()},_proto.componentDidUpdate=function(){emitChange()},_proto.componentWillUnmount=function(){var index=mountedInstances.indexOf(this);mountedInstances.splice(index,1),emitChange()},_proto.render=function(){return import_react8.default.createElement(WrappedComponent,this.props)},SideEffect2}(import_react8.PureComponent);return _defineProperty(SideEffect,"displayName","SideEffect("+getDisplayName(WrappedComponent)+")"),SideEffect}}var index_es_default=withSideEffect;var toArray=function(a){for(var ret=Array(a.length),i=0;i<a.length;++i)ret[i]=a[i];return ret},asArray=function(a){return Array.isArray(a)?a:[a]},getFirst=function(a){return Array.isArray(a)?a[0]:a};var isElementHidden=function(node){if(node.nodeType!==Node.ELEMENT_NODE)return!1;var computedStyle=window.getComputedStyle(node,null);return!computedStyle||!computedStyle.getPropertyValue?!1:computedStyle.getPropertyValue("display")==="none"||computedStyle.getPropertyValue("visibility")==="hidden"},getParentNode=function(node){return node.parentNode&&node.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?node.parentNode.host:node.parentNode},isTopNode=function(node){return node===document||node&&node.nodeType===Node.DOCUMENT_NODE},isVisibleUncached=function(node,checkParent){return!node||isTopNode(node)||!isElementHidden(node)&&checkParent(getParentNode(node))},isVisibleCached=function(visibilityCache,node){var cached=visibilityCache.get(node);if(cached!==void 0)return cached;var result=isVisibleUncached(node,isVisibleCached.bind(void 0,visibilityCache));return visibilityCache.set(node,result),result},isAutoFocusAllowedUncached=function(node,checkParent){return node&&!isTopNode(node)?isAutoFocusAllowed(node)?checkParent(getParentNode(node)):!1:!0},isAutoFocusAllowedCached=function(cache,node){var cached=cache.get(node);if(cached!==void 0)return cached;var result=isAutoFocusAllowedUncached(node,isAutoFocusAllowedCached.bind(void 0,cache));return cache.set(node,result),result},getDataset=function(node){return node.dataset},isHTMLButtonElement=function(node){return node.tagName==="BUTTON"},isHTMLInputElement=function(node){return node.tagName==="INPUT"},isRadioElement=function(node){return isHTMLInputElement(node)&&node.type==="radio"},notHiddenInput=function(node){return!((isHTMLInputElement(node)||isHTMLButtonElement(node))&&(node.type==="hidden"||node.disabled))},isAutoFocusAllowed=function(node){var attribute=node.getAttribute(FOCUS_NO_AUTOFOCUS);return![!0,"true",""].includes(attribute)},isGuard=function(node){var _a;return Boolean(node&&((_a=getDataset(node))===null||_a===void 0?void 0:_a.focusGuard))},isNotAGuard=function(node){return!isGuard(node)},isDefined=function(x){return Boolean(x)};var tabSort=function(a,b){var tabDiff=a.tabIndex-b.tabIndex,indexDiff=a.index-b.index;if(tabDiff){if(!a.tabIndex)return 1;if(!b.tabIndex)return-1}return tabDiff||indexDiff},orderByTabIndex=function(nodes,filterNegative,keepGuards){return toArray(nodes).map(function(node,index){return{node,index,tabIndex:keepGuards&&node.tabIndex===-1?(node.dataset||{}).focusGuard?0:-1:node.tabIndex}}).filter(function(data){return!filterNegative||data.tabIndex>=0}).sort(tabSort)};var tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"];var queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(parent,withGuards){return toArray((parent.shadowRoot||parent).children).reduce(function(acc,child){return acc.concat(child.matches(withGuards?queryGuardTabbables:queryTabbables)?[child]:[],getFocusablesWithShadowDom(child))},[])},getFocusablesWithIFrame=function(parent,withGuards){var _a;return parent instanceof HTMLIFrameElement&&((_a=parent.contentDocument)===null||_a===void 0?void 0:_a.body)?getFocusables([parent.contentDocument.body],withGuards):[parent]},getFocusables=function(parents,withGuards){return parents.reduce(function(acc,parent){var _a,focusableWithShadowDom=getFocusablesWithShadowDom(parent,withGuards),focusableWithIframes=(_a=[]).concat.apply(_a,focusableWithShadowDom.map(function(node){return getFocusablesWithIFrame(node,withGuards)}));return acc.concat(focusableWithIframes,parent.parentNode?toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function(node){return node===parent}):[])},[])},getParentAutofocusables=function(parent){var parentFocus=parent.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray(parentFocus).map(function(node){return getFocusables([node])}).reduce(function(acc,nodes){return acc.concat(nodes)},[])};var filterFocusable=function(nodes,visibilityCache){return toArray(nodes).filter(function(node){return isVisibleCached(visibilityCache,node)}).filter(function(node){return notHiddenInput(node)})},filterAutoFocusable=function(nodes,cache){return cache===void 0&&(cache=new Map),toArray(nodes).filter(function(node){return isAutoFocusAllowedCached(cache,node)})},getTabbableNodes=function(topNodes,visibilityCache,withGuards){return orderByTabIndex(filterFocusable(getFocusables(topNodes,withGuards),visibilityCache),!0,withGuards)},getAllTabbableNodes=function(topNodes,visibilityCache){return orderByTabIndex(filterFocusable(getFocusables(topNodes),visibilityCache),!1)},parentAutofocusables=function(topNode,visibilityCache){return filterFocusable(getParentAutofocusables(topNode),visibilityCache)},contains=function(scope,element){return scope.shadowRoot?contains(scope.shadowRoot,element):Object.getPrototypeOf(scope).contains!==void 0&&Object.getPrototypeOf(scope).contains.call(scope,element)?!0:toArray(scope.children).some(function(child){var _a;if(child instanceof HTMLIFrameElement){var iframeBody=(_a=child.contentDocument)===null||_a===void 0?void 0:_a.body;return iframeBody?contains(iframeBody,element):!1}return contains(child,element)})};var filterNested=function(nodes){for(var contained=new Set,l=nodes.length,i=0;i<l;i+=1)for(var j=i+1;j<l;j+=1){var position=nodes[i].compareDocumentPosition(nodes[j]);(position&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&contained.add(j),(position&Node.DOCUMENT_POSITION_CONTAINS)>0&&contained.add(i)}return nodes.filter(function(_,index){return!contained.has(index)})},getTopParent=function(node){return node.parentNode?getTopParent(node.parentNode):node},getAllAffectedNodes=function(node){var nodes=asArray(node);return nodes.filter(Boolean).reduce(function(acc,currentNode){var group=currentNode.getAttribute(FOCUS_GROUP);return acc.push.apply(acc,group?filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(group,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[currentNode]),acc},[])};var safeProbe=function(cb){try{return cb()}catch{return}};var getActiveElement=function(inDocument){if(inDocument===void 0&&(inDocument=document),!(!inDocument||!inDocument.activeElement)){var activeElement=inDocument.activeElement;return activeElement.shadowRoot?getActiveElement(activeElement.shadowRoot):activeElement instanceof HTMLIFrameElement&&safeProbe(function(){return activeElement.contentWindow.document})?getActiveElement(activeElement.contentWindow.document):activeElement}};var focusInFrame=function(frame,activeElement){return frame===activeElement},focusInsideIframe=function(topNode,activeElement){return Boolean(toArray(topNode.querySelectorAll("iframe")).some(function(node){return focusInFrame(node,activeElement)}))},focusInside=function(topNode,activeElement){return activeElement===void 0&&(activeElement=getActiveElement(getFirst(topNode).ownerDocument)),!activeElement||activeElement.dataset&&activeElement.dataset.focusGuard?!1:getAllAffectedNodes(topNode).some(function(node){return contains(node,activeElement)||focusInsideIframe(node,activeElement)})};var focusIsHidden=function(inDocument){inDocument===void 0&&(inDocument=document);var activeElement=getActiveElement(inDocument);return activeElement?toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(node){return contains(node,activeElement)}):!1};var findSelectedRadio=function(node,nodes){return nodes.filter(isRadioElement).filter(function(el){return el.name===node.name}).filter(function(el){return el.checked})[0]||node},correctNode=function(node,nodes){return isRadioElement(node)&&node.name?findSelectedRadio(node,nodes):node},correctNodes=function(nodes){var resultSet=new Set;return nodes.forEach(function(node){return resultSet.add(correctNode(node,nodes))}),nodes.filter(function(node){return resultSet.has(node)})};var pickFirstFocus=function(nodes){return nodes[0]&&nodes.length>1?correctNode(nodes[0],nodes):nodes[0]},pickFocusable=function(nodes,index){return nodes.length>1?nodes.indexOf(correctNode(nodes[index],nodes)):index};var NEW_FOCUS="NEW_FOCUS",newFocus=function(innerNodes,outerNodes,activeElement,lastNode){var cnt=innerNodes.length,firstFocus=innerNodes[0],lastFocus=innerNodes[cnt-1],isOnGuard=isGuard(activeElement);if(!(activeElement&&innerNodes.indexOf(activeElement)>=0)){var activeIndex=activeElement!==void 0?outerNodes.indexOf(activeElement):-1,lastIndex=lastNode?outerNodes.indexOf(lastNode):activeIndex,lastNodeInside=lastNode?innerNodes.indexOf(lastNode):-1,indexDiff=activeIndex-lastIndex,firstNodeIndex=outerNodes.indexOf(firstFocus),lastNodeIndex=outerNodes.indexOf(lastFocus),correctedNodes=correctNodes(outerNodes),correctedIndex=activeElement!==void 0?correctedNodes.indexOf(activeElement):-1,correctedIndexDiff=correctedIndex-(lastNode?correctedNodes.indexOf(lastNode):activeIndex),returnFirstNode=pickFocusable(innerNodes,0),returnLastNode=pickFocusable(innerNodes,cnt-1);if(activeIndex===-1||lastNodeInside===-1)return NEW_FOCUS;if(!indexDiff&&lastNodeInside>=0)return lastNodeInside;if(activeIndex<=firstNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnLastNode;if(activeIndex>=lastNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnFirstNode;if(indexDiff&&Math.abs(correctedIndexDiff)>1)return lastNodeInside;if(activeIndex<=firstNodeIndex)return returnLastNode;if(activeIndex>lastNodeIndex)return returnFirstNode;if(indexDiff)return Math.abs(indexDiff)>1?lastNodeInside:(cnt+lastNodeInside+indexDiff)%cnt}};var findAutoFocused=function(autoFocusables){return function(node){var _a,autofocus=(_a=getDataset(node))===null||_a===void 0?void 0:_a.autofocus;return node.autofocus||autofocus!==void 0&&autofocus!=="false"||autoFocusables.indexOf(node)>=0}},pickAutofocus=function(nodesIndexes,orderedNodes,groups){var nodes=nodesIndexes.map(function(_a){var node=_a.node;return node}),autoFocusable=filterAutoFocusable(nodes.filter(findAutoFocused(groups)));return autoFocusable&&autoFocusable.length?pickFirstFocus(autoFocusable):pickFirstFocus(filterAutoFocusable(orderedNodes))};var getParents=function(node,parents){return parents===void 0&&(parents=[]),parents.push(node),node.parentNode&&getParents(node.parentNode.host||node.parentNode,parents),parents},getCommonParent=function(nodeA,nodeB){for(var parentsA=getParents(nodeA),parentsB=getParents(nodeB),i=0;i<parentsA.length;i+=1){var currentParent=parentsA[i];if(parentsB.indexOf(currentParent)>=0)return currentParent}return!1},getTopCommonParent=function(baseActiveElement,leftEntry,rightEntries){var activeElements=asArray(baseActiveElement),leftEntries=asArray(leftEntry),activeElement=activeElements[0],topCommon=!1;return leftEntries.filter(Boolean).forEach(function(entry){topCommon=getCommonParent(topCommon||entry,entry)||topCommon,rightEntries.filter(Boolean).forEach(function(subEntry){var common=getCommonParent(activeElement,subEntry);common&&(!topCommon||contains(common,topCommon)?topCommon=common:topCommon=getCommonParent(common,topCommon))})}),topCommon},allParentAutofocusables=function(entries,visibilityCache){return entries.reduce(function(acc,node){return acc.concat(parentAutofocusables(node,visibilityCache))},[])};var reorderNodes=function(srcNodes,dstNodes){var remap=new Map;return dstNodes.forEach(function(entity){return remap.set(entity.node,entity)}),srcNodes.map(function(node){return remap.get(node)}).filter(isDefined)},getFocusMerge=function(topNode,lastNode){var activeElement=getActiveElement(asArray(topNode).length>0?document:getFirst(topNode).ownerDocument),entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(activeElement||topNode,topNode,entries),visibilityCache=new Map,anyFocusable=getAllTabbableNodes(entries,visibilityCache),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)});if(!(!innerElements[0]&&(innerElements=anyFocusable,!innerElements[0]))){var outerNodes=getAllTabbableNodes([commonParent],visibilityCache).map(function(_a){var node=_a.node;return node}),orderedInnerElements=reorderNodes(outerNodes,innerElements),innerNodes=orderedInnerElements.map(function(_a){var node=_a.node;return node}),newId=newFocus(innerNodes,outerNodes,activeElement,lastNode);if(newId===NEW_FOCUS){var focusNode=pickAutofocus(anyFocusable,innerNodes,allParentAutofocusables(entries,visibilityCache));if(focusNode)return{node:focusNode};console.warn("focus-lock: cannot find any node to move focus into");return}return newId===void 0?newId:orderedInnerElements[newId]}};var getFocusabledIn=function(topNode){var entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(topNode,topNode,entries),visibilityCache=new Map,outerNodes=getTabbableNodes([commonParent],visibilityCache,!0),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)}).map(function(_a){var node=_a.node;return node});return outerNodes.map(function(_a){var node=_a.node,index=_a.index;return{node,index,lockItem:innerElements.indexOf(node)>=0,guard:isGuard(node)}})};var focusOn=function(target,focusOptions){"focus"in target&&target.focus(focusOptions),"contentWindow"in target&&target.contentWindow&&target.contentWindow.focus()},guardCount=0,lockDisabled=!1,setFocus=function(topNode,lastNode,options){options===void 0&&(options={});var focusable=getFocusMerge(topNode,lastNode);if(!lockDisabled&&focusable){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(focusable.node,options.focusOptions),guardCount--}};var es2015_default=setFocus;function deferAction(action){setTimeout(action,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(activeElement){return(lastActiveTrap.whiteList||defaultWhitelist)(activeElement)},recordPortal=function(observerNode,portaledElement){lastPortaledElement={observerNode,portaledElement}},focusIsPortaledPair=function(element){return lastPortaledElement&&lastPortaledElement.portaledElement===element};function autoGuard(startIndex,end,step,allNodes){var lastGuard=null,i=startIndex;do{var item=allNodes[i];if(item.guard)item.node.dataset.focusAutoGuard&&(lastGuard=item);else if(item.lockItem){if(i!==startIndex)return;lastGuard=null}else break}while((i+=step)!==end);lastGuard&&(lastGuard.node.tabIndex=0)}var extractRef=function(ref){return ref&&"current"in ref?ref.current:ref},focusWasOutside=function(crossFrameOption){return crossFrameOption?Boolean(focusWasOutsideWindow):focusWasOutsideWindow==="meanwhile"},checkInHost=function checkInHost2(check,el,boundary){return el&&(el.host===check&&(!el.activeElement||boundary.contains(el.activeElement))||el.parentNode&&checkInHost2(check,el.parentNode,boundary))},withinHost=function(activeElement,workingArea){return workingArea.some(function(area){return checkInHost(activeElement,area,area)})},activateTrap=function(){var result=!1;if(lastActiveTrap){var _lastActiveTrap=lastActiveTrap,observed=_lastActiveTrap.observed,persistentFocus=_lastActiveTrap.persistentFocus,autoFocus=_lastActiveTrap.autoFocus,shards=_lastActiveTrap.shards,crossFrame=_lastActiveTrap.crossFrame,focusOptions=_lastActiveTrap.focusOptions,workingNode=observed||lastPortaledElement&&lastPortaledElement.portaledElement,activeElement=document&&document.activeElement;if(workingNode){var workingArea=[workingNode].concat(shards.map(extractRef).filter(Boolean));if((!activeElement||focusWhitelisted(activeElement))&&(persistentFocus||focusWasOutside(crossFrame)||!isFreeFocus()||!lastActiveFocus&&autoFocus)&&(workingNode&&!(focusInside(workingArea)||activeElement&&withinHost(activeElement,workingArea)||focusIsPortaledPair(activeElement,workingNode))&&(document&&!lastActiveFocus&&activeElement&&!autoFocus?(activeElement.blur&&activeElement.blur(),document.body.focus()):(result=es2015_default(workingArea,lastActiveFocus,{focusOptions}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var newActiveElement=document&&document.activeElement,allNodes=getFocusabledIn(workingArea),focusedIndex=allNodes.map(function(_ref2){var node=_ref2.node;return node}).indexOf(newActiveElement);focusedIndex>-1&&(allNodes.filter(function(_ref2){var guard=_ref2.guard,node=_ref2.node;return guard&&node.dataset.focusAutoGuard}).forEach(function(_ref3){var node=_ref3.node;return node.removeAttribute("tabIndex")}),autoGuard(focusedIndex,allNodes.length,1,allNodes),autoGuard(focusedIndex,-1,-1,allNodes))}}}return result},onTrap=function(event){activateTrap()&&event&&(event.stopPropagation(),event.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(event){var source=event.target,currentNode=event.currentTarget;currentNode.contains(source)||recordPortal(currentNode,source)},FocusWatcher=function(){return null},FocusTrap=function(_ref4){var children=_ref4.children;return React5.createElement("div",{onBlur,onFocus},children)};FocusTrap.propTypes={};var onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(propsList){return propsList.filter(function(_ref5){var disabled=_ref5.disabled;return!disabled})}function handleStateChangeOnClient(traps){var trap=traps.slice(-1)[0];trap&&!lastActiveTrap&&attachHandler();var lastTrap=lastActiveTrap,sameTrap=lastTrap&&trap&&trap.id===lastTrap.id;lastActiveTrap=trap,lastTrap&&!sameTrap&&(lastTrap.onDeactivation(),traps.filter(function(_ref6){var id=_ref6.id;return id===lastTrap.id}).length||lastTrap.returnFocus(!trap)),trap?(lastActiveFocus=null,(!sameTrap||lastTrap.observed!==trap.observed)&&trap.onActivation(),activateTrap(!0),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(cb){return cb({moveFocusInside:es2015_default,focusInside})});var Trap_default=index_es_default(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=React6.forwardRef(function(props,ref){return React6.createElement(Lock_default,_extends({sideCar:Trap_default,ref},props))}),_ref=Lock_default.propTypes||{},sideCar=_ref.sideCar,propTypes=_objectWithoutPropertiesLoose(_ref,["sideCar"]);FocusLockCombination.propTypes={};var Combination_default=FocusLockCombination;var es2015_default2=Combination_default;var React11=__toESM(require("react"));var React7=__toESM(require("react"));var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";var effectCar=createSidecarMedium();var nothing=function(){},RemoveScroll=React7.forwardRef(function(props,parentRef){var ref=React7.useRef(null),_a=React7.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),callbacks=_a[0],setCallbacks=_a[1],forwardProps=props.forwardProps,children=props.children,className=props.className,removeScrollBar=props.removeScrollBar,enabled=props.enabled,shards=props.shards,sideCar2=props.sideCar,noIsolation=props.noIsolation,inert=props.inert,allowPinchZoom=props.allowPinchZoom,_b=props.as,Container=_b===void 0?"div":_b,gapMode=props.gapMode,rest=__rest(props,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),SideCar2=sideCar2,containerRef=useMergeRefs([ref,parentRef]),containerProps=__assign(__assign({},rest),callbacks);return React7.createElement(React7.Fragment,null,enabled&&React7.createElement(SideCar2,{sideCar:effectCar,removeScrollBar,shards,noIsolation,inert,setCallbacks,allowPinchZoom:!!allowPinchZoom,lockRef:ref,gapMode}),forwardProps?React7.cloneElement(React7.Children.only(children),__assign(__assign({},containerProps),{ref:containerRef})):React7.createElement(Container,__assign({},containerProps,{className,ref:containerRef}),children))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var React10=__toESM(require("react"));var React9=__toESM(require("react"));var React8=__toESM(require("react"));var currentNonce;var getNonce=function(){if(currentNonce)return currentNonce;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var tag=document.createElement("style");tag.type="text/css";var nonce=getNonce();return nonce&&tag.setAttribute("nonce",nonce),tag}function injectStyles(tag,css){tag.styleSheet?tag.styleSheet.cssText=css:tag.appendChild(document.createTextNode(css))}function insertStyleTag(tag){var head=document.head||document.getElementsByTagName("head")[0];head.appendChild(tag)}var stylesheetSingleton=function(){var counter=0,stylesheet=null;return{add:function(style){counter==0&&(stylesheet=makeStyleTag())&&(injectStyles(stylesheet,style),insertStyleTag(stylesheet)),counter++},remove:function(){counter--,!counter&&stylesheet&&(stylesheet.parentNode&&stylesheet.parentNode.removeChild(stylesheet),stylesheet=null)}}};var styleHookSingleton=function(){var sheet=stylesheetSingleton();return function(styles,isDynamic){React8.useEffect(function(){return sheet.add(styles),function(){sheet.remove()}},[styles&&isDynamic])}};var styleSingleton=function(){var useStyle=styleHookSingleton(),Sheet=function(_a){var styles=_a.styles,dynamic=_a.dynamic;return useStyle(styles,dynamic),null};return Sheet};var zeroGap={left:0,top:0,right:0,gap:0},parse=function(x){return parseInt(x||"",10)||0},getOffset=function(gapMode){var cs=window.getComputedStyle(document.body),left=cs[gapMode==="padding"?"paddingLeft":"marginLeft"],top=cs[gapMode==="padding"?"paddingTop":"marginTop"],right=cs[gapMode==="padding"?"paddingRight":"marginRight"];return[parse(left),parse(top),parse(right)]},getGapWidth=function(gapMode){if(gapMode===void 0&&(gapMode="margin"),typeof window>"u")return zeroGap;var offsets=getOffset(gapMode),documentWidth=document.documentElement.clientWidth,windowWidth=window.innerWidth;return{left:offsets[0],top:offsets[1],right:offsets[2],gap:Math.max(0,windowWidth-documentWidth+offsets[2]-offsets[0])}};var Style=styleSingleton(),getStyles=function(_a,allowRelative,gapMode,important){var left=_a.left,top=_a.top,right=_a.right,gap=_a.gap;return gapMode===void 0&&(gapMode="margin"),`
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return it=o[Symbol.iterator](),it.next.bind(it)}function assignRef(ref,value){if(ref!=null)if(isFunction(ref))ref(value);else try{ref.current=value}catch{throw new Error('Cannot assign value "'+value+'" to ref "'+ref+'"')}}function useComposedRefs(){for(var _len=arguments.length,refs=new Array(_len),_key=0;_key<_len;_key++)refs[_key]=arguments[_key];return(0,import_react5.useCallback)(function(node){for(var _iterator=_createForOfIteratorHelperLoose(refs),_step;!(_step=_iterator()).done;){var ref=_step.value;assignRef(ref,node)}},refs)}function composeEventHandlers(theirHandler,ourHandler){return function(event){if(theirHandler&&theirHandler(event),!event.defaultPrevented)return ourHandler(event)}}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}var React6=__toESM(require("react"));var React3=__toESM(require("react"));var FOCUS_GROUP="data-focus-lock",FOCUS_DISABLED="data-focus-lock-disabled",FOCUS_ALLOW="data-no-focus-lock",FOCUS_AUTO="data-autofocus-inside",FOCUS_NO_AUTOFOCUS="data-no-autofocus";function assignRef2(ref,value){return typeof ref=="function"?ref(value):ref&&(ref.current=value),ref}var import_react6=require("react");function useCallbackRef(initialValue,callback){var ref=(0,import_react6.useState)(function(){return{value:initialValue,callback,facade:{get current(){return ref.value},set current(value){var last=ref.value;last!==value&&(ref.value=value,ref.callback(value,last))}}}})[0];return ref.callback=callback,ref.facade}function useMergeRefs(refs,defaultValue){return useCallbackRef(defaultValue||null,function(newValue){return refs.forEach(function(ref){return assignRef2(ref,newValue)})})}var import_react7=require("react");var React=__toESM(require("react"));var hiddenGuard={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},InFocusGuard=function(_ref2){var children=_ref2.children;return React.createElement(React.Fragment,null,React.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}),children,children&&React.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:hiddenGuard}))};InFocusGuard.propTypes={};InFocusGuard.defaultProps={children:null};var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t}function __spreadArray(to,from,pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++)(ar||!(i in from))&&(ar||(ar=Array.prototype.slice.call(from,0,i)),ar[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))}function ItoI(a){return a}function innerCreateMedium(defaults,middleware){middleware===void 0&&(middleware=ItoI);var buffer=[],assigned=!1,medium={read:function(){if(assigned)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return buffer.length?buffer[buffer.length-1]:defaults},useMedium:function(data){var item=middleware(data,assigned);return buffer.push(item),function(){buffer=buffer.filter(function(x){return x!==item})}},assignSyncMedium:function(cb){for(assigned=!0;buffer.length;){var cbs=buffer;buffer=[],cbs.forEach(cb)}buffer={push:function(x){return cb(x)},filter:function(){return buffer}}},assignMedium:function(cb){assigned=!0;var pendingQueue=[];if(buffer.length){var cbs=buffer;buffer=[],cbs.forEach(cb),pendingQueue=buffer}var executeQueue=function(){var cbs2=pendingQueue;pendingQueue=[],cbs2.forEach(cb)},cycle=function(){return Promise.resolve().then(executeQueue)};cycle(),buffer={push:function(x){pendingQueue.push(x),cycle()},filter:function(filter){return pendingQueue=pendingQueue.filter(filter),buffer}}}};return medium}function createMedium(defaults,middleware){return middleware===void 0&&(middleware=ItoI),innerCreateMedium(defaults,middleware)}function createSidecarMedium(options){options===void 0&&(options={});var medium=innerCreateMedium(null);return medium.options=__assign({async:!0,ssr:!1},options),medium}var React2=__toESM(require("react")),SideCar=function(_a){var sideCar2=_a.sideCar,rest=__rest(_a,["sideCar"]);if(!sideCar2)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var Target=sideCar2.read();if(!Target)throw new Error("Sidecar medium not found");return React2.createElement(Target,__assign({},rest))};SideCar.isSideCarExport=!0;function exportSidecar(medium,exported){return medium.useMedium(exported),SideCar}var mediumFocus=createMedium({},function(_ref2){var target=_ref2.target,currentTarget=_ref2.currentTarget;return{target,currentTarget}}),mediumBlur=createMedium(),mediumEffect=createMedium(),mediumSidecar=createSidecarMedium({async:!0});var emptyArray=[],FocusLock=React3.forwardRef(function(props,parentRef){var _extends22,_React$useState=React3.useState(),realObserved=_React$useState[0],setObserved=_React$useState[1],observed=React3.useRef(),isActive=React3.useRef(!1),originalFocusedElement=React3.useRef(null),children=props.children,disabled=props.disabled,noFocusGuards=props.noFocusGuards,persistentFocus=props.persistentFocus,crossFrame=props.crossFrame,autoFocus=props.autoFocus,allowTextSelection=props.allowTextSelection,group=props.group,className=props.className,whiteList=props.whiteList,hasPositiveIndices=props.hasPositiveIndices,_props$shards=props.shards,shards=_props$shards===void 0?emptyArray:_props$shards,_props$as=props.as,Container=_props$as===void 0?"div":_props$as,_props$lockProps=props.lockProps,containerProps=_props$lockProps===void 0?{}:_props$lockProps,SideCar2=props.sideCar,shouldReturnFocus=props.returnFocus,focusOptions=props.focusOptions,onActivationCallback=props.onActivation,onDeactivationCallback=props.onDeactivation,_React$useState2=React3.useState({}),id=_React$useState2[0],onActivation=React3.useCallback(function(){originalFocusedElement.current=originalFocusedElement.current||document&&document.activeElement,observed.current&&onActivationCallback&&onActivationCallback(observed.current),isActive.current=!0},[onActivationCallback]),onDeactivation=React3.useCallback(function(){isActive.current=!1,onDeactivationCallback&&onDeactivationCallback(observed.current)},[onDeactivationCallback]);(0,import_react7.useEffect)(function(){disabled||(originalFocusedElement.current=null)},[]);var returnFocus=React3.useCallback(function(allowDefer){var returnFocusTo=originalFocusedElement.current;if(returnFocusTo&&returnFocusTo.focus){var howToReturnFocus=typeof shouldReturnFocus=="function"?shouldReturnFocus(returnFocusTo):shouldReturnFocus;if(howToReturnFocus){var returnFocusOptions=typeof howToReturnFocus=="object"?howToReturnFocus:void 0;originalFocusedElement.current=null,allowDefer?Promise.resolve().then(function(){return returnFocusTo.focus(returnFocusOptions)}):returnFocusTo.focus(returnFocusOptions)}}},[shouldReturnFocus]),onFocus3=React3.useCallback(function(event){isActive.current&&mediumFocus.useMedium(event)},[]),onBlur3=mediumBlur.useMedium,setObserveNode=React3.useCallback(function(newObserved){observed.current!==newObserved&&(observed.current=newObserved,setObserved(newObserved))},[]),lockProps=_extends((_extends22={},_extends22[FOCUS_DISABLED]=disabled&&"disabled",_extends22[FOCUS_GROUP]=group,_extends22),containerProps),hasLeadingGuards=noFocusGuards!==!0,hasTailingGuards=hasLeadingGuards&&noFocusGuards!=="tail",mergedRef=useMergeRefs([parentRef,setObserveNode]);return React3.createElement(React3.Fragment,null,hasLeadingGuards&&[React3.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}),hasPositiveIndices?React3.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:disabled?-1:1,style:hiddenGuard}):null],!disabled&&React3.createElement(SideCar2,{id,sideCar:mediumSidecar,observed:realObserved,disabled,persistentFocus,crossFrame,autoFocus,whiteList,shards,onActivation,onDeactivation,returnFocus,focusOptions}),React3.createElement(Container,_extends({ref:mergedRef},lockProps,{className,onBlur:onBlur3,onFocus:onFocus3}),children),hasTailingGuards&&React3.createElement("div",{"data-focus-guard":!0,tabIndex:disabled?-1:0,style:hiddenGuard}))});FocusLock.propTypes={};FocusLock.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var Lock_default=FocusLock;var React5=__toESM(require("react"));function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _typeof(obj){return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(obj2){return typeof obj2}:function(obj2){return obj2&&typeof Symbol=="function"&&obj2.constructor===Symbol&&obj2!==Symbol.prototype?"symbol":typeof obj2},_typeof(obj)}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return(hint==="string"?String:Number)(input)}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key)}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var import_react8=__toESM(require("react"));function withSideEffect(reducePropsToState2,handleStateChangeOnClient2){function getDisplayName(WrappedComponent){return WrappedComponent.displayName||WrappedComponent.name||"Component"}return function(WrappedComponent){var mountedInstances=[],state;function emitChange(){state=reducePropsToState2(mountedInstances.map(function(instance){return instance.props})),handleStateChangeOnClient2(state)}var SideEffect=function(_PureComponent){_inheritsLoose(SideEffect2,_PureComponent);function SideEffect2(){return _PureComponent.apply(this,arguments)||this}SideEffect2.peek=function(){return state};var _proto=SideEffect2.prototype;return _proto.componentDidMount=function(){mountedInstances.push(this),emitChange()},_proto.componentDidUpdate=function(){emitChange()},_proto.componentWillUnmount=function(){var index=mountedInstances.indexOf(this);mountedInstances.splice(index,1),emitChange()},_proto.render=function(){return import_react8.default.createElement(WrappedComponent,this.props)},SideEffect2}(import_react8.PureComponent);return _defineProperty(SideEffect,"displayName","SideEffect("+getDisplayName(WrappedComponent)+")"),SideEffect}}var index_es_default=withSideEffect;var toArray=function(a){for(var ret=Array(a.length),i=0;i<a.length;++i)ret[i]=a[i];return ret},asArray=function(a){return Array.isArray(a)?a:[a]},getFirst=function(a){return Array.isArray(a)?a[0]:a};var isElementHidden=function(node){if(node.nodeType!==Node.ELEMENT_NODE)return!1;var computedStyle=window.getComputedStyle(node,null);return!computedStyle||!computedStyle.getPropertyValue?!1:computedStyle.getPropertyValue("display")==="none"||computedStyle.getPropertyValue("visibility")==="hidden"},getParentNode=function(node){return node.parentNode&&node.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?node.parentNode.host:node.parentNode},isTopNode=function(node){return node===document||node&&node.nodeType===Node.DOCUMENT_NODE},isVisibleUncached=function(node,checkParent){return!node||isTopNode(node)||!isElementHidden(node)&&checkParent(getParentNode(node))},isVisibleCached=function(visibilityCache,node){var cached=visibilityCache.get(node);if(cached!==void 0)return cached;var result=isVisibleUncached(node,isVisibleCached.bind(void 0,visibilityCache));return visibilityCache.set(node,result),result},isAutoFocusAllowedUncached=function(node,checkParent){return node&&!isTopNode(node)?isAutoFocusAllowed(node)?checkParent(getParentNode(node)):!1:!0},isAutoFocusAllowedCached=function(cache,node){var cached=cache.get(node);if(cached!==void 0)return cached;var result=isAutoFocusAllowedUncached(node,isAutoFocusAllowedCached.bind(void 0,cache));return cache.set(node,result),result},getDataset=function(node){return node.dataset},isHTMLButtonElement=function(node){return node.tagName==="BUTTON"},isHTMLInputElement=function(node){return node.tagName==="INPUT"},isRadioElement=function(node){return isHTMLInputElement(node)&&node.type==="radio"},notHiddenInput=function(node){return!((isHTMLInputElement(node)||isHTMLButtonElement(node))&&(node.type==="hidden"||node.disabled))},isAutoFocusAllowed=function(node){var attribute=node.getAttribute(FOCUS_NO_AUTOFOCUS);return![!0,"true",""].includes(attribute)},isGuard=function(node){var _a;return Boolean(node&&((_a=getDataset(node))===null||_a===void 0?void 0:_a.focusGuard))},isNotAGuard=function(node){return!isGuard(node)},isDefined=function(x){return Boolean(x)};var tabSort=function(a,b){var tabDiff=a.tabIndex-b.tabIndex,indexDiff=a.index-b.index;if(tabDiff){if(!a.tabIndex)return 1;if(!b.tabIndex)return-1}return tabDiff||indexDiff},orderByTabIndex=function(nodes,filterNegative,keepGuards){return toArray(nodes).map(function(node,index){return{node,index,tabIndex:keepGuards&&node.tabIndex===-1?(node.dataset||{}).focusGuard?0:-1:node.tabIndex}}).filter(function(data){return!filterNegative||data.tabIndex>=0}).sort(tabSort)};var tabbables=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"];var queryTabbables=tabbables.join(","),queryGuardTabbables="".concat(queryTabbables,", [data-focus-guard]"),getFocusablesWithShadowDom=function(parent,withGuards){return toArray((parent.shadowRoot||parent).children).reduce(function(acc,child){return acc.concat(child.matches(withGuards?queryGuardTabbables:queryTabbables)?[child]:[],getFocusablesWithShadowDom(child))},[])},getFocusablesWithIFrame=function(parent,withGuards){var _a;return parent instanceof HTMLIFrameElement&&((_a=parent.contentDocument)===null||_a===void 0?void 0:_a.body)?getFocusables([parent.contentDocument.body],withGuards):[parent]},getFocusables=function(parents,withGuards){return parents.reduce(function(acc,parent){var _a,focusableWithShadowDom=getFocusablesWithShadowDom(parent,withGuards),focusableWithIframes=(_a=[]).concat.apply(_a,focusableWithShadowDom.map(function(node){return getFocusablesWithIFrame(node,withGuards)}));return acc.concat(focusableWithIframes,parent.parentNode?toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function(node){return node===parent}):[])},[])},getParentAutofocusables=function(parent){var parentFocus=parent.querySelectorAll("[".concat(FOCUS_AUTO,"]"));return toArray(parentFocus).map(function(node){return getFocusables([node])}).reduce(function(acc,nodes){return acc.concat(nodes)},[])};var filterFocusable=function(nodes,visibilityCache){return toArray(nodes).filter(function(node){return isVisibleCached(visibilityCache,node)}).filter(function(node){return notHiddenInput(node)})},filterAutoFocusable=function(nodes,cache){return cache===void 0&&(cache=new Map),toArray(nodes).filter(function(node){return isAutoFocusAllowedCached(cache,node)})},getTabbableNodes=function(topNodes,visibilityCache,withGuards){return orderByTabIndex(filterFocusable(getFocusables(topNodes,withGuards),visibilityCache),!0,withGuards)},getAllTabbableNodes=function(topNodes,visibilityCache){return orderByTabIndex(filterFocusable(getFocusables(topNodes),visibilityCache),!1)},parentAutofocusables=function(topNode,visibilityCache){return filterFocusable(getParentAutofocusables(topNode),visibilityCache)},contains=function(scope,element){return scope.shadowRoot?contains(scope.shadowRoot,element):Object.getPrototypeOf(scope).contains!==void 0&&Object.getPrototypeOf(scope).contains.call(scope,element)?!0:toArray(scope.children).some(function(child){var _a;if(child instanceof HTMLIFrameElement){var iframeBody=(_a=child.contentDocument)===null||_a===void 0?void 0:_a.body;return iframeBody?contains(iframeBody,element):!1}return contains(child,element)})};var filterNested=function(nodes){for(var contained=new Set,l=nodes.length,i=0;i<l;i+=1)for(var j=i+1;j<l;j+=1){var position=nodes[i].compareDocumentPosition(nodes[j]);(position&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&contained.add(j),(position&Node.DOCUMENT_POSITION_CONTAINS)>0&&contained.add(i)}return nodes.filter(function(_,index){return!contained.has(index)})},getTopParent=function(node){return node.parentNode?getTopParent(node.parentNode):node},getAllAffectedNodes=function(node){var nodes=asArray(node);return nodes.filter(Boolean).reduce(function(acc,currentNode){var group=currentNode.getAttribute(FOCUS_GROUP);return acc.push.apply(acc,group?filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP,'="').concat(group,'"]:not([').concat(FOCUS_DISABLED,'="disabled"])')))):[currentNode]),acc},[])};var safeProbe=function(cb){try{return cb()}catch{return}};var getActiveElement=function(inDocument){if(inDocument===void 0&&(inDocument=document),!(!inDocument||!inDocument.activeElement)){var activeElement=inDocument.activeElement;return activeElement.shadowRoot?getActiveElement(activeElement.shadowRoot):activeElement instanceof HTMLIFrameElement&&safeProbe(function(){return activeElement.contentWindow.document})?getActiveElement(activeElement.contentWindow.document):activeElement}};var focusInFrame=function(frame,activeElement){return frame===activeElement},focusInsideIframe=function(topNode,activeElement){return Boolean(toArray(topNode.querySelectorAll("iframe")).some(function(node){return focusInFrame(node,activeElement)}))},focusInside=function(topNode,activeElement){return activeElement===void 0&&(activeElement=getActiveElement(getFirst(topNode).ownerDocument)),!activeElement||activeElement.dataset&&activeElement.dataset.focusGuard?!1:getAllAffectedNodes(topNode).some(function(node){return contains(node,activeElement)||focusInsideIframe(node,activeElement)})};var focusIsHidden=function(inDocument){inDocument===void 0&&(inDocument=document);var activeElement=getActiveElement(inDocument);return activeElement?toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW,"]"))).some(function(node){return contains(node,activeElement)}):!1};var findSelectedRadio=function(node,nodes){return nodes.filter(isRadioElement).filter(function(el){return el.name===node.name}).filter(function(el){return el.checked})[0]||node},correctNode=function(node,nodes){return isRadioElement(node)&&node.name?findSelectedRadio(node,nodes):node},correctNodes=function(nodes){var resultSet=new Set;return nodes.forEach(function(node){return resultSet.add(correctNode(node,nodes))}),nodes.filter(function(node){return resultSet.has(node)})};var pickFirstFocus=function(nodes){return nodes[0]&&nodes.length>1?correctNode(nodes[0],nodes):nodes[0]},pickFocusable=function(nodes,index){return nodes.length>1?nodes.indexOf(correctNode(nodes[index],nodes)):index};var NEW_FOCUS="NEW_FOCUS",newFocus=function(innerNodes,outerNodes,activeElement,lastNode){var cnt=innerNodes.length,firstFocus=innerNodes[0],lastFocus=innerNodes[cnt-1],isOnGuard=isGuard(activeElement);if(!(activeElement&&innerNodes.indexOf(activeElement)>=0)){var activeIndex=activeElement!==void 0?outerNodes.indexOf(activeElement):-1,lastIndex=lastNode?outerNodes.indexOf(lastNode):activeIndex,lastNodeInside=lastNode?innerNodes.indexOf(lastNode):-1,indexDiff=activeIndex-lastIndex,firstNodeIndex=outerNodes.indexOf(firstFocus),lastNodeIndex=outerNodes.indexOf(lastFocus),correctedNodes=correctNodes(outerNodes),correctedIndex=activeElement!==void 0?correctedNodes.indexOf(activeElement):-1,correctedIndexDiff=correctedIndex-(lastNode?correctedNodes.indexOf(lastNode):activeIndex),returnFirstNode=pickFocusable(innerNodes,0),returnLastNode=pickFocusable(innerNodes,cnt-1);if(activeIndex===-1||lastNodeInside===-1)return NEW_FOCUS;if(!indexDiff&&lastNodeInside>=0)return lastNodeInside;if(activeIndex<=firstNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnLastNode;if(activeIndex>=lastNodeIndex&&isOnGuard&&Math.abs(indexDiff)>1)return returnFirstNode;if(indexDiff&&Math.abs(correctedIndexDiff)>1)return lastNodeInside;if(activeIndex<=firstNodeIndex)return returnLastNode;if(activeIndex>lastNodeIndex)return returnFirstNode;if(indexDiff)return Math.abs(indexDiff)>1?lastNodeInside:(cnt+lastNodeInside+indexDiff)%cnt}};var findAutoFocused=function(autoFocusables){return function(node){var _a,autofocus=(_a=getDataset(node))===null||_a===void 0?void 0:_a.autofocus;return node.autofocus||autofocus!==void 0&&autofocus!=="false"||autoFocusables.indexOf(node)>=0}},pickAutofocus=function(nodesIndexes,orderedNodes,groups){var nodes=nodesIndexes.map(function(_a){var node=_a.node;return node}),autoFocusable=filterAutoFocusable(nodes.filter(findAutoFocused(groups)));return autoFocusable&&autoFocusable.length?pickFirstFocus(autoFocusable):pickFirstFocus(filterAutoFocusable(orderedNodes))};var getParents=function(node,parents){return parents===void 0&&(parents=[]),parents.push(node),node.parentNode&&getParents(node.parentNode.host||node.parentNode,parents),parents},getCommonParent=function(nodeA,nodeB){for(var parentsA=getParents(nodeA),parentsB=getParents(nodeB),i=0;i<parentsA.length;i+=1){var currentParent=parentsA[i];if(parentsB.indexOf(currentParent)>=0)return currentParent}return!1},getTopCommonParent=function(baseActiveElement,leftEntry,rightEntries){var activeElements=asArray(baseActiveElement),leftEntries=asArray(leftEntry),activeElement=activeElements[0],topCommon=!1;return leftEntries.filter(Boolean).forEach(function(entry){topCommon=getCommonParent(topCommon||entry,entry)||topCommon,rightEntries.filter(Boolean).forEach(function(subEntry){var common=getCommonParent(activeElement,subEntry);common&&(!topCommon||contains(common,topCommon)?topCommon=common:topCommon=getCommonParent(common,topCommon))})}),topCommon},allParentAutofocusables=function(entries,visibilityCache){return entries.reduce(function(acc,node){return acc.concat(parentAutofocusables(node,visibilityCache))},[])};var reorderNodes=function(srcNodes,dstNodes){var remap=new Map;return dstNodes.forEach(function(entity){return remap.set(entity.node,entity)}),srcNodes.map(function(node){return remap.get(node)}).filter(isDefined)},getFocusMerge=function(topNode,lastNode){var activeElement=getActiveElement(asArray(topNode).length>0?document:getFirst(topNode).ownerDocument),entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(activeElement||topNode,topNode,entries),visibilityCache=new Map,anyFocusable=getAllTabbableNodes(entries,visibilityCache),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)});if(!(!innerElements[0]&&(innerElements=anyFocusable,!innerElements[0]))){var outerNodes=getAllTabbableNodes([commonParent],visibilityCache).map(function(_a){var node=_a.node;return node}),orderedInnerElements=reorderNodes(outerNodes,innerElements),innerNodes=orderedInnerElements.map(function(_a){var node=_a.node;return node}),newId=newFocus(innerNodes,outerNodes,activeElement,lastNode);if(newId===NEW_FOCUS){var focusNode=pickAutofocus(anyFocusable,innerNodes,allParentAutofocusables(entries,visibilityCache));if(focusNode)return{node:focusNode};console.warn("focus-lock: cannot find any node to move focus into");return}return newId===void 0?newId:orderedInnerElements[newId]}};var getFocusabledIn=function(topNode){var entries=getAllAffectedNodes(topNode).filter(isNotAGuard),commonParent=getTopCommonParent(topNode,topNode,entries),visibilityCache=new Map,outerNodes=getTabbableNodes([commonParent],visibilityCache,!0),innerElements=getTabbableNodes(entries,visibilityCache).filter(function(_a){var node=_a.node;return isNotAGuard(node)}).map(function(_a){var node=_a.node;return node});return outerNodes.map(function(_a){var node=_a.node,index=_a.index;return{node,index,lockItem:innerElements.indexOf(node)>=0,guard:isGuard(node)}})};var focusOn=function(target,focusOptions){"focus"in target&&target.focus(focusOptions),"contentWindow"in target&&target.contentWindow&&target.contentWindow.focus()},guardCount=0,lockDisabled=!1,setFocus=function(topNode,lastNode,options){options===void 0&&(options={});var focusable=getFocusMerge(topNode,lastNode);if(!lockDisabled&&focusable){if(guardCount>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),lockDisabled=!0,setTimeout(function(){lockDisabled=!1},1);return}guardCount++,focusOn(focusable.node,options.focusOptions),guardCount--}};var es2015_default=setFocus;function deferAction(action){setTimeout(action,1)}var focusOnBody=function(){return document&&document.activeElement===document.body},isFreeFocus=function(){return focusOnBody()||focusIsHidden()},lastActiveTrap=null,lastActiveFocus=null,lastPortaledElement=null,focusWasOutsideWindow=!1,defaultWhitelist=function(){return!0},focusWhitelisted=function(activeElement){return(lastActiveTrap.whiteList||defaultWhitelist)(activeElement)},recordPortal=function(observerNode,portaledElement){lastPortaledElement={observerNode,portaledElement}},focusIsPortaledPair=function(element){return lastPortaledElement&&lastPortaledElement.portaledElement===element};function autoGuard(startIndex,end,step,allNodes){var lastGuard=null,i=startIndex;do{var item=allNodes[i];if(item.guard)item.node.dataset.focusAutoGuard&&(lastGuard=item);else if(item.lockItem){if(i!==startIndex)return;lastGuard=null}else break}while((i+=step)!==end);lastGuard&&(lastGuard.node.tabIndex=0)}var extractRef=function(ref){return ref&&"current"in ref?ref.current:ref},focusWasOutside=function(crossFrameOption){return crossFrameOption?Boolean(focusWasOutsideWindow):focusWasOutsideWindow==="meanwhile"},checkInHost=function checkInHost2(check,el,boundary){return el&&(el.host===check&&(!el.activeElement||boundary.contains(el.activeElement))||el.parentNode&&checkInHost2(check,el.parentNode,boundary))},withinHost=function(activeElement,workingArea){return workingArea.some(function(area){return checkInHost(activeElement,area,area)})},activateTrap=function(){var result=!1;if(lastActiveTrap){var _lastActiveTrap=lastActiveTrap,observed=_lastActiveTrap.observed,persistentFocus=_lastActiveTrap.persistentFocus,autoFocus=_lastActiveTrap.autoFocus,shards=_lastActiveTrap.shards,crossFrame=_lastActiveTrap.crossFrame,focusOptions=_lastActiveTrap.focusOptions,workingNode=observed||lastPortaledElement&&lastPortaledElement.portaledElement,activeElement=document&&document.activeElement;if(workingNode){var workingArea=[workingNode].concat(shards.map(extractRef).filter(Boolean));if((!activeElement||focusWhitelisted(activeElement))&&(persistentFocus||focusWasOutside(crossFrame)||!isFreeFocus()||!lastActiveFocus&&autoFocus)&&(workingNode&&!(focusInside(workingArea)||activeElement&&withinHost(activeElement,workingArea)||focusIsPortaledPair(activeElement,workingNode))&&(document&&!lastActiveFocus&&activeElement&&!autoFocus?(activeElement.blur&&activeElement.blur(),document.body.focus()):(result=es2015_default(workingArea,lastActiveFocus,{focusOptions}),lastPortaledElement={})),focusWasOutsideWindow=!1,lastActiveFocus=document&&document.activeElement),document){var newActiveElement=document&&document.activeElement,allNodes=getFocusabledIn(workingArea),focusedIndex=allNodes.map(function(_ref2){var node=_ref2.node;return node}).indexOf(newActiveElement);focusedIndex>-1&&(allNodes.filter(function(_ref2){var guard=_ref2.guard,node=_ref2.node;return guard&&node.dataset.focusAutoGuard}).forEach(function(_ref3){var node=_ref3.node;return node.removeAttribute("tabIndex")}),autoGuard(focusedIndex,allNodes.length,1,allNodes),autoGuard(focusedIndex,-1,-1,allNodes))}}}return result},onTrap=function(event){activateTrap()&&event&&(event.stopPropagation(),event.preventDefault())},onBlur=function(){return deferAction(activateTrap)},onFocus=function(event){var source=event.target,currentNode=event.currentTarget;currentNode.contains(source)||recordPortal(currentNode,source)},FocusWatcher=function(){return null},FocusTrap=function(_ref4){var children=_ref4.children;return React5.createElement("div",{onBlur,onFocus},children)};FocusTrap.propTypes={};var onWindowBlur=function(){focusWasOutsideWindow="just",deferAction(function(){focusWasOutsideWindow="meanwhile"})},attachHandler=function(){document.addEventListener("focusin",onTrap),document.addEventListener("focusout",onBlur),window.addEventListener("blur",onWindowBlur)},detachHandler=function(){document.removeEventListener("focusin",onTrap),document.removeEventListener("focusout",onBlur),window.removeEventListener("blur",onWindowBlur)};function reducePropsToState(propsList){return propsList.filter(function(_ref5){var disabled=_ref5.disabled;return!disabled})}function handleStateChangeOnClient(traps){var trap=traps.slice(-1)[0];trap&&!lastActiveTrap&&attachHandler();var lastTrap=lastActiveTrap,sameTrap=lastTrap&&trap&&trap.id===lastTrap.id;lastActiveTrap=trap,lastTrap&&!sameTrap&&(lastTrap.onDeactivation(),traps.filter(function(_ref6){var id=_ref6.id;return id===lastTrap.id}).length||lastTrap.returnFocus(!trap)),trap?(lastActiveFocus=null,(!sameTrap||lastTrap.observed!==trap.observed)&&trap.onActivation(),activateTrap(!0),deferAction(activateTrap)):(detachHandler(),lastActiveFocus=null)}mediumFocus.assignSyncMedium(onFocus);mediumBlur.assignMedium(onBlur);mediumEffect.assignMedium(function(cb){return cb({moveFocusInside:es2015_default,focusInside})});var Trap_default=index_es_default(reducePropsToState,handleStateChangeOnClient)(FocusWatcher);var FocusLockCombination=React6.forwardRef(function(props,ref){return React6.createElement(Lock_default,_extends({sideCar:Trap_default,ref},props))}),_ref=Lock_default.propTypes||{},sideCar=_ref.sideCar,propTypes=_objectWithoutPropertiesLoose(_ref,["sideCar"]);FocusLockCombination.propTypes={};var Combination_default=FocusLockCombination;var es2015_default2=Combination_default;var React11=__toESM(require("react"));var React7=__toESM(require("react"));var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";var effectCar=createSidecarMedium();var nothing=function(){},RemoveScroll=React7.forwardRef(function(props,parentRef){var ref=React7.useRef(null),_a=React7.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),callbacks=_a[0],setCallbacks=_a[1],forwardProps=props.forwardProps,children=props.children,className=props.className,removeScrollBar=props.removeScrollBar,enabled=props.enabled,shards=props.shards,sideCar2=props.sideCar,noIsolation=props.noIsolation,inert=props.inert,allowPinchZoom=props.allowPinchZoom,_b=props.as,Container=_b===void 0?"div":_b,gapMode=props.gapMode,rest=__rest(props,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),SideCar2=sideCar2,containerRef=useMergeRefs([ref,parentRef]),containerProps=__assign(__assign({},rest),callbacks);return React7.createElement(React7.Fragment,null,enabled&&React7.createElement(SideCar2,{sideCar:effectCar,removeScrollBar,shards,noIsolation,inert,setCallbacks,allowPinchZoom:!!allowPinchZoom,lockRef:ref,gapMode}),forwardProps?React7.cloneElement(React7.Children.only(children),__assign(__assign({},containerProps),{ref:containerRef})):React7.createElement(Container,__assign({},containerProps,{className,ref:containerRef}),children))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var React10=__toESM(require("react"));var React9=__toESM(require("react"));var React8=__toESM(require("react"));var currentNonce;var getNonce=function(){if(currentNonce)return currentNonce;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var tag=document.createElement("style");tag.type="text/css";var nonce=getNonce();return nonce&&tag.setAttribute("nonce",nonce),tag}function injectStyles(tag,css){tag.styleSheet?tag.styleSheet.cssText=css:tag.appendChild(document.createTextNode(css))}function insertStyleTag(tag){var head=document.head||document.getElementsByTagName("head")[0];head.appendChild(tag)}var stylesheetSingleton=function(){var counter=0,stylesheet=null;return{add:function(style){counter==0&&(stylesheet=makeStyleTag())&&(injectStyles(stylesheet,style),insertStyleTag(stylesheet)),counter++},remove:function(){counter--,!counter&&stylesheet&&(stylesheet.parentNode&&stylesheet.parentNode.removeChild(stylesheet),stylesheet=null)}}};var styleHookSingleton=function(){var sheet=stylesheetSingleton();return function(styles,isDynamic){React8.useEffect(function(){return sheet.add(styles),function(){sheet.remove()}},[styles&&isDynamic])}};var styleSingleton=function(){var useStyle=styleHookSingleton(),Sheet=function(_a){var styles=_a.styles,dynamic=_a.dynamic;return useStyle(styles,dynamic),null};return Sheet};var zeroGap={left:0,top:0,right:0,gap:0},parse=function(x){return parseInt(x||"",10)||0},getOffset=function(gapMode){var cs=window.getComputedStyle(document.body),left=cs[gapMode==="padding"?"paddingLeft":"marginLeft"],top=cs[gapMode==="padding"?"paddingTop":"marginTop"],right=cs[gapMode==="padding"?"paddingRight":"marginRight"];return[parse(left),parse(top),parse(right)]},getGapWidth=function(gapMode){if(gapMode===void 0&&(gapMode="margin"),typeof window>"u")return zeroGap;var offsets=getOffset(gapMode),documentWidth=document.documentElement.clientWidth,windowWidth=window.innerWidth;return{left:offsets[0],top:offsets[1],right:offsets[2],gap:Math.max(0,windowWidth-documentWidth+offsets[2]-offsets[0])}};var Style=styleSingleton(),getStyles=function(_a,allowRelative,gapMode,important){var left=_a.left,top=_a.top,right=_a.right,gap=_a.gap;return gapMode===void 0&&(gapMode="margin"),`
.`.concat(noScrollbarsClassName,` {

@@ -4,0 +4,0 @@ overflow: hidden `).concat(important,`;

{
"name": "@twilio-paste/modal-dialog-primitive",
"version": "2.0.0",
"version": "2.0.1",
"category": "overlay",

@@ -23,2 +23,3 @@ "status": "production",

"build:js": "NODE_ENV=development node build.js",
"build:typedocs": "tsx ../../../../tools/build/generate-type-docs",
"clean": "rm -rf ./dist",

@@ -36,4 +37,6 @@ "tsc": "tsc"

"react": "^18.0.0",
"react-dom": "^18.0.0"
"react-dom": "^18.0.0",
"tsx": "^3.12.10",
"typescript": "^4.9.4"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc