@techlabi/kycrazy-ui-kit 0.35.0 → 0.37.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.37.0
4
+
5
+ ### Fixes
6
+
7
+ - fix issues with KYC
8
+
9
+ ## 0.36.0
10
+
11
+ ### Fixes
12
+
13
+ - fix camera step issues
14
+
3
15
  ## 0.35.0
4
16
 
5
17
  ### Fixes
package/dist/index.es.js CHANGED
@@ -29163,11 +29163,24 @@ class pD {
29163
29163
  default: ["name", "id", "date", "dob", "expiry", "number", "document", "issued"]
29164
29164
  };
29165
29165
  }
29166
+ async toBase64(t) {
29167
+ if (typeof window > "u")
29168
+ return (await (await import("./__vite-browser-external-l0sNRNKZ.js")).readFile(t)).toString("base64");
29169
+ if (t instanceof File)
29170
+ return new Promise((e, r) => {
29171
+ const o = new FileReader();
29172
+ o.onload = () => {
29173
+ const i = o.result.split(",")[1];
29174
+ e(i);
29175
+ }, o.onerror = r, o.readAsDataURL(t);
29176
+ });
29177
+ throw new Error("Unsupported input type for base64 conversion");
29178
+ }
29166
29179
  async validateIdCard(t, e) {
29167
29180
  let r = t;
29168
29181
  if (typeof t != "string") {
29169
- const s = await t.arrayBuffer(), c = Buffer.from(s).toString("base64");
29170
- r = `data:${t.type};base64,${c}`;
29182
+ const s = await this.toBase64(t);
29183
+ r = `data:${t.type || "image/jpeg"};base64,${s}`;
29171
29184
  }
29172
29185
  const {
29173
29186
  data: { text: o }
@@ -29204,8 +29217,8 @@ class pD {
29204
29217
  await this.loadModels();
29205
29218
  let e = t;
29206
29219
  if (typeof t != "string") {
29207
- const i = await t.arrayBuffer(), u = Buffer.from(i).toString("base64");
29208
- e = `data:${t.type};base64,${u}`;
29220
+ const i = await this.toBase64(t);
29221
+ e = `data:${t.type || "image/jpeg"};base64,${i}`;
29209
29222
  }
29210
29223
  const r = await this.fileToImage(e), o = await E9(r, new zu());
29211
29224
  return {
@@ -29595,6 +29608,7 @@ const gD = {
29595
29608
  title: "Upload ID",
29596
29609
  description: "Place your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",
29597
29610
  frameType: "rectangular",
29611
+ documentTypeId: u,
29598
29612
  currentStep: o,
29599
29613
  onRetake: () => {
29600
29614
  h(null);
@@ -29616,6 +29630,7 @@ const gD = {
29616
29630
  title: "Upload ID Back",
29617
29631
  description: "Place the back of your ID inside the frame and take a picture. Make sure it is not cut or has any glare.",
29618
29632
  frameType: "rectangular",
29633
+ documentTypeId: u,
29619
29634
  currentStep: o,
29620
29635
  onRetake: () => {
29621
29636
  p(null);
@@ -29637,6 +29652,7 @@ const gD = {
29637
29652
  title: "Selfie",
29638
29653
  description: "Place your face inside the frame and take a picture. Make sure it is clearly visible.",
29639
29654
  frameType: "circular",
29655
+ documentTypeId: u,
29640
29656
  currentStep: o,
29641
29657
  onRetake: () => {
29642
29658
  d(null);