@tracktor/shared-module 2.3.1 → 2.3.3

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(w,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(w=typeof globalThis<"u"?globalThis:w||self,h(w["@tracktor/shared-module"]={},w.React))})(this,function(w,h){"use strict";var ee={exports:{}},B={};/**
1
+ (function(C,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(C=typeof globalThis<"u"?globalThis:C||self,m(C["@tracktor/shared-module"]={},C.React))})(this,function(C,m){"use strict";var ee={exports:{}},B={};/**
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 ce;function Ne(){if(ce)return B;ce=1;var t=h,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function f(v,c,y){var R,_={},C=null,s=null;y!==void 0&&(C=""+y),c.key!==void 0&&(C=""+c.key),c.ref!==void 0&&(s=c.ref);for(R in c)u.call(c,R)&&!l.hasOwnProperty(R)&&(_[R]=c[R]);if(v&&v.defaultProps)for(R in c=v.defaultProps,c)_[R]===void 0&&(_[R]=c[R]);return{$$typeof:n,type:v,key:C,ref:s,props:_,_owner:i.current}}return B.Fragment=a,B.jsx=f,B.jsxs=f,B}var G={};/**
9
+ */var ue;function Ye(){if(ue)return B;ue=1;var t=m,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function l(d,u,h){var E,_={},p=null,c=null;h!==void 0&&(p=""+h),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(c=u.ref);for(E in u)s.call(u,E)&&!f.hasOwnProperty(E)&&(_[E]=u[E]);if(d&&d.defaultProps)for(E in u=d.defaultProps,u)_[E]===void 0&&(_[E]=u[E]);return{$$typeof:n,type:d,key:p,ref:c,props:_,_owner:i.current}}return B.Fragment=o,B.jsx=l,B.jsxs=l,B}var G={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,12 +14,12 @@
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 le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),v=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),s=Symbol.for("react.offscreen"),T=Symbol.iterator,I="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=T&&e[T]||e[I];return typeof r=="function"?r:null}var D=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),d=1;d<r;d++)o[d-1]=arguments[d];Y("error",e,o)}}function Y(e,r,o){{var d=D.ReactDebugCurrentFrame,E=d.getStackAddendum();E!==""&&(r+="%s",o=o.concat([E]));var p=o.map(function(m){return String(m)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var N=!1,M=!1,j=!1,ge=!1,me=!1,Q;Q=Symbol.for("react.module.reference");function vt(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===l||me||e===i||e===y||e===R||ge||e===s||N||M||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===f||e.$$typeof===v||e.$$typeof===c||e.$$typeof===Q||e.getModuleId!==void 0))}function gt(e,r,o){var d=e.displayName;if(d)return d;var E=r.displayName||r.name||"";return E!==""?o+"("+E+")":o}function he(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&b("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 u:return"Fragment";case a:return"Portal";case l:return"Profiler";case i:return"StrictMode";case y:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case v:var r=e;return he(r)+".Consumer";case f:var o=e;return he(o._context)+".Provider";case c:return gt(e,e.render,"ForwardRef");case _:var d=e.displayName||null;return d!==null?d:L(e.type)||"Memo";case C:{var E=e,p=E._payload,m=E._init;try{return L(m(p))}catch{return null}}}return null}var z=Object.assign,J=0,ye,Ee,Re,pe,we,Ce,_e;function be(){}be.__reactDisabledLog=!0;function mt(){{if(J===0){ye=console.log,Ee=console.info,Re=console.warn,pe=console.error,we=console.group,Ce=console.groupCollapsed,_e=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})}J++}}function ht(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:ye}),info:z({},e,{value:Ee}),warn:z({},e,{value:Re}),error:z({},e,{value:pe}),group:z({},e,{value:we}),groupCollapsed:z({},e,{value:Ce}),groupEnd:z({},e,{value:_e})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=D.ReactCurrentDispatcher,re;function H(e,r,o){{if(re===void 0)try{throw Error()}catch(E){var d=E.stack.trim().match(/\n( *(at )?)/);re=d&&d[1]||""}return`
18
- `+re+e}}var ne=!1,K;{var yt=typeof WeakMap=="function"?WeakMap:Map;K=new yt}function Pe(e,r){if(!e||ne)return"";{var o=K.get(e);if(o!==void 0)return o}var d;ne=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=te.current,te.current=null,mt();try{if(r){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(W){d=W}Reflect.construct(e,[],m)}else{try{m.call()}catch(W){d=W}e.call(m.prototype)}}else{try{throw Error()}catch(W){d=W}e()}}catch(W){if(W&&d&&typeof W.stack=="string"){for(var g=W.stack.split(`
19
- `),O=d.stack.split(`
20
- `),P=g.length-1,S=O.length-1;P>=1&&S>=0&&g[P]!==O[S];)S--;for(;P>=1&&S>=0;P--,S--)if(g[P]!==O[S]){if(P!==1||S!==1)do if(P--,S--,S<0||g[P]!==O[S]){var k=`
21
- `+g[P].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,k),k}while(P>=1&&S>=0);break}}}finally{ne=!1,te.current=p,ht(),Error.prepareStackTrace=E}var U=e?e.displayName||e.name:"",Ye=U?H(U):"";return typeof e=="function"&&K.set(e,Ye),Ye}function Et(e,r,o){return Pe(e,!1)}function Rt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,o){if(e==null)return"";if(typeof e=="function")return Pe(e,Rt(e));if(typeof e=="string")return H(e);switch(e){case y:return H("Suspense");case R:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Et(e.render);case _:return Z(e.type,r,o);case C:{var d=e,E=d._payload,p=d._init;try{return Z(p(E),r,o)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,je={},Se=D.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,o=Z(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(o)}else Se.setExtraStackFrame(null)}function pt(e,r,o,d,E){{var p=Function.call.bind($);for(var m in e)if(p(e,m)){var g=void 0;try{if(typeof e[m]!="function"){var O=Error((d||"React class")+": "+o+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}g=e[m](r,m,d,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){g=P}g&&!(g instanceof Error)&&(q(E),b("%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).",d||"React class",o,m,typeof g),q(null)),g instanceof Error&&!(g.message in je)&&(je[g.message]=!0,q(E),b("Failed %s type: %s",o,g.message),q(null))}}}var wt=Array.isArray;function oe(e){return wt(e)}function Ct(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,o=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function _t(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function xe(e){if(_t(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ct(e)),Te(e)}var X=D.ReactCurrentOwner,bt={key:!0,ref:!0,__self:!0,__source:!0},Oe,Ae,ae;ae={};function Pt(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function jt(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function St(e,r){if(typeof e.ref=="string"&&X.current&&r&&X.current.stateNode!==r){var o=L(X.current.type);ae[o]||(b('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',L(X.current.type),e.ref),ae[o]=!0)}}function Tt(e,r){{var o=function(){Oe||(Oe=!0,b("%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))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function xt(e,r){{var o=function(){Ae||(Ae=!0,b("%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))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var Ot=function(e,r,o,d,E,p,m){var g={$$typeof:n,type:e,key:r,ref:o,props:m,_owner:p};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function At(e,r,o,d,E){{var p,m={},g=null,O=null;o!==void 0&&(xe(o),g=""+o),jt(r)&&(xe(r.key),g=""+r.key),Pt(r)&&(O=r.ref,St(r,E));for(p in r)$.call(r,p)&&!bt.hasOwnProperty(p)&&(m[p]=r[p]);if(e&&e.defaultProps){var P=e.defaultProps;for(p in P)m[p]===void 0&&(m[p]=P[p])}if(g||O){var S=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&Tt(m,S),O&&xt(m,S)}return Ot(e,g,O,E,d,X.current,m)}}var ie=D.ReactCurrentOwner,Ie=D.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,o=Z(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(o)}else Ie.setExtraStackFrame(null)}var ue;ue=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function ke(){{if(ie.current){var e=L(ie.current.type);if(e)return`
17
+ */var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=m,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),T=Symbol.iterator,k="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=T&&e[T]||e[k];return typeof r=="function"?r:null}var D=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),v=1;v<r;v++)a[v-1]=arguments[v];W("error",e,a)}}function W(e,r,a){{var v=D.ReactDebugCurrentFrame,R=v.getStackAddendum();R!==""&&(r+="%s",a=a.concat([R]));var w=a.map(function(y){return String(y)});w.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,w)}}var Y=!1,M=!1,j=!1,ge=!1,me=!1,Q;Q=Symbol.for("react.module.reference");function vt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===f||me||e===i||e===h||e===E||ge||e===c||Y||M||j||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===_||e.$$typeof===l||e.$$typeof===d||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function gt(e,r,a){var v=e.displayName;if(v)return v;var R=r.displayName||r.name||"";return R!==""?a+"("+R+")":a}function he(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&b("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 s:return"Fragment";case o:return"Portal";case f:return"Profiler";case i:return"StrictMode";case h:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return he(r)+".Consumer";case l:var a=e;return he(a._context)+".Provider";case u:return gt(e,e.render,"ForwardRef");case _:var v=e.displayName||null;return v!==null?v:L(e.type)||"Memo";case p:{var R=e,w=R._payload,y=R._init;try{return L(y(w))}catch{return null}}}return null}var z=Object.assign,J=0,ye,Ee,Re,we,Ce,pe,_e;function be(){}be.__reactDisabledLog=!0;function mt(){{if(J===0){ye=console.log,Ee=console.info,Re=console.warn,we=console.error,Ce=console.group,pe=console.groupCollapsed,_e=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})}J++}}function ht(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:ye}),info:z({},e,{value:Ee}),warn:z({},e,{value:Re}),error:z({},e,{value:we}),group:z({},e,{value:Ce}),groupCollapsed:z({},e,{value:pe}),groupEnd:z({},e,{value:_e})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=D.ReactCurrentDispatcher,re;function X(e,r,a){{if(re===void 0)try{throw Error()}catch(R){var v=R.stack.trim().match(/\n( *(at )?)/);re=v&&v[1]||""}return`
18
+ `+re+e}}var ne=!1,H;{var yt=typeof WeakMap=="function"?WeakMap:Map;H=new yt}function Pe(e,r){if(!e||ne)return"";{var a=H.get(e);if(a!==void 0)return a}var v;ne=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var w;w=te.current,te.current=null,mt();try{if(r){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(N){v=N}Reflect.construct(e,[],y)}else{try{y.call()}catch(N){v=N}e.call(y.prototype)}}else{try{throw Error()}catch(N){v=N}e()}}catch(N){if(N&&v&&typeof N.stack=="string"){for(var g=N.stack.split(`
19
+ `),O=v.stack.split(`
20
+ `),P=g.length-1,S=O.length-1;P>=1&&S>=0&&g[P]!==O[S];)S--;for(;P>=1&&S>=0;P--,S--)if(g[P]!==O[S]){if(P!==1||S!==1)do if(P--,S--,S<0||g[P]!==O[S]){var I=`
21
+ `+g[P].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,I),I}while(P>=1&&S>=0);break}}}finally{ne=!1,te.current=w,ht(),Error.prepareStackTrace=R}var U=e?e.displayName||e.name:"",We=U?X(U):"";return typeof e=="function"&&H.set(e,We),We}function Et(e,r,a){return Pe(e,!1)}function Rt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,a){if(e==null)return"";if(typeof e=="function")return Pe(e,Rt(e));if(typeof e=="string")return X(e);switch(e){case h:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Et(e.render);case _:return Z(e.type,r,a);case p:{var v=e,R=v._payload,w=v._init;try{return Z(w(R),r,a)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,je={},Se=D.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,a=Z(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(a)}else Se.setExtraStackFrame(null)}function wt(e,r,a,v,R){{var w=Function.call.bind($);for(var y in e)if(w(e,y)){var g=void 0;try{if(typeof e[y]!="function"){var O=Error((v||"React class")+": "+a+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}g=e[y](r,y,v,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){g=P}g&&!(g instanceof Error)&&(q(R),b("%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).",v||"React class",a,y,typeof g),q(null)),g instanceof Error&&!(g.message in je)&&(je[g.message]=!0,q(R),b("Failed %s type: %s",a,g.message),q(null))}}}var Ct=Array.isArray;function oe(e){return Ct(e)}function pt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function _t(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function xe(e){if(_t(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",pt(e)),Te(e)}var K=D.ReactCurrentOwner,bt={key:!0,ref:!0,__self:!0,__source:!0},Oe,Ae,ae;ae={};function Pt(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function jt(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function St(e,r){if(typeof e.ref=="string"&&K.current&&r&&K.current.stateNode!==r){var a=L(K.current.type);ae[a]||(b('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',L(K.current.type),e.ref),ae[a]=!0)}}function Tt(e,r){{var a=function(){Oe||(Oe=!0,b("%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))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function xt(e,r){{var a=function(){Ae||(Ae=!0,b("%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))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Ot=function(e,r,a,v,R,w,y){var g={$$typeof:n,type:e,key:r,ref:a,props:y,_owner:w};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function At(e,r,a,v,R){{var w,y={},g=null,O=null;a!==void 0&&(xe(a),g=""+a),jt(r)&&(xe(r.key),g=""+r.key),Pt(r)&&(O=r.ref,St(r,R));for(w in r)$.call(r,w)&&!bt.hasOwnProperty(w)&&(y[w]=r[w]);if(e&&e.defaultProps){var P=e.defaultProps;for(w in P)y[w]===void 0&&(y[w]=P[w])}if(g||O){var S=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&Tt(y,S),O&&xt(y,S)}return Ot(e,g,O,R,v,K.current,y)}}var ie=D.ReactCurrentOwner,ke=D.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,a=Z(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(a)}else ke.setExtraStackFrame(null)}var se;se=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ie(){{if(ie.current){var e=L(ie.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function It(e){return""}var De={};function kt(e){{var r=ke();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=`
23
+ Check the render method of \``+e+"`."}return""}}function kt(e){return""}var De={};function It(e){{var r=Ie();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
24
24
 
25
- Check the top-level render call using <`+o+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=kt(r);if(De[o])return;De[o]=!0;var d="";e&&e._owner&&e._owner!==ie.current&&(d=" It was passed a child from "+L(e._owner.type)+"."),V(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,d),V(null)}}function Le(e,r){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var d=e[o];se(d)&&Fe(d,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var E=x(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),m;!(m=p.next()).done;)se(m.value)&&Fe(m.value,r)}}}function Dt(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===_))o=r.propTypes;else return;if(o){var d=L(r);pt(o,e.props,"prop",d,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var E=L(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ft(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var d=r[o];if(d!=="children"&&d!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",d),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function We(e,r,o,d,E,p){{var m=vt(e);if(!m){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 O=It();O?g+=O:g+=ke();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(L(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,g)}var S=At(e,r,o,E,p);if(S==null)return S;if(m){var k=r.children;if(k!==void 0)if(d)if(oe(k)){for(var U=0;U<k.length;U++)Le(k[U],e);Object.freeze&&Object.freeze(k)}else b("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 Le(k,e)}return e===u?Ft(S):Dt(S),S}}function Lt(e,r,o){return We(e,r,o,!0)}function Wt(e,r,o){return We(e,r,o,!1)}var Yt=Wt,Nt=Lt;G.Fragment=u,G.jsx=Yt,G.jsxs=Nt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ne():ee.exports=Me();var F=ee.exports;const A=h.createContext({}),ze=({children:t,apiURL:n,libraries:a})=>{const u=h.useMemo(()=>({apiURL:n,libraries:a}),[n,a]);return F.jsx(A.Provider,{value:u,children:t})},Ve=({Fallback:t,isLogged:n,loginPath:a="/login",localStorageKey:u="user",redirect401Path:i="/login",...l})=>{var b,Y,N,M;const{libraries:f}=h.useContext(A),v=(l==null?void 0:l.reactRouter)||(f==null?void 0:f.reactRouter),c=(l==null?void 0:l.axios)||(f==null?void 0:f.axios);if(!v)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[y,R]=h.useState(null),{useLocation:_,Navigate:C,Outlet:s}=v,T=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,D=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,c.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(c.defaults.headers.common.Authorization=null,localStorage.removeItem(u),R(i)),Promise.reject(j)}))},[c.defaults.headers.common,c.interceptors.response,u,i]),D&&!y?F.jsx(h.Suspense,{fallback:t,children:(Y=(b=T.state)==null?void 0:b.from)!=null&&Y.state&&((M=(N=T.state)==null?void 0:N.from)==null?void 0:M.pathname)===a?F.jsx(C,{to:T.state.from.state.from.pathname+T.state.from.state.from.search,replace:!0}):F.jsx(s,{})}):F.jsx(C,{to:a+T.search,state:{from:T},replace:!0})},Ue=({...t})=>{const{libraries:n}=h.useContext(A),a=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),u=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!a)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!u)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:i}=u,{useLocation:l,Outlet:f}=a,{pathname:v}=l(),{sendEvent:c}=i();return h.useEffect(()=>{c({event:"pageView",pathname:v})},[v,c]),F.jsx(f,{})},Be=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:a="accessToken",postContentType:u="application/json",...i})=>{const{apiURL:l=i.apiURL,libraries:f}=h.useContext(A),v=(i==null?void 0:i.axios)||(f==null?void 0:f.axios);if(!v)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(v!=null&&v.defaults))return null;const c=localStorage.getItem(n),y=c?JSON.parse(c):null,R=y!=null&&y[t]?y[t]:null,_=y!=null&&y[a]?y[a]:null,C=c?`${R} ${_}`:null;return v.defaults.baseURL=l,v.defaults.headers.post["Content-Type"]=u,C&&(v.defaults.headers.common.Authorization=C),null},Ge=({debug:t,resources:n,...a})=>{const{libraries:u}=h.useContext(A),i=(a==null?void 0:a.i18)||(u==null?void 0:u.i18),{i18next:l,initReactI18next:f,languageDetector:v}=i||{};if(!i)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(v).use(f).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==l.resolvedLanguage&&l.resolvedLanguage&&document.documentElement.setAttribute("lang",l.resolvedLanguage)}),l.on("languageChanged",c=>{document.documentElement.setAttribute("lang",c)})),null},Qe=({dsn:t,integrations:n,tracesSampleRate:a,replaysSessionSampleRate:u,replaysOnErrorSampleRate:i,tracePropagationTargets:l,ignoreErrors:f,debug:v,environment:c,...y})=>{const{libraries:R}=h.useContext(A),_=(y==null?void 0:y.sentry)||(R==null?void 0:R.sentry),C=(y==null?void 0:y.reactRouter)||(R==null?void 0:R.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!C)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:s,matchRoutes:T,useLocation:I,useNavigationType:x}=C;return(v||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:v,dsn:t,environment:c||"production",ignoreErrors:[...f||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:s,matchRoutes:T,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:i||1,replaysSessionSampleRate:u||.1,tracePropagationTargets:l,tracesSampleRate:a||1}),null},Je=({IMaskMixin:t,...n})=>{const a=h.useMemo(()=>t(({TextField:u,...i})=>F.jsx(u,{...i})),[t]);return F.jsx(a,{...n})},Xe=({accessToken:t,...n})=>{const{libraries:a}=h.useContext(A),u=(n==null?void 0:n.mapbox)||(a==null?void 0:a.mapbox);if(!u)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(u.accessToken=t),null},He=({language:t,...n})=>{const{libraries:a}=h.useContext(A),u=(n==null?void 0:n.dayjs)||(a==null?void 0:a.dayjs),i=(n==null?void 0:n.plugin)||(a==null?void 0:a.dayjsPlugin);if(!u)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var v;const f=t||((v=navigator.language)==null?void 0:v.slice(0,2))||"en";i&&i.forEach(c=>{c&&u.extend(c)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),u.locale(f)})().then()},[u,i,t]),null},Ke=t=>t&&typeof t=="function",Ze=t=>t&&typeof t=="function",$e=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:a,...u})=>{var c,y;const{libraries:i}=h.useContext(A),l=(u==null?void 0:u.QueryClient)||((c=i==null?void 0:i.reactQuery)==null?void 0:c.QueryClient),f=(u==null?void 0:u.QueryClientProvider)||((y=i==null?void 0:i.reactQuery)==null?void 0:y.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!f)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!Ke(f))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ze(l))throw new Error("Provided QueryClient dependencies are not valid.");const v=new l({defaultOptions:{mutations:{...a},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(f,{client:v,children:t})},qe=t=>{var y,R,_;const{libraries:n}=h.useContext(A),a=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),u=((y=t==null?void 0:t.i18)==null?void 0:y.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),i=((_=a==null?void 0:a.i18next)==null?void 0:_.t)||u||(C=>C),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},f=i(l),v=h.useCallback(C=>{var T,I,x,D,b,Y,N,M,j;const{response:s}=C||{};return s!=null&&s.reason?String(s.reason):(T=s==null?void 0:s.data)!=null&&T.reason?String(s.data.reason):(I=s==null?void 0:s.data)!=null&&I.message?String(s.data.message):(D=(x=s==null?void 0:s.data)==null?void 0:x.detail)!=null&&D.length&&Array.isArray((b=s==null?void 0:s.data)==null?void 0:b.detail)&&((N=(Y=s==null?void 0:s.data)==null?void 0:Y.detail[0])!=null&&N.msg)&&typeof((j=(M=s==null?void 0:s.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(s.data.detail[0].msg):f},[f]);return{getErrorCode:h.useCallback(C=>{var T,I,x;const{response:s}=C||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(T=s==null?void 0:s.data)!=null&&T.error_code?String((I=s==null?void 0:s.data)==null?void 0:I.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(x=s==null?void 0:s.data)!=null&&x.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:v}},et=({data:t,fetchNextPage:n,isFetchingNextPage:a,isInitialLoading:u,isLoading:i,enabled:l=!0})=>{const f=h.useCallback(async c=>{a||!l||await n({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[l,n,a]),v=h.useMemo(()=>{if(t)return t.pages.reduce((c,y)=>[...c,...y],[])},[t]);return{fetchNextPageOnRowsScrollEnd:f,isLoading:a||i,loadingVariant:u?"skeleton":"linear",rows:v}},tt=t=>{const{libraries:n}=h.useContext(A),a=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(!a)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{a.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:l,accessToken:f})=>{a.defaults.headers.common.Authorization=`${l} ${f}`}}},fe=({library:t,date:n,format:a="ll"})=>t(n).format(a),de=(t,n="km")=>{const a=Number(t);return Number.isNaN(a)?`0 ${n}`:`${a.toFixed(2)} ${n}`},rt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,nt=({path:t,size:n,apiURL:a})=>{if(!t)return"";const u=rt(t),i=`${a}${u}`,l=i.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${i.replace("/files",`/thumbs/${n}`)}`:i},ot=t=>{const{apiURL:n,libraries:a}=h.useContext(A),u=(t==null?void 0:t.dayjs)||(a==null?void 0:a.dayjs);return{dateAdapter:(f,v)=>{if(!u)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:f,format:v,library:u})},distanceAdapter:de,filePathAdapter:(f,v)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return nt({apiURL:n,path:f,size:v})}}},ve=(t,n)=>n==="short"?t.split("-")[0]:t,at=(t,n="full")=>{const[a,u]=h.useState(()=>ve((t==null?void 0:t.language)||navigator.language,n));return h.useEffect(()=>{var l;const i=f=>{u(ve(f,n))};return(l=t==null?void 0:t.on)==null||l.call(t,"languageChanged",i),()=>{var f;(f=t==null?void 0:t.off)==null||f.call(t,"languageChanged",i)}},[t,n]),a},it=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ut=t=>{const u=t.split("/").filter(i=>i.length>0).map(i=>i.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},st=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,a)=>{const u=ut(n),i=it(a);return`${u}${i}`},lt=t=>{if(t)return(t==null?void 0:t.reduce((n,a)=>(n[a]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ft=t=>(Array.isArray(t)?t:[t]).reduce((a,u)=>{const{output:i,operationsToGenerateInfiniteQueryHook:l,input:f="./openapi.json"}=u||{},v=st(f);return{...a,[v]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:f,output:{baseUrl:i==null?void 0:i.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:lt(l)},header:c=>["Generated by orval 🍺",...c.title?[c.title]:[],...c.description?[c.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,query:{useQuery:!0}},schemas:(i==null?void 0:i.schemas)||`src/api/${v}/model`,target:(i==null?void 0:i.target)||`src/api/${v}/services/api.ts`,...i}}}},{}),dt=t=>{const n="moduleFetchError";throw t.message.includes("Failed to fetch dynamically imported module")&&(document.cookie.split(";").some(u=>u.trim().startsWith(`${n}=`))||(document.cookie=`${n}=true; max-age=60; path=/`,window.location.reload())),t};w.GTMSendPageView=Ue,w.InitializeAxiosConfig=Be,w.InitializeDaysJSConfig=He,w.InitializeI18nConfig=Ge,w.InitializeMapBoxConfig=Xe,w.InitializeSentryConfig=Qe,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=ze,w.MaskTextField=Je,w.QueryClientProviderWithConfig=$e,w.RequireAuth=Ve,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ft,w.handleImportModuleError=dt,w.useAdapter=ot,w.useAuth=tt,w.useCurrentLanguage=at,w.useInfiniteDataGrid=et,w.useResponseError=qe,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
25
+ Check the top-level render call using <`+a+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=It(r);if(De[a])return;De[a]=!0;var v="";e&&e._owner&&e._owner!==ie.current&&(v=" It was passed a child from "+L(e._owner.type)+"."),V(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,v),V(null)}}function Le(e,r){{if(typeof e!="object")return;if(oe(e))for(var a=0;a<e.length;a++){var v=e[a];ce(v)&&Fe(v,r)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var R=x(e);if(typeof R=="function"&&R!==e.entries)for(var w=R.call(e),y;!(y=w.next()).done;)ce(y.value)&&Fe(y.value,r)}}}function Dt(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))a=r.propTypes;else return;if(a){var v=L(r);wt(a,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!se){se=!0;var R=L(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ft(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var v=r[a];if(v!=="children"&&v!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ne(e,r,a,v,R,w){{var y=vt(e);if(!y){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 O=kt();O?g+=O:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(L(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,g)}var S=At(e,r,a,R,w);if(S==null)return S;if(y){var I=r.children;if(I!==void 0)if(v)if(oe(I)){for(var U=0;U<I.length;U++)Le(I[U],e);Object.freeze&&Object.freeze(I)}else b("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 Le(I,e)}return e===s?Ft(S):Dt(S),S}}function Lt(e,r,a){return Ne(e,r,a,!0)}function Nt(e,r,a){return Ne(e,r,a,!1)}var Wt=Nt,Yt=Lt;G.Fragment=s,G.jsx=Wt,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ye():ee.exports=Me();var F=ee.exports;const A=m.createContext({}),ze=({children:t,apiURL:n,libraries:o})=>{const s=m.useMemo(()=>({apiURL:n,libraries:o}),[n,o]);return F.jsx(A.Provider,{value:s,children:t})},Ve=({Fallback:t,isLogged:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:i="/login",...f})=>{var b,W,Y,M;const{libraries:l}=m.useContext(A),d=(f==null?void 0:f.reactRouter)||(l==null?void 0:l.reactRouter),u=(f==null?void 0:f.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[h,E]=m.useState(null),{useLocation:_,Navigate:p,Outlet:c}=d,T=_(),k=m.useRef(!1),x=typeof n=="function"?n():!!n,D=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return m.useEffect(()=>{k.current||(k.current=!0,u.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(s),E(i)),Promise.reject(j)}))},[u.defaults.headers.common,u.interceptors.response,s,i]),D&&!h?F.jsx(m.Suspense,{fallback:t,children:(W=(b=T.state)==null?void 0:b.from)!=null&&W.state&&((M=(Y=T.state)==null?void 0:Y.from)==null?void 0:M.pathname)===o?F.jsx(p,{to:T.state.from.state.from.pathname+T.state.from.state.from.search,replace:!0}):F.jsx(c,{})}):F.jsx(p,{to:o+T.search,state:{from:T},replace:!0})},Ue=({...t})=>{const{libraries:n}=m.useContext(A),o=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),s=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!o)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!s)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:i}=s,{useLocation:f,Outlet:l}=o,{pathname:d}=f(),{sendEvent:u}=i();return m.useEffect(()=>{u({event:"pageView",pathname:d})},[d,u]),F.jsx(l,{})},Be=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:o="accessToken",postContentType:s="application/json",...i})=>{const{apiURL:f=i.apiURL,libraries:l}=m.useContext(A),d=(i==null?void 0:i.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(d!=null&&d.defaults))return null;const u=localStorage.getItem(n),h=u?JSON.parse(u):null,E=h!=null&&h[t]?h[t]:null,_=h!=null&&h[o]?h[o]:null,p=u?`${E} ${_}`:null;return d.defaults.baseURL=f,d.defaults.headers.post["Content-Type"]=s,p&&(d.defaults.headers.common.Authorization=p),null},Ge=({debug:t,resources:n,...o})=>{const{libraries:s}=m.useContext(A),i=(o==null?void 0:o.i18)||(s==null?void 0:s.i18),{i18next:f,initReactI18next:l,languageDetector:d}=i||{};if(!i)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return f!=null&&f.isInitialized||(f.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==f.resolvedLanguage&&f.resolvedLanguage&&document.documentElement.setAttribute("lang",f.resolvedLanguage)}),f.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Qe=({dsn:t,integrations:n,tracesSampleRate:o,replaysSessionSampleRate:s,replaysOnErrorSampleRate:i,tracePropagationTargets:f,ignoreErrors:l,debug:d,environment:u,...h})=>{const{libraries:E}=m.useContext(A),_=(h==null?void 0:h.sentry)||(E==null?void 0:E.sentry),p=(h==null?void 0:h.reactRouter)||(E==null?void 0:E.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!p)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:c,matchRoutes:T,useLocation:k,useNavigationType:x}=p;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...l||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:c,matchRoutes:T,useEffect:m.useEffect,useLocation:k,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:i||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},Je=({IMaskMixin:t,...n})=>{const o=m.useMemo(()=>t(({TextField:s,...i})=>F.jsx(s,{...i})),[t]);return F.jsx(o,{...n})},Ke=({accessToken:t,...n})=>{const{libraries:o}=m.useContext(A),s=(n==null?void 0:n.mapbox)||(o==null?void 0:o.mapbox);if(!s)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(s.accessToken=t),null},Xe=({language:t,...n})=>{const{libraries:o}=m.useContext(A),s=(n==null?void 0:n.dayjs)||(o==null?void 0:o.dayjs),i=(n==null?void 0:n.plugin)||(o==null?void 0:o.dayjsPlugin);if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return m.useEffect(()=>{(async()=>{var d;const l=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";i&&i.forEach(u=>{u&&s.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),s.locale(l)})().then()},[s,i,t]),null},He=t=>t&&typeof t=="function",Ze=t=>t&&typeof t=="function",$e=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:o,...s})=>{var u,h;const{libraries:i}=m.useContext(A),f=(s==null?void 0:s.QueryClient)||((u=i==null?void 0:i.reactQuery)==null?void 0:u.QueryClient),l=(s==null?void 0:s.QueryClientProvider)||((h=i==null?void 0:i.reactQuery)==null?void 0:h.QueryClientProvider);if(!f)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!l)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ze(f))throw new Error("Provided QueryClient dependencies are not valid.");const d=new f({defaultOptions:{mutations:{...o},queries:{getNextPageParam:(E,_,p)=>E.length+(p||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(l,{client:d,children:t})},qe=t=>{var h,E,_;const{libraries:n}=m.useContext(A),o=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((h=t==null?void 0:t.i18)==null?void 0:h.translateFunction)||((E=n==null?void 0:n.i18)==null?void 0:E.translateFunction),i=((_=o==null?void 0:o.i18next)==null?void 0:_.t)||s||(p=>p),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=i(f),d=m.useCallback(p=>{var T,k,x,D,b,W,Y,M,j;const{response:c}=p||{};return c!=null&&c.reason?String(c.reason):(T=c==null?void 0:c.data)!=null&&T.reason?String(c.data.reason):(k=c==null?void 0:c.data)!=null&&k.message?String(c.data.message):(D=(x=c==null?void 0:c.data)==null?void 0:x.detail)!=null&&D.length&&Array.isArray((b=c==null?void 0:c.data)==null?void 0:b.detail)&&((Y=(W=c==null?void 0:c.data)==null?void 0:W.detail[0])!=null&&Y.msg)&&typeof((j=(M=c==null?void 0:c.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(c.data.detail[0].msg):l},[l]);return{getErrorCode:m.useCallback(p=>{var T,k,x;const{response:c}=p||{};return c!=null&&c.error_code?String(c==null?void 0:c.error_code):(T=c==null?void 0:c.data)!=null&&T.error_code?String((k=c==null?void 0:c.data)==null?void 0:k.error_code):c!=null&&c.error_code?String(c==null?void 0:c.error_code):(x=c==null?void 0:c.data)!=null&&x.error_code?String(c.data.error_code):"unknown_error_code"},[]),printError:d}},et=({data:t,fetchNextPage:n,isFetchingNextPage:o,isInitialLoading:s,isLoading:i,enabled:f=!0})=>{const l=m.useCallback(async u=>{o||!f||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[f,n,o]),d=m.useMemo(()=>{if(t)return t.pages.reduce((u,h)=>[...u,...h],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||i,loadingVariant:s?"skeleton":"linear",rows:d}},tt=t=>{const{libraries:n}=m.useContext(A),o=(t==null?void 0:t.axios)||(n==null?void 0:n.axios),s=(t==null?void 0:t.localStorageKey)||"user";if(!o)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const i=m.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return m.useEffect(()=>{const l=({newValue:d,key:u})=>{if(u===s){const{accessToken:h,tokenType:E}=d&&JSON.parse(d);i({accessToken:h,tokenType:E})}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[s,i]),{clearAuthenticationToken:f,setAuthenticationToken:i}},fe=({library:t,date:n,format:o="ll"})=>t(n).format(o),de=(t,n="km")=>{const o=Number(t);return Number.isNaN(o)?`0 ${n}`:`${o.toFixed(2)} ${n}`},rt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,nt=({path:t,size:n,apiURL:o})=>{if(!t)return"";const s=rt(t),i=`${o}${s}`,f=i.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&f?`${i.replace("/files",`/thumbs/${n}`)}`:i},ot=t=>{const{apiURL:n,libraries:o}=m.useContext(A),s=(t==null?void 0:t.dayjs)||(o==null?void 0:o.dayjs);return{dateAdapter:(l,d)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:l,format:d,library:s})},distanceAdapter:de,filePathAdapter:(l,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return nt({apiURL:n,path:l,size:d})}}},ve=(t,n)=>n==="short"?t.split("-")[0]:t,at=(t,n="full")=>{const[o,s]=m.useState(()=>ve((t==null?void 0:t.language)||navigator.language,n));return m.useEffect(()=>{var f;const i=l=>{s(ve(l,n))};return(f=t==null?void 0:t.on)==null||f.call(t,"languageChanged",i),()=>{var l;(l=t==null?void 0:t.off)==null||l.call(t,"languageChanged",i)}},[t,n]),o},it=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),st=t=>{const s=t.split("/").filter(i=>i.length>0).map(i=>i.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},ct=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ut=(t,n,o)=>{const s=st(n),i=it(o);return`${s}${i}`},lt=t=>{if(t)return(t==null?void 0:t.reduce((n,o)=>(n[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ft=t=>(Array.isArray(t)?t:[t]).reduce((o,s)=>{const{output:i,operationsToGenerateInfiniteQueryHook:f,input:l="./openapi.json"}=s||{},d=ct(l);return{...o,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:l,output:{baseUrl:i==null?void 0:i.baseUrl,client:"react-query",mode:"tags-split",override:{...(f==null?void 0:f.length)&&{operations:lt(f)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ut,query:{useQuery:!0}},schemas:(i==null?void 0:i.schemas)||`src/api/${d}/model`,target:(i==null?void 0:i.target)||`src/api/${d}/services/api.ts`,...i}}}},{}),dt=t=>{const n="moduleFetchError";throw t.message.includes("Failed to fetch dynamically imported module")&&(document.cookie.split(";").some(s=>s.trim().startsWith(`${n}=`))||(document.cookie=`${n}=true; max-age=60; path=/`,window.location.reload())),t};C.GTMSendPageView=Ue,C.InitializeAxiosConfig=Be,C.InitializeDaysJSConfig=Xe,C.InitializeI18nConfig=Ge,C.InitializeMapBoxConfig=Ke,C.InitializeSentryConfig=Qe,C.InjectDependenciesContext=A,C.InjectDependenciesProvider=ze,C.MaskTextField=Je,C.QueryClientProviderWithConfig=$e,C.RequireAuth=Ve,C.dateAdapter=fe,C.distanceAdapter=de,C.getOrvalConfig=ft,C.handleImportModuleError=dt,C.useAdapter=ot,C.useAuth=tt,C.useCurrentLanguage=at,C.useInfiniteDataGrid=et,C.useResponseError=qe,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",