@cyberskill/shared 1.60.0 → 1.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +0 -15
- package/dist/_tsup-dts-rollup.d.ts +0 -15
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/react/apollo-client.cjs +1 -1
- package/dist/react/apollo-client.js +1 -1
- package/dist/react/apollo-error.cjs +1 -1
- package/dist/react/apollo-error.d.cts +0 -1
- package/dist/react/apollo-error.d.ts +0 -1
- package/dist/react/apollo-error.js +1 -1
- package/dist/react/apollo-error.module.d.cts +1 -0
- package/dist/react/apollo-error.module.d.ts +1 -0
- package/dist/react/apollo-error.module.scss +111 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.cts +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +1 -1
- package/dist/react/loading.module.scss +1 -8
- package/dist/typescript/apollo-error.d.cts +0 -1
- package/dist/typescript/apollo-error.d.ts +0 -1
- package/package.json +1 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.modal-backdrop {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0;
|
|
4
|
+
z-index: 9999999;
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
padding: 1rem;
|
|
10
|
+
|
|
11
|
+
.modal-content {
|
|
12
|
+
position: relative;
|
|
13
|
+
background-color: #0f172a;
|
|
14
|
+
color: white;
|
|
15
|
+
max-width: 42rem;
|
|
16
|
+
width: 100%;
|
|
17
|
+
border-radius: 0.75rem;
|
|
18
|
+
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
padding: 2rem;
|
|
21
|
+
|
|
22
|
+
.btn-close {
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0.75rem;
|
|
25
|
+
right: 1rem;
|
|
26
|
+
font-size: 1.25rem;
|
|
27
|
+
color: white;
|
|
28
|
+
background: none;
|
|
29
|
+
border: none;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
transition: color 0.2s;
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
color: #f87171;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.error-title {
|
|
39
|
+
font-size: 1.75rem;
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
margin-bottom: 0.5rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.error-text {
|
|
45
|
+
font-size: 0.875rem;
|
|
46
|
+
color: #cbd5e1;
|
|
47
|
+
margin-bottom: 1rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.error-details {
|
|
51
|
+
background-color: #1e293b;
|
|
52
|
+
text-align: left;
|
|
53
|
+
font-size: 0.875rem;
|
|
54
|
+
border-radius: 0.5rem;
|
|
55
|
+
padding: 1rem;
|
|
56
|
+
margin-bottom: 1.5rem;
|
|
57
|
+
max-height: 16rem;
|
|
58
|
+
overflow-y: auto;
|
|
59
|
+
border: 1px solid #334155;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 0.5rem;
|
|
63
|
+
|
|
64
|
+
pre {
|
|
65
|
+
white-space: pre-wrap;
|
|
66
|
+
word-break: break-word;
|
|
67
|
+
|
|
68
|
+
&.main {
|
|
69
|
+
color: #fca5a5;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.network {
|
|
73
|
+
color: #fde68a;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.extra {
|
|
77
|
+
color: #67e8f9;
|
|
78
|
+
overflow-x: auto;
|
|
79
|
+
white-space: pre;
|
|
80
|
+
font-family:
|
|
81
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
|
82
|
+
monospace;
|
|
83
|
+
background-color: #0f172a;
|
|
84
|
+
padding: 0.5rem;
|
|
85
|
+
border-radius: 0.375rem;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
ul {
|
|
90
|
+
padding-left: 1rem;
|
|
91
|
+
color: #fda4af;
|
|
92
|
+
list-style: disc;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.btn-retry {
|
|
97
|
+
background: linear-gradient(to right, #3b82f6, #06b6d4);
|
|
98
|
+
color: white;
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
padding: 0.5rem 1.5rem;
|
|
101
|
+
border-radius: 0.75rem;
|
|
102
|
+
transition: background 0.3s ease;
|
|
103
|
+
border: none;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
|
|
106
|
+
&:hover {
|
|
107
|
+
background: linear-gradient(to right, #2563eb, #0891b2);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
package/dist/react/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,i,l){try{var a=e[i](l);var u=a.value}catch(e){t(e);return}if(a.done){r(u)}else{Promise.resolve(u).then(n,o)}}function i(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var l=e.apply(r,t);function a(e){o(l,n,i,a,u,"next",e)}function u(e){o(l,n,i,a,u,"throw",e)}a(undefined)})}}function l(e,r,t){r=f(r);return E(e,A()?Reflect.construct(r,t||[],f(e).constructor):r.apply(e,t))}function a(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function u(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function s(e,r,t){if(r)u(e.prototype,r);if(t)u(e,t);return e}function c(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)k(e,r)}function v(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function p(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var l,a;try{for(t=t.call(e);!(o=(l=t.next()).done);o=true){n.push(l.value);if(r&&n.length===r)break}}catch(e){i=true;a=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw a}}return n}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){c(e,r,t[r])})}return e}function y(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function x(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function w(e,r){if(e==null)return{};var t=j(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function j(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function E(e,r){if(r&&(P(r)==="object"||typeof r==="function")){return r}return n(e)}function k(e,r){k=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return k(e,r)}function N(e,t){return r(e)||h(e,t)||S(e,t)||m()}function O(e){return t(e)||p(e)||S(e)||g()}function P(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function S(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function L(e,r){var t,n,o,i,l={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(r){return u([e,r])}}function u(i){if(t)throw new TypeError("Generator is already executing.");while(l)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:l.label++;return{value:i[1],done:false};case 5:l.label++;n=i[1];i=[0];continue;case 7:i=l.ops.pop();l.trys.pop();continue;default:if(!(o=l.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){l=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(i[0]===6&&l.label<o[1]){l.label=o[1];o=i;break}if(o&&l.label<o[2]){l.label=o[2];l.ops.push(i);break}if(o[2])l.ops.pop();l.trys.pop();continue}i=r.call(e,l)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var I=Object.create;var C=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var V=function(e,r){for(var t in r)C(e,t,{get:r[t],enumerable:!0})},D=function(e,r,t,n){var o=true,i=false,l=undefined;if(r&&(typeof r==="undefined"?"undefined":P(r))=="object"||typeof r=="function")try{var a=function(){var o=s.value;!T.call(e,o)&&o!==t&&C(e,o,{get:function(){return r[o]},enumerable:!(n=q(r,o))||n.enumerable})};for(var u=_(r)[Symbol.iterator](),s;!(o=(s=u.next()).done);o=true)a()}catch(e){i=true;l=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(i){throw l}}}return e};var U=function(e,r,t){return t=e!=null?I(M(e)):{},D(r||!e||!e.__esModule?C(t,"default",{value:e,enumerable:!0}):t,e)},R=function(e){return D(C({},"__esModule",{value:!0}),e)};var G={};V(G,{ApolloErrorScreen:function(){return ea},ApolloErrorViewerModal:function(){return eu},ApolloErrorViewerProvider:function(){return el},ApolloProvider:function(){return ed},Loading:function(){return ey},LoadingContext:function(){return eg},LoadingProvider:function(){return ex},NextIntlContext:function(){return eA},NextIntlProvider:function(){return eM},registerApolloErrorViewerCallback:function(){return eo},showGlobalApolloError:function(){return ei},useApolloErrorViewer:function(){return et},useLoading:function(){return eb},useNextIntl:function(){return eL},useStorage:function(){return eP},useTranslateNextIntl:function(){return eI},withNextIntl:function(){return eC}});module.exports=R(G);var Q=require("@apollo/client"),z=require("@apollo/client/link/error"),J=require("@apollo/client/link/remove-typename"),F=require("@apollo/client/link/retry"),H=require("@apollo/client/link/subscriptions"),W=require("@apollo/client/utilities"),B=require("graphql-ws"),Z=require("react"),$=require("react-hot-toast"),K=require("react-icons/fa6");var X="/graphql";var Y=require("react"),ee=require("react/jsx-runtime"),er=(0,Y.createContext)(void 0);function et(){var e=(0,Y.use)(er);if(!e)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return e}var en=null;function eo(e){en=e}function ei(e){en&&en(e)}function el(e){var r=e.children;var t=N((0,Y.useState)(null),2),n=t[0],o=t[1];(0,Y.useEffect)(function(){eo(o)},[]);var i=(0,Y.useMemo)(function(){return{error:n,showError:o,hideError:function(){return o(null)}}},[n]);return(0,ee.jsx)(er,{value:i,children:r})}function ea(e){var r=e.error,t=e.refetch;var n,o,i;return(0,ee.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 p-6",children:(0,ee.jsxs)("div",{className:"backdrop-blur-md bg-white/10 border border-white/20 shadow-xl rounded-2xl p-8 w-full max-w-lg text-center text-white",children:[(0,ee.jsx)("div",{className:"text-5xl mb-4",children:"\uD83D\uDEA8"}),(0,ee.jsx)("h1",{className:"text-2xl font-bold mb-2",children:"Something went wrong"}),(0,ee.jsx)("p",{className:"text-sm text-slate-300 mb-4",children:"A problem occurred while communicating with the server."}),(0,ee.jsxs)("div",{className:"bg-slate-800 text-left text-sm rounded-lg px-4 py-3 mb-6 overflow-auto max-h-64 border border-slate-700 space-y-2",children:[(0,ee.jsxs)("pre",{className:"text-red-300 whitespace-pre-wrap break-words",children:[(0,ee.jsx)("strong",{children:"Main Error:"})," ",r.message]}),r.networkError&&(0,ee.jsxs)("pre",{className:"text-yellow-300 whitespace-pre-wrap break-words",children:[(0,ee.jsx)("strong",{children:"Network Error:"})," ",r.networkError.message]}),((n=r.graphQLErrors)===null||n===void 0?void 0:n.length)>0&&(0,ee.jsxs)("div",{className:"text-rose-400",children:[(0,ee.jsx)("strong",{children:"GraphQL Errors:"}),(0,ee.jsx)("ul",{className:"list-disc list-inside",children:r.graphQLErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),((o=r.protocolErrors)===null||o===void 0?void 0:o.length)>0&&(0,ee.jsxs)("div",{className:"text-rose-400",children:[(0,ee.jsx)("strong",{children:"Protocol Errors:"}),(0,ee.jsx)("ul",{className:"list-disc list-inside",children:r.protocolErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),((i=r.clientErrors)===null||i===void 0?void 0:i.length)>0&&(0,ee.jsxs)("div",{className:"text-rose-400",children:[(0,ee.jsx)("strong",{children:"Client Errors:"}),(0,ee.jsx)("ul",{className:"list-disc list-inside",children:r.clientErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),r.extraInfo&&(0,ee.jsxs)("pre",{className:"text-cyan-300 whitespace-pre-wrap break-words",children:[(0,ee.jsx)("strong",{children:"Extra Info:"})," ",JSON.stringify(r.extraInfo)]})]}),t&&(0,ee.jsx)("button",{type:"button",onClick:t,className:"bg-gradient-to-r from-blue-500 to-cyan-500 hover:from-blue-600 hover:to-cyan-600 text-white font-semibold px-6 py-2 rounded-xl transition duration-300",children:"\uD83D\uDD04 Retry"})]})})}function eu(){var e=(0,Y.use)(er);if(!e)return null;var r=e.error,t=e.hideError;return r?(0,ee.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",children:(0,ee.jsxs)("div",{className:"relative bg-slate-900 text-white max-w-2xl w-full rounded-xl shadow-lg overflow-hidden",children:[(0,ee.jsx)("button",{type:"button",onClick:t,className:"absolute top-3 right-4 text-xl hover:text-red-400",children:"✕"}),(0,ee.jsx)(ea,{error:r})]})}):null}var es=require("react/jsx-runtime"),ec=/*#__PURE__*/function(e){d(r,e);function r(){a(this,r);var e;e=l(this,r,arguments);e.count=0;return e}s(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-n,i=e.operationName||"Unnamed";return console.info("[Apollo] #".concat(t.count,": ").concat(i," (").concat(o,"ms)")),r})}}]);return r}(Q.ApolloLink);function ef(e){var r=e||{},t=r.uri,n=r.wsUrl,o=r.customLinks,i=new ec,l=(0,z.onError)(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,o=e.operation;var i=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;console.error("[GraphQL error] ".concat(i,": ").concat(r,", Location: ").concat(JSON.stringify(t),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;console.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t)))}),t&&console.error("[Network error]: ".concat(t)),r||n||t){var l,a;var u=(r===null||r===void 0?void 0:(l=r[0])===null||l===void 0?void 0:l.message)||(n===null||n===void 0?void 0:(a=n[0])===null||a===void 0?void 0:a.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",s=new Q.ApolloError({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:u,extraInfo:{operation:o}});$.toast.custom(function(e){return(0,es.jsxs)("div",{className:"bg-slate-800 text-white px-4 py-3 rounded shadow-md flex flex-col gap-2 w-full max-w-sm",children:[(0,es.jsxs)("div",{className:"text-sm font-medium",children:["\uD83D\uDEA8",i," ","—",u]}),(0,es.jsx)(K.FaQuestion,{onClick:function(){setTimeout(function(){ei(s)},0),$.toast.dismiss(e.id)},className:"text-xs text-blue-400 hover:text-blue-300 underline self-start"})]})})}}),a=new F.RetryLink,u=(0,J.removeTypenameFromVariables)();t||console.warn('[Apollo] No GraphQL URI provided — using "'.concat(X,'" as default'));var s=new Q.HttpLink({uri:t!==null&&t!==void 0?t:X,credentials:"include"});n||console.warn("[Apollo] No WebSocket URL provided — subscriptions will use HTTP only");var c=n?new H.GraphQLWsLink((0,B.createClient)({url:n})):Q.ApolloLink.empty(),f=v(c,Q.ApolloLink)?(0,Q.split)(function(e){var r=e.query;var t=(0,W.getMainDefinition)(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},c,s):s;return f===s&&n&&console.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,l,a,u].concat(O(o!==null&&o!==void 0?o:[]),[f])}function ed(e){var r=e.isNextJS,t=e.options,n=e.children,o=e.client,i=e.provider,l=e.cache;var a=t||{},u=a.uri,s=a.wsUrl,c=a.customLinks,f=w(a,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:Q.ApolloClient)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var d=i||Q.ApolloProvider,p=(0,Z.useMemo)(function(){return(0,Q.from)(ef({uri:u,wsUrl:s,customLinks:c}))},[u,s,c]),h=(0,Z.useMemo)(function(){return new Q.ApolloClient(b({link:p,cache:v(l,Q.InMemoryCache)?l:new Q.InMemoryCache},f))},[p,l,f]),m=r?(0,es.jsx)(d,{makeClient:function(){return h},children:n}):(0,es.jsx)(d,{client:h,children:n});return r?(0,es.jsx)(d,{makeClient:function(){return h},children:n}):(0,es.jsxs)(es.Fragment,{children:[(0,es.jsxs)(el,{children:[m,(0,es.jsx)(eu,{})]}),(0,es.jsx)($.Toaster,{})]})}var ev=U(require("classnames"),1),ep=require("react"),eh=U(require("./loading.module.scss"),1),em=require("react/jsx-runtime"),eg=(0,ep.createContext)(void 0);function eb(){var e=(0,ep.use)(eg);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}function ey(e){var r=e.full,t=r===void 0?!1:r,n=e.block,o=n===void 0?!1:n,i=e.className,l=i===void 0?"":i,a=e.message,u=a===void 0?"Loading":a,s=w(e,["full","block","className","message"]);function c(){return(0,em.jsxs)("div",x(b({className:eh.default.container},s),{children:[(0,em.jsx)("div",{className:eh.default.ring}),(0,em.jsx)("div",{className:eh.default.ring}),(0,em.jsx)("div",{className:eh.default.ring}),(0,em.jsx)("div",{className:eh.default.ring}),u&&(0,em.jsx)("div",{className:eh.default.message,children:u})]}))}return t?(0,em.jsx)("div",{className:(0,ev.default)(eh.default.fullscreen,l),children:c()}):o?(0,em.jsx)("div",{className:(0,ev.default)(eh.default.block,l),children:c()}):c()}function ex(e){var r=e.children;var t=N((0,ep.useState)(!1),2),n=t[0],o=t[1],i=N((0,ep.useState)(!1),2),l=i[0],a=i[1],u=(0,ep.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),a(e)},[]),s=(0,ep.useCallback)(function(){o(!1),a(!1)},[]),c=(0,ep.useMemo)(function(){return{isLoading:n,isGlobalLoading:l,showLoading:u,hideLoading:s}},[n,l,u,s]);return(0,em.jsx)(eg,{value:c,children:n?(0,em.jsx)(ey,{full:l}):r})}var ew=require("next-intl"),ej=require("react");var eE=require("react");var ek={serialize:function(e){return JSON.stringify(e,function(e,r){return v(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};var eN=U(require("localforage"),1),eO={get:function e(e){return i(function(){var r;return L(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eN.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return i(function(){var t;return L(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,eN.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var r;return L(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eN.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,r;return L(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eN.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function eP(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ek;var n=N((0,eE.useState)(r),2),o=n[0],l=n[1],a=N((0,eE.useState)(!1),2),u=a[0],s=a[1];(0,eE.useEffect)(function(){var n=!0;return i(function(){var o,i,a,u;return L(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,eO.get(e)];case 1:o=c.sent();if(!n)return[3,5];if(!(o!==null))return[3,2];i=t.deserialize(o);l(i);return[3,5];case 2:if(!(r!==void 0))return[3,4];a=t.serialize(r);return[4,eO.set(e,a)];case 3:c.sent(),l(r);return[3,5];case 4:l(void 0);c.label=5;case 5:return[3,8];case 6:u=c.sent();console.error('Error loading value for key "'.concat(e,'":'),u),n&&l(r);return[3,8];case 7:n&&s(!0);return[7];case 8:return[2]}})})(),function(){n=!1,s(!1)}},[e,r,t]),(0,eE.useEffect)(function(){if(!u)return;i(function(){var r,n;return L(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,eO.set(e,r)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:n=i.sent();console.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[o,e,t,u]);var c=(0,eE.useCallback)(function(e){l(function(r){return typeof e=="function"?e(r):e})},[]),f=(0,eE.useCallback)(/*#__PURE__*/i(function(){var r;return L(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eO.remove(e)];case 1:t.sent(),l(void 0);return[3,3];case 2:r=t.sent();console.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:o,set:c,remove:f}}var eS=require("react/jsx-runtime"),eA=(0,ej.createContext)(void 0);function eL(){var e=(0,ej.use)(eA);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var eI=ew.useTranslations;function eC(e){var r=function(r){var t;var n=eL(),o=n.currentLanguage,i=r.messages,l=r.languages,a="en",u=i[(o===null||o===void 0?void 0:o.value)||a],s=(t=l.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||t===void 0?void 0:t.timezone;return i?(0,eS.jsx)(ew.NextIntlClientProvider,{locale:(o===null||o===void 0?void 0:o.value)||a,messages:u,timeZone:s,children:(0,eS.jsx)(e,b({},r))}):(console.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||a)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function eq(e){var r=e.children;return(0,eS.jsx)(eS.Fragment,{children:r})}var e_=eC(eq);function eM(e){var r=e.children,t=e.languages,n=e.messages;var o;var i=eP("lang",(o=t===null||t===void 0?void 0:t[0])!==null&&o!==void 0?o:{}),l=i.value,a=i.set,u=(0,ej.useMemo)(function(){return{languages:t,currentLanguage:l,setCurrentLanguage:a}},[t,a,l]);return(0,eS.jsx)(eA,{value:u,children:(0,eS.jsx)(e_,{languages:t,messages:n,children:r})})}0&&(module.exports={ApolloErrorScreen:ApolloErrorScreen,ApolloErrorViewerModal:ApolloErrorViewerModal,ApolloErrorViewerProvider:ApolloErrorViewerProvider,ApolloProvider:ApolloProvider,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,registerApolloErrorViewerCallback:registerApolloErrorViewerCallback,showGlobalApolloError:showGlobalApolloError,useApolloErrorViewer:useApolloErrorViewer,useLoading:useLoading,useNextIntl:useNextIntl,useStorage:useStorage,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function r(e){if(Array.isArray(e))return e}function n(r){if(Array.isArray(r))return e(r)}function t(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,n,t,o,i,u){try{var a=e[i](u);var l=a.value}catch(e){n(e);return}if(a.done){r(l)}else{Promise.resolve(l).then(t,o)}}function i(e){return function(){var r=this,n=arguments;return new Promise(function(t,i){var u=e.apply(r,n);function a(e){o(u,t,i,a,l,"next",e)}function l(e){o(u,t,i,a,l,"throw",e)}a(undefined)})}}function u(e,r,n){r=f(r);return E(e,L()?Reflect.construct(r,n||[],f(e).constructor):r.apply(e,n))}function a(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||false;t.configurable=true;if("value"in t)t.writable=true;Object.defineProperty(e,t.key,t)}}function s(e,r,n){if(r)l(e.prototype,r);if(n)l(e,n);return e}function c(e,r,n){if(r in e){Object.defineProperty(e,r,{value:n,enumerable:true,configurable:true,writable:true})}else{e[r]=n}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)k(e,r)}function v(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function p(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h(e,r){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var t=[];var o=true;var i=false;var u,a;try{for(n=n.call(e);!(o=(u=n.next()).done);o=true){t.push(u.value);if(r&&t.length===r)break}}catch(e){i=true;a=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return t}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};var t=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){t=t.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}t.forEach(function(r){c(e,r,n[r])})}return e}function b(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);if(r){t=t.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}n.push.apply(n,t)}return n}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{b(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x(e,r){if(e==null)return{};var n=j(e,r);var t,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){t=i[o];if(r.indexOf(t)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,t))continue;n[t]=e[t]}}return n}function j(e,r){if(e==null)return{};var n={};var t=Object.keys(e);var o,i;for(i=0;i<t.length;i++){o=t[i];if(r.indexOf(o)>=0)continue;n[o]=e[o]}return n}function E(e,r){if(r&&(P(r)==="object"||typeof r==="function")){return r}return t(e)}function k(e,r){k=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return k(e,r)}function O(e,n){return r(e)||h(e,n)||S(e,n)||m()}function N(e){return n(e)||p(e)||S(e)||g()}function P(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function S(r,n){if(!r)return;if(typeof r==="string")return e(r,n);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor)t=r.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(r,n)}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(L=function(){return!!e})()}function A(e,r){var n,t,o,i,u={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(r){return l([e,r])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(u)try{if(n=1,t&&(o=i[0]&2?t["return"]:i[0]?t["throw"]||((o=t["return"])&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;if(t=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:u.label++;return{value:i[1],done:false};case 5:u.label++;t=i[1];i=[0];continue;case 7:i=u.ops.pop();u.trys.pop();continue;default:if(!(o=u.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){u=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(i[0]===6&&u.label<o[1]){u.label=o[1];o=i;break}if(o&&u.label<o[2]){u.label=o[2];u.ops.push(i);break}if(o[2])u.ops.pop();u.trys.pop();continue}i=r.call(e,u)}catch(e){i=[6,e];t=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var I=Object.create;var C=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var V=function(e,r){for(var n in r)C(e,n,{get:r[n],enumerable:!0})},D=function(e,r,n,t){var o=true,i=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":P(r))=="object"||typeof r=="function")try{var a=function(){var o=s.value;!T.call(e,o)&&o!==n&&C(e,o,{get:function(){return r[o]},enumerable:!(t=q(r,o))||t.enumerable})};for(var l=_(r)[Symbol.iterator](),s;!(o=(s=l.next()).done);o=true)a()}catch(e){i=true;u=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(i){throw u}}}return e};var U=function(e,r,n){return n=e!=null?I(M(e)):{},D(r||!e||!e.__esModule?C(n,"default",{value:e,enumerable:!0}):n,e)},G=function(e){return D(C({},"__esModule",{value:!0}),e)};var Q={};V(Q,{ApolloErrorViewerModal:function(){return ea},ApolloErrorViewerProvider:function(){return eu},ApolloProvider:function(){return ef},Loading:function(){return ey},LoadingContext:function(){return em},LoadingProvider:function(){return eb},NextIntlContext:function(){return eS},NextIntlProvider:function(){return e_},registerApolloErrorViewerCallback:function(){return eo},showGlobalApolloError:function(){return ei},useApolloErrorViewer:function(){return en},useLoading:function(){return eg},useNextIntl:function(){return eL},useStorage:function(){return eN},useTranslateNextIntl:function(){return eA},withNextIntl:function(){return eI}});module.exports=G(Q);var R=require("@apollo/client"),z=require("@apollo/client/link/error"),J=require("@apollo/client/link/remove-typename"),F=require("@apollo/client/link/subscriptions"),H=require("@apollo/client/utilities"),W=require("graphql-ws"),B=require("react"),Z=require("react-hot-toast"),$=require("react-icons/fa6");var K="/graphql";var X=require("react"),Y=U(require("./apollo-error.module.scss"),1),ee=require("react/jsx-runtime"),er=(0,X.createContext)(void 0);function en(){var e=(0,X.use)(er);if(!e)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return e}var et=null;function eo(e){et=e}function ei(e){et&&et(e)}function eu(e){var r=e.children;var n=O((0,X.useState)(null),2),t=n[0],o=n[1];(0,X.useEffect)(function(){eo(o)},[]);var i=(0,X.useMemo)(function(){return{error:t,showError:o,hideError:function(){return o(null)}}},[t]);return(0,ee.jsx)(er,{value:i,children:r})}function ea(){var e,r,n;var t=(0,X.use)(er);if(!t||!t.error)return null;var o=t.error,i=t.hideError;return(0,ee.jsx)("div",{className:Y.default["modal-backdrop"],onClick:i,children:(0,ee.jsxs)("div",{className:Y.default["modal-content"],children:[(0,ee.jsx)("button",{type:"button",className:Y.default["btn-close"],onClick:i,children:"✕"}),(0,ee.jsx)("div",{className:Y.default["error-title"],children:"\uD83D\uDEA8 Something went wrong"}),(0,ee.jsx)("p",{className:Y.default["error-text"],children:"A problem occurred while communicating with the server."}),(0,ee.jsxs)("div",{className:Y.default["error-details"],children:[(0,ee.jsxs)("pre",{className:"main",children:[(0,ee.jsx)("strong",{children:"Main Error:"})," ",o.message]}),o.networkError&&(0,ee.jsxs)("pre",{className:"network",children:[(0,ee.jsx)("strong",{children:"Network Error:"})," ",o.networkError.message]}),((e=o.graphQLErrors)===null||e===void 0?void 0:e.length)>0&&(0,ee.jsxs)("div",{children:[(0,ee.jsx)("strong",{children:"GraphQL Errors:"}),(0,ee.jsx)("ul",{children:o.graphQLErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),((r=o.protocolErrors)===null||r===void 0?void 0:r.length)>0&&(0,ee.jsxs)("div",{children:[(0,ee.jsx)("strong",{children:"Protocol Errors:"}),(0,ee.jsx)("ul",{children:o.protocolErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),((n=o.clientErrors)===null||n===void 0?void 0:n.length)>0&&(0,ee.jsxs)("div",{children:[(0,ee.jsx)("strong",{children:"Client Errors:"}),(0,ee.jsx)("ul",{children:o.clientErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),o.extraInfo&&(0,ee.jsxs)("pre",{className:"extra",children:[(0,ee.jsx)("strong",{children:"Extra Info:"})," ",JSON.stringify(o.extraInfo,null,4)]})]}),(0,ee.jsx)("button",{type:"button",className:Y.default["btn-retry"],onClick:function(){return window.location.reload()},children:"\uD83D\uDD04 Retry"})]})})}var el=require("react/jsx-runtime"),es=/*#__PURE__*/function(e){d(r,e);function r(){a(this,r);var e;e=u(this,r,arguments);e.count=0;return e}s(r,[{key:"request",value:function e(e,r){var n=this;var t=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-t,i=e.operationName||"Unnamed";return console.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(o,"ms)")),r})}}]);return r}(R.ApolloLink);function ec(e){var r=e||{},n=r.uri,t=r.wsUrl,o=r.customLinks,i=new es,u=(0,z.onError)(function(e){var r=e.graphQLErrors,n=e.networkError,t=e.protocolErrors,o=e.operation;var i=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,n=e.locations,t=e.path;console.error("[GraphQL error] ".concat(i,": ").concat(r,", Location: ").concat(JSON.stringify(n),", Path: ").concat(t))}),t&&t.forEach(function(e){var r=e.message,n=e.extensions;console.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(n)))}),n&&console.error("[Network error]: ".concat(n)),r||t||n){var u,a;var l=(r===null||r===void 0?void 0:(u=r[0])===null||u===void 0?void 0:u.message)||(t===null||t===void 0?void 0:(a=t[0])===null||a===void 0?void 0:a.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",s=new R.ApolloError({graphQLErrors:r||[],protocolErrors:t||[],clientErrors:[],networkError:n||null,errorMessage:l,extraInfo:{operation:o}});Z.toast.error(function(e){return(0,el.jsxs)(el.Fragment,{children:[l,"\xa0",(0,el.jsx)($.FaQuestion,{onClick:function(){setTimeout(function(){ei(s)},0),Z.toast.dismiss(e.id)}})]})})}}),a=(0,J.removeTypenameFromVariables)();n||console.warn('[Apollo] No GraphQL URI provided — using "'.concat(K,'" as default'));var l=new R.HttpLink({uri:n!==null&&n!==void 0?n:K,credentials:"include"});t||console.warn("[Apollo] No WebSocket URL provided — subscriptions will use HTTP only");var s=t?new F.GraphQLWsLink((0,W.createClient)({url:t})):R.ApolloLink.empty(),c=v(s,R.ApolloLink)?(0,R.split)(function(e){var r=e.query;var n=(0,H.getMainDefinition)(r);return n.kind==="OperationDefinition"&&n.operation==="subscription"},s,l):l;return c===l&&t&&console.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,u,a].concat(N(o!==null&&o!==void 0?o:[]),[c])}function ef(e){var r=e.isNextJS,n=e.options,t=e.children,o=e.client,i=e.provider,u=e.cache;var a=n||{},l=a.uri,s=a.wsUrl,c=a.customLinks,f=x(a,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:R.ApolloClient)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var d=i||R.ApolloProvider,p=(0,B.useMemo)(function(){return(0,R.from)(ec({uri:l,wsUrl:s,customLinks:c}))},[l,s,c]),h=(0,B.useMemo)(function(){return new R.ApolloClient(y({link:p,cache:v(u,R.InMemoryCache)?u:new R.InMemoryCache},f))},[p,u,f]),m=r?(0,el.jsx)(d,{makeClient:function(){return h},children:t}):(0,el.jsx)(d,{client:h,children:t});return r?(0,el.jsx)(d,{makeClient:function(){return h},children:t}):(0,el.jsxs)(el.Fragment,{children:[(0,el.jsxs)(eu,{children:[m,(0,el.jsx)(ea,{})]}),(0,el.jsx)(Z.Toaster,{position:"top-right"})]})}var ed=U(require("classnames"),1),ev=require("react"),ep=U(require("./loading.module.scss"),1),eh=require("react/jsx-runtime"),em=(0,ev.createContext)(void 0);function eg(){var e=(0,ev.use)(em);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}function ey(e){var r=e.full,n=r===void 0?!1:r,t=e.block,o=t===void 0?!1:t,i=e.className,u=i===void 0?"":i,a=e.message,l=a===void 0?"Loading":a,s=x(e,["full","block","className","message"]);function c(){return(0,eh.jsxs)("div",w(y({className:ep.default.container},s),{children:[(0,eh.jsx)("div",{className:ep.default.ring}),(0,eh.jsx)("div",{className:ep.default.ring}),(0,eh.jsx)("div",{className:ep.default.ring}),(0,eh.jsx)("div",{className:ep.default.ring}),l&&(0,eh.jsx)("div",{className:ep.default.message,children:l})]}))}return n?(0,eh.jsx)("div",{className:(0,ed.default)(ep.default.fullscreen,u),children:c()}):o?(0,eh.jsx)("div",{className:(0,ed.default)(ep.default.block,u),children:c()}):c()}function eb(e){var r=e.children;var n=O((0,ev.useState)(!1),2),t=n[0],o=n[1],i=O((0,ev.useState)(!1),2),u=i[0],a=i[1],l=(0,ev.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),a(e)},[]),s=(0,ev.useCallback)(function(){o(!1),a(!1)},[]),c=(0,ev.useMemo)(function(){return{isLoading:t,isGlobalLoading:u,showLoading:l,hideLoading:s}},[t,u,l,s]);return(0,eh.jsx)(em,{value:c,children:t?(0,eh.jsx)(ey,{full:u}):r})}var ew=require("next-intl"),ex=require("react");var ej=require("react");var eE={serialize:function(e){return JSON.stringify(e,function(e,r){return v(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};var ek=U(require("localforage"),1),eO={get:function e(e){return i(function(){var r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,ek.default.getItem(e)];case 1:return[2,n.sent()];case 2:r=n.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return i(function(){var n;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,ek.default.setItem(e,r)];case 1:t.sent();return[3,3];case 2:n=t.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),n);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,ek.default.removeItem(e)];case 1:n.sent();return[3,3];case 2:r=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,ek.default.keys()];case 1:return[2,(e=n.sent())!==null&&e!==void 0?e:[]];case 2:r=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function eN(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eE;var t=O((0,ej.useState)(r),2),o=t[0],u=t[1],a=O((0,ej.useState)(!1),2),l=a[0],s=a[1];(0,ej.useEffect)(function(){var t=!0;return i(function(){var o,i,a,l;return A(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,eO.get(e)];case 1:o=c.sent();if(!t)return[3,5];if(!(o!==null))return[3,2];i=n.deserialize(o);u(i);return[3,5];case 2:if(!(r!==void 0))return[3,4];a=n.serialize(r);return[4,eO.set(e,a)];case 3:c.sent(),u(r);return[3,5];case 4:u(void 0);c.label=5;case 5:return[3,8];case 6:l=c.sent();console.error('Error loading value for key "'.concat(e,'":'),l),t&&u(r);return[3,8];case 7:t&&s(!0);return[7];case 8:return[2]}})})(),function(){t=!1,s(!1)}},[e,r,n]),(0,ej.useEffect)(function(){if(!l)return;i(function(){var r,t;return A(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=n.serialize(o);return[4,eO.set(e,r)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:t=i.sent();console.error('Error saving value for key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},[o,e,n,l]);var c=(0,ej.useCallback)(function(e){u(function(r){return typeof e=="function"?e(r):e})},[]),f=(0,ej.useCallback)(/*#__PURE__*/i(function(){var r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,eO.remove(e)];case 1:n.sent(),u(void 0);return[3,3];case 2:r=n.sent();console.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:o,set:c,remove:f}}var eP=require("react/jsx-runtime"),eS=(0,ex.createContext)(void 0);function eL(){var e=(0,ex.use)(eS);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var eA=ew.useTranslations;function eI(e){var r=function(r){var n;var t=eL(),o=t.currentLanguage,i=r.messages,u=r.languages,a="en",l=i[(o===null||o===void 0?void 0:o.value)||a],s=(n=u.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||n===void 0?void 0:n.timezone;return i?(0,eP.jsx)(ew.NextIntlClientProvider,{locale:(o===null||o===void 0?void 0:o.value)||a,messages:l,timeZone:s,children:(0,eP.jsx)(e,y({},r))}):(console.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||a)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function eC(e){var r=e.children;return(0,eP.jsx)(eP.Fragment,{children:r})}var eq=eI(eC);function e_(e){var r=e.children,n=e.languages,t=e.messages;var o;var i=eN("lang",(o=n===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:{}),u=i.value,a=i.set,l=(0,ex.useMemo)(function(){return{languages:n,currentLanguage:u,setCurrentLanguage:a}},[n,a,u]);return(0,eP.jsx)(eS,{value:l,children:(0,eP.jsx)(eq,{languages:n,messages:t,children:r})})}0&&(module.exports={ApolloErrorViewerModal:ApolloErrorViewerModal,ApolloErrorViewerProvider:ApolloErrorViewerProvider,ApolloProvider:ApolloProvider,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,registerApolloErrorViewerCallback:registerApolloErrorViewerCallback,showGlobalApolloError:showGlobalApolloError,useApolloErrorViewer:useApolloErrorViewer,useLoading:useLoading,useNextIntl:useNextIntl,useStorage:useStorage,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
package/dist/react/index.d.cts
CHANGED
|
@@ -3,7 +3,6 @@ export { useApolloErrorViewer_alias_2 as useApolloErrorViewer } from '../_tsup-d
|
|
|
3
3
|
export { registerApolloErrorViewerCallback_alias_2 as registerApolloErrorViewerCallback } from '../_tsup-dts-rollup.cjs';
|
|
4
4
|
export { showGlobalApolloError_alias_2 as showGlobalApolloError } from '../_tsup-dts-rollup.cjs';
|
|
5
5
|
export { ApolloErrorViewerProvider_alias_2 as ApolloErrorViewerProvider } from '../_tsup-dts-rollup.cjs';
|
|
6
|
-
export { ApolloErrorScreen_alias_2 as ApolloErrorScreen } from '../_tsup-dts-rollup.cjs';
|
|
7
6
|
export { ApolloErrorViewerModal_alias_2 as ApolloErrorViewerModal } from '../_tsup-dts-rollup.cjs';
|
|
8
7
|
export { useLoading_alias_1 as useLoading } from '../_tsup-dts-rollup.cjs';
|
|
9
8
|
export { Loading_alias_1 as Loading } from '../_tsup-dts-rollup.cjs';
|
package/dist/react/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export { useApolloErrorViewer_alias_2 as useApolloErrorViewer } from '../_tsup-d
|
|
|
3
3
|
export { registerApolloErrorViewerCallback_alias_2 as registerApolloErrorViewerCallback } from '../_tsup-dts-rollup.js';
|
|
4
4
|
export { showGlobalApolloError_alias_2 as showGlobalApolloError } from '../_tsup-dts-rollup.js';
|
|
5
5
|
export { ApolloErrorViewerProvider_alias_2 as ApolloErrorViewerProvider } from '../_tsup-dts-rollup.js';
|
|
6
|
-
export { ApolloErrorScreen_alias_2 as ApolloErrorScreen } from '../_tsup-dts-rollup.js';
|
|
7
6
|
export { ApolloErrorViewerModal_alias_2 as ApolloErrorViewerModal } from '../_tsup-dts-rollup.js';
|
|
8
7
|
export { useLoading_alias_1 as useLoading } from '../_tsup-dts-rollup.js';
|
|
9
8
|
export { Loading_alias_1 as Loading } from '../_tsup-dts-rollup.js';
|
package/dist/react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,i,a){try{var s=e[i](a);var l=s.value}catch(e){t(e);return}if(s.done){r(l)}else{Promise.resolve(l).then(n,o)}}function i(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(undefined)})}}function a(e,r,t){r=f(r);return k(e,L()?Reflect.construct(r,t||[],f(e).constructor):r.apply(e,t))}function s(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function c(e,r,t){if(r)l(e.prototype,r);if(t)l(e,t);return e}function u(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)N(e,r)}function m(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var a,s;try{for(t=t.call(e);!(o=(a=t.next()).done);o=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){i=true;s=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw s}}return n}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){u(e,r,t[r])})}return e}function y(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function x(e,r){if(e==null)return{};var t=E(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function E(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function k(e,r){if(r&&(S(r)==="object"||typeof r==="function")){return r}return n(e)}function N(e,r){N=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return N(e,r)}function O(e,t){return r(e)||p(e,t)||P(e,t)||h()}function j(e){return t(e)||v(e)||P(e)||g()}function S(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function P(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(L=function(){return!!e})()}function A(e,r){var t,n,o,i,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(r){return l([e,r])}}function l(i){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}import{ApolloClient as I,ApolloError as C,ApolloLink as _,ApolloProvider as T,from as D,HttpLink as U,InMemoryCache as R,split as M}from"@apollo/client";import{onError as Q}from"@apollo/client/link/error";import{removeTypenameFromVariables as z}from"@apollo/client/link/remove-typename";import{RetryLink as G}from"@apollo/client/link/retry";import{GraphQLWsLink as V}from"@apollo/client/link/subscriptions";import{getMainDefinition as J}from"@apollo/client/utilities";import{createClient as q}from"graphql-ws";import{useMemo as F}from"react";import{toast as H,Toaster as W}from"react-hot-toast";import{FaQuestion as B}from"react-icons/fa6";var K="/graphql";import{createContext as X,use as Z,useEffect as $,useMemo as Y,useState as ee}from"react";import{jsx as er,jsxs as et}from"react/jsx-runtime";var en=X(void 0);function eo(){var e=Z(en);if(!e)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return e}var ei=null;function ea(e){ei=e}function es(e){ei&&ei(e)}function el(e){var r=e.children;var t=O(ee(null),2),n=t[0],o=t[1];$(function(){ea(o)},[]);var i=Y(function(){return{error:n,showError:o,hideError:function(){return o(null)}}},[n]);return er(en,{value:i,children:r})}function ec(e){var r=e.error,t=e.refetch;var n,o,i;return er("div",{className:"flex items-center justify-center min-h-screen bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 p-6",children:et("div",{className:"backdrop-blur-md bg-white/10 border border-white/20 shadow-xl rounded-2xl p-8 w-full max-w-lg text-center text-white",children:[er("div",{className:"text-5xl mb-4",children:"\uD83D\uDEA8"}),er("h1",{className:"text-2xl font-bold mb-2",children:"Something went wrong"}),er("p",{className:"text-sm text-slate-300 mb-4",children:"A problem occurred while communicating with the server."}),et("div",{className:"bg-slate-800 text-left text-sm rounded-lg px-4 py-3 mb-6 overflow-auto max-h-64 border border-slate-700 space-y-2",children:[et("pre",{className:"text-red-300 whitespace-pre-wrap break-words",children:[er("strong",{children:"Main Error:"})," ",r.message]}),r.networkError&&et("pre",{className:"text-yellow-300 whitespace-pre-wrap break-words",children:[er("strong",{children:"Network Error:"})," ",r.networkError.message]}),((n=r.graphQLErrors)===null||n===void 0?void 0:n.length)>0&&et("div",{className:"text-rose-400",children:[er("strong",{children:"GraphQL Errors:"}),er("ul",{className:"list-disc list-inside",children:r.graphQLErrors.map(function(e){return er("li",{children:e.message},e.message)})})]}),((o=r.protocolErrors)===null||o===void 0?void 0:o.length)>0&&et("div",{className:"text-rose-400",children:[er("strong",{children:"Protocol Errors:"}),er("ul",{className:"list-disc list-inside",children:r.protocolErrors.map(function(e){return er("li",{children:e.message},e.message)})})]}),((i=r.clientErrors)===null||i===void 0?void 0:i.length)>0&&et("div",{className:"text-rose-400",children:[er("strong",{children:"Client Errors:"}),er("ul",{className:"list-disc list-inside",children:r.clientErrors.map(function(e){return er("li",{children:e.message},e.message)})})]}),r.extraInfo&&et("pre",{className:"text-cyan-300 whitespace-pre-wrap break-words",children:[er("strong",{children:"Extra Info:"})," ",JSON.stringify(r.extraInfo)]})]}),t&&er("button",{type:"button",onClick:t,className:"bg-gradient-to-r from-blue-500 to-cyan-500 hover:from-blue-600 hover:to-cyan-600 text-white font-semibold px-6 py-2 rounded-xl transition duration-300",children:"\uD83D\uDD04 Retry"})]})})}function eu(){var e=Z(en);if(!e)return null;var r=e.error,t=e.hideError;return r?er("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",children:et("div",{className:"relative bg-slate-900 text-white max-w-2xl w-full rounded-xl shadow-lg overflow-hidden",children:[er("button",{type:"button",onClick:t,className:"absolute top-3 right-4 text-xl hover:text-red-400",children:"✕"}),er(ec,{error:r})]})}):null}import{Fragment as ef,jsx as ed,jsxs as em}from"react/jsx-runtime";var ev=/*#__PURE__*/function(e){"use strict";d(r,e);function r(){s(this,r);var e;e=a(this,r,arguments);e.count=0;return e}c(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-n,i=e.operationName||"Unnamed";return console.info("[Apollo] #".concat(t.count,": ").concat(i," (").concat(o,"ms)")),r})}}]);return r}(_);function ep(e){var r=e||{},t=r.uri,n=r.wsUrl,o=r.customLinks,i=new ev,a=Q(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,o=e.operation;var i=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;console.error("[GraphQL error] ".concat(i,": ").concat(r,", Location: ").concat(JSON.stringify(t),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;console.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t)))}),t&&console.error("[Network error]: ".concat(t)),r||n||t){var a,s;var l=(r===null||r===void 0?void 0:(a=r[0])===null||a===void 0?void 0:a.message)||(n===null||n===void 0?void 0:(s=n[0])===null||s===void 0?void 0:s.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",c=new C({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:l,extraInfo:{operation:o}});H.custom(function(e){return em("div",{className:"bg-slate-800 text-white px-4 py-3 rounded shadow-md flex flex-col gap-2 w-full max-w-sm",children:[em("div",{className:"text-sm font-medium",children:["\uD83D\uDEA8",i," ","—",l]}),ed(B,{onClick:function(){setTimeout(function(){es(c)},0),H.dismiss(e.id)},className:"text-xs text-blue-400 hover:text-blue-300 underline self-start"})]})})}}),s=new G,l=z();t||console.warn('[Apollo] No GraphQL URI provided — using "'.concat(K,'" as default'));var c=new U({uri:t!==null&&t!==void 0?t:K,credentials:"include"});n||console.warn("[Apollo] No WebSocket URL provided — subscriptions will use HTTP only");var u=n?new V(q({url:n})):_.empty(),f=m(u,_)?M(function(e){var r=e.query;var t=J(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},u,c):c;return f===c&&n&&console.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,a,s,l].concat(j(o!==null&&o!==void 0?o:[]),[f])}function eh(e){var r=e.isNextJS,t=e.options,n=e.children,o=e.client,i=e.provider,a=e.cache;var s=t||{},l=s.uri,c=s.wsUrl,u=s.customLinks,f=x(s,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:I)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var d=i||T,v=F(function(){return D(ep({uri:l,wsUrl:c,customLinks:u}))},[l,c,u]),p=F(function(){return new I(b({link:v,cache:m(a,R)?a:new R},f))},[v,a,f]),h=r?ed(d,{makeClient:function(){return p},children:n}):ed(d,{client:p,children:n});return r?ed(d,{makeClient:function(){return p},children:n}):em(ef,{children:[em(el,{children:[h,ed(eu,{})]}),ed(W,{})]})}import eg from"classnames";import{createContext as eb,use as ey,useCallback as ew,useMemo as ex,useState as eE}from"react";import ek from"./loading.module.scss";import{jsx as eN,jsxs as eO}from"react/jsx-runtime";var ej=eb(void 0);function eS(){var e=ey(ej);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}function eP(e){var r=e.full,t=r===void 0?!1:r,n=e.block,o=n===void 0?!1:n,i=e.className,a=i===void 0?"":i,s=e.message,l=s===void 0?"Loading":s,c=x(e,["full","block","className","message"]);function u(){return eO("div",w(b({className:ek.container},c),{children:[eN("div",{className:ek.ring}),eN("div",{className:ek.ring}),eN("div",{className:ek.ring}),eN("div",{className:ek.ring}),l&&eN("div",{className:ek.message,children:l})]}))}return t?eN("div",{className:eg(ek.fullscreen,a),children:u()}):o?eN("div",{className:eg(ek.block,a),children:u()}):u()}function eL(e){var r=e.children;var t=O(eE(!1),2),n=t[0],o=t[1],i=O(eE(!1),2),a=i[0],s=i[1],l=ew(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),s(e)},[]),c=ew(function(){o(!1),s(!1)},[]),u=ex(function(){return{isLoading:n,isGlobalLoading:a,showLoading:l,hideLoading:c}},[n,a,l,c]);return eN(ej,{value:u,children:n?eN(eP,{full:a}):r})}import{NextIntlClientProvider as eA,useTranslations as eI}from"next-intl";import{createContext as eC,use as e_,useMemo as eT}from"react";import{useCallback as eD,useEffect as eU,useState as eR}from"react";var eM={serialize:function(e){return JSON.stringify(e,function(e,r){return m(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};import eQ from"localforage";var ez={get:function e(e){return i(function(){var r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eQ.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return i(function(){var t;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,eQ.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eQ.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eQ.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function eG(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eM;var n=O(eR(r),2),o=n[0],a=n[1],s=O(eR(!1),2),l=s[0],c=s[1];eU(function(){var n=!0;return i(function(){var o,i,s,l;return A(this,function(u){switch(u.label){case 0:u.trys.push([0,6,7,8]);return[4,ez.get(e)];case 1:o=u.sent();if(!n)return[3,5];if(!(o!==null))return[3,2];i=t.deserialize(o);a(i);return[3,5];case 2:if(!(r!==void 0))return[3,4];s=t.serialize(r);return[4,ez.set(e,s)];case 3:u.sent(),a(r);return[3,5];case 4:a(void 0);u.label=5;case 5:return[3,8];case 6:l=u.sent();console.error('Error loading value for key "'.concat(e,'":'),l),n&&a(r);return[3,8];case 7:n&&c(!0);return[7];case 8:return[2]}})})(),function(){n=!1,c(!1)}},[e,r,t]),eU(function(){if(!l)return;i(function(){var r,n;return A(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,ez.set(e,r)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:n=i.sent();console.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[o,e,t,l]);var u=eD(function(e){a(function(r){return typeof e=="function"?e(r):e})},[]),f=eD(/*#__PURE__*/i(function(){var r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,ez.remove(e)];case 1:t.sent(),a(void 0);return[3,3];case 2:r=t.sent();console.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:o,set:u,remove:f}}import{Fragment as eV,jsx as eJ}from"react/jsx-runtime";var eq=eC(void 0);function eF(){var e=e_(eq);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var eH=eI;function eW(e){var r=function(r){var t;var n=eF(),o=n.currentLanguage,i=r.messages,a=r.languages,s="en",l=i[(o===null||o===void 0?void 0:o.value)||s],c=(t=a.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||t===void 0?void 0:t.timezone;return i?eJ(eA,{locale:(o===null||o===void 0?void 0:o.value)||s,messages:l,timeZone:c,children:eJ(e,b({},r))}):(console.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||s)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function eB(e){var r=e.children;return eJ(eV,{children:r})}var eK=eW(eB);function eX(e){var r=e.children,t=e.languages,n=e.messages;var o;var i=eG("lang",(o=t===null||t===void 0?void 0:t[0])!==null&&o!==void 0?o:{}),a=i.value,s=i.set,l=eT(function(){return{languages:t,currentLanguage:a,setCurrentLanguage:s}},[t,s,a]);return eJ(eq,{value:l,children:eJ(eK,{languages:t,messages:n,children:r})})}export{ec as ApolloErrorScreen,eu as ApolloErrorViewerModal,el as ApolloErrorViewerProvider,eh as ApolloProvider,eP as Loading,ej as LoadingContext,eL as LoadingProvider,eq as NextIntlContext,eX as NextIntlProvider,ea as registerApolloErrorViewerCallback,es as showGlobalApolloError,eo as useApolloErrorViewer,eS as useLoading,eF as useNextIntl,eG as useStorage,eH as useTranslateNextIntl,eW as withNextIntl};
|
|
1
|
+
function r(r,e){if(e==null||e>r.length)e=r.length;for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function e(r){if(Array.isArray(r))return r}function n(e){if(Array.isArray(e))return r(e)}function t(r){if(r===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r}function o(r,e,n,t,o,i,a){try{var s=r[i](a);var l=s.value}catch(r){n(r);return}if(s.done){e(l)}else{Promise.resolve(l).then(t,o)}}function i(r){return function(){var e=this,n=arguments;return new Promise(function(t,i){var a=r.apply(e,n);function s(r){o(a,t,i,s,l,"next",r)}function l(r){o(a,t,i,s,l,"throw",r)}s(undefined)})}}function a(r,e,n){e=f(e);return O(r,L()?Reflect.construct(e,n||[],f(r).constructor):e.apply(r,n))}function s(r,e){if(!(r instanceof e)){throw new TypeError("Cannot call a class as a function")}}function l(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||false;t.configurable=true;if("value"in t)t.writable=true;Object.defineProperty(r,t.key,t)}}function u(r,e,n){if(e)l(r.prototype,e);if(n)l(r,n);return r}function c(r,e,n){if(e in r){Object.defineProperty(r,e,{value:n,enumerable:true,configurable:true,writable:true})}else{r[e]=n}return r}function f(r){f=Object.setPrototypeOf?Object.getPrototypeOf:function r(r){return r.__proto__||Object.getPrototypeOf(r)};return f(r)}function d(r,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:true,configurable:true}});if(e)x(r,e)}function v(r,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](r)}else{return r instanceof e}}function p(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function m(r,e){var n=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(n==null)return;var t=[];var o=true;var i=false;var a,s;try{for(n=n.call(r);!(o=(a=n.next()).done);o=true){t.push(a.value);if(e&&t.length===e)break}}catch(r){i=true;s=r}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw s}}return t}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var t=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){t=t.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))}t.forEach(function(e){c(r,e,n[e])})}return r}function b(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);if(e){t=t.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})}n.push.apply(n,t)}return n}function w(r,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(e))}else{b(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function E(r,e){if(r==null)return{};var n=k(r,e);var t,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(o=0;o<i.length;o++){t=i[o];if(e.indexOf(t)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(r,t))continue;n[t]=r[t]}}return n}function k(r,e){if(r==null)return{};var n={};var t=Object.keys(r);var o,i;for(i=0;i<t.length;i++){o=t[i];if(e.indexOf(o)>=0)continue;n[o]=r[o]}return n}function O(r,e){if(e&&(S(e)==="object"||typeof e==="function")){return e}return t(r)}function x(r,e){x=Object.setPrototypeOf||function r(r,e){r.__proto__=e;return r};return x(r,e)}function N(r,n){return e(r)||m(r,n)||P(r,n)||h()}function j(r){return n(r)||p(r)||P(r)||g()}function S(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function P(e,n){if(!e)return;if(typeof e==="string")return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor)t=e.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,n)}function L(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(L=function(){return!!r})()}function I(r,e){var n,t,o,i,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(r){return function(e){return l([r,e])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,t&&(o=i[0]&2?t["return"]:i[0]?t["throw"]||((o=t["return"])&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;if(t=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;t=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=e.call(r,a)}catch(r){i=[6,r];t=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}import{ApolloClient as A,ApolloError as C,ApolloLink as _,ApolloProvider as T,from as D,HttpLink as U,InMemoryCache as M,split as R}from"@apollo/client";import{onError as Q}from"@apollo/client/link/error";import{removeTypenameFromVariables as z}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as G}from"@apollo/client/link/subscriptions";import{getMainDefinition as J}from"@apollo/client/utilities";import{createClient as V}from"graphql-ws";import{useMemo as q}from"react";import{toast as F,Toaster as H}from"react-hot-toast";import{FaQuestion as W}from"react-icons/fa6";var B="/graphql";import{createContext as X,use as Y,useEffect as Z,useMemo as $,useState as K}from"react";import rr from"./apollo-error.module.scss";import{jsx as re,jsxs as rn}from"react/jsx-runtime";var rt=X(void 0);function ro(){var r=Y(rt);if(!r)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return r}var ri=null;function ra(r){ri=r}function rs(r){ri&&ri(r)}function rl(r){var e=r.children;var n=N(K(null),2),t=n[0],o=n[1];Z(function(){ra(o)},[]);var i=$(function(){return{error:t,showError:o,hideError:function(){return o(null)}}},[t]);return re(rt,{value:i,children:e})}function ru(){var r,e,n;var t=Y(rt);if(!t||!t.error)return null;var o=t.error,i=t.hideError;return re("div",{className:rr["modal-backdrop"],onClick:i,children:rn("div",{className:rr["modal-content"],children:[re("button",{type:"button",className:rr["btn-close"],onClick:i,children:"✕"}),re("div",{className:rr["error-title"],children:"\uD83D\uDEA8 Something went wrong"}),re("p",{className:rr["error-text"],children:"A problem occurred while communicating with the server."}),rn("div",{className:rr["error-details"],children:[rn("pre",{className:"main",children:[re("strong",{children:"Main Error:"})," ",o.message]}),o.networkError&&rn("pre",{className:"network",children:[re("strong",{children:"Network Error:"})," ",o.networkError.message]}),((r=o.graphQLErrors)===null||r===void 0?void 0:r.length)>0&&rn("div",{children:[re("strong",{children:"GraphQL Errors:"}),re("ul",{children:o.graphQLErrors.map(function(r){return re("li",{children:r.message},r.message)})})]}),((e=o.protocolErrors)===null||e===void 0?void 0:e.length)>0&&rn("div",{children:[re("strong",{children:"Protocol Errors:"}),re("ul",{children:o.protocolErrors.map(function(r){return re("li",{children:r.message},r.message)})})]}),((n=o.clientErrors)===null||n===void 0?void 0:n.length)>0&&rn("div",{children:[re("strong",{children:"Client Errors:"}),re("ul",{children:o.clientErrors.map(function(r){return re("li",{children:r.message},r.message)})})]}),o.extraInfo&&rn("pre",{className:"extra",children:[re("strong",{children:"Extra Info:"})," ",JSON.stringify(o.extraInfo,null,4)]})]}),re("button",{type:"button",className:rr["btn-retry"],onClick:function(){return window.location.reload()},children:"\uD83D\uDD04 Retry"})]})})}import{Fragment as rc,jsx as rf,jsxs as rd}from"react/jsx-runtime";var rv=/*#__PURE__*/function(r){"use strict";d(e,r);function e(){s(this,e);var r;r=a(this,e,arguments);r.count=0;return r}u(e,[{key:"request",value:function r(r,e){var n=this;var t=Date.now();return this.count+=1,e(r).map(function(e){var o=Date.now()-t,i=r.operationName||"Unnamed";return console.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(o,"ms)")),e})}}]);return e}(_);function rp(r){var e=r||{},n=e.uri,t=e.wsUrl,o=e.customLinks,i=new rv,a=Q(function(r){var e=r.graphQLErrors,n=r.networkError,t=r.protocolErrors,o=r.operation;var i=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(e&&e.forEach(function(r){var e=r.message,n=r.locations,t=r.path;console.error("[GraphQL error] ".concat(i,": ").concat(e,", Location: ").concat(JSON.stringify(n),", Path: ").concat(t))}),t&&t.forEach(function(r){var e=r.message,n=r.extensions;console.error("[Protocol error]: ".concat(e,", Extensions: ").concat(JSON.stringify(n)))}),n&&console.error("[Network error]: ".concat(n)),e||t||n){var a,s;var l=(e===null||e===void 0?void 0:(a=e[0])===null||a===void 0?void 0:a.message)||(t===null||t===void 0?void 0:(s=t[0])===null||s===void 0?void 0:s.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",u=new C({graphQLErrors:e||[],protocolErrors:t||[],clientErrors:[],networkError:n||null,errorMessage:l,extraInfo:{operation:o}});F.error(function(r){return rd(rc,{children:[l,"\xa0",rf(W,{onClick:function(){setTimeout(function(){rs(u)},0),F.dismiss(r.id)}})]})})}}),s=z();n||console.warn('[Apollo] No GraphQL URI provided — using "'.concat(B,'" as default'));var l=new U({uri:n!==null&&n!==void 0?n:B,credentials:"include"});t||console.warn("[Apollo] No WebSocket URL provided — subscriptions will use HTTP only");var u=t?new G(V({url:t})):_.empty(),c=v(u,_)?R(function(r){var e=r.query;var n=J(e);return n.kind==="OperationDefinition"&&n.operation==="subscription"},u,l):l;return c===l&&t&&console.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,a,s].concat(j(o!==null&&o!==void 0?o:[]),[c])}function rm(r){var e=r.isNextJS,n=r.options,t=r.children,o=r.client,i=r.provider,a=r.cache;var s=n||{},l=s.uri,u=s.wsUrl,c=s.customLinks,f=E(s,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:A)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var d=i||T,p=q(function(){return D(rp({uri:l,wsUrl:u,customLinks:c}))},[l,u,c]),m=q(function(){return new A(y({link:p,cache:v(a,M)?a:new M},f))},[p,a,f]),h=e?rf(d,{makeClient:function(){return m},children:t}):rf(d,{client:m,children:t});return e?rf(d,{makeClient:function(){return m},children:t}):rd(rc,{children:[rd(rl,{children:[h,rf(ru,{})]}),rf(H,{position:"top-right"})]})}import rh from"classnames";import{createContext as rg,use as ry,useCallback as rb,useMemo as rw,useState as rE}from"react";import rk from"./loading.module.scss";import{jsx as rO,jsxs as rx}from"react/jsx-runtime";var rN=rg(void 0);function rj(){var r=ry(rN);if(!r)throw new Error("useLoading must be used within a LoadingProvider");return r}function rS(r){var e=r.full,n=e===void 0?!1:e,t=r.block,o=t===void 0?!1:t,i=r.className,a=i===void 0?"":i,s=r.message,l=s===void 0?"Loading":s,u=E(r,["full","block","className","message"]);function c(){return rx("div",w(y({className:rk.container},u),{children:[rO("div",{className:rk.ring}),rO("div",{className:rk.ring}),rO("div",{className:rk.ring}),rO("div",{className:rk.ring}),l&&rO("div",{className:rk.message,children:l})]}))}return n?rO("div",{className:rh(rk.fullscreen,a),children:c()}):o?rO("div",{className:rh(rk.block,a),children:c()}):c()}function rP(r){var e=r.children;var n=N(rE(!1),2),t=n[0],o=n[1],i=N(rE(!1),2),a=i[0],s=i[1],l=rb(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),s(r)},[]),u=rb(function(){o(!1),s(!1)},[]),c=rw(function(){return{isLoading:t,isGlobalLoading:a,showLoading:l,hideLoading:u}},[t,a,l,u]);return rO(rN,{value:c,children:t?rO(rS,{full:a}):e})}import{NextIntlClientProvider as rL,useTranslations as rI}from"next-intl";import{createContext as rA,use as rC,useMemo as r_}from"react";import{useCallback as rT,useEffect as rD,useState as rU}from"react";var rM={serialize:function(r){return JSON.stringify(r,function(r,e){return v(e,Date)?{__type:"Date",value:e.toISOString()}:e})},deserialize:function(r){return JSON.parse(r,function(r,e){return(e===null||e===void 0?void 0:e.__type)==="Date"?new Date(e.value):e})}};import rR from"localforage";var rQ={get:function r(r){return i(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rR.getItem(r)];case 1:return[2,n.sent()];case 2:e=n.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(r,'":'),e),null)];case 3:return[2]}})})()},set:function r(r,e){return i(function(){var n;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,rR.setItem(r,e)];case 1:t.sent();return[3,3];case 2:n=t.sent();console.error('❌ [Storage:set] Error setting key "'.concat(r,'":'),n);return[3,3];case 3:return[2]}})})()},remove:function r(r){return i(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rR.removeItem(r)];case 1:n.sent();return[3,3];case 2:e=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})})()},keys:function r(){return i(function(){var r,e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rR.keys()];case 1:return[2,(r=n.sent())!==null&&r!==void 0?r:[]];case 2:e=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",e),[])];case 3:return[2]}})})()}};function rz(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rM;var t=N(rU(e),2),o=t[0],a=t[1],s=N(rU(!1),2),l=s[0],u=s[1];rD(function(){var t=!0;return i(function(){var o,i,s,l;return I(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,rQ.get(r)];case 1:o=c.sent();if(!t)return[3,5];if(!(o!==null))return[3,2];i=n.deserialize(o);a(i);return[3,5];case 2:if(!(e!==void 0))return[3,4];s=n.serialize(e);return[4,rQ.set(r,s)];case 3:c.sent(),a(e);return[3,5];case 4:a(void 0);c.label=5;case 5:return[3,8];case 6:l=c.sent();console.error('Error loading value for key "'.concat(r,'":'),l),t&&a(e);return[3,8];case 7:t&&u(!0);return[7];case 8:return[2]}})})(),function(){t=!1,u(!1)}},[r,e,n]),rD(function(){if(!l)return;i(function(){var e,t;return I(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];e=n.serialize(o);return[4,rQ.set(r,e)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:t=i.sent();console.error('Error saving value for key "'.concat(r,'":'),t);return[3,4];case 4:return[2]}})})()},[o,r,n,l]);var c=rT(function(r){a(function(e){return typeof r=="function"?r(e):r})},[]),f=rT(/*#__PURE__*/i(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rQ.remove(r)];case 1:n.sent(),a(void 0);return[3,3];case 2:e=n.sent();console.error('Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})}),[r]);return{value:o,set:c,remove:f}}import{Fragment as rG,jsx as rJ}from"react/jsx-runtime";var rV=rA(void 0);function rq(){var r=rC(rV);if(!r)throw new Error("useNextIntl must be used within a NextIntlProvider");return r}var rF=rI;function rH(r){var e=function(e){var n;var t=rq(),o=t.currentLanguage,i=e.messages,a=e.languages,s="en",l=i[(o===null||o===void 0?void 0:o.value)||s],u=(n=a.find(function(r){return r.value===(o===null||o===void 0?void 0:o.value)}))===null||n===void 0?void 0:n.timezone;return i?rJ(rL,{locale:(o===null||o===void 0?void 0:o.value)||s,messages:l,timeZone:u,children:rJ(r,y({},e))}):(console.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||s)),null)};return e.displayName="withNextIntl(".concat(r.displayName||r.name||"Component",")"),e}function rW(r){var e=r.children;return rJ(rG,{children:e})}var rB=rH(rW);function rX(r){var e=r.children,n=r.languages,t=r.messages;var o;var i=rz("lang",(o=n===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:{}),a=i.value,s=i.set,l=r_(function(){return{languages:n,currentLanguage:a,setCurrentLanguage:s}},[n,s,a]);return rJ(rV,{value:l,children:rJ(rB,{languages:n,messages:t,children:e})})}export{ru as ApolloErrorViewerModal,rl as ApolloErrorViewerProvider,rm as ApolloProvider,rS as Loading,rN as LoadingContext,rP as LoadingProvider,rV as NextIntlContext,rX as NextIntlProvider,ra as registerApolloErrorViewerCallback,rs as showGlobalApolloError,ro as useApolloErrorViewer,rj as useLoading,rq as useNextIntl,rz as useStorage,rF as useTranslateNextIntl,rH as withNextIntl};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
|
|
3
|
-
/* Common Overlay Styles */
|
|
4
3
|
.overlay {
|
|
5
|
-
z-index:
|
|
4
|
+
z-index: 999999;
|
|
6
5
|
background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.8));
|
|
7
6
|
backdrop-filter: blur(10px);
|
|
8
7
|
display: flex;
|
|
@@ -13,7 +12,6 @@
|
|
|
13
12
|
animation: overlay-fade-in 0.5s ease-out;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
/* Positioning Modifiers */
|
|
17
15
|
.fullscreen,
|
|
18
16
|
.block {
|
|
19
17
|
@extend .overlay;
|
|
@@ -33,7 +31,6 @@
|
|
|
33
31
|
height: auto;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
/* Container for Rings and Message */
|
|
37
34
|
.container {
|
|
38
35
|
display: flex;
|
|
39
36
|
justify-content: center;
|
|
@@ -41,7 +38,6 @@
|
|
|
41
38
|
position: relative;
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
/* Ring Styles with Responsive Size */
|
|
45
41
|
.ring {
|
|
46
42
|
width: clamp(60px, 10vw, 190px);
|
|
47
43
|
height: clamp(60px, 10vw, 190px);
|
|
@@ -51,7 +47,6 @@
|
|
|
51
47
|
transition: transform 0.3s ease;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
/* Optimized Ring Animations */
|
|
55
50
|
$colors: (
|
|
56
51
|
1: rgb(240, 42, 230),
|
|
57
52
|
2: rgb(240, 19, 67),
|
|
@@ -66,7 +61,6 @@ $colors: (
|
|
|
66
61
|
}
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
/* Message Styling */
|
|
70
64
|
.message {
|
|
71
65
|
color: #524f4f;
|
|
72
66
|
font-weight: bold;
|
|
@@ -75,7 +69,6 @@ $colors: (
|
|
|
75
69
|
font-size: 1rem;
|
|
76
70
|
}
|
|
77
71
|
|
|
78
|
-
/* Animations */
|
|
79
72
|
@keyframes rotate1 {
|
|
80
73
|
from {
|
|
81
74
|
transform: rotateX(50deg) rotateZ(110deg);
|