UNPKG

@j4jinxx/modal

Version:

Minimal Modal/Dialog React Component

29 lines (28 loc) 35.1 kB
import e from"react";function r(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}function t(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o,i={exports:{}},a={exports:{}},c={};var u,f,s,l,p,y,d,m,b,v,g,h,O,S,w={}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function E(){return f||(f=1,"production"===process.env.NODE_ENV?a.exports=function(){if(o)return c;o=1;var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,f=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,y=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,O=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var o=e.$$typeof;switch(o){case r:switch(e=e.type){case s:case l:case n:case a:case i:case y:return e;default:switch(e=e&&e.$$typeof){case f:case p:case b:case m:case u:return e;default:return o}}case t:return o}}}function w(e){return S(e)===l}return c.AsyncMode=s,c.ConcurrentMode=l,c.ContextConsumer=f,c.ContextProvider=u,c.Element=r,c.ForwardRef=p,c.Fragment=n,c.Lazy=b,c.Memo=m,c.Portal=t,c.Profiler=a,c.StrictMode=i,c.Suspense=y,c.isAsyncMode=function(e){return w(e)||S(e)===s},c.isConcurrentMode=w,c.isContextConsumer=function(e){return S(e)===f},c.isContextProvider=function(e){return S(e)===u},c.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},c.isForwardRef=function(e){return S(e)===p},c.isFragment=function(e){return S(e)===n},c.isLazy=function(e){return S(e)===b},c.isMemo=function(e){return S(e)===m},c.isPortal=function(e){return S(e)===t},c.isProfiler=function(e){return S(e)===a},c.isStrictMode=function(e){return S(e)===i},c.isSuspense=function(e){return S(e)===y},c.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===a||e===i||e===y||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===m||e.$$typeof===u||e.$$typeof===f||e.$$typeof===p||e.$$typeof===g||e.$$typeof===h||e.$$typeof===O||e.$$typeof===v)},c.typeOf=S,c}():a.exports=(u||(u=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case r:var m=e.type;switch(m){case u:case f:case n:case i:case o:case l:return m;default:var b=m&&m.$$typeof;switch(b){case c:case s:case d:case y:case a:return b;default:return p}}case t:return p}}}var O=u,S=f,E=c,j=a,x=r,$=s,P=n,T=d,C=y,_=t,k=i,N=o,I=l,R=!1;function M(e){return h(e)===f}w.AsyncMode=O,w.ConcurrentMode=S,w.ContextConsumer=E,w.ContextProvider=j,w.Element=x,w.ForwardRef=$,w.Fragment=P,w.Lazy=T,w.Memo=C,w.Portal=_,w.Profiler=k,w.StrictMode=N,w.Suspense=I,w.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(e)||h(e)===u},w.isConcurrentMode=M,w.isContextConsumer=function(e){return h(e)===c},w.isContextProvider=function(e){return h(e)===a},w.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},w.isForwardRef=function(e){return h(e)===s},w.isFragment=function(e){return h(e)===n},w.isLazy=function(e){return h(e)===d},w.isMemo=function(e){return h(e)===y},w.isPortal=function(e){return h(e)===t},w.isProfiler=function(e){return h(e)===i},w.isStrictMode=function(e){return h(e)===o},w.isSuspense=function(e){return h(e)===l},w.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===f||e===i||e===o||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===v||e.$$typeof===g||e.$$typeof===m)},w.typeOf=h}()),w)),a.exports} /* object-assign (c) Sindre Sorhus @license MIT */function j(){if(l)return s;l=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return s=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(r).map((function(e){return r[e]}));if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),u=1;u<arguments.length;u++){for(var f in i=Object(arguments[u]))r.call(i,f)&&(c[f]=i[f]);if(e){a=e(i);for(var s=0;s<a.length;s++)t.call(i,a[s])&&(c[a[s]]=i[a[s]])}}return c},s}function x(){if(y)return p;y=1;return p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function $(){return m?d:(m=1,d=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var P=E();i.exports=function(){if(h)return g;h=1;var e=E(),r=j(),t=x(),n=$(),o=function(){if(v)return b;v=1;var e=function(){};if("production"!==process.env.NODE_ENV){var r=x(),t={},n=$();e=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function o(o,i,a,c,u){if("production"!==process.env.NODE_ENV)for(var f in o)if(n(o,f)){var s;try{if("function"!=typeof o[f]){var l=Error((c||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=o[f](i,f,c,a,null,r)}catch(e){s=e}if(!s||s instanceof Error||e((c||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in t)){t[s.message]=!0;var p=u?u():"";e("Failed "+a+" type: "+s.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},b=o}(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}),g=function(c,u){var f="function"==typeof Symbol&&Symbol.iterator,s="@@iterator",l="<<anonymous>>",p={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:m(a),arrayOf:function(e){return m((function(r,n,o,i,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var c=r[n];if(!Array.isArray(c))return new d("Invalid "+i+" `"+a+"` of type `"+h(c)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<c.length;u++){var f=e(c,u,o,i,a+"["+u+"]",t);if(f instanceof Error)return f}return null}))},element:m((function(e,r,t,n,o){var i=e[r];return c(i)?null:new d("Invalid "+n+" `"+o+"` of type `"+h(i)+"` supplied to `"+t+"`, expected a single ReactElement.")})),elementType:m((function(r,t,n,o,i){var a=r[t];return e.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+h(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return m((function(r,t,n,o,i){if(!(r[t]instanceof e)){var a=e.name||l;return new d("Invalid "+o+" `"+i+"` of type `"+((c=r[t]).constructor&&c.constructor.name?c.constructor.name:l)+"` supplied to `"+n+"`, expected instance of `"+a+"`.")}var c;return null}))},node:m((function(e,r,t,n,o){return g(e[r])?null:new d("Invalid "+n+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")})),objectOf:function(e){return m((function(r,o,i,a,c){if("function"!=typeof e)return new d("Property `"+c+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=r[o],f=h(u);if("object"!==f)return new d("Invalid "+a+" `"+c+"` of type `"+f+"` supplied to `"+i+"`, expected an object.");for(var s in u)if(n(u,s)){var l=e(u,s,i,a,c+"."+s,t);if(l instanceof Error)return l}return null}))},oneOf:function(e){return Array.isArray(e)?m((function(r,t,n,o,i){for(var a=r[t],c=0;c<e.length;c++)if(y(a,e[c]))return null;var u=JSON.stringify(e,(function(e,r){return"symbol"===O(r)?String(r):r}));return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+u+".")})):("production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var r=0;r<e.length;r++){var o=e[r];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+S(o)+" at index "+r+"."),a}return m((function(r,o,i,a,c){for(var u=[],f=0;f<e.length;f++){var s=(0,e[f])(r,o,i,a,c,t);if(null==s)return null;s.data&&n(s.data,"expectedType")&&u.push(s.data.expectedType)}return new d("Invalid "+a+" `"+c+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(r,n,o,i,a){var c=r[n],u=h(c);if("object"!==u)return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var f in e){var s=e[f];if("function"!=typeof s)return v(o,i,a,f,O(s));var l=s(c,f,o,i,a+"."+f,t);if(l)return l}return null}))},exact:function(e){return m((function(o,i,a,c,u){var f=o[i],s=h(f);if("object"!==s)return new d("Invalid "+c+" `"+u+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");var l=r({},o[i],e);for(var p in l){var y=e[p];if(n(e,p)&&"function"!=typeof y)return v(a,c,u,p,O(y));if(!y)return new d("Invalid "+c+" `"+u+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=y(f,p,a,c,u+"."+p,t);if(m)return m}return null}))}};function y(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function d(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var r={},n=0;function o(o,a,c,f,s,p,y){if(f=f||l,p=p||c,y!==t){if(u){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var b=f+":"+c;!r[b]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+f+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[b]=!0,n++)}}return null==a[c]?o?null===a[c]?new d("The "+s+" `"+p+"` is marked as required in `"+f+"`, but its value is `null`."):new d("The "+s+" `"+p+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(a,c,f,s,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function b(e){return m((function(r,t,n,o,i,a){var c=r[t];return h(c)!==e?new d("Invalid "+o+" `"+i+"` of type `"+O(c)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,r,t,n,o){return new d((e||"React class")+": "+r+" type `"+t+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function g(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(g);if(null===e||c(e))return!0;var r=function(e){var r=e&&(f&&e[f]||e[s]);if("function"==typeof r)return r}(e);if(!r)return!1;var t,n=r.call(e);if(r!==e.entries){for(;!(t=n.next()).done;)if(!g(t.value))return!1}else for(;!(t=n.next()).done;){var o=t.value;if(o&&!g(o[1]))return!1}return!0;default:return!1}}function h(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function O(e){if(null==e)return""+e;var r=h(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function S(e){var r=O(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return d.prototype=Error.prototype,p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},g}()(P.isElement,!0)}else i.exports=function(){if(S)return O;S=1;var e=x();function r(){}function t(){}return t.resetWarningCache=r,O=function(){function n(r,t,n,o,i,a){if(a!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:t,resetWarningCache:r};return i.PropTypes=i,i}}()();var T=n(i.exports);function C(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function _(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?C(Object(t),!0).forEach((function(r){k(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):C(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function k(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},N.apply(this,arguments)}var I,R,M,A,V,D,F,z,W,q,L,Y,U,J,B,H={exports:{}},G={exports:{}},K={},Q={}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ function X(){return M||(M=1,"production"===process.env.NODE_ENV?G.exports=function(){if(I)return K;I=1;var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case r:switch(e=e.type){case u:case f:case n:case i:case o:case l:return e;default:switch(e=e&&e.$$typeof){case c:case s:case d:case y:case a:return e;default:return p}}case t:return p}}}function O(e){return h(e)===f}return K.AsyncMode=u,K.ConcurrentMode=f,K.ContextConsumer=c,K.ContextProvider=a,K.Element=r,K.ForwardRef=s,K.Fragment=n,K.Lazy=d,K.Memo=y,K.Portal=t,K.Profiler=i,K.StrictMode=o,K.Suspense=l,K.isAsyncMode=function(e){return O(e)||h(e)===u},K.isConcurrentMode=O,K.isContextConsumer=function(e){return h(e)===c},K.isContextProvider=function(e){return h(e)===a},K.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},K.isForwardRef=function(e){return h(e)===s},K.isFragment=function(e){return h(e)===n},K.isLazy=function(e){return h(e)===d},K.isMemo=function(e){return h(e)===y},K.isPortal=function(e){return h(e)===t},K.isProfiler=function(e){return h(e)===i},K.isStrictMode=function(e){return h(e)===o},K.isSuspense=function(e){return h(e)===l},K.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===f||e===i||e===o||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===v||e.$$typeof===g||e.$$typeof===m)},K.typeOf=h,K}():G.exports=(R||(R=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,d=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case r:var m=e.type;switch(m){case u:case f:case n:case i:case o:case l:return m;default:var b=m&&m.$$typeof;switch(b){case c:case s:case d:case y:case a:return b;default:return p}}case t:return p}}}var O=u,S=f,w=c,E=a,j=r,x=s,$=n,P=d,T=y,C=t,_=i,k=o,N=l,I=!1;function R(e){return h(e)===f}Q.AsyncMode=O,Q.ConcurrentMode=S,Q.ContextConsumer=w,Q.ContextProvider=E,Q.Element=j,Q.ForwardRef=x,Q.Fragment=$,Q.Lazy=P,Q.Memo=T,Q.Portal=C,Q.Profiler=_,Q.StrictMode=k,Q.Suspense=N,Q.isAsyncMode=function(e){return I||(I=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||h(e)===u},Q.isConcurrentMode=R,Q.isContextConsumer=function(e){return h(e)===c},Q.isContextProvider=function(e){return h(e)===a},Q.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},Q.isForwardRef=function(e){return h(e)===s},Q.isFragment=function(e){return h(e)===n},Q.isLazy=function(e){return h(e)===d},Q.isMemo=function(e){return h(e)===y},Q.isPortal=function(e){return h(e)===t},Q.isProfiler=function(e){return h(e)===i},Q.isStrictMode=function(e){return h(e)===o},Q.isSuspense=function(e){return h(e)===l},Q.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===f||e===i||e===o||e===l||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===y||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===v||e.$$typeof===g||e.$$typeof===m)},Q.typeOf=h}()),Q)),G.exports} /* object-assign (c) Sindre Sorhus @license MIT */function Z(){return F?D:(F=1,D="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function ee(){return W?z:(W=1,z=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var re=X();H.exports=function(){if(U)return Y;U=1;var e=X(),r=function(){if(V)return A;V=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return A=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),u=1;u<arguments.length;u++){for(var f in i=Object(arguments[u]))r.call(i,f)&&(c[f]=i[f]);if(e){a=e(i);for(var s=0;s<a.length;s++)t.call(i,a[s])&&(c[a[s]]=i[a[s]])}}return c},A}(),t=Z(),n=ee(),o=function(){if(L)return q;L=1;var e=function(){};if("production"!==process.env.NODE_ENV){var r=Z(),t={},n=ee();e=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function o(o,i,a,c,u){if("production"!==process.env.NODE_ENV)for(var f in o)if(n(o,f)){var s;try{if("function"!=typeof o[f]){var l=Error((c||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}s=o[f](i,f,c,a,null,r)}catch(e){s=e}if(!s||s instanceof Error||e((c||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in t)){t[s.message]=!0;var p=u?u():"";e("Failed "+a+" type: "+s.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},q=o}(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}),Y=function(c,u){var f="function"==typeof Symbol&&Symbol.iterator,s="<<anonymous>>",l={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:d(a),arrayOf:function(e){return d((function(r,n,o,i,a){if("function"!=typeof e)return new y("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var c=r[n];if(!Array.isArray(c))return new y("Invalid "+i+" `"+a+"` of type `"+g(c)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<c.length;u++){var f=e(c,u,o,i,a+"["+u+"]",t);if(f instanceof Error)return f}return null}))},element:d((function(e,r,t,n,o){var i=e[r];return c(i)?null:new y("Invalid "+n+" `"+o+"` of type `"+g(i)+"` supplied to `"+t+"`, expected a single ReactElement.")})),elementType:d((function(r,t,n,o,i){var a=r[t];return e.isValidElementType(a)?null:new y("Invalid "+o+" `"+i+"` of type `"+g(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return d((function(r,t,n,o,i){if(!(r[t]instanceof e)){var a=e.name||s;return new y("Invalid "+o+" `"+i+"` of type `"+((c=r[t]).constructor&&c.constructor.name?c.constructor.name:s)+"` supplied to `"+n+"`, expected instance of `"+a+"`.")}var c;return null}))},node:d((function(e,r,t,n,o){return v(e[r])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")})),objectOf:function(e){return d((function(r,o,i,a,c){if("function"!=typeof e)return new y("Property `"+c+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=r[o],f=g(u);if("object"!==f)return new y("Invalid "+a+" `"+c+"` of type `"+f+"` supplied to `"+i+"`, expected an object.");for(var s in u)if(n(u,s)){var l=e(u,s,i,a,c+"."+s,t);if(l instanceof Error)return l}return null}))},oneOf:function(e){return Array.isArray(e)?d((function(r,t,n,o,i){for(var a=r[t],c=0;c<e.length;c++)if(p(a,e[c]))return null;var u=JSON.stringify(e,(function(e,r){return"symbol"===h(r)?String(r):r}));return new y("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+u+".")})):("production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var r=0;r<e.length;r++){var o=e[r];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(o)+" at index "+r+"."),a}return d((function(r,o,i,a,c){for(var u=[],f=0;f<e.length;f++){var s=(0,e[f])(r,o,i,a,c,t);if(null==s)return null;s.data&&n(s.data,"expectedType")&&u.push(s.data.expectedType)}return new y("Invalid "+a+" `"+c+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return d((function(r,n,o,i,a){var c=r[n],u=g(c);if("object"!==u)return new y("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var f in e){var s=e[f];if("function"!=typeof s)return b(o,i,a,f,h(s));var l=s(c,f,o,i,a+"."+f,t);if(l)return l}return null}))},exact:function(e){return d((function(o,i,a,c,u){var f=o[i],s=g(f);if("object"!==s)return new y("Invalid "+c+" `"+u+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");var l=r({},o[i],e);for(var p in l){var d=e[p];if(n(e,p)&&"function"!=typeof d)return b(a,c,u,p,h(d));if(!d)return new y("Invalid "+c+" `"+u+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=d(f,p,a,c,u+"."+p,t);if(m)return m}return null}))}};function p(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function y(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function d(e){if("production"!==process.env.NODE_ENV)var r={},n=0;function o(o,a,c,f,l,p,d){if(f=f||s,p=p||c,d!==t){if(u){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var b=f+":"+c;!r[b]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+f+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[b]=!0,n++)}}return null==a[c]?o?null===a[c]?new y("The "+l+" `"+p+"` is marked as required in `"+f+"`, but its value is `null`."):new y("The "+l+" `"+p+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(a,c,f,l,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function m(e){return d((function(r,t,n,o,i,a){var c=r[t];return g(c)!==e?new y("Invalid "+o+" `"+i+"` of type `"+h(c)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function b(e,r,t,n,o){return new y((e||"React class")+": "+r+" type `"+t+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function v(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(v);if(null===e||c(e))return!0;var r=function(e){var r=e&&(f&&e[f]||e["@@iterator"]);if("function"==typeof r)return r}(e);if(!r)return!1;var t,n=r.call(e);if(r!==e.entries){for(;!(t=n.next()).done;)if(!v(t.value))return!1}else for(;!(t=n.next()).done;){var o=t.value;if(o&&!v(o[1]))return!1}return!0;default:return!1}}function g(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function h(e){if(null==e)return""+e;var r=g(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function O(e){var r=h(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return y.prototype=Error.prototype,l.checkPropTypes=o,l.resetWarningCache=o.resetWarningCache,l.PropTypes=l,l},Y}()(re.isElement,!0)}else H.exports=function(){if(B)return J;B=1;var e=Z();function r(){}function t(){}return t.resetWarningCache=r,J=function(){function n(r,t,n,o,i,a){if(a!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:t,resetWarningCache:r};return i.PropTypes=i,i}}()();var te,ne=(te=H.exports)&&te.__esModule&&Object.prototype.hasOwnProperty.call(te,"default")?te.default:te,oe=["opened","onClose","color","style"],ie=function(r){var t=r.opened,n=void 0!==t&&t,o=r.onClose,i=void 0===o?function(){}:o,a=r.color,c=void 0===a?"#e0e0e0":a,u=r.style,f=void 0===u?{}:u,s=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(r,oe);return e.useEffect((function(){var e=document.getElementsByTagName("html")[0];return e.style.overflow=n?"hidden":null,function(){e.style.overflow=null}}),[n]),e.createElement("div",N({style:_({position:"fixed",width:"100%",height:"100%",top:0,left:0,right:0,bottom:0,overflow:"hidden",cursor:"pointer",transition:"opacity 0.3s, visibility 0.3s",zIndex:1008,WebkitTapHighlightColor:"transparent",userSelect:"none",backgroundColor:"".concat(c),opacity:n?.75:0,visibility:n?"visible":"hidden"},f),onClick:i},s))};ie.propTypes={opened:ne.bool,onClose:ne.func,color:ne.string,className:ne.string,style:ne.object},ie.defaultProps={opened:!1,onClose:function(){},color:"#e0e0e0"};var ae=function(r){var n=r.title,o=r.opened,i=void 0!==o&&o,a=r.size,c=void 0===a?"md":a,u=r.onClose,f=void 0===u?function(){}:u,s=r.color,l=void 0===s?"#ffffff":s,p=r.overlayColor,y=void 0===p?"#e0e0e0":p,d=r.onOverlayClick,m=void 0===d?function(){}:d,b=r.children;return e.createElement(e.Fragment,null,e.createElement(ie,{opened:i,color:y,onClose:m}),e.createElement("div",{title:"modal",style:{position:"fixed",alignItems:"center",justifyContent:"center",bottom:0,right:0,top:0,left:0,overflow:"hidden",padding:".4rem",zIndex:1010,display:i?"flex":"none",opacity:i?1:0,cursor:"pointer"},role:"dialog"},e.createElement("div",{title:"modal-container",style:t(t({background:"".concat(l),borderRadius:".1rem",boxShadow:"0 .2rem .5rem rgba(48, 55, 66, .3)",flexDirection:"column",maxHeight:"75vh",width:"100%",display:i?"flex":"none",maxWidth:"sm"==c?"320px":"lg"==c?"960px":"640px",padding:"sm"==c?"0 .4rem":"0 .8rem"},"boxShadow","lg"==c?"none":"0 .2rem .5rem rgba(48, 55, 66, .3)"),"cursor","default"),role:"document",tabIndex:"-1"},e.createElement("div",{title:"modal-container-header",style:{padding:".8rem"}},e.createElement("button",{title:"header-close-btn",style:{border:"none",backgroundColor:"inherit",padding:"4px",fontFamily:"inherit",fontWeight:500,fontSize:"1rem",cursor:"pointer",color:"inherit",float:"right"},type:"button",onClick:f},"✖"),e.createElement("div",{title:"header-title",style:{fontSize:18,fontWeight:500}},n)),e.createElement("div",{title:"modal-container-body",style:{overflowY:"auto",padding:".8rem",position:"relative"}},b))))};ae.propTypes={title:T.string,opened:T.bool,size:T.oneOf(["sm","md","lg"]),onClose:T.func,onOverlayClick:T.func,color:T.string,overlayColor:T.string,children:T.node,className:T.string,style:T.object},ae.defaultProps={title:"Modal Title",opened:!1,size:"md",color:"#ffffff",overlayColor:"#e0e0e0",onClose:function(){},onOverlayClick:function(){}};export{ae as default};