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