@cyberskill/shared 1.61.0 → 1.63.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 +99 -68
- package/dist/_tsup-dts-rollup.d.ts +99 -68
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/configs/graphql/graphql-codegen.cjs +1 -1
- package/dist/configs/graphql/graphql-codegen.js +1 -1
- package/dist/configs/graphql/index.cjs +1 -1
- package/dist/configs/graphql/index.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.js +1 -1
- package/dist/configs/vitest/react/unit.cjs +1 -1
- package/dist/configs/vitest/react/unit.js +1 -1
- package/dist/constants/common-nodejs.cjs +1 -0
- package/dist/constants/common-nodejs.d.cts +1 -0
- package/dist/constants/common-nodejs.d.ts +1 -0
- package/dist/constants/common-nodejs.js +1 -0
- package/dist/constants/common.cjs +1 -1
- package/dist/constants/common.d.cts +0 -1
- package/dist/constants/common.d.ts +0 -1
- package/dist/constants/common.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/path.cjs +1 -1
- package/dist/constants/path.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- 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.js +1 -1
- package/dist/react/apollo-error.module.scss +2 -8
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/next-intl.cjs +1 -1
- package/dist/react/next-intl.js +1 -1
- package/dist/react/storage.cjs +1 -1
- package/dist/react/storage.js +1 -1
- package/dist/typescript/command.cjs +1 -1
- package/dist/typescript/command.d.cts +2 -3
- package/dist/typescript/command.d.ts +2 -3
- package/dist/typescript/command.js +1 -1
- package/dist/typescript/index.cjs +1 -1
- package/dist/typescript/index.d.cts +5 -4
- package/dist/typescript/index.d.ts +5 -4
- package/dist/typescript/index.js +1 -1
- package/dist/typescript/log.d.cts +3 -1
- package/dist/typescript/log.d.ts +3 -1
- package/dist/utils/command.cjs +1 -1
- package/dist/utils/command.d.cts +0 -1
- package/dist/utils/command.d.ts +0 -1
- package/dist/utils/command.js +1 -1
- package/dist/utils/fs.cjs +1 -1
- package/dist/utils/fs.d.cts +1 -1
- package/dist/utils/fs.d.ts +1 -1
- package/dist/utils/fs.js +1 -1
- package/dist/utils/index-nodejs.cjs +1 -1
- package/dist/utils/index-nodejs.d.cts +3 -3
- package/dist/utils/index-nodejs.d.ts +3 -3
- package/dist/utils/index-nodejs.js +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/log-nodejs.cjs +1 -0
- package/dist/utils/log-nodejs.d.cts +2 -0
- package/dist/utils/log-nodejs.d.ts +2 -0
- package/dist/utils/log-nodejs.js +1 -0
- package/dist/utils/log.cjs +1 -1
- package/dist/utils/log.d.cts +1 -1
- package/dist/utils/log.d.ts +1 -1
- package/dist/utils/log.js +1 -1
- package/dist/utils/package.cjs +1 -1
- package/dist/utils/package.js +1 -1
- package/dist/utils/path.cjs +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/storage-client.cjs +1 -1
- package/dist/utils/storage-client.js +1 -1
- package/dist/utils/storage-server.cjs +1 -1
- package/dist/utils/storage-server.js +1 -1
- package/package.json +2 -2
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 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});
|
|
1
|
+
"use strict";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 u=r[i](a);var l=u.value}catch(r){n(r);return}if(u.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 u(r){o(a,t,i,u,l,"next",r)}function l(r){o(a,t,i,u,l,"throw",r)}u(undefined)})}}function a(r,e,n){e=f(e);return E(r,L()?Reflect.construct(e,n||[],f(r).constructor):e.apply(r,n))}function u(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 s(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)O(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 h(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,u;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;u=r}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw u}}return t}function g(){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 m(){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 x(r,e){if(r==null)return{};var n=j(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 j(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 E(r,e){if(e&&(P(e)==="object"||typeof e==="function")){return e}return t(r)}function O(r,e){O=Object.setPrototypeOf||function r(r,e){r.__proto__=e;return r};return O(r,e)}function k(r,n){return e(r)||h(r,n)||S(r,n)||g()}function N(r){return n(r)||p(r)||S(r)||m()}function P(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function S(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 A(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:u(0),"throw":u(1),"return":u(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(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}}}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(r,e){for(var n in e)C(r,n,{get:e[n],enumerable:!0})},D=function(r,e,n,t){var o=true,i=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":P(e))=="object"||typeof e=="function")try{var u=function(){var o=s.value;!T.call(r,o)&&o!==n&&C(r,o,{get:function(){return e[o]},enumerable:!(t=q(e,o))||t.enumerable})};for(var l=_(e)[Symbol.iterator](),s;!(o=(s=l.next()).done);o=true)u()}catch(r){i=true;a=r}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(i){throw a}}}return r};var U=function(r,e,n){return n=r!=null?I(M(r)):{},D(e||!r||!r.__esModule?C(n,"default",{value:r,enumerable:!0}):n,r)},G=function(r){return D(C({},"__esModule",{value:!0}),r)};var Q={};V(Q,{ApolloErrorViewerModal:function(){return rc},ApolloErrorViewerProvider:function(){return rs},ApolloProvider:function(){return rp},Loading:function(){return rx},LoadingContext:function(){return rb},LoadingProvider:function(){return rj},NextIntlContext:function(){return rI},NextIntlProvider:function(){return rV},registerApolloErrorViewerCallback:function(){return ru},showGlobalApolloError:function(){return rl},useApolloErrorViewer:function(){return ri},useLoading:function(){return rw},useNextIntl:function(){return rC},useStorage:function(){return rL},useTranslateNextIntl:function(){return rq},withNextIntl:function(){return r_}});module.exports=G(Q);var R=require("@apollo/client"),z=require("@apollo/client/link/error"),F=require("@apollo/client/link/remove-typename"),J=require("@apollo/client/link/subscriptions"),B=require("@apollo/client/utilities"),H=require("graphql-ws"),W=require("react"),Z=require("react-hot-toast"),$=require("react-icons/fa6");var K="/graphql";var X=require("consola/browser"),Y={silent:X.consola.silent,level:X.consola.level,fatal:X.consola.fatal,error:X.consola.error,warn:X.consola.warn,log:X.consola.log,info:X.consola.info,success:X.consola.success,ready:X.consola.ready,start:X.consola.start,box:X.consola.box,debug:X.consola.debug,trace:X.consola.trace,verbose:X.consola.verbose};var rr=require("react"),re=require("react-icons/fa6"),rn=U(require("./apollo-error.module.scss"),1),rt=require("react/jsx-runtime"),ro=(0,rr.createContext)(void 0);function ri(){var r=(0,rr.use)(ro);if(!r)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return r}var ra=null;function ru(r){ra=r}function rl(r){ra&&ra(r)}function rs(r){var e=r.children;var n=k((0,rr.useState)(null),2),t=n[0],o=n[1];(0,rr.useEffect)(function(){ru(o)},[]);var i=(0,rr.useMemo)(function(){return{error:t,showError:o,hideError:function(){return o(null)}}},[t]);return(0,rt.jsx)(ro,{value:i,children:e})}function rc(){var r,e,n;var t=(0,rr.use)(ro);if(!t||!t.error)return null;var o=t.error,i=t.hideError;return(0,rt.jsx)("div",{className:rn.default["modal-backdrop"],children:(0,rt.jsxs)("div",{className:rn.default["modal-content"],children:[(0,rt.jsx)("button",{type:"button",className:rn.default["btn-close"],onClick:i,children:"✕"}),(0,rt.jsx)("div",{className:rn.default["error-title"],children:o.message}),(0,rt.jsxs)("div",{className:rn.default["error-details"],children:[o.networkError&&(0,rt.jsxs)("pre",{className:"network",children:[(0,rt.jsx)("strong",{children:"Network Error:"}),"\xa0",o.networkError.message]}),((r=o.graphQLErrors)===null||r===void 0?void 0:r.length)>0&&(0,rt.jsxs)("div",{children:[(0,rt.jsx)("strong",{children:"GraphQL Errors:"}),(0,rt.jsx)("ul",{children:o.graphQLErrors.map(function(r){return(0,rt.jsx)("li",{children:r.message},r.message)})})]}),((e=o.protocolErrors)===null||e===void 0?void 0:e.length)>0&&(0,rt.jsxs)("div",{children:[(0,rt.jsx)("strong",{children:"Protocol Errors:"}),(0,rt.jsx)("ul",{children:o.protocolErrors.map(function(r){return(0,rt.jsx)("li",{children:r.message},r.message)})})]}),((n=o.clientErrors)===null||n===void 0?void 0:n.length)>0&&(0,rt.jsxs)("div",{children:[(0,rt.jsx)("strong",{children:"Client Errors:"}),(0,rt.jsx)("ul",{children:o.clientErrors.map(function(r){return(0,rt.jsx)("li",{children:r.message},r.message)})})]}),o.extraInfo&&(0,rt.jsxs)("pre",{className:"extra",children:[(0,rt.jsx)("strong",{children:"Extra Info:"}),"\xa0",JSON.stringify(o.extraInfo,null,4)]})]}),(0,rt.jsx)("button",{type:"button",className:rn.default["btn-retry"],onClick:function(){return window.location.reload()},children:(0,rt.jsx)(re.FaRepeat,{})})]})})}var rf=require("react/jsx-runtime"),rd=/*#__PURE__*/function(r){d(e,r);function e(){u(this,e);var r;r=a(this,e,arguments);r.count=0;return r}s(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 Y.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(o,"ms)")),e})}}]);return e}(R.ApolloLink);function rv(r){var e=r||{},n=e.uri,t=e.wsUrl,o=e.customLinks,i=new rd,a=(0,z.onError)(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;Y.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;Y.error("[Protocol error]: ".concat(e,", Extensions: ").concat(JSON.stringify(n)))}),n&&Y.error("[Network error]: ".concat(n)),e||t||n){var a,u;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:(u=t[0])===null||u===void 0?void 0:u.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",s=new R.ApolloError({graphQLErrors:e||[],protocolErrors:t||[],clientErrors:[],networkError:n||null,errorMessage:l,extraInfo:{operation:o}});Z.toast.error(function(r){return(0,rf.jsxs)(rf.Fragment,{children:[l,"\xa0",(0,rf.jsx)($.FaQuestion,{onClick:function(){setTimeout(function(){rl(s)},0),Z.toast.dismiss(r.id)}})]})})}}),u=(0,F.removeTypenameFromVariables)();n||Y.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"}),s=t?new J.GraphQLWsLink((0,H.createClient)({url:t})):R.ApolloLink.empty(),c=v(s,R.ApolloLink)?(0,R.split)(function(r){var e=r.query;var n=(0,B.getMainDefinition)(e);return n.kind==="OperationDefinition"&&n.operation==="subscription"},s,l):l;return c===l&&t&&Y.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,a,u].concat(N(o!==null&&o!==void 0?o:[]),[c])}function rp(r){var e=r.isNextJS,n=r.options,t=r.children,o=r.client,i=r.provider,a=r.cache;var u=n||{},l=u.uri,s=u.wsUrl,c=u.customLinks,f=x(u,["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,W.useMemo)(function(){return(0,R.from)(rv({uri:l,wsUrl:s,customLinks:c}))},[l,s,c]),h=(0,W.useMemo)(function(){return new R.ApolloClient(y({link:p,cache:v(a,R.InMemoryCache)?a:new R.InMemoryCache},f))},[p,a,f]),g=e?(0,rf.jsx)(d,{makeClient:function(){return h},children:t}):(0,rf.jsx)(d,{client:h,children:t});return e?(0,rf.jsx)(d,{makeClient:function(){return h},children:t}):(0,rf.jsxs)(rf.Fragment,{children:[(0,rf.jsxs)(rs,{children:[g,(0,rf.jsx)(rc,{})]}),(0,rf.jsx)(Z.Toaster,{position:"top-right"})]})}var rh=U(require("classnames"),1),rg=require("react"),rm=U(require("./loading.module.scss"),1),ry=require("react/jsx-runtime"),rb=(0,rg.createContext)(void 0);function rw(){var r=(0,rg.use)(rb);if(!r)throw new Error("useLoading must be used within a LoadingProvider");return r}function rx(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,u=r.message,l=u===void 0?"Loading":u,s=x(r,["full","block","className","message"]);function c(){return(0,ry.jsxs)("div",w(y({className:rm.default.container},s),{children:[(0,ry.jsx)("div",{className:rm.default.ring}),(0,ry.jsx)("div",{className:rm.default.ring}),(0,ry.jsx)("div",{className:rm.default.ring}),(0,ry.jsx)("div",{className:rm.default.ring}),l&&(0,ry.jsx)("div",{className:rm.default.message,children:l})]}))}return n?(0,ry.jsx)("div",{className:(0,rh.default)(rm.default.fullscreen,a),children:c()}):o?(0,ry.jsx)("div",{className:(0,rh.default)(rm.default.block,a),children:c()}):c()}function rj(r){var e=r.children;var n=k((0,rg.useState)(!1),2),t=n[0],o=n[1],i=k((0,rg.useState)(!1),2),a=i[0],u=i[1],l=(0,rg.useCallback)(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),u(r)},[]),s=(0,rg.useCallback)(function(){o(!1),u(!1)},[]),c=(0,rg.useMemo)(function(){return{isLoading:t,isGlobalLoading:a,showLoading:l,hideLoading:s}},[t,a,l,s]);return(0,ry.jsx)(rb,{value:c,children:t?(0,ry.jsx)(rx,{full:a}):e})}var rE=require("next-intl"),rO=require("react");var rk=require("react");var rN={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})}};var rP=U(require("localforage"),1);var rS={get:function r(r){return i(function(){var e;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rP.default.getItem(r)];case 1:return[2,n.sent()];case 2:e=n.sent();return[2,(Y.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 A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,rP.default.setItem(r,e)];case 1:t.sent();return[3,3];case 2:n=t.sent();Y.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 A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rP.default.removeItem(r)];case 1:n.sent();return[3,3];case 2:e=n.sent();Y.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 A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rP.default.keys()];case 1:return[2,(r=n.sent())!==null&&r!==void 0?r:[]];case 2:e=n.sent();return[2,(Y.error("[Storage:keys] Error getting keys:",e),[])];case 3:return[2]}})})()}};function rL(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rN;var t=k((0,rk.useState)(e),2),o=t[0],a=t[1],u=k((0,rk.useState)(!1),2),l=u[0],s=u[1];(0,rk.useEffect)(function(){var t=!0;return i(function(){var o,i,u,l;return A(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,rS.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];u=n.serialize(e);return[4,rS.set(r,u)];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();Y.error('Error loading value for key "'.concat(r,'":'),l),t&&a(e);return[3,8];case 7:t&&s(!0);return[7];case 8:return[2]}})})(),function(){t=!1,s(!1)}},[r,e,n]),(0,rk.useEffect)(function(){if(!l)return;i(function(){var e,t;return A(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,rS.set(r,e)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:t=i.sent();Y.error('Error saving value for key "'.concat(r,'":'),t);return[3,4];case 4:return[2]}})})()},[o,r,n,l]);var c=(0,rk.useCallback)(function(r){a(function(e){return typeof r=="function"?r(e):r})},[]),f=(0,rk.useCallback)(/*#__PURE__*/i(function(){var e;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rS.remove(r)];case 1:n.sent(),a(void 0);return[3,3];case 2:e=n.sent();Y.error('Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})}),[r]);return{value:o,set:c,remove:f}}var rA=require("react/jsx-runtime"),rI=(0,rO.createContext)(void 0);function rC(){var r=(0,rO.use)(rI);if(!r)throw new Error("useNextIntl must be used within a NextIntlProvider");return r}var rq=rE.useTranslations;function r_(r){var e=function(e){var n;var t=rC(),o=t.currentLanguage,i=e.messages,a=e.languages,u="en",l=i[(o===null||o===void 0?void 0:o.value)||u],s=(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?(0,rA.jsx)(rE.NextIntlClientProvider,{locale:(o===null||o===void 0?void 0:o.value)||u,messages:l,timeZone:s,children:(0,rA.jsx)(r,y({},e))}):(Y.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||u)),null)};return e.displayName="withNextIntl(".concat(r.displayName||r.name||"Component",")"),e}function rM(r){var e=r.children;return(0,rA.jsx)(rA.Fragment,{children:e})}var rT=r_(rM);function rV(r){var e=r.children,n=r.languages,t=r.messages;var o;var i=rL("lang",(o=n===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:{}),a=i.value,u=i.set,l=(0,rO.useMemo)(function(){return{languages:n,currentLanguage:a,setCurrentLanguage:u}},[n,u,a]);return(0,rA.jsx)(rI,{value:l,children:(0,rA.jsx)(rT,{languages:n,messages:t,children:e})})}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.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
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 u=s.value}catch(r){n(r);return}if(s.done){e(u)}else{Promise.resolve(u).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,u,"next",r)}function u(r){o(a,t,i,s,u,"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 u(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 l(r,e,n){if(e)u(r.prototype,e);if(n)u(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 v(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 d(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 j(r,n){return e(r)||m(r,n)||P(r,n)||h()}function N(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 u([r,e])}}function u(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 C,ApolloError as A,ApolloLink as _,ApolloProvider as D,from as T,HttpLink as U,InMemoryCache as M,split as Q}from"@apollo/client";import{onError as R}from"@apollo/client/link/error";import{removeTypenameFromVariables as V}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as G}from"@apollo/client/link/subscriptions";import{getMainDefinition as z}from"@apollo/client/utilities";import{createClient as J}from"graphql-ws";import{useMemo as F}from"react";import{toast as q,Toaster as W}from"react-hot-toast";import{FaQuestion as B}from"react-icons/fa6";var H="/graphql";import{consola as Z}from"consola/browser";var $={silent:Z.silent,level:Z.level,fatal:Z.fatal,error:Z.error,warn:Z.warn,log:Z.log,info:Z.info,success:Z.success,ready:Z.ready,start:Z.start,box:Z.box,debug:Z.debug,trace:Z.trace,verbose:Z.verbose};import{createContext as K,use as X,useEffect as Y,useMemo as rr,useState as re}from"react";import{FaRepeat as rn}from"react-icons/fa6";import rt from"./apollo-error.module.scss";import{jsx as ro,jsxs as ri}from"react/jsx-runtime";var ra=K(void 0);function rs(){var r=X(ra);if(!r)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return r}var ru=null;function rl(r){ru=r}function rc(r){ru&&ru(r)}function rf(r){var e=r.children;var n=j(re(null),2),t=n[0],o=n[1];Y(function(){rl(o)},[]);var i=rr(function(){return{error:t,showError:o,hideError:function(){return o(null)}}},[t]);return ro(ra,{value:i,children:e})}function rv(){var r,e,n;var t=X(ra);if(!t||!t.error)return null;var o=t.error,i=t.hideError;return ro("div",{className:rt["modal-backdrop"],children:ri("div",{className:rt["modal-content"],children:[ro("button",{type:"button",className:rt["btn-close"],onClick:i,children:"✕"}),ro("div",{className:rt["error-title"],children:o.message}),ri("div",{className:rt["error-details"],children:[o.networkError&&ri("pre",{className:"network",children:[ro("strong",{children:"Network Error:"}),"\xa0",o.networkError.message]}),((r=o.graphQLErrors)===null||r===void 0?void 0:r.length)>0&&ri("div",{children:[ro("strong",{children:"GraphQL Errors:"}),ro("ul",{children:o.graphQLErrors.map(function(r){return ro("li",{children:r.message},r.message)})})]}),((e=o.protocolErrors)===null||e===void 0?void 0:e.length)>0&&ri("div",{children:[ro("strong",{children:"Protocol Errors:"}),ro("ul",{children:o.protocolErrors.map(function(r){return ro("li",{children:r.message},r.message)})})]}),((n=o.clientErrors)===null||n===void 0?void 0:n.length)>0&&ri("div",{children:[ro("strong",{children:"Client Errors:"}),ro("ul",{children:o.clientErrors.map(function(r){return ro("li",{children:r.message},r.message)})})]}),o.extraInfo&&ri("pre",{className:"extra",children:[ro("strong",{children:"Extra Info:"}),"\xa0",JSON.stringify(o.extraInfo,null,4)]})]}),ro("button",{type:"button",className:rt["btn-retry"],onClick:function(){return window.location.reload()},children:ro(rn,{})})]})})}import{Fragment as rd,jsx as rp,jsxs as rm}from"react/jsx-runtime";var rh=/*#__PURE__*/function(r){"use strict";v(e,r);function e(){s(this,e);var r;r=a(this,e,arguments);r.count=0;return r}l(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 $.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(o,"ms)")),e})}}]);return e}(_);function rg(r){var e=r||{},n=e.uri,t=e.wsUrl,o=e.customLinks,i=new rh,a=R(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;$.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;$.error("[Protocol error]: ".concat(e,", Extensions: ").concat(JSON.stringify(n)))}),n&&$.error("[Network error]: ".concat(n)),e||t||n){var a,s;var u=(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",l=new A({graphQLErrors:e||[],protocolErrors:t||[],clientErrors:[],networkError:n||null,errorMessage:u,extraInfo:{operation:o}});q.error(function(r){return rm(rd,{children:[u,"\xa0",rp(B,{onClick:function(){setTimeout(function(){rc(l)},0),q.dismiss(r.id)}})]})})}}),s=V();n||$.warn('[Apollo] No GraphQL URI provided — using "'.concat(H,'" as default'));var u=new U({uri:n!==null&&n!==void 0?n:H,credentials:"include"}),l=t?new G(J({url:t})):_.empty(),c=d(l,_)?Q(function(r){var e=r.query;var n=z(e);return n.kind==="OperationDefinition"&&n.operation==="subscription"},l,u):u;return c===u&&t&&$.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,a,s].concat(N(o!==null&&o!==void 0?o:[]),[c])}function ry(r){var e=r.isNextJS,n=r.options,t=r.children,o=r.client,i=r.provider,a=r.cache;var s=n||{},u=s.uri,l=s.wsUrl,c=s.customLinks,f=E(s,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:C)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var v=i||D,p=F(function(){return T(rg({uri:u,wsUrl:l,customLinks:c}))},[u,l,c]),m=F(function(){return new C(y({link:p,cache:d(a,M)?a:new M},f))},[p,a,f]),h=e?rp(v,{makeClient:function(){return m},children:t}):rp(v,{client:m,children:t});return e?rp(v,{makeClient:function(){return m},children:t}):rm(rd,{children:[rm(rf,{children:[h,rp(rv,{})]}),rp(W,{position:"top-right"})]})}import rb from"classnames";import{createContext as rw,use as rE,useCallback as rk,useMemo as rO,useState as rx}from"react";import rj from"./loading.module.scss";import{jsx as rN,jsxs as rS}from"react/jsx-runtime";var rP=rw(void 0);function rL(){var r=rE(rP);if(!r)throw new Error("useLoading must be used within a LoadingProvider");return r}function rI(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,u=s===void 0?"Loading":s,l=E(r,["full","block","className","message"]);function c(){return rS("div",w(y({className:rj.container},l),{children:[rN("div",{className:rj.ring}),rN("div",{className:rj.ring}),rN("div",{className:rj.ring}),rN("div",{className:rj.ring}),u&&rN("div",{className:rj.message,children:u})]}))}return n?rN("div",{className:rb(rj.fullscreen,a),children:c()}):o?rN("div",{className:rb(rj.block,a),children:c()}):c()}function rC(r){var e=r.children;var n=j(rx(!1),2),t=n[0],o=n[1],i=j(rx(!1),2),a=i[0],s=i[1],u=rk(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),s(r)},[]),l=rk(function(){o(!1),s(!1)},[]),c=rO(function(){return{isLoading:t,isGlobalLoading:a,showLoading:u,hideLoading:l}},[t,a,u,l]);return rN(rP,{value:c,children:t?rN(rI,{full:a}):e})}import{NextIntlClientProvider as rA,useTranslations as r_}from"next-intl";import{createContext as rD,use as rT,useMemo as rU}from"react";import{useCallback as rM,useEffect as rQ,useState as rR}from"react";var rV={serialize:function(r){return JSON.stringify(r,function(r,e){return d(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 rG from"localforage";var rz={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,rG.getItem(r)];case 1:return[2,n.sent()];case 2:e=n.sent();return[2,($.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,rG.setItem(r,e)];case 1:t.sent();return[3,3];case 2:n=t.sent();$.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,rG.removeItem(r)];case 1:n.sent();return[3,3];case 2:e=n.sent();$.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,rG.keys()];case 1:return[2,(r=n.sent())!==null&&r!==void 0?r:[]];case 2:e=n.sent();return[2,($.error("[Storage:keys] Error getting keys:",e),[])];case 3:return[2]}})})()}};function rJ(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rV;var t=j(rR(e),2),o=t[0],a=t[1],s=j(rR(!1),2),u=s[0],l=s[1];rQ(function(){var t=!0;return i(function(){var o,i,s,u;return I(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,rz.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,rz.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:u=c.sent();$.error('Error loading value for key "'.concat(r,'":'),u),t&&a(e);return[3,8];case 7:t&&l(!0);return[7];case 8:return[2]}})})(),function(){t=!1,l(!1)}},[r,e,n]),rQ(function(){if(!u)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,rz.set(r,e)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:t=i.sent();$.error('Error saving value for key "'.concat(r,'":'),t);return[3,4];case 4:return[2]}})})()},[o,r,n,u]);var c=rM(function(r){a(function(e){return typeof r=="function"?r(e):r})},[]),f=rM(/*#__PURE__*/i(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rz.remove(r)];case 1:n.sent(),a(void 0);return[3,3];case 2:e=n.sent();$.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 rF,jsx as rq}from"react/jsx-runtime";var rW=rD(void 0);function rB(){var r=rT(rW);if(!r)throw new Error("useNextIntl must be used within a NextIntlProvider");return r}var rH=r_;function rZ(r){var e=function(e){var n;var t=rB(),o=t.currentLanguage,i=e.messages,a=e.languages,s="en",u=i[(o===null||o===void 0?void 0:o.value)||s],l=(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?rq(rA,{locale:(o===null||o===void 0?void 0:o.value)||s,messages:u,timeZone:l,children:rq(r,y({},e))}):($.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 r$(r){var e=r.children;return rq(rF,{children:e})}var rK=rZ(r$);function rX(r){var e=r.children,n=r.languages,t=r.messages;var o;var i=rJ("lang",(o=n===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:{}),a=i.value,s=i.set,u=rU(function(){return{languages:n,currentLanguage:a,setCurrentLanguage:s}},[n,s,a]);return rq(rW,{value:u,children:rq(rK,{languages:n,messages:t,children:e})})}export{rv as ApolloErrorViewerModal,rf as ApolloErrorViewerProvider,ry as ApolloProvider,rI as Loading,rP as LoadingContext,rC as LoadingProvider,rW as NextIntlContext,rX as NextIntlProvider,rl as registerApolloErrorViewerCallback,rc as showGlobalApolloError,rs as useApolloErrorViewer,rL as useLoading,rB as useNextIntl,rJ as useStorage,rH as useTranslateNextIntl,rZ as withNextIntl};
|
package/dist/react/next-intl.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(e,r,t,n,u,o
|
|
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(e,r,t,n,u,a,o){try{var l=e[a](o);var i=l.value}catch(e){t(e);return}if(l.done){r(i)}else{Promise.resolve(i).then(n,u)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(u,a){var o=e.apply(r,n);function l(e){t(o,u,a,l,i,"next",e)}function i(e){t(o,u,a,l,i,"throw",e)}l(undefined)})}}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 a(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function o(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var u=true;var a=false;var o,l;try{for(t=t.call(e);!(u=(o=t.next()).done);u=true){n.push(o.value);if(r&&n.length===r)break}}catch(e){a=true;l=e}finally{try{if(!u&&t["return"]!=null)t["return"]()}finally{if(a)throw l}}return n}function l(){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 i(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 s(e,t){return r(e)||o(e,t)||f(e,t)||l()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(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 v(e,r){var t,n,u,a,o={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return a={next:l(0),"throw":l(1),"return":l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(r){return i([e,r])}}function i(a){if(t)throw new TypeError("Generator is already executing.");while(o)try{if(t=1,n&&(u=a[0]&2?n["return"]:a[0]?n["throw"]||((u=n["return"])&&u.call(n),0):n.next)&&!(u=u.call(n,a[1])).done)return u;if(n=0,u)a=[a[0]&2,u.value];switch(a[0]){case 0:case 1:u=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(u=o.trys,u=u.length>0&&u[u.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!u||a[1]>u[0]&&a[1]<u[3])){o.label=a[1];break}if(a[0]===6&&o.label<u[1]){o.label=u[1];u=a;break}if(u&&o.label<u[2]){o.label=u[2];o.ops.push(a);break}if(u[2])o.ops.pop();o.trys.pop();continue}a=r.call(e,o)}catch(e){a=[6,e];n=0}finally{t=u=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var d=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var m=function(e,r){for(var t in r)d(e,t,{get:r[t],enumerable:!0})},w=function(e,r,t,n){var u=true,a=false,o=undefined;if(r&&(typeof r==="undefined"?"undefined":c(r))=="object"||typeof r=="function")try{var l=function(){var u=s.value;!p.call(e,u)&&u!==t&&d(e,u,{get:function(){return r[u]},enumerable:!(n=b(r,u))||n.enumerable})};for(var i=g(r)[Symbol.iterator](),s;!(u=(s=i.next()).done);u=true)l()}catch(e){a=true;o=e}finally{try{if(!u&&i.return!=null){i.return()}}finally{if(a){throw o}}}return e};var x=function(e,r,t){return t=e!=null?y(h(e)):{},w(r||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)},I=function(e){return w(d({},"__esModule",{value:!0}),e)};var S={};m(S,{NextIntlContext:function(){return A},NextIntlProvider:function(){return U},useNextIntl:function(){return D},useTranslateNextIntl:function(){return T},withNextIntl:function(){return M}});module.exports=I(S);var N=require("next-intl"),O=require("react");var j=require("consola/browser"),k={silent:j.consola.silent,level:j.consola.level,fatal:j.consola.fatal,error:j.consola.error,warn:j.consola.warn,log:j.consola.log,info:j.consola.info,success:j.consola.success,ready:j.consola.ready,start:j.consola.start,box:j.consola.box,debug:j.consola.debug,trace:j.consola.trace,verbose:j.consola.verbose};var P=require("react");var E={serialize:function(e){return JSON.stringify(e,function(e,r){return a(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 _=x(require("localforage"),1);var C={get:function e(e){return n(function(){var r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,_.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(k.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return n(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,_.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();k.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return n(function(){var r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,_.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();k.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return n(function(){var e,r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,_.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(k.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function q(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E;var u=s((0,P.useState)(r),2),a=u[0],o=u[1],l=s((0,P.useState)(!1),2),i=l[0],c=l[1];(0,P.useEffect)(function(){var u=!0;return n(function(){var n,a,l,i;return v(this,function(s){switch(s.label){case 0:s.trys.push([0,6,7,8]);return[4,C.get(e)];case 1:n=s.sent();if(!u)return[3,5];if(!(n!==null))return[3,2];a=t.deserialize(n);o(a);return[3,5];case 2:if(!(r!==void 0))return[3,4];l=t.serialize(r);return[4,C.set(e,l)];case 3:s.sent(),o(r);return[3,5];case 4:o(void 0);s.label=5;case 5:return[3,8];case 6:i=s.sent();k.error('Error loading value for key "'.concat(e,'":'),i),u&&o(r);return[3,8];case 7:u&&c(!0);return[7];case 8:return[2]}})})(),function(){u=!1,c(!1)}},[e,r,t]),(0,P.useEffect)(function(){if(!i)return;n(function(){var r,n;return v(this,function(u){switch(u.label){case 0:u.trys.push([0,3,,4]);if(!(a!==void 0))return[3,2];r=t.serialize(a);return[4,C.set(e,r)];case 1:u.sent();u.label=2;case 2:return[3,4];case 3:n=u.sent();k.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[a,e,t,i]);var f=(0,P.useCallback)(function(e){o(function(r){return typeof e=="function"?e(r):e})},[]),y=(0,P.useCallback)(/*#__PURE__*/n(function(){var r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,C.remove(e)];case 1:t.sent(),o(void 0);return[3,3];case 2:r=t.sent();k.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:a,set:f,remove:y}}var z=require("react/jsx-runtime"),A=(0,O.createContext)(void 0);function D(){var e=(0,O.use)(A);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var T=N.useTranslations;function M(e){var r=function(r){var t;var n=D(),u=n.currentLanguage,a=r.messages,o=r.languages,l="en",s=a[(u===null||u===void 0?void 0:u.value)||l],c=(t=o.find(function(e){return e.value===(u===null||u===void 0?void 0:u.value)}))===null||t===void 0?void 0:t.timezone;return a?(0,z.jsx)(N.NextIntlClientProvider,{locale:(u===null||u===void 0?void 0:u.value)||l,messages:s,timeZone:c,children:(0,z.jsx)(e,i({},r))}):(k.warn("Missing messages for language: ".concat((u===null||u===void 0?void 0:u.value)||l)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function L(e){var r=e.children;return(0,z.jsx)(z.Fragment,{children:r})}var J=M(L);function U(e){var r=e.children,t=e.languages,n=e.messages;var u;var a=q("lang",(u=t===null||t===void 0?void 0:t[0])!==null&&u!==void 0?u:{}),o=a.value,l=a.set,i=(0,O.useMemo)(function(){return{languages:t,currentLanguage:o,setCurrentLanguage:l}},[t,l,o]);return(0,z.jsx)(A,{value:i,children:(0,z.jsx)(J,{languages:t,messages:n,children:r})})}0&&(module.exports={NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,useNextIntl:useNextIntl,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
package/dist/react/next-intl.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(e,r,t,n,a,u,o){try{var i=e[u](o);var s=i.value}catch(e){t(e);return}if(i.done){r(s)}else{Promise.resolve(s).then(n,a)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(a,u){var o=e.apply(r,n);function i(e){t(o,a,u,i,s,"next",e)}function s(e){t(o,a,u,i,s,"throw",e)}i(undefined)})}}function a(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 u(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function o(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var a=true;var u=false;var o,i;try{for(t=t.call(e);!(a=(o=t.next()).done);a=true){n.push(o.value);if(r&&n.length===r)break}}catch(e){u=true;i=e}finally{try{if(!a&&t["return"]!=null)t["return"]()}finally{if(u)throw i}}return n}function i(){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 s(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){a(e,r,t[r])})}return e}function l(e,t){return r(e)||o(e,t)||c(e,t)||i()}function c(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 f(e,r){var t,n,a,u,o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]};return u={next:i(0),"throw":i(1),"return":i(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function i(e){return function(r){return s([e,r])}}function s(u){if(t)throw new TypeError("Generator is already executing.");while(o)try{if(t=1,n&&(a=u[0]&2?n["return"]:u[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;if(n=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:o.label++;return{value:u[1],done:false};case 5:o.label++;n=u[1];u=[0];continue;case 7:u=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1];a=u;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(u);break}if(a[2])o.ops.pop();o.trys.pop();continue}u=r.call(e,o)}catch(e){u=[6,e];n=0}finally{t=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}import{NextIntlClientProvider as v,useTranslations as y}from"next-intl";import{createContext as
|
|
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(e,r,t,n,a,u,o){try{var i=e[u](o);var s=i.value}catch(e){t(e);return}if(i.done){r(s)}else{Promise.resolve(s).then(n,a)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(a,u){var o=e.apply(r,n);function i(e){t(o,a,u,i,s,"next",e)}function s(e){t(o,a,u,i,s,"throw",e)}i(undefined)})}}function a(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 u(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function o(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var a=true;var u=false;var o,i;try{for(t=t.call(e);!(a=(o=t.next()).done);a=true){n.push(o.value);if(r&&n.length===r)break}}catch(e){u=true;i=e}finally{try{if(!a&&t["return"]!=null)t["return"]()}finally{if(u)throw i}}return n}function i(){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 s(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){a(e,r,t[r])})}return e}function l(e,t){return r(e)||o(e,t)||c(e,t)||i()}function c(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 f(e,r){var t,n,a,u,o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]};return u={next:i(0),"throw":i(1),"return":i(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function i(e){return function(r){return s([e,r])}}function s(u){if(t)throw new TypeError("Generator is already executing.");while(o)try{if(t=1,n&&(a=u[0]&2?n["return"]:u[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;if(n=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:o.label++;return{value:u[1],done:false};case 5:o.label++;n=u[1];u=[0];continue;case 7:u=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1];a=u;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(u);break}if(a[2])o.ops.pop();o.trys.pop();continue}u=r.call(e,o)}catch(e){u=[6,e];n=0}finally{t=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}import{NextIntlClientProvider as v,useTranslations as y}from"next-intl";import{createContext as g,use as d,useMemo as h}from"react";import{consola as m}from"consola/browser";var b={silent:m.silent,level:m.level,fatal:m.fatal,error:m.error,warn:m.warn,log:m.log,info:m.info,success:m.success,ready:m.ready,start:m.start,box:m.box,debug:m.debug,trace:m.trace,verbose:m.verbose};import{useCallback as p,useEffect as w,useState as x}from"react";var S={serialize:function(e){return JSON.stringify(e,function(e,r){return u(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 I from"localforage";var k={get:function e(e){return n(function(){var r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,I.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(b.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return n(function(){var t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,I.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();b.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return n(function(){var r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,I.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();b.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return n(function(){var e,r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,I.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(b.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function E(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S;var a=l(x(r),2),u=a[0],o=a[1],i=l(x(!1),2),s=i[0],c=i[1];w(function(){var a=!0;return n(function(){var n,u,i,s;return f(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,k.get(e)];case 1:n=l.sent();if(!a)return[3,5];if(!(n!==null))return[3,2];u=t.deserialize(n);o(u);return[3,5];case 2:if(!(r!==void 0))return[3,4];i=t.serialize(r);return[4,k.set(e,i)];case 3:l.sent(),o(r);return[3,5];case 4:o(void 0);l.label=5;case 5:return[3,8];case 6:s=l.sent();b.error('Error loading value for key "'.concat(e,'":'),s),a&&o(r);return[3,8];case 7:a&&c(!0);return[7];case 8:return[2]}})})(),function(){a=!1,c(!1)}},[e,r,t]),w(function(){if(!s)return;n(function(){var r,n;return f(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(u!==void 0))return[3,2];r=t.serialize(u);return[4,k.set(e,r)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:n=a.sent();b.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[u,e,t,s]);var v=p(function(e){o(function(r){return typeof e=="function"?e(r):e})},[]),y=p(/*#__PURE__*/n(function(){var r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,k.remove(e)];case 1:t.sent(),o(void 0);return[3,3];case 2:r=t.sent();b.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:u,set:v,remove:y}}import{Fragment as N,jsx as O}from"react/jsx-runtime";var j=g(void 0);function P(){var e=d(j);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var _=y;function C(e){var r=function(r){var t;var n=P(),a=n.currentLanguage,u=r.messages,o=r.languages,i="en",l=u[(a===null||a===void 0?void 0:a.value)||i],c=(t=o.find(function(e){return e.value===(a===null||a===void 0?void 0:a.value)}))===null||t===void 0?void 0:t.timezone;return u?O(v,{locale:(a===null||a===void 0?void 0:a.value)||i,messages:l,timeZone:c,children:O(e,s({},r))}):(b.warn("Missing messages for language: ".concat((a===null||a===void 0?void 0:a.value)||i)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function z(e){var r=e.children;return O(N,{children:r})}var A=C(z);function D(e){var r=e.children,t=e.languages,n=e.messages;var a;var u=E("lang",(a=t===null||t===void 0?void 0:t[0])!==null&&a!==void 0?a:{}),o=u.value,i=u.set,s=h(function(){return{languages:t,currentLanguage:o,setCurrentLanguage:i}},[t,i,o]);return O(j,{value:s,children:O(A,{languages:t,messages:n,children:r})})}export{j as NextIntlContext,D as NextIntlProvider,P as useNextIntl,_ as useTranslateNextIntl,C as withNextIntl};
|
package/dist/react/storage.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(e,r,t,n,u,
|
|
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(e,r,t,n,o,u,a){try{var s=e[u](a);var c=s.value}catch(e){t(e);return}if(s.done){r(c)}else{Promise.resolve(c).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,u){var a=e.apply(r,n);function s(e){t(a,o,u,s,c,"next",e)}function c(e){t(a,o,u,s,c,"throw",e)}s(undefined)})}}function o(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function u(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 u=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){u=true;s=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(u)throw s}}return n}function a(){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 s(e,t){return r(e)||u(e,t)||i(e,t)||a()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(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(e,r){var t,n,o,u,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return u={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(e){return function(r){return c([e,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var f=Object.create;var v=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var h=function(e,r){for(var t in r)v(e,t,{get:r[t],enumerable:!0})},g=function(e,r,t,n){var o=true,u=false,a=undefined;if(r&&(typeof r==="undefined"?"undefined":c(r))=="object"||typeof r=="function")try{var s=function(){var o=l.value;!d.call(e,o)&&o!==t&&v(e,o,{get:function(){return r[o]},enumerable:!(n=y(r,o))||n.enumerable})};for(var i=b(r)[Symbol.iterator](),l;!(o=(l=i.next()).done);o=true)s()}catch(e){u=true;a=e}finally{try{if(!o&&i.return!=null){i.return()}}finally{if(u){throw a}}}return e};var m=function(e,r,t){return t=e!=null?f(p(e)):{},g(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)},w=function(e){return g(v({},"__esModule",{value:!0}),e)};var S={};h(S,{useStorage:function(){return I}});module.exports=w(S);var k=require("react");var O=require("consola/browser"),E={silent:O.consola.silent,level:O.consola.level,fatal:O.consola.fatal,error:O.consola.error,warn:O.consola.warn,log:O.consola.log,info:O.consola.info,success:O.consola.success,ready:O.consola.ready,start:O.consola.start,box:O.consola.box,debug:O.consola.debug,trace:O.consola.trace,verbose:O.consola.verbose};var _={serialize:function(e){return JSON.stringify(e,function(e,r){return o(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 j=m(require("localforage"),1);var x={get:function e(e){return n(function(){var r;return l(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(E.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return n(function(){var t;return l(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,j.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();E.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return n(function(){var r;return l(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();E.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return n(function(){var e,r;return l(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(E.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function I(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_;var o=s((0,k.useState)(r),2),u=o[0],a=o[1],c=s((0,k.useState)(!1),2),i=c[0],f=c[1];(0,k.useEffect)(function(){var o=!0;return n(function(){var n,u,s,c;return l(this,function(i){switch(i.label){case 0:i.trys.push([0,6,7,8]);return[4,x.get(e)];case 1:n=i.sent();if(!o)return[3,5];if(!(n!==null))return[3,2];u=t.deserialize(n);a(u);return[3,5];case 2:if(!(r!==void 0))return[3,4];s=t.serialize(r);return[4,x.set(e,s)];case 3:i.sent(),a(r);return[3,5];case 4:a(void 0);i.label=5;case 5:return[3,8];case 6:c=i.sent();E.error('Error loading value for key "'.concat(e,'":'),c),o&&a(r);return[3,8];case 7:o&&f(!0);return[7];case 8:return[2]}})})(),function(){o=!1,f(!1)}},[e,r,t]),(0,k.useEffect)(function(){if(!i)return;n(function(){var r,n;return l(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(!(u!==void 0))return[3,2];r=t.serialize(u);return[4,x.set(e,r)];case 1:o.sent();o.label=2;case 2:return[3,4];case 3:n=o.sent();E.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[u,e,t,i]);var v=(0,k.useCallback)(function(e){a(function(r){return typeof e=="function"?e(r):e})},[]),y=(0,k.useCallback)(/*#__PURE__*/n(function(){var r;return l(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,x.remove(e)];case 1:t.sent(),a(void 0);return[3,3];case 2:r=t.sent();E.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:u,set:v,remove:y}}0&&(module.exports={useStorage:useStorage});
|
package/dist/react/storage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(r,e,t,n,a,u,o){try{var s=r[u](o);var i=s.value}catch(r){t(r);return}if(s.done){e(i)}else{Promise.resolve(i).then(n,a)}}function n(r){return function(){var e=this,n=arguments;return new Promise(function(a,u){var o=r.apply(e,n);function s(r){t(o,a,u,s,i,"next",r)}function i(r){t(o,a,u,s,i,"throw",r)}s(undefined)})}}function a(r,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](r)}else{return r instanceof e}}function u(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var a=true;var u=false;var o,s;try{for(t=t.call(r);!(a=(o=t.next()).done);a=true){n.push(o.value);if(e&&n.length===e)break}}catch(r){u=true;s=r}finally{try{if(!a&&t["return"]!=null)t["return"]()}finally{if(u)throw s}}return n}function o(){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 s(r,t){return e(r)||u(r,t)||i(r,t)||o()}function i(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.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 r(e,t)}function c(r,e){var t,n,a,u,o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]};return u={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(r){return function(e){return i([r,e])}}function i(u){if(t)throw new TypeError("Generator is already executing.");while(o)try{if(t=1,n&&(a=u[0]&2?n["return"]:u[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;if(n=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:o.label++;return{value:u[1],done:false};case 5:o.label++;n=u[1];u=[0];continue;case 7:u=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1];a=u;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(u);break}if(a[2])o.ops.pop();o.trys.pop();continue}u=e.call(r,o)}catch(r){u=[6,r];n=0}finally{t=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}import{useCallback as l,useEffect as f,useState as v}from"react";import{consola as y}from"consola/browser";var h={silent:y.silent,level:y.level,fatal:y.fatal,error:y.error,warn:y.warn,log:y.log,info:y.info,success:y.success,ready:y.ready,start:y.start,box:y.box,debug:y.debug,trace:y.trace,verbose:y.verbose};var b={serialize:function(r){return JSON.stringify(r,function(r,e){return a(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 p from"localforage";var g={get:function r(r){return n(function(){var e;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,p.getItem(r)];case 1:return[2,t.sent()];case 2:e=t.sent();return[2,(h.error('[Storage:get] Error getting key "'.concat(r,'":'),e),null)];case 3:return[2]}})})()},set:function r(r,e){return n(function(){var t;return c(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,p.setItem(r,e)];case 1:n.sent();return[3,3];case 2:t=n.sent();h.error('[Storage:set] Error setting key "'.concat(r,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function r(r){return n(function(){var e;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,p.removeItem(r)];case 1:t.sent();return[3,3];case 2:e=t.sent();h.error('[Storage:remove] Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})})()},keys:function r(){return n(function(){var r,e;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,p.keys()];case 1:return[2,(r=t.sent())!==null&&r!==void 0?r:[]];case 2:e=t.sent();return[2,(h.error("[Storage:keys] Error getting keys:",e),[])];case 3:return[2]}})})()}};function d(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b;var a=s(v(e),2),u=a[0],o=a[1],i=s(v(!1),2),y=i[0],p=i[1];f(function(){var a=!0;return n(function(){var n,u,s,i;return c(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,g.get(r)];case 1:n=c.sent();if(!a)return[3,5];if(!(n!==null))return[3,2];u=t.deserialize(n);o(u);return[3,5];case 2:if(!(e!==void 0))return[3,4];s=t.serialize(e);return[4,g.set(r,s)];case 3:c.sent(),o(e);return[3,5];case 4:o(void 0);c.label=5;case 5:return[3,8];case 6:i=c.sent();h.error('Error loading value for key "'.concat(r,'":'),i),a&&o(e);return[3,8];case 7:a&&p(!0);return[7];case 8:return[2]}})})(),function(){a=!1,p(!1)}},[r,e,t]),f(function(){if(!y)return;n(function(){var e,n;return c(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(u!==void 0))return[3,2];e=t.serialize(u);return[4,g.set(r,e)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:n=a.sent();h.error('Error saving value for key "'.concat(r,'":'),n);return[3,4];case 4:return[2]}})})()},[u,r,t,y]);var d=l(function(r){o(function(e){return typeof r=="function"?r(e):r})},[]),m=l(/*#__PURE__*/n(function(){var e;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,g.remove(r)];case 1:t.sent(),o(void 0);return[3,3];case 2:e=t.sent();h.error('Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})}),[r]);return{value:u,set:d,remove:m}}export{d as useStorage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var u=function(e,n){for(var t in n)r(e,t,{get:n[t],enumerable:!0})},a=function(u,a,f,i){var c=true,y=false,l=undefined;if(a&&(typeof a==="undefined"?"undefined":e(a))=="object"||typeof a=="function")try{var _=function(){var e=s.value;!o.call(u,e)&&e!==f&&r(u,e,{get:function(){return a[e]},enumerable:!(i=n(a,e))||i.enumerable})};for(var p=t(a)[Symbol.iterator](),s;!(c=(s=p.next()).done);c=true)_()}catch(e){y=true;l=e}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(y){throw l}}}return u};var f=function(e){return a(r({},"__esModule",{value:!0}),e)};var i={};u(i,{E_CommandType:function(){return y},E_IssueType:function(){return c}});module.exports=f(i);var c=function(e){return e.Error="error",e.Warning="warning",e}(c||{}),y=function(e){return e.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",e.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",e.RAW="RAW",e}(y||{});0&&(module.exports={E_CommandType:E_CommandType,E_IssueType:E_IssueType});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { E_IssueType_alias_1 as E_IssueType } from '../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { I_IssueEntry_alias_1 as I_IssueEntry } from '../_tsup-dts-rollup.cjs';
|
|
3
3
|
export { I_EslintError_alias_1 as I_EslintError } from '../_tsup-dts-rollup.cjs';
|
|
4
|
-
export { I_BoxedLogOptions_alias_1 as I_BoxedLogOptions } from '../_tsup-dts-rollup.cjs';
|
|
5
4
|
export { I_CommandContext_alias_1 as I_CommandContext } from '../_tsup-dts-rollup.cjs';
|
|
6
5
|
export { I_Command_alias_1 as I_Command } from '../_tsup-dts-rollup.cjs';
|
|
7
6
|
export { T_CommandFunction_alias_1 as T_CommandFunction } from '../_tsup-dts-rollup.cjs';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { E_IssueType_alias_1 as E_IssueType } from '../_tsup-dts-rollup.js';
|
|
2
|
+
export { I_IssueEntry_alias_1 as I_IssueEntry } from '../_tsup-dts-rollup.js';
|
|
3
3
|
export { I_EslintError_alias_1 as I_EslintError } from '../_tsup-dts-rollup.js';
|
|
4
|
-
export { I_BoxedLogOptions_alias_1 as I_BoxedLogOptions } from '../_tsup-dts-rollup.js';
|
|
5
4
|
export { I_CommandContext_alias_1 as I_CommandContext } from '../_tsup-dts-rollup.js';
|
|
6
5
|
export { I_Command_alias_1 as I_Command } from '../_tsup-dts-rollup.js';
|
|
7
6
|
export { T_CommandFunction_alias_1 as T_CommandFunction } from '../_tsup-dts-rollup.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=function(_){return _.Error="error",_.Warning="warning",_}(_||{}),r=function(_){return _.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",_.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",_.RAW="RAW",_}(r||{});export{r as E_CommandType,_ as E_IssueType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function
|
|
1
|
+
"use strict";function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function e(t,e,n){e=r(e);return u(t,f()?Reflect.construct(e,n||[],r(t).constructor):e.apply(t,n))}function n(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function r(t){r=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return r(t)}function o(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)i(t,e)}function u(e,n){if(n&&(c(n)==="object"||typeof n==="function")){return n}return t(e)}function i(t,e){i=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return i(t,e)}function c(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}var _=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var p=function(t,e){for(var n in e)_(t,n,{get:e[n],enumerable:!0})},y=function(t,e,n,r){var o=true,u=false,i=undefined;if(e&&(typeof e==="undefined"?"undefined":c(e))=="object"||typeof e=="function")try{var f=function(){var o=y.value;!s.call(t,o)&&o!==n&&_(t,o,{get:function(){return e[o]},enumerable:!(r=a(e,o))||r.enumerable})};for(var p=l(e)[Symbol.iterator](),y;!(o=(y=p.next()).done);o=true)f()}catch(t){u=true;i=t}finally{try{if(!o&&p.return!=null){p.return()}}finally{if(u){throw i}}}return t};var E=function(t){return y(_({},"__esModule",{value:!0}),t)};var C={};p(C,{C_Collection:function(){return O},C_Db:function(){return T},C_Document:function(){return h},C_Model:function(){return P},E_CommandType:function(){return d},E_ConfigType:function(){return m},E_IssueType:function(){return b}});module.exports=E(C);var b=function(t){return t.Error="error",t.Warning="warning",t}(b||{}),d=function(t){return t.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",t.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",t.RAW="RAW",t}(d||{});var m=function(t){return t.ESLINT="eslint",t.COMMITLINT="commitlint",t.LINT_STAGED="lint-staged",t.VITEST_REACT_E2E="vitest-react-e2e",t.VITEST_REACT_UNIT="vitest-react-unit",t}(m||{});var D=require("mongodb"),v=require("mongoose"),T=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(D.Db),h=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(v.Document),P=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(v.Model),O=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(D.Collection);0&&(module.exports={C_Collection:C_Collection,C_Db:C_Db,C_Document:C_Document,C_Model:C_Model,E_CommandType:E_CommandType,E_ConfigType:E_ConfigType,E_IssueType:E_IssueType});
|
|
@@ -6,10 +6,9 @@ export { I_ApolloProviderProps_alias_2 as I_ApolloProviderProps } from '../_tsup
|
|
|
6
6
|
export { ApolloCache_alias_2 as ApolloCache } from '../_tsup-dts-rollup.cjs';
|
|
7
7
|
export { ApolloClient_alias_2 as ApolloClient } from '../_tsup-dts-rollup.cjs';
|
|
8
8
|
export { ApolloClientOptions_alias_2 as ApolloClientOptions } from '../_tsup-dts-rollup.cjs';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
9
|
+
export { E_IssueType_alias_2 as E_IssueType } from '../_tsup-dts-rollup.cjs';
|
|
10
|
+
export { I_IssueEntry_alias_2 as I_IssueEntry } from '../_tsup-dts-rollup.cjs';
|
|
11
11
|
export { I_EslintError_alias_2 as I_EslintError } from '../_tsup-dts-rollup.cjs';
|
|
12
|
-
export { I_BoxedLogOptions_alias_2 as I_BoxedLogOptions } from '../_tsup-dts-rollup.cjs';
|
|
13
12
|
export { I_CommandContext_alias_2 as I_CommandContext } from '../_tsup-dts-rollup.cjs';
|
|
14
13
|
export { I_Command_alias_2 as I_Command } from '../_tsup-dts-rollup.cjs';
|
|
15
14
|
export { T_CommandFunction_alias_2 as T_CommandFunction } from '../_tsup-dts-rollup.cjs';
|
|
@@ -23,7 +22,9 @@ export { T_ConfigType_alias_2 as T_ConfigType } from '../_tsup-dts-rollup.cjs';
|
|
|
23
22
|
export { T_ConfigHandler_alias_2 as T_ConfigHandler } from '../_tsup-dts-rollup.cjs';
|
|
24
23
|
export { I_GraphqlCodegenConfig_alias_2 as I_GraphqlCodegenConfig } from '../_tsup-dts-rollup.cjs';
|
|
25
24
|
export { I_LoadingProps_alias_1 as I_LoadingProps } from '../_tsup-dts-rollup.cjs';
|
|
26
|
-
export {
|
|
25
|
+
export { T_ThrowError_alias_1 as T_ThrowError } from '../_tsup-dts-rollup.cjs';
|
|
26
|
+
export { I_Log_alias_1 as I_Log } from '../_tsup-dts-rollup.cjs';
|
|
27
|
+
export { I_Log_NodeJS_alias_1 as I_Log_NodeJS } from '../_tsup-dts-rollup.cjs';
|
|
27
28
|
export { C_Db_alias_1 as C_Db } from '../_tsup-dts-rollup.cjs';
|
|
28
29
|
export { T_Filter_alias_1 as T_Filter } from '../_tsup-dts-rollup.cjs';
|
|
29
30
|
export { T_InsertOneResult_alias_1 as T_InsertOneResult } from '../_tsup-dts-rollup.cjs';
|
|
@@ -6,10 +6,9 @@ export { I_ApolloProviderProps_alias_2 as I_ApolloProviderProps } from '../_tsup
|
|
|
6
6
|
export { ApolloCache_alias_2 as ApolloCache } from '../_tsup-dts-rollup.js';
|
|
7
7
|
export { ApolloClient_alias_2 as ApolloClient } from '../_tsup-dts-rollup.js';
|
|
8
8
|
export { ApolloClientOptions_alias_2 as ApolloClientOptions } from '../_tsup-dts-rollup.js';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
9
|
+
export { E_IssueType_alias_2 as E_IssueType } from '../_tsup-dts-rollup.js';
|
|
10
|
+
export { I_IssueEntry_alias_2 as I_IssueEntry } from '../_tsup-dts-rollup.js';
|
|
11
11
|
export { I_EslintError_alias_2 as I_EslintError } from '../_tsup-dts-rollup.js';
|
|
12
|
-
export { I_BoxedLogOptions_alias_2 as I_BoxedLogOptions } from '../_tsup-dts-rollup.js';
|
|
13
12
|
export { I_CommandContext_alias_2 as I_CommandContext } from '../_tsup-dts-rollup.js';
|
|
14
13
|
export { I_Command_alias_2 as I_Command } from '../_tsup-dts-rollup.js';
|
|
15
14
|
export { T_CommandFunction_alias_2 as T_CommandFunction } from '../_tsup-dts-rollup.js';
|
|
@@ -23,7 +22,9 @@ export { T_ConfigType_alias_2 as T_ConfigType } from '../_tsup-dts-rollup.js';
|
|
|
23
22
|
export { T_ConfigHandler_alias_2 as T_ConfigHandler } from '../_tsup-dts-rollup.js';
|
|
24
23
|
export { I_GraphqlCodegenConfig_alias_2 as I_GraphqlCodegenConfig } from '../_tsup-dts-rollup.js';
|
|
25
24
|
export { I_LoadingProps_alias_1 as I_LoadingProps } from '../_tsup-dts-rollup.js';
|
|
26
|
-
export {
|
|
25
|
+
export { T_ThrowError_alias_1 as T_ThrowError } from '../_tsup-dts-rollup.js';
|
|
26
|
+
export { I_Log_alias_1 as I_Log } from '../_tsup-dts-rollup.js';
|
|
27
|
+
export { I_Log_NodeJS_alias_1 as I_Log_NodeJS } from '../_tsup-dts-rollup.js';
|
|
27
28
|
export { C_Db_alias_1 as C_Db } from '../_tsup-dts-rollup.js';
|
|
28
29
|
export { T_Filter_alias_1 as T_Filter } from '../_tsup-dts-rollup.js';
|
|
29
30
|
export { T_InsertOneResult_alias_1 as T_InsertOneResult } from '../_tsup-dts-rollup.js';
|
package/dist/typescript/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function n(t,n,
|
|
1
|
+
function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function n(t,n,e){n=r(n);return u(t,s()?Reflect.construct(n,e||[],r(t).constructor):n.apply(t,e))}function e(t,n){if(!(t instanceof n)){throw new TypeError("Cannot call a class as a function")}}function r(t){r=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return r(t)}function o(t,n){if(typeof n!=="function"&&n!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:true,configurable:true}});if(n)i(t,n)}function u(n,e){if(e&&(c(e)==="object"||typeof e==="function")){return e}return t(n)}function i(t,n){i=Object.setPrototypeOf||function t(t,n){t.__proto__=n;return t};return i(t,n)}function c(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}var f=function(t){return t.Error="error",t.Warning="warning",t}(f||{}),_=function(t){return t.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",t.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",t.RAW="RAW",t}(_||{});var a=function(t){return t.ESLINT="eslint",t.COMMITLINT="commitlint",t.LINT_STAGED="lint-staged",t.VITEST_REACT_E2E="vitest-react-e2e",t.VITEST_REACT_UNIT="vitest-react-unit",t}(a||{});import{Collection as l,Db as p}from"mongodb";import{Document as E,Model as y}from"mongoose";var D=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(p),T=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(E),b=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(y),h=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(l);export{h as C_Collection,D as C_Db,T as C_Document,b as C_Model,_ as E_CommandType,a as E_ConfigType,f as E_IssueType};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { T_ThrowError_alias_2 as T_ThrowError } from '../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { I_Log_alias_2 as I_Log } from '../_tsup-dts-rollup.cjs';
|
|
3
|
+
export { I_Log_NodeJS_alias_2 as I_Log_NodeJS } from '../_tsup-dts-rollup.cjs';
|
package/dist/typescript/log.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { T_ThrowError_alias_2 as T_ThrowError } from '../_tsup-dts-rollup.js';
|
|
2
|
+
export { I_Log_alias_2 as I_Log } from '../_tsup-dts-rollup.js';
|
|
3
|
+
export { I_Log_NodeJS_alias_2 as I_Log_NodeJS } from '../_tsup-dts-rollup.js';
|