@kakadu/components 6.15.0 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ "use strict";const Fe=require("react"),be=require("./_commonjsHelpers-DGT2Y9Xa.js");var Y={exports:{}};/*!
2
+ * tabbable 6.5.1
3
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
+ */var pe=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],J=pe.join(","),he=typeof Element>"u",M=he?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Q=!he&&Element.prototype.getRootNode?function(i){return i==null||i.getRootNode==null?void 0:i.getRootNode()}:function(i){return i==null?void 0:i.ownerDocument},ee=function(e,t){t===void 0&&(t=!0);var o=e==null||e.getAttribute==null?void 0:e.getAttribute("inert"),s=o===""||o==="true",l=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ee(e.parentNode));return l},Oe=function(e){var t,o=e==null||e.getAttribute==null||(t=e.getAttribute("contenteditable"))==null?void 0:t.toLowerCase();return o===""||o==="true"||o==="plaintext-only"},ye=function(e,t,o){if(ee(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(J));return t&&M.call(e,J)&&s.unshift(e),s=s.filter(o),s},te=function(e,t,o){for(var s=[],l=Array.from(e);l.length;){var a=l.shift();if(!ee(a,!1))if(a.tagName==="SLOT"){var y=a.assignedElements(),T=y.length?y:a.children,F=te(T,!0,o);o.flatten?s.push.apply(s,F):s.push({scopeParent:a,candidates:F})}else{var k=M.call(a,J);k&&o.filter(a)&&(t||!e.includes(a))&&s.push(a);var D=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),N=!ee(D,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(D&&N){var _=te(D===!0?a.children:D.children,!0,o);o.flatten?s.push.apply(s,_):s.push({scopeParent:a,candidates:_})}else l.unshift.apply(l,a.children)}}return s},me=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},L=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Oe(e))&&!me(e)?0:e.tabIndex},De=function(e,t){var o=L(e);return o<0&&t&&!me(e)?0:o},ke=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ge=function(e){return e.tagName==="INPUT"},Ne=function(e){return ge(e)&&e.type==="hidden"},Re=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pe=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]},Ce=function(e){if(!e.name)return!0;var t=e.form||Q(e),o=function(y){return t.querySelectorAll('input[type="radio"][name="'+y+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=o(window.CSS.escape(e.name));else try{s=o(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var l=Pe(s,e.form);return!l||l===e},Ae=function(e){return ge(e)&&e.type==="radio"},Ie=function(e){return Ae(e)&&!Ce(e)},_e=function(e){var t,o=e&&Q(e),s=(t=o)==null?void 0:t.host,l=!1;if(o&&o!==e){var a,y;for(l=!!((a=s)!=null&&(a=a.ownerDocument)!=null&&a.contains(s)||e!=null&&(y=e.ownerDocument)!=null&&y.contains(e));!l&&s;){var T,F;o=Q(s),s=(T=o)==null?void 0:T.host,l=!!((F=s)!=null&&(F=F.ownerDocument)!=null&&F.contains(s))}}return l},se=function(e){var t=e.getBoundingClientRect(),o=t.width,s=t.height;return o===0&&s===0},je=function(e,t){var o=t.displayCheck,s=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var l=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}var a=getComputedStyle(e),y=a.visibility;if(y==="hidden"||y==="collapse")return!0;var T=M.call(e,"details>summary:first-of-type"),F=T?e.parentElement:e;if(M.call(F,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof s=="function"){for(var k=e;e;){var D=e.parentElement,N=Q(e);if(D&&!D.shadowRoot&&s(D)===!0)return se(e);e.assignedSlot?e=e.assignedSlot:!D&&N!==e.ownerDocument?e=N.host:e=D}e=k}if(_e(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return se(e);return!1},xe=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var s=t.children.item(o);if(s.tagName==="LEGEND")return M.call(t,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}t=t.parentElement}return!1},re=function(e,t){return!(t.disabled||Ne(t)||je(t,e)||Re(t)||xe(t))},oe=function(e,t){return!(Ie(t)||L(t)<0||!re(e,t))},Le=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},we=function(e){var t=[],o=[];return e.forEach(function(s,l){var a=!!s.scopeParent,y=a?s.scopeParent:s,T=De(y,a),F=a?we(s.candidates):y;T===0?a?t.push.apply(t,F):t.push(y):o.push({documentOrder:l,tabIndex:T,item:s,isScope:a,content:F})}),o.sort(ke).reduce(function(s,l){return l.isScope?s.push.apply(s,l.content):s.push(l.content),s},[]).concat(t)},Te=function(e,t){t=t||{};var o;return t.getShadowRoot?o=te([e],t.includeContainer,{filter:oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Le}):o=ye(e,t.includeContainer,oe.bind(null,t)),we(o)},Se=function(e,t){t=t||{};var o;return t.getShadowRoot?o=te([e],t.includeContainer,{filter:re.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=ye(e,t.includeContainer,re.bind(null,t)),o},K=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return M.call(e,J)===!1?!1:oe(t,e)},Be=pe.concat("iframe:not([inert]):not([inert] *)").join(","),X=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return M.call(e,Be)===!1?!1:re(t,e)};const Ke=Object.freeze(Object.defineProperty({__proto__:null,focusable:Se,getTabIndex:L,isFocusable:X,isTabbable:K,tabbable:Te},Symbol.toStringTag,{value:"Module"}));/*!
5
+ * focus-trap 7.8.0
6
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
7
+ */function ue(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,o=Array(e);t<e;t++)o[t]=i[t];return o}function Me(i){if(Array.isArray(i))return ue(i)}function ce(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Ee(i))||e){t&&(i=t);var o=0,s=function(){};return{s,n:function(){return o>=i.length?{done:!0}:{done:!1,value:i[o++]}},e:function(T){throw T},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,a=!0,y=!1;return{s:function(){t=t.call(i)},n:function(){var T=t.next();return a=T.done,T},e:function(T){y=!0,l=T},f:function(){try{a||t.return==null||t.return()}finally{if(y)throw l}}}}function qe(i,e,t){return(e=He(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function $e(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Ve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);e&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,o)}return t}function fe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?le(Object(t),!0).forEach(function(o){qe(i,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach(function(o){Object.defineProperty(i,o,Object.getOwnPropertyDescriptor(t,o))})}return i}function Ge(i){return Me(i)||$e(i)||Ee(i)||Ve()}function Ue(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var o=t.call(i,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function He(i){var e=Ue(i,"string");return typeof e=="symbol"?e:e+""}function Ee(i,e){if(i){if(typeof i=="string")return ue(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ue(i,e):void 0}}var I={getActiveTrap:function(e){return(e==null?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){var o=I.getActiveTrap(e);t!==o&&I.pauseTrap(e);var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var o=e.indexOf(t);o!==-1&&e.splice(o,1),I.unpauseTrap(e)},pauseTrap:function(e){var t=I.getActiveTrap(e);t==null||t._setPausedState(!0)},unpauseTrap:function(e){var t=I.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},We=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},ze=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},G=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Ye=function(e){return G(e)&&!e.shiftKey},Ze=function(e){return G(e)&&e.shiftKey},de=function(e){return setTimeout(e,0)},V=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),s=1;s<t;s++)o[s-1]=arguments[s];return typeof e=="function"?e.apply(void 0,o):e},Z=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Xe=[],Je=function(e,t){var o=(t==null?void 0:t.document)||document,s=(t==null?void 0:t.trapStack)||Xe,l=fe({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Ye,isKeyBackward:Ze},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},y,T=function(n,r,c){return n&&n[r]!==void 0?n[r]:l[c||r]},F=function(n,r){var c=typeof(r==null?void 0:r.composedPath)=="function"?r.composedPath():void 0;return a.containerGroups.findIndex(function(h){var p=h.container,g=h.tabbableNodes;return p.contains(n)||(c==null?void 0:c.includes(p))||g.find(function(v){return v===n})})},k=function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=r.hasFallback,h=c===void 0?!1:c,p=r.params,g=p===void 0?[]:p,v=l[n];if(typeof v=="function"&&(v=v.apply(void 0,Ge(g))),v===!0&&(v=void 0),!v){if(v===void 0||v===!1)return v;throw new Error("`".concat(n,"` was specified but was not a node, or did not return a node"))}var S=v;if(typeof v=="string"){try{S=o.querySelector(v)}catch(E){throw new Error("`".concat(n,'` appears to be an invalid selector; error="').concat(E.message,'"'))}if(!S&&!h)throw new Error("`".concat(n,"` as selector refers to no known node"))}return S},D=function(){var n=k("initialFocus",{hasFallback:!0});if(n===!1)return!1;if(n===void 0||n&&!X(n,l.tabbableOptions))if(F(o.activeElement)>=0)n=o.activeElement;else{var r=a.tabbableGroups[0],c=r&&r.firstTabbableNode;n=c||k("fallbackFocus")}else n===null&&(n=k("fallbackFocus"));if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n},N=function(){if(a.containerGroups=a.containers.map(function(n){var r=Te(n,l.tabbableOptions),c=Se(n,l.tabbableOptions),h=r.length>0?r[0]:void 0,p=r.length>0?r[r.length-1]:void 0,g=c.find(function(E){return K(E)}),v=c.slice().reverse().find(function(E){return K(E)}),S=!!r.find(function(E){return L(E)>0});return{container:n,tabbableNodes:r,focusableNodes:c,posTabIndexesFound:S,firstTabbableNode:h,lastTabbableNode:p,firstDomTabbableNode:g,lastDomTabbableNode:v,nextTabbableNode:function(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,C=r.indexOf(R);return C<0?A?c.slice(c.indexOf(R)+1).find(function(B){return K(B)}):c.slice(0,c.indexOf(R)).reverse().find(function(B){return K(B)}):r[C+(A?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(n){return n.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!k("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(n){return n.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},_=function(n){var r=n.activeElement;if(r)return r.shadowRoot&&r.shadowRoot.activeElement!==null?_(r.shadowRoot):r},P=function(n){if(n!==!1&&n!==_(document)){if(!n||!n.focus){P(D());return}n.focus({preventScroll:!!l.preventScroll}),a.mostRecentlyFocusedNode=n,We(n)&&n.select()}},U=function(n){var r=k("setReturnFocus",{params:[n]});return r||(r===!1?!1:n)},j=function(n){var r=n.target,c=n.event,h=n.isBackward,p=h===void 0?!1:h;r=r||Z(c),N();var g=null;if(a.tabbableGroups.length>0){var v=F(r,c),S=v>=0?a.containerGroups[v]:void 0;if(v<0)p?g=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:g=a.tabbableGroups[0].firstTabbableNode;else if(p){var E=a.tabbableGroups.findIndex(function(ne){var ie=ne.firstTabbableNode;return r===ie});if(E<0&&(S.container===r||X(r,l.tabbableOptions)&&!K(r,l.tabbableOptions)&&!S.nextTabbableNode(r,!1))&&(E=v),E>=0){var R=E===0?a.tabbableGroups.length-1:E-1,A=a.tabbableGroups[R];g=L(r)>=0?A.lastTabbableNode:A.lastDomTabbableNode}else G(c)||(g=S.nextTabbableNode(r,!1))}else{var C=a.tabbableGroups.findIndex(function(ne){var ie=ne.lastTabbableNode;return r===ie});if(C<0&&(S.container===r||X(r,l.tabbableOptions)&&!K(r,l.tabbableOptions)&&!S.nextTabbableNode(r))&&(C=v),C>=0){var B=C===a.tabbableGroups.length-1?0:C+1,x=a.tabbableGroups[B];g=L(r)>=0?x.firstTabbableNode:x.firstDomTabbableNode}else G(c)||(g=S.nextTabbableNode(r))}}else g=k("fallbackFocus");return g},q=function(n){var r=Z(n);if(!(F(r,n)>=0)){if(V(l.clickOutsideDeactivates,n)){y.deactivate({returnFocus:l.returnFocusOnDeactivate});return}V(l.allowOutsideClick,n)||n.preventDefault()}},H=function(n){var r=Z(n),c=F(r,n)>=0;if(c||r instanceof Document)c&&(a.mostRecentlyFocusedNode=r);else{n.stopImmediatePropagation();var h,p=!0;if(a.mostRecentlyFocusedNode)if(L(a.mostRecentlyFocusedNode)>0){var g=F(a.mostRecentlyFocusedNode),v=a.containerGroups[g].tabbableNodes;if(v.length>0){var S=v.findIndex(function(E){return E===a.mostRecentlyFocusedNode});S>=0&&(l.isKeyForward(a.recentNavEvent)?S+1<v.length&&(h=v[S+1],p=!1):S-1>=0&&(h=v[S-1],p=!1))}}else a.containerGroups.some(function(E){return E.tabbableNodes.some(function(R){return L(R)>0})})||(p=!1);else p=!1;p&&(h=j({target:a.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(a.recentNavEvent)})),P(h||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},ae=function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=n;var c=j({event:n,isBackward:r});c&&(G(n)&&n.preventDefault(),P(c))},W=function(n){(l.isKeyForward(n)||l.isKeyBackward(n))&&ae(n,l.isKeyBackward(n))},z=function(n){ze(n)&&V(l.escapeDeactivates,n)!==!1&&(n.preventDefault(),y.deactivate())},$=function(n){var r=Z(n);F(r,n)>=0||V(l.clickOutsideDeactivates,n)||V(l.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())},d=function(){if(a.active)return I.activateTrap(s,y),a.delayInitialFocusTimer=l.delayInitialFocus?de(function(){P(D())}):P(D()),o.addEventListener("focusin",H,!0),o.addEventListener("mousedown",q,{capture:!0,passive:!1}),o.addEventListener("touchstart",q,{capture:!0,passive:!1}),o.addEventListener("click",$,{capture:!0,passive:!1}),o.addEventListener("keydown",W,{capture:!0,passive:!1}),o.addEventListener("keydown",z),y},f=function(n){a.active&&!a.paused&&y._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var r=new Set,c=new Set,h=ce(n),p;try{for(h.s();!(p=h.n()).done;){var g=p.value;r.add(g);for(var v=typeof ShadowRoot<"u"&&g.getRootNode()instanceof ShadowRoot,S=g;S;){r.add(S);var E=S.parentElement,R=[];E?R=E.children:!E&&v&&(R=S.getRootNode().children,E=S.getRootNode().host,v=typeof ShadowRoot<"u"&&E.getRootNode()instanceof ShadowRoot);var A=ce(R),C;try{for(A.s();!(C=A.n()).done;){var B=C.value;c.add(B)}}catch(x){A.e(x)}finally{A.f()}S=E}}}catch(x){h.e(x)}finally{h.f()}r.forEach(function(x){c.delete(x)}),a.adjacentElements=c},m=function(){if(a.active)return o.removeEventListener("focusin",H,!0),o.removeEventListener("mousedown",q,!0),o.removeEventListener("touchstart",q,!0),o.removeEventListener("click",$,!0),o.removeEventListener("keydown",W,!0),o.removeEventListener("keydown",z),y},u=function(n){var r=n.some(function(c){var h=Array.from(c.removedNodes);return h.some(function(p){return p===a.mostRecentlyFocusedNode})});r&&P(D())},w=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(u):void 0,O=function(){w&&(w.disconnect(),a.active&&!a.paused&&a.containers.map(function(n){w.observe(n,{subtree:!0,childList:!0})}))};return y={get active(){return a.active},get paused(){return a.paused},activate:function(n){if(a.active)return this;var r=T(n,"onActivate"),c=T(n,"onPostActivate"),h=T(n,"checkCanFocusTrap"),p=I.getActiveTrap(s),g=!1;if(p&&!p.paused){var v;(v=p._setSubtreeIsolation)===null||v===void 0||v.call(p,!1),g=!0}try{h||N(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=_(o),r==null||r();var S=function(){h&&N(),d(),O(),l.isolateSubtrees&&y._setSubtreeIsolation(!0),c==null||c()};if(h)return h(a.containers.concat()).then(S,S),this;S()}catch(R){if(p===I.getActiveTrap(s)&&g){var E;(E=p._setSubtreeIsolation)===null||E===void 0||E.call(p,!0)}throw R}return this},deactivate:function(n){if(!a.active)return this;var r=fe({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},n);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||y._setSubtreeIsolation(!1),a.alreadySilent.clear(),m(),a.active=!1,a.paused=!1,O(),I.deactivateTrap(s,y);var c=T(r,"onDeactivate"),h=T(r,"onPostDeactivate"),p=T(r,"checkCanReturnFocus"),g=T(r,"returnFocus","returnFocusOnDeactivate");c==null||c();var v=function(){de(function(){g&&P(U(a.nodeFocusedBeforeActivation)),h==null||h()})};return g&&p?(p(U(a.nodeFocusedBeforeActivation)).then(v,v),this):(v(),this)},pause:function(n){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,n)):this},unpause:function(n){return a.active?(a.manuallyPaused=!1,s[s.length-1]!==this?this:this._setPausedState(!1,n)):this},updateContainerElements:function(n){var r=[].concat(n).filter(Boolean);return a.containers=r.map(function(c){return typeof c=="string"?o.querySelector(c):c}),l.isolateSubtrees&&f(a.containers),a.active&&(N(),l.isolateSubtrees&&!a.paused&&y._setSubtreeIsolation(!0)),O(),this}},Object.defineProperties(y,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(n,r){if(a.paused===n)return this;if(a.paused=n,n){var c=T(r,"onPause"),h=T(r,"onPostPause");c==null||c(),m(),O(),y._setSubtreeIsolation(!1),h==null||h()}else{var p=T(r,"onUnpause"),g=T(r,"onPostUnpause");p==null||p(),y._setSubtreeIsolation(!0),N(),d(),O(),g==null||g()}return this}},_setSubtreeIsolation:{value:function(n){l.isolateSubtrees&&a.adjacentElements.forEach(function(r){var c;if(n)switch(l.isolateSubtrees){case"aria-hidden":(r.ariaHidden==="true"||((c=r.getAttribute("aria-hidden"))===null||c===void 0?void 0:c.toLowerCase())==="true")&&a.alreadySilent.add(r),r.setAttribute("aria-hidden","true");break;default:(r.inert||r.hasAttribute("inert"))&&a.alreadySilent.add(r),r.setAttribute("inert",!0);break}else if(!a.alreadySilent.has(r))switch(l.isolateSubtrees){case"aria-hidden":r.removeAttribute("aria-hidden");break;default:r.removeAttribute("inert");break}})}}}),y.updateContainerElements(e),y};const Qe=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:Je},Symbol.toStringTag,{value:"Module"})),et=be.getAugmentedNamespace(Qe),tt=be.getAugmentedNamespace(Ke);var ve;function rt(){if(ve)return Y.exports;ve=1;function i(d){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},i(d)}var e,t;function o(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function s(d,f){for(var m=0;m<f.length;m++){var u=f[m];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,P(u.key),u)}}function l(d,f,m){return f&&s(d.prototype,f),Object.defineProperty(d,"prototype",{writable:!1}),d}function a(d,f,m){return f=k(f),y(d,F()?Reflect.construct(f,m||[],k(d).constructor):f.apply(d,m))}function y(d,f){if(f&&(i(f)=="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T(d)}function T(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d}function F(){try{var d=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F=function(){return!!d})()}function k(d){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},k(d)}function D(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),f&&N(d,f)}function N(d,f){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,u){return m.__proto__=u,m},N(d,f)}function _(d,f,m){return(f=P(f))in d?Object.defineProperty(d,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[f]=m,d}function P(d){var f=U(d,"string");return i(f)=="symbol"?f:f+""}function U(d,f){if(i(d)!="object"||!d)return d;var m=d[Symbol.toPrimitive];if(m!==void 0){var u=m.call(d,f);if(i(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(d)}var j=Fe,q=et,H=q.createFocusTrap,ae=tt,W=ae.isFocusable,z=parseInt((e=(t=/^(\d+)\./.exec(j.version))===null||t===void 0?void 0:t[1])!==null&&e!==void 0?e:0,10),$=(function(d){function f(m){var u;o(this,f),u=a(this,f,[m]),_(u,"getNodeForOption",function(b){var n,r=(n=this.internalOptions[b])!==null&&n!==void 0?n:this.originalOptions[b];if(typeof r=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];r=r.apply(void 0,h)}if(r===!0&&(r=void 0),!r){if(r===void 0||r===!1)return r;throw new Error("`".concat(b,"` was specified but was not a node, or did not return a node"))}var g=r;if(typeof r=="string"){var v;if(g=(v=this.getDocument())===null||v===void 0?void 0:v.querySelector(r),!g)throw new Error("`".concat(b,"` as selector refers to no known node"))}return g}),u.handleDeactivate=u.handleDeactivate.bind(u),u.handlePostDeactivate=u.handlePostDeactivate.bind(u),u.handleClickOutsideDeactivates=u.handleClickOutsideDeactivates.bind(u),u.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:u.handleDeactivate,onPostDeactivate:u.handlePostDeactivate,clickOutsideDeactivates:u.handleClickOutsideDeactivates},u.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var w=m.focusTrapOptions;for(var O in w)if(Object.prototype.hasOwnProperty.call(w,O)){if(O==="returnFocusOnDeactivate"||O==="onDeactivate"||O==="onPostDeactivate"||O==="checkCanReturnFocus"||O==="clickOutsideDeactivates"){u.originalOptions[O]=w[O];continue}u.internalOptions[O]=w[O]}return u.outsideClick=null,u.focusTrapElements=m.containerElements||[],u.updatePreviousElement(),u}return D(f,d),l(f,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var u=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return u||(u===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var u=this.getDocument();u&&(this.previouslyFocusedElement=u.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(u){var w=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,u):this.originalOptions.clickOutsideDeactivates;return w&&(this.outsideClick={target:u.target,allowDeactivation:w}),w}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var u=this,w=function(){var b=u.getReturnFocusNode(),n=!!(u.originalOptions.returnFocusOnDeactivate&&b!==null&&b!==void 0&&b.focus&&(!u.outsideClick||u.outsideClick.allowDeactivation&&!W(u.outsideClick.target,u.internalOptions.tabbableOptions))),r=u.internalOptions.preventScroll,c=r===void 0?!1:r;n&&b.focus({preventScroll:c}),u.originalOptions.onPostDeactivate&&u.originalOptions.onPostDeactivate.call(null),u.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(w,w):w()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var u=this.focusTrapElements.some(Boolean);u&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(u){if(this.focusTrap){u.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var w=!u.active&&this.props.active,O=u.active&&!this.props.active,b=!u.paused&&this.props.paused,n=u.paused&&!this.props.paused;if(w&&(this.updatePreviousElement(),this.focusTrap.activate()),O){this.deactivateTrap();return}b&&this.focusTrap.pause(),n&&this.focusTrap.unpause()}else u.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var u=this,w=this.props.children?j.Children.only(this.props.children):void 0;if(w){if(w.type&&w.type===j.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var O=function(r){var c=u.props.containerElements;w&&(z>=19?typeof w.props.ref=="function"?w.props.ref(r):w.props.ref&&(w.props.ref.current=r):typeof w.ref=="function"?w.ref(r):w.ref&&(w.ref.current=r)),u.focusTrapElements=c||[r]},b=j.cloneElement(w,{ref:O});return b}return null}}])})(j.Component);return $.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:H},Y.exports=$,Y.exports.FocusTrap=$,Y.exports}var at=rt();exports.focusTrapReactExports=at;