@tracktor/shared-module 0.1.0 → 0.2.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.
@@ -1,27 +0,0 @@
1
- "use strict";const V=require("react");var X={},sr={get exports(){return X},set exports(g){X=g}},A={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Te;function fr(){if(Te)return A;Te=1;var g=V,y=Symbol.for("react.element"),S=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,R=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function T(C,l,w){var v,b={},O=null,$=null;w!==void 0&&(O=""+w),l.key!==void 0&&(O=""+l.key),l.ref!==void 0&&($=l.ref);for(v in l)E.call(l,v)&&!m.hasOwnProperty(v)&&(b[v]=l[v]);if(C&&C.defaultProps)for(v in l=C.defaultProps,l)b[v]===void 0&&(b[v]=l[v]);return{$$typeof:y,type:C,key:O,ref:$,props:b,_owner:R.current}}return A.Fragment=S,A.jsx=T,A.jsxs=T,A}var I={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Ce;function lr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var g=V,y=Symbol.for("react.element"),S=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),C=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),Z=Symbol.iterator,Se="@@iterator";function we(e){if(e===null||typeof e!="object")return null;var r=Z&&e[Z]||e[Se];return typeof r=="function"?r:null}var j=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];je("error",e,t)}}function je(e,r,t){{var n=j.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var xe=!1,ke=!1,De=!1,Fe=!1,Ae=!1,Q;Q=Symbol.for("react.module.reference");function Ie(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===m||Ae||e===R||e===w||e===v||Fe||e===$||xe||ke||De||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===b||e.$$typeof===T||e.$$typeof===C||e.$$typeof===l||e.$$typeof===Q||e.getModuleId!==void 0))}function $e(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ee(e){return e.displayName||"Context"}function h(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case S:return"Portal";case m:return"Profiler";case R:return"StrictMode";case w:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case C:var r=e;return ee(r)+".Consumer";case T:var t=e;return ee(t._context)+".Provider";case l:return $e(e,e.render,"ForwardRef");case b:var n=e.displayName||null;return n!==null?n:h(e.type)||"Memo";case O:{var o=e,u=o._payload,i=o._init;try{return h(i(u))}catch{return null}}}return null}var P=Object.assign,D=0,re,te,ne,ae,ie,oe,ue;function se(){}se.__reactDisabledLog=!0;function We(){{if(D===0){re=console.log,te=console.info,ne=console.warn,ae=console.error,ie=console.group,oe=console.groupCollapsed,ue=console.groupEnd;var e={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}}function Ye(){{if(D--,D===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:re}),info:P({},e,{value:te}),warn:P({},e,{value:ne}),error:P({},e,{value:ae}),group:P({},e,{value:ie}),groupCollapsed:P({},e,{value:oe}),groupEnd:P({},e,{value:ue})})}D<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var U=j.ReactCurrentDispatcher,q;function W(e,r,t){{if(q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
18
- `+q+e}}var B=!1,Y;{var Le=typeof WeakMap=="function"?WeakMap:Map;Y=new Le}function fe(e,r){if(!e||B)return"";{var t=Y.get(e);if(t!==void 0)return t}var n;B=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=U.current,U.current=null,We();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(_){n=_}Reflect.construct(e,[],i)}else{try{i.call()}catch(_){n=_}e.call(i.prototype)}}else{try{throw Error()}catch(_){n=_}e()}}catch(_){if(_&&n&&typeof _.stack=="string"){for(var a=_.stack.split(`
19
- `),d=n.stack.split(`
20
- `),s=a.length-1,f=d.length-1;s>=1&&f>=0&&a[s]!==d[f];)f--;for(;s>=1&&f>=0;s--,f--)if(a[s]!==d[f]){if(s!==1||f!==1)do if(s--,f--,f<0||a[s]!==d[f]){var p=`
21
- `+a[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&Y.set(e,p),p}while(s>=1&&f>=0);break}}}finally{B=!1,U.current=u,Ye(),Error.prepareStackTrace=o}var k=e?e.displayName||e.name:"",me=k?W(k):"";return typeof e=="function"&&Y.set(e,me),me}function Ne(e,r,t){return fe(e,!1)}function Me(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function L(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Me(e));if(typeof e=="string")return W(e);switch(e){case w:return W("Suspense");case v:return W("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Ne(e.render);case b:return L(e.type,r,t);case O:{var n=e,o=n._payload,u=n._init;try{return L(u(o),r,t)}catch{}}}return""}var N=Object.prototype.hasOwnProperty,le={},ce=j.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);ce.setExtraStackFrame(t)}else ce.setExtraStackFrame(null)}function Ve(e,r,t,n,o){{var u=Function.call.bind(N);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var d=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(M(o),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),M(null)),a instanceof Error&&!(a.message in le)&&(le[a.message]=!0,M(o),c("Failed %s type: %s",t,a.message),M(null))}}}var Ue=Array.isArray;function J(e){return Ue(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Be(e){try{return de(e),!1}catch{return!0}}function de(e){return""+e}function ve(e){if(Be(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(e)),de(e)}var F=j.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0},pe,ge,G;G={};function Ge(e){if(N.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ze(e){if(N.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ke(e,r){if(typeof e.ref=="string"&&F.current&&r&&F.current.stateNode!==r){var t=h(F.current.type);G[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',h(F.current.type),e.ref),G[t]=!0)}}function He(e,r){{var t=function(){pe||(pe=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Xe(e,r){{var t=function(){ge||(ge=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Ze=function(e,r,t,n,o,u,i){var a={$$typeof:y,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Qe(e,r,t,n,o){{var u,i={},a=null,d=null;t!==void 0&&(ve(t),a=""+t),ze(r)&&(ve(r.key),a=""+r.key),Ge(r)&&(d=r.ref,Ke(r,o));for(u in r)N.call(r,u)&&!Je.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)i[u]===void 0&&(i[u]=s[u])}if(a||d){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&He(i,f),d&&Xe(i,f)}return Ze(e,a,d,o,n,F.current,i)}}var z=j.ReactCurrentOwner,Ee=j.ReactDebugCurrentFrame;function x(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var K;K=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function be(){{if(z.current){var e=h(z.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function er(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
-
25
- Check your code at `+r+":"+t+"."}return""}}var he={};function rr(e){{var r=be();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
-
27
- Check the top-level render call using <`+t+">.")}return r}}function _e(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=rr(r);if(he[t])return;he[t]=!0;var n="";e&&e._owner&&e._owner!==z.current&&(n=" It was passed a child from "+h(e._owner.type)+"."),x(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),x(null)}}function ye(e,r){{if(typeof e!="object")return;if(J(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&_e(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var o=we(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)H(i.value)&&_e(i.value,r)}}}function tr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===b))t=r.propTypes;else return;if(t){var n=h(r);Ve(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!K){K=!0;var o=h(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){x(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),x(null);break}}e.ref!==null&&(x(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),x(null))}}function Re(e,r,t,n,o,u){{var i=Ie(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 d=er(o);d?a+=d:a+=be();var s;e===null?s="null":J(e)?s="array":e!==void 0&&e.$$typeof===y?(s="<"+(h(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var f=Qe(e,r,t,o,u);if(f==null)return f;if(i){var p=r.children;if(p!==void 0)if(n)if(J(p)){for(var k=0;k<p.length;k++)ye(p[k],e);Object.freeze&&Object.freeze(p)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ye(p,e)}return e===E?nr(f):tr(f),f}}function ar(e,r,t){return Re(e,r,t,!0)}function ir(e,r,t){return Re(e,r,t,!1)}var or=ir,ur=ar;I.Fragment=E,I.jsx=or,I.jsxs=ur}()),I}(function(g){process.env.NODE_ENV==="production"?g.exports=fr():g.exports=lr()})(sr);const Oe=X.jsx,Pe=V.createContext({children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),cr=({children:g,translate:y,useAuth:S,Outlet:E,Navigate:R,useLocation:m})=>{const T=V.useMemo(()=>({Navigate:R,Outlet:E,translate:y,useAuth:S,useLocation:m}),[R,E,y,S,m]);return Oe(Pe.Provider,{value:T,children:g})};exports.InjectDependenciesContext=Pe;exports.InjectDependenciesProvider=cr;exports.jsx=Oe;
@@ -1,24 +0,0 @@
1
- import { a as v, j as r } from "./InjectDependenciesProvider-3bbc437d.js";
2
- import { useContext as w, Suspense as p } from "react";
3
- const o = (a) => `RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, E = ({ Fallback: a, loginPath: i = "/login", ...t }) => {
4
- var f, d, h, m;
5
- const {
6
- useLocation: s = t.useLocation,
7
- useAuth: u = t.useAuth,
8
- Outlet: c = t.Outlet,
9
- Navigate: n = t.Navigate
10
- } = w(v);
11
- if (u === void 0)
12
- throw new Error(o("useAuth"));
13
- if (s === void 0)
14
- throw new Error(o("useLocation"));
15
- if (c === void 0)
16
- throw new Error(o("Outlet"));
17
- if (n === void 0)
18
- throw new Error(o("Navigate"));
19
- const { isLogged: l } = u(), e = s();
20
- return l ? /* @__PURE__ */ r(p, { fallback: a, children: (d = (f = e.state) == null ? void 0 : f.from) != null && d.state && ((m = (h = e.state) == null ? void 0 : h.from) == null ? void 0 : m.pathname) === i ? /* @__PURE__ */ r(n, { to: e.state.from.state.from.pathname + e.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ r(c, {}) }) : /* @__PURE__ */ r(n, { to: i, state: { from: e }, replace: !0 });
21
- };
22
- export {
23
- E as R
24
- };
@@ -1 +0,0 @@
1
- "use strict";const t=require("./InjectDependenciesProvider-40e2c821.cjs"),v=require("react"),o=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,w=({Fallback:n,loginPath:s="/login",...r})=>{var d,h,f,l;const{useLocation:u=r.useLocation,useAuth:a=r.useAuth,Outlet:c=r.Outlet,Navigate:i=r.Navigate}=v.useContext(t.InjectDependenciesContext);if(a===void 0)throw new Error(o("useAuth"));if(u===void 0)throw new Error(o("useLocation"));if(c===void 0)throw new Error(o("Outlet"));if(i===void 0)throw new Error(o("Navigate"));const{isLogged:m}=a(),e=u();return m?t.jsx(v.Suspense,{fallback:n,children:(h=(d=e.state)==null?void 0:d.from)!=null&&h.state&&((l=(f=e.state)==null?void 0:f.from)==null?void 0:l.pathname)===s?t.jsx(i,{to:e.state.from.state.from.pathname+e.state.from.state.from.search,replace:!0}):t.jsx(c,{})}):t.jsx(i,{to:s,state:{from:e},replace:!0})};exports.RequireAuth=w;
@@ -1,2 +0,0 @@
1
- export { default as useResponseError } from '../api/hooks/useResponseError';
2
- export * from '../api/hooks/useResponseError';
@@ -1,14 +0,0 @@
1
- export type ResponseError = {
2
- code?: number;
3
- message?: string;
4
- payload?: any;
5
- reason?: string;
6
- detail?: [
7
- {
8
- loc?: [];
9
- msg?: string;
10
- type?: string;
11
- }
12
- ];
13
- } | any;
14
- export default ResponseError;
package/dist/api.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useResponseError-51d8f1ab.cjs");require("react");require("./InjectDependenciesProvider-40e2c821.cjs");exports.useResponseError=e.useResponseError;
package/dist/api.js DELETED
@@ -1,6 +0,0 @@
1
- import { u as s } from "./useResponseError-adb9412c.js";
2
- import "react";
3
- import "./InjectDependenciesProvider-3bbc437d.js";
4
- export {
5
- s as useResponseError
6
- };
@@ -1,2 +0,0 @@
1
- export { default as RequireAuth } from '../auth/components/RequireAuth';
2
- export * from '../auth/components/RequireAuth';
package/dist/auth.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./RequireAuth-da69fc85.cjs");require("./InjectDependenciesProvider-40e2c821.cjs");require("react");exports.RequireAuth=e.RequireAuth;
package/dist/auth.js DELETED
@@ -1,6 +0,0 @@
1
- import { R as i } from "./RequireAuth-c1956d94.js";
2
- import "./InjectDependenciesProvider-3bbc437d.js";
3
- import "react";
4
- export {
5
- i as RequireAuth
6
- };
@@ -1,2 +0,0 @@
1
- export { default as InjectDependenciesProvider } from '../context/InjectDependenciesProvider';
2
- export * from '../context/InjectDependenciesProvider';
package/dist/context.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./InjectDependenciesProvider-40e2c821.cjs");require("react");exports.InjectDependenciesContext=e.InjectDependenciesContext;exports.InjectDependenciesProvider=e.InjectDependenciesProvider;
package/dist/context.js DELETED
@@ -1,6 +0,0 @@
1
- import { a as o, I as r } from "./InjectDependenciesProvider-3bbc437d.js";
2
- import "react";
3
- export {
4
- o as InjectDependenciesContext,
5
- r as InjectDependenciesProvider
6
- };
package/dist/main.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useResponseError-51d8f1ab.cjs"),n=require("./RequireAuth-da69fc85.cjs"),e=require("./InjectDependenciesProvider-40e2c821.cjs");require("react");exports.useResponseError=r.useResponseError;exports.RequireAuth=n.RequireAuth;exports.InjectDependenciesContext=e.InjectDependenciesContext;exports.InjectDependenciesProvider=e.InjectDependenciesProvider;
@@ -1 +0,0 @@
1
- "use strict";const y=require("react"),q=require("./InjectDependenciesProvider-40e2c821.cjs"),w=a=>{const{unknownErrorTranslationKey:r="error.unknownError"}=a||{},{translate:i=a==null?void 0:a.translate}=y.useContext(q.InjectDependenciesContext);return{printError:y.useCallback(t=>{var d,u,c,l,n,g,E,f,k;return(d=t==null?void 0:t.data)!=null&&d.reason?String(t.data.reason):(u=t==null?void 0:t.data)!=null&&u.message?String(t.data.message):(l=(c=t==null?void 0:t.data)==null?void 0:c.detail)!=null&&l.length&&Array.isArray((n=t==null?void 0:t.data)==null?void 0:n.detail)&&((E=(g=t==null?void 0:t.data)==null?void 0:g.detail[0])!=null&&E.msg)&&typeof((k=(f=t==null?void 0:t.data)==null?void 0:f.detail[0])==null?void 0:k.msg)=="string"?String(t.data.detail[0].msg):i?i(r):"Unknown error"},[i,r])}};exports.useResponseError=w;
@@ -1,15 +0,0 @@
1
- import { useContext as m, useCallback as y } from "react";
2
- import { a as w } from "./InjectDependenciesProvider-3bbc437d.js";
3
- const A = (a) => {
4
- const { unknownErrorTranslationKey: d = "error.unknownError" } = a || {}, { translate: i = a == null ? void 0 : a.translate } = m(w);
5
- return { printError: y(
6
- (t) => {
7
- var r, l, u, g, c, f, n, E, k;
8
- return (r = t == null ? void 0 : t.data) != null && r.reason ? String(t.data.reason) : (l = t == null ? void 0 : t.data) != null && l.message ? String(t.data.message) : (g = (u = t == null ? void 0 : t.data) == null ? void 0 : u.detail) != null && g.length && Array.isArray((c = t == null ? void 0 : t.data) == null ? void 0 : c.detail) && ((n = (f = t == null ? void 0 : t.data) == null ? void 0 : f.detail[0]) != null && n.msg) && typeof ((k = (E = t == null ? void 0 : t.data) == null ? void 0 : E.detail[0]) == null ? void 0 : k.msg) == "string" ? String(t.data.detail[0].msg) : i ? i(d) : "Unknown error";
9
- },
10
- [i, d]
11
- ) };
12
- };
13
- export {
14
- A as u
15
- };