@tracktor/shared-module 2.13.0 → 2.13.1
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.cjs +5 -5
- package/dist/main.js +82 -80
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Le;function Rt(){if(Le)return G;Le=1;var t=w,r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function l(d,u,h){var g,C={},
|
|
9
|
+
*/var Le;function Rt(){if(Le)return G;Le=1;var t=w,r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function l(d,u,h){var g,C={},_=null,s=null;h!==void 0&&(_=""+h),u.key!==void 0&&(_=""+u.key),u.ref!==void 0&&(s=u.ref);for(g in u)i.call(u,g)&&!f.hasOwnProperty(g)&&(C[g]=u[g]);if(d&&d.defaultProps)for(g in u=d.defaultProps,u)C[g]===void 0&&(C[g]=u[g]);return{$$typeof:r,type:d,key:_,ref:s,props:C,_owner:a.current}}return G.Fragment=o,G.jsx=l,G.jsxs=l,G}var J={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var $e;function pt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){var t=w,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),
|
|
18
|
-
`+re+e}}var ne=!1,B;{var Ge=typeof WeakMap=="function"?WeakMap:Map;B=new Ge}function we(e,n){if(!e||ne)return"";{var c=B.get(e);if(c!==void 0)return c}var v;ne=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var
|
|
17
|
+
*/var $e;function pt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){var t=w,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),s=Symbol.for("react.offscreen"),b=Symbol.iterator,p="@@iterator";function j(e){if(e===null||typeof e!="object")return null;var n=b&&e[b]||e[p];return typeof n=="function"?n:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var n=arguments.length,c=new Array(n>1?n-1:0),v=1;v<n;v++)c[v-1]=arguments[v];k("error",e,c)}}function k(e,n,c){{var v=y.ReactDebugCurrentFrame,R=v.getStackAddendum();R!==""&&(n+="%s",c=c.concat([R]));var P=c.map(function(E){return String(E)});P.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,P)}}var F=!1,L=!1,$=!1,x=!1,ue=!1,ee;ee=Symbol.for("react.module.reference");function q(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===f||ue||e===a||e===h||e===g||x||e===s||F||L||$||typeof e=="object"&&e!==null&&(e.$$typeof===_||e.$$typeof===C||e.$$typeof===l||e.$$typeof===d||e.$$typeof===u||e.$$typeof===ee||e.getModuleId!==void 0))}function Ue(e,n,c){var v=e.displayName;if(v)return v;var R=n.displayName||n.name||"";return R!==""?c+"("+R+")":c}function le(e){return e.displayName||"Context"}function W(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 i:return"Fragment";case o:return"Portal";case f:return"Profiler";case a:return"StrictMode";case h:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var n=e;return le(n)+".Consumer";case l:var c=e;return le(c._context)+".Provider";case u:return Ue(e,e.render,"ForwardRef");case C:var v=e.displayName||null;return v!==null?v:W(e.type)||"Memo";case _:{var R=e,P=R._payload,E=R._init;try{return W(E(P))}catch{return null}}}return null}var z=Object.assign,M=0,fe,de,ve,ge,he,ye,me;function Ee(){}Ee.__reactDisabledLog=!0;function Ve(){{if(M===0){fe=console.log,de=console.info,ve=console.warn,ge=console.error,he=console.group,ye=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function Me(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:fe}),info:z({},e,{value:de}),warn:z({},e,{value:ve}),error:z({},e,{value:ge}),group:z({},e,{value:he}),groupCollapsed:z({},e,{value:ye}),groupEnd:z({},e,{value:me})})}M<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=y.ReactCurrentDispatcher,re;function K(e,n,c){{if(re===void 0)try{throw Error()}catch(R){var v=R.stack.trim().match(/\n( *(at )?)/);re=v&&v[1]||""}return`
|
|
18
|
+
`+re+e}}var ne=!1,B;{var Ge=typeof WeakMap=="function"?WeakMap:Map;B=new Ge}function we(e,n){if(!e||ne)return"";{var c=B.get(e);if(c!==void 0)return c}var v;ne=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=te.current,te.current=null,Ve();try{if(n){var E=function(){throw Error()};if(Object.defineProperty(E.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(E,[])}catch(N){v=N}Reflect.construct(e,[],E)}else{try{E.call()}catch(N){v=N}e.call(E.prototype)}}else{try{throw Error()}catch(N){v=N}e()}}catch(N){if(N&&v&&typeof N.stack=="string"){for(var m=N.stack.split(`
|
|
19
19
|
`),A=v.stack.split(`
|
|
20
20
|
`),T=m.length-1,O=A.length-1;T>=1&&O>=0&&m[T]!==A[O];)O--;for(;T>=1&&O>=0;T--,O--)if(m[T]!==A[O]){if(T!==1||O!==1)do if(T--,O--,O<0||m[T]!==A[O]){var I=`
|
|
21
|
-
`+m[T].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&B.set(e,I),I}while(T>=1&&O>=0);break}}}finally{ne=!1,te.current=
|
|
21
|
+
`+m[T].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&B.set(e,I),I}while(T>=1&&O>=0);break}}}finally{ne=!1,te.current=P,Me(),Error.prepareStackTrace=R}var V=e?e.displayName||e.name:"",De=V?K(V):"";return typeof e=="function"&&B.set(e,De),De}function Je(e,n,c){return we(e,!1)}function qe(e){var n=e.prototype;return!!(n&&n.isReactComponent)}function Q(e,n,c){if(e==null)return"";if(typeof e=="function")return we(e,qe(e));if(typeof e=="string")return K(e);switch(e){case h:return K("Suspense");case g:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Je(e.render);case C:return Q(e.type,n,c);case _:{var v=e,R=v._payload,P=v._init;try{return Q(P(R),n,c)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Re={},pe=y.ReactDebugCurrentFrame;function X(e){if(e){var n=e._owner,c=Q(e.type,e._source,n?n.type:null);pe.setExtraStackFrame(c)}else pe.setExtraStackFrame(null)}function Ke(e,n,c,v,R){{var P=Function.call.bind(H);for(var E in e)if(P(e,E)){var m=void 0;try{if(typeof e[E]!="function"){var A=Error((v||"React class")+": "+c+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}m=e[E](n,E,v,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){m=T}m&&!(m instanceof Error)&&(X(R),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).",v||"React class",c,E,typeof m),X(null)),m instanceof Error&&!(m.message in Re)&&(Re[m.message]=!0,X(R),S("Failed %s type: %s",c,m.message),X(null))}}}var Be=Array.isArray;function oe(e){return Be(e)}function Qe(e){{var n=typeof Symbol=="function"&&Symbol.toStringTag,c=n&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c}}function He(e){try{return Ce(e),!1}catch{return!0}}function Ce(e){return""+e}function _e(e){if(He(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Qe(e)),Ce(e)}var Se=y.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},Pe,be;function Ze(e){if(H.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return e.ref!==void 0}function et(e){if(H.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function tt(e,n){typeof e.ref=="string"&&Se.current}function rt(e,n){{var c=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)",n))};c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}}function nt(e,n){{var c=function(){be||(be=!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)",n))};c.isReactWarning=!0,Object.defineProperty(e,"ref",{get:c,configurable:!0})}}var ot=function(e,n,c,v,R,P,E){var m={$$typeof:r,type:e,key:n,ref:c,props:E,_owner:P};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function at(e,n,c,v,R){{var P,E={},m=null,A=null;c!==void 0&&(_e(c),m=""+c),et(n)&&(_e(n.key),m=""+n.key),Ze(n)&&(A=n.ref,tt(n,R));for(P in n)H.call(n,P)&&!Xe.hasOwnProperty(P)&&(E[P]=n[P]);if(e&&e.defaultProps){var T=e.defaultProps;for(P in T)E[P]===void 0&&(E[P]=T[P])}if(m||A){var O=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&rt(E,O),A&&nt(E,O)}return ot(e,m,A,R,v,Se.current,E)}}var ae=y.ReactCurrentOwner,je=y.ReactDebugCurrentFrame;function U(e){if(e){var n=e._owner,c=Q(e.type,e._source,n?n.type:null);je.setExtraStackFrame(c)}else je.setExtraStackFrame(null)}var ie;ie=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function Te(){{if(ae.current){var e=W(ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function it(e){return""}var Oe={};function ct(e){{var n=Te();if(!n){var c=typeof e=="string"?e:e.displayName||e.name;c&&(n=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+c+">.")}return n}}function xe(e,n){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var c=ct(n);if(Oe[c])return;Oe[c]=!0;var v="";e&&e._owner&&e._owner!==ae.current&&(v=" It was passed a child from "+W(e._owner.type)+"."),U(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,v),U(null)}}function Ae(e,n){{if(typeof e!="object")return;if(oe(e))for(var c=0;c<e.length;c++){var v=e[c];ce(v)&&xe(v,n)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var R=j(e);if(typeof R=="function"&&R!==e.entries)for(var S=R.call(e),E;!(E=S.next()).done;)ce(E.value)&&xe(E.value,n)}}}function st(e){{var n=e.type;if(n==null||typeof n=="string")return;var c;if(typeof n=="function")c=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===u||n.$$typeof===C))c=n.propTypes;else return;if(c){var v=W(n);Ke(c,e.props,"prop",v,e)}else if(n.PropTypes!==void 0&&!ie){ie=!0;var R=W(n);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ut(e){{for(var n=Object.keys(e.props),c=0;c<n.length;c++){var v=n[c];if(v!=="children"&&v!=="key"){U(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),U(null);break}}e.ref!==null&&(U(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}function ke(e,n,c,v,R,S){{var E=q(e);if(!E){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" 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 A=it();A?m+=A:m+=Te();var T;e===null?T="null":oe(e)?T="array":e!==void 0&&e.$$typeof===r?(T="<"+(W(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):T=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,m)}var O=at(e,n,c,R,S);if(O==null)return O;if(E){var I=n.children;if(I!==void 0)if(v)if(oe(I)){for(var V=0;V<I.length;V++)Ae(I[V],e);Object.freeze&&Object.freeze(I)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ae(I,e)}return e===i?ut(O):st(O),O}}function lt(e,n,c){return ke(e,n,c,!0)}function ft(e,n,c){return ke(e,n,c,!1)}var dt=ft,vt=lt;J.Fragment=i,J.jsx=dt,J.jsxs=vt}()),J}process.env.NODE_ENV==="production"?se.exports=Rt():se.exports=pt();var Y=se.exports;const D=w.createContext({}),Ct=({children:t,apiURL:r,libraries:o,localStorageKeys:i})=>{const a=w.useMemo(()=>({apiURL:r,libraries:o,localStorageKeys:i}),[r,o,i]);return Y.jsx(D.Provider,{value:a,children:t})},_t="user",St=({Fallback:t,isLogged:r,loginPath:o="/login",redirect401Path:i="/login",...a})=>{var k,F,L,$;const{libraries:f,localStorageKeys:l}=w.useContext(D),d=(a==null?void 0:a.reactRouter)||(f==null?void 0:f.reactRouter),u=(a==null?void 0:a.axios)||(f==null?void 0:f.axios),h=(a==null?void 0:a.localStorageKey)||(l==null?void 0:l.user)||_t;if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[g,C]=w.useState(null),{useLocation:b,Navigate:s,Outlet:P}=d,p=b(),j=w.useRef(!1),y=typeof r=="function"?r():!!r,_=typeof y=="boolean"?y:y==null?void 0:y.isLogged;return w.useEffect(()=>{j.current||(j.current=!0,u.interceptors.response.use(x=>x,async x=>{var q;return typeof x=="object"&&x&&"response"in x&&x.response&&typeof x.response=="object"&&"status"in x.response&&x.response&&typeof x.response=="object"&&"status"in x.response&&((q=x==null?void 0:x.response)==null?void 0:q.status)===401&&(u.defaults.headers.common.Authorization=null,typeof window<"u"&&window.localStorage&&localStorage.removeItem(h),C(i)),Promise.reject(x)}))},[u.defaults.headers.common,u.interceptors.response,h,i]),_&&!g?Y.jsx(w.Suspense,{fallback:t,children:(F=(k=p.state)==null?void 0:k.from)!=null&&F.state&&(($=(L=p.state)==null?void 0:L.from)==null?void 0:$.pathname)===o?Y.jsx(s,{to:p.state.from.state.from.pathname+p.state.from.state.from.search,replace:!0}):Y.jsx(P,{})}):Y.jsx(s,{to:o+p.search,state:{from:p},replace:!0})},Pt=({data:t,...r})=>{const{libraries:o}=w.useContext(D),i=(r==null?void 0:r.reactRouter)||(o==null?void 0:o.reactRouter),a=(r==null?void 0:r.gtm)||(o==null?void 0:o.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:f}=a,{useLocation:l,Outlet:d}=i,{pathname:u}=l(),{sendEvent:h}=f();return w.useEffect(()=>{h({event:"pageView",pathname:u,...t})},[t,u,h]),Y.jsx(d,{})},bt="user",jt=({tokenTypeKey:t="tokenType",tokenKey:r="accessToken",postContentType:o="application/json",...i})=>{const{apiURL:a=i.apiURL,libraries:f,localStorageKeys:l}=w.useContext(D),d=(i==null?void 0:i.userLocalStorageKey)||(l==null?void 0:l.user)||bt,u=(i==null?void 0:i.axios)||(f==null?void 0:f.axios);if(!u)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(u!=null&&u.defaults))return null;if(typeof window<"u"&&window.localStorage){const h=localStorage.getItem(d),g=h?JSON.parse(h):null,C=g!=null&&g[t]?g[t]:null,b=g!=null&&g[r]?g[r]:null,s=h?`${C} ${b}`:null;s&&(u.defaults.headers.common.Authorization=s)}return u.defaults.baseURL=a,u.defaults.headers.post["Content-Type"]=o,null},Tt=({debug:t,resources:r,...o})=>{const{libraries:i}=w.useContext(D),a=(o==null?void 0:o.i18)||(i==null?void 0:i.i18),{i18next:f,initReactI18next:l,languageDetector:d}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return f!=null&&f.isInitialized||(f.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:r,returnNull:!1}).then(()=>{document.documentElement.lang!==f.resolvedLanguage&&f.resolvedLanguage&&document.documentElement.setAttribute("lang",f.resolvedLanguage)}),f.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ot=({dsn:t,integrations:r,tracesSampleRate:o,replaysSessionSampleRate:i,replaysOnErrorSampleRate:a,tracePropagationTargets:f,ignoreErrors:l,debug:d,environment:u,release:h,...g})=>{const{libraries:C}=w.useContext(D),b=(g==null?void 0:g.sentry)||(C==null?void 0:C.sentry),s=(g==null?void 0:g.reactRouter)||(C==null?void 0:C.reactRouter);if(!b)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(b.isInitialized())return null;const{createRoutesFromChildren:P,matchRoutes:p,useLocation:j,useNavigationType:y}=s;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&b.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...l||[],/dynamically imported module/,/Cannot read properties of undefined \(reading 'default'\)/,/Loading chunk \d+ failed/,/ChunkLoadError/,/Failed to fetch dynamically imported module/,/vite:preloadError/],integrations:[b.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:P,matchRoutes:p,useEffect:w.useEffect,useLocation:j,useNavigationType:y}),...r||[]],release:h,replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:i||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},xt=({IMaskMixin:t,...r})=>{const o=w.useMemo(()=>t(({TextField:i,...a})=>Y.jsx(i,{...a})),[t]);return Y.jsx(o,{...r})},At=({language:t,...r})=>{const{libraries:o}=w.useContext(D),i=(r==null?void 0:r.dayjs)||(o==null?void 0:o.dayjs),a=(r==null?void 0:r.plugin)||(o==null?void 0:o.dayjsPlugin);if(!i)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return w.useEffect(()=>{(async()=>{var d;const l=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";a&&a.forEach(u=>{u&&i.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),i.locale(l)})().then()},[i,a,t]),null},kt=()=>(w.useEffect(()=>{const t=r=>{try{r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),Dt=t=>t&&typeof t=="function",It=t=>t&&typeof t=="function",Ft=({children:t,defaultQueriesOptions:r,defaultMutationsOptions:o,...i})=>{var u,h;const{libraries:a}=w.useContext(D),f=(i==null?void 0:i.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),l=(i==null?void 0:i.QueryClientProvider)||((h=a==null?void 0:a.reactQuery)==null?void 0:h.QueryClientProvider);if(!f)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!l)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!Dt(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!It(f))throw new Error("Provided QueryClient dependencies are not valid.");const d=new f({defaultOptions:{mutations:{...o},queries:{getNextPageParam:(g,C,b)=>g.length+(b||0),refetchOnWindowFocus:!1,retry:3,...r}}});return Y.jsx(l,{client:d,children:t})},Lt=t=>{var h,g,C;const{libraries:r}=w.useContext(D),o=(t==null?void 0:t.i18)||(r==null?void 0:r.i18),i=((h=t==null?void 0:t.i18)==null?void 0:h.translateFunction)||((g=r==null?void 0:r.i18)==null?void 0:g.translateFunction),a=((C=o==null?void 0:o.i18next)==null?void 0:C.t)||i||(b=>b),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=a(f),d=w.useCallback(b=>{var P,p,j,y,_,k,F,L,$;const{response:s}=b||{};return s!=null&&s.reason?String(s.reason):(P=s==null?void 0:s.data)!=null&&P.reason?String(s.data.reason):(p=s==null?void 0:s.data)!=null&&p.message?String(s.data.message):(y=(j=s==null?void 0:s.data)==null?void 0:j.detail)!=null&&y.length&&Array.isArray((_=s==null?void 0:s.data)==null?void 0:_.detail)&&((F=(k=s==null?void 0:s.data)==null?void 0:k.detail[0])!=null&&F.msg)&&typeof(($=(L=s==null?void 0:s.data)==null?void 0:L.detail[0])==null?void 0:$.msg)=="string"?String(s.data.detail[0].msg):l},[l]);return{getErrorCode:w.useCallback(b=>{var P,p,j;const{response:s}=b||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(P=s==null?void 0:s.data)!=null&&P.error_code?String((p=s==null?void 0:s.data)==null?void 0:p.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(j=s==null?void 0:s.data)!=null&&j.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:d}},$t=({data:t,fetchNextPage:r,isFetchingNextPage:o,isInitialLoading:i,isLoading:a,enabled:f=!0})=>{const l=w.useCallback(async u=>{o||!f||await r({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[f,r,o]),d=w.useMemo(()=>{if(t)return t.pages.reduce((u,h)=>[...u,...h],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||a,loadingVariant:i?"skeleton":"linear",rows:d}},Nt=t=>{const{libraries:r}=w.useContext(D),o=(t==null?void 0:t.axios)||(r==null?void 0:r.axios),i=(t==null?void 0:t.localStorageKey)||"user";if(!o)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const a=w.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return w.useEffect(()=>{const l=({newValue:d,key:u})=>{if(u===i&&d)try{const{accessToken:h,tokenType:g}=JSON.parse(d);a({accessToken:h,tokenType:g})}catch(h){console.error("Failed to parse newValue from localStorage:",h)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[i,a]),{clearAuthenticationToken:f,setAuthenticationToken:a}},Ye=({library:t,date:r,format:o="ll"})=>t(r).format(o),We=(t,r)=>{const{fractionDigits:o=0,metric:i="km"}=r||{},a=Number(t);return Number.isNaN(a)?`0${i}`:`${a.toFixed(o)}${i}`},ze=t=>!t||typeof t!="string"?"":t.replace(/_/g," ").toLowerCase().split(" ").map(o=>o.length>0?o.charAt(0).toUpperCase()+o.slice(1):o).join(" "),Yt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,Wt=({path:t,size:r,apiURL:o})=>{if(!t)return"";const i=Yt(t),a=`${o}${i}`,f=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof r=="number"&&f?`${a.replace("/files",`/thumbs/${r}`)}`:a},zt=t=>{const{apiURL:r,libraries:o}=w.useContext(D),i=(t==null?void 0:t.dayjs)||(o==null?void 0:o.dayjs);return{dateAdapter:(l,d)=>{if(!i)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return Ye({date:l,format:d,library:i})},distanceAdapter:We,filePathAdapter:(l,d)=>{if(!r)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return Wt({apiURL:r,path:l,size:d})},worksiteNameAdapter:ze}},Z=(t,r)=>r==="short"?t.split("-")[0]:t,Ut=(t,r="full")=>{const[o,i]=w.useState(()=>{const a=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,Z(a,r)});return w.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&i(Z(t.language,r));const a=l=>{i(Z(l,r))};return(f=t==null?void 0:t.on)==null||f.call(t,"languageChanged",a),()=>{var l;(l=t==null?void 0:t.off)==null||l.call(t,"languageChanged",a)}},[t,r]),o},Vt="tracktor.filter",Ne=(t,r,o)=>`${o}_${t}=>${r}`,Mt=t=>{const{libraries:r,localStorageKeys:o}=w.useContext(D),i=(t==null?void 0:t.reactRouter)||(r==null?void 0:r.reactRouter),{useLocation:a,useSearchParams:f}=i,{pathname:l}=a(),[d,u]=f(),h=(o==null?void 0:o.filter)||Vt;if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const g=(P,p,j=!0)=>{const y=Ne(P,(t==null?void 0:t.pathname)||l,h);if(!p||Array.isArray(p)&&!p.length){d.delete(P),u(d),localStorage.removeItem(y);return}j&&p&&localStorage.setItem(y,JSON.stringify({...d,[P]:p})),p&&(d.set(P,JSON.stringify(p)),u(d))};return{getFilter:(P,p)=>{const j=d.get(P);if(j)try{return JSON.parse(j)}catch{return j}const y=Ne(P,(t==null?void 0:t.pathname)||l,h),_=localStorage.getItem(y);if(_)try{return JSON.parse(_)[P]}catch{}return p},getFilters:()=>{const P=Object.fromEntries(d.entries()),j=Object.keys(localStorage).filter(y=>y.startsWith(h)&&y.endsWith((t==null?void 0:t.pathname)||l)).reduce((y,_)=>{var F,L;const k=localStorage.getItem(_);if(k){const $=JSON.parse(k),x=(F=Object.keys($))==null?void 0:F[0];y[x]=(L=Object.values($))==null?void 0:L[0]}return y},{});return{...P,...j}},handleFilter:(P,p)=>(j,y)=>{if(y||Array.isArray(y)&&y.length===0){const _=p||"value",k=typeof y=="object"&&_ in y?y[_]:y;g(P,k);return}g(P,void 0)},setFilter:g}},Gt=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),Jt=t=>{const i=t.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return i.charAt(0).toLowerCase()+i.slice(1)},qt=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),Kt=(t,r,o,i)=>{const a=Jt(r),f=Gt(o),l=`${a}${f}`;return t&&typeof t=="object"&&"operationId"in t&&(i!=null&&i.includes(String(t.operationId)))?`${l}AsQuery`:l},Bt=(t,r)=>{const o={};return t==null||t.forEach(i=>{o[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}}}),r==null||r.filter(i=>!o[i]).forEach(i=>{o[i]={query:{useQuery:!0}}}),Object.keys(o).length?o:void 0},Qt=t=>(Array.isArray(t)?t:[t]).reduce((o,i)=>{const{output:a,useInfiniteIds:f,useQueryIds:l,input:d="./openapi.json"}=i||{},u=qt(d);return{...o,[u]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:d,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...((f==null?void 0:f.length)||(l==null?void 0:l.length))&&{operations:Bt(f,l)},header:h=>["Generated by orval 🍺",...h.title?[h.title]:[],...h.description?[h.description]:[]],mutator:{name:"axiosCustomInstance",path:"./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts"},operationName:(h,g,C)=>Kt(h,g,C,l),query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${u}/model`,target:(a==null?void 0:a.target)||`src/api/${u}/services/api.ts`,...a}}}},{});exports.GTMSendPageView=Pt;exports.InitializeAxiosConfig=jt;exports.InitializeDaysJSConfig=At;exports.InitializeI18nConfig=Tt;exports.InitializeSentryConfig=Ot;exports.InjectDependenciesContext=D;exports.InjectDependenciesProvider=Ct;exports.MaskTextField=xt;exports.PreloadErrorHandler=kt;exports.QueryClientProviderWithConfig=Ft;exports.RequireAuth=St;exports.dateAdapter=Ye;exports.distanceAdapter=We;exports.getOrvalConfig=Qt;exports.useAdapter=zt;exports.useAuth=Nt;exports.useCurrentLanguage=Ut;exports.useFilters=Mt;exports.useInfiniteDataGrid=$t;exports.useResponseError=Lt;exports.worksiteNameAdapter=ze;
|
|
25
|
+
Check the top-level render call using <`+c+">.")}return n}}function xe(e,n){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var c=ct(n);if(Oe[c])return;Oe[c]=!0;var v="";e&&e._owner&&e._owner!==ae.current&&(v=" It was passed a child from "+W(e._owner.type)+"."),U(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.',c,v),U(null)}}function Ae(e,n){{if(typeof e!="object")return;if(oe(e))for(var c=0;c<e.length;c++){var v=e[c];ce(v)&&xe(v,n)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var R=j(e);if(typeof R=="function"&&R!==e.entries)for(var P=R.call(e),E;!(E=P.next()).done;)ce(E.value)&&xe(E.value,n)}}}function st(e){{var n=e.type;if(n==null||typeof n=="string")return;var c;if(typeof n=="function")c=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===u||n.$$typeof===C))c=n.propTypes;else return;if(c){var v=W(n);Ke(c,e.props,"prop",v,e)}else if(n.PropTypes!==void 0&&!ie){ie=!0;var R=W(n);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ut(e){{for(var n=Object.keys(e.props),c=0;c<n.length;c++){var v=n[c];if(v!=="children"&&v!=="key"){U(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),U(null);break}}e.ref!==null&&(U(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}function ke(e,n,c,v,R,P){{var E=q(e);if(!E){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" 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 A=it();A?m+=A:m+=Te();var T;e===null?T="null":oe(e)?T="array":e!==void 0&&e.$$typeof===r?(T="<"+(W(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):T=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",T,m)}var O=at(e,n,c,R,P);if(O==null)return O;if(E){var I=n.children;if(I!==void 0)if(v)if(oe(I)){for(var V=0;V<I.length;V++)Ae(I[V],e);Object.freeze&&Object.freeze(I)}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 Ae(I,e)}return e===i?ut(O):st(O),O}}function lt(e,n,c){return ke(e,n,c,!0)}function ft(e,n,c){return ke(e,n,c,!1)}var dt=ft,vt=lt;J.Fragment=i,J.jsx=dt,J.jsxs=vt}()),J}process.env.NODE_ENV==="production"?se.exports=Rt():se.exports=pt();var Y=se.exports;const D=w.createContext({}),Ct=({children:t,apiURL:r,libraries:o,localStorageKeys:i})=>{const a=w.useMemo(()=>({apiURL:r,libraries:o,localStorageKeys:i}),[r,o,i]);return Y.jsx(D.Provider,{value:a,children:t})},_t="user",St=({Fallback:t,isLogged:r,loginPath:o="/login",redirect401Path:i="/login",...a})=>{var k,F,L,$;const{libraries:f,localStorageKeys:l}=w.useContext(D),d=(a==null?void 0:a.reactRouter)||(f==null?void 0:f.reactRouter),u=(a==null?void 0:a.axios)||(f==null?void 0:f.axios),h=(a==null?void 0:a.localStorageKey)||(l==null?void 0:l.user)||_t;if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[g,C]=w.useState(null),{useLocation:_,Navigate:s,Outlet:b}=d,p=_(),j=w.useRef(!1),y=typeof r=="function"?r():!!r,S=typeof y=="boolean"?y:y==null?void 0:y.isLogged;return w.useEffect(()=>{j.current||(j.current=!0,u.interceptors.response.use(x=>x,async x=>{var q;return typeof x=="object"&&x&&"response"in x&&x.response&&typeof x.response=="object"&&"status"in x.response&&x.response&&typeof x.response=="object"&&"status"in x.response&&((q=x==null?void 0:x.response)==null?void 0:q.status)===401&&(u.defaults.headers.common.Authorization=null,typeof window<"u"&&window.localStorage&&localStorage.removeItem(h),C(i)),Promise.reject(x)}))},[u.defaults.headers.common,u.interceptors.response,h,i]),S&&!g?Y.jsx(w.Suspense,{fallback:t,children:(F=(k=p.state)==null?void 0:k.from)!=null&&F.state&&(($=(L=p.state)==null?void 0:L.from)==null?void 0:$.pathname)===o?Y.jsx(s,{to:p.state.from.state.from.pathname+p.state.from.state.from.search,replace:!0}):Y.jsx(b,{})}):Y.jsx(s,{to:o+p.search,state:{from:p},replace:!0})},Pt=({data:t,...r})=>{const{libraries:o}=w.useContext(D),i=(r==null?void 0:r.reactRouter)||(o==null?void 0:o.reactRouter),a=(r==null?void 0:r.gtm)||(o==null?void 0:o.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:f}=a,{useLocation:l,Outlet:d}=i,{pathname:u}=l(),{sendEvent:h}=f();return w.useEffect(()=>{h({event:"pageView",pathname:u,...t})},[t,u,h]),Y.jsx(d,{})},bt="user",jt=({tokenTypeKey:t="tokenType",tokenKey:r="accessToken",postContentType:o="application/json",...i})=>{const{apiURL:a=i.apiURL,libraries:f,localStorageKeys:l}=w.useContext(D),d=(i==null?void 0:i.userLocalStorageKey)||(l==null?void 0:l.user)||bt,u=(i==null?void 0:i.axios)||(f==null?void 0:f.axios);if(!u)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(u!=null&&u.defaults))return null;if(typeof window<"u"&&window.localStorage){const h=localStorage.getItem(d),g=h?JSON.parse(h):null,C=g!=null&&g[t]?g[t]:null,_=g!=null&&g[r]?g[r]:null,s=h?`${C} ${_}`:null;s&&(u.defaults.headers.common.Authorization=s)}return u.defaults.baseURL=a,u.defaults.headers.post["Content-Type"]=o,null},Tt=({debug:t,resources:r,...o})=>{const{libraries:i}=w.useContext(D),a=(o==null?void 0:o.i18)||(i==null?void 0:i.i18),{i18next:f,initReactI18next:l,languageDetector:d}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return f!=null&&f.isInitialized||(f.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:r,returnNull:!1}).then(()=>{document.documentElement.lang!==f.resolvedLanguage&&f.resolvedLanguage&&document.documentElement.setAttribute("lang",f.resolvedLanguage)}),f.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ot=({dsn:t,integrations:r,tracesSampleRate:o,replaysSessionSampleRate:i,replaysOnErrorSampleRate:a,tracePropagationTargets:f,ignoreErrors:l,debug:d,environment:u,release:h,...g})=>{const{libraries:C}=w.useContext(D),_=(g==null?void 0:g.sentry)||(C==null?void 0:C.sentry),s=(g==null?void 0:g.reactRouter)||(C==null?void 0:C.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:b,matchRoutes:p,useLocation:j,useNavigationType:y}=s;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...l||[],/dynamically imported module/,/Cannot read properties of undefined \(reading 'default'\)/,/Loading chunk \d+ failed/,/ChunkLoadError/,/Failed to fetch dynamically imported module/,/vite:preloadError/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:b,matchRoutes:p,useEffect:w.useEffect,useLocation:j,useNavigationType:y}),...r||[]],release:h,replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:i||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},xt=({IMaskMixin:t,...r})=>{const o=w.useMemo(()=>t(({TextField:i,...a})=>Y.jsx(i,{...a})),[t]);return Y.jsx(o,{...r})},At=({language:t,...r})=>{const{libraries:o}=w.useContext(D),i=(r==null?void 0:r.dayjs)||(o==null?void 0:o.dayjs),a=(r==null?void 0:r.plugin)||(o==null?void 0:o.dayjsPlugin);if(!i)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return w.useEffect(()=>{(async()=>{var d;const l=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";a&&a.forEach(u=>{u&&i.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),i.locale(l)})().then()},[i,a,t]),null},kt=()=>(w.useEffect(()=>{const t=r=>{try{r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),Dt=t=>t&&typeof t=="function",It=t=>t&&typeof t=="function",Ft=({children:t,defaultQueriesOptions:r,defaultMutationsOptions:o,...i})=>{var u,h;const{libraries:a}=w.useContext(D),f=(i==null?void 0:i.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),l=(i==null?void 0:i.QueryClientProvider)||((h=a==null?void 0:a.reactQuery)==null?void 0:h.QueryClientProvider);if(!f)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!l)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!Dt(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!It(f))throw new Error("Provided QueryClient dependencies are not valid.");const d=new f({defaultOptions:{mutations:{...o},queries:{getNextPageParam:(g,C,_)=>g.length+(_||0),refetchOnWindowFocus:!1,retry:3,...r}}});return Y.jsx(l,{client:d,children:t})},Lt=t=>{var h,g,C;const{libraries:r}=w.useContext(D),o=(t==null?void 0:t.i18)||(r==null?void 0:r.i18),i=((h=t==null?void 0:t.i18)==null?void 0:h.translateFunction)||((g=r==null?void 0:r.i18)==null?void 0:g.translateFunction),a=((C=o==null?void 0:o.i18next)==null?void 0:C.t)||i||(_=>_),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=a(f),d=w.useCallback(_=>{var b,p,j,y,S,k,F,L,$;if(_ instanceof Error)return _.message;const{response:s}=_||{};return s!=null&&s.reason?String(s.reason):(b=s==null?void 0:s.data)!=null&&b.reason?String(s.data.reason):(p=s==null?void 0:s.data)!=null&&p.message?String(s.data.message):(y=(j=s==null?void 0:s.data)==null?void 0:j.detail)!=null&&y.length&&Array.isArray((S=s==null?void 0:s.data)==null?void 0:S.detail)&&((F=(k=s==null?void 0:s.data)==null?void 0:k.detail[0])!=null&&F.msg)&&typeof(($=(L=s==null?void 0:s.data)==null?void 0:L.detail[0])==null?void 0:$.msg)=="string"?String(s.data.detail[0].msg):l},[l]);return{getErrorCode:w.useCallback(_=>{var b,p,j;const{response:s}=_||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(b=s==null?void 0:s.data)!=null&&b.error_code?String((p=s==null?void 0:s.data)==null?void 0:p.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(j=s==null?void 0:s.data)!=null&&j.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:d}},$t=({data:t,fetchNextPage:r,isFetchingNextPage:o,isInitialLoading:i,isLoading:a,enabled:f=!0})=>{const l=w.useCallback(async u=>{o||!f||await r({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[f,r,o]),d=w.useMemo(()=>{if(t)return t.pages.reduce((u,h)=>[...u,...h],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||a,loadingVariant:i?"skeleton":"linear",rows:d}},Nt=t=>{const{libraries:r}=w.useContext(D),o=(t==null?void 0:t.axios)||(r==null?void 0:r.axios),i=(t==null?void 0:t.localStorageKey)||"user";if(!o)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const a=w.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return w.useEffect(()=>{const l=({newValue:d,key:u})=>{if(u===i&&d)try{const{accessToken:h,tokenType:g}=JSON.parse(d);a({accessToken:h,tokenType:g})}catch(h){console.error("Failed to parse newValue from localStorage:",h)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[i,a]),{clearAuthenticationToken:f,setAuthenticationToken:a}},Ye=({library:t,date:r,format:o="ll"})=>t(r).format(o),We=(t,r)=>{const{fractionDigits:o=0,metric:i="km"}=r||{},a=Number(t);return Number.isNaN(a)?`0${i}`:`${a.toFixed(o)}${i}`},ze=t=>!t||typeof t!="string"?"":t.replace(/_/g," ").toLowerCase().split(" ").map(o=>o.length>0?o.charAt(0).toUpperCase()+o.slice(1):o).join(" "),Yt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,Wt=({path:t,size:r,apiURL:o})=>{if(!t)return"";const i=Yt(t),a=`${o}${i}`,f=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof r=="number"&&f?`${a.replace("/files",`/thumbs/${r}`)}`:a},zt=t=>{const{apiURL:r,libraries:o}=w.useContext(D),i=(t==null?void 0:t.dayjs)||(o==null?void 0:o.dayjs);return{dateAdapter:(l,d)=>{if(!i)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return Ye({date:l,format:d,library:i})},distanceAdapter:We,filePathAdapter:(l,d)=>{if(!r)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return Wt({apiURL:r,path:l,size:d})},worksiteNameAdapter:ze}},Z=(t,r)=>r==="short"?t.split("-")[0]:t,Ut=(t,r="full")=>{const[o,i]=w.useState(()=>{const a=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,Z(a,r)});return w.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&i(Z(t.language,r));const a=l=>{i(Z(l,r))};return(f=t==null?void 0:t.on)==null||f.call(t,"languageChanged",a),()=>{var l;(l=t==null?void 0:t.off)==null||l.call(t,"languageChanged",a)}},[t,r]),o},Vt="tracktor.filter",Ne=(t,r,o)=>`${o}_${t}=>${r}`,Mt=t=>{const{libraries:r,localStorageKeys:o}=w.useContext(D),i=(t==null?void 0:t.reactRouter)||(r==null?void 0:r.reactRouter),{useLocation:a,useSearchParams:f}=i,{pathname:l}=a(),[d,u]=f(),h=(o==null?void 0:o.filter)||Vt;if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const g=(b,p,j=!0)=>{const y=Ne(b,(t==null?void 0:t.pathname)||l,h);if(!p||Array.isArray(p)&&!p.length){d.delete(b),u(d),localStorage.removeItem(y);return}j&&p&&localStorage.setItem(y,JSON.stringify({...d,[b]:p})),p&&(d.set(b,JSON.stringify(p)),u(d))};return{getFilter:(b,p)=>{const j=d.get(b);if(j)try{return JSON.parse(j)}catch{return j}const y=Ne(b,(t==null?void 0:t.pathname)||l,h),S=localStorage.getItem(y);if(S)try{return JSON.parse(S)[b]}catch{}return p},getFilters:()=>{const b=Object.fromEntries(d.entries()),j=Object.keys(localStorage).filter(y=>y.startsWith(h)&&y.endsWith((t==null?void 0:t.pathname)||l)).reduce((y,S)=>{var F,L;const k=localStorage.getItem(S);if(k){const $=JSON.parse(k),x=(F=Object.keys($))==null?void 0:F[0];y[x]=(L=Object.values($))==null?void 0:L[0]}return y},{});return{...b,...j}},handleFilter:(b,p)=>(j,y)=>{if(y||Array.isArray(y)&&y.length===0){const S=p||"value",k=typeof y=="object"&&S in y?y[S]:y;g(b,k);return}g(b,void 0)},setFilter:g}},Gt=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),Jt=t=>{const i=t.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return i.charAt(0).toLowerCase()+i.slice(1)},qt=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),Kt=(t,r,o,i)=>{const a=Jt(r),f=Gt(o),l=`${a}${f}`;return t&&typeof t=="object"&&"operationId"in t&&(i!=null&&i.includes(String(t.operationId)))?`${l}AsQuery`:l},Bt=(t,r)=>{const o={};return t==null||t.forEach(i=>{o[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}}}),r==null||r.filter(i=>!o[i]).forEach(i=>{o[i]={query:{useQuery:!0}}}),Object.keys(o).length?o:void 0},Qt=t=>(Array.isArray(t)?t:[t]).reduce((o,i)=>{const{output:a,useInfiniteIds:f,useQueryIds:l,input:d="./openapi.json"}=i||{},u=qt(d);return{...o,[u]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:d,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...((f==null?void 0:f.length)||(l==null?void 0:l.length))&&{operations:Bt(f,l)},header:h=>["Generated by orval 🍺",...h.title?[h.title]:[],...h.description?[h.description]:[]],mutator:{name:"axiosCustomInstance",path:"./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts"},operationName:(h,g,C)=>Kt(h,g,C,l),query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${u}/model`,target:(a==null?void 0:a.target)||`src/api/${u}/services/api.ts`,...a}}}},{});exports.GTMSendPageView=Pt;exports.InitializeAxiosConfig=jt;exports.InitializeDaysJSConfig=At;exports.InitializeI18nConfig=Tt;exports.InitializeSentryConfig=Ot;exports.InjectDependenciesContext=D;exports.InjectDependenciesProvider=Ct;exports.MaskTextField=xt;exports.PreloadErrorHandler=kt;exports.QueryClientProviderWithConfig=Ft;exports.RequireAuth=St;exports.dateAdapter=Ye;exports.distanceAdapter=We;exports.getOrvalConfig=Qt;exports.useAdapter=zt;exports.useAuth=Nt;exports.useCurrentLanguage=Ut;exports.useFilters=Mt;exports.useInfiniteDataGrid=$t;exports.useResponseError=Lt;exports.worksiteNameAdapter=ze;
|
package/dist/main.js
CHANGED
|
@@ -15,11 +15,11 @@ function mt() {
|
|
|
15
15
|
$e = 1;
|
|
16
16
|
var t = We, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
17
|
function l(d, u, h) {
|
|
18
|
-
var g, p = {},
|
|
19
|
-
h !== void 0 && (
|
|
18
|
+
var g, p = {}, _ = null, s = null;
|
|
19
|
+
h !== void 0 && (_ = "" + h), u.key !== void 0 && (_ = "" + u.key), u.ref !== void 0 && (s = u.ref);
|
|
20
20
|
for (g in u) i.call(u, g) && !f.hasOwnProperty(g) && (p[g] = u[g]);
|
|
21
21
|
if (d && d.defaultProps) for (g in u = d.defaultProps, u) p[g] === void 0 && (p[g] = u[g]);
|
|
22
|
-
return { $$typeof: n, type: d, key:
|
|
22
|
+
return { $$typeof: n, type: d, key: _, ref: s, props: p, _owner: a.current };
|
|
23
23
|
}
|
|
24
24
|
return J.Fragment = o, J.jsx = l, J.jsxs = l, J;
|
|
25
25
|
}
|
|
@@ -36,15 +36,15 @@ var q = {};
|
|
|
36
36
|
var Ne;
|
|
37
37
|
function Et() {
|
|
38
38
|
return Ne || (Ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
-
var t = We, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), d = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"),
|
|
39
|
+
var t = We, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), d = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), s = Symbol.for("react.offscreen"), P = Symbol.iterator, R = "@@iterator";
|
|
40
40
|
function b(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var r =
|
|
43
|
+
var r = P && e[P] || e[R];
|
|
44
44
|
return typeof r == "function" ? r : null;
|
|
45
45
|
}
|
|
46
46
|
var y = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
-
function
|
|
47
|
+
function S(e) {
|
|
48
48
|
{
|
|
49
49
|
for (var r = arguments.length, c = new Array(r > 1 ? r - 1 : 0), v = 1; v < r; v++)
|
|
50
50
|
c[v - 1] = arguments[v];
|
|
@@ -55,16 +55,16 @@ function Et() {
|
|
|
55
55
|
{
|
|
56
56
|
var v = y.ReactDebugCurrentFrame, w = v.getStackAddendum();
|
|
57
57
|
w !== "" && (r += "%s", c = c.concat([w]));
|
|
58
|
-
var
|
|
58
|
+
var C = c.map(function(E) {
|
|
59
59
|
return String(E);
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
C.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, C);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
var L = !1, I = !1, $ = !1, O = !1, de = !1, re;
|
|
65
65
|
re = Symbol.for("react.module.reference");
|
|
66
66
|
function K(e) {
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === i || e === f || de || e === a || e === h || e === g || O || e === s || L || I || $ || typeof e == "object" && e !== null && (e.$$typeof ===
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === f || de || e === a || e === h || e === g || O || e === s || L || I || $ || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === p || e.$$typeof === l || e.$$typeof === d || e.$$typeof === u || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
@@ -83,7 +83,7 @@ function Et() {
|
|
|
83
83
|
function W(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
|
-
if (typeof e.tag == "number" &&
|
|
86
|
+
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")
|
|
87
87
|
return e.displayName || e.name || null;
|
|
88
88
|
if (typeof e == "string")
|
|
89
89
|
return e;
|
|
@@ -114,10 +114,10 @@ function Et() {
|
|
|
114
114
|
case p:
|
|
115
115
|
var v = e.displayName || null;
|
|
116
116
|
return v !== null ? v : W(e.type) || "Memo";
|
|
117
|
-
case
|
|
118
|
-
var w = e,
|
|
117
|
+
case _: {
|
|
118
|
+
var w = e, C = w._payload, E = w._init;
|
|
119
119
|
try {
|
|
120
|
-
return W(E(
|
|
120
|
+
return W(E(C));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -184,7 +184,7 @@ function Et() {
|
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
G < 0 &&
|
|
187
|
+
G < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
var ne = y.ReactCurrentDispatcher, oe;
|
|
@@ -218,8 +218,8 @@ function Et() {
|
|
|
218
218
|
ae = !0;
|
|
219
219
|
var w = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var C;
|
|
222
|
+
C = ne.current, ne.current = null, ze();
|
|
223
223
|
try {
|
|
224
224
|
if (r) {
|
|
225
225
|
var E = function() {
|
|
@@ -272,7 +272,7 @@ function Et() {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
ae = !1, ne.current =
|
|
275
|
+
ae = !1, ne.current = C, Me(), Error.prepareStackTrace = w;
|
|
276
276
|
}
|
|
277
277
|
var M = e ? e.displayName || e.name : "", Ie = M ? B(M) : "";
|
|
278
278
|
return typeof e == "function" && Q.set(e, Ie), Ie;
|
|
@@ -303,10 +303,10 @@ function Et() {
|
|
|
303
303
|
return Je(e.render);
|
|
304
304
|
case p:
|
|
305
305
|
return H(e.type, r, c);
|
|
306
|
-
case
|
|
307
|
-
var v = e, w = v._payload,
|
|
306
|
+
case _: {
|
|
307
|
+
var v = e, w = v._payload, C = v._init;
|
|
308
308
|
try {
|
|
309
|
-
return H(
|
|
309
|
+
return H(C(w), r, c);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
@@ -323,9 +323,9 @@ function Et() {
|
|
|
323
323
|
}
|
|
324
324
|
function Ke(e, r, c, v, w) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
326
|
+
var C = Function.call.bind(X);
|
|
327
327
|
for (var E in e)
|
|
328
|
-
if (
|
|
328
|
+
if (C(e, E)) {
|
|
329
329
|
var m = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof e[E] != "function") {
|
|
@@ -336,7 +336,7 @@ function Et() {
|
|
|
336
336
|
} catch (j) {
|
|
337
337
|
m = j;
|
|
338
338
|
}
|
|
339
|
-
m && !(m instanceof Error) && (Z(w),
|
|
339
|
+
m && !(m instanceof Error) && (Z(w), 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).", v || "React class", c, E, typeof m), Z(null)), m instanceof Error && !(m.message in Se) && (Se[m.message] = !0, Z(w), S("Failed %s type: %s", c, m.message), Z(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -362,7 +362,7 @@ function Et() {
|
|
|
362
362
|
}
|
|
363
363
|
function be(e) {
|
|
364
364
|
if (He(e))
|
|
365
|
-
return
|
|
365
|
+
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), Pe(e);
|
|
366
366
|
}
|
|
367
367
|
var je = y.ReactCurrentOwner, Xe = {
|
|
368
368
|
key: !0,
|
|
@@ -392,7 +392,7 @@ function Et() {
|
|
|
392
392
|
function rt(e, r) {
|
|
393
393
|
{
|
|
394
394
|
var c = function() {
|
|
395
|
-
Te || (Te = !0,
|
|
395
|
+
Te || (Te = !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));
|
|
396
396
|
};
|
|
397
397
|
c.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
398
398
|
get: c,
|
|
@@ -403,7 +403,7 @@ function Et() {
|
|
|
403
403
|
function nt(e, r) {
|
|
404
404
|
{
|
|
405
405
|
var c = function() {
|
|
406
|
-
Oe || (Oe = !0,
|
|
406
|
+
Oe || (Oe = !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));
|
|
407
407
|
};
|
|
408
408
|
c.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
409
409
|
get: c,
|
|
@@ -411,7 +411,7 @@ function Et() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var ot = function(e, r, c, v, w,
|
|
414
|
+
var ot = function(e, r, c, v, w, C, E) {
|
|
415
415
|
var m = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
417
|
$$typeof: n,
|
|
@@ -421,7 +421,7 @@ function Et() {
|
|
|
421
421
|
ref: c,
|
|
422
422
|
props: E,
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
|
-
_owner:
|
|
424
|
+
_owner: C
|
|
425
425
|
};
|
|
426
426
|
return m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
427
427
|
configurable: !1,
|
|
@@ -442,14 +442,14 @@ function Et() {
|
|
|
442
442
|
};
|
|
443
443
|
function at(e, r, c, v, w) {
|
|
444
444
|
{
|
|
445
|
-
var
|
|
445
|
+
var C, E = {}, m = null, A = null;
|
|
446
446
|
c !== void 0 && (be(c), m = "" + c), et(r) && (be(r.key), m = "" + r.key), Ze(r) && (A = r.ref, tt(r, w));
|
|
447
|
-
for (
|
|
448
|
-
X.call(r,
|
|
447
|
+
for (C in r)
|
|
448
|
+
X.call(r, C) && !Xe.hasOwnProperty(C) && (E[C] = r[C]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
450
450
|
var j = e.defaultProps;
|
|
451
|
-
for (
|
|
452
|
-
E[
|
|
451
|
+
for (C in j)
|
|
452
|
+
E[C] === void 0 && (E[C] = j[C]);
|
|
453
453
|
}
|
|
454
454
|
if (m || A) {
|
|
455
455
|
var T = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
@@ -509,7 +509,7 @@ Check the top-level render call using <` + c + ">.");
|
|
|
509
509
|
return;
|
|
510
510
|
ke[c] = !0;
|
|
511
511
|
var v = "";
|
|
512
|
-
e && e._owner && e._owner !== ce.current && (v = " It was passed a child from " + W(e._owner.type) + "."), z(e),
|
|
512
|
+
e && e._owner && e._owner !== ce.current && (v = " It was passed a child from " + W(e._owner.type) + "."), z(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.', c, v), z(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
function Fe(e, r) {
|
|
@@ -526,7 +526,7 @@ Check the top-level render call using <` + c + ">.");
|
|
|
526
526
|
else if (e) {
|
|
527
527
|
var w = b(e);
|
|
528
528
|
if (typeof w == "function" && w !== e.entries)
|
|
529
|
-
for (var
|
|
529
|
+
for (var C = w.call(e), E; !(E = C.next()).done; )
|
|
530
530
|
ue(E.value) && De(E.value, r);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
@@ -551,9 +551,9 @@ Check the top-level render call using <` + c + ">.");
|
|
|
551
551
|
} else if (r.PropTypes !== void 0 && !se) {
|
|
552
552
|
se = !0;
|
|
553
553
|
var w = W(r);
|
|
554
|
-
|
|
554
|
+
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
|
|
555
555
|
}
|
|
556
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
556
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
function ut(e) {
|
|
@@ -561,14 +561,14 @@ Check the top-level render call using <` + c + ">.");
|
|
|
561
561
|
for (var r = Object.keys(e.props), c = 0; c < r.length; c++) {
|
|
562
562
|
var v = r[c];
|
|
563
563
|
if (v !== "children" && v !== "key") {
|
|
564
|
-
z(e),
|
|
564
|
+
z(e), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), z(null);
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
e.ref !== null && (z(e),
|
|
568
|
+
e.ref !== null && (z(e), S("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
function Le(e, r, c, v, w,
|
|
571
|
+
function Le(e, r, c, v, w, C) {
|
|
572
572
|
{
|
|
573
573
|
var E = K(e);
|
|
574
574
|
if (!E) {
|
|
@@ -577,9 +577,9 @@ Check the top-level render call using <` + c + ">.");
|
|
|
577
577
|
var A = it();
|
|
578
578
|
A ? m += A : m += xe();
|
|
579
579
|
var j;
|
|
580
|
-
e === null ? j = "null" : ie(e) ? j = "array" : e !== void 0 && e.$$typeof === n ? (j = "<" + (W(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : j = typeof e,
|
|
580
|
+
e === null ? j = "null" : ie(e) ? j = "array" : e !== void 0 && e.$$typeof === n ? (j = "<" + (W(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : j = 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", j, m);
|
|
581
581
|
}
|
|
582
|
-
var T = at(e, r, c, w,
|
|
582
|
+
var T = at(e, r, c, w, C);
|
|
583
583
|
if (T == null)
|
|
584
584
|
return T;
|
|
585
585
|
if (E) {
|
|
@@ -591,7 +591,7 @@ Check the top-level render call using <` + c + ">.");
|
|
|
591
591
|
Fe(k[M], e);
|
|
592
592
|
Object.freeze && Object.freeze(k);
|
|
593
593
|
} else
|
|
594
|
-
|
|
594
|
+
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.");
|
|
595
595
|
else
|
|
596
596
|
Fe(k, e);
|
|
597
597
|
}
|
|
@@ -625,7 +625,7 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
625
625
|
const { libraries: f, localStorageKeys: l } = F(D), d = (a == null ? void 0 : a.reactRouter) || (f == null ? void 0 : f.reactRouter), u = (a == null ? void 0 : a.axios) || (f == null ? void 0 : f.axios), h = (a == null ? void 0 : a.localStorageKey) || (l == null ? void 0 : l.user) || wt;
|
|
626
626
|
if (!d)
|
|
627
627
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
628
|
-
const [g, p] = Ue(null), { useLocation:
|
|
628
|
+
const [g, p] = Ue(null), { useLocation: _, Navigate: s, Outlet: P } = d, R = _(), b = ht(!1), y = typeof n == "function" ? n() : !!n, S = typeof y == "boolean" ? y : y == null ? void 0 : y.isLogged;
|
|
629
629
|
return V(() => {
|
|
630
630
|
b.current || (b.current = !0, u.interceptors.response.use(
|
|
631
631
|
(O) => O,
|
|
@@ -634,7 +634,7 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
634
634
|
return typeof O == "object" && O && "response" in O && O.response && typeof O.response == "object" && "status" in O.response && O.response && typeof O.response == "object" && "status" in O.response && ((K = O == null ? void 0 : O.response) == null ? void 0 : K.status) === 401 && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(h), p(i)), Promise.reject(O);
|
|
635
635
|
}
|
|
636
636
|
));
|
|
637
|
-
}, [u.defaults.headers.common, u.interceptors.response, h, i]),
|
|
637
|
+
}, [u.defaults.headers.common, u.interceptors.response, h, i]), S && !g ? /* @__PURE__ */ Y.jsx(yt, { fallback: t, children: (L = (x = R.state) == null ? void 0 : x.from) != null && L.state && (($ = (I = R.state) == null ? void 0 : I.from) == null ? void 0 : $.pathname) === o ? /* @__PURE__ */ Y.jsx(s, { to: R.state.from.state.from.pathname + R.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ Y.jsx(P, {}) }) : /* @__PURE__ */ Y.jsx(s, { to: o + R.search, state: { from: R }, replace: !0 });
|
|
638
638
|
}, $t = ({ data: t, ...n }) => {
|
|
639
639
|
const { libraries: o } = F(D), i = (n == null ? void 0 : n.reactRouter) || (o == null ? void 0 : o.reactRouter), a = (n == null ? void 0 : n.gtm) || (o == null ? void 0 : o.gtm);
|
|
640
640
|
if (!i)
|
|
@@ -663,7 +663,7 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
663
663
|
if (!(u != null && u.defaults))
|
|
664
664
|
return null;
|
|
665
665
|
if (typeof window < "u" && window.localStorage) {
|
|
666
|
-
const h = localStorage.getItem(d), g = h ? JSON.parse(h) : null, p = g != null && g[t] ? g[t] : null,
|
|
666
|
+
const h = localStorage.getItem(d), g = h ? JSON.parse(h) : null, p = g != null && g[t] ? g[t] : null, _ = g != null && g[n] ? g[n] : null, s = h ? `${p} ${_}` : null;
|
|
667
667
|
s && (u.defaults.headers.common.Authorization = s);
|
|
668
668
|
}
|
|
669
669
|
return u.defaults.baseURL = a, u.defaults.headers.post["Content-Type"] = o, null;
|
|
@@ -702,15 +702,15 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
702
702
|
release: h,
|
|
703
703
|
...g
|
|
704
704
|
}) => {
|
|
705
|
-
const { libraries: p } = F(D),
|
|
706
|
-
if (!
|
|
705
|
+
const { libraries: p } = F(D), _ = (g == null ? void 0 : g.sentry) || (p == null ? void 0 : p.sentry), s = (g == null ? void 0 : g.reactRouter) || (p == null ? void 0 : p.reactRouter);
|
|
706
|
+
if (!_)
|
|
707
707
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
708
708
|
if (!s)
|
|
709
709
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
710
|
-
if (
|
|
710
|
+
if (_.isInitialized())
|
|
711
711
|
return null;
|
|
712
|
-
const { createRoutesFromChildren:
|
|
713
|
-
return (d || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") &&
|
|
712
|
+
const { createRoutesFromChildren: P, matchRoutes: R, useLocation: b, useNavigationType: y } = s;
|
|
713
|
+
return (d || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && _.init({
|
|
714
714
|
debug: d,
|
|
715
715
|
dsn: t,
|
|
716
716
|
environment: u || "production",
|
|
@@ -724,8 +724,8 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
724
724
|
/vite:preloadError/
|
|
725
725
|
],
|
|
726
726
|
integrations: [
|
|
727
|
-
|
|
728
|
-
createRoutesFromChildren:
|
|
727
|
+
_.reactRouterV6BrowserTracingIntegration({
|
|
728
|
+
createRoutesFromChildren: P,
|
|
729
729
|
matchRoutes: R,
|
|
730
730
|
useEffect: V,
|
|
731
731
|
useLocation: b,
|
|
@@ -793,7 +793,7 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
793
793
|
...o
|
|
794
794
|
},
|
|
795
795
|
queries: {
|
|
796
|
-
getNextPageParam: (g, p,
|
|
796
|
+
getNextPageParam: (g, p, _) => g.length + (_ || 0),
|
|
797
797
|
refetchOnWindowFocus: !1,
|
|
798
798
|
retry: 3,
|
|
799
799
|
...n
|
|
@@ -803,18 +803,20 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
803
803
|
return /* @__PURE__ */ Y.jsx(l, { client: d, children: t });
|
|
804
804
|
}, Gt = (t) => {
|
|
805
805
|
var h, g, p;
|
|
806
|
-
const { libraries: n } = F(D), o = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), i = ((h = t == null ? void 0 : t.i18) == null ? void 0 : h.translateFunction) || ((g = n == null ? void 0 : n.i18) == null ? void 0 : g.translateFunction), a = ((p = o == null ? void 0 : o.i18next) == null ? void 0 : p.t) || i || ((
|
|
807
|
-
(
|
|
808
|
-
var
|
|
809
|
-
|
|
810
|
-
|
|
806
|
+
const { libraries: n } = F(D), o = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), i = ((h = t == null ? void 0 : t.i18) == null ? void 0 : h.translateFunction) || ((g = n == null ? void 0 : n.i18) == null ? void 0 : g.translateFunction), a = ((p = o == null ? void 0 : o.i18next) == null ? void 0 : p.t) || i || ((_) => _), { unknownErrorTranslationKey: f = "error.unknownError" } = t || {}, l = a(f), d = te(
|
|
807
|
+
(_) => {
|
|
808
|
+
var P, R, b, y, S, x, L, I, $;
|
|
809
|
+
if (_ instanceof Error)
|
|
810
|
+
return _.message;
|
|
811
|
+
const { response: s } = _ || {};
|
|
812
|
+
return s != null && s.reason ? String(s.reason) : (P = s == null ? void 0 : s.data) != null && P.reason ? String(s.data.reason) : (R = s == null ? void 0 : s.data) != null && R.message ? String(s.data.message) : (y = (b = s == null ? void 0 : s.data) == null ? void 0 : b.detail) != null && y.length && Array.isArray((S = s == null ? void 0 : s.data) == null ? void 0 : S.detail) && ((L = (x = s == null ? void 0 : s.data) == null ? void 0 : x.detail[0]) != null && L.msg) && typeof (($ = (I = s == null ? void 0 : s.data) == null ? void 0 : I.detail[0]) == null ? void 0 : $.msg) == "string" ? String(s.data.detail[0].msg) : l;
|
|
811
813
|
},
|
|
812
814
|
[l]
|
|
813
815
|
);
|
|
814
|
-
return { getErrorCode: te((
|
|
815
|
-
var
|
|
816
|
-
const { response: s } =
|
|
817
|
-
return s != null && s.error_code ? String(s == null ? void 0 : s.error_code) : (
|
|
816
|
+
return { getErrorCode: te((_) => {
|
|
817
|
+
var P, R, b;
|
|
818
|
+
const { response: s } = _ || {};
|
|
819
|
+
return s != null && s.error_code ? String(s == null ? void 0 : s.error_code) : (P = s == null ? void 0 : s.data) != null && P.error_code ? String((R = s == null ? void 0 : s.data) == null ? void 0 : R.error_code) : s != null && s.error_code ? String(s == null ? void 0 : s.error_code) : (b = s == null ? void 0 : s.data) != null && b.error_code ? String(s.data.error_code) : "unknown_error_code";
|
|
818
820
|
}, []), printError: d };
|
|
819
821
|
}, Jt = ({
|
|
820
822
|
data: t,
|
|
@@ -924,37 +926,37 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
924
926
|
throw new Error(
|
|
925
927
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
|
|
926
928
|
);
|
|
927
|
-
const g = (
|
|
928
|
-
const y = Ye(
|
|
929
|
+
const g = (P, R, b = !0) => {
|
|
930
|
+
const y = Ye(P, (t == null ? void 0 : t.pathname) || l, h);
|
|
929
931
|
if (!R || Array.isArray(R) && !R.length) {
|
|
930
|
-
d.delete(
|
|
932
|
+
d.delete(P), u(d), localStorage.removeItem(y);
|
|
931
933
|
return;
|
|
932
934
|
}
|
|
933
|
-
b && R && localStorage.setItem(y, JSON.stringify({ ...d, [
|
|
935
|
+
b && R && localStorage.setItem(y, JSON.stringify({ ...d, [P]: R })), R && (d.set(P, JSON.stringify(R)), u(d));
|
|
934
936
|
};
|
|
935
937
|
return {
|
|
936
|
-
getFilter: (
|
|
937
|
-
const b = d.get(
|
|
938
|
+
getFilter: (P, R) => {
|
|
939
|
+
const b = d.get(P);
|
|
938
940
|
if (b)
|
|
939
941
|
try {
|
|
940
942
|
return JSON.parse(b);
|
|
941
943
|
} catch {
|
|
942
944
|
return b;
|
|
943
945
|
}
|
|
944
|
-
const y = Ye(
|
|
945
|
-
if (
|
|
946
|
+
const y = Ye(P, (t == null ? void 0 : t.pathname) || l, h), S = localStorage.getItem(y);
|
|
947
|
+
if (S)
|
|
946
948
|
try {
|
|
947
|
-
return JSON.parse(
|
|
949
|
+
return JSON.parse(S)[P];
|
|
948
950
|
} catch {
|
|
949
951
|
}
|
|
950
952
|
return R;
|
|
951
953
|
},
|
|
952
954
|
getFilters: () => {
|
|
953
|
-
const
|
|
955
|
+
const P = Object.fromEntries(d.entries()), b = Object.keys(localStorage).filter(
|
|
954
956
|
(y) => y.startsWith(h) && y.endsWith((t == null ? void 0 : t.pathname) || l)
|
|
955
|
-
).reduce((y,
|
|
957
|
+
).reduce((y, S) => {
|
|
956
958
|
var L, I;
|
|
957
|
-
const x = localStorage.getItem(
|
|
959
|
+
const x = localStorage.getItem(S);
|
|
958
960
|
if (x) {
|
|
959
961
|
const $ = JSON.parse(x), O = (L = Object.keys($)) == null ? void 0 : L[0];
|
|
960
962
|
y[O] = (I = Object.values($)) == null ? void 0 : I[0];
|
|
@@ -962,17 +964,17 @@ const D = gt({}), Lt = ({ children: t, apiURL: n, libraries: o, localStorageKeys
|
|
|
962
964
|
return y;
|
|
963
965
|
}, {});
|
|
964
966
|
return {
|
|
965
|
-
...
|
|
967
|
+
...P,
|
|
966
968
|
...b
|
|
967
969
|
};
|
|
968
970
|
},
|
|
969
|
-
handleFilter: (
|
|
971
|
+
handleFilter: (P, R) => (b, y) => {
|
|
970
972
|
if (y || Array.isArray(y) && y.length === 0) {
|
|
971
|
-
const
|
|
972
|
-
g(
|
|
973
|
+
const S = R || "value", x = typeof y == "object" && S in y ? y[S] : y;
|
|
974
|
+
g(P, x);
|
|
973
975
|
return;
|
|
974
976
|
}
|
|
975
|
-
g(
|
|
977
|
+
g(P, void 0);
|
|
976
978
|
},
|
|
977
979
|
setFilter: g
|
|
978
980
|
};
|