@tracktor/shared-module 0.23.3 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(b,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(b=typeof globalThis<"u"?globalThis:b||self,E(b["@tracktor/shared-module"]={},b.React))})(this,function(b,E){"use strict";var q={exports:{}},Y={};/**
1
+ (function(v,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("axios"),require("react-router-dom"),require("@tracktor/react-google-tag-manager"),require("i18next"),require("i18next-browser-languagedetector"),require("react-i18next"),require("@sentry/react"),require("mapbox-gl"),require("@tanstack/react-query"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","axios","react-router-dom","@tracktor/react-google-tag-manager","i18next","i18next-browser-languagedetector","react-i18next","@sentry/react","mapbox-gl","@tanstack/react-query","dayjs"],E):(v=typeof globalThis<"u"?globalThis:v||self,E(v["@tracktor/shared-module"]={},v.React,v.axios,v.reactRouterDom,v.reactGoogleTagManager,v.i18n,v.LanguageDetector,v.reactI18next,v.Sentry,v.mapbox,v.reactQuery,v.dayjs))})(this,function(v,E,P,k,Me,A,We,Ve,Ye,se,Ue,ze){"use strict";function Be(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(a,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}return a.default=n,Object.freeze(a)}const Q=Be(Ye);var Z={exports:{}},V={};/**
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 Ne(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var t=E,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),n=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),s=1;s<r;s++)a[s-1]=arguments[s];w("error",e,a)}}function w(e,r,a){{var s=k.ReactDebugCurrentFrame,g=s.getStackAddendum();g!==""&&(r+="%s",a=a.concat([g]));var p=a.map(function(d){return String(d)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var fe=!1,de=!1,$=!1,or=!1,ir=!1,ve;ve=Symbol.for("react.module.reference");function ur(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===v||ir||e===c||e===h||e===m||or||e===O||fe||de||$||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===S||e.$$typeof===y||e.$$typeof===n||e.$$typeof===l||e.$$typeof===ve||e.getModuleId!==void 0))}function sr(e,r,a){var s=e.displayName;if(s)return s;var g=r.displayName||r.name||"";return g!==""?a+"("+g+")":a}function ge(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case i:return"Portal";case v:return"Profiler";case c:return"StrictMode";case h:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n:var r=e;return ge(r)+".Consumer";case y:var a=e;return ge(a._context)+".Provider";case l:return sr(e,e.render,"ForwardRef");case S:var s=e.displayName||null;return s!==null?s:x(e.type)||"Memo";case j:{var g=e,p=g._payload,d=g._init;try{return x(d(p))}catch{return null}}}return null}var N=Object.assign,z=0,pe,me,he,Ee,ye,be,Re;function _e(){}_e.__reactDisabledLog=!0;function cr(){{if(z===0){pe=console.log,me=console.info,he=console.warn,Ee=console.error,ye=console.group,be=console.groupCollapsed,Re=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})}z++}}function lr(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:pe}),info:N({},e,{value:me}),warn:N({},e,{value:he}),error:N({},e,{value:Ee}),group:N({},e,{value:ye}),groupCollapsed:N({},e,{value:be}),groupEnd:N({},e,{value:Re})})}z<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=k.ReactCurrentDispatcher,re;function J(e,r,a){{if(re===void 0)try{throw Error()}catch(g){var s=g.stack.trim().match(/\n( *(at )?)/);re=s&&s[1]||""}return`
10
- `+re+e}}var te=!1,X;{var fr=typeof WeakMap=="function"?WeakMap:Map;X=new fr}function Ce(e,r){if(!e||te)return"";{var a=X.get(e);if(a!==void 0)return a}var s;te=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=ee.current,ee.current=null,cr();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){s=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){s=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){s=D}e()}}catch(D){if(D&&s&&typeof D.stack=="string"){for(var f=D.stack.split(`
11
- `),T=s.stack.split(`
12
- `),R=f.length-1,_=T.length-1;R>=1&&_>=0&&f[R]!==T[_];)_--;for(;R>=1&&_>=0;R--,_--)if(f[R]!==T[_]){if(R!==1||_!==1)do if(R--,_--,_<0||f[R]!==T[_]){var P=`
13
- `+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,P),P}while(R>=1&&_>=0);break}}}finally{te=!1,ee.current=p,lr(),Error.prepareStackTrace=g}var V=e?e.displayName||e.name:"",Le=V?J(V):"";return typeof e=="function"&&X.set(e,Le),Le}function dr(e,r,a){return Ce(e,!1)}function vr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function H(e,r,a){if(e==null)return"";if(typeof e=="function")return Ce(e,vr(e));if(typeof e=="string")return J(e);switch(e){case h:return J("Suspense");case m:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return dr(e.render);case S:return H(e.type,r,a);case j:{var s=e,g=s._payload,p=s._init;try{return H(p(g),r,a)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,we={},Te=k.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(a)}else Te.setExtraStackFrame(null)}function gr(e,r,a,s,g){{var p=Function.call.bind(K);for(var d in e)if(p(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((s||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,s,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f instanceof Error)&&(Z(g),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",a,d,typeof f),Z(null)),f instanceof Error&&!(f.message in we)&&(we[f.message]=!0,Z(g),C("Failed %s type: %s",a,f.message),Z(null))}}}var pr=Array.isArray;function ne(e){return pr(e)}function mr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function hr(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function Oe(e){if(hr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mr(e)),Se(e)}var B=k.ReactCurrentOwner,Er={key:!0,ref:!0,__self:!0,__source:!0},je,Pe,ae;ae={};function yr(e){if(K.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function br(e){if(K.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Rr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var a=x(B.current.type);ae[a]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(B.current.type),e.ref),ae[a]=!0)}}function _r(e,r){{var a=function(){je||(je=!0,C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function Cr(e,r){{var a=function(){Pe||(Pe=!0,C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var wr=function(e,r,a,s,g,p,d){var f={$$typeof:o,type:e,key:r,ref:a,props:d,_owner:p};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function Tr(e,r,a,s,g){{var p,d={},f=null,T=null;a!==void 0&&(Oe(a),f=""+a),br(r)&&(Oe(r.key),f=""+r.key),yr(r)&&(T=r.ref,Rr(r,g));for(p in r)K.call(r,p)&&!Er.hasOwnProperty(p)&&(d[p]=r[p]);if(e&&e.defaultProps){var R=e.defaultProps;for(p in R)d[p]===void 0&&(d[p]=R[p])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&_r(d,_),T&&Cr(d,_)}return wr(e,f,T,g,s,B.current,d)}}var oe=k.ReactCurrentOwner,Ae=k.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(a)}else Ae.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
9
+ */var ce;function $e(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var n=E,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),N=Symbol.iterator,U="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=N&&e[N]||e[U];return typeof r=="function"?r:null}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];dr("error",e,t)}}function dr(e,r,t){{var u=L.ReactDebugCurrentFrame,p=u.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var g=t.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var vr=!1,pr=!1,gr=!1,mr=!1,hr=!1,pe;pe=Symbol.for("react.module.reference");function yr(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===_||hr||e===m||e===C||e===y||mr||e===h||vr||pr||gr||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===T||e.$$typeof===o||e.$$typeof===l||e.$$typeof===c||e.$$typeof===pe||e.getModuleId!==void 0))}function Er(e,r,t){var u=e.displayName;if(u)return u;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ge(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&S("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 i:return"Portal";case _:return"Profiler";case m:return"StrictMode";case C:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var r=e;return ge(r)+".Consumer";case o:var t=e;return ge(t._context)+".Provider";case c:return Er(e,e.render,"ForwardRef");case T:var u=e.displayName||null;return u!==null?u:F(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return F(d(g))}catch{return null}}}return null}var I=Object.assign,z=0,me,he,ye,Ee,be,_e,Re;function Ce(){}Ce.__reactDisabledLog=!0;function br(){{if(z===0){me=console.log,he=console.info,ye=console.warn,Ee=console.error,be=console.group,_e=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function _r(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:me}),info:I({},e,{value:he}),warn:I({},e,{value:ye}),error:I({},e,{value:Ee}),group:I({},e,{value:be}),groupCollapsed:I({},e,{value:_e}),groupEnd:I({},e,{value:Re})})}z<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=L.ReactCurrentDispatcher,re;function q(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);re=u&&u[1]||""}return`
10
+ `+re+e}}var te=!1,J;{var Rr=typeof WeakMap=="function"?WeakMap:Map;J=new Rr}function Te(e,r){if(!e||te)return"";{var t=J.get(e);if(t!==void 0)return t}var u;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=ee.current,ee.current=null,br();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){u=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){u=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){u=D}e()}}catch(D){if(D&&u&&typeof D.stack=="string"){for(var f=D.stack.split(`
11
+ `),O=u.stack.split(`
12
+ `),b=f.length-1,R=O.length-1;b>=1&&R>=0&&f[b]!==O[R];)R--;for(;b>=1&&R>=0;b--,R--)if(f[b]!==O[R]){if(b!==1||R!==1)do if(b--,R--,R<0||f[b]!==O[R]){var w=`
13
+ `+f[b].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,w),w}while(b>=1&&R>=0);break}}}finally{te=!1,ee.current=g,_r(),Error.prepareStackTrace=p}var W=e?e.displayName||e.name:"",Le=W?q(W):"";return typeof e=="function"&&J.set(e,Le),Le}function Cr(e,r,t){return Te(e,!1)}function Tr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return Te(e,Tr(e));if(typeof e=="string")return q(e);switch(e){case C:return q("Suspense");case y:return q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Cr(e.render);case T:return X(e.type,r,t);case j:{var u=e,p=u._payload,g=u._init;try{return X(g(p),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Se={},Oe=L.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}function Sr(e,r,t,u,p){{var g=Function.call.bind(H);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var O=Error((u||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}f=e[d](r,d,u,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){f=b}f&&!(f instanceof Error)&&(K(p),S("%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).",u||"React class",t,d,typeof f),K(null)),f instanceof Error&&!(f.message in Se)&&(Se[f.message]=!0,K(p),S("Failed %s type: %s",t,f.message),K(null))}}}var Or=Array.isArray;function ne(e){return Or(e)}function jr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function wr(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function we(e){if(wr(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jr(e)),je(e)}var B=L.ReactCurrentOwner,Pr={key:!0,ref:!0,__self:!0,__source:!0},Pe,ke,ae;ae={};function kr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ar(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function xr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=F(B.current.type);ae[t]||(S('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',F(B.current.type),e.ref),ae[t]=!0)}}function Fr(e,r){{var t=function(){Pe||(Pe=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Dr(e,r){{var t=function(){ke||(ke=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Ir=function(e,r,t,u,p,g,d){var f={$$typeof:a,type:e,key:r,ref:t,props:d,_owner:g};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function Nr(e,r,t,u,p){{var g,d={},f=null,O=null;t!==void 0&&(we(t),f=""+t),Ar(r)&&(we(r.key),f=""+r.key),kr(r)&&(O=r.ref,xr(r,p));for(g in r)H.call(r,g)&&!Pr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var b=e.defaultProps;for(g in b)d[g]===void 0&&(d[g]=b[g])}if(f||O){var R=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Fr(d,R),O&&Dr(d,R)}return Ir(e,f,O,p,u,B.current,d)}}var oe=L.ReactCurrentOwner,Ae=L.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(t)}else Ae.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function xe(){{if(oe.current){var e=F(oe.current.type);if(e)return`
14
14
 
15
- Check the render method of \``+e+"`."}return""}}function Sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`
15
+ Check the render method of \``+e+"`."}return""}}function Lr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
16
16
 
17
- Check your code at `+r+":"+a+"."}return""}}var xe={};function Or(e){{var r=ke();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
17
+ Check your code at `+r+":"+t+"."}return""}}var Fe={};function Mr(e){{var r=xe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
18
18
 
19
- Check the top-level render call using <`+a+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Or(r);if(xe[a])return;xe[a]=!0;var s="";e&&e._owner&&e._owner!==oe.current&&(s=" It was passed a child from "+x(e._owner.type)+"."),M(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,s),M(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ne(e))for(var a=0;a<e.length;a++){var s=e[a];ue(s)&&De(s,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var g=L(e);if(typeof g=="function"&&g!==e.entries)for(var p=g.call(e),d;!(d=p.next()).done;)ue(d.value)&&De(d.value,r)}}}function jr(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===l||r.$$typeof===S))a=r.propTypes;else return;if(a){var s=x(r);gr(a,e.props,"prop",s,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var g=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",g||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pr(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var s=r[a];if(s!=="children"&&s!=="key"){M(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),M(null);break}}e.ref!==null&&(M(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Ie(e,r,a,s,g,p){{var d=ur(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=Sr(g);T?f+=T:f+=ke();var R;e===null?R="null":ne(e)?R="array":e!==void 0&&e.$$typeof===o?(R="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,f)}var _=Tr(e,r,a,g,p);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(s)if(ne(P)){for(var V=0;V<P.length;V++)Fe(P[V],e);Object.freeze&&Object.freeze(P)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(P,e)}return e===u?Pr(_):jr(_),_}}function Ar(e,r,a){return Ie(e,r,a,!0)}function kr(e,r,a){return Ie(e,r,a,!1)}var xr=kr,Dr=Ar;Y.Fragment=u,Y.jsx=xr,Y.jsxs=Dr}()),Y}var U={};/**
19
+ Check the top-level render call using <`+t+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Mr(r);if(Fe[t])return;Fe[t]=!0;var u="";e&&e._owner&&e._owner!==oe.current&&(u=" It was passed a child from "+F(e._owner.type)+"."),M(e),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,u),M(null)}}function Ie(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var u=e[t];ue(u)&&De(u,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)ue(d.value)&&De(d.value,r)}}}function Wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===T))t=r.propTypes;else return;if(t){var u=F(r);Sr(t,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=F(r);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var u=r[t];if(u!=="children"&&u!=="key"){M(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),M(null);break}}e.ref!==null&&(M(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Ne(e,r,t,u,p,g){{var d=yr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" 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=Lr(p);O?f+=O:f+=xe();var b;e===null?b="null":ne(e)?b="array":e!==void 0&&e.$$typeof===a?(b="<"+(F(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,f)}var R=Nr(e,r,t,p,g);if(R==null)return R;if(d){var w=r.children;if(w!==void 0)if(u)if(ne(w)){for(var W=0;W<w.length;W++)Ie(w[W],e);Object.freeze&&Object.freeze(w)}else S("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 Ie(w,e)}return e===s?Vr(R):Wr(R),R}}function Yr(e,r,t){return Ne(e,r,t,!0)}function Ur(e,r,t){return Ne(e,r,t,!1)}var zr=Ur,Br=Yr;V.Fragment=s,V.jsx=zr,V.jsxs=Br}()),V}var Y={};/**
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 <`+a+">.")}return r}}function De(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 ce;function We(){if(ce)return U;ce=1;var t=E,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function y(n,l,h){var m,S={},j=null,O=null;h!==void 0&&(j=""+h),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(O=l.ref);for(m in l)u.call(l,m)&&!v.hasOwnProperty(m)&&(S[m]=l[m]);if(n&&n.defaultProps)for(m in l=n.defaultProps,l)S[m]===void 0&&(S[m]=l[m]);return{$$typeof:o,type:n,key:j,ref:O,props:S,_owner:c.current}}return U.Fragment=i,U.jsx=y,U.jsxs=y,U}process.env.NODE_ENV==="production"?q.exports=We():q.exports=Ne();var A=q.exports;const W=E.createContext({apiURL:void 0,axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Me=({axios:t,children:o,translate:i,useAuth:u,Outlet:c,Navigate:v,useLocation:y,useGoogleTagManager:n,apiURL:l})=>{const h=E.useMemo(()=>({apiURL:l,axios:t,Navigate:v,Outlet:c,translate:i,useAuth:u,useGoogleTagManager:n,useLocation:y}),[v,c,l,t,i,u,n,y]);return A.jsx(W.Provider,{value:h,children:o})},G=t=>`RequireAuth require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({Fallback:t,loginPath:o="/login",localStorageKey:i="user",redirect401Path:u="/login",...c})=>{var I,L,k,C;const{axios:v=c.axios,useLocation:y=c.useLocation,useAuth:n=c.useAuth,Outlet:l=c.Outlet,Navigate:h=c.Navigate}=E.useContext(W);if(n===void 0)throw new Error(G("useAuth"));if(y===void 0)throw new Error(G("useLocation"));if(l===void 0)throw new Error(G("Outlet"));if(h===void 0)throw new Error(G("Navigate"));const[m,S]=E.useState(null),{isLogged:j}=n(),O=y(),F=E.useRef(!1);return E.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var $;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&(($=w==null?void 0:w.response)==null?void 0:$.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(i),S(u)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,i,u]),j&&!m?A.jsx(E.Suspense,{fallback:t,children:(L=(I=O.state)==null?void 0:I.from)!=null&&L.state&&((C=(k=O.state)==null?void 0:k.from)==null?void 0:C.pathname)===o?A.jsx(h,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):A.jsx(l,{})}):A.jsx(h,{to:o,state:{from:O},replace:!0})},Q=t=>`GTMSendPageView require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({...t})=>{const{useLocation:o=t.useLocation,Outlet:i=t.Outlet,useGoogleTagManager:u=t.useGoogleTagManager}=E.useContext(W);if(o===void 0)throw new Error(Q("useLocation"));if(i===void 0)throw new Error(Q("Outlet"));if(u===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:c}=o(),{sendEvent:v}=u();return E.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),A.jsx(i,{})},Ue=({axios:t,baseURL:o,tokenTypeKey:i="tokenType",userLocalStorageKey:u="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!t.defaults)return null;const y=localStorage.getItem(u),n=y?JSON.parse(y):null,l=n!=null&&n[i]?n[i]:null,h=n!=null&&n[c]?n[c]:null,m=y?`${l} ${h}`:null;return t.defaults.baseURL=o,t.defaults.headers.post["Content-Type"]=v,m&&(t.defaults.headers.common.Authorization=m),null},ze=({i18n:t,debug:o,initReactI18next:i,resources:u,LanguageDetector:c})=>(t!=null&&t.isInitialized||(t.use(c).use(i).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==t.resolvedLanguage&&t.resolvedLanguage&&document.documentElement.setAttribute("lang",t.resolvedLanguage)}),t.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Be=({dsn:t,sentry:o,integrations:i,tracesSampleRate:u,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:y,tracePropagationTargets:n,ignoreErrors:l,debug:h,environment:m})=>(o.isInitialized()||(h||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:h,dsn:t,environment:m||"production",ignoreErrors:[...l||[],/dynamically imported module/],integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),o.replayIntegration(),...i||[]],replaysOnErrorSampleRate:y||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:n,tracesSampleRate:u||1}),null),Ge=({IMaskMixin:t,...o})=>{const i=E.useMemo(()=>t(({TextField:u,...c})=>A.jsx(u,{...c})),[t]);return A.jsx(i,{...o})},$e=({mapbox:t,accessToken:o})=>(t&&o&&(t.accessToken=o),null),Je=({children:t,defaultOptions:o,QueryClient:i,QueryClientProvider:u})=>{const c=new i({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return A.jsx(u,{client:c,children:t})},Xe=t=>{const{unknownErrorTranslationKey:o="error.unknownError"}=t||{},{translate:i=t==null?void 0:t.translate}=E.useContext(W),u=i?i(o):"Unknown error",c=E.useCallback(y=>{var l,h,m,S,j,O,F,I,L;const{response:n}=y||{};return n!=null&&n.reason?String(n.reason):(l=n==null?void 0:n.data)!=null&&l.reason?String(n.data.reason):(h=n==null?void 0:n.data)!=null&&h.message?String(n.data.message):(S=(m=n==null?void 0:n.data)==null?void 0:m.detail)!=null&&S.length&&Array.isArray((j=n==null?void 0:n.data)==null?void 0:j.detail)&&((F=(O=n==null?void 0:n.data)==null?void 0:O.detail[0])!=null&&F.msg)&&typeof((L=(I=n==null?void 0:n.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(n.data.detail[0].msg):u},[u]);return{getErrorCode:E.useCallback(y=>{var l,h,m;const{response:n}=y||{};return n!=null&&n.error_code?String(n==null?void 0:n.error_code):(l=n==null?void 0:n.data)!=null&&l.error_code?String((h=n==null?void 0:n.data)==null?void 0:h.error_code):n!=null&&n.error_code?String(n==null?void 0:n.error_code):(m=n==null?void 0:n.data)!=null&&m.error_code?String(n.data.error_code):"unknown_error_code"},[]),printError:c}},He=({data:t,fetchNextPage:o,isFetchingNextPage:i,isInitialLoading:u,isLoading:c,enabled:v=!0})=>{const y=E.useCallback(async l=>{i||!v||await o({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,o,i]),n=E.useMemo(()=>{if(t)return t.pages.reduce((l,h)=>[...l,...h],[])},[t]);return{fetchNextPageOnRowsScrollEnd:y,isLoading:i||c,loadingVariant:u?"skeleton":"linear",rows:n}},Ke=t=>{const o=E.useCallback(({tokenType:u,accessToken:c})=>{t.defaults.headers.common.Authorization=`${u} ${c}`},[t.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{t.defaults.headers.common.Authorization=null},[t.defaults.headers.common]),setAuthenticationToken:o}},Ze=(t,o="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${o}`:`${i.toFixed(2)} ${o}`},qe=t=>{const o=t&&typeof t=="object"&&"pathname"in t&&t.pathname?t.pathname:t;return typeof o=="string"?o!=null&&o.startsWith("/")?o!=null&&o.startsWith("/files")?o:`/files${o}`:o!=null&&o.startsWith("files")?`/${o}`:o!=null&&o.startsWith("files")?`/${o}`:`/files/${o}`:o},le=(t,o)=>{if(!t)return"";const i=qe(t),u=typeof t=="object"&&"pathname"in t?`${t.origin}${i}`:t;return typeof o=="number"?`${u.replace("/files",`/thumbs/${o}`)}`:u},Qe=()=>{const{apiURL:t}=E.useContext(W);return{distanceAdapter:Ze,filePathAdapter:(i,u)=>le(t&&typeof i=="string"?{origin:t,pathname:i}:i,u)}},er=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),rr=t=>{const u=t.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},tr=(t,o,i)=>{const u=rr(o),c=er(i);return`${u}${c}`},nr=t=>{if(t)return(t==null?void 0:t.reduce((o,i)=>(o[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},o),{}))||{}},ar=t=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=t||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:tr,...(i==null?void 0:i.length)&&{operations:nr(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};b.AxiosConfig=Ue,b.GTMSendPageView=Ye,b.I18nConfig=ze,b.InjectDependenciesContext=W,b.InjectDependenciesProvider=Me,b.MapBoxConfig=$e,b.MaskTextField=Ge,b.QueryClientConfigProvider=Je,b.RequireAuth=Ve,b.SentryConfig=Be,b.getOrvalConfig=ar,b.useAdapter=Qe,b.useAuth=Ke,b.useInfiniteDataGrid=He,b.useResponseError=Xe,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
27
+ */var le;function Ge(){if(le)return Y;le=1;var n=E,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,m=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,C){var y,T={},j=null,h=null;C!==void 0&&(j=""+C),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(h=c.ref);for(y in c)s.call(c,y)&&!_.hasOwnProperty(y)&&(T[y]=c[y]);if(l&&l.defaultProps)for(y in c=l.defaultProps,c)T[y]===void 0&&(T[y]=c[y]);return{$$typeof:a,type:l,key:j,ref:h,props:T,_owner:m.current}}return Y.Fragment=i,Y.jsx=o,Y.jsxs=o,Y}process.env.NODE_ENV==="production"?Z.exports=Ge():Z.exports=$e();var x=Z.exports;const qe=({Fallback:n,loginPath:a="/login",localStorageKey:i="user",redirect401Path:s="/login",isLogged:m})=>{var C,y,T,j;const[_,o]=E.useState(null),l=k.useLocation(),c=E.useRef(!1);return E.useLayoutEffect(()=>{c.current||(c.current=!0,P==null||P.interceptors.response.use(h=>h,async h=>{var G;return typeof h=="object"&&h&&"response"in h&&h.response&&typeof h.response=="object"&&"status"in h.response&&h.response&&typeof h.response=="object"&&"status"in h.response&&((G=h==null?void 0:h.response)==null?void 0:G.status)===401&&(P.defaults.headers.common.Authorization=null,localStorage.removeItem(i),o(s)),Promise.reject(h)}))},[i,s]),m&&!_?x.jsx(E.Suspense,{fallback:n,children:(y=(C=l.state)==null?void 0:C.from)!=null&&y.state&&((j=(T=l.state)==null?void 0:T.from)==null?void 0:j.pathname)===a?x.jsx(k.Navigate,{to:l.state.from.state.from.pathname+l.state.from.state.from.search,replace:!0}):x.jsx(k.Outlet,{})}):x.jsx(k.Navigate,{to:a,state:{from:l},replace:!0})},Je=()=>{const{pathname:n}=k.useLocation(),{sendEvent:a}=Me.useGoogleTagManager();return E.useEffect(()=>{a({event:"pageView",pathname:n})},[n,a]),x.jsx(k.Outlet,{})},$=E.createContext({apiURL:void 0,children:void 0}),Xe=({children:n,apiURL:a})=>{const i=E.useMemo(()=>({apiURL:a}),[a]);return x.jsx($.Provider,{value:i,children:n})},He=({tokenTypeKey:n="tokenType",userLocalStorageKey:a="user",tokenKey:i="accessToken",postContentType:s="application/json",...m})=>{const{apiURL:_=m.baseURL}=E.useContext($);if(!P.defaults)return null;const o=localStorage.getItem(a),l=o?JSON.parse(o):null,c=l!=null&&l[n]?l[n]:null,C=l!=null&&l[i]?l[i]:null,y=o?`${c} ${C}`:null;return P.defaults.baseURL=_,P.defaults.headers.post["Content-Type"]=s,y&&(P.defaults.headers.common.Authorization=y),null},Ke=({debug:n,resources:a})=>(A!=null&&A.isInitialized||(A.use(We).use(Ve.initReactI18next).init({debug:n,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:a,returnNull:!1}).then(()=>{document.documentElement.lang!==A.resolvedLanguage&&A.resolvedLanguage&&document.documentElement.setAttribute("lang",A.resolvedLanguage)}),A.on("languageChanged",i=>{document.documentElement.setAttribute("lang",i)})),null),Qe=({dsn:n,integrations:a,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:m,tracePropagationTargets:_,ignoreErrors:o,debug:l,environment:c})=>(Q.isInitialized()||(l||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&Q.init({debug:l,dsn:n,environment:c||"production",ignoreErrors:[...o||[],/dynamically imported module/],integrations:[Q.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:k.createRoutesFromChildren,matchRoutes:k.matchRoutes,useEffect:E.useEffect,useLocation:k.useLocation,useNavigationType:k.useNavigationType}),...a||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:_,tracesSampleRate:i||1}),null),Ze=({IMaskMixin:n,...a})=>{const i=E.useMemo(()=>n(({TextField:s,...m})=>x.jsx(s,{...m})),[n]);return x.jsx(i,{...a})},er=({accessToken:n})=>(se&&n&&(se.accessToken=n),null),rr=({children:n,defaultQueriesOptions:a,defaultMutationsOptions:i,QueryClient:s})=>{const m=new s({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(_,o,l)=>_.length+(l||0),refetchOnWindowFocus:!1,retry:3,...a}}});return x.jsx(Ue.QueryClientProvider,{client:m,children:n})},tr=n=>{const{unknownErrorTranslationKey:a="error.unknownError"}=n||{},i=A.t(a),s=E.useCallback(_=>{var l,c,C,y,T,j,h,N,U;const{response:o}=_||{};return o!=null&&o.reason?String(o.reason):(l=o==null?void 0:o.data)!=null&&l.reason?String(o.data.reason):(c=o==null?void 0:o.data)!=null&&c.message?String(o.data.message):(y=(C=o==null?void 0:o.data)==null?void 0:C.detail)!=null&&y.length&&Array.isArray((T=o==null?void 0:o.data)==null?void 0:T.detail)&&((h=(j=o==null?void 0:o.data)==null?void 0:j.detail[0])!=null&&h.msg)&&typeof((U=(N=o==null?void 0:o.data)==null?void 0:N.detail[0])==null?void 0:U.msg)=="string"?String(o.data.detail[0].msg):i},[i]);return{getErrorCode:E.useCallback(_=>{var l,c,C;const{response:o}=_||{};return o!=null&&o.error_code?String(o==null?void 0:o.error_code):(l=o==null?void 0:o.data)!=null&&l.error_code?String((c=o==null?void 0:o.data)==null?void 0:c.error_code):o!=null&&o.error_code?String(o==null?void 0:o.error_code):(C=o==null?void 0:o.data)!=null&&C.error_code?String(o.data.error_code):"unknown_error_code"},[]),printError:s}},nr=({data:n,fetchNextPage:a,isFetchingNextPage:i,isInitialLoading:s,isLoading:m,enabled:_=!0})=>{const o=E.useCallback(async c=>{i||!_||await a({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[_,a,i]),l=E.useMemo(()=>{if(n)return n.pages.reduce((c,C)=>[...c,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:o,isLoading:i||m,loadingVariant:s?"skeleton":"linear",rows:l}},ar=()=>({clearAuthenticationToken:()=>{P.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:i,accessToken:s})=>{P.defaults.headers.common.Authorization=`${i} ${s}`}}),fe=(n,a="ddd D MMM YY")=>ze(n).format(a),de=(n,a="km")=>{const i=Number(n);return Number.isNaN(i)?`0 ${a}`:`${i.toFixed(2)} ${a}`},or=n=>{const a=n&&typeof n=="object"&&"pathname"in n&&n.pathname?n.pathname:n;return typeof a=="string"?a!=null&&a.startsWith("/")?a!=null&&a.startsWith("/files")?a:`/files${a}`:a!=null&&a.startsWith("files")?`/${a}`:a!=null&&a.startsWith("files")?`/${a}`:`/files/${a}`:a},ve=(n,a)=>{if(!n)return"";const i=or(n),s=typeof n=="object"&&"pathname"in n?`${n.origin}${i}`:n;return typeof a=="number"?`${s.replace("/files",`/thumbs/${a}`)}`:s},ir=()=>{const{apiURL:n}=E.useContext($);return{dateAdapter:fe,distanceAdapter:de,filePathAdapter:(i,s)=>ve(n&&typeof i=="string"?{origin:n,pathname:i}:i,s)}},ur=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),sr=n=>{const s=n.split("/").filter(m=>m.length>0).map(m=>m.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},cr=(n,a,i)=>{const s=sr(a),m=ur(i);return`${s}${m}`},lr=n=>{if(n)return(n==null?void 0:n.reduce((a,i)=>(a[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},a),{}))||{}},fr=n=>{const{input:a="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:a,output:{client:"react-query",mode:"tags-split",override:{header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:cr,...(i==null?void 0:i.length)&&{operations:lr(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};v.AxiosConfig=He,v.GTMSendPageView=Je,v.I18nConfig=Ke,v.InjectDependenciesContext=$,v.InjectDependenciesProvider=Xe,v.MapBoxConfig=er,v.MaskTextField=Ze,v.QueryClientConfigProvider=rr,v.RequireAuth=qe,v.SentryConfig=Qe,v.dateAdapter=fe,v.distanceAdapter=de,v.getOrvalConfig=fr,v.useAdapter=ir,v.useAuth=ar,v.useInfiniteDataGrid=nr,v.useResponseError=tr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
@@ -0,0 +1,8 @@
1
+ import dayjs from "dayjs";
2
+ /**
3
+ * Format date to own specific format
4
+ * @param date
5
+ * @param format
6
+ */
7
+ export declare const dateAdapter: (date: dayjs.ConfigType, format?: string) => string;
8
+ export default dateAdapter;
@@ -5,6 +5,6 @@
5
5
  */
6
6
  declare const filePathAdapter: (location?: string | null | {
7
7
  pathname: string;
8
- origin: string;
8
+ origin?: string;
9
9
  }, size?: number | "full") => string;
10
10
  export default filePathAdapter;
@@ -1,7 +1,7 @@
1
1
  declare const _default: {
2
2
  useInfiniteDataGrid: (location?: string | {
3
3
  pathname: string;
4
- origin: string;
4
+ origin?: string | undefined;
5
5
  } | null | undefined, size?: number | "full" | undefined) => string;
6
6
  };
7
7
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.23.3",
3
+ "version": "1.0.0-beta.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",
@@ -37,15 +37,26 @@
37
37
  "react-dom": "^18.2.0"
38
38
  },
39
39
  "devDependencies": {
40
+ "@sentry/react": "^8.5.0",
41
+ "@tanstack/react-query": "^5.40.0",
40
42
  "@testing-library/jest-dom": "^5.17.0",
41
43
  "@testing-library/react": "^14.0.0",
42
44
  "@testing-library/user-event": "^14.5.1",
45
+ "@tracktor/react-google-tag-manager": "^1.2.4",
46
+ "@types/mapbox-gl": "^3.1.0",
43
47
  "@types/react": "^18.2.30",
44
48
  "@types/react-dom": "^18.2.14",
45
49
  "@vitejs/plugin-react": "^4.2.1",
50
+ "axios": "^1.7.2",
51
+ "dayjs": "^1.11.11",
46
52
  "eslint-config-react-tracktor": "^1.7.1",
47
53
  "husky": "^8.0.3",
54
+ "i18next": "^23.11.5",
55
+ "i18next-browser-languagedetector": "^8.0.0",
48
56
  "jsdom": "^22.1.0",
57
+ "mapbox-gl": "^3.4.0",
58
+ "react-i18next": "^14.1.2",
59
+ "react-router-dom": "^6.23.1",
49
60
  "typescript": "^5.3.3",
50
61
  "vite": "^5.1.5",
51
62
  "vite-plugin-dts": "^3.7.3",
@@ -53,7 +64,49 @@
53
64
  "vitest": "^1.3.1"
54
65
  },
55
66
  "peerDependencies": {
67
+ "@sentry/react": "*",
68
+ "@tanstack/react-query": "*",
69
+ "@tracktor/react-google-tag-manager": "*",
70
+ "axios": "*",
71
+ "dayjs": "*",
72
+ "i18next": "*",
73
+ "i18next-browser-languagedetector": "*",
74
+ "mapbox-gl": "*",
56
75
  "react": ">=18.0.0",
57
- "react-dom": ">=18.0.0"
76
+ "react-dom": ">=18.0.0",
77
+ "react-i18next": "*",
78
+ "react-router-dom": ">=6.0.0"
79
+ },
80
+ "peerDependenciesMeta": {
81
+ "@sentry/react": {
82
+ "optional": true
83
+ },
84
+ "@tanstack/react-query": {
85
+ "optional": true
86
+ },
87
+ "@tracktor/react-google-tag-manager": {
88
+ "optional": true
89
+ },
90
+ "axios": {
91
+ "optional": true
92
+ },
93
+ "dayjs": {
94
+ "optional": true
95
+ },
96
+ "i18next": {
97
+ "optional": true
98
+ },
99
+ "i18next-browser-languagedetector": {
100
+ "optional": true
101
+ },
102
+ "mapbox-gl": {
103
+ "optional": true
104
+ },
105
+ "react-i18next": {
106
+ "optional": true
107
+ },
108
+ "react-router-dom": {
109
+ "optional": true
110
+ }
58
111
  }
59
112
  }