coinley-checkout 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"coinley-checkout.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/context/ThemeContext.jsx","../src/services/api.js","../src/context/CoinleyContext.jsx","../src/services/web3.js","../src/components/QRCode.jsx","../src/components/PaymentStatus.jsx","../src/components/PaymentMethods.jsx","../src/assets/Logo.png","../src/components/CoinleyModal.jsx","../src/components/CoinleyCheckout.jsx","../src/index.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","// src/context/ThemeContext.jsx\r\nimport React, { createContext, useState, useContext, useEffect } from 'react';\r\n\r\nconst ThemeContext = createContext();\r\n\r\nexport const useTheme = () => useContext(ThemeContext);\r\n\r\nexport const ThemeProvider = ({ initialTheme = 'light', children }) => {\r\n const [theme, setTheme] = useState(initialTheme);\r\n\r\n const toggleTheme = () => {\r\n setTheme(prevTheme => prevTheme === 'light' ? 'dark' : 'light');\r\n };\r\n\r\n useEffect(() => {\r\n document.documentElement.classList.remove('light', 'dark');\r\n document.documentElement.classList.add(theme);\r\n }, [theme]);\r\n\r\n return (\r\n <ThemeContext.Provider value={{ theme, setTheme, toggleTheme }}>\r\n {children}\r\n </ThemeContext.Provider>\r\n );\r\n};\r\n","// src/services/api.js - Production Version\r\nlet apiConfig = {\r\n apiKey: null,\r\n apiSecret: null,\r\n apiUrl: 'https://coinleyserver-production.up.railway.app'\r\n };\r\n \r\n /**\r\n * Initialize the API with configuration\r\n * @param {Object} config - API configuration\r\n */\r\n export const initializeApi = (config) => {\r\n apiConfig = { ...apiConfig, ...config };\r\n console.log('API initialized with:', apiConfig);\r\n };\r\n \r\n /**\r\n * Generate headers with authentication\r\n * @returns {Object} - Headers object with authentication\r\n */\r\n const getHeaders = () => {\r\n return {\r\n 'Content-Type': 'application/json',\r\n 'x-api-key': apiConfig.apiKey,\r\n 'x-api-secret': apiConfig.apiSecret\r\n };\r\n };\r\n \r\n /**\r\n * Create a new payment\r\n * @param {Object} paymentData - Payment data\r\n * @returns {Promise} - Promise resolving to payment details\r\n */\r\n export const createPayment = async (paymentData) => {\r\n try {\r\n console.log('Creating payment with data:', paymentData);\r\n console.log('API URL:', `${apiConfig.apiUrl}/api/payments/create`);\r\n \r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/create`, {\r\n method: 'POST',\r\n headers: getHeaders(),\r\n body: JSON.stringify(paymentData)\r\n });\r\n \r\n console.log('Create payment response status:', response.status);\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n console.error('Error creating payment:', errorData);\r\n throw new Error(errorData.error || `Failed to create payment: ${response.status}`);\r\n }\r\n \r\n const data = await response.json();\r\n console.log('Create payment response data:', data);\r\n return data;\r\n } catch (error) {\r\n console.error('Create payment error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get payment details by ID\r\n * @param {string} paymentId - Payment ID\r\n * @returns {Promise} - Promise resolving to payment details\r\n */\r\n export const getPayment = async (paymentId) => {\r\n try {\r\n console.log('Getting payment:', paymentId);\r\n \r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/${paymentId}`, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n console.error('Error getting payment:', errorData);\r\n throw new Error(errorData.error || `Failed to get payment: ${response.status}`);\r\n }\r\n \r\n const data = await response.json();\r\n console.log('Get payment response:', data);\r\n return data;\r\n } catch (error) {\r\n console.error('Get payment error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Process a payment\r\n * @param {Object} processData - Payment process data\r\n * @returns {Promise} - Promise resolving to processed payment details\r\n */\r\n export const processPayment = async (processData) => {\r\n try {\r\n console.log('Processing payment with data:', processData);\r\n console.log('API URL:', `${apiConfig.apiUrl}/api/payments/process`);\r\n \r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/process`, {\r\n method: 'POST',\r\n headers: getHeaders(),\r\n body: JSON.stringify(processData)\r\n });\r\n \r\n console.log('Process payment response status:', response.status);\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n console.error('Error processing payment:', errorData);\r\n throw new Error(errorData.error || `Failed to process payment: ${response.status}`);\r\n }\r\n \r\n const data = await response.json();\r\n console.log('Process payment response data:', data);\r\n return data;\r\n } catch (error) {\r\n console.error('Process payment error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get merchant payments with optional filtering\r\n * @param {Object} options - Filter and pagination options\r\n * @returns {Promise} - Promise resolving to paginated payment list\r\n */\r\n export const getMerchantPayments = async (options = {}) => {\r\n try {\r\n const { page = 1, limit = 10, status, currency, startDate, endDate, search } = options;\r\n \r\n // Build query string\r\n const queryParams = new URLSearchParams();\r\n queryParams.append('page', page);\r\n queryParams.append('limit', limit);\r\n \r\n if (status) queryParams.append('status', status);\r\n if (currency) queryParams.append('currency', currency);\r\n if (startDate) queryParams.append('startDate', startDate);\r\n if (endDate) queryParams.append('endDate', endDate);\r\n if (search) queryParams.append('search', search);\r\n \r\n const url = `${apiConfig.apiUrl}/api/payments/merchant/list?${queryParams.toString()}`;\r\n \r\n const response = await fetch(url, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n throw new Error(errorData.error || `Failed to get payments: ${response.status}`);\r\n }\r\n \r\n return await response.json();\r\n } catch (error) {\r\n console.error('Get merchant payments error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get payment statistics for the merchant\r\n * @returns {Promise} - Promise resolving to payment statistics\r\n */\r\n export const getMerchantPaymentStats = async () => {\r\n try {\r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/merchant/stats`, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n throw new Error(errorData.error || `Failed to get payment stats: ${response.status}`);\r\n }\r\n \r\n return await response.json();\r\n } catch (error) {\r\n console.error('Get merchant payment stats error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get supported currencies from the server\r\n * @returns {Promise} - Promise resolving to list of supported currencies\r\n */\r\n export const getSupportedCurrencies = async () => {\r\n try {\r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/currencies`, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n throw new Error(errorData.error || `Failed to get currencies: ${response.status}`);\r\n }\r\n \r\n return await response.json();\r\n } catch (error) {\r\n console.error('Get supported currencies error:', error);\r\n \r\n // Fallback to hardcoded list if API fails\r\n return {\r\n currencies: [\r\n { id: 'USDT', name: 'Tether USD', network: 'ethereum' },\r\n { id: 'USDC', name: 'USD Coin', network: 'ethereum' },\r\n { id: 'BNB', name: 'Binance Coin', network: 'binance' },\r\n { id: 'SOL', name: 'Solana', network: 'solana' },\r\n { id: 'USDC_SOL', name: 'USD Coin (Solana)', network: 'solana' }\r\n ]\r\n };\r\n }\r\n };\r\n \r\n /**\r\n * Generate a mock transaction hash for testing\r\n * @returns {string} - Mock transaction hash\r\n */\r\n export const generateMockTransactionHash = () => {\r\n return `0x${Array.from({length: 64}, () => \r\n Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n };","\r\n// src/context/CoinleyContext.jsx\r\nimport React, { createContext, useContext, useState, useEffect } from 'react';\r\nimport { initializeApi } from '../services/api';\r\n\r\nconst CoinleyContext = createContext();\r\n\r\nexport const useCoinley = () => useContext(CoinleyContext);\r\n\r\nexport const CoinleyProvider = ({ \r\n apiKey, \r\n apiSecret, \r\n apiUrl = 'https://coinleyserver-production.up.railway.app',\r\n debug = false,\r\n children \r\n}) => {\r\n const [isInitialized, setIsInitialized] = useState(false);\r\n const [error, setError] = useState(null);\r\n\r\n useEffect(() => {\r\n if (!apiKey || !apiSecret) {\r\n setError('API key and secret are required');\r\n return;\r\n }\r\n\r\n try {\r\n initializeApi({ apiKey, apiSecret, apiUrl });\r\n setIsInitialized(true);\r\n if (debug) {\r\n console.log('Coinley SDK initialized with:', { apiKey, apiUrl });\r\n }\r\n } catch (err) {\r\n setError(err.message);\r\n if (debug) {\r\n console.error('Coinley SDK initialization error:', err);\r\n }\r\n }\r\n }, [apiKey, apiSecret, apiUrl, debug]);\r\n\r\n const value = {\r\n apiKey,\r\n apiSecret,\r\n apiUrl,\r\n isInitialized,\r\n error,\r\n debug\r\n };\r\n\r\n return (\r\n <CoinleyContext.Provider value={value}>\r\n {children}\r\n </CoinleyContext.Provider>\r\n );\r\n};","\r\n// src/services/web3.js - Production Version\r\n/**\r\n * Check if MetaMask is installed\r\n * @returns {boolean} - Whether MetaMask is installed\r\n */\r\nexport const isMetaMaskInstalled = () => {\r\n return typeof window !== 'undefined' && typeof window.ethereum !== 'undefined';\r\n };\r\n \r\n /**\r\n * Connect to MetaMask wallet\r\n * @returns {Promise<string[]>} - Promise resolving to array of accounts\r\n */\r\n export const connectWallet = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });\r\n return accounts;\r\n } catch (error) {\r\n console.error('Error connecting to wallet:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get current wallet accounts\r\n * @returns {Promise<string[]>} - Promise resolving to array of accounts\r\n */\r\n export const getAccounts = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const accounts = await window.ethereum.request({ method: 'eth_accounts' });\r\n return accounts;\r\n } catch (error) {\r\n console.error('Error getting accounts:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get the current chain ID\r\n * @returns {Promise<string>} - Promise resolving to chain ID\r\n */\r\n export const getChainId = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const chainId = await window.ethereum.request({ method: 'eth_chainId' });\r\n return chainId;\r\n } catch (error) {\r\n console.error('Error getting chain ID:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Send a transaction\r\n * @param {Object} txParams - Transaction parameters\r\n * @returns {Promise<string>} - Promise resolving to transaction hash\r\n */\r\n export const sendTransaction = async (txParams) => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const txHash = await window.ethereum.request({\r\n method: 'eth_sendTransaction',\r\n params: [txParams],\r\n });\r\n return txHash;\r\n } catch (error) {\r\n console.error('Error sending transaction:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Send USDT or other ERC-20 token\r\n * @param {string} tokenAddress - The token contract address\r\n * @param {string} toAddress - Recipient address\r\n * @param {string} amount - Amount in smallest unit (e.g., wei)\r\n * @returns {Promise<string>} - Promise resolving to transaction hash\r\n */\r\n export const sendToken = async (tokenAddress, toAddress, amount) => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n // Get current account\r\n const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });\r\n const fromAddress = accounts[0];\r\n \r\n // ERC-20 token transfer function signature: transfer(address,uint256)\r\n const transferFunctionSignature = '0xa9059cbb';\r\n \r\n // The parameters for the transfer function (to address and amount)\r\n // Need to pad the address to 32 bytes and convert amount to hex\r\n const paddedToAddress = toAddress.slice(2).padStart(64, '0');\r\n const paddedAmount = amount.toString(16).padStart(64, '0');\r\n \r\n // Combine everything into the transaction data\r\n const data = `${transferFunctionSignature}${paddedToAddress}${paddedAmount}`;\r\n \r\n // Create transaction parameters\r\n const txParams = {\r\n from: fromAddress,\r\n to: tokenAddress,\r\n data: data,\r\n };\r\n \r\n // Send the transaction\r\n const txHash = await window.ethereum.request({\r\n method: 'eth_sendTransaction',\r\n params: [txParams],\r\n });\r\n \r\n return txHash;\r\n } catch (error) {\r\n console.error('Error sending token:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Check if a wallet is connected\r\n * @returns {Promise<boolean>} - Promise resolving to whether a wallet is connected\r\n */\r\n export const isWalletConnected = async () => {\r\n try {\r\n const accounts = await getAccounts();\r\n return accounts.length > 0;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n \r\n /**\r\n * Determine the network name from chain ID\r\n * @param {string} chainId - Chain ID in hex\r\n * @returns {string} - Network name\r\n */\r\n export const getNetworkName = (chainId) => {\r\n const networks = {\r\n '0x1': 'Ethereum Mainnet',\r\n '0x3': 'Ropsten Testnet',\r\n '0x4': 'Rinkeby Testnet',\r\n '0x5': 'Goerli Testnet',\r\n '0x2a': 'Kovan Testnet',\r\n '0x38': 'Binance Smart Chain',\r\n '0x89': 'Polygon',\r\n '0xa86a': 'Avalanche',\r\n };\r\n \r\n return networks[chainId] || `Unknown Network (${chainId})`;\r\n };\r\n \r\n /**\r\n * Get ERC-20 token balance\r\n * @param {string} tokenAddress - Token contract address\r\n * @param {string} userAddress - User wallet address\r\n * @returns {Promise<string>} - Promise resolving to token balance\r\n */\r\n export const getTokenBalance = async (tokenAddress, userAddress) => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n // balanceOf function signature\r\n const balanceOfSignature = '0x70a08231';\r\n \r\n // Pad the address to 32 bytes\r\n const paddedAddress = userAddress.slice(2).padStart(64, '0');\r\n \r\n // Create the call data\r\n const data = `${balanceOfSignature}${paddedAddress}`;\r\n \r\n // Call the contract\r\n const balance = await window.ethereum.request({\r\n method: 'eth_call',\r\n params: [\r\n {\r\n to: tokenAddress,\r\n data: data\r\n },\r\n 'latest'\r\n ]\r\n });\r\n \r\n // Convert the hex balance to decimal\r\n return parseInt(balance, 16).toString();\r\n } catch (error) {\r\n console.error('Error getting token balance:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n // Token addresses for common currencies (mainnet)\r\n export const TOKEN_ADDRESSES = {\r\n USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7',\r\n USDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\r\n DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F',\r\n WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n WBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'\r\n };\r\n \r\n // For testing purposes only - simulate a transaction without MetaMask\r\n export const simulateTransaction = (amount, currency, toAddress) => {\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n const txHash = `0x${Array.from({length: 64}, () => \r\n Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n \r\n resolve(txHash);\r\n }, 2000);\r\n });\r\n };","// // src/components/QRCode.jsx\r\n// import React, { useEffect, useRef } from 'react';\r\n\r\n// // A simple QR code renderer - in a production app, you would use a library like qrcode.react\r\n// const QRCode = ({ value, size = 200, theme = 'light' }) => {\r\n// const canvasRef = useRef(null);\r\n\r\n// // This is a simplified example - in a real implementation, use a proper QR code library\r\n// useEffect(() => {\r\n// const canvas = canvasRef.current;\r\n// if (!canvas) return;\r\n\r\n// const ctx = canvas.getContext('2d');\r\n// if (!ctx) return;\r\n\r\n// // Clear canvas\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(0, 0, size, size);\r\n\r\n// // Draw a fake QR code pattern for demonstration\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n\r\n// // Draw corner squares (position detection patterns)\r\n// // Top-left corner\r\n// ctx.fillRect(10, 10, 30, 30);\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(15, 15, 20, 20);\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n// ctx.fillRect(20, 20, 10, 10);\r\n\r\n// // Top-right corner\r\n// ctx.fillRect(size - 40, 10, 30, 30);\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(size - 35, 15, 20, 20);\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n// ctx.fillRect(size - 30, 20, 10, 10);\r\n\r\n// // Bottom-left corner\r\n// ctx.fillRect(10, size - 40, 30, 30);\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(15, size - 35, 20, 20);\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n// ctx.fillRect(20, size - 30, 10, 10);\r\n\r\n// // Draw random dots to simulate QR code data\r\n// const cellSize = 5;\r\n// for (let y = 0; y < size; y += cellSize) {\r\n// for (let x = 0; x < size; x += cellSize) {\r\n// // Skip the corners (position detection patterns)\r\n// if (\r\n// (x < 50 && y < 50) || \r\n// (x > size - 50 && y < 50) || \r\n// (x < 50 && y > size - 50)\r\n// ) {\r\n// continue;\r\n// }\r\n\r\n// // Random fill with ~40% probability\r\n// if (Math.random() > 0.6) {\r\n// ctx.fillRect(x, y, cellSize, cellSize);\r\n// }\r\n// }\r\n// }\r\n\r\n// // Draw a logo in the center\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(size / 2 - 20, size / 2 - 20, 40, 40);\r\n// ctx.fillStyle = '#3B82F6'; // Blue color for logo\r\n// ctx.beginPath();\r\n// ctx.arc(size / 2, size / 2, 15, 0, 2 * Math.PI);\r\n// ctx.fill();\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.beginPath();\r\n// ctx.arc(size / 2, size / 2, 10, 0, 2 * Math.PI);\r\n// ctx.fill();\r\n// ctx.fillStyle = '#3B82F6';\r\n// ctx.beginPath();\r\n// ctx.arc(size / 2, size / 2, 5, 0, 2 * Math.PI);\r\n// ctx.fill();\r\n// }, [size, value, theme]);\r\n\r\n// return (\r\n// <div className={`p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-white'} shadow-sm`}>\r\n// <canvas\r\n// ref={canvasRef}\r\n// width={size}\r\n// height={size}\r\n// className=\"mx-auto rounded\"\r\n// />\r\n// <div className=\"mt-2 text-center\">\r\n// <p className={`text-sm font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>\r\n// Scan with your wallet app\r\n// </p>\r\n// <p className={`text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// or copy the address below\r\n// </p>\r\n// </div>\r\n// <div className={`mt-2 p-2 rounded text-sm break-all ${theme === 'dark' ? 'bg-gray-800 text-gray-300' : 'bg-gray-100 text-gray-700'}`}>\r\n// {value.slice(0, 20)}...{value.slice(-10)}\r\n// </div>\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default QRCode;\r\n\r\n\r\n\r\n\r\n\r\n\r\n// src/components/QRCode.jsx - Ultra-simplified\r\nimport React from 'react';\r\n\r\nconst QRCode = ({ walletAddress, amount, currency, theme = 'light' }) => {\r\n return (\r\n <div className=\"flex flex-col items-center\">\r\n {/* Placeholder QR code */}\r\n <div className={`p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-white'} mb-3`}>\r\n <div style={{ width: '200px', height: '200px', backgroundColor: '#f0f0f0', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\r\n QR Code: {currency}\r\n </div>\r\n </div>\r\n \r\n <div className=\"text-center text-sm\">\r\n Scan with your wallet app to pay\r\n </div>\r\n \r\n {walletAddress && (\r\n <div className=\"mt-3 w-full\">\r\n <p className=\"text-xs mb-1\">\r\n Send {amount} {currency} to:\r\n </p>\r\n <div className=\"text-xs font-mono p-2 rounded overflow-auto break-all bg-gray-100\">\r\n {walletAddress}\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default QRCode;","// src/components/PaymentStatus.jsx - Updated version\r\nimport React from 'react';\r\n\r\nconst PaymentStatus = ({ status, theme = 'light', message }) => {\r\n console.log('PaymentStatus render:', { status, message });\r\n\r\n const renderIcon = () => {\r\n switch (status) {\r\n case 'processing':\r\n return (\r\n <div className=\"animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20\"></div>\r\n );\r\n case 'success':\r\n return (\r\n <div className=\"rounded-full h-12 w-12 bg-green-100 flex items-center justify-center\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n className=\"h-8 w-8 text-green-500\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n strokeWidth={2}\r\n >\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\r\n </svg>\r\n </div>\r\n );\r\n case 'error':\r\n return (\r\n <div className=\"rounded-full h-12 w-12 bg-red-100 flex items-center justify-center\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n className=\"h-8 w-8 text-red-500\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n strokeWidth={2}\r\n >\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </div>\r\n );\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n const getStatusTitle = () => {\r\n switch (status) {\r\n case 'processing':\r\n return 'Processing Payment';\r\n case 'success':\r\n return 'Payment Successful';\r\n case 'error':\r\n return 'Payment Failed';\r\n default:\r\n return 'Unknown Status';\r\n }\r\n };\r\n\r\n const getMessageClasses = () => {\r\n switch (status) {\r\n case 'processing':\r\n return theme === 'dark' ? 'text-blue-300' : 'text-blue-600';\r\n case 'success':\r\n return theme === 'dark' ? 'text-green-300' : 'text-green-600';\r\n case 'error':\r\n return theme === 'dark' ? 'text-red-300' : 'text-red-600';\r\n default:\r\n return theme === 'dark' ? 'text-gray-300' : 'text-gray-600';\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"flex flex-col items-center justify-center py-6\">\r\n <div className=\"mb-4\">{renderIcon()}</div>\r\n <h3 className={`text-xl font-bold mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>\r\n {getStatusTitle()}\r\n </h3>\r\n <p className={`text-center ${getMessageClasses()}`}>{message}</p>\r\n\r\n {status === 'processing' && (\r\n <div className={`mt-4 text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n This may take a few moments. Please do not close this window.\r\n </div>\r\n )}\r\n\r\n {status === 'success' && (\r\n <div className={`mt-4 p-2 rounded ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n Your payment has been successfully processed. You will receive a confirmation shortly.\r\n </p>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default PaymentStatus;","// src/components/PaymentMethods.jsx - Updated version\r\nimport React from 'react';\r\n\r\nconst PaymentMethods = ({ onSelect, selected, theme = 'light' }) => {\r\n // Debug logs to verify props\r\n console.log('PaymentMethods render:', { selected });\r\n\r\n const paymentMethods = [\r\n {\r\n id: 'USDT',\r\n name: 'USDT',\r\n description: 'Tether USD',\r\n logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzI2QTE3QiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy45MjIgMTcuMzgzdi0uMDAyYy0uMTEuMDA4LS42NzcuMDQyLTEuOTQyLjA0Mi0xLjAxIDAtMS43MjEtLjAzLTEuOTcxLS4wNDJ2LjAwM2MtMy44ODgtLjE3MS02Ljc5LS44NDgtNi43OS0xLjY1OCAwLS44MDkgMi45MDItMS40ODYgNi43OS0xLjY2di4wNDdjLjI1NC4wMTguOTgyLjA0NSAxLjk4OC4wNDUgMS4yMDcgMCAxLjgxMi0uMDM2IDEuOTI1LS4wNDZ2LS4wNDRjMy44OC4xNzQgNi43NzUuODUxIDYuNzc1IDEuNjU4IDAgLjgwNy0yLjg5NSAxLjQ4NS02Ljc3NSAxLjY1N3ptMC0zLjU2NnYtLjA0N2MuMS0uMDA4LjYyNS0uMDQ1IDEuOTI1LS4wNDUgMS4wMDUgMCAxLjczNC4wMjcgMS45ODguMDQ2di0yLjg0MWgtMy45MXYyLjgzOWMtLjExMS4wMDgtLjY4LjA0Ni0xLjk3MS4wNDYtMS4yNDMgMC0xLjgzMi0uMDM4LTEuOTQyLS4wNDZ2LTIuODRoLTMuOTF2Mi44MzhjLjI1NC4wMi45ODIuMDQ2IDEuOTg4LjA0NiAxLjIwOCAwIDEuODEyLS4wMzggMS45MjUtLjA0Nn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xNTNhMy4xMzMgMy4xMzMgMCAwMDAtNC41MzdoNC4xNTNhNy42MjEgNy42MjEgMCAwMTAgNC41Mzd6bS0xMy43OTMtNC41MzdoNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAgNC41MzdIOS42ODZhNy42MjEgNy42MjEgMCAwMTAtNC41Mzd6Ii8+PC9nPjwvc3ZnPg==',\r\n },\r\n {\r\n id: 'BNB',\r\n name: 'BNB',\r\n description: 'Binance Coin',\r\n logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSI+PGNpcmNsZSBjeD0iMTYiIGN5PSIxNiIgcj0iMTYiIGZpbGw9IiNGM0JBMkYiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMTIuMTE2IDE0LjQwNEwxNiAxMC41MmwzLjg4NiAzLjg4NmwtMi4yNiAyLjI1OEwxNiAxNC4xNDlsLTEuNjM0IDEuNjM1LTIuMjUtMi4yNTl6bTkuMTUyLS4wMDFsMi4yNi0yLjI1OSAyLjg4NyAyLjg4Ny0yLjI1OSAyLjI1OS0yLjg4OC0yLjg4N3pNMTIuMTE1IDE3LjU5NmwyLjI2LTIuMjU5IDIuODg3IDIuODg3LTIuMjU5IDIuMjU5LTIuODg4LTIuODg3em0tNC4yMjktLjAwMWwyLjI2LTIuMjU5IDIuODg3IDIuODg3LTIuMjU5IDIuMjU5LTIuODg4LTIuODg3em02LjM0NCAwTDE2IDE5LjM2NWwxLjc3Mi0xLjc3MSAyLjI1OCAyLjI1OS0xLjc3MiAxLjc3Mi0uMTcuMTctMS45MTUgMS45MTMtNC4wNDUtNC4wNDUuMDA1LS4wMDQuMDAzLS4wMDYuMDk0LS4wOTQuMDgtLjA3OXoiLz48L2c+PC9zdmc+',\r\n },\r\n {\r\n id: 'SOL',\r\n name: 'SOL',\r\n description: 'Solana',\r\n logo: 'data:image/svg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S40NC42OWwtLjQ4LjI0Yy0uMy4xNS0xMS40NSA1LjgtMTEuNDUgNS44LS4yMi4xMi0uNTctLjA0LS41Ny0uMzJWMTJjLS4wMi0uMzUuMjQtLjY2LjU3LS43aDguNDRhLjY3LjY3IDAgMDAuNjEtLjM4di0uMDJjLjA3LS4xNi4yNC0uMjQuNC0uMmwuMjUuMDRjLjE0LjAyLjMuMTguMy4xOHoiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+',\r\n },\r\n {\r\n id: 'USDC_SOL',\r\n name: 'USDC (Solana)',\r\n description: 'USD Coin on Solana',\r\n logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzJCNzVFRCIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0yMS4yMDkgOS43MzlsLTIuOTQxIDIuOTQxYTMuMTMyIDMuMTMyIDAgMDAtNC41MzYgMGwtMi45NDItMi45NDFhNy42MjMgNy42MjMgMCAwMTEwLjQxOSAwek0xMC43OTEgMjIuMjYxbDIuOTQxLTIuOTQxYTMuMTMyIDMuMTMyIDAgMDA0LjUzNiAwbDIuOTQyIDIuOTQxYTcuNjIzIDcuNjIzIDAgMDEtMTAuNDE5IDB6bTExLjU3NS00LjI2MWgtNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAtNC41MzdoNC4xNTNhNy42MjEgNy42MjEgMCAwMTAgNC41Mzd6bS0xMy43OTMtNC41MzdoNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAgNC41MzdIOS42ODZhNy42MjEgNy42MjEgMCAwMTAtNC41Mzd6Ii8+PC9nPjwvc3ZnPg==',\r\n }\r\n ];\r\n\r\n const handleSelectPaymentMethod = (id) => {\r\n console.log('Method selected:', id);\r\n // Call the onSelect prop with the selected currency\r\n onSelect(id);\r\n };\r\n\r\n return (\r\n <div>\r\n <h3 className={`text-lg font-medium mb-3 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Select Payment Method\r\n </h3>\r\n <div className=\"space-y-2\">\r\n {paymentMethods.map((method) => (\r\n <button\r\n key={method.id}\r\n onClick={() => handleSelectPaymentMethod(method.id)}\r\n className={`w-full flex items-center p-3 rounded-lg transition-colors ${\r\n selected === method.id\r\n ? theme === 'dark'\r\n ? 'bg-blue-900/30 border border-blue-500'\r\n : 'bg-blue-50 border border-blue-500'\r\n : theme === 'dark'\r\n ? 'bg-gray-700 hover:bg-gray-600 border border-gray-700'\r\n : 'bg-white hover:bg-gray-50 border border-gray-200'\r\n }`}\r\n >\r\n <div className=\"flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3\">\r\n <img src={method.logo} alt={method.name} className=\"h-6 w-6\" />\r\n </div>\r\n <div className=\"flex-1 text-left\">\r\n <h4 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>{method.name}</h4>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-500'}`}>{method.description}</p>\r\n </div>\r\n {selected === method.id && (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n className=\"h-5 w-5 text-blue-500\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n >\r\n <path\r\n fillRule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\"\r\n clipRule=\"evenodd\"\r\n />\r\n </svg>\r\n )}\r\n </button>\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default PaymentMethods;","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAAc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zhitDPgo2laq7FYrD+fXZAfOI97BXtRDKSpG0cxaSj84FVaD//NMRqPNayZUt2YYpiL9ytcp83SEejj483tGCFfIIKjbjtGv1wEwn94cVNyL77xfa2YdtMjNSdsZgrKj1eJHsWpRX7AvhYuHqvFjDfFaT3FO2Fp0VVUzxhFOzalT159IppeaYF+F8YPns2Zp2kUdU5ATz5FOpKuf2T6DNMtcovDztAnx9z2UGpVq0/vaqKFwdUetS5AC7RMbe6wqXTq8CnWpx4s4TRGVsdU3Wyf0rKke5PpWFG5liiFmpqPL0KjTSsxrr59ngYsG9pfny1WJu951z8HG85PozNRIug1OmUu0iKgqXUfyiw+e/IhFv/dkNhTKEabebFK/0hFvtNYR8wrsym27FpgBmaqjUvc1yznvaNxv3VJmzcrutRvVWqEFfEU5HXIlbwifZat1WtXATaJPv9MlyXxc5Ew2zOyh/d6Xe8SYDf+VBZo/VXh/jATa5jhd/JqVK+0UHm6gJzPea2qL3NB0NXEBwD6JmwtE+yx6cVzfdR/5V4JhBgt/YM/O9GzbkM2fubfk2KlLl94MV+XmRW2Ga77B83RQnKyX7TAcC5WBhzKesyaDXO1HWfIe0MjSDYaGNmkEzGdG1QTGaP7m4S2GDxsYJURVlQcDxAIHUQ+1z48V+Jhzp+OSFEWy8mECwdgXlfbYNsh6tF1Xfoh7GslnN9Z0btZay8MmOFkw5YpR2MKW3BCNLO0O0HZqP78QfVYP/jx2mW5TAmcbZYTHxsYFYVNer2XfRyobjxWh1cT607T7d4qejPsrO0EzAgv0u/HH4OBeGaxPO94Q6plv8FECovJc8uTjKNvgPcUpIo0ZgmzUAAAAASUVORK5CYII=\"","// // src/components/CoinleyModal.jsx - Production Version\r\n// import React, { useEffect, useState } from 'react';\r\n// import PaymentMethods from './PaymentMethods';\r\n// import PaymentStatus from './PaymentStatus';\r\n// import QRCode from './QRCode';\r\n// import { isMetaMaskInstalled } from '../services/web3';\r\n// import Logo from '../assets/Logo.png';\r\n\r\n\r\n// const CoinleyModal = ({\r\n// isOpen,\r\n// onClose,\r\n// payment,\r\n// paymentStatus,\r\n// selectedCurrency,\r\n// onCurrencySelect,\r\n// onPayment,\r\n// error,\r\n// theme = 'light',\r\n// merchantName,\r\n// transactionHash,\r\n// walletConnected,\r\n// onConnectWallet,\r\n// testMode = false\r\n// }) => {\r\n// // IMPORTANT: Start with 'select-currency', not 'processing'\r\n// const [step, setStep] = useState('select-currency');\r\n// const [isMetaMaskAvailable, setIsMetaMaskAvailable] = useState(false);\r\n \r\n// // Check if MetaMask is available\r\n// useEffect(() => {\r\n// setIsMetaMaskAvailable(isMetaMaskInstalled());\r\n// }, []);\r\n\r\n// // Update step based on payment status\r\n// useEffect(() => {\r\n// if (paymentStatus === 'loading') {\r\n// setStep('processing');\r\n// } else if (paymentStatus === 'success') {\r\n// setStep('success');\r\n// } else if (paymentStatus === 'error') {\r\n// setStep('error');\r\n// } else if (paymentStatus === 'idle' && payment) {\r\n// // Make sure we start at currency selection when a new payment is created\r\n// setStep('select-currency');\r\n// }\r\n// }, [paymentStatus, payment]);\r\n\r\n// const handleCurrencySelect = (currency) => {\r\n// onCurrencySelect(currency);\r\n// setStep('confirm');\r\n// };\r\n\r\n// const handlePaymentConfirm = () => {\r\n// onPayment();\r\n// };\r\n\r\n// const handleBack = () => {\r\n// if (step === 'confirm') {\r\n// setStep('select-currency');\r\n// }\r\n// };\r\n\r\n// const handleClose = () => {\r\n// onClose();\r\n// };\r\n\r\n// // Format amount with 2 decimal places\r\n// const formatAmount = (amount) => {\r\n// return parseFloat(amount).toFixed(2);\r\n// };\r\n\r\n// // Format transaction hash for display\r\n// const formatTransactionHash = (hash) => {\r\n// if (!hash) return '';\r\n// if (hash.length <= 14) return hash;\r\n// return `${hash.slice(0, 8)}...${hash.slice(-6)}`;\r\n// };\r\n\r\n// // Base modal classes\r\n// const modalBaseClasses = `fixed inset-0 z-50 overflow-y-auto ${theme === 'dark' ? 'bg-gray-900/75' : 'bg-black/50'}`;\r\n// const modalContentClasses = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${theme === 'dark' ? 'bg-gray-800 text-white' : 'bg-white text-gray-800'}`;\r\n// const headerClasses = `text-xl font-bold mb-4 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`;\r\n// const buttonPrimaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark' \r\n// ? 'bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500' \r\n// : 'bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500'\r\n// }`;\r\n// const buttonSecondaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark'\r\n// ? 'bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500'\r\n// : 'bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500'\r\n// }`;\r\n\r\n// if (!isOpen) return null;\r\n\r\n// return (\r\n// <div className={modalBaseClasses}>\r\n// <div className=\"flex min-h-screen items-center justify-center p-4\">\r\n// <div className={modalContentClasses}>\r\n// {/* Header */}\r\n// <div className=\"flex justify-between items-center mb-6\">\r\n// <div className=\"flex items-center\">\r\n// <img src={Logo} />\r\n// <h2 className={headerClasses}>Coinley Pay</h2>\r\n// </div>\r\n// <button \r\n// onClick={handleClose}\r\n// className={`text-gray-500 hover:text-gray-700 focus:outline-none ${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : ''}`}\r\n// >\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\r\n// </svg>\r\n// </button>\r\n// </div>\r\n \r\n// {/* Content */}\r\n// <div className=\"mb-6\">\r\n// {payment && (\r\n// <div className={`mb-6 p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {merchantName}\r\n// </p>\r\n// <div className=\"flex justify-between items-center mt-2\">\r\n// <span className={`font-medium ${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}`}>\r\n// Amount:\r\n// </span>\r\n// <span className=\"font-bold text-xl\">\r\n// ${formatAmount(payment.totalAmount || payment.amount)}\r\n// </span>\r\n// </div>\r\n// <div className=\"text-xs mt-1 text-right\">\r\n// <span className={`${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// Payment ID: {payment.id.slice(0, 8)}...\r\n// </span>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'select-currency' && (\r\n// <PaymentMethods \r\n// onSelect={handleCurrencySelect} \r\n// selected={selectedCurrency}\r\n// theme={theme}\r\n// />\r\n// )}\r\n\r\n// {step === 'confirm' && payment && (\r\n// <div>\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <h3 className={`text-lg font-medium mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Payment Details\r\n// </h3>\r\n// <div className=\"space-y-2\">\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Currency:</span>\r\n// <span className=\"font-medium\">{selectedCurrency}</span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Network:</span>\r\n// <span className=\"font-medium\">\r\n// {selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'Solana' : 'Ethereum'}\r\n// </span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Fee:</span>\r\n// <span className=\"font-medium\">1.75%</span>\r\n// </div>\r\n// </div>\r\n// </div>\r\n\r\n// {testMode ? (\r\n// // Test mode payment option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <div className=\"bg-blue-500 rounded-full p-2 mr-3\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-white\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\r\n// </svg>\r\n// </div>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Test Mode Payment\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Click \"Pay Now\" to simulate a successful payment\r\n// </p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// ) : isMetaMaskAvailable ? (\r\n// // MetaMask available option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <img \r\n// src=\"https://metamask.io/images/metamask-fox.svg\" \r\n// alt=\"MetaMask\" \r\n// className=\"w-8 h-8 mr-2\"\r\n// />\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Pay with MetaMask\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {walletConnected \r\n// ? \"Your wallet is connected. Click 'Pay Now' to proceed.\" \r\n// : \"Click 'Connect Wallet' to proceed with payment.\"\r\n// }\r\n// </p>\r\n// </div>\r\n// </div>\r\n// {!walletConnected && (\r\n// <button\r\n// onClick={onConnectWallet}\r\n// className={`mt-3 ${buttonPrimaryClasses}`}\r\n// >\r\n// Connect Wallet\r\n// </button>\r\n// )}\r\n// </div>\r\n// ) : (\r\n// // MetaMask not available warning\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-yellow-900/20' : 'bg-yellow-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-yellow-500 mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\r\n// </svg>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// MetaMask Not Detected\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Please install MetaMask extension to make payments\r\n// </p>\r\n// </div>\r\n// </div>\r\n// <a\r\n// href=\"https://metamask.io/download/\"\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`block mt-3 text-center ${buttonPrimaryClasses}`}\r\n// >\r\n// Install MetaMask\r\n// </a>\r\n// </div>\r\n// )}\r\n\r\n// <div className=\"mt-6 grid grid-cols-2 gap-3\">\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={buttonSecondaryClasses}\r\n// >\r\n// Back\r\n// </button>\r\n// <button\r\n// type=\"button\"\r\n// onClick={handlePaymentConfirm}\r\n// className={buttonPrimaryClasses}\r\n// disabled={!testMode && isMetaMaskAvailable && !walletConnected}\r\n// >\r\n// Pay Now\r\n// </button>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'processing' && (\r\n// <PaymentStatus \r\n// status=\"processing\" \r\n// theme={theme}\r\n// message=\"Processing your payment...\"\r\n// />\r\n// )}\r\n\r\n// {step === 'success' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"success\" \r\n// theme={theme}\r\n// message=\"Payment successful!\"\r\n// />\r\n// {transactionHash && (\r\n// <div className={`mt-4 p-3 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'} mb-1`}>\r\n// Transaction Hash:\r\n// </p>\r\n// <p className={`text-sm font-mono break-all ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// {formatTransactionHash(transactionHash)}\r\n// </p>\r\n// {/* Optional: Add link to blockchain explorer */}\r\n// <a \r\n// href={`https://etherscan.io/tx/${transactionHash}`}\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`text-xs ${theme === 'dark' ? 'text-blue-400' : 'text-blue-600'} mt-2 inline-block`}\r\n// >\r\n// View on Etherscan →\r\n// </a>\r\n// </div>\r\n// )}\r\n// </div>\r\n// )}\r\n\r\n// {step === 'error' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"error\" \r\n// theme={theme}\r\n// message={error || \"An error occurred while processing your payment.\"}\r\n// />\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={`mt-4 ${buttonSecondaryClasses}`}\r\n// >\r\n// Try Again\r\n// </button>\r\n// </div>\r\n// )}\r\n// </div>\r\n\r\n// {/* Footer */}\r\n// <div className={`text-center text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// <p>Powered by Coinley - Secure Cryptocurrency Payments</p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default CoinleyModal;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n// // src/components/CoinleyModal.jsx - Updated with QR Code Feature\r\n// import React, { useEffect, useState } from 'react';\r\n// import PaymentMethods from './PaymentMethods';\r\n// import PaymentStatus from './PaymentStatus';\r\n// import QRCode from './QRCode';\r\n// import { isMetaMaskInstalled } from '../services/web3';\r\n// import Logo from '../assets/Logo.png';\r\n\r\n// const CoinleyModal = ({\r\n// isOpen,\r\n// onClose,\r\n// payment,\r\n// paymentStatus,\r\n// selectedCurrency,\r\n// onCurrencySelect,\r\n// onPayment,\r\n// error,\r\n// theme = 'light',\r\n// merchantName,\r\n// transactionHash,\r\n// walletConnected,\r\n// onConnectWallet,\r\n// testMode = false\r\n// }) => {\r\n// // IMPORTANT: Start with 'select-currency', not 'processing'\r\n// const [step, setStep] = useState('select-currency');\r\n// const [isMetaMaskAvailable, setIsMetaMaskAvailable] = useState(false);\r\n// // Add paymentMethod state to toggle between QR and wallet\r\n// const [paymentMethod, setPaymentMethod] = useState('wallet');\r\n \r\n// // Check if MetaMask is available\r\n// useEffect(() => {\r\n// setIsMetaMaskAvailable(isMetaMaskInstalled());\r\n// }, []);\r\n\r\n// // Update step based on payment status\r\n// useEffect(() => {\r\n// if (paymentStatus === 'loading') {\r\n// setStep('processing');\r\n// } else if (paymentStatus === 'success') {\r\n// setStep('success');\r\n// } else if (paymentStatus === 'error') {\r\n// setStep('error');\r\n// } else if (paymentStatus === 'idle' && payment) {\r\n// // Make sure we start at currency selection when a new payment is created\r\n// setStep('select-currency');\r\n// }\r\n// }, [paymentStatus, payment]);\r\n\r\n// const handleCurrencySelect = (currency) => {\r\n// onCurrencySelect(currency);\r\n// setStep('confirm');\r\n// };\r\n\r\n// const handlePaymentConfirm = () => {\r\n// onPayment();\r\n// };\r\n\r\n// const handleBack = () => {\r\n// if (step === 'confirm') {\r\n// setStep('select-currency');\r\n// }\r\n// };\r\n\r\n// const handleClose = () => {\r\n// onClose();\r\n// };\r\n\r\n// // Format amount with 2 decimal places\r\n// const formatAmount = (amount) => {\r\n// return parseFloat(amount).toFixed(2);\r\n// };\r\n\r\n// // Format transaction hash for display\r\n// const formatTransactionHash = (hash) => {\r\n// if (!hash) return '';\r\n// if (hash.length <= 14) return hash;\r\n// return `${hash.slice(0, 8)}...${hash.slice(-6)}`;\r\n// };\r\n\r\n// // Toggle payment method\r\n// const togglePaymentMethod = (method) => {\r\n// setPaymentMethod(method);\r\n// };\r\n\r\n// // Base modal classes\r\n// const modalBaseClasses = `fixed inset-0 z-50 overflow-y-auto ${theme === 'dark' ? 'bg-gray-900/75' : 'bg-black/50'}`;\r\n// const modalContentClasses = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${theme === 'dark' ? 'bg-gray-800 text-white' : 'bg-white text-gray-800'}`;\r\n// const headerClasses = `text-xl font-bold mb-4 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`;\r\n// const buttonPrimaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark' \r\n// ? 'bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500' \r\n// : 'bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500'\r\n// }`;\r\n// const buttonSecondaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark'\r\n// ? 'bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500'\r\n// : 'bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500'\r\n// }`;\r\n// const tabButtonClasses = `py-2 px-4 text-sm font-medium focus:outline-none transition-colors`;\r\n// const activeTabClasses = `${theme === 'dark' ? 'bg-gray-700 text-white' : 'bg-gray-100 text-gray-800'} rounded-t-md`;\r\n// const inactiveTabClasses = `${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : 'text-gray-500 hover:text-gray-700'}`;\r\n\r\n// if (!isOpen) return null;\r\n\r\n// console.log('CoinleyModal render:', {\r\n// testMode,\r\n// paymentMethod,\r\n// step,\r\n// isMetaMaskAvailable\r\n// });\r\n\r\n// return (\r\n// <div className={modalBaseClasses}>\r\n// <div className=\"flex min-h-screen items-center justify-center p-4\">\r\n// <div className={modalContentClasses}>\r\n// {/* Header */}\r\n// <div className=\"flex justify-between items-center mb-6\">\r\n// <div className=\"flex items-center\">\r\n// <img src={Logo} alt=\"Coinley Logo\" className=\"h-8 mr-2\" />\r\n// <h2 className={headerClasses}>Coinley Pay</h2>\r\n// </div>\r\n// <button \r\n// onClick={handleClose}\r\n// className={`text-gray-500 hover:text-gray-700 focus:outline-none ${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : ''}`}\r\n// >\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\r\n// </svg>\r\n// </button>\r\n// </div>\r\n \r\n// {/* Content */}\r\n// <div className=\"mb-6\">\r\n// {payment && (\r\n// <div className={`mb-6 p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {merchantName}\r\n// </p>\r\n// <div className=\"flex justify-between items-center mt-2\">\r\n// <span className={`font-medium ${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}`}>\r\n// Amount:\r\n// </span>\r\n// <span className=\"font-bold text-xl\">\r\n// ${formatAmount(payment.totalAmount || payment.amount)}\r\n// </span>\r\n// </div>\r\n// <div className=\"text-xs mt-1 text-right\">\r\n// <span className={`${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// Payment ID: {payment.id.slice(0, 8)}...\r\n// </span>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'select-currency' && (\r\n// <PaymentMethods \r\n// onSelect={handleCurrencySelect} \r\n// selected={selectedCurrency}\r\n// theme={theme}\r\n// />\r\n// )}\r\n\r\n// {step === 'confirm' && payment && (\r\n// <div>\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <h3 className={`text-lg font-medium mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Payment Details\r\n// </h3>\r\n// <div className=\"space-y-2\">\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Currency:</span>\r\n// <span className=\"font-medium\">{selectedCurrency}</span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Network:</span>\r\n// <span className=\"font-medium\">\r\n// {selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'Solana' : 'Ethereum'}\r\n// </span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Fee:</span>\r\n// <span className=\"font-medium\">1.75%</span>\r\n// </div>\r\n// </div>\r\n// </div>\r\n\r\n// {/* Payment Method Tabs */}\r\n// {!testMode && (\r\n// <div className=\"mb-4\">\r\n// <div className=\"flex border-b border-gray-200\">\r\n// <button\r\n// onClick={() => togglePaymentMethod('wallet')}\r\n// className={`${tabButtonClasses} ${paymentMethod === 'wallet' ? activeTabClasses : inactiveTabClasses}`}\r\n// >\r\n// Connect Wallet\r\n// </button>\r\n// <button\r\n// onClick={() => togglePaymentMethod('qrcode')}\r\n// className={`${tabButtonClasses} ${paymentMethod === 'qrcode' ? activeTabClasses : inactiveTabClasses}`}\r\n// >\r\n// QR Code\r\n// </button>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {testMode ? (\r\n// // Test mode payment option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <div className=\"bg-blue-500 rounded-full p-2 mr-3\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-white\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\r\n// </svg>\r\n// </div>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Test Mode Payment\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Click \"Pay Now\" to simulate a successful payment\r\n// </p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// ) : paymentMethod === 'qrcode' ? (\r\n// // QR Code payment option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <QRCode \r\n// walletAddress={payment.walletAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'} \r\n// amount={payment.totalAmount || payment.amount}\r\n// currency={selectedCurrency}\r\n// theme={theme}\r\n// />\r\n// </div>\r\n// ) : isMetaMaskAvailable ? (\r\n// // MetaMask available option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <img \r\n// src=\"https://metamask.io/images/metamask-fox.svg\" \r\n// alt=\"MetaMask\" \r\n// className=\"w-8 h-8 mr-2\"\r\n// />\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Pay with MetaMask\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {walletConnected \r\n// ? \"Your wallet is connected. Click 'Pay Now' to proceed.\" \r\n// : \"Click 'Connect Wallet' to proceed with payment.\"\r\n// }\r\n// </p>\r\n// </div>\r\n// </div>\r\n// {!walletConnected && (\r\n// <button\r\n// onClick={onConnectWallet}\r\n// className={`mt-3 ${buttonPrimaryClasses}`}\r\n// >\r\n// Connect Wallet\r\n// </button>\r\n// )}\r\n// </div>\r\n// ) : (\r\n// // MetaMask not available warning\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-yellow-900/20' : 'bg-yellow-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-yellow-500 mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\r\n// </svg>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// MetaMask Not Detected\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Please install MetaMask extension to make payments\r\n// </p>\r\n// </div>\r\n// </div>\r\n// <a\r\n// href=\"https://metamask.io/download/\"\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`block mt-3 text-center ${buttonPrimaryClasses}`}\r\n// >\r\n// Install MetaMask\r\n// </a>\r\n// </div>\r\n// )}\r\n\r\n// <div className=\"mt-6 grid grid-cols-2 gap-3\">\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={buttonSecondaryClasses}\r\n// >\r\n// Back\r\n// </button>\r\n// <button\r\n// type=\"button\"\r\n// onClick={handlePaymentConfirm}\r\n// className={buttonPrimaryClasses}\r\n// disabled={!testMode && paymentMethod === 'wallet' && isMetaMaskAvailable && !walletConnected}\r\n// >\r\n// Pay Now\r\n// </button>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'processing' && (\r\n// <PaymentStatus \r\n// status=\"processing\" \r\n// theme={theme}\r\n// message=\"Processing your payment...\"\r\n// />\r\n// )}\r\n\r\n// {step === 'success' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"success\" \r\n// theme={theme}\r\n// message=\"Payment successful!\"\r\n// />\r\n// {transactionHash && (\r\n// <div className={`mt-4 p-3 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'} mb-1`}>\r\n// Transaction Hash:\r\n// </p>\r\n// <p className={`text-sm font-mono break-all ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// {formatTransactionHash(transactionHash)}\r\n// </p>\r\n// {/* Optional: Add link to blockchain explorer */}\r\n// <a \r\n// href={`https://etherscan.io/tx/${transactionHash}`}\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`text-xs ${theme === 'dark' ? 'text-blue-400' : 'text-blue-600'} mt-2 inline-block`}\r\n// >\r\n// View on Etherscan →\r\n// </a>\r\n// </div>\r\n// )}\r\n// </div>\r\n// )}\r\n\r\n// {step === 'error' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"error\" \r\n// theme={theme}\r\n// message={error || \"An error occurred while processing your payment.\"}\r\n// />\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={`mt-4 ${buttonSecondaryClasses}`}\r\n// >\r\n// Try Again\r\n// </button>\r\n// </div>\r\n// )}\r\n// </div>\r\n\r\n// {/* Footer */}\r\n// <div className={`text-center text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// <p>Powered by Coinley - Secure Cryptocurrency Payments</p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default CoinleyModal;\r\n\r\n\r\n\r\n// src/components/CoinleyModal.jsx\r\nimport React, { lazy, Suspense, useEffect, useState } from 'react';\r\nimport PaymentMethods from './PaymentMethods';\r\nimport PaymentStatus from './PaymentStatus';\r\nimport { isMetaMaskInstalled } from '../services/web3';\r\nimport Logo from '../assets/Logo.png';\r\n\r\nconst QRCode = lazy(() => import('./QRCode'));\r\n\r\nconst CoinleyModal = ({\r\n isOpen,\r\n onClose,\r\n payment,\r\n paymentStatus,\r\n selectedCurrency,\r\n onCurrencySelect,\r\n onPayment,\r\n error,\r\n theme = 'light',\r\n merchantName,\r\n transactionHash,\r\n walletConnected,\r\n onConnectWallet,\r\n testMode = false\r\n}) => {\r\n const [step, setStep] = useState('select-currency');\r\n const [isMetaMaskAvailable, setIsMetaMaskAvailable] = useState(false);\r\n const [paymentMethod, setPaymentMethod] = useState('wallet');\r\n\r\n // Check if MetaMask is available\r\n useEffect(() => {\r\n if (typeof window !== 'undefined') {\r\n setIsMetaMaskAvailable(isMetaMaskInstalled());\r\n }\r\n }, []);\r\n\r\n // Update step based on payment status\r\n useEffect(() => {\r\n if (paymentStatus === 'loading') {\r\n setStep('processing');\r\n } else if (paymentStatus === 'success') {\r\n setStep('success');\r\n } else if (paymentStatus === 'error') {\r\n setStep('error');\r\n } else if (paymentStatus === 'idle' && payment) {\r\n setStep('select-currency');\r\n }\r\n }, [paymentStatus, payment]);\r\n\r\n const handleCurrencySelect = (currency) => {\r\n onCurrencySelect(currency);\r\n setStep('confirm');\r\n };\r\n\r\n const handlePaymentConfirm = () => {\r\n onPayment(paymentMethod === 'qrcode');\r\n };\r\n\r\n const handleBack = () => {\r\n if (step === 'confirm') {\r\n setStep('select-currency');\r\n }\r\n };\r\n\r\n const handleClose = () => {\r\n onClose();\r\n };\r\n\r\n // Format amount with 2 decimal places\r\n const formatAmount = (amount) => {\r\n return parseFloat(amount).toFixed(2);\r\n };\r\n\r\n // Format transaction hash for display\r\n const formatTransactionHash = (hash) => {\r\n if (!hash) return '';\r\n if (hash.length <= 14) return hash;\r\n return `${hash.slice(0, 8)}...${hash.slice(-6)}`;\r\n };\r\n\r\n // Toggle payment method\r\n const togglePaymentMethod = (method) => {\r\n setPaymentMethod(method);\r\n };\r\n\r\n // CSS Classes\r\n const modalBaseClasses = `fixed inset-0 z-50 overflow-y-auto ${theme === 'dark' ? 'bg-gray-900/75' : 'bg-black/50'}`;\r\n const modalContentClasses = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${theme === 'dark' ? 'bg-gray-800 text-white' : 'bg-white text-gray-800'}`;\r\n const headerClasses = `text-xl font-bold mb-4 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`;\r\n const buttonPrimaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n theme === 'dark' \r\n ? 'bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500' \r\n : 'bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500'\r\n }`;\r\n const buttonSecondaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n theme === 'dark'\r\n ? 'bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500'\r\n : 'bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500'\r\n }`;\r\n const tabButtonClasses = `py-2 px-4 text-sm font-medium focus:outline-none transition-colors`;\r\n const activeTabClasses = `${theme === 'dark' ? 'bg-gray-700 text-white' : 'bg-gray-100 text-gray-800'} rounded-t-md`;\r\n const inactiveTabClasses = `${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : 'text-gray-500 hover:text-gray-700'}`;\r\n\r\n if (!isOpen) return null;\r\n\r\n return (\r\n <div className={modalBaseClasses}>\r\n <div className=\"flex min-h-screen items-center justify-center p-4\">\r\n <div className={modalContentClasses}>\r\n {/* Header */}\r\n <div className=\"flex justify-between items-center mb-6\">\r\n <div className=\"flex items-center\">\r\n <img src={Logo} alt=\"Coinley Logo\" className=\"h-8 mr-2\" />\r\n <h2 className={headerClasses}>Coinley Pay</h2>\r\n </div>\r\n <button \r\n onClick={handleClose}\r\n className={`text-gray-500 hover:text-gray-700 focus:outline-none ${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : ''}`}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n \r\n {/* Content */}\r\n <div className=\"mb-6\">\r\n {payment && (\r\n <div className={`mb-6 p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n {merchantName}\r\n </p>\r\n <div className=\"flex justify-between items-center mt-2\">\r\n <span className={`font-medium ${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}`}>\r\n Amount:\r\n </span>\r\n <span className=\"font-bold text-xl\">\r\n ${formatAmount(payment.totalAmount || payment.amount)}\r\n </span>\r\n </div>\r\n <div className=\"text-xs mt-1 text-right\">\r\n <span className={`${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n Payment ID: {payment.id.slice(0, 8)}...\r\n </span>\r\n </div>\r\n </div>\r\n )}\r\n\r\n {step === 'select-currency' && (\r\n <PaymentMethods \r\n onSelect={handleCurrencySelect} \r\n selected={selectedCurrency}\r\n theme={theme}\r\n />\r\n )}\r\n\r\n {step === 'confirm' && payment && (\r\n <div>\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <h3 className={`text-lg font-medium mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Payment Details\r\n </h3>\r\n <div className=\"space-y-2\">\r\n <div className=\"flex justify-between\">\r\n <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Currency:</span>\r\n <span className=\"font-medium\">{selectedCurrency}</span>\r\n </div>\r\n <div className=\"flex justify-between\">\r\n <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Network:</span>\r\n <span className=\"font-medium\">\r\n {selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'Solana' : 'Ethereum'}\r\n </span>\r\n </div>\r\n <div className=\"flex justify-between\">\r\n <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Fee:</span>\r\n <span className=\"font-medium\">1.75%</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Payment Method Tabs */}\r\n <div className=\"mb-4\">\r\n <div className=\"flex border-b border-gray-200\">\r\n <button\r\n onClick={() => togglePaymentMethod('wallet')}\r\n className={`${tabButtonClasses} ${paymentMethod === 'wallet' ? activeTabClasses : inactiveTabClasses}`}\r\n >\r\n Connect Wallet\r\n </button>\r\n <button\r\n onClick={() => togglePaymentMethod('qrcode')}\r\n className={`${tabButtonClasses} ${paymentMethod === 'qrcode' ? activeTabClasses : inactiveTabClasses}`}\r\n >\r\n QR Code\r\n </button>\r\n </div>\r\n </div>\r\n\r\n {testMode ? (\r\n // Test mode payment option\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n <div className=\"flex items-center\">\r\n <div className=\"bg-blue-500 rounded-full p-2 mr-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-white\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\r\n </svg>\r\n </div>\r\n <div>\r\n <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Test Mode Payment\r\n </h3>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n Click \"Pay Now\" to simulate a successful payment\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n ) : paymentMethod === 'qrcode' ? (\r\n // QR Code payment option\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n <QRCode \r\n walletAddress={payment.walletAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'} \r\n amount={payment.totalAmount || payment.amount}\r\n currency={selectedCurrency}\r\n theme={theme}\r\n />\r\n </div>\r\n ) : isMetaMaskAvailable ? (\r\n // MetaMask available option\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n <div className=\"flex items-center\">\r\n <img \r\n src=\"https://metamask.io/images/metamask-fox.svg\" \r\n alt=\"MetaMask\" \r\n className=\"w-8 h-8 mr-2\"\r\n />\r\n <div>\r\n <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Pay with MetaMask\r\n </h3>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n {walletConnected \r\n ? \"Your wallet is connected. Click 'Pay Now' to proceed.\" \r\n : \"Click 'Connect Wallet' to proceed with payment.\"\r\n }\r\n </p>\r\n </div>\r\n </div>\r\n {!walletConnected && (\r\n <button\r\n onClick={onConnectWallet}\r\n className={`mt-3 ${buttonPrimaryClasses}`}\r\n >\r\n Connect Wallet\r\n </button>\r\n )}\r\n </div>\r\n ) : (\r\n // MetaMask not available warning\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-yellow-900/20' : 'bg-yellow-50'}`}>\r\n <div className=\"flex items-center\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-yellow-500 mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\r\n </svg>\r\n <div>\r\n <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n MetaMask Not Detected\r\n </h3>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n Please install MetaMask extension to make payments\r\n </p>\r\n </div>\r\n </div>\r\n <a\r\n href=\"https://metamask.io/download/\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={`block mt-3 text-center ${buttonPrimaryClasses}`}\r\n >\r\n Install MetaMask\r\n </a>\r\n </div>\r\n )}\r\n\r\n <div className=\"mt-6 grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n onClick={handleBack}\r\n className={buttonSecondaryClasses}\r\n >\r\n Back\r\n </button>\r\n <button\r\n type=\"button\"\r\n onClick={handlePaymentConfirm}\r\n className={buttonPrimaryClasses}\r\n disabled={!testMode && paymentMethod === 'wallet' && isMetaMaskAvailable && !walletConnected}\r\n >\r\n Pay Now\r\n </button>\r\n </div>\r\n </div>\r\n )}\r\n\r\n {step === 'processing' && (\r\n <PaymentStatus \r\n status=\"processing\" \r\n theme={theme}\r\n message=\"Processing your payment...\"\r\n />\r\n )}\r\n\r\n {step === 'success' && (\r\n <div>\r\n <PaymentStatus \r\n status=\"success\" \r\n theme={theme}\r\n message=\"Payment successful!\"\r\n />\r\n {transactionHash && (\r\n <div className={`mt-4 p-3 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'} mb-1`}>\r\n Transaction Hash:\r\n </p>\r\n <p className={`text-sm font-mono break-all ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n {formatTransactionHash(transactionHash)}\r\n </p>\r\n <a \r\n href={`https://etherscan.io/tx/${transactionHash}`}\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={`text-xs ${theme === 'dark' ? 'text-blue-400' : 'text-blue-600'} mt-2 inline-block`}\r\n >\r\n View on Etherscan →\r\n </a>\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n\r\n {step === 'error' && (\r\n <div>\r\n <PaymentStatus \r\n status=\"error\" \r\n theme={theme}\r\n message={error || \"An error occurred while processing your payment.\"}\r\n />\r\n <button\r\n type=\"button\"\r\n onClick={handleBack}\r\n className={`mt-4 ${buttonSecondaryClasses}`}\r\n >\r\n Try Again\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Footer */}\r\n <div className={`text-center text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n <p>Powered by Coinley - Secure Cryptocurrency Payments</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default CoinleyModal;","// // src/components/CoinleyCheckout.jsx - Production Version\r\n// import React, { forwardRef, useImperativeHandle, useState, useEffect } from 'react';\r\n// import { useCoinley } from '../context/CoinleyContext';\r\n// import { useTheme } from '../context/ThemeContext';\r\n// import CoinleyModal from './CoinleyModal';\r\n// import { createPayment, processPayment } from '../services/api';\r\n// import { isMetaMaskInstalled, connectWallet, sendTransaction } from '../services/web3';\r\n\r\n// const CoinleyCheckout = forwardRef(({ \r\n// apiKey,\r\n// apiSecret,\r\n// apiUrl,\r\n// customerEmail,\r\n// merchantName = 'Merchant',\r\n// onSuccess,\r\n// onError,\r\n// onClose,\r\n// theme,\r\n// autoOpen = false,\r\n// debug = false,\r\n// testMode = false // Add testMode flag for development\r\n// }, ref) => {\r\n// const coinleyContext = useCoinley();\r\n// const { theme: contextTheme } = useTheme();\r\n \r\n// const [isOpen, setIsOpen] = useState(autoOpen);\r\n// const [payment, setPayment] = useState(null);\r\n// const [paymentStatus, setPaymentStatus] = useState('idle'); // idle, loading, success, error\r\n// const [selectedCurrency, setSelectedCurrency] = useState('USDT');\r\n// const [error, setError] = useState(null);\r\n// const [transactionHash, setTransactionHash] = useState(null);\r\n// const [walletConnected, setWalletConnected] = useState(false);\r\n \r\n// // Use the component props or fallback to context values\r\n// const effectiveApiKey = apiKey || coinleyContext?.apiKey;\r\n// const effectiveApiSecret = apiSecret || coinleyContext?.apiSecret;\r\n// const effectiveApiUrl = apiUrl || coinleyContext?.apiUrl;\r\n// const effectiveTheme = theme || contextTheme;\r\n// const effectiveDebug = debug || coinleyContext?.debug;\r\n\r\n// useImperativeHandle(ref, () => ({\r\n// open: (paymentDetails) => {\r\n// handleOpen(paymentDetails);\r\n// },\r\n// close: () => {\r\n// handleClose();\r\n// },\r\n// getPayment: () => payment\r\n// }));\r\n\r\n// const log = (message, data) => {\r\n// if (effectiveDebug) {\r\n// console.log(`[Coinley SDK] ${message}`, data);\r\n// }\r\n// };\r\n\r\n// // Check MetaMask connection on mount\r\n// useEffect(() => {\r\n// const checkWalletConnection = async () => {\r\n// if (isMetaMaskInstalled()) {\r\n// try {\r\n// const accounts = await window.ethereum.request({ method: 'eth_accounts' });\r\n// setWalletConnected(accounts && accounts.length > 0);\r\n// } catch (err) {\r\n// log('Error checking wallet connection:', err);\r\n// setWalletConnected(false);\r\n// }\r\n// } else {\r\n// setWalletConnected(false);\r\n// }\r\n// };\r\n\r\n// checkWalletConnection();\r\n// }, []);\r\n\r\n// // Handle MetaMask account changes\r\n// useEffect(() => {\r\n// const handleAccountsChanged = (accounts) => {\r\n// setWalletConnected(accounts.length > 0);\r\n// };\r\n\r\n// if (window.ethereum) {\r\n// window.ethereum.on('accountsChanged', handleAccountsChanged);\r\n// }\r\n\r\n// return () => {\r\n// if (window.ethereum) {\r\n// window.ethereum.removeListener('accountsChanged', handleAccountsChanged);\r\n// }\r\n// };\r\n// }, []);\r\n\r\n// const handleOpen = async (paymentDetails) => {\r\n// if (!paymentDetails || !paymentDetails.amount) {\r\n// setError('Payment amount is required');\r\n// if (onError) onError(new Error('Payment amount is required'));\r\n// return;\r\n// }\r\n\r\n// setPaymentStatus('loading');\r\n// setIsOpen(true);\r\n\r\n// try {\r\n// log('Creating payment with details:', paymentDetails);\r\n \r\n// // Create a payment on the Coinley backend\r\n// const paymentResponse = await createPayment({\r\n// amount: paymentDetails.amount,\r\n// currency: paymentDetails.currency || 'USDT',\r\n// customerEmail: paymentDetails.customerEmail || customerEmail,\r\n// callbackUrl: paymentDetails.callbackUrl,\r\n// metadata: paymentDetails.metadata || {}\r\n// });\r\n\r\n// log('Payment created:', paymentResponse);\r\n \r\n// setPayment(paymentResponse.payment);\r\n// setPaymentStatus('idle');\r\n// setError(null);\r\n// } catch (err) {\r\n// log('Error creating payment:', err);\r\n// setError(err.message || 'Failed to create payment');\r\n// setPaymentStatus('error');\r\n// if (onError) onError(err);\r\n// }\r\n// };\r\n\r\n// const handleClose = () => {\r\n// setIsOpen(false);\r\n// setTransactionHash(null);\r\n// if (onClose) onClose();\r\n// };\r\n\r\n// const handlePaymentMethodSelect = (currency) => {\r\n// log('Currency selected:', currency);\r\n// setSelectedCurrency(currency);\r\n// };\r\n\r\n// const connectToWallet = async () => {\r\n// if (!isMetaMaskInstalled()) {\r\n// setError('MetaMask is not installed. Please install MetaMask to make payments.');\r\n// return false;\r\n// }\r\n\r\n// try {\r\n// const accounts = await connectWallet();\r\n// setWalletConnected(accounts.length > 0);\r\n// return accounts.length > 0;\r\n// } catch (err) {\r\n// log('Error connecting to wallet:', err);\r\n// setError(err.message || 'Failed to connect to wallet');\r\n// return false;\r\n// }\r\n// };\r\n\r\n// const handlePayment = async () => {\r\n// if (!payment) {\r\n// setError('No active payment to process');\r\n// return;\r\n// }\r\n\r\n// log('Starting payment process...');\r\n// setPaymentStatus('loading');\r\n// setTransactionHash(null);\r\n\r\n// try {\r\n// log('Processing payment:', { paymentId: payment.id, currency: selectedCurrency });\r\n \r\n// let txHash;\r\n\r\n// // Check if we're in test mode or need a real wallet transaction\r\n// if (testMode) {\r\n// // Simulate transaction for testing\r\n// log('Test mode: Generating mock transaction...');\r\n// txHash = `0x${Array.from({length: 64}, () => \r\n// Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n// } else {\r\n// // Real payment flow\r\n// // 1. Ensure wallet is connected\r\n// if (!walletConnected) {\r\n// const connected = await connectToWallet();\r\n// if (!connected) {\r\n// throw new Error('Please connect your wallet to proceed with payment');\r\n// }\r\n// }\r\n\r\n// // 2. Get merchant address from payment\r\n// const merchantAddress = payment.merchantAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'; // Fallback for testing\r\n \r\n// // 3. Create transaction parameters\r\n// const txParams = {\r\n// from: await window.ethereum.request({ method: 'eth_requestAccounts' }).then(accounts => accounts[0]),\r\n// to: merchantAddress,\r\n// value: '0x0', // For ERC-20 tokens, value is 0\r\n// data: '0x', // Would include token transfer data for ERC-20\r\n// };\r\n\r\n// // 4. Send transaction through MetaMask\r\n// log('Sending transaction to wallet for approval...');\r\n// txHash = await sendTransaction(txParams);\r\n// }\r\n\r\n// log('Transaction hash:', txHash);\r\n// setTransactionHash(txHash);\r\n\r\n// // Process the payment on the Coinley backend\r\n// log('Sending process payment request to API...');\r\n// const processResponse = await processPayment({\r\n// paymentId: payment.id,\r\n// transactionHash: txHash,\r\n// network: 'ethereum' // Or determine based on selected currency\r\n// });\r\n\r\n// log('Payment processed successfully:', processResponse);\r\n\r\n// setPaymentStatus('success');\r\n \r\n// // Call the onSuccess callback with transaction details\r\n// if (onSuccess) {\r\n// log('Calling onSuccess callback...');\r\n// onSuccess(payment.id, txHash);\r\n// }\r\n\r\n// // Close the modal after a delay if auto-close is desired\r\n// // setTimeout(() => {\r\n// // log('Auto-closing modal after success...');\r\n// // handleClose();\r\n// // }, 5000);\r\n\r\n// } catch (err) {\r\n// log('Payment error:', err);\r\n// setError(err.message || 'Failed to process payment');\r\n// setPaymentStatus('error');\r\n// if (onError) onError(err);\r\n// }\r\n// };\r\n\r\n// // Open modal if autoOpen is true and we have a payment\r\n// useEffect(() => {\r\n// if (autoOpen && payment) {\r\n// setIsOpen(true);\r\n// }\r\n// }, [autoOpen, payment]);\r\n\r\n// return (\r\n// <>\r\n// {isOpen && (\r\n// <CoinleyModal\r\n// isOpen={isOpen}\r\n// onClose={handleClose}\r\n// payment={payment}\r\n// paymentStatus={paymentStatus}\r\n// selectedCurrency={selectedCurrency}\r\n// onCurrencySelect={handlePaymentMethodSelect}\r\n// onPayment={handlePayment}\r\n// error={error}\r\n// theme={effectiveTheme}\r\n// merchantName={merchantName}\r\n// transactionHash={transactionHash}\r\n// walletConnected={walletConnected}\r\n// onConnectWallet={connectToWallet}\r\n// testMode={testMode}\r\n// />\r\n// )}\r\n// </>\r\n// );\r\n// });\r\n\r\n// CoinleyCheckout.displayName = 'CoinleyCheckout';\r\n\r\n// export default CoinleyCheckout;\r\n\r\n\r\n\r\n\r\n// src/components/CoinleyCheckout.jsx\r\nimport React, { forwardRef, useImperativeHandle, useState, useEffect } from 'react';\r\nimport { useCoinley } from '../context/CoinleyContext';\r\nimport { useTheme } from '../context/ThemeContext';\r\nimport CoinleyModal from './CoinleyModal';\r\nimport { createPayment, processPayment } from '../services/api';\r\nimport { isMetaMaskInstalled, connectWallet, sendTransaction } from '../services/web3';\r\n\r\nconst CoinleyCheckout = forwardRef(({ \r\n apiKey,\r\n apiSecret,\r\n apiUrl,\r\n customerEmail,\r\n merchantName = 'Merchant',\r\n onSuccess,\r\n onError,\r\n onClose,\r\n theme,\r\n autoOpen = false,\r\n debug = false,\r\n testMode = false\r\n}, ref) => {\r\n const coinleyContext = useCoinley();\r\n const { theme: contextTheme } = useTheme();\r\n \r\n const [isOpen, setIsOpen] = useState(autoOpen);\r\n const [payment, setPayment] = useState(null);\r\n const [paymentStatus, setPaymentStatus] = useState('idle'); // idle, loading, success, error\r\n const [selectedCurrency, setSelectedCurrency] = useState('USDT');\r\n const [error, setError] = useState(null);\r\n const [transactionHash, setTransactionHash] = useState(null);\r\n const [walletConnected, setWalletConnected] = useState(false);\r\n \r\n // Use the component props or fallback to context values\r\n const effectiveApiKey = apiKey || coinleyContext?.apiKey;\r\n const effectiveApiSecret = apiSecret || coinleyContext?.apiSecret;\r\n const effectiveApiUrl = apiUrl || coinleyContext?.apiUrl;\r\n const effectiveTheme = theme || contextTheme;\r\n const effectiveDebug = debug || coinleyContext?.debug;\r\n\r\n useImperativeHandle(ref, () => ({\r\n open: (paymentDetails) => {\r\n handleOpen(paymentDetails);\r\n },\r\n close: () => {\r\n handleClose();\r\n },\r\n getPayment: () => payment\r\n }));\r\n\r\n const log = (message, data) => {\r\n if (effectiveDebug) {\r\n console.log(`[Coinley SDK] ${message}`, data);\r\n }\r\n };\r\n\r\n // Check MetaMask connection on mount\r\n useEffect(() => {\r\n const checkWalletConnection = async () => {\r\n if (isMetaMaskInstalled()) {\r\n try {\r\n const accounts = await window.ethereum.request({ method: 'eth_accounts' });\r\n setWalletConnected(accounts && accounts.length > 0);\r\n } catch (err) {\r\n log('Error checking wallet connection:', err);\r\n setWalletConnected(false);\r\n }\r\n } else {\r\n setWalletConnected(false);\r\n }\r\n };\r\n\r\n checkWalletConnection();\r\n }, []);\r\n\r\n // Handle MetaMask account changes\r\n useEffect(() => {\r\n const handleAccountsChanged = (accounts) => {\r\n setWalletConnected(accounts.length > 0);\r\n };\r\n\r\n if (typeof window !== 'undefined' && window.ethereum) {\r\n window.ethereum.on('accountsChanged', handleAccountsChanged);\r\n }\r\n\r\n return () => {\r\n if (typeof window !== 'undefined' && window.ethereum) {\r\n window.ethereum.removeListener('accountsChanged', handleAccountsChanged);\r\n }\r\n };\r\n }, []);\r\n\r\n const handleOpen = async (paymentDetails) => {\r\n if (!paymentDetails || !paymentDetails.amount) {\r\n setError('Payment amount is required');\r\n if (onError) onError(new Error('Payment amount is required'));\r\n return;\r\n }\r\n\r\n setPaymentStatus('loading');\r\n setIsOpen(true);\r\n\r\n try {\r\n log('Creating payment with details:', paymentDetails);\r\n \r\n // Create a payment on the Coinley backend\r\n const paymentResponse = await createPayment({\r\n amount: paymentDetails.amount,\r\n currency: paymentDetails.currency || 'USDT',\r\n customerEmail: paymentDetails.customerEmail || customerEmail,\r\n callbackUrl: paymentDetails.callbackUrl,\r\n metadata: paymentDetails.metadata || {}\r\n });\r\n\r\n log('Payment created:', paymentResponse);\r\n \r\n setPayment(paymentResponse.payment);\r\n setPaymentStatus('idle');\r\n setError(null);\r\n \r\n log('Payment created and state updated:', {\r\n payment: paymentResponse.payment,\r\n status: 'idle'\r\n });\r\n } catch (err) {\r\n log('Error creating payment:', err);\r\n setError(err.message || 'Failed to create payment');\r\n setPaymentStatus('error');\r\n if (onError) onError(err);\r\n }\r\n };\r\n\r\n const handleClose = () => {\r\n setIsOpen(false);\r\n setTransactionHash(null);\r\n if (onClose) onClose();\r\n };\r\n\r\n const handlePaymentMethodSelect = (currency) => {\r\n log('Currency selected:', currency);\r\n setSelectedCurrency(currency);\r\n };\r\n\r\n const connectToWallet = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n setError('MetaMask is not installed. Please install MetaMask to make payments.');\r\n return false;\r\n }\r\n\r\n try {\r\n const accounts = await connectWallet();\r\n setWalletConnected(accounts.length > 0);\r\n return accounts.length > 0;\r\n } catch (err) {\r\n log('Error connecting to wallet:', err);\r\n setError(err.message || 'Failed to connect to wallet');\r\n return false;\r\n }\r\n };\r\n\r\n const handlePayment = async (isQrCodeMode = false) => {\r\n if (!payment) {\r\n setError('No active payment to process');\r\n return;\r\n }\r\n\r\n log('Starting payment process...', { isQrCodeMode });\r\n setPaymentStatus('loading');\r\n setTransactionHash(null);\r\n\r\n try {\r\n log('Processing payment:', { paymentId: payment.id, currency: selectedCurrency, isQrCodeMode });\r\n \r\n let txHash;\r\n\r\n // Check if we're in test mode or need a real wallet transaction\r\n if (testMode) {\r\n // Simulate transaction for testing\r\n log('Test mode: Generating mock transaction...');\r\n txHash = `0x${Array.from({length: 64}, () => \r\n Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n } else if (isQrCodeMode) {\r\n // For QR code payments, we generate a placeholder hash\r\n // In a real implementation, we might want to verify the transaction\r\n log('QR code payment: User confirms payment was sent');\r\n txHash = `qrcode_${Date.now().toString(16)}_${Math.random().toString(16).substring(2, 10)}`;\r\n } else {\r\n // Real payment flow with wallet\r\n // 1. Ensure wallet is connected\r\n if (!walletConnected) {\r\n const connected = await connectToWallet();\r\n if (!connected) {\r\n throw new Error('Please connect your wallet to proceed with payment');\r\n }\r\n }\r\n\r\n // 2. Get merchant address from payment\r\n const merchantAddress = payment.walletAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'; // Fallback for testing\r\n \r\n // 3. Create transaction parameters\r\n const txParams = {\r\n from: await window.ethereum.request({ method: 'eth_requestAccounts' }).then(accounts => accounts[0]),\r\n to: merchantAddress,\r\n value: '0x0', // For ERC-20 tokens, value is 0\r\n data: '0x', // Would include token transfer data for ERC-20\r\n };\r\n\r\n // 4. Send transaction through MetaMask\r\n log('Sending transaction to wallet for approval...');\r\n txHash = await sendTransaction(txParams);\r\n }\r\n\r\n log('Transaction hash:', txHash);\r\n setTransactionHash(txHash);\r\n\r\n // Process the payment on the Coinley backend\r\n log('Sending process payment request to API...');\r\n const processResponse = await processPayment({\r\n paymentId: payment.id,\r\n transactionHash: txHash,\r\n network: selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'solana' : 'ethereum'\r\n });\r\n\r\n log('Payment processed successfully:', processResponse);\r\n\r\n setPaymentStatus('success');\r\n \r\n // Call the onSuccess callback with transaction details\r\n if (onSuccess) {\r\n log('Calling onSuccess callback...');\r\n onSuccess(payment.id, txHash);\r\n }\r\n\r\n } catch (err) {\r\n log('Payment error:', err);\r\n setError(err.message || 'Failed to process payment');\r\n setPaymentStatus('error');\r\n if (onError) onError(err);\r\n }\r\n };\r\n\r\n // Open modal if autoOpen is true and we have a payment\r\n useEffect(() => {\r\n if (autoOpen && payment) {\r\n setIsOpen(true);\r\n }\r\n }, [autoOpen, payment]);\r\n\r\n return (\r\n <>\r\n {isOpen && (\r\n <CoinleyModal\r\n isOpen={isOpen}\r\n onClose={handleClose}\r\n payment={payment}\r\n paymentStatus={paymentStatus}\r\n selectedCurrency={selectedCurrency}\r\n onCurrencySelect={handlePaymentMethodSelect}\r\n onPayment={handlePayment}\r\n error={error}\r\n theme={effectiveTheme}\r\n merchantName={merchantName}\r\n transactionHash={transactionHash}\r\n walletConnected={walletConnected}\r\n onConnectWallet={connectToWallet}\r\n testMode={testMode}\r\n />\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nCoinleyCheckout.displayName = 'CoinleyCheckout';\r\n\r\nexport default CoinleyCheckout;","// // src/index.js - Production Version\r\n// import { ThemeProvider } from './context/ThemeContext';\r\n// import { CoinleyProvider } from './context/CoinleyContext';\r\n// import CoinleyCheckout from './components/CoinleyCheckout';\r\n// import CoinleyModal from './components/CoinleyModal';\r\n// import './styles.css';\r\n\r\n// // Export primary components\r\n// export {\r\n// ThemeProvider,\r\n// CoinleyProvider,\r\n// CoinleyCheckout,\r\n// CoinleyModal\r\n// };\r\n\r\n// // Export API utilities\r\n// export {\r\n// createPayment,\r\n// getPayment,\r\n// processPayment,\r\n// getMerchantPayments,\r\n// getMerchantPaymentStats,\r\n// getSupportedCurrencies\r\n// } from './services/api';\r\n\r\n// // Export Web3 utilities\r\n// export {\r\n// isMetaMaskInstalled,\r\n// connectWallet,\r\n// getAccounts,\r\n// getChainId,\r\n// sendTransaction,\r\n// sendToken,\r\n// isWalletConnected,\r\n// getNetworkName,\r\n// getTokenBalance,\r\n// TOKEN_ADDRESSES\r\n// } from './services/web3';\r\n\r\n// // Default configuration\r\n// export const DEFAULT_CONFIG = {\r\n// apiUrl: 'https://coinleyserver-production.up.railway.app\"',\r\n// debug: false,\r\n// testMode: false,\r\n// theme: 'light'\r\n// };\r\n\r\n// // Version info\r\n// export const VERSION = '1.0.0';\r\n\r\n\r\n\r\n// src/index.js - Fixed imports to avoid circular dependencies\r\nimport { ThemeProvider } from './context/ThemeContext';\r\nimport { CoinleyProvider } from './context/CoinleyContext';\r\n\r\n// Import API utilities to avoid circular dependencies\r\nimport {\r\n createPayment,\r\n getPayment,\r\n processPayment,\r\n getMerchantPayments,\r\n getMerchantPaymentStats,\r\n getSupportedCurrencies\r\n} from './services/api';\r\n\r\n// Import Web3 utilities\r\nimport {\r\n isMetaMaskInstalled,\r\n connectWallet,\r\n getAccounts,\r\n getChainId,\r\n sendTransaction,\r\n sendToken,\r\n isWalletConnected,\r\n getNetworkName,\r\n getTokenBalance,\r\n TOKEN_ADDRESSES\r\n} from './services/web3';\r\n\r\n// Import components separately\r\nimport QRCode from './components/QRCode';\r\nimport PaymentStatus from './components/PaymentStatus';\r\nimport PaymentMethods from './components/PaymentMethods';\r\nimport CoinleyModal from './components/CoinleyModal';\r\nimport CoinleyCheckout from './components/CoinleyCheckout';\r\n\r\n// Import styles\r\nimport './styles.css';\r\n\r\n// Export all components and utilities\r\nexport {\r\n ThemeProvider,\r\n CoinleyProvider,\r\n CoinleyCheckout,\r\n CoinleyModal,\r\n QRCode,\r\n PaymentStatus,\r\n PaymentMethods,\r\n // API utilities\r\n createPayment,\r\n getPayment,\r\n processPayment,\r\n getMerchantPayments,\r\n getMerchantPaymentStats,\r\n getSupportedCurrencies,\r\n // Web3 utilities\r\n isMetaMaskInstalled,\r\n connectWallet,\r\n getAccounts,\r\n getChainId,\r\n sendTransaction,\r\n sendToken,\r\n isWalletConnected,\r\n getNetworkName,\r\n getTokenBalance,\r\n TOKEN_ADDRESSES\r\n};\r\n\r\n// Default configuration\r\nexport const DEFAULT_CONFIG = {\r\n apiUrl: 'https://coinleyserver-production.up.railway.app',\r\n debug: false,\r\n testMode: false,\r\n theme: 'light'\r\n};\r\n\r\n// Version info\r\nexport const VERSION = '1.0.4';"],"names":["ReactDebugCurrentFrame","self","jsxRuntimeModule","require$$0","require$$1","createContext","useContext","useState","useEffect","jsx","QRCode","jsxs","lazy","forwardRef","useImperativeHandle"],"mappings":";;;;;;;;;;;;;;;;;;;;AASa,QAAI,IAAE,YAAi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;;;;;;;;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"coinley-checkout.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/context/ThemeContext.jsx","../src/services/api.js","../src/context/CoinleyContext.jsx","../src/components/QRCode.jsx","../src/components/PaymentStatus.jsx","../src/components/PaymentMethods.jsx","../src/services/web3.js","../src/assets/Logo.png","../src/components/CoinleyModal.jsx","../src/components/CoinleyCheckout.jsx","../src/index.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","// src/context/ThemeContext.jsx\r\nimport React, { createContext, useState, useContext, useEffect } from 'react';\r\n\r\nconst ThemeContext = createContext();\r\n\r\nexport const useTheme = () => useContext(ThemeContext);\r\n\r\nexport const ThemeProvider = ({ initialTheme = 'light', children }) => {\r\n const [theme, setTheme] = useState(initialTheme);\r\n\r\n const toggleTheme = () => {\r\n setTheme(prevTheme => prevTheme === 'light' ? 'dark' : 'light');\r\n };\r\n\r\n useEffect(() => {\r\n document.documentElement.classList.remove('light', 'dark');\r\n document.documentElement.classList.add(theme);\r\n }, [theme]);\r\n\r\n return (\r\n <ThemeContext.Provider value={{ theme, setTheme, toggleTheme }}>\r\n {children}\r\n </ThemeContext.Provider>\r\n );\r\n};\r\n","// src/services/api.js - Production Version\r\nlet apiConfig = {\r\n apiKey: null,\r\n apiSecret: null,\r\n apiUrl: 'https://coinleyserver-production.up.railway.app'\r\n };\r\n \r\n /**\r\n * Initialize the API with configuration\r\n * @param {Object} config - API configuration\r\n */\r\n export const initializeApi = (config) => {\r\n apiConfig = { ...apiConfig, ...config };\r\n console.log('API initialized with:', apiConfig);\r\n };\r\n \r\n /**\r\n * Generate headers with authentication\r\n * @returns {Object} - Headers object with authentication\r\n */\r\n const getHeaders = () => {\r\n return {\r\n 'Content-Type': 'application/json',\r\n 'x-api-key': apiConfig.apiKey,\r\n 'x-api-secret': apiConfig.apiSecret\r\n };\r\n };\r\n \r\n /**\r\n * Create a new payment\r\n * @param {Object} paymentData - Payment data\r\n * @returns {Promise} - Promise resolving to payment details\r\n */\r\n export const createPayment = async (paymentData) => {\r\n try {\r\n console.log('Creating payment with data:', paymentData);\r\n console.log('API URL:', `${apiConfig.apiUrl}/api/payments/create`);\r\n \r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/create`, {\r\n method: 'POST',\r\n headers: getHeaders(),\r\n body: JSON.stringify(paymentData)\r\n });\r\n \r\n console.log('Create payment response status:', response.status);\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n console.error('Error creating payment:', errorData);\r\n throw new Error(errorData.error || `Failed to create payment: ${response.status}`);\r\n }\r\n \r\n const data = await response.json();\r\n console.log('Create payment response data:', data);\r\n return data;\r\n } catch (error) {\r\n console.error('Create payment error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get payment details by ID\r\n * @param {string} paymentId - Payment ID\r\n * @returns {Promise} - Promise resolving to payment details\r\n */\r\n export const getPayment = async (paymentId) => {\r\n try {\r\n console.log('Getting payment:', paymentId);\r\n \r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/${paymentId}`, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n console.error('Error getting payment:', errorData);\r\n throw new Error(errorData.error || `Failed to get payment: ${response.status}`);\r\n }\r\n \r\n const data = await response.json();\r\n console.log('Get payment response:', data);\r\n return data;\r\n } catch (error) {\r\n console.error('Get payment error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Process a payment\r\n * @param {Object} processData - Payment process data\r\n * @returns {Promise} - Promise resolving to processed payment details\r\n */\r\n export const processPayment = async (processData) => {\r\n try {\r\n console.log('Processing payment with data:', processData);\r\n console.log('API URL:', `${apiConfig.apiUrl}/api/payments/process`);\r\n \r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/process`, {\r\n method: 'POST',\r\n headers: getHeaders(),\r\n body: JSON.stringify(processData)\r\n });\r\n \r\n console.log('Process payment response status:', response.status);\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n console.error('Error processing payment:', errorData);\r\n throw new Error(errorData.error || `Failed to process payment: ${response.status}`);\r\n }\r\n \r\n const data = await response.json();\r\n console.log('Process payment response data:', data);\r\n return data;\r\n } catch (error) {\r\n console.error('Process payment error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get merchant payments with optional filtering\r\n * @param {Object} options - Filter and pagination options\r\n * @returns {Promise} - Promise resolving to paginated payment list\r\n */\r\n export const getMerchantPayments = async (options = {}) => {\r\n try {\r\n const { page = 1, limit = 10, status, currency, startDate, endDate, search } = options;\r\n \r\n // Build query string\r\n const queryParams = new URLSearchParams();\r\n queryParams.append('page', page);\r\n queryParams.append('limit', limit);\r\n \r\n if (status) queryParams.append('status', status);\r\n if (currency) queryParams.append('currency', currency);\r\n if (startDate) queryParams.append('startDate', startDate);\r\n if (endDate) queryParams.append('endDate', endDate);\r\n if (search) queryParams.append('search', search);\r\n \r\n const url = `${apiConfig.apiUrl}/api/payments/merchant/list?${queryParams.toString()}`;\r\n \r\n const response = await fetch(url, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n throw new Error(errorData.error || `Failed to get payments: ${response.status}`);\r\n }\r\n \r\n return await response.json();\r\n } catch (error) {\r\n console.error('Get merchant payments error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get payment statistics for the merchant\r\n * @returns {Promise} - Promise resolving to payment statistics\r\n */\r\n export const getMerchantPaymentStats = async () => {\r\n try {\r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/merchant/stats`, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n throw new Error(errorData.error || `Failed to get payment stats: ${response.status}`);\r\n }\r\n \r\n return await response.json();\r\n } catch (error) {\r\n console.error('Get merchant payment stats error:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get supported currencies from the server\r\n * @returns {Promise} - Promise resolving to list of supported currencies\r\n */\r\n export const getSupportedCurrencies = async () => {\r\n try {\r\n const response = await fetch(`${apiConfig.apiUrl}/api/payments/currencies`, {\r\n method: 'GET',\r\n headers: getHeaders()\r\n });\r\n \r\n if (!response.ok) {\r\n const errorData = await response.json();\r\n throw new Error(errorData.error || `Failed to get currencies: ${response.status}`);\r\n }\r\n \r\n return await response.json();\r\n } catch (error) {\r\n console.error('Get supported currencies error:', error);\r\n \r\n // Fallback to hardcoded list if API fails\r\n return {\r\n currencies: [\r\n { id: 'USDT', name: 'Tether USD', network: 'ethereum' },\r\n { id: 'USDC', name: 'USD Coin', network: 'ethereum' },\r\n { id: 'BNB', name: 'Binance Coin', network: 'binance' },\r\n { id: 'SOL', name: 'Solana', network: 'solana' },\r\n { id: 'USDC_SOL', name: 'USD Coin (Solana)', network: 'solana' }\r\n ]\r\n };\r\n }\r\n };\r\n \r\n /**\r\n * Generate a mock transaction hash for testing\r\n * @returns {string} - Mock transaction hash\r\n */\r\n export const generateMockTransactionHash = () => {\r\n return `0x${Array.from({length: 64}, () => \r\n Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n };","\r\n// src/context/CoinleyContext.jsx\r\nimport React, { createContext, useContext, useState, useEffect } from 'react';\r\nimport { initializeApi } from '../services/api';\r\n\r\nconst CoinleyContext = createContext();\r\n\r\nexport const useCoinley = () => useContext(CoinleyContext);\r\n\r\nexport const CoinleyProvider = ({ \r\n apiKey, \r\n apiSecret, \r\n apiUrl = 'https://coinleyserver-production.up.railway.app',\r\n debug = false,\r\n children \r\n}) => {\r\n const [isInitialized, setIsInitialized] = useState(false);\r\n const [error, setError] = useState(null);\r\n\r\n useEffect(() => {\r\n if (!apiKey || !apiSecret) {\r\n setError('API key and secret are required');\r\n return;\r\n }\r\n\r\n try {\r\n initializeApi({ apiKey, apiSecret, apiUrl });\r\n setIsInitialized(true);\r\n if (debug) {\r\n console.log('Coinley SDK initialized with:', { apiKey, apiUrl });\r\n }\r\n } catch (err) {\r\n setError(err.message);\r\n if (debug) {\r\n console.error('Coinley SDK initialization error:', err);\r\n }\r\n }\r\n }, [apiKey, apiSecret, apiUrl, debug]);\r\n\r\n const value = {\r\n apiKey,\r\n apiSecret,\r\n apiUrl,\r\n isInitialized,\r\n error,\r\n debug\r\n };\r\n\r\n return (\r\n <CoinleyContext.Provider value={value}>\r\n {children}\r\n </CoinleyContext.Provider>\r\n );\r\n};","// // src/components/QRCode.jsx\r\n// import React, { useEffect, useRef } from 'react';\r\n\r\n// // A simple QR code renderer - in a production app, you would use a library like qrcode.react\r\n// const QRCode = ({ value, size = 200, theme = 'light' }) => {\r\n// const canvasRef = useRef(null);\r\n\r\n// // This is a simplified example - in a real implementation, use a proper QR code library\r\n// useEffect(() => {\r\n// const canvas = canvasRef.current;\r\n// if (!canvas) return;\r\n\r\n// const ctx = canvas.getContext('2d');\r\n// if (!ctx) return;\r\n\r\n// // Clear canvas\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(0, 0, size, size);\r\n\r\n// // Draw a fake QR code pattern for demonstration\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n\r\n// // Draw corner squares (position detection patterns)\r\n// // Top-left corner\r\n// ctx.fillRect(10, 10, 30, 30);\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(15, 15, 20, 20);\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n// ctx.fillRect(20, 20, 10, 10);\r\n\r\n// // Top-right corner\r\n// ctx.fillRect(size - 40, 10, 30, 30);\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(size - 35, 15, 20, 20);\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n// ctx.fillRect(size - 30, 20, 10, 10);\r\n\r\n// // Bottom-left corner\r\n// ctx.fillRect(10, size - 40, 30, 30);\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(15, size - 35, 20, 20);\r\n// ctx.fillStyle = theme === 'dark' ? '#FFFFFF' : '#000000';\r\n// ctx.fillRect(20, size - 30, 10, 10);\r\n\r\n// // Draw random dots to simulate QR code data\r\n// const cellSize = 5;\r\n// for (let y = 0; y < size; y += cellSize) {\r\n// for (let x = 0; x < size; x += cellSize) {\r\n// // Skip the corners (position detection patterns)\r\n// if (\r\n// (x < 50 && y < 50) || \r\n// (x > size - 50 && y < 50) || \r\n// (x < 50 && y > size - 50)\r\n// ) {\r\n// continue;\r\n// }\r\n\r\n// // Random fill with ~40% probability\r\n// if (Math.random() > 0.6) {\r\n// ctx.fillRect(x, y, cellSize, cellSize);\r\n// }\r\n// }\r\n// }\r\n\r\n// // Draw a logo in the center\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.fillRect(size / 2 - 20, size / 2 - 20, 40, 40);\r\n// ctx.fillStyle = '#3B82F6'; // Blue color for logo\r\n// ctx.beginPath();\r\n// ctx.arc(size / 2, size / 2, 15, 0, 2 * Math.PI);\r\n// ctx.fill();\r\n// ctx.fillStyle = theme === 'dark' ? '#1F2937' : '#FFFFFF';\r\n// ctx.beginPath();\r\n// ctx.arc(size / 2, size / 2, 10, 0, 2 * Math.PI);\r\n// ctx.fill();\r\n// ctx.fillStyle = '#3B82F6';\r\n// ctx.beginPath();\r\n// ctx.arc(size / 2, size / 2, 5, 0, 2 * Math.PI);\r\n// ctx.fill();\r\n// }, [size, value, theme]);\r\n\r\n// return (\r\n// <div className={`p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-white'} shadow-sm`}>\r\n// <canvas\r\n// ref={canvasRef}\r\n// width={size}\r\n// height={size}\r\n// className=\"mx-auto rounded\"\r\n// />\r\n// <div className=\"mt-2 text-center\">\r\n// <p className={`text-sm font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>\r\n// Scan with your wallet app\r\n// </p>\r\n// <p className={`text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// or copy the address below\r\n// </p>\r\n// </div>\r\n// <div className={`mt-2 p-2 rounded text-sm break-all ${theme === 'dark' ? 'bg-gray-800 text-gray-300' : 'bg-gray-100 text-gray-700'}`}>\r\n// {value.slice(0, 20)}...{value.slice(-10)}\r\n// </div>\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default QRCode;\r\n\r\n\r\n\r\n\r\n\r\n\r\n// src/components/QRCode.jsx\r\nimport React from 'react';\r\n\r\n/**\r\n * A simple QR code component that displays payment information\r\n */\r\nconst QRCode = ({ walletAddress, amount, currency, theme = 'light' }) => {\r\n // Create a placeholder QR code (in real implementation, use a proper QR library)\r\n const qrPlaceholder = (\r\n <div \r\n style={{\r\n width: '200px',\r\n height: '200px',\r\n backgroundColor: theme === 'dark' ? '#374151' : '#f3f4f6',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n color: theme === 'dark' ? 'white' : 'black',\r\n fontWeight: 'bold',\r\n border: `1px solid ${theme === 'dark' ? '#4b5563' : '#e5e7eb'}`,\r\n margin: '0 auto',\r\n }}\r\n >\r\n {currency} Payment QR\r\n </div>\r\n );\r\n\r\n return (\r\n <div className=\"flex flex-col items-center\">\r\n <div className={`p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-white'} mb-3`}>\r\n {qrPlaceholder}\r\n </div>\r\n \r\n <div className={`text-center text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}`}>\r\n Scan with your wallet app to pay\r\n </div>\r\n \r\n {walletAddress && (\r\n <div className=\"mt-3 w-full\">\r\n <p className={`text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'} mb-1`}>\r\n Send {amount} {currency} to:\r\n </p>\r\n <div className={`text-xs font-mono p-2 rounded overflow-auto break-all ${theme === 'dark' ? 'bg-gray-800 text-gray-300' : 'bg-gray-100 text-gray-700'}`}>\r\n {walletAddress}\r\n </div>\r\n </div>\r\n )}\r\n \r\n <div className=\"mt-4 w-full\">\r\n <div className={`p-3 rounded ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <h4 className={`text-sm font-medium mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Payment Instructions\r\n </h4>\r\n <ol className={`text-xs space-y-2 ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n <li>1. Open your crypto wallet app</li>\r\n <li>2. Scan the QR code above</li>\r\n <li>3. Send {amount} {currency}</li>\r\n <li>4. Click \"Pay Now\" button after sending</li>\r\n </ol>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default QRCode;","// // src/components/PaymentStatus.jsx - Updated version\r\n// import React from 'react';\r\n\r\n// const PaymentStatus = ({ status, theme = 'light', message }) => {\r\n// console.log('PaymentStatus render:', { status, message });\r\n\r\n// const renderIcon = () => {\r\n// switch (status) {\r\n// case 'processing':\r\n// return (\r\n// <div className=\"animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20\"></div>\r\n// );\r\n// case 'success':\r\n// return (\r\n// <div className=\"rounded-full h-12 w-12 bg-green-100 flex items-center justify-center\">\r\n// <svg\r\n// xmlns=\"http://www.w3.org/2000/svg\"\r\n// className=\"h-8 w-8 text-green-500\"\r\n// fill=\"none\"\r\n// viewBox=\"0 0 24 24\"\r\n// stroke=\"currentColor\"\r\n// strokeWidth={2}\r\n// >\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\r\n// </svg>\r\n// </div>\r\n// );\r\n// case 'error':\r\n// return (\r\n// <div className=\"rounded-full h-12 w-12 bg-red-100 flex items-center justify-center\">\r\n// <svg\r\n// xmlns=\"http://www.w3.org/2000/svg\"\r\n// className=\"h-8 w-8 text-red-500\"\r\n// fill=\"none\"\r\n// viewBox=\"0 0 24 24\"\r\n// stroke=\"currentColor\"\r\n// strokeWidth={2}\r\n// >\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\r\n// </svg>\r\n// </div>\r\n// );\r\n// default:\r\n// return null;\r\n// }\r\n// };\r\n\r\n// const getStatusTitle = () => {\r\n// switch (status) {\r\n// case 'processing':\r\n// return 'Processing Payment';\r\n// case 'success':\r\n// return 'Payment Successful';\r\n// case 'error':\r\n// return 'Payment Failed';\r\n// default:\r\n// return 'Unknown Status';\r\n// }\r\n// };\r\n\r\n// const getMessageClasses = () => {\r\n// switch (status) {\r\n// case 'processing':\r\n// return theme === 'dark' ? 'text-blue-300' : 'text-blue-600';\r\n// case 'success':\r\n// return theme === 'dark' ? 'text-green-300' : 'text-green-600';\r\n// case 'error':\r\n// return theme === 'dark' ? 'text-red-300' : 'text-red-600';\r\n// default:\r\n// return theme === 'dark' ? 'text-gray-300' : 'text-gray-600';\r\n// }\r\n// };\r\n\r\n// return (\r\n// <div className=\"flex flex-col items-center justify-center py-6\">\r\n// <div className=\"mb-4\">{renderIcon()}</div>\r\n// <h3 className={`text-xl font-bold mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>\r\n// {getStatusTitle()}\r\n// </h3>\r\n// <p className={`text-center ${getMessageClasses()}`}>{message}</p>\r\n\r\n// {status === 'processing' && (\r\n// <div className={`mt-4 text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// This may take a few moments. Please do not close this window.\r\n// </div>\r\n// )}\r\n\r\n// {status === 'success' && (\r\n// <div className={`mt-4 p-2 rounded ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Your payment has been successfully processed. You will receive a confirmation shortly.\r\n// </p>\r\n// </div>\r\n// )}\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default PaymentStatus;\r\n\r\n\r\n// src/components/PaymentStatus.jsx\r\nimport React from 'react';\r\n\r\n/**\r\n * Component to display payment status\r\n */\r\nconst PaymentStatus = ({ status, message, theme = 'light' }) => {\r\n // Render different icons based on status\r\n const renderIcon = () => {\r\n switch (status) {\r\n case 'processing':\r\n return (\r\n <div className=\"animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20\"></div>\r\n );\r\n case 'success':\r\n return (\r\n <div className=\"rounded-full h-12 w-12 bg-green-100 flex items-center justify-center\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n className=\"h-8 w-8 text-green-500\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n strokeWidth={2}\r\n >\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\r\n </svg>\r\n </div>\r\n );\r\n case 'error':\r\n return (\r\n <div className=\"rounded-full h-12 w-12 bg-red-100 flex items-center justify-center\">\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n className=\"h-8 w-8 text-red-500\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n stroke=\"currentColor\"\r\n strokeWidth={2}\r\n >\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </div>\r\n );\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n // Get status title\r\n const getStatusTitle = () => {\r\n switch (status) {\r\n case 'processing':\r\n return 'Processing Payment';\r\n case 'success':\r\n return 'Payment Successful';\r\n case 'error':\r\n return 'Payment Failed';\r\n default:\r\n return 'Unknown Status';\r\n }\r\n };\r\n\r\n // Get appropriate text color for message\r\n const getMessageClasses = () => {\r\n switch (status) {\r\n case 'processing':\r\n return theme === 'dark' ? 'text-blue-300' : 'text-blue-600';\r\n case 'success':\r\n return theme === 'dark' ? 'text-green-300' : 'text-green-600';\r\n case 'error':\r\n return theme === 'dark' ? 'text-red-300' : 'text-red-600';\r\n default:\r\n return theme === 'dark' ? 'text-gray-300' : 'text-gray-600';\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"flex flex-col items-center justify-center py-6\">\r\n <div className=\"mb-4\">{renderIcon()}</div>\r\n <h3 className={`text-xl font-bold mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>\r\n {getStatusTitle()}\r\n </h3>\r\n <p className={`text-center ${getMessageClasses()}`}>{message}</p>\r\n\r\n {status === 'processing' && (\r\n <div className={`mt-4 text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n This may take a few moments. Please do not close this window.\r\n </div>\r\n )}\r\n\r\n {status === 'success' && (\r\n <div className={`mt-4 p-2 rounded ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n Your payment has been successfully processed. You will receive a confirmation shortly.\r\n </p>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default PaymentStatus;","// // src/components/PaymentMethods.jsx - Updated version\r\n// import React from 'react';\r\n\r\n// const PaymentMethods = ({ onSelect, selected, theme = 'light' }) => {\r\n// // Debug logs to verify props\r\n// console.log('PaymentMethods render:', { selected });\r\n\r\n// const paymentMethods = [\r\n// {\r\n// id: 'USDT',\r\n// name: 'USDT',\r\n// description: 'Tether USD',\r\n// logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzI2QTE3QiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy45MjIgMTcuMzgzdi0uMDAyYy0uMTEuMDA4LS42NzcuMDQyLTEuOTQyLjA0Mi0xLjAxIDAtMS43MjEtLjAzLTEuOTcxLS4wNDJ2LjAwM2MtMy44ODgtLjE3MS02Ljc5LS44NDgtNi43OS0xLjY1OCAwLS44MDkgMi45MDItMS40ODYgNi43OS0xLjY2di4wNDdjLjI1NC4wMTguOTgyLjA0NSAxLjk4OC4wNDUgMS4yMDcgMCAxLjgxMi0uMDM2IDEuOTI1LS4wNDZ2LS4wNDRjMy44OC4xNzQgNi43NzUuODUxIDYuNzc1IDEuNjU4IDAgLjgwNy0yLjg5NSAxLjQ4NS02Ljc3NSAxLjY1N3ptMC0zLjU2NnYtLjA0N2MuMS0uMDA4LjYyNS0uMDQ1IDEuOTI1LS4wNDUgMS4wMDUgMCAxLjczNC4wMjcgMS45ODguMDQ2di0yLjg0MWgtMy45MXYyLjgzOWMtLjExMS4wMDgtLjY4LjA0Ni0xLjk3MS4wNDYtMS4yNDMgMC0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C41MzdoNC4xNTNhMy4xMzMgMy4xMzMgMCAwMDAgNC41MzdIOS42ODZhNy42MjEgNy42MjEgMCAwMTAtNC41Mzd6Ii8+PC9nPjwvc3ZnPg==',\r\n// }\r\n// ];\r\n\r\n// const handleSelectPaymentMethod = (id) => {\r\n// console.log('Method selected:', id);\r\n// // Call the onSelect prop with the selected currency\r\n// onSelect(id);\r\n// };\r\n\r\n// return (\r\n// <div>\r\n// <h3 className={`text-lg font-medium mb-3 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Select Payment Method\r\n// </h3>\r\n// <div className=\"space-y-2\">\r\n// {paymentMethods.map((method) => (\r\n// <button\r\n// key={method.id}\r\n// onClick={() => handleSelectPaymentMethod(method.id)}\r\n// className={`w-full flex items-center p-3 rounded-lg transition-colors ${\r\n// selected === method.id\r\n// ? theme === 'dark'\r\n// ? 'bg-blue-900/30 border border-blue-500'\r\n// : 'bg-blue-50 border border-blue-500'\r\n// : theme === 'dark'\r\n// ? 'bg-gray-700 hover:bg-gray-600 border border-gray-700'\r\n// : 'bg-white hover:bg-gray-50 border border-gray-200'\r\n// }`}\r\n// >\r\n// <div className=\"flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3\">\r\n// <img src={method.logo} alt={method.name} className=\"h-6 w-6\" />\r\n// </div>\r\n// <div className=\"flex-1 text-left\">\r\n// <h4 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>{method.name}</h4>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-500'}`}>{method.description}</p>\r\n// </div>\r\n// {selected === method.id && (\r\n// <svg\r\n// xmlns=\"http://www.w3.org/2000/svg\"\r\n// className=\"h-5 w-5 text-blue-500\"\r\n// viewBox=\"0 0 20 20\"\r\n// fill=\"currentColor\"\r\n// >\r\n// <path\r\n// fillRule=\"evenodd\"\r\n// d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\"\r\n// clipRule=\"evenodd\"\r\n// />\r\n// </svg>\r\n// )}\r\n// </button>\r\n// ))}\r\n// </div>\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default PaymentMethods;\r\n\r\n\r\n\r\n// src/components/PaymentMethods.jsx\r\nimport React from 'react';\r\n\r\n/**\r\n * Component for selecting payment currency\r\n */\r\nconst PaymentMethods = ({ onSelect, selected, theme = 'light' }) => {\r\n const paymentMethods = [\r\n {\r\n id: 'USDT',\r\n name: 'USDT',\r\n description: 'Tether USD',\r\n logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzI2QTE3QiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNy45MjIgMTcuMzgzdi0uMDAyYy0uMTEuMDA4LS42NzcuMDQyLTEuOTQyLjA0Mi0xLjAxIDAtMS43MjEtLjAzLTEuOTcxLS4wNDJ2LjAwM2MtMy44ODgtLjE3MS02Ljc5LS44NDgtNi43OS0xLjY1OCAwLS44MDkgMi45MDItMS40ODYgNi43OS0xLjY2di4wNDdjLjI1NC4wMTguOTgyLjA0NSAxLjk4OC4wNDUgMS4yMDcgMCAxLjgxMi0uMDM2IDEuOTI1LS4wNDZ2LS4wNDRjMy44OC4xNzQgNi43NzUuODUxIDYuNzc1IDEuNjU4IDAgLjgwNy0yLjg5NSAxLjQ4NS02Ljc3NSAxLjY1N3ptMC0zLjU2NnYtLjA0N2MuMS0uMDA4LjYyNS0uMDQ1IDEuOTI1LS4wNDUgMS4wMDUgMCAxLjczNC4wMjcgMS45ODguMDQ2di0yLjg0MWgtMy45MXYyLj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LjEzLS4yM2MuMDktLjA2LjIzLTEuMDQuMjMtMS4wNC4wMy0uMjIuMTYtLjQyLjM2LS41M2wuNC0uMjJjLjA4LS4wNC41My0uNDUuNTMtLjQ1LjEzLS4xLjMtLjAzLjM0LjEzIDAgMCAxLjg5IDkuMDEgMS44OSA5LjAxLjA1LjMtLjE3LjU2LS40NC42OWwtLjQ4LjI0Yy0uMy4xNS0xMS40NSA1LjgtMTEuNDUgNS44LS4yMi4xMi0uNTctLjA0LS41Ny0uMzJWMTJjLS4wMi0uMzUuMjQtLjY2LjU3LS43aDguNDRhLjY3LjY3IDAgMDAuNjEtLjM4di0uMDJjLjA3LS4xNi4yNC0uMjQuNC0uMmwuMjUuMDRjLjE0LjAyLjMuMTguMy4xOHoiIGZpbGw9IiNmZmYiLz48L2c+PC9zdmc+',\r\n }\r\n ];\r\n\r\n const handleSelectPaymentMethod = (id) => {\r\n onSelect(id);\r\n };\r\n\r\n return (\r\n <div>\r\n <h3 className={`text-lg font-medium mb-3 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Select Payment Method\r\n </h3>\r\n <div className=\"space-y-2\">\r\n {paymentMethods.map((method) => (\r\n <button\r\n key={method.id}\r\n onClick={() => handleSelectPaymentMethod(method.id)}\r\n className={`w-full flex items-center p-3 rounded-lg transition-colors ${\r\n selected === method.id\r\n ? theme === 'dark'\r\n ? 'bg-blue-900/30 border border-blue-500'\r\n : 'bg-blue-50 border border-blue-500'\r\n : theme === 'dark'\r\n ? 'bg-gray-700 hover:bg-gray-600 border border-gray-700'\r\n : 'bg-white hover:bg-gray-50 border border-gray-200'\r\n }`}\r\n >\r\n <div className=\"flex-shrink-0 h-10 w-10 bg-white rounded-full flex items-center justify-center mr-3\">\r\n <img src={method.logo} alt={method.name} className=\"h-6 w-6\" />\r\n </div>\r\n <div className=\"flex-1 text-left\">\r\n <h4 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`}>{method.name}</h4>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-500'}`}>{method.description}</p>\r\n </div>\r\n {selected === method.id && (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n className=\"h-5 w-5 text-blue-500\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n >\r\n <path\r\n fillRule=\"evenodd\"\r\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\"\r\n clipRule=\"evenodd\"\r\n />\r\n </svg>\r\n )}\r\n </button>\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default PaymentMethods;","\r\n// src/services/web3.js - Production Version\r\n/**\r\n * Check if MetaMask is installed\r\n * @returns {boolean} - Whether MetaMask is installed\r\n */\r\nexport const isMetaMaskInstalled = () => {\r\n return typeof window !== 'undefined' && typeof window.ethereum !== 'undefined';\r\n };\r\n \r\n /**\r\n * Connect to MetaMask wallet\r\n * @returns {Promise<string[]>} - Promise resolving to array of accounts\r\n */\r\n export const connectWallet = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });\r\n return accounts;\r\n } catch (error) {\r\n console.error('Error connecting to wallet:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get current wallet accounts\r\n * @returns {Promise<string[]>} - Promise resolving to array of accounts\r\n */\r\n export const getAccounts = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const accounts = await window.ethereum.request({ method: 'eth_accounts' });\r\n return accounts;\r\n } catch (error) {\r\n console.error('Error getting accounts:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Get the current chain ID\r\n * @returns {Promise<string>} - Promise resolving to chain ID\r\n */\r\n export const getChainId = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const chainId = await window.ethereum.request({ method: 'eth_chainId' });\r\n return chainId;\r\n } catch (error) {\r\n console.error('Error getting chain ID:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Send a transaction\r\n * @param {Object} txParams - Transaction parameters\r\n * @returns {Promise<string>} - Promise resolving to transaction hash\r\n */\r\n export const sendTransaction = async (txParams) => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n const txHash = await window.ethereum.request({\r\n method: 'eth_sendTransaction',\r\n params: [txParams],\r\n });\r\n return txHash;\r\n } catch (error) {\r\n console.error('Error sending transaction:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Send USDT or other ERC-20 token\r\n * @param {string} tokenAddress - The token contract address\r\n * @param {string} toAddress - Recipient address\r\n * @param {string} amount - Amount in smallest unit (e.g., wei)\r\n * @returns {Promise<string>} - Promise resolving to transaction hash\r\n */\r\n export const sendToken = async (tokenAddress, toAddress, amount) => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n // Get current account\r\n const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });\r\n const fromAddress = accounts[0];\r\n \r\n // ERC-20 token transfer function signature: transfer(address,uint256)\r\n const transferFunctionSignature = '0xa9059cbb';\r\n \r\n // The parameters for the transfer function (to address and amount)\r\n // Need to pad the address to 32 bytes and convert amount to hex\r\n const paddedToAddress = toAddress.slice(2).padStart(64, '0');\r\n const paddedAmount = amount.toString(16).padStart(64, '0');\r\n \r\n // Combine everything into the transaction data\r\n const data = `${transferFunctionSignature}${paddedToAddress}${paddedAmount}`;\r\n \r\n // Create transaction parameters\r\n const txParams = {\r\n from: fromAddress,\r\n to: tokenAddress,\r\n data: data,\r\n };\r\n \r\n // Send the transaction\r\n const txHash = await window.ethereum.request({\r\n method: 'eth_sendTransaction',\r\n params: [txParams],\r\n });\r\n \r\n return txHash;\r\n } catch (error) {\r\n console.error('Error sending token:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n /**\r\n * Check if a wallet is connected\r\n * @returns {Promise<boolean>} - Promise resolving to whether a wallet is connected\r\n */\r\n export const isWalletConnected = async () => {\r\n try {\r\n const accounts = await getAccounts();\r\n return accounts.length > 0;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n \r\n /**\r\n * Determine the network name from chain ID\r\n * @param {string} chainId - Chain ID in hex\r\n * @returns {string} - Network name\r\n */\r\n export const getNetworkName = (chainId) => {\r\n const networks = {\r\n '0x1': 'Ethereum Mainnet',\r\n '0x3': 'Ropsten Testnet',\r\n '0x4': 'Rinkeby Testnet',\r\n '0x5': 'Goerli Testnet',\r\n '0x2a': 'Kovan Testnet',\r\n '0x38': 'Binance Smart Chain',\r\n '0x89': 'Polygon',\r\n '0xa86a': 'Avalanche',\r\n };\r\n \r\n return networks[chainId] || `Unknown Network (${chainId})`;\r\n };\r\n \r\n /**\r\n * Get ERC-20 token balance\r\n * @param {string} tokenAddress - Token contract address\r\n * @param {string} userAddress - User wallet address\r\n * @returns {Promise<string>} - Promise resolving to token balance\r\n */\r\n export const getTokenBalance = async (tokenAddress, userAddress) => {\r\n if (!isMetaMaskInstalled()) {\r\n throw new Error('MetaMask is not installed');\r\n }\r\n \r\n try {\r\n // balanceOf function signature\r\n const balanceOfSignature = '0x70a08231';\r\n \r\n // Pad the address to 32 bytes\r\n const paddedAddress = userAddress.slice(2).padStart(64, '0');\r\n \r\n // Create the call data\r\n const data = `${balanceOfSignature}${paddedAddress}`;\r\n \r\n // Call the contract\r\n const balance = await window.ethereum.request({\r\n method: 'eth_call',\r\n params: [\r\n {\r\n to: tokenAddress,\r\n data: data\r\n },\r\n 'latest'\r\n ]\r\n });\r\n \r\n // Convert the hex balance to decimal\r\n return parseInt(balance, 16).toString();\r\n } catch (error) {\r\n console.error('Error getting token balance:', error);\r\n throw error;\r\n }\r\n };\r\n \r\n // Token addresses for common currencies (mainnet)\r\n export const TOKEN_ADDRESSES = {\r\n USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7',\r\n USDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',\r\n DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F',\r\n WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\r\n WBTC: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'\r\n };\r\n \r\n // For testing purposes only - simulate a transaction without MetaMask\r\n export const simulateTransaction = (amount, currency, toAddress) => {\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n const txHash = `0x${Array.from({length: 64}, () => \r\n Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n \r\n resolve(txHash);\r\n }, 2000);\r\n });\r\n };","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAAcCAYAAACqAXueAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAiaSURBVHgB7VrdddNIFL4zNuDAw2orQDQATgUoUABQAU4FOGcLiF0BpoI4FcQ0QLQVxAHOvqLtwDyQOBBr9rszI2n058jeBEhOvnNkS6M7o7m6c39HRA3Qf/bxLR+l9uDIR/sXHD26trjTJeoMiO6/pEuCEBuHOBQfZuxfB9mQjpnv958d9/O9W2/w6+N4StcSHV+INoQhdoVQB7ju0Q1DUwFbiN1Cw6Wt+l+EHg4vu5TXdKHWIydgmFyv//xjWWhCzOyZB5pA0xo63zSrf0vjQNvZhNPvjTB/Gf9NNwx5DZZyQIoOSn5VOYxLaRaAUkHaFotpcgqhdmG6j7Aq4LNbXfqtMQ+VUts4xkrRDq7HdMOQF3BMkT3zcez1n30yJjmOJymNsv5WyCdZx0XIvzvB59cQ7qHur1SUtP/eYKHOt4lOR3QD0XYvRuGTUX/r+A1Msm9a1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4JhBgt/YM/O9GzbkM2fubfk2KlLl94MV+XmRW2Ga77B83RQnKyX7TAcC5WBhzKesyaDXO1HWfIe0MjSDYaGNmkEzGdG1QTGaP7m4S2GDxsYJURVlQcDxAIHUQ+1z48V+Jhzp+OSFEWy8mECwdgXlfbYNsh6tF1Xfoh7GslnN9Z0btZay8MmOFkw5YpR2MKW3BCNLO0O0HZqP78QfVYP/jx2mW5TAmcbZYTHxsYFYVNer2XfRyobjxWh1cT607T7d4qejPsrO0EzAgv0u/HH4OBeGaxPO94Q6plv8FECovJc8uTjKNvgPcUpIo0ZgmzUAAAAASUVORK5CYII=\"","// // src/components/CoinleyModal.jsx - Production Version\r\n// import React, { useEffect, useState } from 'react';\r\n// import PaymentMethods from './PaymentMethods';\r\n// import PaymentStatus from './PaymentStatus';\r\n// import QRCode from './QRCode';\r\n// import { isMetaMaskInstalled } from '../services/web3';\r\n// import Logo from '../assets/Logo.png';\r\n\r\n\r\n// const CoinleyModal = ({\r\n// isOpen,\r\n// onClose,\r\n// payment,\r\n// paymentStatus,\r\n// selectedCurrency,\r\n// onCurrencySelect,\r\n// onPayment,\r\n// error,\r\n// theme = 'light',\r\n// merchantName,\r\n// transactionHash,\r\n// walletConnected,\r\n// onConnectWallet,\r\n// testMode = false\r\n// }) => {\r\n// // IMPORTANT: Start with 'select-currency', not 'processing'\r\n// const [step, setStep] = useState('select-currency');\r\n// const [isMetaMaskAvailable, setIsMetaMaskAvailable] = useState(false);\r\n \r\n// // Check if MetaMask is available\r\n// useEffect(() => {\r\n// setIsMetaMaskAvailable(isMetaMaskInstalled());\r\n// }, []);\r\n\r\n// // Update step based on payment status\r\n// useEffect(() => {\r\n// if (paymentStatus === 'loading') {\r\n// setStep('processing');\r\n// } else if (paymentStatus === 'success') {\r\n// setStep('success');\r\n// } else if (paymentStatus === 'error') {\r\n// setStep('error');\r\n// } else if (paymentStatus === 'idle' && payment) {\r\n// // Make sure we start at currency selection when a new payment is created\r\n// setStep('select-currency');\r\n// }\r\n// }, [paymentStatus, payment]);\r\n\r\n// const handleCurrencySelect = (currency) => {\r\n// onCurrencySelect(currency);\r\n// setStep('confirm');\r\n// };\r\n\r\n// const handlePaymentConfirm = () => {\r\n// onPayment();\r\n// };\r\n\r\n// const handleBack = () => {\r\n// if (step === 'confirm') {\r\n// setStep('select-currency');\r\n// }\r\n// };\r\n\r\n// const handleClose = () => {\r\n// onClose();\r\n// };\r\n\r\n// // Format amount with 2 decimal places\r\n// const formatAmount = (amount) => {\r\n// return parseFloat(amount).toFixed(2);\r\n// };\r\n\r\n// // Format transaction hash for display\r\n// const formatTransactionHash = (hash) => {\r\n// if (!hash) return '';\r\n// if (hash.length <= 14) return hash;\r\n// return `${hash.slice(0, 8)}...${hash.slice(-6)}`;\r\n// };\r\n\r\n// // Base modal classes\r\n// const modalBaseClasses = `fixed inset-0 z-50 overflow-y-auto ${theme === 'dark' ? 'bg-gray-900/75' : 'bg-black/50'}`;\r\n// const modalContentClasses = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${theme === 'dark' ? 'bg-gray-800 text-white' : 'bg-white text-gray-800'}`;\r\n// const headerClasses = `text-xl font-bold mb-4 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`;\r\n// const buttonPrimaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark' \r\n// ? 'bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500' \r\n// : 'bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500'\r\n// }`;\r\n// const buttonSecondaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark'\r\n// ? 'bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500'\r\n// : 'bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500'\r\n// }`;\r\n\r\n// if (!isOpen) return null;\r\n\r\n// return (\r\n// <div className={modalBaseClasses}>\r\n// <div className=\"flex min-h-screen items-center justify-center p-4\">\r\n// <div className={modalContentClasses}>\r\n// {/* Header */}\r\n// <div className=\"flex justify-between items-center mb-6\">\r\n// <div className=\"flex items-center\">\r\n// <img src={Logo} />\r\n// <h2 className={headerClasses}>Coinley Pay</h2>\r\n// </div>\r\n// <button \r\n// onClick={handleClose}\r\n// className={`text-gray-500 hover:text-gray-700 focus:outline-none ${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : ''}`}\r\n// >\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\r\n// </svg>\r\n// </button>\r\n// </div>\r\n \r\n// {/* Content */}\r\n// <div className=\"mb-6\">\r\n// {payment && (\r\n// <div className={`mb-6 p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {merchantName}\r\n// </p>\r\n// <div className=\"flex justify-between items-center mt-2\">\r\n// <span className={`font-medium ${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}`}>\r\n// Amount:\r\n// </span>\r\n// <span className=\"font-bold text-xl\">\r\n// ${formatAmount(payment.totalAmount || payment.amount)}\r\n// </span>\r\n// </div>\r\n// <div className=\"text-xs mt-1 text-right\">\r\n// <span className={`${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// Payment ID: {payment.id.slice(0, 8)}...\r\n// </span>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'select-currency' && (\r\n// <PaymentMethods \r\n// onSelect={handleCurrencySelect} \r\n// selected={selectedCurrency}\r\n// theme={theme}\r\n// />\r\n// )}\r\n\r\n// {step === 'confirm' && payment && (\r\n// <div>\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <h3 className={`text-lg font-medium mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Payment Details\r\n// </h3>\r\n// <div className=\"space-y-2\">\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Currency:</span>\r\n// <span className=\"font-medium\">{selectedCurrency}</span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Network:</span>\r\n// <span className=\"font-medium\">\r\n// {selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'Solana' : 'Ethereum'}\r\n// </span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Fee:</span>\r\n// <span className=\"font-medium\">1.75%</span>\r\n// </div>\r\n// </div>\r\n// </div>\r\n\r\n// {testMode ? (\r\n// // Test mode payment option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <div className=\"bg-blue-500 rounded-full p-2 mr-3\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-white\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\r\n// </svg>\r\n// </div>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Test Mode Payment\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Click \"Pay Now\" to simulate a successful payment\r\n// </p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// ) : isMetaMaskAvailable ? (\r\n// // MetaMask available option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <img \r\n// src=\"https://metamask.io/images/metamask-fox.svg\" \r\n// alt=\"MetaMask\" \r\n// className=\"w-8 h-8 mr-2\"\r\n// />\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Pay with MetaMask\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {walletConnected \r\n// ? \"Your wallet is connected. Click 'Pay Now' to proceed.\" \r\n// : \"Click 'Connect Wallet' to proceed with payment.\"\r\n// }\r\n// </p>\r\n// </div>\r\n// </div>\r\n// {!walletConnected && (\r\n// <button\r\n// onClick={onConnectWallet}\r\n// className={`mt-3 ${buttonPrimaryClasses}`}\r\n// >\r\n// Connect Wallet\r\n// </button>\r\n// )}\r\n// </div>\r\n// ) : (\r\n// // MetaMask not available warning\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-yellow-900/20' : 'bg-yellow-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-yellow-500 mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\r\n// </svg>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// MetaMask Not Detected\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Please install MetaMask extension to make payments\r\n// </p>\r\n// </div>\r\n// </div>\r\n// <a\r\n// href=\"https://metamask.io/download/\"\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`block mt-3 text-center ${buttonPrimaryClasses}`}\r\n// >\r\n// Install MetaMask\r\n// </a>\r\n// </div>\r\n// )}\r\n\r\n// <div className=\"mt-6 grid grid-cols-2 gap-3\">\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={buttonSecondaryClasses}\r\n// >\r\n// Back\r\n// </button>\r\n// <button\r\n// type=\"button\"\r\n// onClick={handlePaymentConfirm}\r\n// className={buttonPrimaryClasses}\r\n// disabled={!testMode && isMetaMaskAvailable && !walletConnected}\r\n// >\r\n// Pay Now\r\n// </button>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'processing' && (\r\n// <PaymentStatus \r\n// status=\"processing\" \r\n// theme={theme}\r\n// message=\"Processing your payment...\"\r\n// />\r\n// )}\r\n\r\n// {step === 'success' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"success\" \r\n// theme={theme}\r\n// message=\"Payment successful!\"\r\n// />\r\n// {transactionHash && (\r\n// <div className={`mt-4 p-3 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'} mb-1`}>\r\n// Transaction Hash:\r\n// </p>\r\n// <p className={`text-sm font-mono break-all ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// {formatTransactionHash(transactionHash)}\r\n// </p>\r\n// {/* Optional: Add link to blockchain explorer */}\r\n// <a \r\n// href={`https://etherscan.io/tx/${transactionHash}`}\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`text-xs ${theme === 'dark' ? 'text-blue-400' : 'text-blue-600'} mt-2 inline-block`}\r\n// >\r\n// View on Etherscan →\r\n// </a>\r\n// </div>\r\n// )}\r\n// </div>\r\n// )}\r\n\r\n// {step === 'error' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"error\" \r\n// theme={theme}\r\n// message={error || \"An error occurred while processing your payment.\"}\r\n// />\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={`mt-4 ${buttonSecondaryClasses}`}\r\n// >\r\n// Try Again\r\n// </button>\r\n// </div>\r\n// )}\r\n// </div>\r\n\r\n// {/* Footer */}\r\n// <div className={`text-center text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// <p>Powered by Coinley - Secure Cryptocurrency Payments</p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default CoinleyModal;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n// // src/components/CoinleyModal.jsx - Updated with QR Code Feature\r\n// import React, { useEffect, useState } from 'react';\r\n// import PaymentMethods from './PaymentMethods';\r\n// import PaymentStatus from './PaymentStatus';\r\n// import QRCode from './QRCode';\r\n// import { isMetaMaskInstalled } from '../services/web3';\r\n// import Logo from '../assets/Logo.png';\r\n\r\n// const CoinleyModal = ({\r\n// isOpen,\r\n// onClose,\r\n// payment,\r\n// paymentStatus,\r\n// selectedCurrency,\r\n// onCurrencySelect,\r\n// onPayment,\r\n// error,\r\n// theme = 'light',\r\n// merchantName,\r\n// transactionHash,\r\n// walletConnected,\r\n// onConnectWallet,\r\n// testMode = false\r\n// }) => {\r\n// // IMPORTANT: Start with 'select-currency', not 'processing'\r\n// const [step, setStep] = useState('select-currency');\r\n// const [isMetaMaskAvailable, setIsMetaMaskAvailable] = useState(false);\r\n// // Add paymentMethod state to toggle between QR and wallet\r\n// const [paymentMethod, setPaymentMethod] = useState('wallet');\r\n \r\n// // Check if MetaMask is available\r\n// useEffect(() => {\r\n// setIsMetaMaskAvailable(isMetaMaskInstalled());\r\n// }, []);\r\n\r\n// // Update step based on payment status\r\n// useEffect(() => {\r\n// if (paymentStatus === 'loading') {\r\n// setStep('processing');\r\n// } else if (paymentStatus === 'success') {\r\n// setStep('success');\r\n// } else if (paymentStatus === 'error') {\r\n// setStep('error');\r\n// } else if (paymentStatus === 'idle' && payment) {\r\n// // Make sure we start at currency selection when a new payment is created\r\n// setStep('select-currency');\r\n// }\r\n// }, [paymentStatus, payment]);\r\n\r\n// const handleCurrencySelect = (currency) => {\r\n// onCurrencySelect(currency);\r\n// setStep('confirm');\r\n// };\r\n\r\n// const handlePaymentConfirm = () => {\r\n// onPayment();\r\n// };\r\n\r\n// const handleBack = () => {\r\n// if (step === 'confirm') {\r\n// setStep('select-currency');\r\n// }\r\n// };\r\n\r\n// const handleClose = () => {\r\n// onClose();\r\n// };\r\n\r\n// // Format amount with 2 decimal places\r\n// const formatAmount = (amount) => {\r\n// return parseFloat(amount).toFixed(2);\r\n// };\r\n\r\n// // Format transaction hash for display\r\n// const formatTransactionHash = (hash) => {\r\n// if (!hash) return '';\r\n// if (hash.length <= 14) return hash;\r\n// return `${hash.slice(0, 8)}...${hash.slice(-6)}`;\r\n// };\r\n\r\n// // Toggle payment method\r\n// const togglePaymentMethod = (method) => {\r\n// setPaymentMethod(method);\r\n// };\r\n\r\n// // Base modal classes\r\n// const modalBaseClasses = `fixed inset-0 z-50 overflow-y-auto ${theme === 'dark' ? 'bg-gray-900/75' : 'bg-black/50'}`;\r\n// const modalContentClasses = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${theme === 'dark' ? 'bg-gray-800 text-white' : 'bg-white text-gray-800'}`;\r\n// const headerClasses = `text-xl font-bold mb-4 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`;\r\n// const buttonPrimaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark' \r\n// ? 'bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500' \r\n// : 'bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500'\r\n// }`;\r\n// const buttonSecondaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n// theme === 'dark'\r\n// ? 'bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500'\r\n// : 'bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500'\r\n// }`;\r\n// const tabButtonClasses = `py-2 px-4 text-sm font-medium focus:outline-none transition-colors`;\r\n// const activeTabClasses = `${theme === 'dark' ? 'bg-gray-700 text-white' : 'bg-gray-100 text-gray-800'} rounded-t-md`;\r\n// const inactiveTabClasses = `${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : 'text-gray-500 hover:text-gray-700'}`;\r\n\r\n// if (!isOpen) return null;\r\n\r\n// console.log('CoinleyModal render:', {\r\n// testMode,\r\n// paymentMethod,\r\n// step,\r\n// isMetaMaskAvailable\r\n// });\r\n\r\n// return (\r\n// <div className={modalBaseClasses}>\r\n// <div className=\"flex min-h-screen items-center justify-center p-4\">\r\n// <div className={modalContentClasses}>\r\n// {/* Header */}\r\n// <div className=\"flex justify-between items-center mb-6\">\r\n// <div className=\"flex items-center\">\r\n// <img src={Logo} alt=\"Coinley Logo\" className=\"h-8 mr-2\" />\r\n// <h2 className={headerClasses}>Coinley Pay</h2>\r\n// </div>\r\n// <button \r\n// onClick={handleClose}\r\n// className={`text-gray-500 hover:text-gray-700 focus:outline-none ${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : ''}`}\r\n// >\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\r\n// </svg>\r\n// </button>\r\n// </div>\r\n \r\n// {/* Content */}\r\n// <div className=\"mb-6\">\r\n// {payment && (\r\n// <div className={`mb-6 p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {merchantName}\r\n// </p>\r\n// <div className=\"flex justify-between items-center mt-2\">\r\n// <span className={`font-medium ${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}`}>\r\n// Amount:\r\n// </span>\r\n// <span className=\"font-bold text-xl\">\r\n// ${formatAmount(payment.totalAmount || payment.amount)}\r\n// </span>\r\n// </div>\r\n// <div className=\"text-xs mt-1 text-right\">\r\n// <span className={`${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// Payment ID: {payment.id.slice(0, 8)}...\r\n// </span>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'select-currency' && (\r\n// <PaymentMethods \r\n// onSelect={handleCurrencySelect} \r\n// selected={selectedCurrency}\r\n// theme={theme}\r\n// />\r\n// )}\r\n\r\n// {step === 'confirm' && payment && (\r\n// <div>\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <h3 className={`text-lg font-medium mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Payment Details\r\n// </h3>\r\n// <div className=\"space-y-2\">\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Currency:</span>\r\n// <span className=\"font-medium\">{selectedCurrency}</span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Network:</span>\r\n// <span className=\"font-medium\">\r\n// {selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'Solana' : 'Ethereum'}\r\n// </span>\r\n// </div>\r\n// <div className=\"flex justify-between\">\r\n// <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Fee:</span>\r\n// <span className=\"font-medium\">1.75%</span>\r\n// </div>\r\n// </div>\r\n// </div>\r\n\r\n// {/* Payment Method Tabs */}\r\n// {!testMode && (\r\n// <div className=\"mb-4\">\r\n// <div className=\"flex border-b border-gray-200\">\r\n// <button\r\n// onClick={() => togglePaymentMethod('wallet')}\r\n// className={`${tabButtonClasses} ${paymentMethod === 'wallet' ? activeTabClasses : inactiveTabClasses}`}\r\n// >\r\n// Connect Wallet\r\n// </button>\r\n// <button\r\n// onClick={() => togglePaymentMethod('qrcode')}\r\n// className={`${tabButtonClasses} ${paymentMethod === 'qrcode' ? activeTabClasses : inactiveTabClasses}`}\r\n// >\r\n// QR Code\r\n// </button>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {testMode ? (\r\n// // Test mode payment option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <div className=\"bg-blue-500 rounded-full p-2 mr-3\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-white\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\r\n// </svg>\r\n// </div>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Test Mode Payment\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Click \"Pay Now\" to simulate a successful payment\r\n// </p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// ) : paymentMethod === 'qrcode' ? (\r\n// // QR Code payment option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <QRCode \r\n// walletAddress={payment.walletAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'} \r\n// amount={payment.totalAmount || payment.amount}\r\n// currency={selectedCurrency}\r\n// theme={theme}\r\n// />\r\n// </div>\r\n// ) : isMetaMaskAvailable ? (\r\n// // MetaMask available option\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <img \r\n// src=\"https://metamask.io/images/metamask-fox.svg\" \r\n// alt=\"MetaMask\" \r\n// className=\"w-8 h-8 mr-2\"\r\n// />\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// Pay with MetaMask\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// {walletConnected \r\n// ? \"Your wallet is connected. Click 'Pay Now' to proceed.\" \r\n// : \"Click 'Connect Wallet' to proceed with payment.\"\r\n// }\r\n// </p>\r\n// </div>\r\n// </div>\r\n// {!walletConnected && (\r\n// <button\r\n// onClick={onConnectWallet}\r\n// className={`mt-3 ${buttonPrimaryClasses}`}\r\n// >\r\n// Connect Wallet\r\n// </button>\r\n// )}\r\n// </div>\r\n// ) : (\r\n// // MetaMask not available warning\r\n// <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-yellow-900/20' : 'bg-yellow-50'}`}>\r\n// <div className=\"flex items-center\">\r\n// <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-yellow-500 mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n// <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\r\n// </svg>\r\n// <div>\r\n// <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// MetaMask Not Detected\r\n// </h3>\r\n// <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n// Please install MetaMask extension to make payments\r\n// </p>\r\n// </div>\r\n// </div>\r\n// <a\r\n// href=\"https://metamask.io/download/\"\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`block mt-3 text-center ${buttonPrimaryClasses}`}\r\n// >\r\n// Install MetaMask\r\n// </a>\r\n// </div>\r\n// )}\r\n\r\n// <div className=\"mt-6 grid grid-cols-2 gap-3\">\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={buttonSecondaryClasses}\r\n// >\r\n// Back\r\n// </button>\r\n// <button\r\n// type=\"button\"\r\n// onClick={handlePaymentConfirm}\r\n// className={buttonPrimaryClasses}\r\n// disabled={!testMode && paymentMethod === 'wallet' && isMetaMaskAvailable && !walletConnected}\r\n// >\r\n// Pay Now\r\n// </button>\r\n// </div>\r\n// </div>\r\n// )}\r\n\r\n// {step === 'processing' && (\r\n// <PaymentStatus \r\n// status=\"processing\" \r\n// theme={theme}\r\n// message=\"Processing your payment...\"\r\n// />\r\n// )}\r\n\r\n// {step === 'success' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"success\" \r\n// theme={theme}\r\n// message=\"Payment successful!\"\r\n// />\r\n// {transactionHash && (\r\n// <div className={`mt-4 p-3 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n// <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'} mb-1`}>\r\n// Transaction Hash:\r\n// </p>\r\n// <p className={`text-sm font-mono break-all ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n// {formatTransactionHash(transactionHash)}\r\n// </p>\r\n// {/* Optional: Add link to blockchain explorer */}\r\n// <a \r\n// href={`https://etherscan.io/tx/${transactionHash}`}\r\n// target=\"_blank\"\r\n// rel=\"noopener noreferrer\"\r\n// className={`text-xs ${theme === 'dark' ? 'text-blue-400' : 'text-blue-600'} mt-2 inline-block`}\r\n// >\r\n// View on Etherscan →\r\n// </a>\r\n// </div>\r\n// )}\r\n// </div>\r\n// )}\r\n\r\n// {step === 'error' && (\r\n// <div>\r\n// <PaymentStatus \r\n// status=\"error\" \r\n// theme={theme}\r\n// message={error || \"An error occurred while processing your payment.\"}\r\n// />\r\n// <button\r\n// type=\"button\"\r\n// onClick={handleBack}\r\n// className={`mt-4 ${buttonSecondaryClasses}`}\r\n// >\r\n// Try Again\r\n// </button>\r\n// </div>\r\n// )}\r\n// </div>\r\n\r\n// {/* Footer */}\r\n// <div className={`text-center text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n// <p>Powered by Coinley - Secure Cryptocurrency Payments</p>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// </div>\r\n// );\r\n// };\r\n\r\n// export default CoinleyModal;\r\n\r\n\r\n\r\n\r\n\r\n// src/components/CoinleyModal.jsx\r\nimport React, { useState, useEffect } from 'react';\r\nimport PaymentMethods from './PaymentMethods';\r\nimport PaymentStatus from './PaymentStatus';\r\nimport QRCode from './QRCode'; \r\nimport { isMetaMaskInstalled } from '../services/web3';\r\nimport Logo from '../assets/Logo.png';\r\n\r\n/**\r\n * Modal component for Coinley payments\r\n */\r\nconst CoinleyModal = ({\r\n isOpen,\r\n onClose,\r\n payment,\r\n paymentStatus,\r\n selectedCurrency,\r\n onCurrencySelect,\r\n onPayment,\r\n error,\r\n theme = 'light',\r\n merchantName,\r\n transactionHash,\r\n walletConnected,\r\n onConnectWallet,\r\n testMode = false\r\n}) => {\r\n // State\r\n const [step, setStep] = useState('select-currency');\r\n const [isMetaMaskAvailable, setIsMetaMaskAvailable] = useState(false);\r\n const [paymentMethod, setPaymentMethod] = useState('wallet');\r\n\r\n // Check if MetaMask is available\r\n useEffect(() => {\r\n if (typeof window !== 'undefined') {\r\n setIsMetaMaskAvailable(isMetaMaskInstalled());\r\n }\r\n }, []);\r\n\r\n // Update step based on payment status\r\n useEffect(() => {\r\n if (paymentStatus === 'loading') {\r\n setStep('processing');\r\n } else if (paymentStatus === 'success') {\r\n setStep('success');\r\n } else if (paymentStatus === 'error') {\r\n setStep('error');\r\n } else if (paymentStatus === 'idle' && payment) {\r\n setStep('select-currency');\r\n }\r\n }, [paymentStatus, payment]);\r\n\r\n // Function to handle currency selection\r\n const handleCurrencySelect = (currency) => {\r\n onCurrencySelect(currency);\r\n setStep('confirm');\r\n };\r\n\r\n // Function to handle payment confirmation\r\n const handlePaymentConfirm = () => {\r\n // Pass true if using QR code payment method\r\n onPayment(paymentMethod === 'qrcode');\r\n };\r\n\r\n // Function to go back to currency selection\r\n const handleBack = () => {\r\n if (step === 'confirm') {\r\n setStep('select-currency');\r\n }\r\n };\r\n\r\n // Function to close the modal\r\n const handleClose = () => {\r\n onClose();\r\n };\r\n\r\n // Format amount with 2 decimal places\r\n const formatAmount = (amount) => {\r\n return parseFloat(amount).toFixed(2);\r\n };\r\n\r\n // Format transaction hash for display\r\n const formatTransactionHash = (hash) => {\r\n if (!hash) return '';\r\n if (hash.length <= 14) return hash;\r\n return `${hash.slice(0, 8)}...${hash.slice(-6)}`;\r\n };\r\n\r\n // Toggle payment method\r\n const togglePaymentMethod = (method) => {\r\n setPaymentMethod(method);\r\n };\r\n\r\n // CSS Classes\r\n const modalBaseClasses = `fixed inset-0 z-50 overflow-y-auto ${theme === 'dark' ? 'bg-gray-900/75' : 'bg-black/50'}`;\r\n const modalContentClasses = `relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl ${theme === 'dark' ? 'bg-gray-800 text-white' : 'bg-white text-gray-800'}`;\r\n const headerClasses = `text-xl font-bold mb-4 ${theme === 'dark' ? 'text-white' : 'text-gray-900'}`;\r\n const buttonPrimaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n theme === 'dark' \r\n ? 'bg-blue-600 hover:bg-blue-700 text-white focus:ring-blue-500' \r\n : 'bg-blue-500 hover:bg-blue-600 text-white focus:ring-blue-500'\r\n }`;\r\n const buttonSecondaryClasses = `w-full py-2 px-4 rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 ${\r\n theme === 'dark'\r\n ? 'bg-gray-700 hover:bg-gray-600 text-white focus:ring-gray-500'\r\n : 'bg-gray-200 hover:bg-gray-300 text-gray-800 focus:ring-gray-500'\r\n }`;\r\n const tabButtonClasses = `py-2 px-4 text-sm font-medium focus:outline-none transition-colors`;\r\n const activeTabClasses = `${theme === 'dark' ? 'bg-gray-700 text-white' : 'bg-gray-100 text-gray-800'} rounded-t-md`;\r\n const inactiveTabClasses = `${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : 'text-gray-500 hover:text-gray-700'}`;\r\n\r\n if (!isOpen) return null;\r\n\r\n return (\r\n <div className={modalBaseClasses}>\r\n <div className=\"flex min-h-screen items-center justify-center p-4\">\r\n <div className={modalContentClasses}>\r\n {/* Header */}\r\n <div className=\"flex justify-between items-center mb-6\">\r\n <div className=\"flex items-center\">\r\n <img src={Logo} alt=\"Coinley Logo\" className=\"h-8 mr-2\" />\r\n <h2 className={headerClasses}>Coinley Pay</h2>\r\n </div>\r\n <button \r\n onClick={handleClose}\r\n className={`text-gray-500 hover:text-gray-700 focus:outline-none ${theme === 'dark' ? 'text-gray-400 hover:text-gray-300' : ''}`}\r\n >\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\r\n </svg>\r\n </button>\r\n </div>\r\n \r\n {/* Content */}\r\n <div className=\"mb-6\">\r\n {payment && (\r\n <div className={`mb-6 p-4 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n {merchantName}\r\n </p>\r\n <div className=\"flex justify-between items-center mt-2\">\r\n <span className={`font-medium ${theme === 'dark' ? 'text-gray-300' : 'text-gray-700'}`}>\r\n Amount:\r\n </span>\r\n <span className=\"font-bold text-xl\">\r\n ${formatAmount(payment.totalAmount || payment.amount)}\r\n </span>\r\n </div>\r\n <div className=\"text-xs mt-1 text-right\">\r\n <span className={`${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n Payment ID: {payment.id && payment.id.slice(0, 8)}...\r\n </span>\r\n </div>\r\n </div>\r\n )}\r\n\r\n {step === 'select-currency' && (\r\n <PaymentMethods \r\n onSelect={handleCurrencySelect} \r\n selected={selectedCurrency}\r\n theme={theme}\r\n />\r\n )}\r\n\r\n {step === 'confirm' && payment && (\r\n <div>\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <h3 className={`text-lg font-medium mb-2 ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Payment Details\r\n </h3>\r\n <div className=\"space-y-2\">\r\n <div className=\"flex justify-between\">\r\n <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Currency:</span>\r\n <span className=\"font-medium\">{selectedCurrency}</span>\r\n </div>\r\n <div className=\"flex justify-between\">\r\n <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Network:</span>\r\n <span className=\"font-medium\">\r\n {selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'Solana' : 'Ethereum'}\r\n </span>\r\n </div>\r\n <div className=\"flex justify-between\">\r\n <span className={theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}>Fee:</span>\r\n <span className=\"font-medium\">1.75%</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* Payment Method Tabs - Always visible */}\r\n <div className=\"mb-4\">\r\n <div className=\"flex border-b border-gray-200\">\r\n <button\r\n onClick={() => togglePaymentMethod('wallet')}\r\n className={`${tabButtonClasses} ${paymentMethod === 'wallet' ? activeTabClasses : inactiveTabClasses}`}\r\n >\r\n Connect Wallet\r\n </button>\r\n <button\r\n onClick={() => togglePaymentMethod('qrcode')}\r\n className={`${tabButtonClasses} ${paymentMethod === 'qrcode' ? activeTabClasses : inactiveTabClasses}`}\r\n >\r\n QR Code\r\n </button>\r\n </div>\r\n </div>\r\n\r\n {testMode ? (\r\n // Test mode payment option\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n <div className=\"flex items-center\">\r\n <div className=\"bg-blue-500 rounded-full p-2 mr-3\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-white\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\r\n </svg>\r\n </div>\r\n <div>\r\n <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Test Mode Payment\r\n </h3>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n Click \"Pay Now\" to simulate a successful payment\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n ) : paymentMethod === 'qrcode' ? (\r\n // QR Code payment option\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n <QRCode \r\n walletAddress={payment.walletAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'} \r\n amount={payment.totalAmount || payment.amount}\r\n currency={selectedCurrency}\r\n theme={theme}\r\n />\r\n </div>\r\n ) : isMetaMaskAvailable ? (\r\n // MetaMask available option\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-blue-900/20' : 'bg-blue-50'}`}>\r\n <div className=\"flex items-center\">\r\n <img \r\n src=\"https://metamask.io/images/metamask-fox.svg\" \r\n alt=\"MetaMask\" \r\n className=\"w-8 h-8 mr-2\"\r\n />\r\n <div>\r\n <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n Pay with MetaMask\r\n </h3>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n {walletConnected \r\n ? \"Your wallet is connected. Click 'Pay Now' to proceed.\" \r\n : \"Click 'Connect Wallet' to proceed with payment.\"\r\n }\r\n </p>\r\n </div>\r\n </div>\r\n {!walletConnected && (\r\n <button\r\n onClick={onConnectWallet}\r\n className={`mt-3 ${buttonPrimaryClasses}`}\r\n >\r\n Connect Wallet\r\n </button>\r\n )}\r\n </div>\r\n ) : (\r\n // MetaMask not available warning\r\n <div className={`p-4 rounded-lg mb-4 ${theme === 'dark' ? 'bg-yellow-900/20' : 'bg-yellow-50'}`}>\r\n <div className=\"flex items-center\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6 text-yellow-500 mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\r\n </svg>\r\n <div>\r\n <h3 className={`font-medium ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n MetaMask Not Detected\r\n </h3>\r\n <p className={`text-sm ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'}`}>\r\n Please install MetaMask extension to make payments\r\n </p>\r\n </div>\r\n </div>\r\n <a\r\n href=\"https://metamask.io/download/\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={`block mt-3 text-center ${buttonPrimaryClasses}`}\r\n >\r\n Install MetaMask\r\n </a>\r\n </div>\r\n )}\r\n\r\n <div className=\"mt-6 grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n onClick={handleBack}\r\n className={buttonSecondaryClasses}\r\n >\r\n Back\r\n </button>\r\n <button\r\n type=\"button\"\r\n onClick={handlePaymentConfirm}\r\n className={buttonPrimaryClasses}\r\n disabled={!testMode && paymentMethod === 'wallet' && isMetaMaskAvailable && !walletConnected}\r\n >\r\n Pay Now\r\n </button>\r\n </div>\r\n </div>\r\n )}\r\n\r\n {step === 'processing' && (\r\n <PaymentStatus \r\n status=\"processing\" \r\n theme={theme}\r\n message=\"Processing your payment...\"\r\n />\r\n )}\r\n\r\n {step === 'success' && (\r\n <div>\r\n <PaymentStatus \r\n status=\"success\" \r\n theme={theme}\r\n message=\"Payment successful!\"\r\n />\r\n {transactionHash && (\r\n <div className={`mt-4 p-3 rounded-lg ${theme === 'dark' ? 'bg-gray-700' : 'bg-gray-100'}`}>\r\n <p className={`text-xs ${theme === 'dark' ? 'text-gray-300' : 'text-gray-600'} mb-1`}>\r\n Transaction Hash:\r\n </p>\r\n <p className={`text-sm font-mono break-all ${theme === 'dark' ? 'text-white' : 'text-gray-800'}`}>\r\n {formatTransactionHash(transactionHash)}\r\n </p>\r\n <a \r\n href={`https://etherscan.io/tx/${transactionHash}`}\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={`text-xs ${theme === 'dark' ? 'text-blue-400' : 'text-blue-600'} mt-2 inline-block`}\r\n >\r\n View on Etherscan →\r\n </a>\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n\r\n {step === 'error' && (\r\n <div>\r\n <PaymentStatus \r\n status=\"error\" \r\n theme={theme}\r\n message={error || \"An error occurred while processing your payment.\"}\r\n />\r\n <button\r\n type=\"button\"\r\n onClick={handleBack}\r\n className={`mt-4 ${buttonSecondaryClasses}`}\r\n >\r\n Try Again\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n\r\n {/* Footer */}\r\n <div className={`text-center text-xs ${theme === 'dark' ? 'text-gray-400' : 'text-gray-500'}`}>\r\n <p>Powered by Coinley - Secure Cryptocurrency Payments</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default CoinleyModal;","// // src/components/CoinleyCheckout.jsx - Production Version\r\n// import React, { forwardRef, useImperativeHandle, useState, useEffect } from 'react';\r\n// import { useCoinley } from '../context/CoinleyContext';\r\n// import { useTheme } from '../context/ThemeContext';\r\n// import CoinleyModal from './CoinleyModal';\r\n// import { createPayment, processPayment } from '../services/api';\r\n// import { isMetaMaskInstalled, connectWallet, sendTransaction } from '../services/web3';\r\n\r\n// const CoinleyCheckout = forwardRef(({ \r\n// apiKey,\r\n// apiSecret,\r\n// apiUrl,\r\n// customerEmail,\r\n// merchantName = 'Merchant',\r\n// onSuccess,\r\n// onError,\r\n// onClose,\r\n// theme,\r\n// autoOpen = false,\r\n// debug = false,\r\n// testMode = false // Add testMode flag for development\r\n// }, ref) => {\r\n// const coinleyContext = useCoinley();\r\n// const { theme: contextTheme } = useTheme();\r\n \r\n// const [isOpen, setIsOpen] = useState(autoOpen);\r\n// const [payment, setPayment] = useState(null);\r\n// const [paymentStatus, setPaymentStatus] = useState('idle'); // idle, loading, success, error\r\n// const [selectedCurrency, setSelectedCurrency] = useState('USDT');\r\n// const [error, setError] = useState(null);\r\n// const [transactionHash, setTransactionHash] = useState(null);\r\n// const [walletConnected, setWalletConnected] = useState(false);\r\n \r\n// // Use the component props or fallback to context values\r\n// const effectiveApiKey = apiKey || coinleyContext?.apiKey;\r\n// const effectiveApiSecret = apiSecret || coinleyContext?.apiSecret;\r\n// const effectiveApiUrl = apiUrl || coinleyContext?.apiUrl;\r\n// const effectiveTheme = theme || contextTheme;\r\n// const effectiveDebug = debug || coinleyContext?.debug;\r\n\r\n// useImperativeHandle(ref, () => ({\r\n// open: (paymentDetails) => {\r\n// handleOpen(paymentDetails);\r\n// },\r\n// close: () => {\r\n// handleClose();\r\n// },\r\n// getPayment: () => payment\r\n// }));\r\n\r\n// const log = (message, data) => {\r\n// if (effectiveDebug) {\r\n// console.log(`[Coinley SDK] ${message}`, data);\r\n// }\r\n// };\r\n\r\n// // Check MetaMask connection on mount\r\n// useEffect(() => {\r\n// const checkWalletConnection = async () => {\r\n// if (isMetaMaskInstalled()) {\r\n// try {\r\n// const accounts = await window.ethereum.request({ method: 'eth_accounts' });\r\n// setWalletConnected(accounts && accounts.length > 0);\r\n// } catch (err) {\r\n// log('Error checking wallet connection:', err);\r\n// setWalletConnected(false);\r\n// }\r\n// } else {\r\n// setWalletConnected(false);\r\n// }\r\n// };\r\n\r\n// checkWalletConnection();\r\n// }, []);\r\n\r\n// // Handle MetaMask account changes\r\n// useEffect(() => {\r\n// const handleAccountsChanged = (accounts) => {\r\n// setWalletConnected(accounts.length > 0);\r\n// };\r\n\r\n// if (window.ethereum) {\r\n// window.ethereum.on('accountsChanged', handleAccountsChanged);\r\n// }\r\n\r\n// return () => {\r\n// if (window.ethereum) {\r\n// window.ethereum.removeListener('accountsChanged', handleAccountsChanged);\r\n// }\r\n// };\r\n// }, []);\r\n\r\n// const handleOpen = async (paymentDetails) => {\r\n// if (!paymentDetails || !paymentDetails.amount) {\r\n// setError('Payment amount is required');\r\n// if (onError) onError(new Error('Payment amount is required'));\r\n// return;\r\n// }\r\n\r\n// setPaymentStatus('loading');\r\n// setIsOpen(true);\r\n\r\n// try {\r\n// log('Creating payment with details:', paymentDetails);\r\n \r\n// // Create a payment on the Coinley backend\r\n// const paymentResponse = await createPayment({\r\n// amount: paymentDetails.amount,\r\n// currency: paymentDetails.currency || 'USDT',\r\n// customerEmail: paymentDetails.customerEmail || customerEmail,\r\n// callbackUrl: paymentDetails.callbackUrl,\r\n// metadata: paymentDetails.metadata || {}\r\n// });\r\n\r\n// log('Payment created:', paymentResponse);\r\n \r\n// setPayment(paymentResponse.payment);\r\n// setPaymentStatus('idle');\r\n// setError(null);\r\n// } catch (err) {\r\n// log('Error creating payment:', err);\r\n// setError(err.message || 'Failed to create payment');\r\n// setPaymentStatus('error');\r\n// if (onError) onError(err);\r\n// }\r\n// };\r\n\r\n// const handleClose = () => {\r\n// setIsOpen(false);\r\n// setTransactionHash(null);\r\n// if (onClose) onClose();\r\n// };\r\n\r\n// const handlePaymentMethodSelect = (currency) => {\r\n// log('Currency selected:', currency);\r\n// setSelectedCurrency(currency);\r\n// };\r\n\r\n// const connectToWallet = async () => {\r\n// if (!isMetaMaskInstalled()) {\r\n// setError('MetaMask is not installed. Please install MetaMask to make payments.');\r\n// return false;\r\n// }\r\n\r\n// try {\r\n// const accounts = await connectWallet();\r\n// setWalletConnected(accounts.length > 0);\r\n// return accounts.length > 0;\r\n// } catch (err) {\r\n// log('Error connecting to wallet:', err);\r\n// setError(err.message || 'Failed to connect to wallet');\r\n// return false;\r\n// }\r\n// };\r\n\r\n// const handlePayment = async () => {\r\n// if (!payment) {\r\n// setError('No active payment to process');\r\n// return;\r\n// }\r\n\r\n// log('Starting payment process...');\r\n// setPaymentStatus('loading');\r\n// setTransactionHash(null);\r\n\r\n// try {\r\n// log('Processing payment:', { paymentId: payment.id, currency: selectedCurrency });\r\n \r\n// let txHash;\r\n\r\n// // Check if we're in test mode or need a real wallet transaction\r\n// if (testMode) {\r\n// // Simulate transaction for testing\r\n// log('Test mode: Generating mock transaction...');\r\n// txHash = `0x${Array.from({length: 64}, () => \r\n// Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n// } else {\r\n// // Real payment flow\r\n// // 1. Ensure wallet is connected\r\n// if (!walletConnected) {\r\n// const connected = await connectToWallet();\r\n// if (!connected) {\r\n// throw new Error('Please connect your wallet to proceed with payment');\r\n// }\r\n// }\r\n\r\n// // 2. Get merchant address from payment\r\n// const merchantAddress = payment.merchantAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'; // Fallback for testing\r\n \r\n// // 3. Create transaction parameters\r\n// const txParams = {\r\n// from: await window.ethereum.request({ method: 'eth_requestAccounts' }).then(accounts => accounts[0]),\r\n// to: merchantAddress,\r\n// value: '0x0', // For ERC-20 tokens, value is 0\r\n// data: '0x', // Would include token transfer data for ERC-20\r\n// };\r\n\r\n// // 4. Send transaction through MetaMask\r\n// log('Sending transaction to wallet for approval...');\r\n// txHash = await sendTransaction(txParams);\r\n// }\r\n\r\n// log('Transaction hash:', txHash);\r\n// setTransactionHash(txHash);\r\n\r\n// // Process the payment on the Coinley backend\r\n// log('Sending process payment request to API...');\r\n// const processResponse = await processPayment({\r\n// paymentId: payment.id,\r\n// transactionHash: txHash,\r\n// network: 'ethereum' // Or determine based on selected currency\r\n// });\r\n\r\n// log('Payment processed successfully:', processResponse);\r\n\r\n// setPaymentStatus('success');\r\n \r\n// // Call the onSuccess callback with transaction details\r\n// if (onSuccess) {\r\n// log('Calling onSuccess callback...');\r\n// onSuccess(payment.id, txHash);\r\n// }\r\n\r\n// // Close the modal after a delay if auto-close is desired\r\n// // setTimeout(() => {\r\n// // log('Auto-closing modal after success...');\r\n// // handleClose();\r\n// // }, 5000);\r\n\r\n// } catch (err) {\r\n// log('Payment error:', err);\r\n// setError(err.message || 'Failed to process payment');\r\n// setPaymentStatus('error');\r\n// if (onError) onError(err);\r\n// }\r\n// };\r\n\r\n// // Open modal if autoOpen is true and we have a payment\r\n// useEffect(() => {\r\n// if (autoOpen && payment) {\r\n// setIsOpen(true);\r\n// }\r\n// }, [autoOpen, payment]);\r\n\r\n// return (\r\n// <>\r\n// {isOpen && (\r\n// <CoinleyModal\r\n// isOpen={isOpen}\r\n// onClose={handleClose}\r\n// payment={payment}\r\n// paymentStatus={paymentStatus}\r\n// selectedCurrency={selectedCurrency}\r\n// onCurrencySelect={handlePaymentMethodSelect}\r\n// onPayment={handlePayment}\r\n// error={error}\r\n// theme={effectiveTheme}\r\n// merchantName={merchantName}\r\n// transactionHash={transactionHash}\r\n// walletConnected={walletConnected}\r\n// onConnectWallet={connectToWallet}\r\n// testMode={testMode}\r\n// />\r\n// )}\r\n// </>\r\n// );\r\n// });\r\n\r\n// CoinleyCheckout.displayName = 'CoinleyCheckout';\r\n\r\n// export default CoinleyCheckout;\r\n\r\n\r\n\r\n\r\n\r\n// src/components/CoinleyCheckout.jsx\r\nimport React, { forwardRef, useImperativeHandle, useState, useEffect } from 'react';\r\nimport { useCoinley } from '../context/CoinleyContext';\r\nimport { useTheme } from '../context/ThemeContext';\r\nimport CoinleyModal from './CoinleyModal';\r\nimport { createPayment, processPayment } from '../services/api';\r\nimport { isMetaMaskInstalled, connectWallet, sendTransaction } from '../services/web3';\r\n\r\n/**\r\n * Main Coinley checkout component - exposed as a forwardRef\r\n */\r\nconst CoinleyCheckout = forwardRef(({ \r\n apiKey,\r\n apiSecret,\r\n apiUrl,\r\n customerEmail,\r\n merchantName = 'Merchant',\r\n onSuccess,\r\n onError,\r\n onClose,\r\n theme,\r\n autoOpen = false,\r\n debug = false,\r\n testMode = false\r\n}, ref) => {\r\n // Context\r\n const coinleyContext = useCoinley();\r\n const { theme: contextTheme } = useTheme();\r\n \r\n // State\r\n const [isOpen, setIsOpen] = useState(autoOpen);\r\n const [payment, setPayment] = useState(null);\r\n const [paymentStatus, setPaymentStatus] = useState('idle');\r\n const [selectedCurrency, setSelectedCurrency] = useState('USDT');\r\n const [error, setError] = useState(null);\r\n const [transactionHash, setTransactionHash] = useState(null);\r\n const [walletConnected, setWalletConnected] = useState(false);\r\n \r\n // Use the component props or fallback to context values\r\n const effectiveApiKey = apiKey || coinleyContext?.apiKey;\r\n const effectiveApiSecret = apiSecret || coinleyContext?.apiSecret;\r\n const effectiveApiUrl = apiUrl || coinleyContext?.apiUrl;\r\n const effectiveTheme = theme || contextTheme;\r\n const effectiveDebug = debug || coinleyContext?.debug;\r\n\r\n // Expose methods via ref\r\n useImperativeHandle(ref, () => ({\r\n open: (paymentDetails) => {\r\n handleOpen(paymentDetails);\r\n },\r\n close: () => {\r\n handleClose();\r\n },\r\n getPayment: () => payment\r\n }));\r\n\r\n // Debug logging helper\r\n const log = (message, data) => {\r\n if (effectiveDebug) {\r\n console.log(`[Coinley SDK] ${message}`, data);\r\n }\r\n };\r\n\r\n // Check MetaMask connection on mount\r\n useEffect(() => {\r\n if (typeof window !== 'undefined') {\r\n const checkWalletConnection = async () => {\r\n if (isMetaMaskInstalled()) {\r\n try {\r\n const accounts = await window.ethereum.request({ method: 'eth_accounts' });\r\n setWalletConnected(accounts && accounts.length > 0);\r\n } catch (err) {\r\n log('Error checking wallet connection:', err);\r\n setWalletConnected(false);\r\n }\r\n } else {\r\n setWalletConnected(false);\r\n }\r\n };\r\n \r\n checkWalletConnection();\r\n }\r\n }, [effectiveDebug]);\r\n\r\n // Handle MetaMask account changes\r\n useEffect(() => {\r\n if (typeof window !== 'undefined' && window.ethereum) {\r\n const handleAccountsChanged = (accounts) => {\r\n setWalletConnected(accounts.length > 0);\r\n };\r\n\r\n window.ethereum.on('accountsChanged', handleAccountsChanged);\r\n\r\n return () => {\r\n window.ethereum.removeListener('accountsChanged', handleAccountsChanged);\r\n };\r\n }\r\n \r\n return () => {}; // Empty cleanup for non-browser environments\r\n }, []);\r\n\r\n // Handle opening the payment modal\r\n const handleOpen = async (paymentDetails) => {\r\n if (!paymentDetails || !paymentDetails.amount) {\r\n setError('Payment amount is required');\r\n if (onError) onError(new Error('Payment amount is required'));\r\n return;\r\n }\r\n\r\n setPaymentStatus('loading');\r\n setIsOpen(true);\r\n\r\n try {\r\n log('Creating payment with details:', paymentDetails);\r\n \r\n // Create a payment on the Coinley backend\r\n const paymentResponse = await createPayment({\r\n amount: paymentDetails.amount,\r\n currency: paymentDetails.currency || 'USDT',\r\n customerEmail: paymentDetails.customerEmail || customerEmail,\r\n callbackUrl: paymentDetails.callbackUrl,\r\n metadata: paymentDetails.metadata || {}\r\n });\r\n\r\n log('Payment created:', paymentResponse);\r\n \r\n setPayment(paymentResponse.payment);\r\n setPaymentStatus('idle');\r\n setError(null);\r\n \r\n log('Payment created and state updated:', {\r\n payment: paymentResponse.payment,\r\n status: 'idle'\r\n });\r\n } catch (err) {\r\n log('Error creating payment:', err);\r\n setError(err.message || 'Failed to create payment');\r\n setPaymentStatus('error');\r\n if (onError) onError(err);\r\n }\r\n };\r\n\r\n // Handle closing the modal\r\n const handleClose = () => {\r\n setIsOpen(false);\r\n setTransactionHash(null);\r\n if (onClose) onClose();\r\n };\r\n\r\n // Handle currency selection\r\n const handlePaymentMethodSelect = (currency) => {\r\n log('Currency selected:', currency);\r\n setSelectedCurrency(currency);\r\n };\r\n\r\n // Handle wallet connection\r\n const connectToWallet = async () => {\r\n if (!isMetaMaskInstalled()) {\r\n setError('MetaMask is not installed. Please install MetaMask to make payments.');\r\n return false;\r\n }\r\n\r\n try {\r\n const accounts = await connectWallet();\r\n setWalletConnected(accounts.length > 0);\r\n return accounts.length > 0;\r\n } catch (err) {\r\n log('Error connecting to wallet:', err);\r\n setError(err.message || 'Failed to connect to wallet');\r\n return false;\r\n }\r\n };\r\n\r\n // Handle payment submission\r\n const handlePayment = async (isQrCodeMode = false) => {\r\n if (!payment) {\r\n setError('No active payment to process');\r\n return;\r\n }\r\n\r\n log('Starting payment process...', { isQrCodeMode });\r\n setPaymentStatus('loading');\r\n setTransactionHash(null);\r\n\r\n try {\r\n log('Processing payment:', { paymentId: payment.id, currency: selectedCurrency, isQrCodeMode });\r\n \r\n let txHash;\r\n\r\n // Different payment flows based on mode\r\n if (testMode) {\r\n // Test mode: Just generate a mock hash\r\n log('Test mode: Generating mock transaction...');\r\n txHash = `0x${Array.from({length: 64}, () => \r\n Math.floor(Math.random() * 16).toString(16)).join('')}`;\r\n } else if (isQrCodeMode) {\r\n // QR code mode: User manually confirms payment\r\n log('QR code payment: User confirms payment was sent');\r\n txHash = `qrcode_${Date.now().toString(16)}_${Math.random().toString(16).substring(2, 10)}`;\r\n } else {\r\n // Wallet payment flow\r\n if (!walletConnected) {\r\n const connected = await connectToWallet();\r\n if (!connected) {\r\n throw new Error('Please connect your wallet to proceed with payment');\r\n }\r\n }\r\n\r\n // Get merchant address from payment or use fallback\r\n const merchantAddress = payment.walletAddress || '0x742d35Cc6634C0532925a3b844Bc454e4438f44e';\r\n \r\n // Create transaction parameters\r\n const txParams = {\r\n from: await window.ethereum.request({ method: 'eth_requestAccounts' }).then(accounts => accounts[0]),\r\n to: merchantAddress,\r\n value: '0x0', // For ERC-20 tokens, value is 0\r\n data: '0x', // Would include token transfer data for ERC-20\r\n };\r\n\r\n // Send transaction through MetaMask\r\n log('Sending transaction to wallet for approval...');\r\n txHash = await sendTransaction(txParams);\r\n }\r\n\r\n log('Transaction hash:', txHash);\r\n setTransactionHash(txHash);\r\n\r\n // Process the payment on the Coinley backend\r\n log('Sending process payment request to API...');\r\n const processResponse = await processPayment({\r\n paymentId: payment.id,\r\n transactionHash: txHash,\r\n network: selectedCurrency === 'SOL' || selectedCurrency === 'USDC_SOL' ? 'solana' : 'ethereum'\r\n });\r\n\r\n log('Payment processed successfully:', processResponse);\r\n\r\n setPaymentStatus('success');\r\n \r\n // Call the onSuccess callback with transaction details\r\n if (onSuccess) {\r\n log('Calling onSuccess callback...');\r\n onSuccess(payment.id, txHash);\r\n }\r\n\r\n } catch (err) {\r\n log('Payment error:', err);\r\n setError(err.message || 'Failed to process payment');\r\n setPaymentStatus('error');\r\n if (onError) onError(err);\r\n }\r\n };\r\n\r\n // Auto-open modal if specified\r\n useEffect(() => {\r\n if (autoOpen && payment) {\r\n setIsOpen(true);\r\n }\r\n }, [autoOpen, payment]);\r\n\r\n return (\r\n <>\r\n {isOpen && (\r\n <CoinleyModal\r\n isOpen={isOpen}\r\n onClose={handleClose}\r\n payment={payment}\r\n paymentStatus={paymentStatus}\r\n selectedCurrency={selectedCurrency}\r\n onCurrencySelect={handlePaymentMethodSelect}\r\n onPayment={handlePayment}\r\n error={error}\r\n theme={effectiveTheme}\r\n merchantName={merchantName}\r\n transactionHash={transactionHash}\r\n walletConnected={walletConnected}\r\n onConnectWallet={connectToWallet}\r\n testMode={testMode}\r\n />\r\n )}\r\n </>\r\n );\r\n});\r\n\r\n// Add display name for better debugging\r\nCoinleyCheckout.displayName = 'CoinleyCheckout';\r\n\r\nexport default CoinleyCheckout;","// // src/index.js - Production Version\r\n// import { ThemeProvider } from './context/ThemeContext';\r\n// import { CoinleyProvider } from './context/CoinleyContext';\r\n// import CoinleyCheckout from './components/CoinleyCheckout';\r\n// import CoinleyModal from './components/CoinleyModal';\r\n// import './styles.css';\r\n\r\n// // Export primary components\r\n// export {\r\n// ThemeProvider,\r\n// CoinleyProvider,\r\n// CoinleyCheckout,\r\n// CoinleyModal\r\n// };\r\n\r\n// // Export API utilities\r\n// export {\r\n// createPayment,\r\n// getPayment,\r\n// processPayment,\r\n// getMerchantPayments,\r\n// getMerchantPaymentStats,\r\n// getSupportedCurrencies\r\n// } from './services/api';\r\n\r\n// // Export Web3 utilities\r\n// export {\r\n// isMetaMaskInstalled,\r\n// connectWallet,\r\n// getAccounts,\r\n// getChainId,\r\n// sendTransaction,\r\n// sendToken,\r\n// isWalletConnected,\r\n// getNetworkName,\r\n// getTokenBalance,\r\n// TOKEN_ADDRESSES\r\n// } from './services/web3';\r\n\r\n// // Default configuration\r\n// export const DEFAULT_CONFIG = {\r\n// apiUrl: 'https://coinleyserver-production.up.railway.app\"',\r\n// debug: false,\r\n// testMode: false,\r\n// theme: 'light'\r\n// };\r\n\r\n// // Version info\r\n// export const VERSION = '1.0.0';\r\n\r\n\r\n\r\n// src/index.js\r\n// First import styles to ensure they're included\r\nimport './styles.css';\r\n\r\n// Import context providers\r\nimport { ThemeProvider } from './context/ThemeContext';\r\nimport { CoinleyProvider } from './context/CoinleyContext';\r\n\r\n// Import components individually to avoid circular dependencies\r\nimport QRCode from './components/QRCode';\r\nimport PaymentStatus from './components/PaymentStatus';\r\nimport PaymentMethods from './components/PaymentMethods';\r\nimport CoinleyModal from './components/CoinleyModal';\r\nimport CoinleyCheckout from './components/CoinleyCheckout';\r\n\r\n// Import API utilities\r\nimport {\r\n createPayment,\r\n getPayment,\r\n processPayment,\r\n getMerchantPayments,\r\n getMerchantPaymentStats,\r\n getSupportedCurrencies\r\n} from './services/api';\r\n\r\n// Import Web3 utilities\r\nimport {\r\n isMetaMaskInstalled,\r\n connectWallet,\r\n getAccounts,\r\n getChainId,\r\n sendTransaction,\r\n sendToken,\r\n isWalletConnected,\r\n getNetworkName,\r\n getTokenBalance,\r\n TOKEN_ADDRESSES\r\n} from './services/web3';\r\n\r\n// Export public components and utilities\r\nexport {\r\n // Providers\r\n ThemeProvider,\r\n CoinleyProvider,\r\n \r\n // Main components\r\n CoinleyCheckout,\r\n CoinleyModal,\r\n \r\n // UI components\r\n QRCode,\r\n PaymentStatus,\r\n PaymentMethods,\r\n \r\n // API utilities\r\n createPayment,\r\n getPayment,\r\n processPayment,\r\n getMerchantPayments,\r\n getMerchantPaymentStats,\r\n getSupportedCurrencies,\r\n \r\n // Web3 utilities\r\n isMetaMaskInstalled,\r\n connectWallet,\r\n getAccounts,\r\n getChainId,\r\n sendTransaction,\r\n sendToken,\r\n isWalletConnected,\r\n getNetworkName,\r\n getTokenBalance,\r\n TOKEN_ADDRESSES\r\n};\r\n\r\n// Default configuration\r\nexport const DEFAULT_CONFIG = {\r\n apiUrl: 'https://coinleyserver-production.up.railway.app',\r\n debug: false,\r\n testMode: false,\r\n theme: 'light'\r\n};\r\n\r\n// Version info\r\nexport const VERSION = '1.0.6'; // Update version to reflect QR code feature addition"],"names":["ReactDebugCurrentFrame","self","jsxRuntimeModule","require$$0","require$$1","createContext","useContext","useState","useEffect","jsx","jsxs","forwardRef","useImperativeHandle"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASa,QAAI,IAAE,YAAiB,IAAE,OAAO,IAAI,eAAe,GAAE,IAAE,OAAO,IAAI,gBAAgB,GAAE,IAAE,OAAO,UAAU,gBAAe,IAAE,EAAE,mDAAmD,mBAAkB,IAAE,EAAC,KAAI,MAAG,KAAI,MAAG,QAAO,MAAG,UAAS,KAAE;AAClP,aAAS,EAAE,GAAE,GAAE,GAAE;AAAC,UAAI,GAAE,IAAE,IAAG,IAAE,MAAK,IAAE;AAAK,iBAAS,MAAI,IAAE,KAAG;AAAG,iBAAS,E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