@smartcomply/web-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## React Compiler
11
+
12
+ The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
+
14
+ ## Expanding the ESLint configuration
15
+
16
+ If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
17
+
18
+ ```js
19
+ export default defineConfig([
20
+ globalIgnores(['dist']),
21
+ {
22
+ files: ['**/*.{ts,tsx}'],
23
+ extends: [
24
+ // Other configs...
25
+
26
+ // Remove tseslint.configs.recommended and replace with this
27
+ tseslint.configs.recommendedTypeChecked,
28
+ // Alternatively, use this for stricter rules
29
+ tseslint.configs.strictTypeChecked,
30
+ // Optionally, add this for stylistic rules
31
+ tseslint.configs.stylisticTypeChecked,
32
+
33
+ // Other configs...
34
+ ],
35
+ languageOptions: {
36
+ parserOptions: {
37
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
+ tsconfigRootDir: import.meta.dirname,
39
+ },
40
+ // other options...
41
+ },
42
+ },
43
+ ])
44
+ ```
45
+
46
+ You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
+
48
+ ```js
49
+ // eslint.config.js
50
+ import reactX from 'eslint-plugin-react-x'
51
+ import reactDom from 'eslint-plugin-react-dom'
52
+
53
+ export default defineConfig([
54
+ globalIgnores(['dist']),
55
+ {
56
+ files: ['**/*.{ts,tsx}'],
57
+ extends: [
58
+ // Other configs...
59
+ // Enable lint rules for React
60
+ reactX.configs['recommended-typescript'],
61
+ // Enable lint rules for React DOM
62
+ reactDom.configs.recommended,
63
+ ],
64
+ languageOptions: {
65
+ parserOptions: {
66
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
+ tsconfigRootDir: import.meta.dirname,
68
+ },
69
+ // other options...
70
+ },
71
+ },
72
+ ])
73
+ ```
package/dist/index.cjs ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";var bt=Object.create;var oe=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var kt=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty;var Et=(t,e,r)=>e in t?oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Tt=(t,e)=>{for(var r in e)oe(t,r,{get:e[r],enumerable:!0})},Pe=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of xt(e))!Ft.call(t,s)&&s!==r&&oe(t,s,{get:()=>e[s],enumerable:!(o=wt(e,s))||o.enumerable});return t};var W=(t,e,r)=>(r=t!=null?bt(kt(t)):{},Pe(e||!t||!t.__esModule?oe(r,"default",{value:t,enumerable:!0}):r,t)),St=t=>Pe(oe({},"__esModule",{value:!0}),t);var I=(t,e,r)=>Et(t,typeof e!="symbol"?e+"":e,r);var Bt={};Tt(Bt,{SmartComply:()=>J,default:()=>zt});module.exports=St(Bt);var nt=require("react-dom/client");function be(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}be(`/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-gray-50: #F8FAFC;--color-gray-100: #F1F5F9;--color-gray-200: #E2E8F0;--color-gray-300: #CBD5E1;--color-gray-400: #94A3B8;--color-gray-500: #64748B;--color-gray-600: #475569;--color-gray-700: #334155;--color-gray-800: #A3AED0;--color-white: #FFFFFF;--spacing: .25rem;--container-md: 28rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--radius-lg: .5rem;--radius-xl: .75rem;--radius-3xl: 1.5rem;--shadow-2xl: var(--shadow-2xl);--ease-out: cubic-bezier(0, 0, .2, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--animate-spin: spin 1s linear infinite;--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono);--shadow-boxy: var(--shadow-boxy);--shadow-subtle: var(--shadow-subtle);--shadow-subtle2: var(--shadow-subtle2);--shadow-3xl: 0px 12px 24px 0px #4750760A;--color-background: var(--background);--color-foreground: var(--foreground);--color-accent: var(--accent);--color-accent-foreground: var(--accent-foreground);--color-popover: var(--popover);--color-popover-foreground: var(--popover-foreground);--color-border: var(--border);--color-input-bg: var(--input-bg);--color-input-foreground: var(--input-foreground);--color-label: var(--label);--color-card: var(--card);--color-ring: var(--ring);--color-placeholder: var(--placeholder);--color-caption: var(--caption);--color-disabled: var(--disabled);--color-caption-error: var(--accent-foreground);--color-menu-bg: var(--menu-bg);--color-tooltip-bg: var(--tooltip-bg);--color-error-6: #F43F5E;--color-primary-10: #011947;--color-primary-20: #002C72;--color-primary-30: #1D438F;--color-primary-40: #395BA9;--color-primary-60: #6E8EDF;--color-primary-80: #B1C5FF;--color-primary-95: #EEF0FF;--color-primary-100: #304499;--color-secondary-5: #FFC87F}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-6{bottom:calc(var(--spacing) * 6)}.z-1{z-index:1}.z-10{z-index:10}.container{width:100%;@media(width>=40rem){max-width:40rem}@media(width>=48rem){max-width:48rem}@media(width>=64rem){max-width:64rem}@media(width>=80rem){max-width:80rem}@media(width>=96rem){max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-block{display:inline-block}.aspect-\\[3\\/4\\]{aspect-ratio:3/4}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-30{width:calc(var(--spacing) * 30);height:calc(var(--spacing) * 30)}.size-44{width:calc(var(--spacing) * 44);height:calc(var(--spacing) * 44)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-12{height:calc(var(--spacing) * 12)}.h-\\[80\\%\\]{height:80%}.h-\\[90\\%\\]{height:90%}.h-\\[400px\\]{height:400px}.h-full{height:100%}.max-h-60{max-height:calc(var(--spacing) * 60)}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing) * 4)}.w-12{width:calc(var(--spacing) * 12)}.w-\\[35\\%\\]{width:35%}.w-\\[80\\%\\]{width:80%}.w-full{width:100%}.max-w-\\[55\\%\\]{max-width:55%}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-\\[500px\\]{max-width:500px}.max-w-md{max-width:var(--container-md)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.rotate-180{rotate:180deg}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-3{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-4{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-5{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-6{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-full{border-radius:calc(infinity * 1px)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-\\[\\#CBD5E1\\]{border-color:#cbd5e1}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-\\[\\#262A2F\\]{background-color:#262a2f}.bg-\\[\\#F8F8F8\\]{background-color:#f8f8f8}.bg-\\[rgba\\(0\\,0\\,0\\,0\\.6\\)\\]{background-color:#0009}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-secondary-5{background-color:var(--color-secondary-5)}.bg-white{background-color:var(--color-white)}.stroke-\\[\\#62DF98\\]{stroke:#62df98}.stroke-error-6\\/60{stroke:color-mix(in srgb,#F43F5E 60%,transparent);@supports (color: color-mix(in lab,red,red)){stroke:color-mix(in oklab,var(--color-error-6) 60%,transparent)}}.stroke-white\\/50{stroke:color-mix(in srgb,#FFFFFF 50%,transparent);@supports (color: color-mix(in lab,red,red)){stroke:color-mix(in oklab,var(--color-white) 50%,transparent)}}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:calc(var(--spacing) * 2)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-24\\!{padding-block:calc(var(--spacing) * 24)!important}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.font-\\[monospace\\]{font-family:monospace}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\\[14px\\]{font-size:14px}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-all{word-break:break-all}.text-error-6{color:var(--color-error-6)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-500{--tw-duration: .5s;transition-duration:.5s}.ease-in-out{--tw-ease: var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease: var(--ease-out);transition-timing-function:var(--ease-out)}.hover\\:rounded-3xl{&:hover{@media(hover:hover){border-radius:var(--radius-3xl)}}}.hover\\:border-gray-100{&:hover{@media(hover:hover){border-color:var(--color-gray-100)}}}.hover\\:border-gray-400{&:hover{@media(hover:hover){border-color:var(--color-gray-400)}}}.hover\\:\\!bg-transparent{&:hover{@media(hover:hover){background-color:transparent!important}}}.focus\\:border-\\[\\#E8EAF6\\]{&:focus{border-color:#e8eaf6}}.focus\\:border-\\[\\#E8F5E9\\]{&:focus{border-color:#e8f5e9}}.focus\\:border-\\[\\#FFF8E1\\]{&:focus{border-color:#fff8e1}}.focus\\:ring-2{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:ring-\\[\\#E8EAF6\\]{&:focus{--tw-ring-color: #E8EAF6}}.focus\\:ring-\\[\\#E8F5E9\\]{&:focus{--tw-ring-color: #E8F5E9}}.focus\\:ring-\\[\\#FFF8E1\\]{&:focus{--tw-ring-color: #FFF8E1}}.focus\\:outline-none{&:focus{--tw-outline-style: none;outline-style:none}}.disabled\\:opacity-50{&:disabled{opacity:50%}}.max-\\[450px\\]\\:\\!w-\\[calc\\(100vw_-_2rem\\)\\]{@media(width<450px){width:calc(100vw - 2rem)!important}}.max-sm\\:w-\\[80vw\\]{@media(width<40rem){width:80vw}}.sm\\:px-\\[6\\%\\]{@media(width>=40rem){padding-inline:6%}}.md\\:right-8{@media(width>=48rem){right:calc(var(--spacing) * 8)}}.md\\:bottom-6{@media(width>=48rem){bottom:calc(var(--spacing) * 6)}}.md\\:flex{@media(width>=48rem){display:flex}}.md\\:justify-between{@media(width>=48rem){justify-content:space-between}}.md\\:justify-start{@media(width>=48rem){justify-content:flex-start}}.md\\:bg-transparent\\!{@media(width>=48rem){background-color:transparent!important}}.md\\:px-10{@media(width>=48rem){padding-inline:calc(var(--spacing) * 10)}}.md\\:text-xl{@media(width>=48rem){font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}}.\\[\\&_li\\]\\:hover\\:bg-transparent\\!{& li{&:hover{@media(hover:hover){background-color:transparent!important}}}}}@font-face{font-family:Lexend;src:url(./assets/fonts/Lexend-Regular.ttf)}@font-face{font-family:LexendMedium;src:url(./assets/fonts/Lexend-Medium.ttf)}@font-face{font-family:LexendSemibold;src:url(./assets/fonts/Lexend-SemiBold.ttf)}@font-face{font-family:LexendBold;src:url(./assets/fonts/Lexend-Bold.ttf)}:root{font-family:Lexend,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--background: #f8fafc;--foreground: #334155;--primary: #202d66;--primary-foreground: #ffffff;--input-bg: #ffffff;--input-foreground: #475569;--label: #475569;--placeholder: #94a3b8;--caption: #64748b;--caption-error: #f43f5e;--disabled: #f1f5f9;--card: #ffffff;--card-foreground: oklch(.985 0 0);--popover: #ffffff;--popover-foreground: #475569;--menu-bg: #f1f5f9;--accent: #e9eeff;--accent-foreground: #4d61b0;--secondary: #1e293b;--secondary-foreground: 0 0% 100%;--muted: #64748b;--muted-foreground: #94a3b8;--border: #e2e8f0;--ring: #4d61b0;--destructive: #f43f5e;--destructive-foreground: #cc135f;--tooltip-bg: #212529;--shadow-boxy: 0px 1px 2px 0px #0a0d120d;--shadow-subtle: 0px 11.76px 22.06px 0px #00000014;--shadow-subtle2: 0px 4px 8px 0px #9898980a;--shadow-2xl: 0px 24px 48px -12px #0a0d122e;--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08)}@layer utilities{.bg-background{background-color:var(--color-background)}.bg-foreground{background-color:var(--color-foreground)}.bg-accent{background-color:var(--color-accent)}.bg-accent-foreground{background-color:var(--color-accent-foreground)}.bg-popover{background-color:var(--color-popover)}.bg-popover-foreground{background-color:var(--color-popover-foreground)}.bg-border{background-color:var(--color-border)}.bg-input-bg{background-color:var(--color-input-bg)}.bg-input-foreground{background-color:var(--color-input-foreground)}.bg-label{background-color:var(--color-label)}.bg-card{background-color:var(--color-card)}.bg-ring{background-color:var(--color-ring)}.bg-placeholder{background-color:var(--color-placeholder)}.bg-caption{background-color:var(--color-caption)}.bg-disabled{background-color:var(--color-disabled)}.bg-caption-error{background-color:var(--color-caption-error)}.bg-menu-bg{background-color:var(--color-menu-bg)}.bg-tooltip-bg{background-color:var(--color-tooltip-bg)}.text-background{color:var(--color-background)}.text-foreground{color:var(--color-foreground)}.text-accent{color:var(--color-accent)}.text-accent-foreground{color:var(--color-accent-foreground)}.text-popover{color:var(--color-popover)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-border{color:var(--color-border)}.text-input-bg{color:var(--color-input-bg)}.text-input-foreground{color:var(--color-input-foreground)}.text-label{color:var(--color-label)}.text-card{color:var(--color-card)}.text-ring{color:var(--color-ring)}.text-placeholder{color:var(--color-placeholder)}.text-caption{color:var(--color-caption)}.text-disabled{color:var(--color-disabled)}.text-caption-error{color:var(--color-caption-error)}.text-menu-bg{color:var(--color-menu-bg)}.text-tooltip-bg{color:var(--color-tooltip-bg)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-800{background-color:var(--color-gray-800)}.text-gray-50{color:var(--color-gray-50)}.text-gray-100{color:var(--color-gray-100)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.bg-primary-10{background-color:var(--color-primary-10)}.bg-primary-20{background-color:var(--color-primary-20)}.bg-primary-30{background-color:var(--color-primary-30)}.bg-primary-40{background-color:var(--color-primary-40)}.bg-primary-60{background-color:var(--color-primary-60)}.bg-primary-80{background-color:var(--color-primary-80)}.bg-primary-95{background-color:var(--color-primary-95)}.bg-primary-100{background-color:var(--color-primary-100)}.text-primary-10{color:var(--color-primary-10)}.text-primary-20{color:var(--color-primary-20)}.text-primary-30{color:var(--color-primary-30)}.text-primary-40{color:var(--color-primary-40)}.text-primary-60{color:var(--color-primary-60)}.text-primary-80{color:var(--color-primary-80)}.text-primary-95{color:var(--color-primary-95)}.text-primary-100{color:var(--color-primary-100)}.shadow-boxy{box-shadow:var(--shadow-boxy)}.shadow-subtle{box-shadow:var(--shadow-subtle)}.shadow-subtle2{box-shadow:var(--shadow-subtle2)}.shadow-2xl{box-shadow:var(--shadow-2xl)}.shadow-3xl{box-shadow:var(--shadow-3xl)}.font-semibold{font-family:LexendSemibold}.font-bold{font-family:LexendBold}.font-medium{font-family:LexendMedium}}.sc-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:999999}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-blur{syntax: "*"; inherits: false;}@property --tw-brightness{syntax: "*"; inherits: false;}@property --tw-contrast{syntax: "*"; inherits: false;}@property --tw-grayscale{syntax: "*"; inherits: false;}@property --tw-hue-rotate{syntax: "*"; inherits: false;}@property --tw-invert{syntax: "*"; inherits: false;}@property --tw-opacity{syntax: "*"; inherits: false;}@property --tw-saturate{syntax: "*"; inherits: false;}@property --tw-sepia{syntax: "*"; inherits: false;}@property --tw-drop-shadow{syntax: "*"; inherits: false;}@property --tw-drop-shadow-color{syntax: "*"; inherits: false;}@property --tw-drop-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-drop-shadow-size{syntax: "*"; inherits: false;}@property --tw-duration{syntax: "*"; inherits: false;}@property --tw-ease{syntax: "*"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse: 0;--tw-border-style: solid;--tw-font-weight: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-blur: initial;--tw-brightness: initial;--tw-contrast: initial;--tw-grayscale: initial;--tw-hue-rotate: initial;--tw-invert: initial;--tw-opacity: initial;--tw-saturate: initial;--tw-sepia: initial;--tw-drop-shadow: initial;--tw-drop-shadow-color: initial;--tw-drop-shadow-alpha: 100%;--tw-drop-shadow-size: initial;--tw-duration: initial;--tw-ease: initial}}}
2
+ `);var it=W(require("react"),1);var D=require("react");var Ue=require("react/jsx-runtime");function ue({selectedTheme:t}){return(0,Ue.jsx)("div",{className:"mx-auto animate-spin rounded-full h-12 w-12 border-b-2 ",style:{borderColor:t.primaryColor}})}var Ae=require("tailwind-merge"),je=W(require("clsx"),1),me=require("@mediapipe/tasks-vision"),He={default:{primaryColor:"#4d61b0",secondaryColor:"#E8EAF6",buttonText:"#FFFFFF",borderRadius:"4px",focus:"focus:outline-none focus:ring-2 focus:ring-[#E8EAF6] focus:border-[#E8EAF6]"},sunset_gold:{primaryColor:"#FFD700",secondaryColor:"#FFF8E1",buttonText:"#5D4037",borderRadius:"8px",focus:"focus:outline-none focus:ring-2 focus:ring-[#FFF8E1] focus:border-[#FFF8E1]"},midnight_blue:{primaryColor:"#1A237E",secondaryColor:"#E8EAF6",buttonText:"#FFFFFF",borderRadius:"4px",focus:"focus:outline-none focus:ring-2 focus:ring-[#E8EAF6] focus:border-[#E8EAF6]"},forest_emerald:{primaryColor:"#2E7D32",secondaryColor:"#E8F5E9",buttonText:"#FFFFFF",borderRadius:"12px",focus:"focus:outline-none focus:ring-2 focus:ring-[#E8F5E9] focus:border-[#E8F5E9]"}},ze=t=>He[t]||He.default;function k(...t){return(0,Ae.twMerge)((0,je.default)(t))}var Be=t=>t.map(e=>({label:e,value:e}));var Oe=async t=>{let e=await me.FilesetResolver.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"),r=await me.FaceLandmarker.createFromOptions(e,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},runningMode:"IMAGE"}),o=new Image,s=URL.createObjectURL(t);o.src=s,await o.decode(),URL.revokeObjectURL(s);let n=r.detect(o);if(n.faceLandmarks&&n.faceLandmarks.length>0){let a=n.faceLandmarks[0],i=document.createElement("canvas"),p=i.getContext("2d"),E=a.map(h=>h.x*o.width),w=a.map(h=>h.y*o.height),S=Math.min(...E),g=Math.max(...E),N=Math.min(...w),x=Math.max(...w),u=g-S,b=x-N,T=u*.5;return i.width=224,i.height=224,p?.drawImage(o,S-T,N-T,u+T*2,b+T*2,0,0,224,224),r.close(),new Promise(h=>i.toBlob(h,"image/jpeg",.95))}return r.close(),null};function fe(t,e,r){return new File([t],e,{type:r||t.type,lastModified:Date.now()})}var Ke={data_verification:{key:"data_verification",title:"Data verification",subtitle:"Businesses that store, process, or transmit credit or debit card information maintain a secure environment.",preview:"Verify your identity with personal data"},document_verification:{key:"document_verification",title:"Document verification",subtitle:"Businesses that store, process, or transmit credit or debit card information maintain a secure environment.",preview:"Verify your identity with ID documents"}},we={global:{passport:{title:"Passport",key:"passport"}},kenya:{},nigeria:{bvn:{title:"Bank Verification Number (BVN)",key:"bvn"},nin:{title:"National Identity Number (NIN)",key:"nin"},passport:{title:"Nigeria Passport",key:"passport"}}};var $e=`
3
+ block bg-white w-full px-2 py-1.5 rounded-lg
4
+ border border-gray-300
5
+ shadow-sm
6
+ text-gray-700 text-sm
7
+ transition-all
8
+ hover:border-gray-400`;var Ge=["liveness-intro","liveness-check","success-confirmation"];var _=require("react/jsx-runtime");function xe({config:t,selectedTheme:e,onNext:r}){return(0,_.jsxs)("section",{className:"space-y-4",children:[(0,_.jsxs)("section",{className:"space-y-2",children:[(0,_.jsx)("h3",{className:"text-left text-2xl font-semibold text-gray-600",children:"Verify your identity"}),(0,_.jsx)("p",{className:"text-left text-sm text-gray-500",children:"Please note that you need to be on a well-connected network to complete this verification. You will undergo the following verification:"})]}),(0,_.jsx)("div",{className:"w-full space-y-5 pb-2 pt-3",children:Object.values(Ke).map(o=>t.verification_type?.includes(o.key)?(0,_.jsx)("button",{className:k("flex w-full items-start justify-start gap-2 rounded-3xl px-4 py-3","pointer-events-none border border-gray-200"),children:(0,_.jsxs)("div",{className:"space-y-1",children:[(0,_.jsx)("p",{className:k("text-md text-left font-semibold","text-gray-600"),children:o.title}),(0,_.jsx)("p",{className:k("text-left text-sm text-gray-500"),children:o.preview})]})},o.key):null)}),(0,_.jsx)("button",{onClick:r,className:k("text-md h-12 w-full rounded-xl text-center font-semibold text-white"),style:{background:e.primaryColor},children:"Continue"})]})}var j=require("react");var A=require("react");var H=require("react/jsx-runtime");function ge({options:t,value:e,onChange:r,selectedTheme:o,placeholder:s}){let[n,a]=(0,A.useState)(!1),i=(0,A.useRef)(null),p=(0,A.useRef)(null),[E,w]=(0,A.useState)(0);(0,A.useEffect)(()=>{let g=N=>{p.current&&!p.current.contains(N.target)&&i.current&&!i.current.contains(N.target)&&a(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),(0,A.useEffect)(()=>{i.current&&w(i.current.offsetWidth)},[i.current?.offsetWidth,n]);let S=t.find(g=>g.value===e)?.label||s||"Select";return(0,H.jsxs)("div",{className:"relative inline-block text-left w-full",children:[(0,H.jsxs)("button",{ref:i,onClick:()=>a(!n),className:k(`
9
+ w-full px-4 py-2 rounded-lg border border-gray-300
10
+ shadow-sm text-gray-700 text-sm
11
+ bg-white
12
+ flex justify-between items-center
13
+ capitalize
14
+ `,o.focus),children:[(0,H.jsx)("span",{children:S}),(0,H.jsx)("svg",{className:`w-4 h-4 ml-2 transition-transform duration-200 ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,H.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&(0,H.jsx)("div",{ref:p,className:"absolute z-10 mt-1 bg-white shadow-lg rounded-lg max-h-60 overflow-auto",style:{width:E},children:t.map(g=>(0,H.jsx)("div",{onClick:()=>{r(g.value),a(!1)},className:`
15
+ cursor-pointer px-4 py-2 text-sm text-gray-700 capitalize
16
+ ${g.value===e?"font-semibold":""}
17
+ `,children:g.label},g.value))})]})}var P=W(require("react-hot-toast"),1);var qe="./trash-KETR47RP.svg";var l=require("react/jsx-runtime"),Qe=200;function ke({config:t,selectedTheme:e,onSubmit:r,handleIdUpdate:o,idFile:s}){let n=(0,j.useRef)(null),[a,i]=(0,j.useState)({identifier:"",identifier_type:"",country:""}),p=(0,j.useMemo)(()=>Object.keys(t.channels||{}),[t.channels]),E=(0,j.useMemo)(()=>{let u={};return(t?.channels?.[a.country]||[])?.forEach(T=>{let h=we?.[a?.country]?.[T]||null;h&&(u[T]=h)}),u},[t.channels,a.country]),w=(0,j.useMemo)(()=>we?.[a.country||""]?.[a?.identifier_type||""]||null,[a?.identifier_type]),S=(0,j.useMemo)(()=>Object.entries(E).map(u=>{let[b,T]=u;return{label:T.title,value:b}}),[E]),g=(u,b)=>{i(T=>({...T,[u]:b}))},N=()=>{n.current&&(n.current.value="",n.current.files=null),o(void 0,void 0)},x=async u=>{let b=u.target.files?.[0];if(!b)return;if(!["image/jpeg","image/png"].includes(b.type)){P.default.error("Only JPG and PNG files are allowed."),u.target.value="";return}if(b?.size>1024*Qe){P.default.error(`Max file size is ${Qe}kb`);return}N(),P.default.loading("Scanning document for photo...");try{let h=await Oe(b);if(!h){P.default.dismiss(),P.default.error("Could not find a clear face on this ID. Please upload a clearer image.");return}let R=new FileReader;R.onload=function(){let $=R.result},R.readAsDataURL(h);let L=`snapshot-${new Date().getTime()}.jpg`,B=new File([h],L,{type:"image/jpeg"});P.default.dismiss(),P.default.success("ID Photo extracted!"),o(b,B)}catch{P.default.dismiss(),P.default.error("Error processing document. Please upload a document with your face on it")}};return(0,l.jsxs)("section",{className:"space-y-6",children:[(0,l.jsxs)("section",{className:"space-y-2",children:[(0,l.jsx)("h3",{className:"text-left text-2xl font-semibold text-gray-600",children:"Verify your identity"}),(0,l.jsx)("p",{className:"text-left text-sm text-gray-500",children:"Identity verification. Please note that you need to be on a well-connected network to complete this verification."})]}),(0,l.jsxs)("div",{className:"mx-auto space-y-5",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:"Country"}),(0,l.jsx)(ge,{options:Be(p),onChange:u=>g("country",u),value:a.country,selectedTheme:e,placeholder:"Select country"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:"Verification Channel"}),(0,l.jsx)(ge,{options:S,onChange:u=>g("identifier_type",u),value:a.identifier_type,selectedTheme:e,placeholder:"Select verification channel"})]}),a.identifier_type?(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:w?.title||"Input"}),(0,l.jsx)("input",{ref:n,type:"text",placeholder:"Enter "+a.identifier_type,value:a.identifier,onChange:u=>g("identifier",u.target.value),className:k($e,e.focus)})]}):null,a?.identifier_type&&t?.verification_type?.includes("document_verification")?(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:"Upload identity document"}),(0,l.jsxs)("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center gap-1 rounded-xl border-4 border-dashed border-[#CBD5E1] bg-[#F8F8F8] px-4 py-6",children:[(0,l.jsx)("input",{type:"file",name:"id-doc",id:"id-doc",hidden:!0,onChange:x},s?s.name:"empty"),(0,l.jsx)("label",{htmlFor:"id-doc",className:"text-center text-sm text-gray-600",children:"Click to upload"}),(0,l.jsx)("p",{className:"text-center text-sm font-normal text-gray-400",children:"Accepted file types: JPG, PNG"})]}),(0,l.jsx)("p",{className:"text-sm text-gray-600 font-semibold",children:"Max file size: 200KB"}),s&&(0,l.jsx)("aside",{className:"mt-3",children:(0,l.jsx)("ul",{children:(0,l.jsxs)("li",{className:"m-0 mb-1 flex justify-between gap-3 p-2 hover:rounded-3xl hover:border-1.5 hover:border-gray-100 hover:!bg-transparent",children:[(0,l.jsx)("div",{className:"flex flex-1 gap-3",children:(0,l.jsx)("div",{className:"flex flex-1 flex-col",children:(0,l.jsx)("p",{className:"break-all text-left text-[14px] font-normal text-gray-600",children:s?.name})})}),(0,l.jsx)("div",{className:"flex shrink-0 gap-2",children:(0,l.jsx)("button",{onClick:N,className:"text-lg font-semibold",children:(0,l.jsx)("img",{src:qe,className:"size-5 mx-auto shrink-0",alt:"delete"})})})]})})})]}):null]}),(0,l.jsx)("button",{onClick:()=>r(a.identifier,a.identifier_type,a.country),className:k("text-md h-12 w-full rounded-xl text-center font-semibold disabled:opacity-50"),disabled:!a?.country||!a?.identifier||!a?.identifier_type||!s&&t.verification_type.includes("document_verification"),style:{background:e.primaryColor,color:e.buttonText},children:"Continue"}),(0,l.jsx)("div",{className:"w-full h-12"})]})}var M=require("react/jsx-runtime");function Fe({selectedTheme:t,onStart:e}){return(0,M.jsxs)("section",{className:"mt-8 space-y-6",children:[(0,M.jsxs)("section",{className:"space-y-2",children:[(0,M.jsx)("h3",{className:"text-left text-2xl font-semibold text-gray-600",children:"Liveliness Check"}),(0,M.jsxs)("p",{className:"text-left text-sm text-gray-500",children:["Make sure you are in a well lit area, hold your phone at eye level and look straight into the camera."," "]})]}),(0,M.jsxs)("ul",{className:"mx-auto max-w-[80%] list-disc text-sm text-gray-600 [&_li]:hover:bg-transparent!",children:[(0,M.jsx)("li",{children:"Stay in a well lit area with your eyes clearly visible. "}),(0,M.jsx)("li",{children:"Remove anything covering your face like masks, glasses, hats."}),(0,M.jsx)("li",{children:"Follow the onscreen instruction for face capture."})]}),(0,M.jsx)("button",{onClick:e,className:k("text-md h-12 w-full rounded-xl text-center font-semibold "),style:{background:t.primaryColor,color:t.buttonText},children:"Take a selfie"})]})}var K=W(require("react-hot-toast"),1);var d=require("react"),ye=require("@mediapipe/tasks-vision");var Ct=[362,385,387,263,373,380],Dt=[33,160,158,133,153,144],Ve=t=>{let e=s=>{let n=s.map(E=>t[E]),a=Math.hypot(n[1].x-n[5].x,n[1].y-n[5].y),i=Math.hypot(n[2].x-n[4].x,n[2].y-n[4].y),p=Math.hypot(n[0].x-n[3].x,n[0].y-n[3].y);return(a+i)/(2*p)},r=e(Ct),o=e(Dt);return(r+o)/2<.18},Ee=t=>{let e=t[1].x,r=t[234].x,s=t[454].x-r,n=(e-r)/s;return n<.35?"LEFT":n>.65?"RIGHT":"CENTER"},Rt=13,It=14,_t=78,Lt=308,Ye=t=>{let e=t[Rt],r=t[It],o=t[_t],s=t[Lt],n=Math.hypot(e.x-r.x,e.y-r.y),a=Math.hypot(o.x-s.x,o.y-s.y);return n/a>.35};var We="http://localhost:8000";var V=class{constructor(e,r){I(this,"baseUrl");I(this,"timeout");I(this,"session");I(this,"onError");I(this,"destroy");this.baseUrl=We,this.timeout=e.timeout||45e3,this.session=e.session,this.onError=e.onError,this.destroy=r}async request(e,r,o,s){let n=new AbortController,a=setTimeout(()=>n.abort(),this.timeout);try{let i=o instanceof FormData,p=await fetch(`${this.baseUrl}${r}`,{method:e,headers:{Authorization:`Session ${this.session}`,...s||{},...i?{}:{"Content-Type":"application/json"}},body:o?i?o:JSON.stringify(o):void 0,signal:n.signal});if(!(p.headers.get("content-type")||"").includes("application/json"))throw new Error(`Unexpected response from ${r} (${p.status})`);let w;try{w=await p.json()}catch{w=null}if(!p.ok){let S=w?.message||w?.error||`Error: ${p.status}`;throw{status:p.status,message:S,data:w}}return w}catch(i){throw i.name==="AbortError"?this.onError?.({error:i,message:"Request timeout",code:"TIMEOUT_ERROR"}):i.status==403||i.status==401?(this.onError?.({error:i,message:"Session expired. Please restart the process",code:"AUTH_ERROR"}),console.error("Authentication failed. Session is no longer valid."),setTimeout(()=>{typeof this.destroy=="function"&&this.destroy()},2e3)):this.onError?.({error:i||i.data,message:"An error occured",code:"UNKNOWN_ERROR"}),i}finally{clearTimeout(a)}}post(e,r,o){return this.request("POST",e,r,o)}patch(e,r,o){return this.request("PATCH",e,r,o)}get(e){return this.request("GET",e)}};var ae=W(require("react-hot-toast"),1);var he=require("react"),z=require("react/jsx-runtime");function Te({onComplete:t,canClose:e}){let[r,o]=(0,he.useState)(0);return(0,he.useEffect)(()=>{let s;return r<99?s=setInterval(()=>{o(n=>{let a=Math.floor(Math.random()*10)+1,i=n+a;return i>=99?99:i})},500):r===99&&e&&(o(100),t&&t()),()=>clearInterval(s)},[r,e,t]),(0,z.jsxs)("div",{className:"mt-8 space-y-4",children:[(0,z.jsxs)("section",{className:"space-y-1",children:[(0,z.jsx)("h3",{className:"text-center animate-pulse text-2xl font-semibold text-gray-600",children:"Finalizing Verification..."}),(0,z.jsx)("p",{className:"text-center text-sm text-gray-600",children:"Please do not close this page"})]}),(0,z.jsx)("div",{className:"w-full max-w-[55%] mx-auto bg-gray-100 rounded-full h-2",children:(0,z.jsx)("div",{className:"bg-secondary-5 h-2 rounded-full transition-all duration-300 ease-out",style:{width:`${r}%`}})}),(0,z.jsxs)("p",{className:"text-center text-sm text-gray-600",children:[r,"%"]})]})}var Xe="./loading-5HD36QXU.svg";var F=require("react/jsx-runtime");var O=[{id:"CENTER",label:"Center your face in the oval",subtitle:"Position your face inside of the circle and take a photo."},{id:"BLINK",label:"Blink your eyes",subtitle:"While your face is centered, blink your eyes twice."},{id:"TURN_HEAD",label:"Turn your head",subtitle:"Slowly turn your head left or right"},{id:"OPEN_MOUTH",label:"Open your mouth",subtitle:"Open your mouth"}],Pt=({sdkInstance:t,updateStep:e,config:r,idFile:o,snapshotFile:s,identityFormData:n})=>{let a=(0,d.useRef)(null),i=(0,d.useRef)(null),p=(0,d.useRef)(0),E=(0,d.useRef)(0),w=(0,d.useRef)(null),S=(0,d.useRef)(null),g=(0,d.useRef)(null),N=(0,d.useRef)(!1),x=(0,d.useRef)(null),u=(0,d.useRef)(!1),[b,T]=(0,d.useState)(0),[h,R]=(0,d.useState)(!1),[L,B]=(0,d.useState)(!1),[$,G]=(0,d.useState)(),[ne,De]=(0,d.useState)(null),[ve,Re]=(0,d.useState)(),[st,ie]=(0,d.useState)(!1),[lt,se]=(0,d.useState)(!1),[ct,dt]=(0,d.useState)(!1),[q,pt]=(0,d.useState)(!1),[Y,le]=(0,d.useState)("neutral"),[ut,Ie]=(0,d.useState)(!1),ee=(0,d.useRef)(!1),U=(0,d.useRef)(null),ce=(0,d.useRef)([]),_e=()=>{S.current&&cancelAnimationFrame(S.current),w.current&&(w.current.getTracks().forEach(m=>m.stop()),w.current=null),a.current&&(a.current.srcObject=null)},de=()=>{ee.current||p.current>=O.length||(ee.current=!0,le("success"),g.current&&clearTimeout(g.current),setTimeout(()=>{if(p.current<O.length-1){let m=p.current+1;T(m),le("neutral"),ee.current=!1}else console.log("\u{1F38A} All actions done!"),mt()},2e3))},mt=async()=>{se(!0),_e();let m;ve||(m=await Le()),await ht(m)},ft=()=>{De(null),G(void 0),B(!1),R(!1),ie(!1),Ie(!1),T(0),Re(void 0)},gt=()=>new Promise(m=>{if(!a.current)return null;let C=document.createElement("canvas");C.width=a.current.videoWidth,C.height=a.current.videoHeight,C.getContext("2d")?.drawImage(a.current,0,0),C.toBlob(f=>{m(f)},"image/jpeg",.9)}),ht=async m=>{let C=m||ve;if(!x.current?.id||!C){ae.default.error("Invalid payload"),ft(),se(!1);return}let y=new V(t);try{se(!0);let f=new FormData;f.append("entry",x.current.id.toString()),f.append("session",t.session),f.append("video_file",C),(await y.post("/v1/liveness/submit/",f)).status=="success"&&dt(!0)}catch(f){let v=f?.message||f.response?.data?.message||"Submission failed";ae.default.error(v),t.onError?.({error:f,message:v,code:"SUBMISSION_ERROR"}),setTimeout(()=>{window.location.reload()},3e3)}};(0,d.useEffect)(()=>{if(!(!q||b>=O.length))return le("neutral"),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{le("error")},5e3),()=>{g.current&&clearTimeout(g.current)}},[b,q]),(0,d.useEffect)(()=>{p.current=b},[b]),(0,d.useEffect)(()=>{if(ne||!$||st||N.current||!n)return;let m=new V(t);(async()=>{N.current=!0;try{let y=new FormData;y.append("sdk_config",r.id.toString()),y.append("autoshot_file",$),y.append("challenge_actions",JSON.stringify(O.filter(v=>v.id!=="CENTER").map(v=>v.id))),y.append("identifier",n.identifier),y.append("identifier_type",n.identifier_type),y.append("country",n?.country),r.verification_type.includes("document_verification")&&(y.append("id_file",o),y.append("snapshot_file",s)),ie(!0);let f=await m.post("/v1/liveness/create/",y);f.status=="success"&&f.data&&setTimeout(()=>{De(f.data),x.current=f.data,ie(!1)},1500)}catch(y){let f=y?.message||y.response?.data?.message||"An error occured. Please try again";ae.default.error(f),t.onError?.({error:y,message:f,code:"ENTRY_CREATION_ERROR"}),ie(!1),setTimeout(()=>{window.location.reload()},3e3)}})()},[ne,$]),(0,d.useEffect)(()=>{if(ut)return;Ie(!0);let m,C,y=async()=>{let v=await ye.FilesetResolver.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm");m=await ye.FaceLandmarker.createFromOptions(v,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numFaces:1}),m&&!q&&pt(!0),C=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:480},height:{ideal:640},frameRate:{ideal:15}}}),a.current&&(a.current.srcObject=C,a.current.onloadedmetadata=()=>{a.current?.play(),f()})},f=async()=>{if(!a.current||!m||Y==="success"||ee.current){S.current=requestAnimationFrame(f);return}let v=performance.now(),Q=m.detectForVideo(a.current,v);if(Q.faceLandmarks&&Q.faceLandmarks.length>0){let te=Q.faceLandmarks[0],pe=O[p.current];if(p.current==O.length)return;if(pe.id==="CENTER"){let re=te[1];if(re.x>.4&&re.x<.6&&re.y>.4&&re.y<.6){if(!u.current){u.current=!0;let Me=await gt();if(Me){let vt=fe(Me,`autoshot-${t.session}.jpg`,"image/jpeg");G(vt),B(!0)}else u.current=!1}u.current&&x.current&&!ee.current&&(U.current?.state!=="recording"&&yt(C),de())}}else pe.id==="BLINK"?Ve(te)?de():E.current=0:pe.id==="TURN_HEAD"?(Ee(te)==="LEFT"||Ee(te)==="RIGHT")&&de():pe.id==="OPEN_MOUTH"&&Ye(te)&&de()}S.current=requestAnimationFrame(f)};return y(),()=>{_e(),i.current&&clearTimeout(i.current),U.current?.state!=="inactive"&&U.current?.stop()}},[]);let yt=m=>{ce.current=[];let y=["video/webm;codecs=vp8","video/webm","video/mp4"].find(v=>MediaRecorder.isTypeSupported(v));if(!y){ae.default.error("Browser does not support recording");return}let f={mimeType:y,videoBitsPerSecond:25e4};try{U.current=new MediaRecorder(m,f)}catch{U.current=new MediaRecorder(m)}U.current.ondataavailable=v=>{v.data&&v.data.size>0&&ce.current.push(v.data)},U.current.onstop=()=>{let v=new Blob(ce.current,{type:"video/webm"});if(v.size>0){let Q=fe(v,`session-${t.session}.webm`,"video/webm");Re(Q)}},U.current.start(),i.current=setTimeout(()=>{Le()},2e4)},Le=async()=>{let m=U.current;return!m||m.state==="inactive"?ve||void 0:new Promise(C=>{i.current&&(clearTimeout(i.current),i.current=null);let y=()=>{m.removeEventListener("stop",y);let f=new Blob(ce.current,{type:"video/webm"}),v=fe(f,`session-${t.session}.webm`,"video/webm");w.current&&w.current.getTracks().forEach(Q=>Q.stop()),C(v)};m.addEventListener("stop",y),m.stop()})};return(0,F.jsx)(F.Fragment,{children:lt?(0,F.jsx)(Te,{canClose:ct,onComplete:()=>{t.onSuccess?.({data:{entryId:x.current?.id,identifier:x.current?.identifier,identifier_type:x.current?.identifier_type,video_url:x.current?.video_url,autoshot_url:x.current?.autoshot_url,document_url:x.current?.document_url||null},status:200,message:"Liveness captured successfully"}),e("success-confirmation"),se(!1)}}):(0,F.jsxs)("section",{className:"space-y-3 relative flex flex-col items-start justify-center p-4 h-[400px]",children:[(0,F.jsxs)("div",{className:"text-left",children:[(0,F.jsx)("h3",{className:"text-2xl font-bold text-gray-600 animate-pulse",children:q?b===0&&!ne&&L?"Synchronizing Session...":O[b]?.label:"Getting ready..."}),q&&ne?(0,F.jsx)("p",{className:"text-sm text-gray-500",children:O[b]?.subtitle}):null]}),(0,F.jsxs)("div",{className:k("relative w-full max-w-md aspect-[3/4] overflow-hidden rounded-3xl",q?"bg-[rgba(0,0,0,0.6)]":"bg-[#262A2F]"),children:[(0,F.jsx)("video",{ref:a,className:"absolute inset-0 w-full h-full object-cover mirror",muted:!0,playsInline:!0}),q?(0,F.jsx)("div",{className:"absolute inset-0 pointer-events-none flex items-center justify-center",children:(0,F.jsx)("svg",{viewBox:"0 0 100 100",className:"w-[80%] h-[80%] overflow-visible",children:(0,F.jsx)("ellipse",{cx:"50",cy:"50",rx:"35",ry:"45",fill:"none",strokeWidth:"3",className:k("transition-colors duration-500 ease-in-out",Y==="neutral"&&"stroke-white/50",Y==="success"&&"stroke-[#62DF98]",Y==="error"&&"stroke-error-6/60"),style:{filter:Y!=="neutral"?`drop-shadow(0 0 8px ${Y==="success"?"#22c55e":"#ef4444"})`:"none"}})})}):(0,F.jsxs)("div",{className:"absolute w-full h-full gap-1.5 pointer-events-none flex flex-col items-center justify-center",children:[(0,F.jsx)("img",{src:Xe,alt:"loading",className:"size-9 animate-spin"}),(0,F.jsx)("span",{className:"text-white text-sm text-center",children:"Loading camera"})]})]})]})})},Ze=Pt;var Je="./success-GHUHNWON.svg";var et=require("react"),X=require("react/jsx-runtime");function Se({redirect_url:t,destroy:e}){return(0,et.useEffect)(()=>{let r=setTimeout(()=>{t?window.location.assign(t):e()},3e3);return()=>clearTimeout(r)},[]),(0,X.jsxs)("section",{className:"mt-8 space-y-3",children:[(0,X.jsx)("img",{src:Je,className:"size-44 mx-auto shrink-0",alt:"success-icon"}),(0,X.jsx)("h3",{className:"text-center text-2xl font-semibold text-gray-600",children:"Identity verified"}),(0,X.jsx)("p",{className:"text-center text-sm text-gray-600",children:"We have successfully verified your identity. You can close this page now."})]})}var tt="./shield-checkmark-JBZCUXJC.png";var Z=require("react"),rt=W(require("react-hot-toast"),1),ot=require("react/jsx-runtime"),At=180;function Ne({destroy:t,onExpire:e}){let[r,o]=(0,Z.useState)(At),[s,n]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{let p=setInterval(()=>{o(E=>E>0?E-1:0)},1e3);return()=>clearInterval(p)},[]),(0,Z.useEffect)(()=>{if(r>0&&!s)return;rt.default.error("Time limit exceeded"),n(!1);let p=setTimeout(()=>{e?.(),t()},1500);return()=>clearTimeout(p)},[r,s]);let a=Math.floor(r/60),i=r%60;return(0,ot.jsxs)("p",{className:k("text-2xl font-bold font-[monospace]",r<60?"text-error-6":"text-gray-600"),children:[a,":",i.toString().padStart(2,"0")]})}var c=require("react/jsx-runtime"),jt=({sdkInstance:t})=>{let[e,r]=(0,D.useState)("loading"),[o,s]=(0,D.useState)(null),[n,a]=(0,D.useState)(),[i,p]=(0,D.useState)(),[E,w]=(0,D.useState)(),[S,g]=(0,D.useState)(!1),N=(0,D.useMemo)(()=>t.getConfig(),[t]),x=(0,D.useMemo)(()=>ze(o?.theme),[o?.theme]),u=(0,D.useMemo)(()=>({identity:1,"liveness-intro":2,"liveness-check":3})[e]||0,[e]),b=async(h,R,L)=>{if(!n&&o?.verification_type?.includes("document_verification")){K.default.error("Please upload ID");return}let B={session_id:N.session,onboarding_type:R,id_number:h,name_to_confirm:"",[R]:h};w({identifier:h,identifier_type:R,country:L});try{let G=await t.getHttp().post("/v1/onboarding/verify",B);G.status==="verified"&&(K.default.success(G.message||"Verification successful"),r("liveness-intro"))}catch($){let G=$?.message||"An error occured. Please try again";K.default.error(G)}},T=async(h,R)=>{a(h),p(R)};return(0,D.useEffect)(()=>{let h=t.getHttp();(async()=>{try{r("loading");let L=await h.get("/v1/sdk/initialize/");L.status=="success"&&L.data&&setTimeout(()=>{s(L.data),r("welcome")},1500)}catch(L){let B=L?.message||"An error occured. Please try again";K.default.error(B),r("")}})()},[]),o?(0,c.jsxs)("main",{id:"smartcomply-sdk-root",className:"sc-overlay overflow-y-auto flex h-full min-h-screen bg-gray-50",children:[(0,c.jsx)("div",{id:"liveness-container",className:""}),(0,c.jsx)(K.Toaster,{}),(0,c.jsxs)("div",{className:"fixed bg-gray-50 top-0 flex w-full items-center justify-between px-4 py-4 md:px-10",children:[(0,c.jsx)("section",{className:"flex items-center gap-4",children:(0,c.jsx)("h2",{className:"text-center text-lg font-semibold text-gray-600 md:text-xl",children:o?.brand_name?o?.brand_name:"Brand name"})}),(0,c.jsxs)("div",{className:"flex items-center justify-end gap-4",children:[S?(0,c.jsx)(Ne,{destroy:t.destroy,onExpire:N?.onExpire}):null,e==="welcome"||e==="loading"?null:(0,c.jsx)("p",{className:"relative text-center text-sm font-medium text-gray-400",children:u?`Step ${u} of 3`:"All Done"})]})]}),(0,c.jsxs)("div",{className:"fixed z-1 bg-gray-50 md:bg-transparent! bottom-0 flex w-full items-center justify-center px-10 py-4 md:bottom-6 md:right-8 md:justify-between",children:[(0,c.jsx)("span",{className:"hidden md:flex"}),(0,c.jsx)("p",{className:"relative pt-2 text-center text-xs font-medium text-gray-400",children:"Powered by Adhere"})]}),(0,c.jsx)("div",{className:"flex flex-1 items-start justify-center px-4 py-24! sm:px-[6%] md:justify-start h-full",children:(0,c.jsxs)("div",{className:k("w-full max-w-[500px] max-sm:w-[80vw] max-[450px]:!w-[calc(100vw_-_2rem)]",Ge.includes(e)?"mx-auto":""),children:[e==="loading"&&(0,c.jsx)(ue,{selectedTheme:x}),e==="welcome"&&(0,c.jsx)(xe,{config:o,onNext:()=>{r("identity"),g(!0)},selectedTheme:x}),e==="identity"&&(0,c.jsx)(ke,{config:o,onSubmit:b,selectedTheme:x,handleIdUpdate:T,idFile:n}),e==="liveness-intro"&&(0,c.jsx)(Fe,{config:o,onStart:()=>r("liveness-check"),selectedTheme:x}),e==="liveness-check"&&(0,c.jsx)(Ze,{config:o,updateStep:h=>r(h),sdkInstance:N,idFile:n,snapshotFile:i,identityFormData:E}),e==="success-confirmation"&&(0,c.jsx)(Se,{destroy:t.destroy,redirect_url:o.redirect_url})]})}),e==="loading"||e==="welcome"?(0,c.jsxs)("div",{className:"relative hidden w-[35%] bg-gray-100 h-full md:flex",children:[(0,c.jsxs)("section",{className:"mx-auto flex h-[90%] max-w-[90%] flex-col justify-center space-y-4",children:[(0,c.jsx)("img",{src:tt,className:"size-30 mx-auto shrink-0",alt:"shield-checkmark"}),(0,c.jsxs)("section",{className:"space-y-2",children:[(0,c.jsxs)("h3",{className:"text-center text-xl font-semibold text-gray-600",children:["Welcome to"," ",o?.brand_name?o?.brand_name:"Brand Name"]}),(0,c.jsx)("p",{className:"break-all text-center text-sm text-gray-500",children:o?.description?o?.description:"Description"})]})]})," ",(0,c.jsx)("div",{className:"absolute bottom-6 flex w-full items-center justify-center",children:(0,c.jsx)("p",{className:"relative pt-2 text-center text-xs font-medium text-gray-400",children:"Powered by Adhere"})})]}):null]}):(0,c.jsxs)("main",{id:"smartcomply-sdk-root",className:"sc-overlay flex h-full min-h-screen bg-gray-50",children:[(0,c.jsx)(K.Toaster,{}),e=="loading"?(0,c.jsx)(ue,{selectedTheme:x}):null]})},at=jt;var Ce=require("react/jsx-runtime"),J=class{constructor(e){I(this,"http");I(this,"config");I(this,"root",null);I(this,"containerId","smartcomply-sdk-root");I(this,"destroy",()=>{this.root&&(this.root.unmount(),this.root=null);let e=document.getElementById(this.containerId);e&&e.remove(),console.log("SDK Destroyed and cleaned up.")});this.config=e,this.http=new V(e,this.destroy.bind(this))}getConfig(){return this.config}getHttp(){return this.http}launch(){let e=document.getElementById(this.containerId);e||(e=document.createElement("div"),e.id=this.containerId,document.body.appendChild(e)),this.root=(0,nt.createRoot)(e),this.root.render((0,Ce.jsx)(it.default.StrictMode,{children:(0,Ce.jsx)(at,{sdkInstance:this})}))}};var zt=J;0&&(module.exports={SmartComply});
@@ -0,0 +1,34 @@
1
+ interface SDKConfig {
2
+ timeout?: number;
3
+ session: string;
4
+ onSuccess?: (data: any) => void;
5
+ onError?: (error: any) => void;
6
+ onExpire?: () => void;
7
+ }
8
+
9
+ declare class HttpClient {
10
+ private baseUrl;
11
+ private timeout;
12
+ private session;
13
+ private onError;
14
+ private destroy;
15
+ constructor(config: SDKConfig, destroy?: Function);
16
+ request<T>(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
17
+ post<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
18
+ patch<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
19
+ get<T>(path: string): Promise<T>;
20
+ }
21
+
22
+ declare class SmartComply {
23
+ private http;
24
+ private config;
25
+ private root;
26
+ private containerId;
27
+ constructor(config: SDKConfig);
28
+ getConfig(): SDKConfig;
29
+ getHttp(): HttpClient;
30
+ launch(): void;
31
+ destroy: () => void;
32
+ }
33
+
34
+ export { type SDKConfig, SmartComply, SmartComply as default };
@@ -0,0 +1,34 @@
1
+ interface SDKConfig {
2
+ timeout?: number;
3
+ session: string;
4
+ onSuccess?: (data: any) => void;
5
+ onError?: (error: any) => void;
6
+ onExpire?: () => void;
7
+ }
8
+
9
+ declare class HttpClient {
10
+ private baseUrl;
11
+ private timeout;
12
+ private session;
13
+ private onError;
14
+ private destroy;
15
+ constructor(config: SDKConfig, destroy?: Function);
16
+ request<T>(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
17
+ post<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
18
+ patch<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
19
+ get<T>(path: string): Promise<T>;
20
+ }
21
+
22
+ declare class SmartComply {
23
+ private http;
24
+ private config;
25
+ private root;
26
+ private containerId;
27
+ constructor(config: SDKConfig);
28
+ getConfig(): SDKConfig;
29
+ getHttp(): HttpClient;
30
+ launch(): void;
31
+ destroy: () => void;
32
+ }
33
+
34
+ export { type SDKConfig, SmartComply, SmartComply as default };
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ var bt=Object.defineProperty;var wt=(t,e,r)=>e in t?bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var D=(t,e,r)=>wt(t,typeof e!="symbol"?e+"":e,r);import{createRoot as Xt}from"react-dom/client";function ye(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}ye(`/*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-gray-50: #F8FAFC;--color-gray-100: #F1F5F9;--color-gray-200: #E2E8F0;--color-gray-300: #CBD5E1;--color-gray-400: #94A3B8;--color-gray-500: #64748B;--color-gray-600: #475569;--color-gray-700: #334155;--color-gray-800: #A3AED0;--color-white: #FFFFFF;--spacing: .25rem;--container-md: 28rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--radius-lg: .5rem;--radius-xl: .75rem;--radius-3xl: 1.5rem;--shadow-2xl: var(--shadow-2xl);--ease-out: cubic-bezier(0, 0, .2, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--animate-spin: spin 1s linear infinite;--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono);--shadow-boxy: var(--shadow-boxy);--shadow-subtle: var(--shadow-subtle);--shadow-subtle2: var(--shadow-subtle2);--shadow-3xl: 0px 12px 24px 0px #4750760A;--color-background: var(--background);--color-foreground: var(--foreground);--color-accent: var(--accent);--color-accent-foreground: var(--accent-foreground);--color-popover: var(--popover);--color-popover-foreground: var(--popover-foreground);--color-border: var(--border);--color-input-bg: var(--input-bg);--color-input-foreground: var(--input-foreground);--color-label: var(--label);--color-card: var(--card);--color-ring: var(--ring);--color-placeholder: var(--placeholder);--color-caption: var(--caption);--color-disabled: var(--disabled);--color-caption-error: var(--accent-foreground);--color-menu-bg: var(--menu-bg);--color-tooltip-bg: var(--tooltip-bg);--color-error-6: #F43F5E;--color-primary-10: #011947;--color-primary-20: #002C72;--color-primary-30: #1D438F;--color-primary-40: #395BA9;--color-primary-60: #6E8EDF;--color-primary-80: #B1C5FF;--color-primary-95: #EEF0FF;--color-primary-100: #304499;--color-secondary-5: #FFC87F}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-6{bottom:calc(var(--spacing) * 6)}.z-1{z-index:1}.z-10{z-index:10}.container{width:100%;@media(width>=40rem){max-width:40rem}@media(width>=48rem){max-width:48rem}@media(width>=64rem){max-width:64rem}@media(width>=80rem){max-width:80rem}@media(width>=96rem){max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-block{display:inline-block}.aspect-\\[3\\/4\\]{aspect-ratio:3/4}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-30{width:calc(var(--spacing) * 30);height:calc(var(--spacing) * 30)}.size-44{width:calc(var(--spacing) * 44);height:calc(var(--spacing) * 44)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-12{height:calc(var(--spacing) * 12)}.h-\\[80\\%\\]{height:80%}.h-\\[90\\%\\]{height:90%}.h-\\[400px\\]{height:400px}.h-full{height:100%}.max-h-60{max-height:calc(var(--spacing) * 60)}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing) * 4)}.w-12{width:calc(var(--spacing) * 12)}.w-\\[35\\%\\]{width:35%}.w-\\[80\\%\\]{width:80%}.w-full{width:100%}.max-w-\\[55\\%\\]{max-width:55%}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-\\[500px\\]{max-width:500px}.max-w-md{max-width:var(--container-md)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.rotate-180{rotate:180deg}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-3{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-4{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-5{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-6{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-full{border-radius:calc(infinity * 1px)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-\\[\\#CBD5E1\\]{border-color:#cbd5e1}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-\\[\\#262A2F\\]{background-color:#262a2f}.bg-\\[\\#F8F8F8\\]{background-color:#f8f8f8}.bg-\\[rgba\\(0\\,0\\,0\\,0\\.6\\)\\]{background-color:#0009}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-secondary-5{background-color:var(--color-secondary-5)}.bg-white{background-color:var(--color-white)}.stroke-\\[\\#62DF98\\]{stroke:#62df98}.stroke-error-6\\/60{stroke:color-mix(in srgb,#F43F5E 60%,transparent);@supports (color: color-mix(in lab,red,red)){stroke:color-mix(in oklab,var(--color-error-6) 60%,transparent)}}.stroke-white\\/50{stroke:color-mix(in srgb,#FFFFFF 50%,transparent);@supports (color: color-mix(in lab,red,red)){stroke:color-mix(in oklab,var(--color-white) 50%,transparent)}}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:calc(var(--spacing) * 2)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-24\\!{padding-block:calc(var(--spacing) * 24)!important}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.font-\\[monospace\\]{font-family:monospace}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\\[14px\\]{font-size:14px}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-all{word-break:break-all}.text-error-6{color:var(--color-error-6)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-500{--tw-duration: .5s;transition-duration:.5s}.ease-in-out{--tw-ease: var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease: var(--ease-out);transition-timing-function:var(--ease-out)}.hover\\:rounded-3xl{&:hover{@media(hover:hover){border-radius:var(--radius-3xl)}}}.hover\\:border-gray-100{&:hover{@media(hover:hover){border-color:var(--color-gray-100)}}}.hover\\:border-gray-400{&:hover{@media(hover:hover){border-color:var(--color-gray-400)}}}.hover\\:\\!bg-transparent{&:hover{@media(hover:hover){background-color:transparent!important}}}.focus\\:border-\\[\\#E8EAF6\\]{&:focus{border-color:#e8eaf6}}.focus\\:border-\\[\\#E8F5E9\\]{&:focus{border-color:#e8f5e9}}.focus\\:border-\\[\\#FFF8E1\\]{&:focus{border-color:#fff8e1}}.focus\\:ring-2{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:ring-\\[\\#E8EAF6\\]{&:focus{--tw-ring-color: #E8EAF6}}.focus\\:ring-\\[\\#E8F5E9\\]{&:focus{--tw-ring-color: #E8F5E9}}.focus\\:ring-\\[\\#FFF8E1\\]{&:focus{--tw-ring-color: #FFF8E1}}.focus\\:outline-none{&:focus{--tw-outline-style: none;outline-style:none}}.disabled\\:opacity-50{&:disabled{opacity:50%}}.max-\\[450px\\]\\:\\!w-\\[calc\\(100vw_-_2rem\\)\\]{@media(width<450px){width:calc(100vw - 2rem)!important}}.max-sm\\:w-\\[80vw\\]{@media(width<40rem){width:80vw}}.sm\\:px-\\[6\\%\\]{@media(width>=40rem){padding-inline:6%}}.md\\:right-8{@media(width>=48rem){right:calc(var(--spacing) * 8)}}.md\\:bottom-6{@media(width>=48rem){bottom:calc(var(--spacing) * 6)}}.md\\:flex{@media(width>=48rem){display:flex}}.md\\:justify-between{@media(width>=48rem){justify-content:space-between}}.md\\:justify-start{@media(width>=48rem){justify-content:flex-start}}.md\\:bg-transparent\\!{@media(width>=48rem){background-color:transparent!important}}.md\\:px-10{@media(width>=48rem){padding-inline:calc(var(--spacing) * 10)}}.md\\:text-xl{@media(width>=48rem){font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}}.\\[\\&_li\\]\\:hover\\:bg-transparent\\!{& li{&:hover{@media(hover:hover){background-color:transparent!important}}}}}@font-face{font-family:Lexend;src:url(./assets/fonts/Lexend-Regular.ttf)}@font-face{font-family:LexendMedium;src:url(./assets/fonts/Lexend-Medium.ttf)}@font-face{font-family:LexendSemibold;src:url(./assets/fonts/Lexend-SemiBold.ttf)}@font-face{font-family:LexendBold;src:url(./assets/fonts/Lexend-Bold.ttf)}:root{font-family:Lexend,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--background: #f8fafc;--foreground: #334155;--primary: #202d66;--primary-foreground: #ffffff;--input-bg: #ffffff;--input-foreground: #475569;--label: #475569;--placeholder: #94a3b8;--caption: #64748b;--caption-error: #f43f5e;--disabled: #f1f5f9;--card: #ffffff;--card-foreground: oklch(.985 0 0);--popover: #ffffff;--popover-foreground: #475569;--menu-bg: #f1f5f9;--accent: #e9eeff;--accent-foreground: #4d61b0;--secondary: #1e293b;--secondary-foreground: 0 0% 100%;--muted: #64748b;--muted-foreground: #94a3b8;--border: #e2e8f0;--ring: #4d61b0;--destructive: #f43f5e;--destructive-foreground: #cc135f;--tooltip-bg: #212529;--shadow-boxy: 0px 1px 2px 0px #0a0d120d;--shadow-subtle: 0px 11.76px 22.06px 0px #00000014;--shadow-subtle2: 0px 4px 8px 0px #9898980a;--shadow-2xl: 0px 24px 48px -12px #0a0d122e;--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08)}@layer utilities{.bg-background{background-color:var(--color-background)}.bg-foreground{background-color:var(--color-foreground)}.bg-accent{background-color:var(--color-accent)}.bg-accent-foreground{background-color:var(--color-accent-foreground)}.bg-popover{background-color:var(--color-popover)}.bg-popover-foreground{background-color:var(--color-popover-foreground)}.bg-border{background-color:var(--color-border)}.bg-input-bg{background-color:var(--color-input-bg)}.bg-input-foreground{background-color:var(--color-input-foreground)}.bg-label{background-color:var(--color-label)}.bg-card{background-color:var(--color-card)}.bg-ring{background-color:var(--color-ring)}.bg-placeholder{background-color:var(--color-placeholder)}.bg-caption{background-color:var(--color-caption)}.bg-disabled{background-color:var(--color-disabled)}.bg-caption-error{background-color:var(--color-caption-error)}.bg-menu-bg{background-color:var(--color-menu-bg)}.bg-tooltip-bg{background-color:var(--color-tooltip-bg)}.text-background{color:var(--color-background)}.text-foreground{color:var(--color-foreground)}.text-accent{color:var(--color-accent)}.text-accent-foreground{color:var(--color-accent-foreground)}.text-popover{color:var(--color-popover)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-border{color:var(--color-border)}.text-input-bg{color:var(--color-input-bg)}.text-input-foreground{color:var(--color-input-foreground)}.text-label{color:var(--color-label)}.text-card{color:var(--color-card)}.text-ring{color:var(--color-ring)}.text-placeholder{color:var(--color-placeholder)}.text-caption{color:var(--color-caption)}.text-disabled{color:var(--color-disabled)}.text-caption-error{color:var(--color-caption-error)}.text-menu-bg{color:var(--color-menu-bg)}.text-tooltip-bg{color:var(--color-tooltip-bg)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-800{background-color:var(--color-gray-800)}.text-gray-50{color:var(--color-gray-50)}.text-gray-100{color:var(--color-gray-100)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.bg-primary-10{background-color:var(--color-primary-10)}.bg-primary-20{background-color:var(--color-primary-20)}.bg-primary-30{background-color:var(--color-primary-30)}.bg-primary-40{background-color:var(--color-primary-40)}.bg-primary-60{background-color:var(--color-primary-60)}.bg-primary-80{background-color:var(--color-primary-80)}.bg-primary-95{background-color:var(--color-primary-95)}.bg-primary-100{background-color:var(--color-primary-100)}.text-primary-10{color:var(--color-primary-10)}.text-primary-20{color:var(--color-primary-20)}.text-primary-30{color:var(--color-primary-30)}.text-primary-40{color:var(--color-primary-40)}.text-primary-60{color:var(--color-primary-60)}.text-primary-80{color:var(--color-primary-80)}.text-primary-95{color:var(--color-primary-95)}.text-primary-100{color:var(--color-primary-100)}.shadow-boxy{box-shadow:var(--shadow-boxy)}.shadow-subtle{box-shadow:var(--shadow-subtle)}.shadow-subtle2{box-shadow:var(--shadow-subtle2)}.shadow-2xl{box-shadow:var(--shadow-2xl)}.shadow-3xl{box-shadow:var(--shadow-3xl)}.font-semibold{font-family:LexendSemibold}.font-bold{font-family:LexendBold}.font-medium{font-family:LexendMedium}}.sc-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:999999}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-blur{syntax: "*"; inherits: false;}@property --tw-brightness{syntax: "*"; inherits: false;}@property --tw-contrast{syntax: "*"; inherits: false;}@property --tw-grayscale{syntax: "*"; inherits: false;}@property --tw-hue-rotate{syntax: "*"; inherits: false;}@property --tw-invert{syntax: "*"; inherits: false;}@property --tw-opacity{syntax: "*"; inherits: false;}@property --tw-saturate{syntax: "*"; inherits: false;}@property --tw-sepia{syntax: "*"; inherits: false;}@property --tw-drop-shadow{syntax: "*"; inherits: false;}@property --tw-drop-shadow-color{syntax: "*"; inherits: false;}@property --tw-drop-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-drop-shadow-size{syntax: "*"; inherits: false;}@property --tw-duration{syntax: "*"; inherits: false;}@property --tw-ease{syntax: "*"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse: 0;--tw-border-style: solid;--tw-font-weight: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-blur: initial;--tw-brightness: initial;--tw-contrast: initial;--tw-grayscale: initial;--tw-hue-rotate: initial;--tw-invert: initial;--tw-opacity: initial;--tw-saturate: initial;--tw-sepia: initial;--tw-drop-shadow: initial;--tw-drop-shadow-color: initial;--tw-drop-shadow-alpha: 100%;--tw-drop-shadow-size: initial;--tw-duration: initial;--tw-ease: initial}}}
2
+ `);import Zt from"react";import{useState as q,useEffect as Yt,useMemo as De}from"react";import{jsx as xt}from"react/jsx-runtime";function ie({selectedTheme:t}){return xt("div",{className:"mx-auto animate-spin rounded-full h-12 w-12 border-b-2 ",style:{borderColor:t.primaryColor}})}import{twMerge as kt}from"tailwind-merge";import Ft from"clsx";import{FaceLandmarker as Et,FilesetResolver as Tt}from"@mediapipe/tasks-vision";var Ue={default:{primaryColor:"#4d61b0",secondaryColor:"#E8EAF6",buttonText:"#FFFFFF",borderRadius:"4px",focus:"focus:outline-none focus:ring-2 focus:ring-[#E8EAF6] focus:border-[#E8EAF6]"},sunset_gold:{primaryColor:"#FFD700",secondaryColor:"#FFF8E1",buttonText:"#5D4037",borderRadius:"8px",focus:"focus:outline-none focus:ring-2 focus:ring-[#FFF8E1] focus:border-[#FFF8E1]"},midnight_blue:{primaryColor:"#1A237E",secondaryColor:"#E8EAF6",buttonText:"#FFFFFF",borderRadius:"4px",focus:"focus:outline-none focus:ring-2 focus:ring-[#E8EAF6] focus:border-[#E8EAF6]"},forest_emerald:{primaryColor:"#2E7D32",secondaryColor:"#E8F5E9",buttonText:"#FFFFFF",borderRadius:"12px",focus:"focus:outline-none focus:ring-2 focus:ring-[#E8F5E9] focus:border-[#E8F5E9]"}},He=t=>Ue[t]||Ue.default;function x(...t){return kt(Ft(t))}var Ae=t=>t.map(e=>({label:e,value:e}));var je=async t=>{let e=await Tt.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"),r=await Et.createFromOptions(e,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},runningMode:"IMAGE"}),o=new Image,s=URL.createObjectURL(t);o.src=s,await o.decode(),URL.revokeObjectURL(s);let n=r.detect(o);if(n.faceLandmarks&&n.faceLandmarks.length>0){let a=n.faceLandmarks[0],i=document.createElement("canvas"),l=i.getContext("2d"),k=a.map(m=>m.x*o.width),v=a.map(m=>m.y*o.height),E=Math.min(...k),u=Math.max(...k),T=Math.min(...v),w=Math.max(...v),c=u-E,y=w-T,F=c*.5;return i.width=224,i.height=224,l?.drawImage(o,E-F,T-F,c+F*2,y+F*2,0,0,224,224),r.close(),new Promise(m=>i.toBlob(m,"image/jpeg",.95))}return r.close(),null};function se(t,e,r){return new File([t],e,{type:r||t.type,lastModified:Date.now()})}var ze={data_verification:{key:"data_verification",title:"Data verification",subtitle:"Businesses that store, process, or transmit credit or debit card information maintain a secure environment.",preview:"Verify your identity with personal data"},document_verification:{key:"document_verification",title:"Document verification",subtitle:"Businesses that store, process, or transmit credit or debit card information maintain a secure environment.",preview:"Verify your identity with ID documents"}},ve={global:{passport:{title:"Passport",key:"passport"}},kenya:{},nigeria:{bvn:{title:"Bank Verification Number (BVN)",key:"bvn"},nin:{title:"National Identity Number (NIN)",key:"nin"},passport:{title:"Nigeria Passport",key:"passport"}}};var Be=`
3
+ block bg-white w-full px-2 py-1.5 rounded-lg
4
+ border border-gray-300
5
+ shadow-sm
6
+ text-gray-700 text-sm
7
+ transition-all
8
+ hover:border-gray-400`;var Oe=["liveness-intro","liveness-check","success-confirmation"];import{jsx as K,jsxs as be}from"react/jsx-runtime";function we({config:t,selectedTheme:e,onNext:r}){return be("section",{className:"space-y-4",children:[be("section",{className:"space-y-2",children:[K("h3",{className:"text-left text-2xl font-semibold text-gray-600",children:"Verify your identity"}),K("p",{className:"text-left text-sm text-gray-500",children:"Please note that you need to be on a well-connected network to complete this verification. You will undergo the following verification:"})]}),K("div",{className:"w-full space-y-5 pb-2 pt-3",children:Object.values(ze).map(o=>t.verification_type?.includes(o.key)?K("button",{className:x("flex w-full items-start justify-start gap-2 rounded-3xl px-4 py-3","pointer-events-none border border-gray-200"),children:be("div",{className:"space-y-1",children:[K("p",{className:x("text-md text-left font-semibold","text-gray-600"),children:o.title}),K("p",{className:x("text-left text-sm text-gray-500"),children:o.preview})]})},o.key):null)}),K("button",{onClick:r,className:x("text-md h-12 w-full rounded-xl text-center font-semibold text-white"),style:{background:e.primaryColor},children:"Continue"})]})}import{useMemo as ce,useRef as Nt,useState as Ct}from"react";import{useState as Ke,useRef as $e,useEffect as Ge}from"react";import{jsx as W,jsxs as qe}from"react/jsx-runtime";function le({options:t,value:e,onChange:r,selectedTheme:o,placeholder:s}){let[n,a]=Ke(!1),i=$e(null),l=$e(null),[k,v]=Ke(0);Ge(()=>{let u=T=>{l.current&&!l.current.contains(T.target)&&i.current&&!i.current.contains(T.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]),Ge(()=>{i.current&&v(i.current.offsetWidth)},[i.current?.offsetWidth,n]);let E=t.find(u=>u.value===e)?.label||s||"Select";return qe("div",{className:"relative inline-block text-left w-full",children:[qe("button",{ref:i,onClick:()=>a(!n),className:x(`
9
+ w-full px-4 py-2 rounded-lg border border-gray-300
10
+ shadow-sm text-gray-700 text-sm
11
+ bg-white
12
+ flex justify-between items-center
13
+ capitalize
14
+ `,o.focus),children:[W("span",{children:E}),W("svg",{className:`w-4 h-4 ml-2 transition-transform duration-200 ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:W("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&W("div",{ref:l,className:"absolute z-10 mt-1 bg-white shadow-lg rounded-lg max-h-60 overflow-auto",style:{width:k},children:t.map(u=>W("div",{onClick:()=>{r(u.value),a(!1)},className:`
15
+ cursor-pointer px-4 py-2 text-sm text-gray-700 capitalize
16
+ ${u.value===e?"font-semibold":""}
17
+ `,children:u.label},u.value))})]})}import P from"react-hot-toast";var Qe="./trash-KETR47RP.svg";import{jsx as h,jsxs as U}from"react/jsx-runtime";var Ve=200;function xe({config:t,selectedTheme:e,onSubmit:r,handleIdUpdate:o,idFile:s}){let n=Nt(null),[a,i]=Ct({identifier:"",identifier_type:"",country:""}),l=ce(()=>Object.keys(t.channels||{}),[t.channels]),k=ce(()=>{let c={};return(t?.channels?.[a.country]||[])?.forEach(F=>{let m=ve?.[a?.country]?.[F]||null;m&&(c[F]=m)}),c},[t.channels,a.country]),v=ce(()=>ve?.[a.country||""]?.[a?.identifier_type||""]||null,[a?.identifier_type]),E=ce(()=>Object.entries(k).map(c=>{let[y,F]=c;return{label:F.title,value:y}}),[k]),u=(c,y)=>{i(F=>({...F,[c]:y}))},T=()=>{n.current&&(n.current.value="",n.current.files=null),o(void 0,void 0)},w=async c=>{let y=c.target.files?.[0];if(!y)return;if(!["image/jpeg","image/png"].includes(y.type)){P.error("Only JPG and PNG files are allowed."),c.target.value="";return}if(y?.size>1024*Ve){P.error(`Max file size is ${Ve}kb`);return}T(),P.loading("Scanning document for photo...");try{let m=await je(y);if(!m){P.dismiss(),P.error("Could not find a clear face on this ID. Please upload a clearer image.");return}let C=new FileReader;C.onload=function(){let j=C.result},C.readAsDataURL(m);let I=`snapshot-${new Date().getTime()}.jpg`,H=new File([m],I,{type:"image/jpeg"});P.dismiss(),P.success("ID Photo extracted!"),o(y,H)}catch{P.dismiss(),P.error("Error processing document. Please upload a document with your face on it")}};return U("section",{className:"space-y-6",children:[U("section",{className:"space-y-2",children:[h("h3",{className:"text-left text-2xl font-semibold text-gray-600",children:"Verify your identity"}),h("p",{className:"text-left text-sm text-gray-500",children:"Identity verification. Please note that you need to be on a well-connected network to complete this verification."})]}),U("div",{className:"mx-auto space-y-5",children:[U("div",{children:[h("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:"Country"}),h(le,{options:Ae(l),onChange:c=>u("country",c),value:a.country,selectedTheme:e,placeholder:"Select country"})]}),U("div",{children:[h("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:"Verification Channel"}),h(le,{options:E,onChange:c=>u("identifier_type",c),value:a.identifier_type,selectedTheme:e,placeholder:"Select verification channel"})]}),a.identifier_type?U("div",{children:[h("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:v?.title||"Input"}),h("input",{ref:n,type:"text",placeholder:"Enter "+a.identifier_type,value:a.identifier,onChange:c=>u("identifier",c.target.value),className:x(Be,e.focus)})]}):null,a?.identifier_type&&t?.verification_type?.includes("document_verification")?U("div",{children:[h("label",{className:"block text-sm font-medium text-gray-700 mb-1 text-left",children:"Upload identity document"}),U("div",{className:"flex w-full cursor-pointer flex-col items-center justify-center gap-1 rounded-xl border-4 border-dashed border-[#CBD5E1] bg-[#F8F8F8] px-4 py-6",children:[h("input",{type:"file",name:"id-doc",id:"id-doc",hidden:!0,onChange:w},s?s.name:"empty"),h("label",{htmlFor:"id-doc",className:"text-center text-sm text-gray-600",children:"Click to upload"}),h("p",{className:"text-center text-sm font-normal text-gray-400",children:"Accepted file types: JPG, PNG"})]}),h("p",{className:"text-sm text-gray-600 font-semibold",children:"Max file size: 200KB"}),s&&h("aside",{className:"mt-3",children:h("ul",{children:U("li",{className:"m-0 mb-1 flex justify-between gap-3 p-2 hover:rounded-3xl hover:border-1.5 hover:border-gray-100 hover:!bg-transparent",children:[h("div",{className:"flex flex-1 gap-3",children:h("div",{className:"flex flex-1 flex-col",children:h("p",{className:"break-all text-left text-[14px] font-normal text-gray-600",children:s?.name})})}),h("div",{className:"flex shrink-0 gap-2",children:h("button",{onClick:T,className:"text-lg font-semibold",children:h("img",{src:Qe,className:"size-5 mx-auto shrink-0",alt:"delete"})})})]})})})]}):null]}),h("button",{onClick:()=>r(a.identifier,a.identifier_type,a.country),className:x("text-md h-12 w-full rounded-xl text-center font-semibold disabled:opacity-50"),disabled:!a?.country||!a?.identifier||!a?.identifier_type||!s&&t.verification_type.includes("document_verification"),style:{background:e.primaryColor,color:e.buttonText},children:"Continue"}),h("div",{className:"w-full h-12"})]})}import{jsx as X,jsxs as de}from"react/jsx-runtime";function ke({selectedTheme:t,onStart:e}){return de("section",{className:"mt-8 space-y-6",children:[de("section",{className:"space-y-2",children:[X("h3",{className:"text-left text-2xl font-semibold text-gray-600",children:"Liveliness Check"}),de("p",{className:"text-left text-sm text-gray-500",children:["Make sure you are in a well lit area, hold your phone at eye level and look straight into the camera."," "]})]}),de("ul",{className:"mx-auto max-w-[80%] list-disc text-sm text-gray-600 [&_li]:hover:bg-transparent!",children:[X("li",{children:"Stay in a well lit area with your eyes clearly visible. "}),X("li",{children:"Remove anything covering your face like masks, glasses, hats."}),X("li",{children:"Follow the onscreen instruction for face capture."})]}),X("button",{onClick:e,className:x("text-md h-12 w-full rounded-xl text-center font-semibold "),style:{background:t.primaryColor,color:t.buttonText},children:"Take a selfie"})]})}import ge,{Toaster as at}from"react-hot-toast";import{useEffect as ue,useRef as N,useState as R}from"react";import{FaceLandmarker as At,FilesetResolver as jt}from"@mediapipe/tasks-vision";var Dt=[362,385,387,263,373,380],Rt=[33,160,158,133,153,144],Ye=t=>{let e=s=>{let n=s.map(k=>t[k]),a=Math.hypot(n[1].x-n[5].x,n[1].y-n[5].y),i=Math.hypot(n[2].x-n[4].x,n[2].y-n[4].y),l=Math.hypot(n[0].x-n[3].x,n[0].y-n[3].y);return(a+i)/(2*l)},r=e(Dt),o=e(Rt);return(r+o)/2<.18},Fe=t=>{let e=t[1].x,r=t[234].x,s=t[454].x-r,n=(e-r)/s;return n<.35?"LEFT":n>.65?"RIGHT":"CENTER"},It=13,_t=14,Lt=78,Mt=308,We=t=>{let e=t[It],r=t[_t],o=t[Lt],s=t[Mt],n=Math.hypot(e.x-r.x,e.y-r.y),a=Math.hypot(o.x-s.x,o.y-s.y);return n/a>.35};var Xe="http://localhost:8000";var $=class{constructor(e,r){D(this,"baseUrl");D(this,"timeout");D(this,"session");D(this,"onError");D(this,"destroy");this.baseUrl=Xe,this.timeout=e.timeout||45e3,this.session=e.session,this.onError=e.onError,this.destroy=r}async request(e,r,o,s){let n=new AbortController,a=setTimeout(()=>n.abort(),this.timeout);try{let i=o instanceof FormData,l=await fetch(`${this.baseUrl}${r}`,{method:e,headers:{Authorization:`Session ${this.session}`,...s||{},...i?{}:{"Content-Type":"application/json"}},body:o?i?o:JSON.stringify(o):void 0,signal:n.signal});if(!(l.headers.get("content-type")||"").includes("application/json"))throw new Error(`Unexpected response from ${r} (${l.status})`);let v;try{v=await l.json()}catch{v=null}if(!l.ok){let E=v?.message||v?.error||`Error: ${l.status}`;throw{status:l.status,message:E,data:v}}return v}catch(i){throw i.name==="AbortError"?this.onError?.({error:i,message:"Request timeout",code:"TIMEOUT_ERROR"}):i.status==403||i.status==401?(this.onError?.({error:i,message:"Session expired. Please restart the process",code:"AUTH_ERROR"}),console.error("Authentication failed. Session is no longer valid."),setTimeout(()=>{typeof this.destroy=="function"&&this.destroy()},2e3)):this.onError?.({error:i||i.data,message:"An error occured",code:"UNKNOWN_ERROR"}),i}finally{clearTimeout(a)}}post(e,r,o){return this.request("POST",e,r,o)}patch(e,r,o){return this.request("PATCH",e,r,o)}get(e){return this.request("GET",e)}};import me from"react-hot-toast";import{useEffect as Pt,useState as Ut}from"react";import{jsx as pe,jsxs as Ee}from"react/jsx-runtime";function Te({onComplete:t,canClose:e}){let[r,o]=Ut(0);return Pt(()=>{let s;return r<99?s=setInterval(()=>{o(n=>{let a=Math.floor(Math.random()*10)+1,i=n+a;return i>=99?99:i})},500):r===99&&e&&(o(100),t&&t()),()=>clearInterval(s)},[r,e,t]),Ee("div",{className:"mt-8 space-y-4",children:[Ee("section",{className:"space-y-1",children:[pe("h3",{className:"text-center animate-pulse text-2xl font-semibold text-gray-600",children:"Finalizing Verification..."}),pe("p",{className:"text-center text-sm text-gray-600",children:"Please do not close this page"})]}),pe("div",{className:"w-full max-w-[55%] mx-auto bg-gray-100 rounded-full h-2",children:pe("div",{className:"bg-secondary-5 h-2 rounded-full transition-all duration-300 ease-out",style:{width:`${r}%`}})}),Ee("p",{className:"text-center text-sm text-gray-600",children:[r,"%"]})]})}var Ze="./loading-5HD36QXU.svg";import{Fragment as Bt,jsx as _,jsxs as fe}from"react/jsx-runtime";var A=[{id:"CENTER",label:"Center your face in the oval",subtitle:"Position your face inside of the circle and take a photo."},{id:"BLINK",label:"Blink your eyes",subtitle:"While your face is centered, blink your eyes twice."},{id:"TURN_HEAD",label:"Turn your head",subtitle:"Slowly turn your head left or right"},{id:"OPEN_MOUTH",label:"Open your mouth",subtitle:"Open your mouth"}],zt=({sdkInstance:t,updateStep:e,config:r,idFile:o,snapshotFile:s,identityFormData:n})=>{let a=N(null),i=N(null),l=N(0),k=N(0),v=N(null),E=N(null),u=N(null),T=N(!1),w=N(null),c=N(!1),[y,F]=R(0),[m,C]=R(!1),[I,H]=R(!1),[j,z]=R(),[J,Re]=R(null),[he,Ie]=R(),[st,ee]=R(!1),[lt,te]=R(!1),[ct,dt]=R(!1),[B,pt]=R(!1),[G,re]=R("neutral"),[ut,_e]=R(!1),Q=N(!1),M=N(null),oe=N([]),Le=()=>{E.current&&cancelAnimationFrame(E.current),v.current&&(v.current.getTracks().forEach(d=>d.stop()),v.current=null),a.current&&(a.current.srcObject=null)},ae=()=>{Q.current||l.current>=A.length||(Q.current=!0,re("success"),u.current&&clearTimeout(u.current),setTimeout(()=>{if(l.current<A.length-1){let d=l.current+1;F(d),re("neutral"),Q.current=!1}else console.log("\u{1F38A} All actions done!"),mt()},2e3))},mt=async()=>{te(!0),Le();let d;he||(d=await Me()),await ht(d)},ft=()=>{Re(null),z(void 0),H(!1),C(!1),ee(!1),_e(!1),F(0),Ie(void 0)},gt=()=>new Promise(d=>{if(!a.current)return null;let S=document.createElement("canvas");S.width=a.current.videoWidth,S.height=a.current.videoHeight,S.getContext("2d")?.drawImage(a.current,0,0),S.toBlob(p=>{d(p)},"image/jpeg",.9)}),ht=async d=>{let S=d||he;if(!w.current?.id||!S){me.error("Invalid payload"),ft(),te(!1);return}let f=new $(t);try{te(!0);let p=new FormData;p.append("entry",w.current.id.toString()),p.append("session",t.session),p.append("video_file",S),(await f.post("/v1/liveness/submit/",p)).status=="success"&&dt(!0)}catch(p){let g=p?.message||p.response?.data?.message||"Submission failed";me.error(g),t.onError?.({error:p,message:g,code:"SUBMISSION_ERROR"}),setTimeout(()=>{window.location.reload()},3e3)}};ue(()=>{if(!(!B||y>=A.length))return re("neutral"),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{re("error")},5e3),()=>{u.current&&clearTimeout(u.current)}},[y,B]),ue(()=>{l.current=y},[y]),ue(()=>{if(J||!j||st||T.current||!n)return;let d=new $(t);(async()=>{T.current=!0;try{let f=new FormData;f.append("sdk_config",r.id.toString()),f.append("autoshot_file",j),f.append("challenge_actions",JSON.stringify(A.filter(g=>g.id!=="CENTER").map(g=>g.id))),f.append("identifier",n.identifier),f.append("identifier_type",n.identifier_type),f.append("country",n?.country),r.verification_type.includes("document_verification")&&(f.append("id_file",o),f.append("snapshot_file",s)),ee(!0);let p=await d.post("/v1/liveness/create/",f);p.status=="success"&&p.data&&setTimeout(()=>{Re(p.data),w.current=p.data,ee(!1)},1500)}catch(f){let p=f?.message||f.response?.data?.message||"An error occured. Please try again";me.error(p),t.onError?.({error:f,message:p,code:"ENTRY_CREATION_ERROR"}),ee(!1),setTimeout(()=>{window.location.reload()},3e3)}})()},[J,j]),ue(()=>{if(ut)return;_e(!0);let d,S,f=async()=>{let g=await jt.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm");d=await At.createFromOptions(g,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numFaces:1}),d&&!B&&pt(!0),S=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:480},height:{ideal:640},frameRate:{ideal:15}}}),a.current&&(a.current.srcObject=S,a.current.onloadedmetadata=()=>{a.current?.play(),p()})},p=async()=>{if(!a.current||!d||G==="success"||Q.current){E.current=requestAnimationFrame(p);return}let g=performance.now(),O=d.detectForVideo(a.current,g);if(O.faceLandmarks&&O.faceLandmarks.length>0){let V=O.faceLandmarks[0],ne=A[l.current];if(l.current==A.length)return;if(ne.id==="CENTER"){let Y=V[1];if(Y.x>.4&&Y.x<.6&&Y.y>.4&&Y.y<.6){if(!c.current){c.current=!0;let Pe=await gt();if(Pe){let vt=se(Pe,`autoshot-${t.session}.jpg`,"image/jpeg");z(vt),H(!0)}else c.current=!1}c.current&&w.current&&!Q.current&&(M.current?.state!=="recording"&&yt(S),ae())}}else ne.id==="BLINK"?Ye(V)?ae():k.current=0:ne.id==="TURN_HEAD"?(Fe(V)==="LEFT"||Fe(V)==="RIGHT")&&ae():ne.id==="OPEN_MOUTH"&&We(V)&&ae()}E.current=requestAnimationFrame(p)};return f(),()=>{Le(),i.current&&clearTimeout(i.current),M.current?.state!=="inactive"&&M.current?.stop()}},[]);let yt=d=>{oe.current=[];let f=["video/webm;codecs=vp8","video/webm","video/mp4"].find(g=>MediaRecorder.isTypeSupported(g));if(!f){me.error("Browser does not support recording");return}let p={mimeType:f,videoBitsPerSecond:25e4};try{M.current=new MediaRecorder(d,p)}catch{M.current=new MediaRecorder(d)}M.current.ondataavailable=g=>{g.data&&g.data.size>0&&oe.current.push(g.data)},M.current.onstop=()=>{let g=new Blob(oe.current,{type:"video/webm"});if(g.size>0){let O=se(g,`session-${t.session}.webm`,"video/webm");Ie(O)}},M.current.start(),i.current=setTimeout(()=>{Me()},2e4)},Me=async()=>{let d=M.current;return!d||d.state==="inactive"?he||void 0:new Promise(S=>{i.current&&(clearTimeout(i.current),i.current=null);let f=()=>{d.removeEventListener("stop",f);let p=new Blob(oe.current,{type:"video/webm"}),g=se(p,`session-${t.session}.webm`,"video/webm");v.current&&v.current.getTracks().forEach(O=>O.stop()),S(g)};d.addEventListener("stop",f),d.stop()})};return _(Bt,{children:lt?_(Te,{canClose:ct,onComplete:()=>{t.onSuccess?.({data:{entryId:w.current?.id,identifier:w.current?.identifier,identifier_type:w.current?.identifier_type,video_url:w.current?.video_url,autoshot_url:w.current?.autoshot_url,document_url:w.current?.document_url||null},status:200,message:"Liveness captured successfully"}),e("success-confirmation"),te(!1)}}):fe("section",{className:"space-y-3 relative flex flex-col items-start justify-center p-4 h-[400px]",children:[fe("div",{className:"text-left",children:[_("h3",{className:"text-2xl font-bold text-gray-600 animate-pulse",children:B?y===0&&!J&&I?"Synchronizing Session...":A[y]?.label:"Getting ready..."}),B&&J?_("p",{className:"text-sm text-gray-500",children:A[y]?.subtitle}):null]}),fe("div",{className:x("relative w-full max-w-md aspect-[3/4] overflow-hidden rounded-3xl",B?"bg-[rgba(0,0,0,0.6)]":"bg-[#262A2F]"),children:[_("video",{ref:a,className:"absolute inset-0 w-full h-full object-cover mirror",muted:!0,playsInline:!0}),B?_("div",{className:"absolute inset-0 pointer-events-none flex items-center justify-center",children:_("svg",{viewBox:"0 0 100 100",className:"w-[80%] h-[80%] overflow-visible",children:_("ellipse",{cx:"50",cy:"50",rx:"35",ry:"45",fill:"none",strokeWidth:"3",className:x("transition-colors duration-500 ease-in-out",G==="neutral"&&"stroke-white/50",G==="success"&&"stroke-[#62DF98]",G==="error"&&"stroke-error-6/60"),style:{filter:G!=="neutral"?`drop-shadow(0 0 8px ${G==="success"?"#22c55e":"#ef4444"})`:"none"}})})}):fe("div",{className:"absolute w-full h-full gap-1.5 pointer-events-none flex flex-col items-center justify-center",children:[_("img",{src:Ze,alt:"loading",className:"size-9 animate-spin"}),_("span",{className:"text-white text-sm text-center",children:"Loading camera"})]})]})]})})},Je=zt;var et="./success-GHUHNWON.svg";import{useEffect as Kt}from"react";import{jsx as Se,jsxs as $t}from"react/jsx-runtime";function Ne({redirect_url:t,destroy:e}){return Kt(()=>{let r=setTimeout(()=>{t?window.location.assign(t):e()},3e3);return()=>clearTimeout(r)},[]),$t("section",{className:"mt-8 space-y-3",children:[Se("img",{src:et,className:"size-44 mx-auto shrink-0",alt:"success-icon"}),Se("h3",{className:"text-center text-2xl font-semibold text-gray-600",children:"Identity verified"}),Se("p",{className:"text-center text-sm text-gray-600",children:"We have successfully verified your identity. You can close this page now."})]})}var tt="./shield-checkmark-JBZCUXJC.png";import{useEffect as rt,useState as ot}from"react";import qt from"react-hot-toast";import{jsxs as Vt}from"react/jsx-runtime";var Qt=180;function Ce({destroy:t,onExpire:e}){let[r,o]=ot(Qt),[s,n]=ot(!1);rt(()=>{let l=setInterval(()=>{o(k=>k>0?k-1:0)},1e3);return()=>clearInterval(l)},[]),rt(()=>{if(r>0&&!s)return;qt.error("Time limit exceeded"),n(!1);let l=setTimeout(()=>{e?.(),t()},1500);return()=>clearTimeout(l)},[r,s]);let a=Math.floor(r/60),i=r%60;return Vt("p",{className:x("text-2xl font-bold font-[monospace]",r<60?"text-error-6":"text-gray-600"),children:[a,":",i.toString().padStart(2,"0")]})}import{jsx as b,jsxs as L}from"react/jsx-runtime";var Wt=({sdkInstance:t})=>{let[e,r]=q("loading"),[o,s]=q(null),[n,a]=q(),[i,l]=q(),[k,v]=q(),[E,u]=q(!1),T=De(()=>t.getConfig(),[t]),w=De(()=>He(o?.theme),[o?.theme]),c=De(()=>({identity:1,"liveness-intro":2,"liveness-check":3})[e]||0,[e]),y=async(m,C,I)=>{if(!n&&o?.verification_type?.includes("document_verification")){ge.error("Please upload ID");return}let H={session_id:T.session,onboarding_type:C,id_number:m,name_to_confirm:"",[C]:m};v({identifier:m,identifier_type:C,country:I});try{let z=await t.getHttp().post("/v1/onboarding/verify",H);z.status==="verified"&&(ge.success(z.message||"Verification successful"),r("liveness-intro"))}catch(j){let z=j?.message||"An error occured. Please try again";ge.error(z)}},F=async(m,C)=>{a(m),l(C)};return Yt(()=>{let m=t.getHttp();(async()=>{try{r("loading");let I=await m.get("/v1/sdk/initialize/");I.status=="success"&&I.data&&setTimeout(()=>{s(I.data),r("welcome")},1500)}catch(I){let H=I?.message||"An error occured. Please try again";ge.error(H),r("")}})()},[]),o?L("main",{id:"smartcomply-sdk-root",className:"sc-overlay overflow-y-auto flex h-full min-h-screen bg-gray-50",children:[b("div",{id:"liveness-container",className:""}),b(at,{}),L("div",{className:"fixed bg-gray-50 top-0 flex w-full items-center justify-between px-4 py-4 md:px-10",children:[b("section",{className:"flex items-center gap-4",children:b("h2",{className:"text-center text-lg font-semibold text-gray-600 md:text-xl",children:o?.brand_name?o?.brand_name:"Brand name"})}),L("div",{className:"flex items-center justify-end gap-4",children:[E?b(Ce,{destroy:t.destroy,onExpire:T?.onExpire}):null,e==="welcome"||e==="loading"?null:b("p",{className:"relative text-center text-sm font-medium text-gray-400",children:c?`Step ${c} of 3`:"All Done"})]})]}),L("div",{className:"fixed z-1 bg-gray-50 md:bg-transparent! bottom-0 flex w-full items-center justify-center px-10 py-4 md:bottom-6 md:right-8 md:justify-between",children:[b("span",{className:"hidden md:flex"}),b("p",{className:"relative pt-2 text-center text-xs font-medium text-gray-400",children:"Powered by Adhere"})]}),b("div",{className:"flex flex-1 items-start justify-center px-4 py-24! sm:px-[6%] md:justify-start h-full",children:L("div",{className:x("w-full max-w-[500px] max-sm:w-[80vw] max-[450px]:!w-[calc(100vw_-_2rem)]",Oe.includes(e)?"mx-auto":""),children:[e==="loading"&&b(ie,{selectedTheme:w}),e==="welcome"&&b(we,{config:o,onNext:()=>{r("identity"),u(!0)},selectedTheme:w}),e==="identity"&&b(xe,{config:o,onSubmit:y,selectedTheme:w,handleIdUpdate:F,idFile:n}),e==="liveness-intro"&&b(ke,{config:o,onStart:()=>r("liveness-check"),selectedTheme:w}),e==="liveness-check"&&b(Je,{config:o,updateStep:m=>r(m),sdkInstance:T,idFile:n,snapshotFile:i,identityFormData:k}),e==="success-confirmation"&&b(Ne,{destroy:t.destroy,redirect_url:o.redirect_url})]})}),e==="loading"||e==="welcome"?L("div",{className:"relative hidden w-[35%] bg-gray-100 h-full md:flex",children:[L("section",{className:"mx-auto flex h-[90%] max-w-[90%] flex-col justify-center space-y-4",children:[b("img",{src:tt,className:"size-30 mx-auto shrink-0",alt:"shield-checkmark"}),L("section",{className:"space-y-2",children:[L("h3",{className:"text-center text-xl font-semibold text-gray-600",children:["Welcome to"," ",o?.brand_name?o?.brand_name:"Brand Name"]}),b("p",{className:"break-all text-center text-sm text-gray-500",children:o?.description?o?.description:"Description"})]})]})," ",b("div",{className:"absolute bottom-6 flex w-full items-center justify-center",children:b("p",{className:"relative pt-2 text-center text-xs font-medium text-gray-400",children:"Powered by Adhere"})})]}):null]}):L("main",{id:"smartcomply-sdk-root",className:"sc-overlay flex h-full min-h-screen bg-gray-50",children:[b(at,{}),e=="loading"?b(ie,{selectedTheme:w}):null]})},nt=Wt;import{jsx as it}from"react/jsx-runtime";var Z=class{constructor(e){D(this,"http");D(this,"config");D(this,"root",null);D(this,"containerId","smartcomply-sdk-root");D(this,"destroy",()=>{this.root&&(this.root.unmount(),this.root=null);let e=document.getElementById(this.containerId);e&&e.remove(),console.log("SDK Destroyed and cleaned up.")});this.config=e,this.http=new $(e,this.destroy.bind(this))}getConfig(){return this.config}getHttp(){return this.http}launch(){let e=document.getElementById(this.containerId);e||(e=document.createElement("div"),e.id=this.containerId,document.body.appendChild(e)),this.root=Xt(e),this.root.render(it(Zt.StrictMode,{children:it(nt,{sdkInstance:this})}))}};var Ho=Z;export{Z as SmartComply,Ho as default};
@@ -0,0 +1,14 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M20 3.33398V6.66732" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M28.3385 5.56641L26.6719 8.45316" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M34.4336 11.668L31.5469 13.3346" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M36.6693 20H33.3359" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M34.4336 28.3346L31.5469 26.668" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
7
+ <path d="M28.3385 34.4336L26.6719 31.5469" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
8
+ <path d="M20 36.6673V33.334" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <path d="M11.6719 34.4336L13.3385 31.5469" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <path d="M5.57031 28.3346L8.45707 26.668" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path d="M3.33594 20H6.66927" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
12
+ <path d="M5.57031 11.668L8.45707 13.3346" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
13
+ <path d="M11.6719 5.56641L13.3385 8.45316" stroke="#F1F5F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
14
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="264" height="264" viewBox="0 0 264 264" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="264" height="264" rx="132" fill="#ECFDF5"/>
3
+ <path d="M132.001 48.666C86.0846 48.666 48.668 86.0827 48.668 131.999C48.668 177.916 86.0846 215.333 132.001 215.333C177.918 215.333 215.335 177.916 215.335 131.999C215.335 86.0827 177.918 48.666 132.001 48.666ZM171.835 112.833L124.585 160.083C123.418 161.249 121.835 161.916 120.168 161.916C118.501 161.916 116.918 161.249 115.751 160.083L92.168 136.499C89.7513 134.083 89.7513 130.083 92.168 127.666C94.5846 125.249 98.5846 125.249 101.001 127.666L120.168 146.833L163.001 103.999C165.418 101.583 169.418 101.583 171.835 103.999C174.251 106.416 174.251 110.333 171.835 112.833Z" fill="#10B981"/>
4
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14 3.98763C11.78 3.76763 9.54667 3.6543 7.32 3.6543C6 3.6543 4.68 3.72096 3.36 3.8543L2 3.98763" stroke="#F43F5E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M5.66406 3.31398L5.81073 2.44065C5.9174 1.80732 5.9974 1.33398 7.12406 1.33398H8.87073C9.9974 1.33398 10.0841 1.83398 10.1841 2.44732L10.3307 3.31398" stroke="#F43F5E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M12.563 6.09375L12.1297 12.8071C12.0564 13.8537 11.9964 14.6671 10.1364 14.6671H5.85635C3.99635 14.6671 3.93635 13.8537 3.86302 12.8071L3.42969 6.09375" stroke="#F43F5E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M6.88281 11H9.10281" stroke="#F43F5E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M6.33594 8.33398H9.66927" stroke="#F43F5E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
7
+ </svg>
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@smartcomply/web-sdk",
3
+ "private": false,
4
+ "version": "1.0.0",
5
+ "description": "Smartcomply Identity Verification SDK",
6
+ "author": {
7
+ "name": "Tito Adeoye"
8
+ },
9
+ "type": "module",
10
+ "main": "dist/index.js",
11
+ "module": "dist/index.esm.js",
12
+ "types": "dist/index.d.ts",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsup src/index.ts --format cjs,esm --dts --minify --clean --injectStyle",
18
+ "prepublishOnly": "npm run build"
19
+ },
20
+ "dependencies": {
21
+ "@mediapipe/tasks-vision": "^0.10.32",
22
+ "@tailwindcss/vite": "^4.1.18",
23
+ "clsx": "^2.1.1",
24
+ "prettier-plugin-tailwindcss": "^0.7.2",
25
+ "react": "^19.2.0",
26
+ "react-dom": "^19.2.0",
27
+ "react-hot-toast": "^2.6.0",
28
+ "tailwind-merge": "^3.4.0",
29
+ "tailwindcss-animate": "^1.0.7",
30
+ "tsup": "^8.5.1",
31
+ "vite-tsconfig-paths": "^6.1.0"
32
+ },
33
+ "devDependencies": {
34
+ "@eslint/js": "^9.39.1",
35
+ "@tailwindcss/postcss": "^4.2.0",
36
+ "@types/node": "^24.10.1",
37
+ "@types/react": "^19.2.7",
38
+ "@types/react-dom": "^19.2.3",
39
+ "@vitejs/plugin-react": "^5.1.1",
40
+ "autoprefixer": "^10.4.24",
41
+ "eslint": "^9.39.1",
42
+ "eslint-plugin-react-hooks": "^7.0.1",
43
+ "eslint-plugin-react-refresh": "^0.4.24",
44
+ "globals": "^16.5.0",
45
+ "postcss": "^8.5.6",
46
+ "shx": "^0.4.0",
47
+ "tailwindcss": "^4.1.18",
48
+ "typescript": "~5.9.3",
49
+ "typescript-eslint": "^8.48.0",
50
+ "vite": "^7.3.1"
51
+ }
52
+ }