react-md
Version:
This is the full react-md library bundled together for convenience.
7 lines • 881 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e=e||self).ReactMD={},e.React,e.ReactDOM)}(this,(function(e,t,r){"use strict";var n="default"in t?t.default:t,o="default"in r?r.default:r;function a(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var c=a((function(e){
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){var t={}.hasOwnProperty;function r(){for(var e=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)&&o.length){var c=r.apply(null,o);c&&e.push(c)}else if("object"===a)for(var i in o)t.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r}()}));function i(e){var n=e.into,o=e.intoId,a=e.children,c=t.useState(null),i=c[0],l=c[1];return t.useEffect((function(){var e=function(e,t){if("undefined"==typeof document)return null;var r=null;return void 0===e&&void 0===t?r=document.body:"string"==typeof t?r=document.getElementById(t):"string"==typeof e?r=document.querySelector(e):"function"==typeof e?r=e():e&&(r=e),r}(n,o);i!==e&&l(e)}),[n,o,i]),i?r.createPortal(a,i):null}try{var l=require("prop-types");i.propTypes={into:l.oneOfType([l.string,l.func,l.object]),intoId:l.string,children:l.node}}catch(e){}function s(e){var t=e.portal,r=e.portalInto,o=e.portalIntoId,a=e.children;return t||r||o?n.createElement(i,{into:r,intoId:o},a):a}try{var f=require("prop-types");s.propTypes={portal:f.bool,portalInto:f.oneOfType([f.string,f.func,f.object]),portalIntoId:f.string,children:f.node}}catch(e){}var u=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,p=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function h(e){if(!u.test(e)&&!p.test(e))throw new TypeError("Invalid color string.");var t=(e=e.replace(u,(function(e,t,r,n){return""+t+t+r+r+n+n}))).match(p)||[];return[parseInt(t[1]||"",16)||0,parseInt(t[2]||"",16)||0,parseInt(t[3]||"",16)||0]}function d(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function v(e){var t=h(e),r=t[0],n=t[1],o=t[2];return.2126*d(r)+.7152*d(n)+.0722*d(o)}function m(e,t){var r=v(e)+.05,n=v(t)+.05;return Math.max(r,n)/Math.min(r,n)}var y=function(){},b=!1;function g(){if("undefined"==typeof window)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return window.addEventListener("testSupportsPassive",y,t),window.removeEventListener("testSupportsPassive",y,t),b=e,e}g();var O=Object.freeze({__proto__:null,update:g,get isSupported(){return b}}),E=[];function w(e,t,r,n){void 0===t&&(t=window),void 0===r&&(r=!1);var o=[],a=function(e,t){var r=!1,n=function(e){return function(){for(var n=0;n<t.length;n+=1)t[n](e);r=!1}};return function(t){e?r||(r=!0,window.requestAnimationFrame(n(t))):n(t)()}}(r,o);return{add:function(r){o.length||t.addEventListener(e,a,n),-1===o.indexOf(r)&&o.push(r)},remove:function(r){var c=o.indexOf(r);c>=0&&(o.splice(c,1),o.length||t.removeEventListener(e,a,n))}}}function z(e,t,r,n){void 0===t&&(t=window),void 0===r&&(r="resize"===e||"scroll"===e);var o=E.findIndex((function(o){return o.type===e&&o.target===t&&o.options===n&&o.throttle===r}));return-1===o&&(E.push({type:e,target:t,options:n,throttle:r,handler:w(e,t,r,n)}),o=E.length-1),E[o].handler}var j=function(){return(j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function V(e,t,r,n,o,a){void 0===o&&(o=!1),t[(e?"add":"remove")+"EventListener"]("touch"+r,n,b?j({passive:!0,capture:o},a):o)}function S(e){var r=t.useRef(e);return t.useEffect((function(){r.current=e})),r}function M(e){var r=e.enabled,n=void 0===r||r,o=e.onScroll,a=e.element,c=e.options,i=void 0===c?!!b&&{passive:!0}:c,l=S(o);t.useEffect((function(){if(n){var e=z("scroll",a||window,!0,i),t=function(e){return l.current(e)};return e.add(t),function(){e.remove(t)}}}),[n,a,i])}function H(e){var r=t.useState(e),n=r[0],o=r[1],a=S(n);return[n,t.useCallback((function(){a.current||o(!0)}),[]),t.useCallback((function(){a.current&&o(!1)}),[]),t.useCallback((function(){o((function(e){return!e}))}),[]),o]}function P(){var e=function(e){void 0===e&&(e=1200);var r=t.useState(0),n=r[0],o=r[1],a=S(n),c=t.useRef(!1),i=t.useCallback((function(){o(Date.now()),c.current=!1}),[]),l=t.useCallback((function(){var t=a.current;c.current||Date.now()-t<e?c.current=!1:o(0)}),[e]);return t.useEffect((function(){return window.addEventListener("touchstart",i,!0),function(){window.removeEventListener("touchstart",i,!0)}}),[i]),t.useEffect((function(){if(0!==n){var e=function(){c.current=!0};return window.addEventListener("mousemove",l,!0),window.addEventListener("contextmenu",e,!0),function(){window.removeEventListener("mousemove",l,!0),window.removeEventListener("contextmenu",e,!0)}}c.current=!1}),[n,l]),0!==n}(),r=function(){var e=H(!1),r=e[0],n=e[1],o=e[2];return t.useEffect((function(){if(!r)return window.addEventListener("keydown",n,!0),function(){window.removeEventListener("keydown",n,!0)}}),[r,n]),t.useEffect((function(){if(r)return window.addEventListener("mousedown",o,!0),window.addEventListener("touchstart",o,!0),function(){window.removeEventListener("mousedown",o,!0),window.removeEventListener("touchstart",o,!0)}}),[r,o]),r}();return e?"touch":r?"keyboard":"mouse"}var I=t.createContext("mouse"),C=t.createContext(!1);function R(){return t.useContext(I)}function x(e){return R()===e}function L(e){var r=e.children;if(t.useContext(C))throw new Error("Nested `InteractionModeListener` components");var o=P();return function(e){t.useEffect((function(){var t="rmd-utils--"+e;return document.body.classList.add(t),function(){document.body.classList.remove(t)}}),[e])}(o),n.createElement(I.Provider,{value:o},n.createElement(C.Provider,{value:!0},r))}try{var T=require("prop-types");L.propTypes={children:T.node.isRequired}}catch(e){}function N(e,t){if(!t)return e;var r=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(n,o){return r.call(t,o)&&t[o]&&(n=n+" "+e+"--"+o),n}),e)}function G(e){if(!e)throw new Error("bem requires a base block class but none were provided.");return function(t,r){if("string"!=typeof t&&r)throw new TypeError("bem does not support having two modifier arguments.");return t?"string"!=typeof t?N(e,t):N(e+"__"+t,r):e}}function A(e,r,n,o){void 0===n&&(n=!1),void 0===o&&(o="undefined"!=typeof window);var a=t.useState((function(){return void 0!==r?r:!(n||!o||"undefined"==typeof window)&&window.matchMedia(e).matches})),c=a[0],i=a[1];return t.useEffect((function(){if("undefined"!=typeof window&&!n){var t=window.matchMedia(e),r=function(e){var t=e.matches;return i(t)};return t.addListener(r),t.matches!==c&&i(t.matches),function(){return t.removeListener(r)}}}),[n,c,e]),c}var k=function(e,t){var r=typeof e;return"undefined"===r?"":"("+t+"-width: "+("number"===r?e+"px":e)+")"};function D(e){var r=e.min,n=e.max;return A(t.useMemo((function(){return"screen and "+[k(r,"min"),k(n,"max")].filter(Boolean).join(" and ")}),[r,n]))}var F=function(){var e,t=null===(e=window.screen.orientation)||void 0===e?void 0:e.type;if("string"==typeof t)return t;var r=window.screen;return r.availHeight>r.availWidth?"portrait-primary":"landscape-primary"};function _(e){var r=t.useState((function(){return e||("undefined"!=typeof window?F():"landscape-primary")})),n=r[0],o=r[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=function(){o(F())};return window.addEventListener("orientationchange",e),function(){return window.removeEventListener("orientationchange",e)}}}),[]),n}var q={isPhone:!1,isTablet:!1,isDesktop:!0,isLargeDesktop:!1,isLandscape:!0};var B=function(){return(B=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},K=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},W=t.createContext(B(B({},q),{__initialized:!1}));function U(){var e=t.useContext(W),r=e.__initialized,n=K(e,["__initialized"]);if(!r)throw new Error("Attempted to use the current `AppSizeContext` without mounting the `AppSizeListener` component beforehand.");return n}var Y=function(){return(Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},X=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Q=G("rmd-grid"),$=t.forwardRef((function(e,r){var o,a,i,l,s,f,u,p=e.style,h=e.className,d=e.clone,v=e.children,m=e.colSpan,y=e.colStart,b=e.colEnd,g=e.rowSpan,O=e.rowStart,E=e.rowEnd,w=e.phone,z=e.tablet,j=e.desktop,V=e.largeDesktop,S=X(e,["style","className","clone","children","colSpan","colStart","colEnd","rowSpan","rowStart","rowEnd","phone","tablet","desktop","largeDesktop"]),M=U(),H=M.isPhone,P=M.isTablet,I=M.isDesktop,C=M.isLargeDesktop,R=m,x=y,L=b,T=g,N=O,G=E,A=H&&w||P&&z||I&&j||C&&V;A&&(T=void 0===(o=A.rowSpan)?g:o,N=void 0===(a=A.rowStart)?O:a,G=void 0===(i=A.rowEnd)?E:i,R=void 0===(l=A.colSpan)?m:l,x=void 0===(s=A.colStart)?y:s,L=void 0===(f=A.colEnd)?b:f);var k=Y({gridColumnStart:x,gridColumnEnd:L,gridRowStart:N,gridRowEnd:T?"span "+T:G},p),D=c(Q("cell",((u={})[""+R]=R,u)),h);if(d&&t.isValidElement(v)){var F=t.Children.only(v);return t.cloneElement(F,{style:Y(Y({},F.props.style),k),className:c(D,F.props.className)})}return n.createElement("div",Y({},S,{ref:r,style:k,className:D}),v)}));try{var J=require("prop-types"),Z=J.shape({rowSpan:J.number,rowStart:J.oneOfType([J.number,J.string]),rowEnd:J.oneOfType([J.number,J.string]),colSpan:J.number,colStart:J.oneOfType([J.number,J.string]),colEnd:J.oneOfType([J.number,J.string])});$.propTypes={style:J.object,className:J.string,clone:J.bool,rowSpan:J.number,rowStart:J.oneOfType([J.number,J.string]),rowEnd:J.oneOfType([J.number,J.string]),colSpan:J.number,colStart:J.oneOfType([J.number,J.string]),colEnd:J.oneOfType([J.number,J.string]),phone:Z,tablet:Z,desktop:Z,largeDesktop:Z,children:J.node}}catch(e){}var ee=function(){return(ee=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},te=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},re=G("rmd-grid"),ne=t.forwardRef((function(e,r){var o,a=e.style,i=e.className,l=e.children,s=e.clone,f=void 0!==s&&s,u=e.wrapOnly,p=void 0!==u&&u,h=e.columns,d=e.phoneColumns,v=e.tabletColumns,m=e.desktopColumns,y=e.largeDesktopColumns,b=e.padding,g=e.gutter,O=e.minCellWidth,E=te(e,["style","className","children","clone","wrapOnly","columns","phoneColumns","tabletColumns","desktopColumns","largeDesktopColumns","padding","gutter","minCellWidth"]),w=U(),z=w.isPhone,j=w.isTablet,V=w.isDesktop,S=w.isLargeDesktop,M=ee(ee({padding:0!==b&&b||void 0,gridTemplateColumns:O?"repeat(auto-fill, minmax("+O+", 1fr))":void 0},a),((o={})["--rmd-grid-cols"]=z&&d||j&&v||S&&y||V&&m||h,o["--rmd-grid-gutter"]=g,o)),H=l;return(f||p)&&(H=t.Children.map(l,(function(e){return e&&n.createElement($,{clone:f},e)}))),n.createElement("div",ee({},E,{ref:r,style:M,className:c(re({"no-padding":0===b}),i)}),H)}));try{var oe=require("prop-types");ne.propTypes={style:oe.object,className:oe.string,clone:oe.bool,wrapOnly:oe.bool,columns:oe.number,phoneColumns:oe.number,tabletColumns:oe.number,desktopColumns:oe.number,largeDesktopColumns:oe.number,padding:oe.oneOfType([oe.number,oe.string]),gutter:oe.string,children:oe.node,minCellWidth:oe.string}}catch(e){}function ae(e,t){t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e))}var ce=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var o=n[r];e.call(t,o[1],o[0])}},t}()}(),ie="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,le="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),se="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(le):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var fe=["top","right","bottom","left","width","height","size","weight"],ue="undefined"!=typeof MutationObserver,pe=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var r=!1,n=!1,o=0;function a(){r&&(r=!1,e()),n&&i()}function c(){se(a)}function i(){var e=Date.now();if(r){if(e-o<2)return;n=!0}else r=!0,n=!1,setTimeout(c,t);o=e}return i}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){ie&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ue?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){ie&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;fe.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),he=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},de=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||le},ve=Ee(0,0,0,0);function me(e){return parseFloat(e)||0}function ye(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+me(e["border-"+r+"-width"])}),0)}function be(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return ve;var n=de(e).getComputedStyle(e),o=function(e){for(var t={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var o=n[r],a=e["padding-"+o];t[o]=me(a)}return t}(n),a=o.left+o.right,c=o.top+o.bottom,i=me(n.width),l=me(n.height);if("border-box"===n.boxSizing&&(Math.round(i+a)!==t&&(i-=ye(n,"left","right")+a),Math.round(l+c)!==r&&(l-=ye(n,"top","bottom")+c)),!function(e){return e===de(e).document.documentElement}(e)){var s=Math.round(i+a)-t,f=Math.round(l+c)-r;1!==Math.abs(s)&&(i-=s),1!==Math.abs(f)&&(l-=f)}return Ee(o.left,o.top,i,l)}var ge="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof de(e).SVGGraphicsElement}:function(e){return e instanceof de(e).SVGElement&&"function"==typeof e.getBBox};function Oe(e){return ie?ge(e)?function(e){var t=e.getBBox();return Ee(0,0,t.width,t.height)}(e):be(e):ve}function Ee(e,t,r,n){return{x:e,y:t,width:r,height:n}}var we=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ee(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Oe(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),ze=function(e,t){var r,n,o,a,c,i,l,s=(n=(r=t).x,o=r.y,a=r.width,c=r.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(i.prototype),he(l,{x:n,y:o,width:a,height:c,top:o,right:n+a,bottom:c+o,left:n}),l);he(this,{target:e,contentRect:s})},je=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new ce,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof de(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new we(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof de(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new ze(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Ve="undefined"!=typeof WeakMap?new WeakMap:new ce,Se=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=pe.getInstance(),n=new je(t,r,this);Ve.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){Se.prototype[e]=function(){var t;return(t=Ve.get(this))[e].apply(t,arguments)}}));var Me=void 0!==le.ResizeObserver?le.ResizeObserver:Se,He=function(){return(He=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Pe(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function Ie(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}function Ce(e){var r=e.disableHeight,n=void 0!==r&&r,o=e.disableWidth,a=void 0!==o&&o,c=e.onResize,i=e.target;t.useEffect((function(){if(!n||!a){var e=function(e){return function(e){return!!e&&void 0!==e.current}(e)?e.current:function(e){return"function"==typeof e}(e)?e():"string"==typeof e?document.querySelector(e):e}(i);if(e){var t,r=new Me((function(e){for(var r=0;r<e.length;r+=1){var o=e[r],i=o.target,l=o.contentRect,s={height:l.height,width:l.width,scrollHeight:i.scrollHeight,scrollWidth:i.scrollWidth},f=Pe(t,s),u=Ie(t,s);t=s,(f&&!n||u&&!a)&&c(He(He({},s),{element:i}))}}));return r.observe(e),function(){r.disconnect()}}}}),[i,c,n,a])}var Re=function(){return(Re=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},xe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Le=G("rmd-grid-list"),Te=t.forwardRef((function(e,r){var o=e.className,a=e.children,i=e.square,l=void 0!==i&&i,s=e.clone,f=void 0!==s&&s,u=xe(e,["className","children","square","clone"]),p=c(Le("cell",{square:l}),o);if(f&&t.isValidElement(a)){var h=t.Children.only(a);return t.cloneElement(h,{className:c(p,h.props.className)})}return n.createElement("div",Re({},u,{ref:r,className:p}),a)}));try{var Ne=require("prop-types");Te.propTypes={clone:Ne.bool,square:Ne.bool,className:Ne.string,children:Ne.node}}catch(e){}var Ge={height:void 0,width:void 0};function Ae(e,t){if(void 0===e&&(e="width"),void 0===t&&(t=!1),"undefined"==typeof window)return-1;var r=Ge[e];if(!t&&"number"==typeof r)return r;var n=document.createElement("div");n.style.visibility="hidden",n.style.overflow="scroll",document.body.appendChild(n);var o=document.createElement("div");n.appendChild(o);var a="width"===e?"offsetWidth":"offsetHeight";return r=n[a]-o[a],Ge[e]=r,document.body.removeChild(n),r}var ke=function(){return(ke=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},De=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Fe=G("rmd-grid-list"),_e=t.forwardRef((function(e,r){var o,a=e.style,i=e.className,l=e.children,s=e.clone,f=void 0!==s&&s,u=e.wrapOnly,p=void 0!==u&&u,h=e.cellMargin,d=e.defaultSize,v=e.maxCellSize,m=void 0===v?150:v,y=e.containerPadding,b=void 0===y?16:y,g=e.disableHeightObserver,O=void 0!==g&&g,E=e.disableWidthObserver,w=void 0!==E&&E,z=De(e,["style","className","children","clone","wrapOnly","cellMargin","defaultSize","maxCellSize","containerPadding","disableHeightObserver","disableWidthObserver"]),j=t.useState(d||{columns:-1,cellWidth:m}),V=j[0],S=j[1],M=t.useRef(null),H=t.useCallback((function(){if(M.current){var e=M.current.getBoundingClientRect().width;e-=b,M.current.offsetHeight<M.current.scrollHeight&&(e-=Ae("width"));var t=Math.ceil(e/m);S({cellWidth:e/t,columns:t})}}),[m,b]),P=t.useCallback((function(e){ae(e,r),M.current=e,e&&H()}),[r,H]);Ce({disableHeight:O,disableWidth:w,onResize:H,target:M});var I=ke(ke({},a),((o={})["--rmd-cell-size"]=V.cellWidth+"px",o["--rmd-cell-margin"]=h||void 0,o)),C=null;return C=function(e){return"function"==typeof e}(l)?l(V):f||p?t.Children.map(l,(function(e){return e&&n.createElement(Te,{clone:f},e)})):l,n.createElement("div",ke({},z,{ref:P,style:I,className:c(Fe(),i)}),C)}));try{var qe=require("prop-types");_e.propTypes={style:qe.object,clone:qe.bool,wrapOnly:qe.bool,className:qe.string,children:qe.oneOfType([qe.func,qe.node]),cellMargin:qe.string,maxCellSize:qe.number,defaultSize:qe.oneOfType([qe.shape({columns:qe.number.isRequired,cellWidth:qe.number.isRequired}),qe.func]),containerPadding:qe.number,disableHeightObserver:qe.bool,disableWidthObserver:qe.bool}}catch(e){}function Be(e,t,r,n){e=e.toUpperCase();for(var o=r;o<n;o+=1){if(0===t[o].toUpperCase().indexOf(e))return o}return-1}function Ke(e,t,r,n){void 0===n&&(n=!0);var o=Be(e,t,r+1,t.length);-1===o&&(o=Be(e,t,0,r+(n?1:0)));return o}var We=function(){return(We=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ue(e,t){return Object.keys(t).reduce((function(e,r){return void 0===e[r]&&(e[r]=t[r]),e}),We({},e))}function Ye(e,t,r,n){return void 0===t&&(t=!1),void 0===r&&(r=!1),void 0===n&&(n=!1),t&&(e=e.toLowerCase()),n?e=e.replace(/\s/g,""):r&&(e=e.trim()),e}function Xe(e,t){switch(void 0===t&&(t="value"),typeof e){case"string":return e;case"number":return Number.isNaN(e)?"":""+e;case"function":return Xe(e(),t);case"object":return e?Xe(e[t],t):"";default:return""}}var Qe=Xe,$e={getItemValue:Qe,valueKey:"value",trim:!0,ignoreWhitespace:!1};function Je(e,t,r){void 0===r&&(r={});var n=Ue(r,$e),o=n.getItemValue,a=n.valueKey,c=n.trim,i=n.ignoreWhitespace,l=n.startsWith,s=void 0!==l&&l;return(e=Ye(e,!0,c,i))&&t.length?t.filter((function(t){var r=Ye(o(t,a),!0,c,i);return s?0===r.indexOf(e):-1!==r.indexOf(e)})):t}function Ze(e){return new RegExp((""+e).split("").join("\\w*").replace(/(\(|\||\)|\\(?!w\*)|\[|\|-|\.|\^|\+|\$|\?|^(?!w)\*)/g,"\\$1").replace(/\*\*/g,"*\\*"),"i")}function et(e,t,r){void 0===r&&(r={});var n=Ue(r,$e),o=n.getItemValue,a=n.valueKey,c=n.trim,i=n.ignoreWhitespace;if(e=Ye(e,!1,c,i),!t.length||!e)return t;var l=Ze(e);return t.filter((function(e){var t=Ye(o(e,a),!1,c,i);return t.length&&t.match(l)}))}function tt(e,r){void 0===r&&(r=500);var n=t.useRef(e),o=t.useRef(),a=t.useCallback((function(){window.clearTimeout(o.current),n.current=e}),[e]),c=t.useCallback((function(e){n.current=e,window.clearTimeout(o.current),o.current=window.setTimeout(a,r)}),[r,a]);return[n,c,a]}function rt(e){var r=e.items,n=e.onChange,o=e.onKeyDown,a=e.resetTime,c=void 0===a?500:a,i=e.searchIndex,l=e.valueKey,s=void 0===l?"value":l,f=e.getItemValue,u=void 0===f?Qe:f,p=e.findMatchIndex,h=void 0===p?Ke:p,d=tt("",c),v=d[0],m=d[1],y=t.useMemo((function(){return r.map((function(e){return u(e,s)}))}),[r,u,s]);return t.useCallback((function(e){o&&o(e);var t=e.key,a=e.altKey,c=e.ctrlKey,l=e.metaKey;if(!(a||c||l||t.length>1||!v.current&&" "===t)){var s=t;v.current!==t&&(s=""+v.current+t),m(s);var f=h(s,y,i,!0);if(f!==i&&-1!==f){var u={index:f,item:r[f],items:r,query:s,target:e.currentTarget};n(u)}}}),[i,h,r,n,o,m,v,y])}var nt=function(){return(nt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ot(e){var r=e.children,o=e.onChange,a=e.phoneMaxWidth,c=void 0===a?"47.9375em":a,i=e.tabletMinWidth,l=void 0===i?"48em":i,s=e.tabletMaxWidth,f=void 0===s?"64em":s,u=e.desktopMinWidth,p=void 0===u?"64.0625em":u,h=e.desktopLargeMinWidth,d=void 0===h?"80em":h,v=e.defaultSize,m=void 0===v?q:v,y=function(e){var r=void 0===e?{}:e,n=r.phoneMaxWidth,o=void 0===n?"47.9375em":n,a=r.tabletMinWidth,c=void 0===a?"48em":a,i=r.tabletMaxWidth,l=void 0===i?"64em":i,s=r.desktopMinWidth,f=void 0===s?"64.0625em":s,u=r.desktopLargeMinWidth,p=void 0===u?"80em":u,h=r.defaultSize,d=void 0===h?q:h;if("undefined"==typeof window)return d;var v=D({min:f}),m=D({min:p}),y=D({min:c,max:l}),b=D({max:o}),g=v,O=!v&&y,E=!O&&!g&&b,w=_().includes("landscape"),z=m,j=t.useState(d),V=j[0],S=j[1];return t.useEffect((function(){V.isPhone===E&&V.isTablet===O&&V.isDesktop===g&&V.isLargeDesktop===z&&V.isLandscape===w||(E||O||g||z)&&S({isPhone:E,isTablet:O,isDesktop:g,isLargeDesktop:z,isLandscape:w})}),[E,O,g,z,w,V]),V}({phoneMaxWidth:c,tabletMaxWidth:f,tabletMinWidth:l,desktopMinWidth:p,desktopLargeMinWidth:d,defaultSize:m}),b=t.useRef(y);t.useEffect((function(){!o||m.isPhone===y.isPhone&&m.isTablet===y.isTablet&&m.isDesktop===y.isDesktop&&m.isLargeDesktop===y.isLargeDesktop&&m.isLandscape===y.isLandscape||o(y,m)}),[]),t.useEffect((function(){b.current!==y&&(o&&o(y,b.current),b.current=y)}));var g=t.useMemo((function(){return nt(nt({},y),{__initialized:!0})}),[y]);return n.createElement(W.Provider,{value:g},r)}try{var at=require("prop-types"),ct=at.oneOfType([at.string,at.number]);ot.propTypes={children:at.node.isRequired,onChange:at.func,phoneMaxWidth:ct,tabletMinWidth:ct,tabletMaxWidth:ct,desktopMinWidth:ct,desktopLargeMinWidth:ct,defaultSize:at.shape({isPhone:at.bool.isRequired,isTablet:at.bool.isRequired,isDesktop:at.bool.isRequired,isLargeDesktop:at.bool.isRequired,isLandscape:at.bool.isRequired})}}catch(e){}function it(e){var r=e.disableHeight,o=void 0!==r&&r,a=e.disableWidth,c=void 0!==a&&a,i=e.className,l=e.component,s=void 0===l?"span":l,f=e.target,u=e.onResize,p=t.useState(null),h=p[0],d=p[1];Ce({disableHeight:o,disableWidth:c,target:f||h,onResize:u});var v=t.useCallback((function(e){d(e?e.parentElement:null)}),[]);return null===f||f?null:n.createElement(s,{className:i,"aria-hidden":"true",ref:v})}try{var lt=require("prop-types");it.propTypes={disableHeight:lt.bool,disableWidth:lt.bool,className:lt.string,component:lt.oneOfType([lt.string]),target:lt.oneOfType([lt.string,lt.func,lt.object])}}catch(e){}function st(e){var r=e.onResize,n=e.options,o=e.immediate,a=e.enabled,c=void 0===a||a,i=S(r);t.useEffect((function(){if(c){var e=z("resize",window,!0,n),t=function(e){return i.current(e)};return e.add(t),o&&"undefined"!=typeof window&&window.dispatchEvent(new UIEvent("resize")),function(){e.remove(t)}}}),[n,c])}function ft(e){var t=e.onResize,r=e.options,n=e.immediate;return st({onResize:t,options:r,immediate:void 0===n?"undefined"!=typeof window:n,enabled:!0}),null}try{var ut=require("prop-types");ft.propTypes={onResize:ut.func.isRequired,options:ut.object,immediate:ut.bool}}catch(e){}var pt=function(e){var t=e,r=t.children,n=t.fallback,o=U(),a=o.isPhone,c=o.isTablet;return a||c?r:n},ht=function(e){var t=e,r=t.children,n=t.fallback;return U().isPhone?r:n},dt=function(e){var t=e,r=t.children,n=t.fallback;return U().isTablet?r:n},vt=function(e){var t=e,r=t.children,n=t.fallback;return U().isDesktop?r:n},mt={fallback:null};function yt(e){if(!e)return null;if(/(tree|list)item/.test(e.getAttribute("role")||"")){if(n=e.querySelector(".rmd-tree-item__content, .rmd-item-text"))return n}else if("file"===e.getAttribute("type")){var t=document.querySelector('[for="'+e.id+'"]');if(t)return t}var r=e.getAttribute("data-sizing-selector");if(r){var n;if(n=e.querySelector(r))return n;throw new Error("Unable to find a child element using the `data-sizing-selector`")}return e}function bt(e){var t=document.documentElement||{clientHeight:0,clientWidth:0};return"width"===e?window.innerWidth||t.clientWidth:window.innerHeight||t.clientHeight}function gt(e){return"number"==typeof e?e+"px":""}function Ot(e,t){void 0===t&&(t={});var r=e.cloneNode(!0);r.removeAttribute("id"),r.removeAttribute("role"),r.style.position="fixed",r.style.visibility="hidden",r.style.left=gt(t.left),r.style.top=gt(t.top),r.style.right=gt(t.right),r.style.bottom=gt(t.bottom),r.style.webkitTransform="none",r.style.transform="none";var n=e.parentElement||document.body;n.appendChild(r);var o=r.getBoundingClientRect();return n.removeChild(r),o}function Et(e){var t=e.xMargin,r=e.elWidth,n=e.initialX,o=e.containerRect;return(null!=n?n:o.left)-r-t}function wt(e){var t=e.xMargin,r=e.initialX,n=e.containerRect;return(null!=r?r:n.left)+t}function zt(e){var t=e.xMargin,r=e.elWidth,n=e.initialX,o=e.containerRect;return(null!=n?n:o.left+o.width)-r-t}function jt(e){var t=e.xMargin,r=e.initialX,n=e.containerRect;return(null!=r?r:n.left+n.width)+t}function Vt(e){var t=e.yMargin,r=e.initialY,n=e.elHeight,o=e.containerRect;return(null!=r?r:o.top)-n-t}function St(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top)+t}function Mt(e){var t=e.yMargin,r=e.initialY,n=e.elHeight,o=e.containerRect;return(null!=r?r:o.top+o.height)-n-t}function Ht(e){var t=e.yMargin,r=e.initialY,n=e.containerRect;return(null!=r?r:n.top+n.height)+t}function Pt(e){var t=e.x,r=e.vw,n=e.vwMargin,o=e.xMargin,a=e.width,c=e.elWidth,i=e.initialX,l=e.containerRect,s=e.disableSwapping;if("min"===a||"equal"===a)return function(e){var t,r,n=e.x,o=e.vw,a=e.elWidth,c=e.xMargin,i=e.vwMargin,l=e.initialX,s=e.containerRect,f=e.isMinWidth,u=null!=l?l:s.left+c,p=s.width-2*c;return f&&(t=p,p=void 0,u+a>o-i&&(r=i)),{left:u,right:r,width:p,minWidth:t,actualX:n}}({x:t,vw:r,vwMargin:n,xMargin:o,elWidth:c,initialX:i,containerRect:l,isMinWidth:"min"===a});if(c>r-2*n)return{left:n,right:n,actualX:t};var f={vwMargin:n,xMargin:o,elWidth:c,initialX:i,screenRight:r-n,containerRect:l,disableSwapping:s};switch(t){case"left":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,o=e.disableSwapping,a=Et(e),c="left";if(a>=t)return{actualX:c,left:a};var i=jt(e);return o||i+n>r?a=t:(a=i,c="right"),{actualX:c,left:a}}(f);case"inner-left":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,o=e.disableSwapping,a=wt(e),c="inner-left";if(a+n<=r)return{actualX:c,left:a};var i=zt(e);return o||i<t?a=t:(a=i,c="inner-right"),{actualX:c,left:a}}(f);case"center":return function(e){var t=e.vwMargin,r=e.screenRight,n=e.elWidth,o=function(e){var t=e.elWidth,r=e.initialX,n=e.containerRect,o=n.width/2,a=t/2;return(null!=r?r:n.left+o)-a}(e);return o<t?o=t:(o+n>r||o<t)&&(o=r-n),{actualX:"center",left:o}}(f);case"inner-right":return function(e){var t=e.screenRight,r=e.vwMargin,n=e.elWidth,o=e.disableSwapping,a=zt(e),c="inner-right";if(a>=r)return{actualX:c,left:a};var i=wt(e);return o||i+n>t?a=t-n:(a=i,c="inner-left"),{actualX:c,left:a}}(f);case"right":return function(e){var t=e.screenRight,r=e.vwMargin,n=e.elWidth,o=e.disableSwapping,a=jt(e),c="right";if(a+n<=t)return{actualX:c,left:a};var i=Et(e);return o||i<r?a=t-n:(a=i,c="left"),{actualX:c,left:a}}(f);default:throw new Error("This should never happen")}}function It(e){var t=e.y,r=e.vh,n=e.vhMargin,o=e.yMargin,a=e.elHeight,c=e.initialY,i=e.containerRect,l=e.disableSwapping,s=e.preventOverlap,f=e.disableVHBounds;if(!f&&!s&&a>r-2*n)return{top:n,bottom:n,actualY:"center"};var u={vhMargin:n,yMargin:o,elHeight:a,initialY:c,containerRect:i,screenBottom:r-n,preventOverlap:s,disableSwapping:l,disableVHBounds:f};switch(t){case"above":return function(e){var t=e.yMargin,r=e.vhMargin,n=e.screenBottom,o=e.elHeight,a=e.containerRect,c=e.preventOverlap,i=e.disableSwapping,l=e.disableVHBounds,s=Vt(e),f="above";if(l)return{actualY:f,top:Math.max(0,s)};if(s>r)return{actualY:f,top:s};var u,p=Ht(e);return i||p+o>n?s=r:(f="below",s=p),c&&"above"===f&&s+o>a.top&&(u=window.innerHeight-a.top+t),{actualY:f,top:s,bottom:u}}(u);case"top":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,c=St(e),i="top";if(a||c+n<=r)return{actualY:i,top:c};var l=Mt(e);return o||l<t?c=t:(i="bottom",c=l),{actualY:i,top:c}}(u);case"center":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableVHBounds,a=function(e){var t=e.elHeight,r=e.initialY,n=e.containerRect,o=n.height/2,a=t/2;return(null!=r?r:n.top+o)-a}(e);return o?{actualY:"center",top:Math.max(0,a)}:((a=Math.max(t,a))+n>r&&(a=r-n),{actualY:"center",top:a})}(u);case"bottom":return function(e){var t=e.vhMargin,r=e.screenBottom,n=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,c=Mt(e),i="bottom";if(a||c>t)return{actualY:i,top:c};var l=St(e);return o||l+n>r?c=r-n:(i="top",c=l),{actualY:i,top:c}}(u);case"below":return function(e){var t=e.yMargin,r=e.vhMargin,n=e.elHeight,o=e.screenBottom,a=e.containerRect,c=e.preventOverlap,i=e.disableSwapping,l=e.disableVHBounds,s=Ht(e),f="below";if(l||s+n<=o)return{actualY:f,top:s};if(c){var u=a.top-t;return i||u<o-s?{actualY:f,top:s,bottom:r}:{actualY:"above",top:Math.max(r,u-n),bottom:bt("height")-u}}var p=Vt(e);return i||p<r?s=o-n:(f="above",s=p),{actualY:f,top:s}}(u);default:throw new Error("This should never happen")}}function Ct(e){var t="0";switch(e.x){case"right":case"inner-left":t="0";break;case"center":t="50%";break;case"left":case"inner-right":t="100%";break;default:t="0"}var r="0";switch(e.y){case"above":case"bottom":r="100%";break;case"center":r="50%";break;case"below":case"top":r="0";break;default:r="0"}return t+" "+r}function Rt(e){var t=e.container,r=e.element,n=e.anchor,o=void 0===n?{}:n,a=e.initialX,c=e.initialY,i=e.vwMargin,l=void 0===i?16:i,s=e.vhMargin,f=void 0===s?16:s,u=e.xMargin,p=void 0===u?0:u,h=e.yMargin,d=void 0===h?0:h,v=e.width,m=void 0===v?"auto":v,y=e.preventOverlap,b=void 0!==y&&y,g=e.transformOrigin,O=void 0!==g&&g,E=e.disableSwapping,w=void 0!==E&&E,z=e.disableVHBounds,j=void 0!==z&&z;t=yt(t);var V={x:o.x||"center",y:o.y||"below"};if("auto"!==m&&"center"!==V.x)throw new Error('Unable to use a calculated width when the horizontal anchor is not `"center"`.');if(b&&"above"!==V.y&&"below"!==V.y)throw new Error('Unable to prevent overlap when the vertical anchor is not `"above"` or `"below"`');if(!t||!r)return{actualX:V.x,actualY:V.y};var S=t.getBoundingClientRect(),M=bt("height"),H=bt("width"),P=Ot(r),I=P.height,C=P.width;j&&(r.closest("[role='dialog']")||(c=(null!=c?c:0)+window.scrollY));var R=Pt({x:V.x,vw:H,vwMargin:l,xMargin:p,width:m,elWidth:C,initialX:a,containerRect:S,disableSwapping:w}),x=R.left,L=R.right,T=R.width,N=R.minWidth,G=R.actualX,A=It({y:V.y,vh:M,vhMargin:f,yMargin:d,initialY:c,elHeight:I,containerRect:S,disableSwapping:w,preventOverlap:b,disableVHBounds:j}),k=A.top,D=A.bottom,F=A.actualY;return{actualX:G,actualY:F,style:{left:x,top:k,right:L,bottom:D,width:T,minWidth:N,position:j?"absolute":"fixed",transformOrigin:O?Ct({x:G,y:F}):void 0}}}pt.defaultProps=mt,ht.defaultProps=mt,dt.defaultProps=mt,vt.defaultProps=mt;var xt={x:"inner-left",y:"top"},Lt={x:"inner-right",y:"top"},Tt={x:"right",y:"top"},Nt={x:"center",y:"center"},Gt={x:"center",y:"below"},At={x:"inner-right",y:"below"},kt=["BUTTON","TEXTAREA","SELECT"].reduce((function(e,t){return e+","+t+":not([disabled])"}),'a[href],area[href],input:not([disabled]):not([type="hidden"])')+",[tabindex]",Dt=kt+':not([tabindex="-1"])';function Ft(e,t){return void 0===t&&(t=!1),Array.from(e.querySelectorAll(t?kt:Dt))}function _t(e,t){if(t=yt(t),e&&t){var r=t.offsetTop;t.offsetParent!==e&&(r-=e.offsetTop);var n=r+t.offsetHeight;n>e.offsetHeight+e.scrollTop?e.scrollTop=n-e.offsetHeight:r<e.scrollTop&&(e.scrollTop=r)}}function qt(e,t,r,n,o){var a;switch(void 0===r&&(r=!1),void 0===n&&(n=!1),o&&o.length||(o=Ft(e,r)),t){case"first":a=o[0];break;case"last":a=o[o.length-1];break;default:a=e.querySelector(t)}if(!a)throw new Error("Unable to find a focusable element");a.focus({preventScroll:n}),n||e===document||_t(e,a)}function Bt(e,r,n,o,a){void 0===n&&(n=!1),void 0===o&&(o=!1),void 0===a&&(a=!1),t.useEffect((function(){if(!a){var t=window.requestAnimationFrame((function(){var t=function(e){var t=null;return e&&(t=e instanceof HTMLElement?e:e.current),t}(e);t&&(t.focus({preventScroll:n}),qt(t,r,o,n))}));return function(){window.cancelAnimationFrame(t)}}}),[r,a,e,o,n])}function Kt(e,r,n){void 0===r&&(r=void 0),void 0===n&&(n=null);var o=t.useRef({disabled:e,fallback:r});t.useEffect((function(){o.current={disabled:e,fallback:r}})),t.useEffect((function(){if(!e){var t=n||document.activeElement,r=t.closest('[role="menu"]'),a=null;if(r&&!(a=document.getElementById(r.id.replace(/-menu$/,"")))){var c=(r.getAttribute("aria-labelledby")||"").split(" ").map((function(e){return"#"+e+"[tabindex]"})).join(",");a=c?document.querySelector(c):null}return function(){var e=o.current,c=e.fallback;if(!e.disabled)if(!r||!a||n||c||document.contains(t)||!document.contains(a)){var i=t;if(document.contains(i)||(i=n&&document.contains(n)?n:null),!i&&c)switch(typeof c){case"string":i=document.querySelector(c);break;case"function":i=c();break;default:i=c}i&&!document.contains(i)&&(i=null),i&&i.focus()}else a.focus()}}}),[])}var Wt,Ut,Yt=function(){return(Yt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Xt=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},Qt=t.forwardRef((function(e,r){var o=e.children,a=e.onKeyDown,c=e.component,i=void 0===c?"div":c,l=e.defaultFocus,s=void 0===l?"first":l,f=e.disableFocusCache,u=void 0!==f&&f,p=e.disableFocusOnMount,h=void 0!==p&&p,d=e.disableFocusOnMountScroll,v=void 0!==d&&d,m=e.disableFocusOnUnmount,y=void 0!==m&&m,b=e.disableTabFocusWrap,g=void 0!==b&&b,O=e.unmountFocusFallback,E=void 0===O?"":O,w=Xt(e,["children","onKeyDown","component","defaultFocus","disableFocusCache","disableFocusOnMount","disableFocusOnMountScroll","disableFocusOnUnmount","disableTabFocusWrap","unmountFocusFallback"]),z=t.useRef(null),j=t.useCallback((function(e){ae(e,r),z.current=e}),[r]);Kt(y,E),Bt(z,s,v,!1,h);var V=function(e){var r=e.disabled,n=void 0!==r&&r,o=e.disableFocusCache,a=void 0!==o&&o,c=e.onKeyDown,i=t.useRef([]),l=t.useCallback((function(e){if(c&&c(e),"Tab"===e.key){!a&&i.current.length||(i.current=Ft(e.currentTarget));var t=i.current,r=t.length;0!==r&&(1===r?e.preventDefault():t[0]===e.target&&e.shiftKey?(e.preventDefault(),t[r-1].focus()):t[r-1]!==e.target||e.shiftKey||(e.preventDefault(),t[0].focus()))}}),[c,a]);return n?c:l}({disabled:g,disableFocusCache:u,onKeyDown:a});return n.createElement(i,Yt({},w,{onKeyDown:V,ref:j}),o)}));try{var $t=require("prop-types");Qt.propTypes={disableFocusCache:$t.bool,disableFocusOnMount:$t.bool,disableFocusOnUnmount:$t.bool,disableTabFocusWrap:$t.bool,defaultFocus:$t.oneOfType([$t.oneOf(["first","last"]),$t.string]),component:$t.oneOfType([$t.string,$t.func,$t.object]),unmountFocusFallback:$t.oneOfType([$t.string,$t.func,$t.object]),children:$t.node,onKeyDown:$t.func,disableFocusOnMountScroll:$t.bool}}catch(e){}(Wt=e.IncrementMovementKey||(e.IncrementMovementKey={})).ArrowUp="ArrowUp",Wt.ArrowDown="ArrowDown",Wt.ArrowLeft="ArrowLeft",Wt.ArrowRight="ArrowRight",Wt.PageDown="PageDown",Wt.PageUp="PageUp",Wt.ShiftArrowUp="Shift+ArrowUp",Wt.ShiftArrowDown="Shift+ArrowDown",Wt.ShiftArrowLeft="Shift+ArrowLeft",Wt.ShiftArrowRight="Shift+ArrowRight",Wt.AltArrowDown="Alt+ArrowDown",Wt.AltArrowUp="Alt+ArrowUp",Wt.AltArrowLeft="Alt+ArrowLeft",Wt.AltArrowRight="Alt+ArrowRight",Wt.AltPageDown="Alt+PageDown",Wt.AltPageUp="Alt+PageUp",Wt.ControlArrowDown="Control+ArrowDown",Wt.ControlArrowUp="Control+ArrowUp",(Ut=e.JumpMovementKey||(e.JumpMovementKey={})).Home="Home",Ut.End="End",Ut.AltHome="Alt+Home",Ut.AltEnd="Alt+End",Ut.ControlHome="Control+Home",Ut.ControlEnd="Control+End",Ut.ControlShiftHome="Control+Shift+Home",Ut.ControlShiftEnd="Control+Shift+End";var Jt=function(){return(Jt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zt={loopable:!0,searchable:!0,incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End]},er=Jt(Jt({},Zt),{incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft]}),tr=Jt(Jt({},Zt),{loopable:!1}),rr=Jt(Jt({},er),{loopable:!1}),nr={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[],jumpToLastKeys:[],searchable:!1},or={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[],jumpToLastKeys:[],searchable:!1},ar={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home,e.JumpMovementKey.ControlShiftHome],jumpToLastKeys:[e.JumpMovementKey.End,e.JumpMovementKey.ControlShiftEnd],loopable:!0,searchable:!0},cr={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[e.JumpMovementKey.Home,e.JumpMovementKey.ControlShiftHome],jumpToLastKeys:[e.JumpMovementKey.End,e.JumpMovementKey.ControlShiftEnd],loopable:!0,searchable:!0},ir={incrementKeys:[e.IncrementMovementKey.ArrowRight],decrementKeys:[e.IncrementMovementKey.ArrowLeft],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End],loopable:!0,searchable:!1},lr={incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovementKey.End],loopable:!0,searchable:!1},sr=Object.freeze({__proto__:null,VERTICAL_MENU:Zt,HORIZONTAL_MENU:er,VERTICAL_LISTBOX:tr,HORIZONTAL_LISTBOX:rr,VERTICAL_COMBOBOX:nr,HORIZONTAL_COMBOBOX:or,VERTICAL_TREE:ar,HORIZONTAL_TREE:cr,HORIZONTAL_TABS:ir,VERTICAL_TABS:lr});function fr(e,t,r,n){void 0===n&&(n=!1);var o=e+(r?1:-1);return n?o=Math.min(t,Math.max(0,o)):o>t?o=0:o<0&&(o=t),o}function ur(e,t){if(!e)throw new Error("The id must be a string with a length greater than 0");if(t<0)throw new RangeError("The provided index must be greater than 0");return e+"-item-"+(t+1)}function pr(e,t){return e.map((function(e){return{shiftKey:e.includes("Shift+"),metaKey:e.includes("Meta+"),ctrlKey:e.includes("Control+"),altKey:e.includes("Alt+"),key:e.replace(/(Shift|Meta|Alt|Control)\+/g,""),type:t}}))}function hr(e){var t=e.key,r=e.altKey,n=e.ctrlKey,o=e.metaKey,a=e.shiftKey;return e.type+"-"+[o&&"Meta",n&&"Control",a&&"Shift",r&&"Alt",t].filter(Boolean).join("+")}var dr=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],c=0,i=a.length;c<i;c++,o++)n[o]=a[c];return n};function vr(e){var r=e.onKeyDown,n=e.incrementKeys,o=e.decrementKeys,a=e.jumpToFirstKeys,c=e.jumpToLastKeys,i=e.stopPropagation,l=void 0===i||i,s=e.onChange,f=e.items,u=e.resetTime,p=e.findMatchIndex,h=e.focusedIndex,d=e.loopable,v=void 0===d||d,m=e.searchable,y=void 0===m||m,b=e.valueKey,g=void 0===b?"value":b,O=e.getItemValue,E=void 0===O?Qe:O,w=t.useMemo((function(){return dr(pr(n,"increment"),pr(o,"decrement"),pr(a,"first"),pr(c,"last"))}),[n,o,a,c]),z=t.useMemo((function(){return Array.from(f,(function(){return{current:null}}))}),[f]),j=rt({items:f,valueKey:g,getItemValue:E,onChange:function(e){s(e,z)},searchIndex:h,resetTime:u,findMatchIndex:p}),V=t.useCallback((function(e){y&&j(e),r&&r(e);var t=e.target,n=function(e,t){var r=e.key,n=e.altKey,o=e.ctrlKey,a=e.metaKey,c=e.shiftKey;return t.find((function(e){return e.key===r&&e.altKey===n&&e.ctrlKey===o&&e.metaKey===a&&e.shiftKey===c}))||null}(e,w);if(n&&t){e.preventDefault(),l&&e.stopPropagation();var o,a=n.type,c=f.length-1;switch(a){case"first":o=0;break;case"last":o=c;break;default:o=fr(h,c,"increment"===a,!v)}if(o!==h){var i={index:o,item:f[o],items:f,query:hr(n),target:e.currentTarget};s(i,z)}}}),[r,l,h,w,f,j,v,y,s,z]);return[z,V]}var mr=function(){return(mr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},yr=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};function br(e){var r=e.baseId,n=e.getId,o=void 0===n?ur:n,a=e.defaultFocusedIndex,c=void 0===a?-1:a,i=e.items,l=e.onChange,s=e.getItemValue,f=void 0===s?Qe:s,u=e.valueKey,p=void 0===u?"value":u,h=e.onKeyDown,d=e.onEnter,v=e.onSpace,m=yr(e,["baseId","getId","defaultFocusedIndex","items","onChange","getItemValue","valueKey","onKeyDown","onEnter","onSpace"]),y=t.useState(c),b=y[0],g=y[1],O=-1!==b?o(r,b):"",E=vr(mr(mr({},m),{valueKey:p,getItemValue:f,focusedIndex:b,items:i,onChange:function(e,t){l&&l(e,t);var r=e.index,n=e.target,o=t[r]&&t[r].current;o&&n&&n.scrollHeight>n.offsetHeight&&_t(n,o),g(r)},onKeyDown:function(e){h&&h(e);var t=w[b]&&w[b].current||null;d&&"Enter"===e.key?d(b,t):v&&" "===e.key&&(e.preventDefault(),v(b,t))}})),w=E[0],z=E[1];return{activeId:O,itemRefs:w,onKeyDown:z,focusedIndex:b,setFocusedIndex:g}}var gr=function(){return(gr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},O