UNPKG

react-md

Version:

This is the full react-md library bundled together for convenience.

7 lines 365 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("crypto")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","crypto"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactMD={},e.React,e.ReactDOM,e.crypto)}(this,(function(e,t,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(t),i=o(n),l=o(r),s={exports:{}}; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&e.push(i)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var l in o)t.call(o,l)&&o[l]&&e.push(l);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(s);var c=s.exports;function u(e){var r=e.into,o=e.intoId,a=e.children,i=t.useState(null),l=i[0],s=i[1];return t.useEffect((function(){var e=function(e,t){if("undefined"==typeof document)return null;var n=null;return void 0===e&&void 0===t?n=document.body:"string"==typeof t?n=document.getElementById(t):"string"==typeof e?n=document.querySelector(e):"function"==typeof e?n=e():e&&(n=e),n}(r,o);l!==e&&s(e)}),[r,o,l]),l?n.createPortal(a,l):null}function d(e){var t=e.portal,n=e.portalInto,r=e.portalIntoId,o=e.children;return t||n||r?a.default.createElement(u,{into:n,intoId:r},o):o}function f(e,t){t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e))}function p(e,t){if(!t)return e;var n=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(r,o){return n.call(t,o)&&t[o]&&(r=r+" "+e+"--"+o),r}),e)}function m(e){return function(t,n){return t?"string"!=typeof t?p(e,t):p(e+"__"+t,n):e}}var v=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function b(e){var t=(e=e.replace(v,(function(e,t,n,r){return""+t+t+n+n+r+r}))).match(y)||[];return[parseInt(t[1]||"",16)||0,parseInt(t[2]||"",16)||0,parseInt(t[3]||"",16)||0]}function h(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function g(e){var t=b(e),n=t[0],r=t[1],o=t[2];return.2126*h(n)+.7152*h(r)+.0722*h(o)}function O(e,t){var n=g(e)+.05,r=g(t)+.05;return Math.max(n,r)/Math.min(n,r)}var w=function(e){return function(e){return!!e&&void 0!==e.current}(e)?e.current:e};function E(e,t){return e=w(e),t=w(t),!!(e&&t&&e.contains(t))}var x=function(){return(x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function C(e,t){return Object.keys(t).reduce((function(e,n){return void 0===e[n]&&(e[n]=t[n]),e}),x({},e))}var P=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},j=t.createContext({root:!0,dir:"ltr",toggleDir:function(){throw new Error("Tried to toggle the current writing direction without initializing the `Dir` component.")}}),S=j.Provider;function N(){var e=t.useContext(j);return e.root,P(e,["root"])}var I=function(){var e="ltr";"undefined"!=typeof document&&(e="rtl"===document.documentElement.getAttribute("dir")?"rtl":"ltr");return e};function T(e){var n=e.children,r=e.defaultDir,o=void 0===r?I:r,i=t.useContext(j).root,l=t.useState(o),s=l[0],c=l[1];t.useEffect((function(){if(i&&"undefined"!=typeof document)return document.documentElement.setAttribute("dir",s),function(){document.documentElement.removeAttribute("dir")}}),[s,i]);var u=t.useCallback((function(){c((function(e){return"ltr"===e?"rtl":"ltr"}))}),[]),d=t.useMemo((function(){return{root:!1,dir:s,toggleDir:u}}),[s,u]),f=t.Children.only(n);return i||(f=t.cloneElement(f,{dir:s})),a.default.createElement(S,{value:d},f)}var A=function(){},k=!1;function R(){if("undefined"==typeof window)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return window.addEventListener("testSupportsPassive",A,t),window.removeEventListener("testSupportsPassive",A,t),k=e,e}R();var M=Object.freeze({__proto__:null,update:R,get isSupported(){return k}}),L=[];function D(e,t,n,r){void 0===t&&(t=window),void 0===n&&(n=!1);var o=[],a=function(e,t){var n=!1,r=function(e){return function(){for(var r=0;r<t.length;r+=1)t[r](e);n=!1}};return function(t){e?n||(n=!0,window.requestAnimationFrame(r(t))):r(t)()}}(n,o);return{add:function(n){o.length||t.addEventListener(e,a,r),-1===o.indexOf(n)&&o.push(n)},remove:function(n){var i=o.indexOf(n);i>=0&&(o.splice(i,1),o.length||t.removeEventListener(e,a,r))}}}function F(e,t,n,r){void 0===t&&(t=window),void 0===n&&(n="resize"===e||"scroll"===e);var o=L.findIndex((function(o){return o.type===e&&o.target===t&&o.options===r&&o.throttle===n}));return-1===o&&(L.push({type:e,target:t,options:r,throttle:n,handler:D(e,t,n,r)}),o=L.length-1),L[o].handler}var _=function(){return(_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function K(e,t,n,r,o,a){void 0===o&&(o=!1),t[(e?"add":"remove")+"EventListener"]("touch"+n,r,k?_({passive:!0,capture:o},a):o)}function B(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e})),n}function H(e){var n=e.enabled,r=void 0===n||n,o=e.onScroll,a=e.element,i=e.options,l=void 0===i?!!k&&{passive:!0}:i,s=B(o);t.useEffect((function(){if(r){var e=F("scroll",a||window,!0,l),t=function(e){return s.current(e)};return e.add(t),function(){e.remove(t)}}}),[r,a,l])}function V(e,t,n){if(e>=t)throw new RangeError("A range must have the min value less than the max value");if(n>t||n<e)throw new RangeError("A value must be between the min and max values");var r=(n-e)/(t-e);return Math.max(0,Math.min(Math.abs(r),1))}var W=1e3;function z(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e})),t.useEffect((function(){return function(){return n.current()}}),[])}var U=function(){},q=t.createContext({visibleInTime:W,enableHoverMode:U,disableHoverMode:U,startDisableTimer:U}),X=q.Provider;function G(){return t.useContext(q)}function Y(e){var n=e.children,r=e.disabled,o=void 0!==r&&r,i=e.defaultVisibleInTime,l=void 0===i?W:i,s=e.deactivateTime,c=void 0===s?1e3:s,u=t.useState(l),d=u[0],f=u[1],p=t.useRef(),m=t.useCallback((function(){o||(window.clearTimeout(p.current),f(0))}),[o]),v=t.useCallback((function(){window.clearTimeout(p.current),f(l)}),[l]),y=t.useCallback((function(){window.clearTimeout(p.current),p.current=window.setTimeout((function(){f(l)}),c)}),[l,c]);t.useEffect((function(){o&&(window.clearTimeout(p.current),f(l))}),[o,l]),z((function(){window.clearTimeout(p.current)}));var b=t.useMemo((function(){return{visibleInTime:d,enableHoverMode:m,disableHoverMode:v,startDisableTimer:y}}),[v,m,y,d]);return a.default.createElement(X,{value:b},n)}var J="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function $(){var e=t.useState("mouse"),n=e[0],r=e[1],o=t.useRef(0),a=t.useRef(!1);return J((function(){var e=function(){return r("mouse")},t=function(){return r("keyboard")},i=function(){o.current=Date.now(),a.current=!1,r("touch")},l=function(){a.current||Date.now()-o.current<1200?a.current=!1:e()},s=function(){a.current=!0},c="rmd-utils--"+n;return document.body.classList.add(c),window.addEventListener("touchstart",i,!0),"mouse"===n?window.addEventListener("keydown",t,!0):"keyboard"===n?window.addEventListener("mousedown",e,!0):(window.addEventListener("mousemove",l,!0),window.addEventListener("contextmenu",s,!0)),function(){document.body.classList.remove(c),window.removeEventListener("touchstart",i,!0),"mouse"===n?window.removeEventListener("keydown",t,!0):"keyboard"===n?window.removeEventListener("mousedown",e,!0):(window.removeEventListener("mousemove",l,!0),window.removeEventListener("contextmenu",s,!0))}}),[n]),n}var Q=t.createContext("mouse"),Z=t.createContext(!1),ee=Q.Provider,te=Z.Provider;function ne(){return t.useContext(Q)}function re(e){return $()===e}function oe(e){var n=e.children,r=$();if(t.useContext(Z))throw new Error("Mounted multiple `UserInteractionModeListener` components.");return a.default.createElement(ee,{value:r},a.default.createElement(te,{value:!0},n))}var ae=oe,ie=function(){return(ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function le(e){var n=void 0===e?{}:e,r=n.disabled,o=void 0!==r&&r,a=n.sticky,i=void 0!==a&&a,l=n.onClick,s=n.onMouseEnter,c=n.onMouseLeave,u=n.defaultVisible,d=void 0!==u&&u,f=n.exitVisibilityDelay,p=void 0===f?i?300:0:f,m=ne(),v="touch"===m,y=t.useState(d),b=y[0],h=y[1],g=t.useState(!1),O=g[0],w=g[1],E=t.useRef(),x=t.useRef(d),C=G(),P=C.visibleInTime,j=C.enableHoverMode,S=C.disableHoverMode,N=C.startDisableTimer,I=0===P;t.useEffect((function(){i&&!b&&w(!1)}),[b,i]),z((function(){window.clearTimeout(E.current)})),t.useEffect((function(){if(!o){var e=function(){h(!1),S(),window.clearTimeout(E.current)};return x.current||e(),x.current=!1,window.addEventListener("mousedown",e),function(){window.removeEventListener("mousedown",e)}}}),[S,m,o]);var T,A=t.useCallback((function(e){if(null==s||s(e),!(O||o||v||e.isPropagationStopped())){if(window.clearTimeout(E.current),0===P)return j(),void h(!0);E.current=window.setTimeout((function(){j(),h(!0)}),P)}}),[o,j,v,s,O,P]),k=t.useCallback((function(e){null==c||c(e),O||o||v||e.isPropagationStopped()||(N(),window.clearTimeout(E.current),0!==p?E.current=window.setTimeout((function(){h(!1)}),p):h(!1))}),[o,p,v,c,N,O]),R=t.useCallback((function(e){null==l||l(e),e.isPropagationStopped()||o||(N(),window.clearTimeout(E.current))}),[o,l,N]),M=t.useCallback((function(e){null==l||l(e),e.isPropagationStopped()||o||(O?(w(!1),h((function(e){return!e}))):(w(!0),h(!0),S()))}),[S,o,l,O]),L={onClick:R,onMouseEnter:A,onMouseLeave:k};return i&&(T=ie(ie({},L),{onClick:M})),{active:I,stuck:i?O:void 0,visible:b,setVisible:h,handlers:L,stickyHandlers:T,enableHoverMode:j,disableHoverMode:S,startDisableTimer:N}}var se="64.0625em",ce="48em",ue="64em",de="47.9375em",fe="80em",pe=function(){var e,t=null===(e=window.screen.orientation)||void 0===e?void 0:e.type;if("string"==typeof t)return t;var n=window.screen;return n.availHeight>n.availWidth?"portrait-primary":"landscape-primary"};function me(e){var n=t.useState((function(){return e||("undefined"!=typeof window?pe():"landscape-primary")})),r=n[0],o=n[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=function(){o(pe())};return window.addEventListener("orientationchange",e),function(){return window.removeEventListener("orientationchange",e)}}}),[]),r}function ve(e,n,r,o){void 0===r&&(r=!1),void 0===o&&(o="undefined"!=typeof window);var a=t.useState((function(){return void 0!==n?n:!(r||!o||"undefined"==typeof window)&&window.matchMedia(e).matches})),i=a[0],l=a[1];return t.useEffect((function(){if("undefined"!=typeof window&&!r){var t=window.matchMedia(e),n=function(e){var t=e.matches;return l(t)};return t.addEventListener("change",n),t.matches!==i&&l(t.matches),function(){t.removeEventListener("change",n)}}}),[r,i,e]),i}var ye=function(e,t){var n=typeof e;return"undefined"===n?"":"("+t+"-width: "+("number"===n?e+"px":e)+")"};function be(e){var n=e.min,r=e.max;return ve(t.useMemo((function(){return"screen and "+[ye(n,"min"),ye(r,"max")].filter(Boolean).join(" and ")}),[n,r]))}var he={isPhone:!1,isTablet:!1,isDesktop:!0,isLargeDesktop:!1,isLandscape:!0};function ge(e){var n=void 0===e?{}:e,r=n.phoneMaxWidth,o=void 0===r?de:r,a=n.tabletMinWidth,i=void 0===a?ce:a,l=n.tabletMaxWidth,s=void 0===l?ue:l,c=n.desktopMinWidth,u=void 0===c?se:c,d=n.desktopLargeMinWidth,f=void 0===d?fe:d,p=n.defaultSize,m=void 0===p?he:p;if("undefined"==typeof window)return m;var v=be({min:u}),y=be({min:f}),b=be({min:i,max:s}),h=be({max:o}),g=v,O=!v&&b,w=!O&&!g&&h,E=me().includes("landscape"),x=y,C=t.useState(m),P=C[0],j=C[1];return t.useEffect((function(){P.isPhone===w&&P.isTablet===O&&P.isDesktop===g&&P.isLargeDesktop===x&&P.isLandscape===E||(w||O||g||x)&&j({isPhone:w,isTablet:O,isDesktop:g,isLargeDesktop:x,isLandscape:E})}),[w,O,g,x,E,P]),P}var Oe=function(){return(Oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},we=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Ee=t.createContext(Oe(Oe({},he),{__initialized:!1}));function xe(){var e=t.useContext(Ee),n=e.__initialized,r=we(e,["__initialized"]);if(!n)throw new Error("Unable to get the current `AppSize` from `react-md` because the `AppSizeListener` could not be found when using the `useAppSize` hook. To fix this error, either initialize the `AppSizeListener` component from `@react-md/utils` or the `Configuration` component from `@react-md/layout` near the root of your app.");return r}var Ce,Pe=function(){return(Pe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},je=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Se=m("rmd-grid"),Ne=t.forwardRef((function(e,n){var r,o,i,l,s,u,d,f=e.style,p=e.className,m=e.clone,v=e.children,y=e.colSpan,b=e.colStart,h=e.colEnd,g=e.rowSpan,O=e.rowStart,w=e.rowEnd,E=e.phone,x=e.tablet,C=e.desktop,P=e.largeDesktop,j=je(e,["style","className","clone","children","colSpan","colStart","colEnd","rowSpan","rowStart","rowEnd","phone","tablet","desktop","largeDesktop"]),S=xe(),N=S.isPhone,I=S.isTablet,T=S.isDesktop,A=S.isLargeDesktop,k=y,R=b,M=h,L=g,D=O,F=w,_=N&&E||I&&x||A&&P||T&&C;_&&(L=void 0===(r=_.rowSpan)?g:r,D=void 0===(o=_.rowStart)?O:o,F=void 0===(i=_.rowEnd)?w:i,k=void 0===(l=_.colSpan)?y:l,R=void 0===(s=_.colStart)?b:s,M=void 0===(u=_.colEnd)?h:u);var K=Pe({gridColumnStart:R,gridColumnEnd:M,gridRowStart:D,gridRowEnd:L?"span "+L:F},f),B=c(Se("cell",((d={})[""+k]=k,d)),p);if(m&&t.isValidElement(v)){var H=t.Children.only(v);return t.cloneElement(H,{style:Pe(Pe({},H.props.style),K),className:c(B,H.props.className)})}return a.default.createElement("div",Pe({},j,{ref:n,style:K,className:B}),v)})),Ie=function(){return(Ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Te=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Ae="--rmd-grid-cols",ke="--rmd-grid-gutter",Re=m("rmd-grid"),Me=t.forwardRef((function(e,n){var r,o=e.style,i=e.className,l=e.children,s=e.clone,u=void 0!==s&&s,d=e.cloneStyles,f=void 0!==d&&d,p=e.wrapOnly,m=void 0!==p&&p,v=e.columns,y=e.phoneColumns,b=e.tabletColumns,h=e.desktopColumns,g=e.largeDesktopColumns,O=e.padding,w=e.gutter,E=e.minCellWidth,x=Te(e,["style","className","children","clone","cloneStyles","wrapOnly","columns","phoneColumns","tabletColumns","desktopColumns","largeDesktopColumns","padding","gutter","minCellWidth"]),C=xe(),P=C.isPhone,j=C.isTablet,S=C.isDesktop,N=C.isLargeDesktop,I=Ie(Ie({padding:0!==O&&O||void 0,gridTemplateColumns:E?"repeat(auto-fill, minmax("+E+", 1fr))":void 0},o),((r={})[Ae]=P&&y||j&&b||N&&g||S&&h||v,r[ke]=w,r)),T=c(Re({"no-padding":0===O}),i);if(f&&t.isValidElement(l)){var A=t.Children.only(l);return t.cloneElement(A,{style:Ie(Ie({},I),A.props.style),className:c(T,A.props.className)})}var k=l;return(u||m)&&(k=t.Children.map(l,(function(e){return e&&a.default.createElement(Ne,{clone:u},e)}))),a.default.createElement("div",Ie({},x,{ref:n,style:I,className:T}),k)})),Le=function(){return(Le=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},De=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Fe=m("rmd-grid-list"),_e=t.forwardRef((function(e,n){var r=e.className,o=e.children,i=e.square,l=void 0!==i&&i,s=e.clone,u=void 0!==s&&s,d=De(e,["className","children","square","clone"]),f=c(Fe("cell",{square:l}),r);if(u&&t.isValidElement(o)){var p=t.Children.only(o);return t.cloneElement(p,{className:c(f,p.props.className)})}return a.default.createElement("div",Le({},d,{ref:n,className:f}),o)})),Ke=[],Be="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Ce||(Ce={}));var He,Ve=function(e){return Object.freeze(e)},We=function(e,t){this.inlineSize=e,this.blockSize=t,Ve(this)},ze=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ve(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ue=function(e){return e instanceof SVGElement&&"getBBox"in e},qe=function(e){if(Ue(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,a=o.offsetWidth,i=o.offsetHeight;return!(a||i||e.getClientRects().length)},Xe=function(e){var t,n;if(e instanceof Element)return!0;var r=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&e instanceof r.Element)},Ge="undefined"!=typeof window?window:{},Ye=new WeakMap,Je=/auto|scroll/,$e=/^tb|vertical/,Qe=/msie|trident/i.test(Ge.navigator&&Ge.navigator.userAgent),Ze=function(e){return parseFloat(e||"0")},et=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new We((n?t:e)||0,(n?e:t)||0)},tt=Ve({devicePixelContentBoxSize:et(),borderBoxSize:et(),contentBoxSize:et(),contentRect:new ze(0,0,0,0)}),nt=function(e,t){if(void 0===t&&(t=!1),Ye.has(e)&&!t)return Ye.get(e);if(qe(e))return Ye.set(e,tt),tt;var n=getComputedStyle(e),r=Ue(e)&&e.ownerSVGElement&&e.getBBox(),o=!Qe&&"border-box"===n.boxSizing,a=$e.test(n.writingMode||""),i=!r&&Je.test(n.overflowY||""),l=!r&&Je.test(n.overflowX||""),s=r?0:Ze(n.paddingTop),c=r?0:Ze(n.paddingRight),u=r?0:Ze(n.paddingBottom),d=r?0:Ze(n.paddingLeft),f=r?0:Ze(n.borderTopWidth),p=r?0:Ze(n.borderRightWidth),m=r?0:Ze(n.borderBottomWidth),v=d+c,y=s+u,b=(r?0:Ze(n.borderLeftWidth))+p,h=f+m,g=l?e.offsetHeight-h-e.clientHeight:0,O=i?e.offsetWidth-b-e.clientWidth:0,w=o?v+b:0,E=o?y+h:0,x=r?r.width:Ze(n.width)-w-O,C=r?r.height:Ze(n.height)-E-g,P=x+v+O+b,j=C+y+g+h,S=Ve({devicePixelContentBoxSize:et(Math.round(x*devicePixelRatio),Math.round(C*devicePixelRatio),a),borderBoxSize:et(P,j,a),contentBoxSize:et(x,C,a),contentRect:new ze(d,s,x,C)});return Ye.set(e,S),S},rt=function(e,t,n){var r=nt(e,n),o=r.borderBoxSize,a=r.contentBoxSize,i=r.devicePixelContentBoxSize;switch(t){case Ce.DEVICE_PIXEL_CONTENT_BOX:return i;case Ce.BORDER_BOX:return o;default:return a}},ot=function(e){var t=nt(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Ve([t.borderBoxSize]),this.contentBoxSize=Ve([t.contentBoxSize]),this.devicePixelContentBoxSize=Ve([t.devicePixelContentBoxSize])},at=function(e){if(qe(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},it=function(){var e=1/0,t=[];Ke.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new ot(t.target),o=at(t.target);r.push(n),t.lastReportedSize=rt(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},lt=function(e){Ke.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(at(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},st=function(){var e,t=0;for(lt(t);Ke.some((function(e){return e.activeTargets.length>0}));)t=it(),lt(t);return Ke.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Be}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Be),window.dispatchEvent(e)),t>0},ct=[],ut=function(e){if(!He){var t=0,n=document.createTextNode("");new MutationObserver((function(){return ct.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),He=function(){n.textContent=""+(t?t--:t++)}}ct.push(e),He()},dt=0,ft={attributes:!0,characterData:!0,childList:!0,subtree:!0},pt=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],mt=function(e){return void 0===e&&(e=0),Date.now()+e},vt=!1,yt=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!vt){vt=!0;var n,r=mt(e);n=function(){var n=!1;try{n=st()}finally{if(vt=!1,e=r-mt(),!dt)return;n?t.run(1e3):e>0?t.run(e):t.start()}},ut((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,ft)};document.body?t():Ge.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),pt.forEach((function(t){return Ge.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),pt.forEach((function(t){return Ge.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),bt=function(e){!dt&&e>0&&yt.start(),!(dt+=e)&&yt.stop()},ht=function(){function e(e,t){this.target=e,this.observedBox=t||Ce.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=rt(this.target,this.observedBox,!0);return e=this.target,Ue(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),gt=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Ot=new WeakMap,wt=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Et=function(){function e(){}return e.connect=function(e,t){var n=new gt(e,t);Ot.set(e,n)},e.observe=function(e,t,n){var r=Ot.get(e),o=0===r.observationTargets.length;wt(r.observationTargets,t)<0&&(o&&Ke.push(r),r.observationTargets.push(new ht(t,n&&n.box)),bt(1),yt.schedule())},e.unobserve=function(e,t){var n=Ot.get(e),r=wt(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&Ke.splice(Ke.indexOf(n),1),n.observationTargets.splice(r,1),bt(-1))},e.disconnect=function(e){var t=this,n=Ot.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),xt=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Et.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Xe(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Et.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Xe(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Et.unobserve(this,e)},e.prototype.disconnect=function(){Et.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function Ct(e){var n=t.useRef(null),r=t.useCallback((function(t){f(t,e),n.current=t}),[e]);return[n,r]}var Pt=function(){return(Pt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function jt(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function St(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}function Nt(e){var n=e.disableHeight,r=void 0!==n&&n,o=e.disableWidth,a=void 0!==o&&o,i=e.onResize,l=e.target;t.useEffect((function(){if(!r||!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}(l);if(e){var t,n=new xt((function(e){for(var n=0;n<e.length;n+=1){var o=e[n],l=o.target,s=o.contentRect,c={height:s.height,width:s.width,scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth},u=jt(t,c),d=St(t,c);t=c,(u&&!r||d&&!a)&&i(Pt(Pt({},c),{element:l}))}}));return n.observe(e),function(){n.unobserve(e),n.disconnect()}}}}),[l,i,r,a])}var It,Tt=function(){return(Tt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function At(e,t){return!e||e.height!==t.height||e.scrollHeight!==t.scrollHeight}function kt(e,t){return!e||e.width!==t.width||e.scrollWidth!==t.scrollWidth}var Rt=[];function Mt(e,t){if(void 0===t&&(t={}),"function"==typeof e){var n=e,r=t.ref,o=t.disableHeight,a=void 0!==o&&o,i=t.disableWidth,l=void 0!==i&&i,s=Ct(r),c=s[0],u=s[1];return J((function(){var e=c.current;if(!(a&&l||!e))return It||"undefined"==typeof document||(It=new xt((function(e){for(var t=function(t){var n=e[t],r=Rt.filter((function(e){return e.target===n.target}));if(!r.length)return{value:void 0};for(var o=n.contentRect,a=o.height,i=o.width,l=n.target,s={height:a,width:i,scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth},c=0;c<r.length;c+=1){var u=r[c],d=u.handler,f=u.prevSize,p=u.disableHeight,m=u.disableWidth,v=At(f,s),y=kt(f,s);(v&&!p||y&&!m)&&(u.prevSize=s,d(Tt(Tt({},s),{element:n.target})))}},n=0;n<e.length;n+=1){var r=t(n);if("object"==typeof r)return r.value}}))),function(e,t,n,r){var o=Rt.find((function(t){return t.target===e}));Rt.push({target:e,handler:t,disableWidth:r,disableHeight:n,prevSize:void 0}),o||null==It||It.observe(e)}(e,n,a,l),function(){!function(e,t,n,r){var o=Rt.findIndex((function(o){return o.target===e&&o.handler===t&&o.disableWidth===r&&o.disableHeight===n}));-1!==o&&Rt.splice(o,1),Rt.some((function(t){return t.target===e}))||null==It||It.unobserve(e)}(e,n,a,l)}}),[a,l,n]),[c,u]}Nt(e)}var Lt={height:void 0,width:void 0};var Dt=function(){return(Dt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ft="--rmd-cell-size",_t="--rmd-cell-margin",Kt=t.createContext({columns:-1,cellWidth:-1}),Bt=Kt.Provider;function Ht(e){var n,r=void 0===e?{}:e,o=r.ref,a=r.style,i=r.className,l=r.cellMargin,s=r.defaultSize,u=r.maxCellSize,d=void 0===u?150:u,f=r.disableHeight,p=void 0!==f&&f,m=r.disableWidth,v=void 0!==m&&m,y=r.containerPadding,b=void 0===y?16:y,h=Ct(o),g=h[0],O=h[1],w=t.useState(s||{columns:-1,cellWidth:d}),E=w[0],x=w[1],C=Mt(t.useCallback((function(){var e=g.current;if(e){var t=e.getBoundingClientRect().width;t-=b,e.offsetHeight<e.scrollHeight&&(t-=function(e,t){if(void 0===e&&(e="width"),void 0===t&&(t=!1),"undefined"==typeof window)return-1;var n=Lt[e];if(!t&&"number"==typeof n)return n;var r=document.createElement("div");r.style.visibility="hidden",r.style.overflow="scroll",document.body.appendChild(r);var o=document.createElement("div");r.appendChild(o);var a="width"===e?"offsetWidth":"offsetHeight";return n=r[a]-o[a],Lt[e]=n,document.body.removeChild(r),n}("width"));var n=Math.ceil(t/d);x({cellWidth:t/n,columns:n})}}),[b,d,g]),{ref:O,disableHeight:p,disableWidth:v})[1],P=Dt(Dt({},a),((n={})[Ft]=E.cellWidth+"px",n));return l&&(P[_t]=l),[{ref:C,style:P,className:c("rmd-grid-list",i)},E]}var Vt=function(){return(Vt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Wt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},zt=t.forwardRef((function(e,n){var r=e.style,o=e.className,i=e.children,l=e.clone,s=void 0!==l&&l,c=e.wrapOnly,u=void 0!==c&&c,d=e.cellMargin,f=e.defaultSize,p=e.maxCellSize,m=void 0===p?150:p,v=e.containerPadding,y=void 0===v?16:v,b=e.disableHeightObserver,h=void 0!==b&&b,g=e.disableWidthObserver,O=void 0!==g&&g,w=Wt(e,["style","className","children","clone","wrapOnly","cellMargin","defaultSize","maxCellSize","containerPadding","disableHeightObserver","disableWidthObserver"]),E=Ht({ref:n,style:r,className:o,cellMargin:d,defaultSize:f,maxCellSize:m,containerPadding:y,disableHeight:h,disableWidth:O}),x=E[0],C=E[1],P=null;return P=function(e){return"function"==typeof e}(i)?i(C):s||u?t.Children.map(i,(function(e){return e&&a.default.createElement(_e,{clone:s},e)})):i,a.default.createElement(Bt,{value:C},a.default.createElement("div",Vt({},w,x),P))}));function Ut(e){var t=e.value,n=e.min,r=void 0===n?0:n,o=e.max,a=e.increment,i=e.minmax,l=t+(a?1:-1);return void 0!==i&&i?l=Math.min(o,Math.max(r,l)):l>o?l=r:l<r&&(l=o),l}function qt(e,t,n,r,o){void 0===o&&(o=n-t);var a=Math.round((e-t)*r/o)/r,i=Math.min(Math.max(a,0),1),l=o/r,s=Number.isInteger(l)?o%r:l.toString().split(".")[1].length;return Math.min(n,Math.max(t,parseFloat((i*o+t).toFixed(s))))}function Xt(e,t){if(!t.length)return e;var n={};for(var r in e)t.includes(r)||(n[r]=e[r]);return n}function Gt(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 n,r=e.getAttribute("data-sizing-selector");if(r&&(n=e.querySelector(r)))return n;return e}function Yt(e){var t=document.documentElement||{clientHeight:0,clientWidth:0};return"width"===e?window.innerWidth||t.clientWidth:window.innerHeight||t.clientHeight}function Jt(e){return"number"==typeof e?e+"px":""}function $t(e,t){void 0===t&&(t={});var n=e.cloneNode(!0);n.removeAttribute("id"),n.removeAttribute("role"),n.style.position="fixed",n.style.visibility="hidden",n.style.left=Jt(t.left),n.style.top=Jt(t.top),n.style.right=Jt(t.right),n.style.bottom=Jt(t.bottom),n.style.webkitTransform="none",n.style.transform="none";var r=e.parentElement||document.body;r.appendChild(n);var o=n.getBoundingClientRect();return r.removeChild(n),o}function Qt(e){var t=e.xMargin,n=e.elWidth,r=e.initialX,o=e.containerRect;return(null!=r?r:o.left)-n-t}function Zt(e){var t=e.xMargin,n=e.initialX,r=e.containerRect;return(null!=n?n:r.left)+t}function en(e){var t=e.xMargin,n=e.elWidth,r=e.initialX,o=e.containerRect;return(null!=r?r:o.left+o.width)-n-t}function tn(e){var t=e.xMargin,n=e.initialX,r=e.containerRect;return(null!=n?n:r.left+r.width)+t}function nn(e){var t=e.yMargin,n=e.initialY,r=e.elHeight,o=e.containerRect;return(null!=n?n:o.top)-r-t}function rn(e){var t=e.yMargin,n=e.initialY,r=e.containerRect;return(null!=n?n:r.top)+t}function on(e){var t=e.yMargin,n=e.initialY,r=e.elHeight,o=e.containerRect;return(null!=n?n:o.top+o.height)-r-t}function an(e){var t=e.yMargin,n=e.initialY,r=e.containerRect;return(null!=n?n:r.top+r.height)+t}function ln(e){var t=e.x,n=e.vw,r=e.vwMargin,o=e.xMargin,a=e.width,i=e.elWidth,l=e.initialX,s=e.containerRect,c=e.disableSwapping;if("min"===a||"equal"===a)return function(e){var t,n,r=e.x,o=e.vw,a=e.elWidth,i=e.xMargin,l=e.vwMargin,s=e.initialX,c=e.containerRect,u=e.isMinWidth,d=null!=s?s:c.left+i,f=c.width-2*i;return u&&(t=f,f=void 0,d+a>o-l&&(n=l)),{left:d,right:n,width:f,minWidth:t,actualX:r}}({x:t,vw:n,vwMargin:r,xMargin:o,elWidth:i,initialX:l,containerRect:s,isMinWidth:"min"===a});if(i>n-2*r)return{left:r,right:r,actualX:t};var u={vwMargin:r,xMargin:o,elWidth:i,initialX:l,screenRight:n-r,containerRect:s,disableSwapping:c};switch(t){case"left":return function(e){var t=e.vwMargin,n=e.screenRight,r=e.elWidth,o=e.disableSwapping,a=Qt(e),i="left";if(a>=t)return{actualX:i,left:a};var l=tn(e);return o||l+r>n?a=t:(a=l,i="right"),{actualX:i,left:a}}(u);case"inner-left":return function(e){var t=e.vwMargin,n=e.screenRight,r=e.elWidth,o=e.disableSwapping,a=Zt(e),i="inner-left";if(a+r<=n)return{actualX:i,left:a};var l=en(e);return o||l<t?a=t:(a=l,i="inner-right"),{actualX:i,left:a}}(u);case"center":return function(e){var t=e.vwMargin,n=e.screenRight,r=e.elWidth,o=function(e){var t=e.elWidth,n=e.initialX,r=e.containerRect,o=r.width/2,a=t/2;return(null!=n?n:r.left+o)-a}(e);return o<t?o=t:(o+r>n||o<t)&&(o=n-r),{actualX:"center",left:o}}(u);case"inner-right":return function(e){var t=e.screenRight,n=e.vwMargin,r=e.elWidth,o=e.disableSwapping,a=en(e),i="inner-right";if(a>=n)return{actualX:i,left:a};var l=Zt(e);return o||l+r>t?a=t-r:(a=l,i="inner-left"),{actualX:i,left:a}}(u);case"right":return function(e){var t=e.screenRight,n=e.vwMargin,r=e.elWidth,o=e.disableSwapping,a=tn(e),i="right";if(a+r<=t)return{actualX:i,left:a};var l=Qt(e);return o||l<n?a=t-r:(a=l,i="left"),{actualX:i,left:a}}(u);default:throw new Error("This should never happen")}}function sn(e){var t=e.y,n=e.vh,r=e.vhMargin,o=e.yMargin,a=e.elHeight,i=e.initialY,l=e.containerRect,s=e.disableSwapping,c=e.preventOverlap,u=e.disableVHBounds;if(!u&&!c&&a>n-2*r)return{top:r,bottom:r,actualY:"center"};var d={vhMargin:r,yMargin:o,elHeight:a,initialY:i,containerRect:l,screenBottom:n-r,preventOverlap:c,disableSwapping:s,disableVHBounds:u};switch(t){case"above":return function(e){var t=e.yMargin,n=e.vhMargin,r=e.screenBottom,o=e.elHeight,a=e.containerRect,i=e.preventOverlap,l=e.disableSwapping,s=e.disableVHBounds,c=nn(e),u="above";if(s)return{actualY:u,top:Math.max(0,c)};if(c>n)return{actualY:u,top:c};var d,f=an(e);return l||f+o>r?c=n:(u="below",c=f),i&&"above"===u&&c+o>a.top&&(d=window.innerHeight-a.top+t),{actualY:u,top:c,bottom:d}}(d);case"top":return function(e){var t=e.vhMargin,n=e.screenBottom,r=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,i=rn(e),l="top";if(a||i+r<=n)return{actualY:l,top:i};var s=on(e);return o||s<t?i=t:(l="bottom",i=s),{actualY:l,top:i}}(d);case"center":return function(e){var t=e.vhMargin,n=e.screenBottom,r=e.elHeight,o=e.disableVHBounds,a=function(e){var t=e.elHeight,n=e.initialY,r=e.containerRect,o=r.height/2,a=t/2;return(null!=n?n:r.top+o)-a}(e),i="center";return o?{actualY:i,top:Math.max(0,a)}:((a=Math.max(t,a))+r>n&&(a=n-r),{actualY:i,top:a})}(d);case"bottom":return function(e){var t=e.vhMargin,n=e.screenBottom,r=e.elHeight,o=e.disableSwapping,a=e.disableVHBounds,i=on(e),l="bottom";if(a||i>t)return{actualY:l,top:i};var s=rn(e);return o||s+r>n?i=n-r:(l="top",i=s),{actualY:l,top:i}}(d);case"below":return function(e){var t=e.yMargin,n=e.vhMargin,r=e.elHeight,o=e.screenBottom,a=e.containerRect,i=e.preventOverlap,l=e.disableSwapping,s=e.disableVHBounds,c=an(e),u="below";if(s||c+r<=o)return{actualY:u,top:c};if(i){var d=a.top-t;return l||d<o-c?{actualY:u,top:c,bottom:n}:{actualY:"above",top:Math.max(n,d-r),bottom:Yt("height")-d}}var f=nn(e);return l||f<n?c=o-r:(u="above",c=f),{actualY:u,top:c}}(d);default:throw new Error("This should never happen")}}function cn(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 n="0";switch(e.y){case"above":case"bottom":n="100%";break;case"center":n="50%";break;case"below":case"top":n="0";break;default:n="0"}return t+" "+n}function un(e){var t=e.container,n=e.element,r=e.anchor,o=void 0===r?{}:r,a=e.initialX,i=e.initialY,l=e.vwMargin,s=void 0===l?16:l,c=e.vhMargin,u=void 0===c?16:c,d=e.xMargin,f=void 0===d?0:d,p=e.yMargin,m=void 0===p?0:p,v=e.width,y=void 0===v?"auto":v,b=e.preventOverlap,h=void 0!==b&&b,g=e.transformOrigin,O=void 0!==g&&g,w=e.disableSwapping,E=void 0!==w&&w,x=e.disableVHBounds,C=void 0!==x&&x;t=Gt(t);var P={x:o.x||"center",y:o.y||"below"};if(!t||!n)return{actualX:P.x,actualY:P.y};var j=t.getBoundingClientRect(),S=Yt("height"),N=Yt("width"),I=$t(n),T=I.height,A=I.width;C&&(n.closest("[role='dialog']")||(i=(null!=i?i:0)+window.scrollY));var k=ln({x:P.x,vw:N,vwMargin:s,xMargin:f,width:y,elWidth:A,initialX:a,containerRect:j,disableSwapping:E}),R=k.left,M=k.right,L=k.width,D=k.minWidth,F=k.actualX,_=sn({y:P.y,vh:S,vhMargin:u,yMargin:m,initialY:i,elHeight:T,containerRect:j,disableSwapping:E,preventOverlap:h,disableVHBounds:C}),K=_.top,B=_.bottom,H=_.actualY;return{actualX:F,actualY:H,style:{left:R,top:K,right:M,bottom:B,width:L,minWidth:D,position:C?"absolute":"fixed",transformOrigin:O?cn({x:F,y:H}):void 0}}}var dn={x:"center",y:"above"},fn={x:"inner-left",y:"top"},pn={x:"inner-right",y:"top"},mn={x:"right",y:"top"},vn={x:"left",y:"center"},yn={x:"center",y:"center"},bn={x:"right",y:"center"},hn={x:"center",y:"below"},gn={x:"inner-right",y:"below"};function On(e,t){if(t=Gt(t),e&&t){var n=t.offsetTop;t.offsetParent!==e&&(n-=e.offsetTop);var r=n+t.offsetHeight;r>e.offsetHeight+e.scrollTop?e.scrollTop=r-e.offsetHeight:n<e.scrollTop&&(e.scrollTop=n)}}function wn(e,t,n,r){e=e.toUpperCase();for(var o=n;o<r;o+=1){if(0===t[o].toUpperCase().indexOf(e))return o}return-1}function En(e,t,n,r){void 0===r&&(r=!0);var o=wn(e,t,n+1,t.length);-1===o&&(o=wn(e,t,0,n+(r?1:0)));return o}function xn(e,t,n,r){return void 0===t&&(t=!1),void 0===n&&(n=!1),void 0===r&&(r=!1),t&&(e=e.toLowerCase()),r?e=e.replace(/\s/g,""):n&&(e=e.trim()),e}function Cn(e,t){switch(void 0===t&&(t="value"),typeof e){case"string":return e;case"number":return Number.isNaN(e)?"":""+e;case"function":return Cn(e(),t);case"object":return e?Cn(e[t],t):"";default:return""}}var Pn=Cn,jn="value",Sn={getItemValue:Pn,valueKey:jn,trim:true,ignoreWhitespace:false};function Nn(e,t,n){void 0===n&&(n={});var r=C(n,Sn),o=r.getItemValue,a=r.valueKey,i=r.trim,l=r.ignoreWhitespace,s=r.startsWith,c=void 0!==s&&s;return(e=xn(e,!0,i,l))&&t.length?t.filter((function(t){var n=xn(o(t,a),!0,i,l);return c?0===n.indexOf(e):-1!==n.indexOf(e)})):t}function In(e){return new RegExp((""+e).split("").join("\\w*").replace(/(\(|\||\)|\\(?!w\*)|\[|\|-|\.|\^|\+|\$|\?|^(?!w)\*)/g,"\\$1").replace(/\*\*/g,"*\\*"),"i")}function Tn(e,t,n){void 0===n&&(n={});var r=C(n,Sn),o=r.getItemValue,a=r.valueKey,i=r.trim,l=r.ignoreWhitespace;if(e=xn(e,!1,i,l),!t.length||!e)return t;var s=In(e);return t.filter((function(e){var t=xn(o(e,a),!1,i,l);return t.length&&t.match(s)}))}function An(e,n){void 0===n&&(n=500);var r=t.useRef(e),o=t.useRef(),a=t.useCallback((function(){window.clearTimeout(o.current),r.current=e}),[e]),i=t.useCallback((function(e){r.current=e,window.clearTimeout(o.current),o.current=window.setTimeout(a,n)}),[n,a]);return[r,i,a]}function kn(e){var n=e.items,r=e.onChange,o=e.onKeyDown,a=e.resetTime,i=void 0===a?500:a,l=e.searchIndex,s=e.valueKey,c=void 0===s?jn:s,u=e.getItemValue,d=void 0===u?Pn:u,f=e.findMatchIndex,p=void 0===f?En:f,m=An("",i),v=m[0],y=m[1],b=t.useMemo((function(){return n.map((function(e){return d(e,c)}))}),[n,d,c]);return t.useCallback((function(e){o&&o(e);var t=e.key,a=e.altKey,i=e.ctrlKey,s=e.metaKey;if(!(a||i||s||t.length>1||!v.current&&" "===t)){var c=t;v.current!==t&&(c=""+v.current+t),y(c);var u=p(c,b,l,!0);if(u!==l&&-1!==u){var d={index:u,item:n[u],items:n,query:c,target:e.currentTarget};r(d)}}}),[l,p,n,r,o,y,v,b])}var Rn=function(){return(Rn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Mn(e){var n=e.children,r=e.onChange,o=e.phoneMaxWidth,i=void 0===o?de:o,l=e.tabletMinWidth,s=void 0===l?ce:l,c=e.tabletMaxWidth,u=void 0===c?ue:c,d=e.desktopMinWidth,f=void 0===d?se:d,p=e.desktopLargeMinWidth,m=void 0===p?fe:p,v=e.defaultSize,y=void 0===v?he:v,b=ge({phoneMaxWidth:i,tabletMaxWidth:u,tabletMinWidth:s,desktopMinWidth:f,desktopLargeMinWidth:m,defaultSize:y}),h=t.useRef(b);t.useEffect((function(){!r||y.isPhone===b.isPhone&&y.isTablet===b.isTablet&&y.isDesktop===b.isDesktop&&y.isLargeDesktop===b.isLargeDesktop&&y.isLandscape===b.isLandscape||r(b,y)}),[]),t.useEffect((function(){h.current!==b&&(r&&r(b,h.current),h.current=b)}));var g=t.useMemo((function(){return Rn(Rn({},b),{__initialized:!0})}),[b]);return a.default.createElement(Ee.Provider,{value:g},n)}function Ln(e){var n=e.onResize,r=e.options,o=e.immediate,a=e.enabled,i=void 0===a||a,l=B(n);t.useEffect((function(){if(i){var e=F("resize",window,!0,r),t=function(e){return l.current(e)};return e.add(t),o&&"undefined"!=typeof window&&window.dispatchEvent(new UIEvent("resize")),function(){e.remove(t)}}}),[r,i])}function Dn(e,t){void 0===t&&(t={});var n=t.fontSizeFallback,r=void 0===n?16:n,o=t.element;if("number"==typeof e)return e;var a=parseFloat(e);if(/px$/.test(e))return a;if("undefined"==typeof document)return a*r;var i=/rem$/.test(e),l=document.documentElement;return!i&&o&&(l=o.parentElement||o),a*parseFloat(window.getComputedStyle(l).fontSize||r+"px")}function Fn(e){return e?void 0!==e.current?e.current:e:null}function _n(e){var n=e.enabled,r=e.element,o=e.onOutsideClick;t.useEffect((function(){if(n)return window.addEventListener("click",e),function(){window.removeEventListener("click",e)};function e(e){var t=e.target,n=Fn(r);E(n,t)||o(n,t,E)}}),[n,r,o])}function Kn(e){var n=t.useState(e),r=n[0],o=n[1],a=B(r);return[r,t.useCallback((function(){a.current||o(!0)}),[]),t.useCallback((function(){a.current&&o(!1)}),[]),t.useCallback((function(){o((function(e){return!e}))}),[]),o]}function Bn(e,n,r){void 0===r&&(r=!1);var o=B(e),a=B(n),i=t.useRef(),l=Kn(r),s=l[0],c=l[1],u=l[2],d=t.useCallback((function(){window.clearTimeout(i.current),i.current=void 0}),[]),f=t.useCallback((function(){d(),i.current=window.setTimeout((function(){o.current(),u()}),a.current)}),[]),p=t.useCallback((function(){d(),u()}),[]);return t.useEffect((function(){if(s)return i.current=window.setTimeout((function(){o.current(),u()}),n),function(){d()}}),[s,n,u]),[c,p,f]}var Hn=function(e){return e.replace(/\s/g,"")};function Vn(e,t){if(void 0===t&&(t=".rmd-icon--font"),"string"==typeof e)return Hn(e);if(t&&Array.from(e.querySelectorAll(t)).some((function(e){return!!e.textContent}))){var n=e.cloneNode(!0),r=void 0;do{(r=n.querySelector(t))&&r.parentNode&&r.parentNode.removeChild(r)}while(r);return Hn(n.textContent||"")}return Hn(e.textContent||"")}var Wn=["BUTTON","TEXTAREA","SELECT"].reduce((function(e,t){return e+","+t+":not([disabled])"}),'a[href],area[href],input:not([disabled]):not([type="hidden"])')+",[tabindex]",zn=Wn+':not([tabindex="-1"])';function Un(e,t){return void 0===t&&(t=!1),Array.from(e.querySelectorAll(t?Wn:zn))}function qn(e,t){return void 0===t&&(t="programmatic"),"matches"in e&&e.matches("programmatic"===t?Wn:zn)}function Xn(e,t,n,r,o){var a;switch(void 0===n&&(n=!1),void 0===r&&(r=!1),o&&o.length||(o=Un(e,n)),t){case"first":a=o[0];break;case"last":a=o[o.length-1];break;default:a=e.querySelector(t)}if(!a&&qn(e,"programmatic")&&(a=e),!a)throw new Error("Unable to find a focusable element");a.focus({preventScroll:r}),r||e===document||On(e,a)}function Gn(e,n,r,o,a){void 0===r&&(r=!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:r}),Xn(t,n,o,r))}));return function(){window.cancelAnimationFrame(t)}}}),[n,a,e,o,r])}function Yn(e,n,r){void 0===n&&(n=void 0),void 0===r&&(r=null);var o=t.useRef({disabled:e,fallback:n});t.useEffect((function(){o.current={disabled:e,fallback:n}})),t.useEffect((function(){if(!e){var t=r||document.activeElement,n=t.closest('[role="menu"]'),a=null;if(n&&!(a=document.getElementById(n.id.replace(/-menu$/,"")))){var i=(n.getAttribute("aria-labelledby")||"").split(" ").map((function(e){return"#"+e+"[tabindex]"})).join(",");a=i?document.querySelector(i):null}return function(){var e=o.current,i=e.fallback;if(!e.disabled)if(!n||!a||r||i||document.contains(t)||!document.contains(a)){var l=t;if(document.contains(l)||(l=r&&document.contains(r)?r:null),!l&&i)switch(typeof i){case"string":l=document.querySelector(i);break;case"function":l=i();break;default:l=i}l&&!document.contains(l)&&(l=null),l&&l.focus()}else a.focus()}}}),[])}var Jn,$n,Qn=function(){return(Qn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},er=t.forwardRef((function(e,n){var r=e.children,o=e.onKeyDown,i=e.component,l=void 0===i?"div":i,s=e.defaultFocus,c=void 0===s?"first":s,u=e.disableFocusCache,d=void 0!==u&&u,f=e.disableFocusOnMount,p=void 0!==f&&f,m=e.disableFocusOnMountScroll,v=void 0!==m&&m,y=e.disableFocusOnUnmount,b=void 0!==y&&y,h=e.disableTabFocusWrap,g=void 0!==h&&h,O=e.unmountFocusFallback,w=void 0===O?"":O,E=Zn(e,["children","onKeyDown","component","defaultFocus","disableFocusCache","disableFocusOnMount","disableFocusOnMountScroll","disableFocusOnUnmount","disableTabFocusWrap","unmountFocusFallback"]),x=Ct(n),C=x[0],P=x[1];Yn(b,w),Gn(C,c,v,!1,p);var j=function(e){var n=e.disabled,r=void 0!==n&&n,o=e.disableFocusCache,a=void 0!==o&&o,i=e.onKeyDown,l=t.useRef([]),s=t.useCallback((function(e){if(i&&i(e),"Tab"===e.key){!a&&l.current.length||(l.current=Un(e.currentTarget));var t=l.current,n=t.length;0!==n&&(1===n?(e.preventDefault(),t[0].focus()):t[0]===e.target&&e.shiftKey?(e.preventDefault(),t[n-1].focus()):t[n-1]!==e.target||e.shiftKey||(e.preventDefault(),t[0].focus()))}}),[i,a]);return r?i:s}({disabled:g,disableFocusCache:d,onKeyDown:o});return a.default.createElement(l,Qn({},E,{onKeyDown:j,ref:P}),r)}));e.IncrementMovementKey=void 0,(Jn=e.IncrementMovementKey||(e.IncrementMovementKey={})).ArrowUp="ArrowUp",Jn.ArrowDown="ArrowDown",Jn.ArrowLeft="ArrowLeft",Jn.ArrowRight="ArrowRight",Jn.PageDown="PageDown",Jn.PageUp="PageUp",Jn.ShiftArrowUp="Shift+ArrowUp",Jn.ShiftArrowDown="Shift+ArrowDown",Jn.ShiftArrowLeft="Shift+ArrowLeft",Jn.ShiftArrowRight="Shift+ArrowRight",Jn.AltArrowDown="Alt+ArrowDown",Jn.AltArrowUp="Alt+ArrowUp",Jn.AltArrowLeft="Alt+ArrowLeft",Jn.AltArrowRight="Alt+ArrowRight",Jn.AltPageDown="Alt+PageDown",Jn.AltPageUp="Alt+PageUp",Jn.ControlArrowDown="Control+ArrowDown",Jn.ControlArrowUp="Control+ArrowUp",e.JumpMovementKey=void 0,($n=e.JumpMovementKey||(e.JumpMovementKey={})).Home="Home",$n.End="End",$n.AltHome="Alt+Home",$n.AltEnd="Alt+End",$n.ControlHome="Control+Home",$n.ControlEnd="Control+End",$n.ControlShiftHome="Control+Shift+Home",$n.ControlShiftEnd="Control+Shift+End";var tr=function(){return(tr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},nr={loopable:!0,searchable:!0,incrementKeys:[e.IncrementMovementKey.ArrowDown],decrementKeys:[e.IncrementMovementKey.ArrowUp],jumpToFirstKeys:[e.JumpMovementKey.Home],jumpToLastKeys:[e.JumpMovem