Socket
Socket
Sign inDemoInstall

@blaze-react/utils

Package Overview
Dependencies
Maintainers
8
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blaze-react/utils - npm Package Compare versions

Comparing version 0.8.0-alpha.43 to 0.8.0-alpha.44

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [0.8.0-alpha.44](https://github.com/thebyte9/blaze-components-react/compare/v0.8.0-alpha.43...v0.8.0-alpha.44) (2021-10-06)
**Note:** Version bump only for package @blaze-react/utils
# [0.8.0-alpha.43](https://github.com/thebyte9/blaze-components-react/compare/v0.8.0-alpha.42...v0.8.0-alpha.43) (2021-10-06)

@@ -8,0 +16,0 @@

2

dist/main.js
/*! For license information please see main.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@blaze-react"]=e():t["@blaze-react"]=e()}(this,(function(){return function(){var t={360:function(){!function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=function(t){for(var e=window.document,n=o(e);n;)n=o(e=n.ownerDocument);return e}(),e=[],n=null,r=null;u.prototype.THROTTLE_TIMEOUT=100,u.prototype.POLL_INTERVAL=null,u.prototype.USE_MUTATION_OBSERVER=!0,u._setupCrossOriginUpdater=function(){return n||(n=function(t,n){r=t&&n?l(t,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.forEach((function(t){t._checkForIntersections()}))}),n},u._resetCrossOriginUpdater=function(){n=null,r=null},u.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},u.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},u.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},u.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},u.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},u.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},u.prototype._monitorIntersections=function(e){var n=e.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(e)){var r=this._checkForIntersections,i=null,u=null;this.POLL_INTERVAL?i=n.setInterval(r,this.POLL_INTERVAL):(s(n,"resize",r,!0),s(e,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(u=new n.MutationObserver(r)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push((function(){var t=e.defaultView;t&&(i&&t.clearInterval(i),c(t,"resize",r,!0)),c(e,"scroll",r,!0),u&&u.disconnect()}));var a=this.root&&(this.root.ownerDocument||this.root)||t;if(e!=a){var f=o(e);f&&this._monitorIntersections(f.ownerDocument)}}},u.prototype._unmonitorIntersections=function(e){var n=this._monitoringDocuments.indexOf(e);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||t;if(!this._observationTargets.some((function(t){var n=t.element.ownerDocument;if(n==e)return!0;for(;n&&n!=r;){var i=o(n);if((n=i&&i.ownerDocument)==e)return!0}return!1}))){var i=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),i(),e!=r){var u=o(e);u&&this._unmonitorIntersections(u.ownerDocument)}}}},u.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e<t.length;e++)t[e]()},u.prototype._checkForIntersections=function(){if(this.root||!n||r){var t=this._rootIsInDom(),e=t?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var o=r.element,u=a(o),s=this._rootContainsTarget(o),c=r.entry,f=t&&s&&this._computeTargetAndRootIntersection(o,u,e),l=null;this._rootContainsTarget(o)?n&&!this.root||(l=e):l={top:0,bottom:0,left:0,right:0,width:0,height:0};var h=r.entry=new i({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:u,rootBounds:l,intersectionRect:f});c?t&&s?this._hasCrossedThreshold(c,h)&&this._queuedEntries.push(h):c&&c.isIntersecting&&this._queuedEntries.push(h):this._queuedEntries.push(h)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},u.prototype._computeTargetAndRootIntersection=function(e,o,i){if("none"!=window.getComputedStyle(e).display){for(var u,s,c,f,h,d,v,y,m=o,g=p(e),b=!1;!b&&g;){var _=null,w=1==g.nodeType?window.getComputedStyle(g):{};if("none"==w.display)return null;if(g==this.root||9==g.nodeType)if(b=!0,g==this.root||g==t)n&&!this.root?!r||0==r.width&&0==r.height?(g=null,_=null,m=null):_=r:_=i;else{var E=p(g),O=E&&a(E),I=E&&this._computeTargetAndRootIntersection(E,O,i);O&&I?(g=E,_=l(O,I)):(g=null,m=null)}else{var R=g.ownerDocument;g!=R.body&&g!=R.documentElement&&"visible"!=w.overflow&&(_=a(g))}if(_&&(u=_,s=m,void 0,void 0,void 0,void 0,void 0,void 0,c=Math.max(u.top,s.top),f=Math.min(u.bottom,s.bottom),h=Math.max(u.left,s.left),y=f-c,m=(v=(d=Math.min(u.right,s.right))-h)>=0&&y>=0&&{top:c,bottom:f,left:h,right:d,width:v,height:y}||null),!m)break;g=g&&p(g)}return m}},u.prototype._getRootRect=function(){var e;if(this.root&&!d(this.root))e=a(this.root);else{var n=d(this.root)?this.root:t,r=n.documentElement,o=n.body;e={top:0,left:0,right:r.clientWidth||o.clientWidth,width:r.clientWidth||o.clientWidth,bottom:r.clientHeight||o.clientHeight,height:r.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(e)},u.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},u.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==r)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==n||i==r||i<n!=i<r)return!0}},u.prototype._rootIsInDom=function(){return!this.root||h(t,this.root)},u.prototype._rootContainsTarget=function(e){var n=this.root&&(this.root.ownerDocument||this.root)||t;return h(n,e)&&(!this.root||n==e.ownerDocument)},u.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},u.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},window.IntersectionObserver=u,window.IntersectionObserverEntry=i}function o(t){try{return t.defaultView&&t.defaultView.frameElement||null}catch(t){return null}}function i(t){this.time=t.time,this.target=t.target,this.rootBounds=f(t.rootBounds),this.boundingClientRect=f(t.boundingClientRect),this.intersectionRect=f(t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function u(t,e){var n,r,o,i=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType&&9!=i.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout((function(){n(),o=null}),r))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function s(t,e,n,r){"function"==typeof t.addEventListener?t.addEventListener(e,n,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function c(t,e,n,r){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function a(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function f(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function l(t,e){var n=e.top-t.top,r=e.left-t.left;return{top:n,left:r,height:e.height,width:e.width,bottom:n+e.height,right:r+e.width}}function h(t,e){for(var n=e;n;){if(n==t)return!0;n=p(n)}return!1}function p(e){var n=e.parentNode;return 9==e.nodeType&&e!=t?o(e):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function d(t){return t&&9===t.nodeType}}()},320:function(t){"use strict";var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,i){for(var u,s,c=o(t),a=1;a<arguments.length;a++){for(var f in u=Object(arguments[a]))n.call(u,f)&&(c[f]=u[f]);if(e){s=e(u);for(var l=0;l<s.length;l++)r.call(u,s[l])&&(c[s[l]]=u[s[l]])}}return c}},837:function(t,e,n){"use strict";n(320);var r=n(784),o=60103;if("function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function a(t,e,n){var r,i={},a=null,f=null;for(r in void 0!==n&&(a=""+n),void 0!==e.key&&(a=""+e.key),void 0!==e.ref&&(f=e.ref),e)s.call(e,r)&&!c.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===i[r]&&(i[r]=e[r]);return{$$typeof:o,type:t,key:a,ref:f,props:i,_owner:u.current}}e.jsx=a,e.jsxs=a},426:function(t,e,n){"use strict";var r=n(320),o=60103,i=60106;e.Fragment=60107,e.StrictMode=60108,e.Profiler=60114;var u=60109,s=60110,c=60112;e.Suspense=60113;var a=60115,f=60116;if("function"==typeof Symbol&&Symbol.for){var l=Symbol.for;o=l("react.element"),i=l("react.portal"),e.Fragment=l("react.fragment"),e.StrictMode=l("react.strict_mode"),e.Profiler=l("react.profiler"),u=l("react.provider"),s=l("react.context"),c=l("react.forward_ref"),e.Suspense=l("react.suspense"),a=l("react.memo"),f=l("react.lazy")}var h="function"==typeof Symbol&&Symbol.iterator;function p(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function y(t,e,n){this.props=t,this.context=e,this.refs=v,this.updater=n||d}function m(){}function g(t,e,n){this.props=t,this.context=e,this.refs=v,this.updater=n||d}y.prototype.isReactComponent={},y.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(p(85));this.updater.enqueueSetState(this,t,e,"setState")},y.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},m.prototype=y.prototype;var b=g.prototype=new m;b.constructor=g,r(b,y.prototype),b.isPureReactComponent=!0;var _={current:null},w=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function O(t,e,n){var r,i={},u=null,s=null;if(null!=e)for(r in void 0!==e.ref&&(s=e.ref),void 0!==e.key&&(u=""+e.key),e)w.call(e,r)&&!E.hasOwnProperty(r)&&(i[r]=e[r]);var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){for(var a=Array(c),f=0;f<c;f++)a[f]=arguments[f+2];i.children=a}if(t&&t.defaultProps)for(r in c=t.defaultProps)void 0===i[r]&&(i[r]=c[r]);return{$$typeof:o,type:t,key:u,ref:s,props:i,_owner:_.current}}function I(t){return"object"==typeof t&&null!==t&&t.$$typeof===o}var R=/\/+/g;function T(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function S(t,e,n,r,u){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case o:case i:c=!0}}if(c)return u=u(c=t),t=""===r?"."+T(c,0):r,Array.isArray(u)?(n="",null!=t&&(n=t.replace(R,"$&/")+"/"),S(u,e,n,"",(function(t){return t}))):null!=u&&(I(u)&&(u=function(t,e){return{$$typeof:o,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(u,n+(!u.key||c&&c.key===u.key?"":(""+u.key).replace(R,"$&/")+"/")+t)),e.push(u)),1;if(c=0,r=""===r?".":r+":",Array.isArray(t))for(var a=0;a<t.length;a++){var f=r+T(s=t[a],a);c+=S(s,e,n,f,u)}else if("function"==typeof(f=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=h&&t[h]||t["@@iterator"])?t:null}(t)))for(t=f.call(t),a=0;!(s=t.next()).done;)c+=S(s=s.value,e,n,f=r+T(s,a++),u);else if("object"===s)throw e=""+t,Error(p(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e));return c}function j(t,e,n){if(null==t)return t;var r=[],o=0;return S(t,r,"","",(function(t){return e.call(n,t,o++)})),r}function x(t){if(-1===t._status){var e=t._result;e=e(),t._status=0,t._result=e,e.then((function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)}),(function(e){0===t._status&&(t._status=2,t._result=e)}))}if(1===t._status)return t._result;throw t._result}var k={current:null};function C(){var t=k.current;if(null===t)throw Error(p(321));return t}var P={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:_,IsSomeRendererActing:{current:!1},assign:r};e.Children={map:j,forEach:function(t,e,n){j(t,(function(){e.apply(this,arguments)}),n)},count:function(t){var e=0;return j(t,(function(){e++})),e},toArray:function(t){return j(t,(function(t){return t}))||[]},only:function(t){if(!I(t))throw Error(p(143));return t}},e.Component=y,e.PureComponent=g,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,e.cloneElement=function(t,e,n){if(null==t)throw Error(p(267,t));var i=r({},t.props),u=t.key,s=t.ref,c=t._owner;if(null!=e){if(void 0!==e.ref&&(s=e.ref,c=_.current),void 0!==e.key&&(u=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(f in e)w.call(e,f)&&!E.hasOwnProperty(f)&&(i[f]=void 0===e[f]&&void 0!==a?a[f]:e[f])}var f=arguments.length-2;if(1===f)i.children=n;else if(1<f){a=Array(f);for(var l=0;l<f;l++)a[l]=arguments[l+2];i.children=a}return{$$typeof:o,type:t.type,key:u,ref:s,props:i,_owner:c}},e.createContext=function(t,e){return void 0===e&&(e=null),(t={$$typeof:s,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:u,_context:t},t.Consumer=t},e.createElement=O,e.createFactory=function(t){var e=O.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:c,render:t}},e.isValidElement=I,e.lazy=function(t){return{$$typeof:f,_payload:{_status:-1,_result:t},_init:x}},e.memo=function(t,e){return{$$typeof:a,type:t,compare:void 0===e?null:e}},e.useCallback=function(t,e){return C().useCallback(t,e)},e.useContext=function(t,e){return C().useContext(t,e)},e.useDebugValue=function(){},e.useEffect=function(t,e){return C().useEffect(t,e)},e.useImperativeHandle=function(t,e,n){return C().useImperativeHandle(t,e,n)},e.useLayoutEffect=function(t,e){return C().useLayoutEffect(t,e)},e.useMemo=function(t,e){return C().useMemo(t,e)},e.useReducer=function(t,e,n){return C().useReducer(t,e,n)},e.useRef=function(t){return C().useRef(t)},e.useState=function(t){return C().useState(t)},e.version="17.0.2"},784:function(t,e,n){"use strict";t.exports=n(426)},322:function(t,e,n){"use strict";t.exports=n(837)}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return function(){"use strict";n.r(r),n.d(r,{ErrorMessage:function(){return d},buildClassNames:function(){return e},useDebounce:function(){return s},useEventListener:function(){return l},useInView:function(){return f}});var t=function(t){return!!t&&Object.keys(t).filter((function(e){return!!t[e]})).map((function(t){return"".concat(t)})).join(" ")},e=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?e:t(e),o=t(n),i=o?"".concat(r," ").concat(o):r;return i};function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],u=!0,s=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{u||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var u=n(784),s=function(t,e){var n=i((0,u.useState)(t),2),r=n[0],o=n[1];return(0,u.useEffect)((function(){var n=setTimeout((function(){o(t)}),e);return function(){clearTimeout(n)}}),[t,e]),r};function c(t,e,n,r,o,i,u){try{var s=t[i](u),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,o)}function a(t){var e=t.ref,n=t.once,r=void 0===n||n,o=t.offset,s=void 0===o?"0px":o,a=i((0,u.useState)(!1),2),f=a[0],l=a[1],h=(0,u.useRef)();return(0,u.useEffect)((function(){var t;(t=regeneratorRuntime.mark((function t(){var n,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=(e||h||{}).current){t.next=4;break}return t.abrupt("return");case 4:return o=new IntersectionObserver((function(t,e){var o=i(t,1)[0];l(o.isIntersecting),o.isIntersecting&&r&&(null==e||e.unobserve(n))}),{rootMargin:s}),n&&o.observe(n),t.abrupt("return",(function(){null==o||o.unobserve(n)}));case 7:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function u(t){c(i,r,o,u,s,"next",t)}function s(t){c(i,r,o,u,s,"throw",t)}u(void 0)}))})()}),[s,r,e]),[f,h]}n(360),a.displayName="useInView";var f=a,l=function(t,e,n){var r=(0,u.useRef)();(0,u.useEffect)((function(){var o=(null==n?void 0:n.current)||window;if(o&&o.addEventListener){r.current!==e&&(r.current=e);var i=function(t){null!=r&&r.current&&r.current(t)};return o.addEventListener(t,i),function(){o.removeEventListener(t,i)}}}),[t,n,e])},h=n(322),p=function(t){var e=t.message,n=t.icon;return(0,h.jsxs)("div",{className:"validation","data-testid":"validation-message",children:[(0,h.jsx)("i",{className:"material-icons",children:n}),e]})};p.defaultProps={icon:"warning"};var d=p}(),r}()}));
!function(){var t={360:function(){!function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=function(t){for(var e=window.document,n=o(e);n;)n=o(e=n.ownerDocument);return e}(),e=[],n=null,r=null;s.prototype.THROTTLE_TIMEOUT=100,s.prototype.POLL_INTERVAL=null,s.prototype.USE_MUTATION_OBSERVER=!0,s._setupCrossOriginUpdater=function(){return n||(n=function(t,n){r=t&&n?l(t,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.forEach((function(t){t._checkForIntersections()}))}),n},s._resetCrossOriginUpdater=function(){n=null,r=null},s.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},s.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},s.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},s.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},s.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},s.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},s.prototype._monitorIntersections=function(e){var n=e.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(e)){var r=this._checkForIntersections,i=null,s=null;this.POLL_INTERVAL?i=n.setInterval(r,this.POLL_INTERVAL):(u(n,"resize",r,!0),u(e,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(s=new n.MutationObserver(r)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push((function(){var t=e.defaultView;t&&(i&&t.clearInterval(i),c(t,"resize",r,!0)),c(e,"scroll",r,!0),s&&s.disconnect()}));var a=this.root&&(this.root.ownerDocument||this.root)||t;if(e!=a){var h=o(e);h&&this._monitorIntersections(h.ownerDocument)}}},s.prototype._unmonitorIntersections=function(e){var n=this._monitoringDocuments.indexOf(e);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||t;if(!this._observationTargets.some((function(t){var n=t.element.ownerDocument;if(n==e)return!0;for(;n&&n!=r;){var i=o(n);if((n=i&&i.ownerDocument)==e)return!0}return!1}))){var i=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),i(),e!=r){var s=o(e);s&&this._unmonitorIntersections(s.ownerDocument)}}}},s.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e<t.length;e++)t[e]()},s.prototype._checkForIntersections=function(){if(this.root||!n||r){var t=this._rootIsInDom(),e=t?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var o=r.element,s=a(o),u=this._rootContainsTarget(o),c=r.entry,h=t&&u&&this._computeTargetAndRootIntersection(o,s,e),l=null;this._rootContainsTarget(o)?n&&!this.root||(l=e):l={top:0,bottom:0,left:0,right:0,width:0,height:0};var f=r.entry=new i({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:s,rootBounds:l,intersectionRect:h});c?t&&u?this._hasCrossedThreshold(c,f)&&this._queuedEntries.push(f):c&&c.isIntersecting&&this._queuedEntries.push(f):this._queuedEntries.push(f)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},s.prototype._computeTargetAndRootIntersection=function(e,o,i){if("none"!=window.getComputedStyle(e).display){for(var s,u,c,h,f,d,v,g,m=o,b=p(e),y=!1;!y&&b;){var w=null,_=1==b.nodeType?window.getComputedStyle(b):{};if("none"==_.display)return null;if(b==this.root||9==b.nodeType)if(y=!0,b==this.root||b==t)n&&!this.root?!r||0==r.width&&0==r.height?(b=null,w=null,m=null):w=r:w=i;else{var E=p(b),I=E&&a(E),O=E&&this._computeTargetAndRootIntersection(E,I,i);I&&O?(b=E,w=l(I,O)):(b=null,m=null)}else{var T=b.ownerDocument;b!=T.body&&b!=T.documentElement&&"visible"!=_.overflow&&(w=a(b))}if(w&&(s=w,u=m,void 0,void 0,void 0,void 0,void 0,void 0,c=Math.max(s.top,u.top),h=Math.min(s.bottom,u.bottom),f=Math.max(s.left,u.left),g=h-c,m=(v=(d=Math.min(s.right,u.right))-f)>=0&&g>=0&&{top:c,bottom:h,left:f,right:d,width:v,height:g}||null),!m)break;b=b&&p(b)}return m}},s.prototype._getRootRect=function(){var e;if(this.root&&!d(this.root))e=a(this.root);else{var n=d(this.root)?this.root:t,r=n.documentElement,o=n.body;e={top:0,left:0,right:r.clientWidth||o.clientWidth,width:r.clientWidth||o.clientWidth,bottom:r.clientHeight||o.clientHeight,height:r.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(e)},s.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},s.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==r)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==n||i==r||i<n!=i<r)return!0}},s.prototype._rootIsInDom=function(){return!this.root||f(t,this.root)},s.prototype._rootContainsTarget=function(e){var n=this.root&&(this.root.ownerDocument||this.root)||t;return f(n,e)&&(!this.root||n==e.ownerDocument)},s.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},s.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},window.IntersectionObserver=s,window.IntersectionObserverEntry=i}function o(t){try{return t.defaultView&&t.defaultView.frameElement||null}catch(t){return null}}function i(t){this.time=t.time,this.target=t.target,this.rootBounds=h(t.rootBounds),this.boundingClientRect=h(t.boundingClientRect),this.intersectionRect=h(t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function s(t,e){var n,r,o,i=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType&&9!=i.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout((function(){n(),o=null}),r))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function u(t,e,n,r){"function"==typeof t.addEventListener?t.addEventListener(e,n,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function c(t,e,n,r){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function a(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function h(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function l(t,e){var n=e.top-t.top,r=e.left-t.left;return{top:n,left:r,height:e.height,width:e.width,bottom:n+e.height,right:r+e.width}}function f(t,e){for(var n=e;n;){if(n==t)return!0;n=p(n)}return!1}function p(e){var n=e.parentNode;return 9==e.nodeType&&e!=t?o(e):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function d(t){return t&&9===t.nodeType}}()},320:function(t){"use strict";var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,i){for(var s,u,c=o(t),a=1;a<arguments.length;a++){for(var h in s=Object(arguments[a]))n.call(s,h)&&(c[h]=s[h]);if(e){u=e(s);for(var l=0;l<u.length;l++)r.call(s,u[l])&&(c[u[l]]=s[u[l]])}}return c}},837:function(t,e,n){"use strict";n(320);var r=n(297),o=60103;if("function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function a(t,e,n){var r,i={},a=null,h=null;for(r in void 0!==n&&(a=""+n),void 0!==e.key&&(a=""+e.key),void 0!==e.ref&&(h=e.ref),e)u.call(e,r)&&!c.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===i[r]&&(i[r]=e[r]);return{$$typeof:o,type:t,key:a,ref:h,props:i,_owner:s.current}}e.jsx=a,e.jsxs=a},322:function(t,e,n){"use strict";t.exports=n(837)},297:function(t){"use strict";t.exports=require("react")}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r),n.d(r,{ErrorMessage:function(){return d},buildClassNames:function(){return e},useDebounce:function(){return u},useEventListener:function(){return l},useInView:function(){return h}});var t=function(t){return!!t&&Object.keys(t).filter((function(e){return!!t[e]})).map((function(t){return"".concat(t)})).join(" ")},e=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?e:t(e),o=t(n),i=o?"".concat(r," ").concat(o):r;return i};function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],s=!0,u=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{s||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var s=n(297),u=function(t,e){var n=i((0,s.useState)(t),2),r=n[0],o=n[1];return(0,s.useEffect)((function(){var n=setTimeout((function(){o(t)}),e);return function(){clearTimeout(n)}}),[t,e]),r};function c(t,e,n,r,o,i,s){try{var u=t[i](s),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function a(t){var e=t.ref,n=t.once,r=void 0===n||n,o=t.offset,u=void 0===o?"0px":o,a=i((0,s.useState)(!1),2),h=a[0],l=a[1],f=(0,s.useRef)();return(0,s.useEffect)((function(){var t;(t=regeneratorRuntime.mark((function t(){var n,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=(e||f||{}).current){t.next=4;break}return t.abrupt("return");case 4:return o=new IntersectionObserver((function(t,e){var o=i(t,1)[0];l(o.isIntersecting),o.isIntersecting&&r&&(null==e||e.unobserve(n))}),{rootMargin:u}),n&&o.observe(n),t.abrupt("return",(function(){null==o||o.unobserve(n)}));case 7:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){c(i,r,o,s,u,"next",t)}function u(t){c(i,r,o,s,u,"throw",t)}s(void 0)}))})()}),[u,r,e]),[h,f]}n(360),a.displayName="useInView";var h=a,l=function(t,e,n){var r=(0,s.useRef)();(0,s.useEffect)((function(){var o=(null==n?void 0:n.current)||window;if(o&&o.addEventListener){r.current!==e&&(r.current=e);var i=function(t){null!=r&&r.current&&r.current(t)};return o.addEventListener(t,i),function(){o.removeEventListener(t,i)}}}),[t,n,e])},f=n(322),p=function(t){var e=t.message,n=t.icon;return(0,f.jsxs)("div",{className:"validation","data-testid":"validation-message",children:[(0,f.jsx)("i",{className:"material-icons",children:n}),e]})};p.defaultProps={icon:"warning"};var d=p}(),module.exports["@blaze-react"]=r}();

@@ -15,10 +15,1 @@ /*

*/
/** @license React v17.0.2
* react.production.min.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.
*/
{
"name": "@blaze-react/utils",
"version": "0.8.0-alpha.43",
"version": "0.8.0-alpha.44",
"description": "",

@@ -29,3 +29,3 @@ "main": "./dist/main.js",

},
"gitHead": "3524e85d519f17955e8ea9602041b9f0acf7d616"
"gitHead": "55a479ea240da985df9c930013f705b2a8842d22"
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc