@tracktor/shared-module 2.1.2 → 2.1.4

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