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