Comparing version 2.0.2 to 3.0.0
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var r=require("react"),n=e(r),t=e(require("ua-parser-js"));function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,r){return e(r={exports:{}},r.exports),r.exports}var i=a(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,t=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,s=n?Symbol.for("react.async_mode"):60111,l=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,y=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.fundamental"):60117,h=n?Symbol.for("react.responder"):60118;function g(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:switch(e=e.type){case s:case l:case a:case c:case i:case y:return e;default:switch(e=e&&e.$$typeof){case f:case p:case u:return e;default:return r}}case v:case m:case o:return r}}}function O(e){return g(e)===l}r.typeOf=g,r.AsyncMode=s,r.ConcurrentMode=l,r.ContextConsumer=f,r.ContextProvider=u,r.Element=t,r.ForwardRef=p,r.Fragment=a,r.Lazy=v,r.Memo=m,r.Portal=o,r.Profiler=c,r.StrictMode=i,r.Suspense=y,r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===l||e===c||e===i||e===y||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===u||e.$$typeof===f||e.$$typeof===p||e.$$typeof===b||e.$$typeof===h)},r.isAsyncMode=function(e){return O(e)||g(e)===s},r.isConcurrentMode=O,r.isContextConsumer=function(e){return g(e)===f},r.isContextProvider=function(e){return g(e)===u},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return g(e)===p},r.isFragment=function(e){return g(e)===a},r.isLazy=function(e){return g(e)===v},r.isMemo=function(e){return g(e)===m},r.isPortal=function(e){return g(e)===o},r.isProfiler=function(e){return g(e)===c},r.isStrictMode=function(e){return g(e)===i},r.isSuspense=function(e){return g(e)===y}});o(i);var c=a(function(e,r){"production"!==process.env.NODE_ENV&&function(){Object.defineProperty(r,"__esModule",{value:!0});var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118;var h=function(e,r){if(void 0===r)throw new Error("`lowPriorityWarning(condition, format, ...args)` requires a warning message argument");if(!e){for(var n=arguments.length,t=Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];(function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];var o=0,a="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.warn(a);try{throw new Error(a)}catch(e){}}).apply(void 0,[r].concat(t))}};function g(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case n:var y=e.type;switch(y){case f:case s:case o:case i:case a:case p:return y;default:var v=y&&y.$$typeof;switch(v){case u:case l:case c:return v;default:return r}}case m:case d:case t:return r}}}var O=f,w=s,S=u,E=c,j=n,P=l,x=o,_=m,$=d,T=t,C=i,I=a,N=p,k=!1;function A(e){return g(e)===s}r.typeOf=g,r.AsyncMode=O,r.ConcurrentMode=w,r.ContextConsumer=S,r.ContextProvider=E,r.Element=j,r.ForwardRef=P,r.Fragment=x,r.Lazy=_,r.Memo=$,r.Portal=T,r.Profiler=C,r.StrictMode=I,r.Suspense=N,r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===i||e===a||e===p||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===c||e.$$typeof===u||e.$$typeof===l||e.$$typeof===v||e.$$typeof===b)},r.isAsyncMode=function(e){return k||(k=!0,h(!1,"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.")),A(e)||g(e)===f},r.isConcurrentMode=A,r.isContextConsumer=function(e){return g(e)===u},r.isContextProvider=function(e){return g(e)===c},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},r.isForwardRef=function(e){return g(e)===l},r.isFragment=function(e){return g(e)===o},r.isLazy=function(e){return g(e)===m},r.isMemo=function(e){return g(e)===d},r.isPortal=function(e){return g(e)===t},r.isProfiler=function(e){return g(e)===i},r.isStrictMode=function(e){return g(e)===a},r.isSuspense=function(e){return g(e)===p}}()});o(c);var u=a(function(e){e.exports="production"===process.env.NODE_ENV?i:c}),f=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var p=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={},n=0;n<10;n++)r["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(r).map(function(e){return r[e]}).join(""))return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},t)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var n,t,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var i in n=Object(arguments[a]))s.call(n,i)&&(o[i]=n[i]);if(f){t=f(n);for(var c=0;c<t.length;c++)l.call(n,t[c])&&(o[t[c]]=n[t[c]])}}return o},y="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",d=function(){};if("production"!==process.env.NODE_ENV){var m=y,v={},b=Function.call.bind(Object.prototype.hasOwnProperty);d=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function h(e,r,n,t,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(b(e,a)){var i;try{if("function"!=typeof e[a]){var c=Error((t||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.");throw c.name="Invariant Violation",c}i=e[a](r,a,t,n,null,m)}catch(e){i=e}if(!i||i instanceof Error||d((t||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in v)){v[i.message]=!0;var u=o?o():"";d("Failed "+n+" type: "+i.message+(null!=u?u:""))}}}h.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(v={})};var g=h,O=Function.call.bind(Object.prototype.hasOwnProperty),w=function(){};function S(){return null}"production"!==process.env.NODE_ENV&&(w=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}});var E=function(e,r){var n="function"==typeof Symbol&&Symbol.iterator,t="@@iterator";var o="<<anonymous>>",a={array:s("array"),bool:s("boolean"),func:s("function"),number:s("number"),object:s("object"),string:s("string"),symbol:s("symbol"),any:f(S),arrayOf:function(e){return f(function(r,n,t,o,a){if("function"!=typeof e)return new c("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var i=r[n];if(!Array.isArray(i)){var u=d(i);return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected an array.")}for(var f=0;f<i.length;f++){var s=e(i,f,t,o,a+"["+f+"]",y);if(s instanceof Error)return s}return null})},element:function(){return f(function(r,n,t,o,a){var i=r[n];if(!e(i)){var u=d(i);return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected a single ReactElement.")}return null})}(),elementType:function(){return f(function(e,r,n,t,o){var a=e[r];if(!u.isValidElementType(a)){var i=d(a);return new c("Invalid "+t+" `"+o+"` of type `"+i+"` supplied to `"+n+"`, expected a single ReactElement type.")}return null})}(),instanceOf:function(e){return f(function(r,n,t,a,i){if(!(r[n]instanceof e)){var u=e.name||o,f=function(e){if(!e.constructor||!e.constructor.name)return o;return e.constructor.name}(r[n]);return new c("Invalid "+a+" `"+i+"` of type `"+f+"` supplied to `"+t+"`, expected instance of `"+u+"`.")}return null})},node:function(){return f(function(e,r,n,t,o){if(!l(e[r]))return new c("Invalid "+t+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.");return null})}(),objectOf:function(e){return f(function(r,n,t,o,a){if("function"!=typeof e)return new c("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var i=r[n],u=d(i);if("object"!==u)return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected an object.");for(var f in i)if(O(i,f)){var s=e(i,f,t,o,a+"."+f,y);if(s instanceof Error)return s}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&w(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."),S;return f(function(r,n,t,o,a){for(var u=r[n],f=0;f<e.length;f++)if(i(u,e[f]))return null;var s=JSON.stringify(e,function(e,r){var n=m(r);return"symbol"===n?String(r):r});return new c("Invalid "+o+" `"+a+"` of value `"+String(u)+"` supplied to `"+t+"`, expected one of "+s+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&w("Invalid argument supplied to oneOfType, expected an instance of array."),S;for(var r=0;r<e.length;r++){var n=e[r];if("function"!=typeof n)return w("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(n)+" at index "+r+"."),S}return f(function(r,n,t,o,a){for(var i=0;i<e.length;i++){var u=e[i];if(null==u(r,n,t,o,a,y))return null}return new c("Invalid "+o+" `"+a+"` supplied to `"+t+"`.")})},shape:function(e){return f(function(r,n,t,o,a){var i=r[n],u=d(i);if("object"!==u)return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected `object`.");for(var f in e){var s=e[f];if(s){var l=s(i,f,t,o,a+"."+f,y);if(l)return l}}return null})},exact:function(e){return f(function(r,n,t,o,a){var i=r[n],u=d(i);if("object"!==u)return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected `object`.");var f=p({},r[n],e);for(var s in f){var l=e[s];if(!l)return new c("Invalid "+o+" `"+a+"` key `"+s+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(r[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=l(i,s,t,o,a+"."+s,y);if(m)return m}return null})}};function i(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function c(e){this.message=e,this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var n={},t=0;function a(a,i,u,f,s,l,p){if(f=f||o,l=l||u,p!==y){if(r){var d=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 d.name="Invariant Violation",d}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=f+":"+u;!n[m]&&t<3&&(w("You are manually calling a React.PropTypes validation function for the `"+l+"` 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."),n[m]=!0,t++)}}return null==i[u]?a?new c(null===i[u]?"The "+s+" `"+l+"` is marked as required in `"+f+"`, but its value is `null`.":"The "+s+" `"+l+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(i,u,f,s,l)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function s(e){return f(function(r,n,t,o,a,i){var u=r[n];return d(u)!==e?new c("Invalid "+o+" `"+a+"` of type `"+m(u)+"` supplied to `"+t+"`, expected `"+e+"`."):null})}function l(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(l);if(null===r||e(r))return!0;var o=function(e){var r=e&&(n&&e[n]||e[t]);if("function"==typeof r)return r}(r);if(!o)return!1;var a,i=o.call(r);if(o!==r.entries){for(;!(a=i.next()).done;)if(!l(a.value))return!1}else for(;!(a=i.next()).done;){var c=a.value;if(c&&!l(c[1]))return!1}return!0;default:return!1}}function d(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 m(e){if(null==e)return""+e;var r=d(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function v(e){var r=m(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return c.prototype=Error.prototype,a.checkPropTypes=g,a.resetWarningCache=g.resetWarningCache,a.PropTypes=a,a};function j(){}function P(){}P.resetWarningCache=j;var x=a(function(e){if("production"!==process.env.NODE_ENV){e.exports=E(u.isElement,!0)}else e.exports=function(){function e(e,r,n,t,o,a){if(a!==y){var i=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 i.name="Invariant Violation",i}}function r(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:P,resetWarningCache:j};return n.PropTypes=n,n}()}),_=n.createContext(),$=_.Consumer,T=function(e){var o=e.value,a=e.children,i=new t(o).getResult(),c=r.useState(i),u=c[0],f=c[1];return r.useEffect(function(){u.ua!==o&&void 0!==o&&f(o)}),n.createElement(_.Provider,{value:u},a)};T.propTypes={value:x.any,children:x.node};exports.UserAgent=$,exports.UserAgentProvider=T,exports.withUserAgent=function(e){return function(r){function t(){r.apply(this,arguments)}return r&&(t.__proto__=r),(t.prototype=Object.create(r&&r.prototype)).constructor=t,t.getInitialProps=function(r){return new Promise(function(n,t){var o;if(o={},e.getInitialProps)return e.getInitialProps(r).then(function(e){try{return o=e,a.call(this)}catch(e){return t(e)}}.bind(this),t);function a(){return n(o)}return a.call(this)})},t.prototype.render=function(){var r=this;return n.createElement($,null,function(t){return n.createElement(e,Object.assign({},{ua:t},r.props))})},t}(n.PureComponent)}; | ||
var e=require("react"),t=require("ua-parser-js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=/*#__PURE__*/r(e),o=/*#__PURE__*/r(t);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function c(e){var t={exports:{}};return e(t,t.exports),t.exports}var u="function"==typeof Symbol&&Symbol.for,f=u?Symbol.for("react.element"):60103,s=u?Symbol.for("react.portal"):60106,p=u?Symbol.for("react.fragment"):60107,l=u?Symbol.for("react.strict_mode"):60108,y=u?Symbol.for("react.profiler"):60114,d=u?Symbol.for("react.provider"):60109,m=u?Symbol.for("react.context"):60110,b=u?Symbol.for("react.async_mode"):60111,v=u?Symbol.for("react.concurrent_mode"):60111,h=u?Symbol.for("react.forward_ref"):60112,g=u?Symbol.for("react.suspense"):60113,S=u?Symbol.for("react.suspense_list"):60120,O=u?Symbol.for("react.memo"):60115,w=u?Symbol.for("react.lazy"):60116,E=u?Symbol.for("react.block"):60121,j=u?Symbol.for("react.fundamental"):60117,x=u?Symbol.for("react.responder"):60118,$=u?Symbol.for("react.scope"):60119;function P(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case f:switch(e=e.type){case b:case v:case p:case y:case l:case g:return e;default:switch(e=e&&e.$$typeof){case m:case h:case w:case O:case d:return e;default:return t}}case s:return t}}}function T(e){return P(e)===v}var _={AsyncMode:b,ConcurrentMode:v,ContextConsumer:m,ContextProvider:d,Element:f,ForwardRef:h,Fragment:p,Lazy:w,Memo:O,Portal:s,Profiler:y,StrictMode:l,Suspense:g,isAsyncMode:function(e){return T(e)||P(e)===b},isConcurrentMode:T,isContextConsumer:function(e){return P(e)===m},isContextProvider:function(e){return P(e)===d},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===f},isForwardRef:function(e){return P(e)===h},isFragment:function(e){return P(e)===p},isLazy:function(e){return P(e)===w},isMemo:function(e){return P(e)===O},isPortal:function(e){return P(e)===s},isProfiler:function(e){return P(e)===y},isStrictMode:function(e){return P(e)===l},isSuspense:function(e){return P(e)===g},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===p||e===v||e===y||e===l||e===g||e===S||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===O||e.$$typeof===d||e.$$typeof===m||e.$$typeof===h||e.$$typeof===j||e.$$typeof===x||e.$$typeof===$||e.$$typeof===E)},typeOf:P},C=c(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var y=e.type;switch(y){case f:case s:case o:case i:case a:case l:return y;default:var b=y&&y.$$typeof;switch(b){case u:case p:case m:case d:case c:return b;default:return t}}case n:return t}}}var O=s,w=u,E=c,j=r,x=p,$=o,P=m,T=d,_=n,C=i,I=a,k=l,N=!1;function R(e){return S(e)===s}t.AsyncMode=f,t.ConcurrentMode=O,t.ContextConsumer=w,t.ContextProvider=E,t.Element=j,t.ForwardRef=x,t.Fragment=$,t.Lazy=P,t.Memo=T,t.Portal=_,t.Profiler=C,t.StrictMode=I,t.Suspense=k,t.isAsyncMode=function(e){return N||(N=!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)||S(e)===f},t.isConcurrentMode=R,t.isContextConsumer=function(e){return S(e)===u},t.isContextProvider=function(e){return S(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===p},t.isFragment=function(e){return S(e)===o},t.isLazy=function(e){return S(e)===m},t.isMemo=function(e){return S(e)===d},t.isPortal=function(e){return S(e)===n},t.isProfiler=function(e){return S(e)===i},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===l},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===i||e===a||e===l||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===c||e.$$typeof===u||e.$$typeof===p||e.$$typeof===v||e.$$typeof===h||e.$$typeof===g||e.$$typeof===b)},t.typeOf=S}()}),I=c(function(e){e.exports="production"===process.env.NODE_ENV?_:C}),k=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;function A(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var M=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 t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(e){return t[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(e,t){for(var r,n,o=A(e),a=1;a<arguments.length;a++){for(var i in r=Object(arguments[a]))N.call(r,i)&&(o[i]=r[i]);if(k){n=k(r);for(var c=0;c<n.length;c++)R.call(r,n[c])&&(o[n[c]]=r[n[c]])}}return o},V=Function.call.bind(Object.prototype.hasOwnProperty),D="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",F=V,q=function(){};if("production"!==process.env.NODE_ENV){var z=D,U={},W=F;q=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function L(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(W(e,a)){var i;try{if("function"!=typeof e[a]){var c=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}i=e[a](t,a,n,r,null,z)}catch(e){i=e}if(!i||i instanceof Error||q((n||"React class")+": type specification of "+r+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in U)){U[i.message]=!0;var u=o?o():"";q("Failed "+r+" type: "+i.message+(null!=u?u:""))}}}L.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(U={})};var J=L,B=function(){};function Y(){return null}function H(){}function G(){}"production"!==process.env.NODE_ENV&&(B=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),G.resetWarningCache=H;var K=c(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var r="function"==typeof Symbol&&Symbol.iterator,n="<<anonymous>>",o={array:u("array"),bigint:u("bigint"),bool:u("boolean"),func:u("function"),number:u("number"),object:u("object"),string:u("string"),symbol:u("symbol"),any:c(Y),arrayOf:function(e){return c(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var c=t[r];if(!Array.isArray(c))return new i("Invalid "+o+" `"+a+"` of type `"+p(c)+"` supplied to `"+n+"`, expected an array.");for(var u=0;u<c.length;u++){var f=e(c,u,n,o,a+"["+u+"]",D);if(f instanceof Error)return f}return null})},element:c(function(t,r,n,o,a){var c=t[r];return e(c)?null:new i("Invalid "+o+" `"+a+"` of type `"+p(c)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:c(function(e,t,r,n,o){var a=e[t];return I.isValidElementType(a)?null:new i("Invalid "+n+" `"+o+"` of type `"+p(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return c(function(t,r,o,a,c){return t[r]instanceof e?null:new i("Invalid "+a+" `"+c+"` of type `"+((u=t[r]).constructor&&u.constructor.name?u.constructor.name:n)+"` supplied to `"+o+"`, expected instance of `"+(e.name||n)+"`.");var u})},node:c(function(e,t,r,n,o){return s(e[t])?null:new i("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return c(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var c=t[r],u=p(c);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+n+"`, expected an object.");for(var f in c)if(F(c,f)){var s=e(c,f,n,o,a+"."+f,D);if(s instanceof Error)return s}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&B(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."),Y;function t(t,r,n,o,c){for(var u=t[r],f=0;f<e.length;f++)if(a(u,e[f]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===l(t)?String(t):t});return new i("Invalid "+o+" `"+c+"` of value `"+String(u)+"` supplied to `"+n+"`, expected one of "+s+".")}return c(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&B("Invalid argument supplied to oneOfType, expected an instance of array."),Y;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return B("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(r)+" at index "+t+"."),Y}return c(function(t,r,n,o,a){for(var c=[],u=0;u<e.length;u++){var f=(0,e[u])(t,r,n,o,a,D);if(null==f)return null;f.data&&F(f.data,"expectedType")&&c.push(f.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+n+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return c(function(t,r,n,o,a){var c=t[r],u=p(c);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+n+"`, expected `object`.");for(var s in e){var y=e[s];if("function"!=typeof y)return f(n,o,a,s,l(y));var d=y(c,s,n,o,a+"."+s,D);if(d)return d}return null})},exact:function(e){return c(function(t,r,n,o,a){var c=t[r],u=p(c);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+n+"`, expected `object`.");var s=M({},t[r],e);for(var y in s){var d=e[y];if(F(e,y)&&"function"!=typeof d)return f(n,o,a,y,l(d));if(!d)return new i("Invalid "+o+" `"+a+"` key `"+y+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(t[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=d(c,y,n,o,a+"."+y,D);if(m)return m}return null})}};function a(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function c(e){function t(t,r,o,a,c,u,f){if(a=a||n,u=u||o,f!==D){var s=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 s.name="Invariant Violation",s}return null==r[o]?t?new i(null===r[o]?"The "+c+" `"+u+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+c+" `"+u+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,c,u)}process;var r=t.bind(null,!1);return r.isRequired=t.bind(null,!0),r}function u(e){return c(function(t,r,n,o,a,c){var u=t[r];return p(u)!==e?new i("Invalid "+o+" `"+a+"` of type `"+l(u)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function f(e,t,r,n,o){return new i((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function s(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(s);if(null===t||e(t))return!0;var n=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!n)return!1;var o,a=n.call(t);if(n!==t.entries){for(;!(o=a.next()).done;)if(!s(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!s(i[1]))return!1}return!0;default:return!1}}function p(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function l(e){if(null==e)return""+e;var t=p(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=l(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,o.checkPropTypes=J,o.resetWarningCache=J.resetWarningCache,o.PropTypes=o,o}(I.isElement):function(){function e(e,t,r,n,o,a){if(a!==D){var i=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 i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:G,resetWarningCache:H};return r.PropTypes=r,r}()}),Q=n.default.createContext(),X=Q.Consumer,Z=function(t){var r=t.value,a=t.children,i=new o.default(r).getResult(),c=e.useState(i),u=c[0],f=c[1];return e.useEffect(function(){u.ua!==r&&void 0!==r&&f(r)}),/*#__PURE__*/n.default.createElement(Q.Provider,{value:u},a)};Z.propTypes={value:K.any,children:K.node},exports.UserAgent=X,exports.UserAgentProvider=Z,exports.useUserAgent=function(){return n.default.useContext(Q)},exports.withUserAgent=function(e){/*#__PURE__*/return function(t){var r,o;function c(){return t.apply(this,arguments)||this}return o=t,(r=c).prototype=Object.create(o.prototype),r.prototype.constructor=r,i(r,o),c.getInitialProps=function(t){try{var r={},n=function(){if(e.getInitialProps)return Promise.resolve(e.getInitialProps(t)).then(function(e){r=e})}();return Promise.resolve(n&&n.then?n.then(function(){return r}):r)}catch(e){return Promise.reject(e)}},c.prototype.render=function(){var t=this;/*#__PURE__*/return n.default.createElement(X,null,function(r){/*#__PURE__*/return n.default.createElement(e,a({ua:r},t.props))})},c}(n.default.PureComponent)}; | ||
//# sourceMappingURL=react-ua.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react"),require("ua-parser-js")):"function"==typeof define&&define.amd?define(["exports","react","ua-parser-js"],r):r(e.reactUa={},e.react,e.UAParser)}(this,function(e,r,n){var t="default"in r?r.default:r;function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,r){return e(r={exports:{}},r.exports),r.exports}n=n&&n.hasOwnProperty("default")?n.default:n;var i=a(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,t=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,s=n?Symbol.for("react.async_mode"):60111,l=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,y=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.fundamental"):60117,h=n?Symbol.for("react.responder"):60118;function g(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:switch(e=e.type){case s:case l:case a:case c:case i:case y:return e;default:switch(e=e&&e.$$typeof){case f:case p:case u:return e;default:return r}}case v:case m:case o:return r}}}function O(e){return g(e)===l}r.typeOf=g,r.AsyncMode=s,r.ConcurrentMode=l,r.ContextConsumer=f,r.ContextProvider=u,r.Element=t,r.ForwardRef=p,r.Fragment=a,r.Lazy=v,r.Memo=m,r.Portal=o,r.Profiler=c,r.StrictMode=i,r.Suspense=y,r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===l||e===c||e===i||e===y||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===u||e.$$typeof===f||e.$$typeof===p||e.$$typeof===b||e.$$typeof===h)},r.isAsyncMode=function(e){return O(e)||g(e)===s},r.isConcurrentMode=O,r.isContextConsumer=function(e){return g(e)===f},r.isContextProvider=function(e){return g(e)===u},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return g(e)===p},r.isFragment=function(e){return g(e)===a},r.isLazy=function(e){return g(e)===v},r.isMemo=function(e){return g(e)===m},r.isPortal=function(e){return g(e)===o},r.isProfiler=function(e){return g(e)===c},r.isStrictMode=function(e){return g(e)===i},r.isSuspense=function(e){return g(e)===y}});o(i);var c=a(function(e,r){"production"!==process.env.NODE_ENV&&function(){Object.defineProperty(r,"__esModule",{value:!0});var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118;var h=function(e,r){if(void 0===r)throw new Error("`lowPriorityWarning(condition, format, ...args)` requires a warning message argument");if(!e){for(var n=arguments.length,t=Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];(function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),t=1;t<r;t++)n[t-1]=arguments[t];var o=0,a="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.warn(a);try{throw new Error(a)}catch(e){}}).apply(void 0,[r].concat(t))}};function g(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case n:var y=e.type;switch(y){case f:case s:case o:case i:case a:case p:return y;default:var v=y&&y.$$typeof;switch(v){case u:case l:case c:return v;default:return r}}case m:case d:case t:return r}}}var O=f,w=s,S=u,E=c,j=n,P=l,x=o,_=m,$=d,T=t,C=i,I=a,N=p,A=!1;function k(e){return g(e)===s}r.typeOf=g,r.AsyncMode=O,r.ConcurrentMode=w,r.ContextConsumer=S,r.ContextProvider=E,r.Element=j,r.ForwardRef=P,r.Fragment=x,r.Lazy=_,r.Memo=$,r.Portal=T,r.Profiler=C,r.StrictMode=I,r.Suspense=N,r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===i||e===a||e===p||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===c||e.$$typeof===u||e.$$typeof===l||e.$$typeof===v||e.$$typeof===b)},r.isAsyncMode=function(e){return A||(A=!0,h(!1,"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.")),k(e)||g(e)===f},r.isConcurrentMode=k,r.isContextConsumer=function(e){return g(e)===u},r.isContextProvider=function(e){return g(e)===c},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},r.isForwardRef=function(e){return g(e)===l},r.isFragment=function(e){return g(e)===o},r.isLazy=function(e){return g(e)===m},r.isMemo=function(e){return g(e)===d},r.isPortal=function(e){return g(e)===t},r.isProfiler=function(e){return g(e)===i},r.isStrictMode=function(e){return g(e)===a},r.isSuspense=function(e){return g(e)===p}}()});o(c);var u=a(function(e){e.exports="production"===process.env.NODE_ENV?i:c}),f=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var p=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={},n=0;n<10;n++)r["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(r).map(function(e){return r[e]}).join(""))return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},t)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var n,t,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var i in n=Object(arguments[a]))s.call(n,i)&&(o[i]=n[i]);if(f){t=f(n);for(var c=0;c<t.length;c++)l.call(n,t[c])&&(o[t[c]]=n[t[c]])}}return o},y="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",d=function(){};if("production"!==process.env.NODE_ENV){var m=y,v={},b=Function.call.bind(Object.prototype.hasOwnProperty);d=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function h(e,r,n,t,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(b(e,a)){var i;try{if("function"!=typeof e[a]){var c=Error((t||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.");throw c.name="Invariant Violation",c}i=e[a](r,a,t,n,null,m)}catch(e){i=e}if(!i||i instanceof Error||d((t||"React class")+": type specification of "+n+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in v)){v[i.message]=!0;var u=o?o():"";d("Failed "+n+" type: "+i.message+(null!=u?u:""))}}}h.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(v={})};var g=h,O=Function.call.bind(Object.prototype.hasOwnProperty),w=function(){};function S(){return null}"production"!==process.env.NODE_ENV&&(w=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}});var E=function(e,r){var n="function"==typeof Symbol&&Symbol.iterator,t="@@iterator";var o="<<anonymous>>",a={array:s("array"),bool:s("boolean"),func:s("function"),number:s("number"),object:s("object"),string:s("string"),symbol:s("symbol"),any:f(S),arrayOf:function(e){return f(function(r,n,t,o,a){if("function"!=typeof e)return new c("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var i=r[n];if(!Array.isArray(i)){var u=d(i);return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected an array.")}for(var f=0;f<i.length;f++){var s=e(i,f,t,o,a+"["+f+"]",y);if(s instanceof Error)return s}return null})},element:function(){return f(function(r,n,t,o,a){var i=r[n];if(!e(i)){var u=d(i);return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected a single ReactElement.")}return null})}(),elementType:function(){return f(function(e,r,n,t,o){var a=e[r];if(!u.isValidElementType(a)){var i=d(a);return new c("Invalid "+t+" `"+o+"` of type `"+i+"` supplied to `"+n+"`, expected a single ReactElement type.")}return null})}(),instanceOf:function(e){return f(function(r,n,t,a,i){if(!(r[n]instanceof e)){var u=e.name||o,f=function(e){if(!e.constructor||!e.constructor.name)return o;return e.constructor.name}(r[n]);return new c("Invalid "+a+" `"+i+"` of type `"+f+"` supplied to `"+t+"`, expected instance of `"+u+"`.")}return null})},node:function(){return f(function(e,r,n,t,o){if(!l(e[r]))return new c("Invalid "+t+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.");return null})}(),objectOf:function(e){return f(function(r,n,t,o,a){if("function"!=typeof e)return new c("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var i=r[n],u=d(i);if("object"!==u)return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected an object.");for(var f in i)if(O(i,f)){var s=e(i,f,t,o,a+"."+f,y);if(s instanceof Error)return s}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&w(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."),S;return f(function(r,n,t,o,a){for(var u=r[n],f=0;f<e.length;f++)if(i(u,e[f]))return null;var s=JSON.stringify(e,function(e,r){var n=m(r);return"symbol"===n?String(r):r});return new c("Invalid "+o+" `"+a+"` of value `"+String(u)+"` supplied to `"+t+"`, expected one of "+s+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&w("Invalid argument supplied to oneOfType, expected an instance of array."),S;for(var r=0;r<e.length;r++){var n=e[r];if("function"!=typeof n)return w("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(n)+" at index "+r+"."),S}return f(function(r,n,t,o,a){for(var i=0;i<e.length;i++){var u=e[i];if(null==u(r,n,t,o,a,y))return null}return new c("Invalid "+o+" `"+a+"` supplied to `"+t+"`.")})},shape:function(e){return f(function(r,n,t,o,a){var i=r[n],u=d(i);if("object"!==u)return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected `object`.");for(var f in e){var s=e[f];if(s){var l=s(i,f,t,o,a+"."+f,y);if(l)return l}}return null})},exact:function(e){return f(function(r,n,t,o,a){var i=r[n],u=d(i);if("object"!==u)return new c("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+t+"`, expected `object`.");var f=p({},r[n],e);for(var s in f){var l=e[s];if(!l)return new c("Invalid "+o+" `"+a+"` key `"+s+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(r[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=l(i,s,t,o,a+"."+s,y);if(m)return m}return null})}};function i(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function c(e){this.message=e,this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var n={},t=0;function a(a,i,u,f,s,l,p){if(f=f||o,l=l||u,p!==y){if(r){var d=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 d.name="Invariant Violation",d}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var m=f+":"+u;!n[m]&&t<3&&(w("You are manually calling a React.PropTypes validation function for the `"+l+"` 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."),n[m]=!0,t++)}}return null==i[u]?a?new c(null===i[u]?"The "+s+" `"+l+"` is marked as required in `"+f+"`, but its value is `null`.":"The "+s+" `"+l+"` is marked as required in `"+f+"`, but its value is `undefined`."):null:e(i,u,f,s,l)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function s(e){return f(function(r,n,t,o,a,i){var u=r[n];return d(u)!==e?new c("Invalid "+o+" `"+a+"` of type `"+m(u)+"` supplied to `"+t+"`, expected `"+e+"`."):null})}function l(r){switch(typeof r){case"number":case"string":case"undefined":return!0;case"boolean":return!r;case"object":if(Array.isArray(r))return r.every(l);if(null===r||e(r))return!0;var o=function(e){var r=e&&(n&&e[n]||e[t]);if("function"==typeof r)return r}(r);if(!o)return!1;var a,i=o.call(r);if(o!==r.entries){for(;!(a=i.next()).done;)if(!l(a.value))return!1}else for(;!(a=i.next()).done;){var c=a.value;if(c&&!l(c[1]))return!1}return!0;default:return!1}}function d(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 m(e){if(null==e)return""+e;var r=d(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function v(e){var r=m(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return c.prototype=Error.prototype,a.checkPropTypes=g,a.resetWarningCache=g.resetWarningCache,a.PropTypes=a,a};function j(){}function P(){}P.resetWarningCache=j;var x=a(function(e){if("production"!==process.env.NODE_ENV){e.exports=E(u.isElement,!0)}else e.exports=function(){function e(e,r,n,t,o,a){if(a!==y){var i=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 i.name="Invariant Violation",i}}function r(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:P,resetWarningCache:j};return n.PropTypes=n,n}()}),_=t.createContext(),$=_.Consumer,T=function(e){var o=e.value,a=e.children,i=new n(o).getResult(),c=r.useState(i),u=c[0],f=c[1];return r.useEffect(function(){u.ua!==o&&void 0!==o&&f(o)}),t.createElement(_.Provider,{value:u},a)};T.propTypes={value:x.any,children:x.node};e.UserAgent=$,e.UserAgentProvider=T,e.withUserAgent=function(e){return function(r){function n(){r.apply(this,arguments)}return r&&(n.__proto__=r),(n.prototype=Object.create(r&&r.prototype)).constructor=n,n.getInitialProps=function(r){return new Promise(function(n,t){var o;if(o={},e.getInitialProps)return e.getInitialProps(r).then(function(e){try{return o=e,a.call(this)}catch(e){return t(e)}}.bind(this),t);function a(){return n(o)}return a.call(this)})},n.prototype.render=function(){var r=this;return t.createElement($,null,function(n){return t.createElement(e,Object.assign({},{ua:n},r.props))})},n}(t.PureComponent)}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("ua-parser-js")):"function"==typeof define&&define.amd?define(["exports","react","ua-parser-js"],t):t((e||self).reactUa={},e.react,e.uaParserJs)}(this,function(e,t,r){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/n(t),a=/*#__PURE__*/n(r);function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){var t={exports:{}};return e(t,t.exports),t.exports}var f="function"==typeof Symbol&&Symbol.for,s=f?Symbol.for("react.element"):60103,p=f?Symbol.for("react.portal"):60106,l=f?Symbol.for("react.fragment"):60107,y=f?Symbol.for("react.strict_mode"):60108,d=f?Symbol.for("react.profiler"):60114,m=f?Symbol.for("react.provider"):60109,b=f?Symbol.for("react.context"):60110,v=f?Symbol.for("react.async_mode"):60111,h=f?Symbol.for("react.concurrent_mode"):60111,g=f?Symbol.for("react.forward_ref"):60112,S=f?Symbol.for("react.suspense"):60113,O=f?Symbol.for("react.suspense_list"):60120,w=f?Symbol.for("react.memo"):60115,j=f?Symbol.for("react.lazy"):60116,E=f?Symbol.for("react.block"):60121,x=f?Symbol.for("react.fundamental"):60117,$=f?Symbol.for("react.responder"):60118,P=f?Symbol.for("react.scope"):60119;function T(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case s:switch(e=e.type){case v:case h:case l:case d:case y:case S:return e;default:switch(e=e&&e.$$typeof){case b:case g:case j:case w:case m:return e;default:return t}}case p:return t}}}function _(e){return T(e)===h}var C={AsyncMode:v,ConcurrentMode:h,ContextConsumer:b,ContextProvider:m,Element:s,ForwardRef:g,Fragment:l,Lazy:j,Memo:w,Portal:p,Profiler:d,StrictMode:y,Suspense:S,isAsyncMode:function(e){return _(e)||T(e)===v},isConcurrentMode:_,isContextConsumer:function(e){return T(e)===b},isContextProvider:function(e){return T(e)===m},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===s},isForwardRef:function(e){return T(e)===g},isFragment:function(e){return T(e)===l},isLazy:function(e){return T(e)===j},isMemo:function(e){return T(e)===w},isPortal:function(e){return T(e)===p},isProfiler:function(e){return T(e)===d},isStrictMode:function(e){return T(e)===y},isSuspense:function(e){return T(e)===S},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===l||e===h||e===d||e===y||e===S||e===O||"object"==typeof e&&null!==e&&(e.$$typeof===j||e.$$typeof===w||e.$$typeof===m||e.$$typeof===b||e.$$typeof===g||e.$$typeof===x||e.$$typeof===$||e.$$typeof===P||e.$$typeof===E)},typeOf:T},I=u(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,p=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var y=e.type;switch(y){case f:case s:case o:case i:case a:case l:return y;default:var b=y&&y.$$typeof;switch(b){case u:case p:case m:case d:case c:return b;default:return t}}case n:return t}}}var O=s,w=u,j=c,E=r,x=p,$=o,P=m,T=d,_=n,C=i,I=a,k=l,N=!1;function R(e){return S(e)===s}t.AsyncMode=f,t.ConcurrentMode=O,t.ContextConsumer=w,t.ContextProvider=j,t.Element=E,t.ForwardRef=x,t.Fragment=$,t.Lazy=P,t.Memo=T,t.Portal=_,t.Profiler=C,t.StrictMode=I,t.Suspense=k,t.isAsyncMode=function(e){return N||(N=!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)||S(e)===f},t.isConcurrentMode=R,t.isContextConsumer=function(e){return S(e)===u},t.isContextProvider=function(e){return S(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===p},t.isFragment=function(e){return S(e)===o},t.isLazy=function(e){return S(e)===m},t.isMemo=function(e){return S(e)===d},t.isPortal=function(e){return S(e)===n},t.isProfiler=function(e){return S(e)===i},t.isStrictMode=function(e){return S(e)===a},t.isSuspense=function(e){return S(e)===l},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===i||e===a||e===l||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===c||e.$$typeof===u||e.$$typeof===p||e.$$typeof===v||e.$$typeof===h||e.$$typeof===g||e.$$typeof===b)},t.typeOf=S}()}),k=u(function(e){e.exports="production"===process.env.NODE_ENV?C:I}),N=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function M(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var V=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 t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(e){return t[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(e,t){for(var r,n,o=M(e),a=1;a<arguments.length;a++){for(var i in r=Object(arguments[a]))R.call(r,i)&&(o[i]=r[i]);if(N){n=N(r);for(var c=0;c<n.length;c++)A.call(r,n[c])&&(o[n[c]]=r[n[c]])}}return o},D=Function.call.bind(Object.prototype.hasOwnProperty),F="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",q=D,U=function(){};if("production"!==process.env.NODE_ENV){var z=F,W={},L=q;U=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function J(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(L(e,a)){var i;try{if("function"!=typeof e[a]){var c=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}i=e[a](t,a,n,r,null,z)}catch(e){i=e}if(!i||i instanceof Error||U((n||"React class")+": type specification of "+r+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in W)){W[i.message]=!0;var u=o?o():"";U("Failed "+r+" type: "+i.message+(null!=u?u:""))}}}J.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(W={})};var B=J,Y=function(){};function H(){return null}function G(){}function K(){}"production"!==process.env.NODE_ENV&&(Y=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),K.resetWarningCache=G;var Q=u(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var r="function"==typeof Symbol&&Symbol.iterator,n="<<anonymous>>",o={array:u("array"),bigint:u("bigint"),bool:u("boolean"),func:u("function"),number:u("number"),object:u("object"),string:u("string"),symbol:u("symbol"),any:c(H),arrayOf:function(e){return c(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var c=t[r];if(!Array.isArray(c))return new i("Invalid "+o+" `"+a+"` of type `"+p(c)+"` supplied to `"+n+"`, expected an array.");for(var u=0;u<c.length;u++){var f=e(c,u,n,o,a+"["+u+"]",F);if(f instanceof Error)return f}return null})},element:c(function(t,r,n,o,a){var c=t[r];return e(c)?null:new i("Invalid "+o+" `"+a+"` of type `"+p(c)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:c(function(e,t,r,n,o){var a=e[t];return k.isValidElementType(a)?null:new i("Invalid "+n+" `"+o+"` of type `"+p(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return c(function(t,r,o,a,c){return t[r]instanceof e?null:new i("Invalid "+a+" `"+c+"` of type `"+((u=t[r]).constructor&&u.constructor.name?u.constructor.name:n)+"` supplied to `"+o+"`, expected instance of `"+(e.name||n)+"`.");var u})},node:c(function(e,t,r,n,o){return s(e[t])?null:new i("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return c(function(t,r,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var c=t[r],u=p(c);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+n+"`, expected an object.");for(var f in c)if(q(c,f)){var s=e(c,f,n,o,a+"."+f,F);if(s instanceof Error)return s}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Y(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."),H;function t(t,r,n,o,c){for(var u=t[r],f=0;f<e.length;f++)if(a(u,e[f]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===l(t)?String(t):t});return new i("Invalid "+o+" `"+c+"` of value `"+String(u)+"` supplied to `"+n+"`, expected one of "+s+".")}return c(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Y("Invalid argument supplied to oneOfType, expected an instance of array."),H;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return Y("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(r)+" at index "+t+"."),H}return c(function(t,r,n,o,a){for(var c=[],u=0;u<e.length;u++){var f=(0,e[u])(t,r,n,o,a,F);if(null==f)return null;f.data&&q(f.data,"expectedType")&&c.push(f.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+n+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return c(function(t,r,n,o,a){var c=t[r],u=p(c);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+n+"`, expected `object`.");for(var s in e){var y=e[s];if("function"!=typeof y)return f(n,o,a,s,l(y));var d=y(c,s,n,o,a+"."+s,F);if(d)return d}return null})},exact:function(e){return c(function(t,r,n,o,a){var c=t[r],u=p(c);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+n+"`, expected `object`.");var s=V({},t[r],e);for(var y in s){var d=e[y];if(q(e,y)&&"function"!=typeof d)return f(n,o,a,y,l(d));if(!d)return new i("Invalid "+o+" `"+a+"` key `"+y+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(t[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=d(c,y,n,o,a+"."+y,F);if(m)return m}return null})}};function a(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function c(e){function t(t,r,o,a,c,u,f){if(a=a||n,u=u||o,f!==F){var s=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 s.name="Invariant Violation",s}return null==r[o]?t?new i(null===r[o]?"The "+c+" `"+u+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+c+" `"+u+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,c,u)}process;var r=t.bind(null,!1);return r.isRequired=t.bind(null,!0),r}function u(e){return c(function(t,r,n,o,a,c){var u=t[r];return p(u)!==e?new i("Invalid "+o+" `"+a+"` of type `"+l(u)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function f(e,t,r,n,o){return new i((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function s(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(s);if(null===t||e(t))return!0;var n=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!n)return!1;var o,a=n.call(t);if(n!==t.entries){for(;!(o=a.next()).done;)if(!s(o.value))return!1}else for(;!(o=a.next()).done;){var i=o.value;if(i&&!s(i[1]))return!1}return!0;default:return!1}}function p(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function l(e){if(null==e)return""+e;var t=p(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=l(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,o.checkPropTypes=B,o.resetWarningCache=B.resetWarningCache,o.PropTypes=o,o}(k.isElement):function(){function e(e,t,r,n,o,a){if(a!==F){var i=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 i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:K,resetWarningCache:G};return r.PropTypes=r,r}()}),X=o.default.createContext(),Z=X.Consumer,ee=function(e){var r=e.value,n=e.children,i=new a.default(r).getResult(),c=t.useState(i),u=c[0],f=c[1];return t.useEffect(function(){u.ua!==r&&void 0!==r&&f(r)}),/*#__PURE__*/o.default.createElement(X.Provider,{value:u},n)};ee.propTypes={value:Q.any,children:Q.node},e.UserAgent=Z,e.UserAgentProvider=ee,e.useUserAgent=function(){return o.default.useContext(X)},e.withUserAgent=function(e){/*#__PURE__*/return function(t){var r,n;function a(){return t.apply(this,arguments)||this}return n=t,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,c(r,n),a.getInitialProps=function(t){try{var r={},n=function(){if(e.getInitialProps)return Promise.resolve(e.getInitialProps(t)).then(function(e){r=e})}();return Promise.resolve(n&&n.then?n.then(function(){return r}):r)}catch(e){return Promise.reject(e)}},a.prototype.render=function(){var t=this;/*#__PURE__*/return o.default.createElement(Z,null,function(r){/*#__PURE__*/return o.default.createElement(e,i({ua:r},t.props))})},a}(o.default.PureComponent)}}); | ||
//# sourceMappingURL=react-ua.umd.js.map |
{ | ||
"name": "react-ua", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "React User Agent component and provider with new React Context API", | ||
@@ -14,4 +14,4 @@ "main": "dist/react-ua.js", | ||
"dev": "microbundle watch --jsx=React.createElement --compress=false", | ||
"prerelease": "npm run build", | ||
"release": "npm publish --access public", | ||
"old-prerelease": "npm run build", | ||
"old-release": "npm publish --access public", | ||
"lint": "eslint src", | ||
@@ -41,3 +41,3 @@ "test": "jest", | ||
"peerDependencies": { | ||
"react": "^16.9.0" | ||
"react": "^16.9.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
@@ -49,3 +49,3 @@ "devDependencies": { | ||
"@babel/preset-react": "7.0.0", | ||
"@testing-library/react": "9.1.4", | ||
"@testing-library/react": "13.0.0", | ||
"babel-eslint": "10.0.3", | ||
@@ -58,7 +58,7 @@ "babel-jest": "24.9.0", | ||
"jest": "24.9.0", | ||
"microbundle": "0.7.0", | ||
"prettier": "1.18.2", | ||
"prop-types": "15.7.2", | ||
"react": "16.9.0", | ||
"react-dom": "16.9.0" | ||
"microbundle": "0.14.2", | ||
"prettier": "2.6.2", | ||
"prop-types": "15.8.1", | ||
"react": "18.0.0", | ||
"react-dom": "18.0.0" | ||
}, | ||
@@ -65,0 +65,0 @@ "dependencies": { |
@@ -19,2 +19,3 @@ # react-ua | ||
- Wrapper for [ua-parser-js](https://github.com/faisalman/ua-parser-js) | ||
- Using new React [Hooks API](https://reactjs.org/docs/hooks-faq.html) | ||
- Using new React [Context API](https://reactjs.org/docs/context.html) | ||
@@ -28,20 +29,19 @@ - SSR-ready | ||
import React from 'react'; | ||
import { UserAgentProvider, UserAgent, withUserAgent } from 'react-ua'; | ||
import { UserAgentProvider, useUserAgent } from 'react-ua'; | ||
const Comp = () => ( | ||
<UserAgent>{ua => <div>OS: {ua.os.name}</div>}</UserAgent> | ||
) | ||
const CompWithHooks = () => { | ||
const ua = useUserAgent(); | ||
return <div>OS: {ua.os.name}</div>; | ||
}; | ||
const CompWithHoc = withUserAgent(({ ua }) => ( | ||
<div>OS: {ua.os.name}</div> | ||
)); | ||
const CompWithHoc = withUserAgent(({ ua }) => <div>OS: {ua.os.name}</div>); | ||
const App = () => ( | ||
<UserAgentProvider> | ||
<Comp /> | ||
<CompWithHoc /> | ||
<CompWithHooks /> | ||
</UserAgentProvider> | ||
); | ||
ReactDOM.render(<App />, document.getElementById("#root")) | ||
ReactDOM.render(<App />, document.getElementById('#root')); | ||
@@ -48,0 +48,0 @@ // SSR |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
315692
11
232
36
1