@tracktor/shared-module 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(P,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(P=typeof globalThis<"u"?globalThis:P||self,E(P["@tracktor/shared-module"]={},P.React))})(this,function(P,E){"use strict";var q={},Ie={get exports(){return q},set exports(f){q=f}},Y={};/**
1
+ (function(_,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(_=typeof globalThis<"u"?globalThis:_||self,y(_["@tracktor/shared-module"]={},_.React))})(this,function(_,y){"use strict";var Q={},Ie={get exports(){return Q},set exports(n){Q=n}},N={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ue;function Le(){if(ue)return Y;ue=1;var f=E,m=Symbol.for("react.element"),y=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,v=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function i(R,d,w){var h,T={},S=null,O=null;w!==void 0&&(S=""+w),d.key!==void 0&&(S=""+d.key),d.ref!==void 0&&(O=d.ref);for(h in d)b.call(d,h)&&!l.hasOwnProperty(h)&&(T[h]=d[h]);if(R&&R.defaultProps)for(h in d=R.defaultProps,d)T[h]===void 0&&(T[h]=d[h]);return{$$typeof:m,type:R,key:S,ref:O,props:T,_owner:v.current}}return Y.Fragment=y,Y.jsx=i,Y.jsxs=i,Y}var W={};/**
9
+ */var ue;function Le(){if(ue)return N;ue=1;var n=y,d=Symbol.for("react.element"),g=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function i(b,p,C){var R,w={},S=null,O=null;C!==void 0&&(S=""+C),p.key!==void 0&&(S=""+p.key),p.ref!==void 0&&(O=p.ref);for(R in p)h.call(p,R)&&!u.hasOwnProperty(R)&&(w[R]=p[R]);if(b&&b.defaultProps)for(R in p=b.defaultProps,p)w[R]===void 0&&(w[R]=p[R]);return{$$typeof:d,type:b,key:S,ref:O,props:w,_owner:f.current}}return N.Fragment=g,N.jsx=i,N.jsxs=i,N}var W={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var se;function Me(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var f=E,m=Symbol.for("react.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),R=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,A="@@iterator";function B(e){if(e===null||typeof e!="object")return null;var r=D&&e[D]||e[A];return typeof r=="function"?r:null}var j=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function u(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ce("error",e,t)}}function ce(e,r,t){{var n=j.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var fe=!1,J=!1,Ue=!1,Ge=!1,Be=!1,le;le=Symbol.for("react.module.reference");function Je(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===l||Be||e===v||e===w||e===h||Ge||e===O||fe||J||Ue||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===T||e.$$typeof===i||e.$$typeof===R||e.$$typeof===d||e.$$typeof===le||e.getModuleId!==void 0))}function ze(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function de(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&u("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case y:return"Portal";case l:return"Profiler";case v:return"StrictMode";case w:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:var r=e;return de(r)+".Consumer";case i:var t=e;return de(t._context)+".Provider";case d:return ze(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:x(e.type)||"Memo";case S:{var s=e,c=s._payload,o=s._init;try{return x(o(c))}catch{return null}}}return null}var F=Object.assign,V=0,ve,pe,ge,he,Ee,me,ye;function be(){}be.__reactDisabledLog=!0;function Ke(){{if(V===0){ve=console.log,pe=console.info,ge=console.warn,he=console.error,Ee=console.group,me=console.groupCollapsed,ye=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function $e(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:ve}),info:F({},e,{value:pe}),warn:F({},e,{value:ge}),error:F({},e,{value:he}),group:F({},e,{value:Ee}),groupCollapsed:F({},e,{value:me}),groupEnd:F({},e,{value:ye})})}V<0&&u("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Q=j.ReactCurrentDispatcher,ee;function z(e,r,t){{if(ee===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ee=n&&n[1]||""}return`
18
- `+ee+e}}var re=!1,K;{var He=typeof WeakMap=="function"?WeakMap:Map;K=new He}function Re(e,r){if(!e||re)return"";{var t=K.get(e);if(t!==void 0)return t}var n;re=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=Q.current,Q.current=null,Ke();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(k){n=k}Reflect.construct(e,[],o)}else{try{o.call()}catch(k){n=k}e.call(o.prototype)}}else{try{throw Error()}catch(k){n=k}e()}}catch(k){if(k&&n&&typeof k.stack=="string"){for(var a=k.stack.split(`
19
- `),_=n.stack.split(`
20
- `),p=a.length-1,g=_.length-1;p>=1&&g>=0&&a[p]!==_[g];)g--;for(;p>=1&&g>=0;p--,g--)if(a[p]!==_[g]){if(p!==1||g!==1)do if(p--,g--,g<0||a[p]!==_[g]){var C=`
21
- `+a[p].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,C),C}while(p>=1&&g>=0);break}}}finally{re=!1,Q.current=c,$e(),Error.prepareStackTrace=s}var M=e?e.displayName||e.name:"",Fe=M?z(M):"";return typeof e=="function"&&K.set(e,Fe),Fe}function Xe(e,r,t){return Re(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function $(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,qe(e));if(typeof e=="string")return z(e);switch(e){case w:return z("Suspense");case h:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Xe(e.render);case T:return $(e.type,r,t);case S:{var n=e,s=n._payload,c=n._init;try{return $(c(s),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,_e={},Te=j.ReactDebugCurrentFrame;function X(e){if(e){var r=e._owner,t=$(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}function Ze(e,r,t,n,s){{var c=Function.call.bind(H);for(var o in e)if(c(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var _=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(p){a=p}a&&!(a instanceof Error)&&(X(s),u("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),X(null)),a instanceof Error&&!(a.message in _e)&&(_e[a.message]=!0,X(s),u("Failed %s type: %s",t,a.message),X(null))}}}var Qe=Array.isArray;function te(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Oe(e){if(rr(e))return u("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),we(e)}var U=j.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},Se,Ce,ne;ne={};function nr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=x(U.current.type);ne[t]||(u('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(U.current.type),e.ref),ne[t]=!0)}}function ir(e,r){{var t=function(){Se||(Se=!0,u("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function ur(e,r){{var t=function(){Ce||(Ce=!0,u("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var sr=function(e,r,t,n,s,c,o){var a={$$typeof:m,type:e,key:r,ref:t,props:o,_owner:c};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function cr(e,r,t,n,s){{var c,o={},a=null,_=null;t!==void 0&&(Oe(t),a=""+t),ar(r)&&(Oe(r.key),a=""+r.key),nr(r)&&(_=r.ref,or(r,s));for(c in r)H.call(r,c)&&!tr.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var p=e.defaultProps;for(c in p)o[c]===void 0&&(o[c]=p[c])}if(a||_){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(o,g),_&&ur(o,g)}return sr(e,a,_,s,n,U.current,o)}}var ae=j.ReactCurrentOwner,Pe=j.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=$(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===m}function je(){{if(ae.current){var e=x(ae.current.type);if(e)return`
17
+ */var se;function Me(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var n=y,d=Symbol.for("react.element"),g=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),b=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),x=Symbol.iterator,F="@@iterator";function B(e){if(e===null||typeof e!="object")return null;var r=x&&e[x]||e[F];return typeof r=="function"?r:null}var j=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];ce("error",e,t)}}function ce(e,r,t){{var a=j.ReactDebugCurrentFrame,l=a.getStackAddendum();l!==""&&(r+="%s",t=t.concat([l]));var v=t.map(function(s){return String(s)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var le=!1,z=!1,Je=!1,He=!1,Ke=!1,fe;fe=Symbol.for("react.module.reference");function Xe(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===u||Ke||e===f||e===C||e===R||He||e===O||le||z||Je||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===w||e.$$typeof===i||e.$$typeof===b||e.$$typeof===p||e.$$typeof===fe||e.getModuleId!==void 0))}function qe(e,r,t){var a=e.displayName;if(a)return a;var l=r.displayName||r.name||"";return l!==""?t+"("+l+")":t}function de(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case g:return"Portal";case u:return"Profiler";case f:return"StrictMode";case C:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return de(r)+".Consumer";case i:var t=e;return de(t._context)+".Provider";case p:return qe(e,e.render,"ForwardRef");case w:var a=e.displayName||null;return a!==null?a:k(e.type)||"Memo";case S:{var l=e,v=l._payload,s=l._init;try{return k(s(v))}catch{return null}}}return null}var I=Object.assign,V=0,ve,pe,ge,he,me,Ee,ye;function be(){}be.__reactDisabledLog=!0;function Qe(){{if(V===0){ve=console.log,pe=console.info,ge=console.warn,he=console.error,me=console.group,Ee=console.groupCollapsed,ye=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function $e(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ve}),info:I({},e,{value:pe}),warn:I({},e,{value:ge}),error:I({},e,{value:he}),group:I({},e,{value:me}),groupCollapsed:I({},e,{value:Ee}),groupEnd:I({},e,{value:ye})})}V<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=j.ReactCurrentDispatcher,ee;function J(e,r,t){{if(ee===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);ee=a&&a[1]||""}return`
18
+ `+ee+e}}var re=!1,H;{var Ze=typeof WeakMap=="function"?WeakMap:Map;H=new Ze}function Re(e,r){if(!e||re)return"";{var t=H.get(e);if(t!==void 0)return t}var a;re=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=Z.current,Z.current=null,Qe();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(A){a=A}Reflect.construct(e,[],s)}else{try{s.call()}catch(A){a=A}e.call(s.prototype)}}else{try{throw Error()}catch(A){a=A}e()}}catch(A){if(A&&a&&typeof A.stack=="string"){for(var o=A.stack.split(`
19
+ `),T=a.stack.split(`
20
+ `),m=o.length-1,E=T.length-1;m>=1&&E>=0&&o[m]!==T[E];)E--;for(;m>=1&&E>=0;m--,E--)if(o[m]!==T[E]){if(m!==1||E!==1)do if(m--,E--,E<0||o[m]!==T[E]){var P=`
21
+ `+o[m].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(m>=1&&E>=0);break}}}finally{re=!1,Z.current=v,$e(),Error.prepareStackTrace=l}var M=e?e.displayName||e.name:"",Fe=M?J(M):"";return typeof e=="function"&&H.set(e,Fe),Fe}function er(e,r,t){return Re(e,!1)}function rr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,rr(e));if(typeof e=="string")return J(e);switch(e){case C:return J("Suspense");case R:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return er(e.render);case w:return K(e.type,r,t);case S:{var a=e,l=a._payload,v=a._init;try{return K(v(l),r,t)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,_e={},Te=j.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}function tr(e,r,t,a,l){{var v=Function.call.bind(X);for(var s in e)if(v(e,s)){var o=void 0;try{if(typeof e[s]!="function"){var T=Error((a||"React class")+": "+t+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}o=e[s](r,s,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){o=m}o&&!(o instanceof Error)&&(q(l),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",t,s,typeof o),q(null)),o instanceof Error&&!(o.message in _e)&&(_e[o.message]=!0,q(l),c("Failed %s type: %s",t,o.message),q(null))}}}var nr=Array.isArray;function te(e){return nr(e)}function ar(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Ce(e){if(or(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),we(e)}var U=j.ReactCurrentOwner,ir={key:!0,ref:!0,__self:!0,__source:!0},Oe,Se,ne;ne={};function ur(e){if(X.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function sr(e){if(X.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function cr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=k(U.current.type);ne[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(U.current.type),e.ref),ne[t]=!0)}}function lr(e,r){{var t=function(){Oe||(Oe=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function fr(e,r){{var t=function(){Se||(Se=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var dr=function(e,r,t,a,l,v,s){var o={$$typeof:d,type:e,key:r,ref:t,props:s,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function vr(e,r,t,a,l){{var v,s={},o=null,T=null;t!==void 0&&(Ce(t),o=""+t),sr(r)&&(Ce(r.key),o=""+r.key),ur(r)&&(T=r.ref,cr(r,l));for(v in r)X.call(r,v)&&!ir.hasOwnProperty(v)&&(s[v]=r[v]);if(e&&e.defaultProps){var m=e.defaultProps;for(v in m)s[v]===void 0&&(s[v]=m[v])}if(o||T){var E=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&lr(s,E),T&&fr(s,E)}return dr(e,o,T,l,a,U.current,s)}}var ae=j.ReactCurrentOwner,Pe=j.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===d}function je(){{if(ae.current){var e=k(ae.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function fr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
23
+ Check the render method of \``+e+"`."}return""}}function pr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
- Check your code at `+r+":"+t+"."}return""}}var xe={};function lr(e){{var r=je();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
25
+ Check your code at `+r+":"+t+"."}return""}}var ke={};function gr(e){{var r=je();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
26
 
27
- Check the top-level render call using <`+t+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(xe[t])return;xe[t]=!0;var n="";e&&e._owner&&e._owner!==ae.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),L(e),u('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),L(null)}}function De(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var n=e[t];ie(n)&&ke(n,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var s=B(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),o;!(o=c.next()).done;)ie(o.value)&&ke(o.value,r)}}}function dr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=x(r);Ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var s=x(r);u("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&u("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){L(e),u("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),L(null);break}}e.ref!==null&&(L(e),u("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function Ae(e,r,t,n,s,c){{var o=Je(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=fr(s);_?a+=_:a+=je();var p;e===null?p="null":te(e)?p="array":e!==void 0&&e.$$typeof===m?(p="<"+(x(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):p=typeof e,u("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",p,a)}var g=cr(e,r,t,s,c);if(g==null)return g;if(o){var C=r.children;if(C!==void 0)if(n)if(te(C)){for(var M=0;M<C.length;M++)De(C[M],e);Object.freeze&&Object.freeze(C)}else u("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else De(C,e)}return e===b?vr(g):dr(g),g}}function pr(e,r,t){return Ae(e,r,t,!0)}function gr(e,r,t){return Ae(e,r,t,!1)}var hr=gr,Er=pr;W.Fragment=b,W.jsx=hr,W.jsxs=Er}()),W}(function(f){process.env.NODE_ENV==="production"?f.exports=Le():f.exports=Me()})(Ie);const I=q.jsx,N=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ye=({axios:f,children:m,translate:y,useAuth:b,Outlet:v,Navigate:l,useLocation:i,useGoogleTagManager:R})=>{const d=E.useMemo(()=>({axios:f,Navigate:l,Outlet:v,translate:y,useAuth:b,useGoogleTagManager:R,useLocation:i}),[l,v,f,y,b,R,i]);return I(N.Provider,{value:d,children:m})},G=f=>`RequireAuth require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:f,loginPath:m="/login",localStorageKey:y="user",redirect401Path:b="/login",...v})=>{var D,A,B,j;const{axios:l=v.axios,useLocation:i=v.useLocation,useAuth:R=v.useAuth,Outlet:d=v.Outlet,Navigate:w=v.Navigate}=E.useContext(N);if(R===void 0)throw new Error(G("useAuth"));if(i===void 0)throw new Error(G("useLocation"));if(d===void 0)throw new Error(G("Outlet"));if(w===void 0)throw new Error(G("Navigate"));const[h,T]=E.useState(null),{isLogged:S}=R(),O=i();return E.useLayoutEffect(()=>{l==null||l.interceptors.response.use(u=>u,async u=>{var J;return typeof u=="object"&&u&&"response"in u&&u.response&&typeof u.response=="object"&&"status"in u.response&&u.response&&typeof u.response=="object"&&"status"in u.response&&((J=u==null?void 0:u.response)==null?void 0:J.status)===401&&(l.defaults.headers.common.Authorization=null,localStorage.removeItem(y),T(b)),Promise.reject(u)})},[l==null?void 0:l.defaults,l==null?void 0:l.interceptors.response,y,b]),S&&!h?I(E.Suspense,{fallback:f,children:(A=(D=O.state)==null?void 0:D.from)!=null&&A.state&&((j=(B=O.state)==null?void 0:B.from)==null?void 0:j.pathname)===m?I(w,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):I(d,{})}):I(w,{to:m,state:{from:O},replace:!0})},Z=f=>`GTMSendPageView require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ne=({...f})=>{const{useLocation:m=f.useLocation,Outlet:y=f.Outlet,useGoogleTagManager:b=f.useGoogleTagManager}=E.useContext(N);if(m===void 0)throw new Error(Z("useLocation"));if(y===void 0)throw new Error(Z("Outlet"));if(b===void 0)throw new Error(Z("useGoogleTagManager"));const{pathname:v}=m(),{sendEvent:l}=b();return E.useEffect(()=>{l({event:"pageView",pathname:v})},[v,l]),I(y,{})},Ve=f=>{const{unknownErrorTranslationKey:m="error.unknownError"}=f||{},{translate:y=f==null?void 0:f.translate}=E.useContext(N);return{printError:E.useCallback(v=>{var R,d,w,h,T,S,O,D,A;const l=y?y(m):"Unknown error",{response:i}=v||{};return v!=null&&v.reason?String(v.reason):(R=i==null?void 0:i.data)!=null&&R.reason?String(i.data.reason):(d=i==null?void 0:i.data)!=null&&d.message?String(i.data.message):(h=(w=i==null?void 0:i.data)==null?void 0:w.detail)!=null&&h.length&&Array.isArray((T=i==null?void 0:i.data)==null?void 0:T.detail)&&((O=(S=i==null?void 0:i.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((A=(D=i==null?void 0:i.data)==null?void 0:D.detail[0])==null?void 0:A.msg)=="string"?String(i.data.detail[0].msg):l},[y,m])}};P.GTMSendPageView=Ne,P.InjectDependenciesContext=N,P.InjectDependenciesProvider=Ye,P.RequireAuth=We,P.useResponseError=Ve,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+t+">.")}return r}}function Ae(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=gr(r);if(ke[t])return;ke[t]=!0;var a="";e&&e._owner&&e._owner!==ae.current&&(a=" It was passed a child from "+k(e._owner.type)+"."),L(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),L(null)}}function xe(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var a=e[t];ie(a)&&Ae(a,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var l=B(e);if(typeof l=="function"&&l!==e.entries)for(var v=l.call(e),s;!(s=v.next()).done;)ie(s.value)&&Ae(s.value,r)}}}function hr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===w))t=r.propTypes;else return;if(t){var a=k(r);tr(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var l=k(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){L(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),L(null);break}}e.ref!==null&&(L(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function De(e,r,t,a,l,v){{var s=Xe(e);if(!s){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=pr(l);T?o+=T:o+=je();var m;e===null?m="null":te(e)?m="array":e!==void 0&&e.$$typeof===d?(m="<"+(k(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,o)}var E=vr(e,r,t,l,v);if(E==null)return E;if(s){var P=r.children;if(P!==void 0)if(a)if(te(P)){for(var M=0;M<P.length;M++)xe(P[M],e);Object.freeze&&Object.freeze(P)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xe(P,e)}return e===h?mr(E):hr(E),E}}function Er(e,r,t){return De(e,r,t,!0)}function yr(e,r,t){return De(e,r,t,!1)}var br=yr,Rr=Er;W.Fragment=h,W.jsx=br,W.jsxs=Rr}()),W}(function(n){process.env.NODE_ENV==="production"?n.exports=Le():n.exports=Me()})(Ie);const D=Q.jsx,Y=y.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:d,translate:g,useAuth:h,Outlet:f,Navigate:u,useLocation:i,useGoogleTagManager:b})=>{const p=y.useMemo(()=>({axios:n,Navigate:u,Outlet:f,translate:g,useAuth:h,useGoogleTagManager:b,useLocation:i}),[u,f,n,g,h,b,i]);return D(Y.Provider,{value:p,children:d})},G=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:d="/login",localStorageKey:g="user",redirect401Path:h="/login",...f})=>{var x,F,B,j;const{axios:u=f.axios,useLocation:i=f.useLocation,useAuth:b=f.useAuth,Outlet:p=f.Outlet,Navigate:C=f.Navigate}=y.useContext(Y);if(b===void 0)throw new Error(G("useAuth"));if(i===void 0)throw new Error(G("useLocation"));if(p===void 0)throw new Error(G("Outlet"));if(C===void 0)throw new Error(G("Navigate"));const[R,w]=y.useState(null),{isLogged:S}=b(),O=i();return y.useLayoutEffect(()=>{u==null||u.interceptors.response.use(c=>c,async c=>{var z;return typeof c=="object"&&c&&"response"in c&&c.response&&typeof c.response=="object"&&"status"in c.response&&c.response&&typeof c.response=="object"&&"status"in c.response&&((z=c==null?void 0:c.response)==null?void 0:z.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(g),w(h)),Promise.reject(c)})},[u==null?void 0:u.defaults,u==null?void 0:u.interceptors.response,g,h]),S&&!R?D(y.Suspense,{fallback:n,children:(F=(x=O.state)==null?void 0:x.from)!=null&&F.state&&((j=(B=O.state)==null?void 0:B.from)==null?void 0:j.pathname)===d?D(C,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):D(p,{})}):D(C,{to:d,state:{from:O},replace:!0})},$=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({...n})=>{const{useLocation:d=n.useLocation,Outlet:g=n.Outlet,useGoogleTagManager:h=n.useGoogleTagManager}=y.useContext(Y);if(d===void 0)throw new Error($("useLocation"));if(g===void 0)throw new Error($("Outlet"));if(h===void 0)throw new Error($("useGoogleTagManager"));const{pathname:f}=d(),{sendEvent:u}=h();return y.useEffect(()=>{u({event:"pageView",pathname:f})},[f,u]),D(g,{})},Ve=({axios:n,baseURL:d,userLocalStorageKey:g="user",postContentType:h="application/json"})=>(y.useLayoutEffect(()=>{if(!n.defaults)return;const f=localStorage.getItem(g),u=f?JSON.parse(f):null,i=u&&typeof u=="object"&&"tokenType"in u&&u.tokenType?u.tokenType:null,b=u&&typeof u=="object"&&"accessToken"in u&&u.accessToken?u.accessToken:null,p=f?`${i} ${b}`:null;n.defaults.baseURL=d,n.defaults.headers.post["Content-Type"]=h,p&&(n.defaults.headers.common.Authorization=p)},[n.defaults,n.defaults.baseURL,n.defaults.headers.common,n.defaults.headers.post,d,h,g]),null),Ue=({i18n:n,initReactI18next:d,resources:g,LanguageDetector:h})=>(n.use(h).use(d).init({debug:!1,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{useSuspense:!0},resources:g,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",f=>{document.documentElement.setAttribute("lang",f)}),null),Ge=({dsn:n,sentry:d})=>(y.useLayoutEffect(()=>{d&&process.env.NODE_ENV!=="development"&&d.init({dsn:n,integrations:[new d.BrowserTracing],tracesSampleRate:1})},[n,d]),null),Be=({children:n,defaultOptions:d,QueryClient:g,QueryClientProvider:h})=>{const f=new g({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...d}}});return D(h,{client:f,children:n})},ze=n=>{const{unknownErrorTranslationKey:d="error.unknownError"}=n||{},{translate:g=n==null?void 0:n.translate}=y.useContext(Y);return{printError:y.useCallback(f=>{var b,p,C,R,w,S,O,x,F;const u=g?g(d):"Unknown error",{response:i}=f||{};return f!=null&&f.reason?String(f.reason):(b=i==null?void 0:i.data)!=null&&b.reason?String(i.data.reason):(p=i==null?void 0:i.data)!=null&&p.message?String(i.data.message):(R=(C=i==null?void 0:i.data)==null?void 0:C.detail)!=null&&R.length&&Array.isArray((w=i==null?void 0:i.data)==null?void 0:w.detail)&&((O=(S=i==null?void 0:i.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((F=(x=i==null?void 0:i.data)==null?void 0:x.detail[0])==null?void 0:F.msg)=="string"?String(i.data.detail[0].msg):u},[g,d])}};_.AxiosConfig=Ve,_.GTMSendPageView=Ye,_.I18nConfig=Ue,_.InjectDependenciesContext=Y,_.InjectDependenciesProvider=Ne,_.QueryClientProvider=Be,_.RequireAuth=We,_.SentryConfig=Ge,_.useResponseError=ze,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",
@@ -1,3 +0,0 @@
1
- import GTMSendPageView from "./GTMSendPageView";
2
- export default GTMSendPageView;
3
- export * from "./GTMSendPageView";
@@ -1,3 +0,0 @@
1
- import RequireAuth from "./RequireAuth";
2
- export default RequireAuth;
3
- export * from "./RequireAuth";