@incodetech/web 2.4.1-agentic.10 → 2.4.1-agentic.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Checkbox-DiUv5uz_.js +152 -0
- package/dist/{GeolocationPermissionDenied-Dag9fchQ.js → GeolocationPermissionDenied-BgR-wfhk.js} +5 -5
- package/dist/{Password-4ht2vsqv.js → Password-Bm6m9Odt.js} +4 -4
- package/dist/{RadioGroup-Cf6xDIm5.js → RadioGroup-B51k7HFw.js} +4 -4
- package/dist/{RequiredLegend-DwaAzhid.js → RequiredLegend-DBqkV44u.js} +2 -2
- package/dist/{RequiredMarker-CGQR8lsb.js → RequiredMarker-euhY-M-q.js} +2 -2
- package/dist/Stepper-Bsi6OUY0.js +426 -0
- package/dist/{TextField-o3qwE7KD.js → TextField-DvBQu9WE.js} +4 -4
- package/dist/ae-signature/ae-signature.es.js +4 -4
- package/dist/{af-ZA-CdJRBJEg.js → af-ZA-R3dt5u2_.js} +41 -0
- package/dist/{ageVerification-u2zo-WUl.js → ageVerification-D2lxCZfL.js} +5 -5
- package/dist/{am-Df9uoE6e.js → am-BHu7GOhs.js} +41 -0
- package/dist/antifraud/antifraud.es.js +5 -5
- package/dist/{applyStudioConfig-Deh55YNW.js → applyStudioConfig-Bi7ubgUr.js} +2 -2
- package/dist/{ar-AE-CAoWsgnA.js → ar-AE-7pR7a7Rk.js} +41 -0
- package/dist/{ar-hyEIwsq9.js → ar-DM3z6uYS.js} +41 -0
- package/dist/{ar-EG-CXi0p-DV.js → ar-EG-LYsd6BEE.js} +41 -0
- package/dist/assets/great-vibes-latin-400-normal.woff2 +0 -0
- package/dist/assets/great-vibes-latin-ext-400-normal.woff2 +0 -0
- package/dist/authentication/authentication.es.js +9 -8
- package/dist/{autoFocusTitle-CNeT8ydU.js → autoFocusTitle-Dpou-oRt.js} +2 -2
- package/dist/{az-CUehzrK3.js → az-2KdCi6qX.js} +41 -0
- package/dist/{back-horizontal-hint-D5xvRtEe.js → back-horizontal-hint-DVmAanm-.js} +1 -1
- package/dist/{back-vertical-hint-DoKJSQhY.js → back-vertical-hint-CHtKdVeQ.js} +1 -1
- package/dist/base.css +1 -1
- package/dist/{baseTutorial-xDkp34JC.js → baseTutorial-BTDnyihW.js} +4 -4
- package/dist/{bn-DStUscj0.js → bn-BmlWLOS3.js} +41 -0
- package/dist/{bottomSheet-COrgITc6.js → bottomSheet-B_gvcGYk.js} +3 -3
- package/dist/{bs-Lq1FPKJj.js → bs-sjiT2AGH.js} +41 -0
- package/dist/{ca-K83Ys4Fe.js → ca-ClW9d7vi.js} +41 -0
- package/dist/cameraOverlay-tevNm9mf.js +2 -0
- package/dist/{cameraOverlayHeader-C7Pi5eIm.js → cameraOverlayHeader-DXrM_mWF.js} +5 -5
- package/dist/{cameraView-B7l40Opf.js → cameraView-DvBalXtW.js} +3 -3
- package/dist/{capture-D7HVD1ht.js → capture-BE61DSsu.js} +21 -21
- package/dist/capture-D64TN_Jk.js +2 -0
- package/dist/capture-D9mFM1bm.js +3 -0
- package/dist/{capture-I1enj-0M.js → capture-DfN4A_fO.js} +10 -10
- package/dist/captureButtonIcon-BluEeg4P.js +1 -0
- package/dist/{captureFocusContext-CNtkY3Lk.js → captureFocusContext-l8PLoc6Z.js} +11 -11
- package/dist/{captureFooter-CucCxqz-.js → captureFooter-Cb78Ph85.js} +5 -5
- package/dist/{ceb-NR8sWgTh.js → ceb-4P7W-PzT.js} +41 -0
- package/dist/certificate-issuance/certificate-issuance.es.js +12 -12
- package/dist/{checkbox-C5k2pepr.js → checkbox-BHmWr1C6.js} +4 -4
- package/dist/{chooser-CNm0MKQl.js → chooser-Bw4Ride9.js} +12 -12
- package/dist/{connectionError-Bs3TO2RP.js → connectionError-D6UQdyHT.js} +5 -5
- package/dist/consent/consent.es.js +23 -32
- package/dist/consent/styles.css +1 -1
- package/dist/consent/styles.css.js +1 -1
- package/dist/{countryDefinitions-DlsV3Tf8.js → countryDefinitions-UXJ0maPk.js} +6 -0
- package/dist/{countryFlag-CZUyZ06G.js → countryFlag-D2eCGWCr.js} +1 -1
- package/dist/{countrySelector-CPgaMT7n.js → countrySelector-mTwAk_wo.js} +4 -4
- package/dist/cross-document-data-match/cross-document-data-match.es.js +5 -5
- package/dist/{cs-CZ-KpSXcWZT.js → cs-CZ-DHfTm0QA.js} +41 -0
- package/dist/{cs-UYoUjOrG.js → cs-qiukbXDQ.js} +41 -0
- package/dist/curp-validation/curp-validation.es.js +17 -19
- package/dist/custom-fields/styles.css +1 -1
- package/dist/custom-fields/styles.css.js +1 -1
- package/dist/{customFields-BcubL9au.js → customFields-Wh1wCbgV.js} +23 -22
- package/dist/{customWatchlist-D4RK0ow6.js → customWatchlist-BVOMDxpw.js} +6 -6
- package/dist/{da-DK-Bds8n-Rj.js → da-DK-BJ0kx3IU.js} +41 -0
- package/dist/{dashboardTheme-DQaxmEq3.js → dashboardTheme-DGCGdRPG.js} +16 -2
- package/dist/dateField-uSn1Tfxh.js +315 -0
- package/dist/{de-CZlvE1Xz.js → de-AwoDSQnT.js} +42 -1
- package/dist/{denied-BeVKpBem.js → denied-C5_YIBd5.js} +7 -7
- package/dist/{devWarn-B4kGEiva.js → devWarn-Ipda56ZX.js} +84 -84
- package/dist/{deviceWallet-7b1VpcGm.js → deviceWallet-DbWiknsf.js} +4 -4
- package/dist/{digitalIdRedirect-CG9jzrQh.js → digitalIdRedirect-CWjKjOpe.js} +4 -4
- package/dist/{digitalIdUpload-BUJcgYY5.js → digitalIdUpload-CBxlskZX.js} +7 -7
- package/dist/document-capture/document-capture.es.js +1 -1
- package/dist/document-signature/document-signature.es.js +379 -0
- package/dist/document-signature/styles.css +2 -0
- package/dist/document-signature/styles.css.js +1 -0
- package/dist/{documentCapture-JcxukEgT.js → documentCapture-CClYtlSL.js} +23 -22
- package/dist/documentCapture-DddzJ7nO.js +2 -0
- package/dist/dropdownComposed-DElId5J9.js +1 -0
- package/dist/{dropdownComposed-yNmLuHxU.js → dropdownComposed-DMbbp8GV.js} +4 -4
- package/dist/dynamic-forms/dynamic-forms.es.js +26 -23
- package/dist/ekyb/ekyb.es.js +1 -1
- package/dist/{ekybModule-Cp-7fs23.js → ekybModule-ByGPRHWw.js} +17 -17
- package/dist/ekybModule-DPuCLgZ9.js +2 -0
- package/dist/ekyc/ekyc.es.js +1 -1
- package/dist/ekyc/styles.css +1 -1
- package/dist/ekyc/styles.css.js +1 -1
- package/dist/ekyc-prefill/ekyc-prefill.es.js +1 -1
- package/dist/{ekycModule-DKUZp3Ww.js → ekycModule-C8DT_5SP.js} +79 -63
- package/dist/ekycModule-DNK6vMOr.js +2 -0
- package/dist/ekycPrefillModule-7Qy3GaZH.js +2 -0
- package/dist/{ekycPrefillModule-DJoeviHP.js → ekycPrefillModule-BlEnF4qc.js} +29 -31
- package/dist/{el-C6tFl9i9.js → el-CqJyvKNt.js} +42 -1
- package/dist/{el-GR-BLkQ_dbO.js → el-GR-DSIPYZOW.js} +41 -0
- package/dist/electronic-signature/electronic-signature.es.js +1 -1
- package/dist/electronic-signature/styles.css +1 -1
- package/dist/electronic-signature/styles.css.js +1 -1
- package/dist/{electronic-signature-D-4uTJdE.js → electronic-signature-DeBi05qe.js} +59 -51
- package/dist/email/email.es.js +10 -10
- package/dist/{emailInput-C5VHG66O.js → emailInput-CABItmP4.js} +4 -4
- package/dist/{en-DNBypQuu.js → en-BHavlQyz.js} +41 -0
- package/dist/{en-DG-BEuiDKtl.js → en-DG-C-msGafh.js} +41 -0
- package/dist/{errorContent-BC8mDFld.js → errorContent-DYhK9FMd.js} +6 -6
- package/dist/{errorParams-W7NX72mI.js → errorParams-pIAQtp7y.js} +1 -1
- package/dist/{es-419-BCIRYhZK.js → es-419-Dib58nCl.js} +1 -1
- package/dist/{es-DjQEM4f9.js → es-CzlFuE_6.js} +42 -1
- package/dist/{es-ES-Q6nMptUM.js → es-ES-BQpbPw03.js} +41 -0
- package/dist/{es-MX-Df5g3bAX.js → es-MX-DqZO_tod.js} +42 -1
- package/dist/{et-BYRhgB8X.js → et-D_7tbD3q.js} +41 -0
- package/dist/{expiredId-BVa13c9u.js → expiredId-DoMyxXAJ.js} +6 -6
- package/dist/extensibility.es.js +102 -42
- package/dist/{fa-IR-DP-FPc-r.js → fa-IR-DraDR5e6.js} +41 -0
- package/dist/face-match/face-match.es.js +1 -1
- package/dist/{faceMatch-C5QmR3Vt.js → faceMatch-8Y_U5K6T.js} +30 -28
- package/dist/faceMatch-C9gEayyD.js +2 -0
- package/dist/{fi-FI-rnIjEC7X.js → fi-FI-O8Sv4NbM.js} +41 -0
- package/dist/field-comparison/field-comparison.es.js +1 -1
- package/dist/fieldComparison-B_77hL0v.js +2 -0
- package/dist/{fieldComparison-CDGiqzsu.js → fieldComparison-DtQPggFs.js} +11 -11
- package/dist/{fieldLabelHint-eF42wLDJ.js → fieldLabelHint-XHNEEyMn.js} +1 -1
- package/dist/{finalSuccessScreen-vOR061dK.js → finalSuccessScreen-Co1SgXRD.js} +12 -12
- package/dist/fiscal-qr/fiscal-qr.es.js +22 -19
- package/dist/{flipAnimation-CGP9Fu9J.js → flipAnimation-Cv52EKtR.js} +5 -5
- package/dist/{flipCapturedCardEligibility-C8wQ0_No.js → flipCapturedCardEligibility-C0j114lS.js} +4 -4
- package/dist/flow/flow.es.js +102 -98
- package/dist/flow/styles.css +1 -1
- package/dist/{formField-DrSwXufE.js → formField-DugBNP7u.js} +5 -5
- package/dist/{fr-CA-vPsubqTC.js → fr-CA-DdyVunG0.js} +41 -0
- package/dist/{fr-P8YbBMxT.js → fr-CKhhqumg.js} +41 -0
- package/dist/{front-horizontal-hint-CDHj9LQF.js → front-horizontal-hint-DKL87QSZ.js} +1 -1
- package/dist/{front-vertical-hint-B_pU27Iv.js → front-vertical-hint-OhyP3VgZ.js} +1 -1
- package/dist/geolocation/geolocation.es.js +10 -10
- package/dist/government-validation/government-validation.es.js +7 -7
- package/dist/{he-DfptjOXC.js → he-CSe75YbO.js} +41 -0
- package/dist/{hi-C7tSzMcB.js → hi-DufbjF3u.js} +41 -0
- package/dist/{hmn-jKsUYgaq.js → hmn-CU-cNH29.js} +41 -0
- package/dist/{homeScreen-C1b8yg4y.js → homeScreen-B5abxQw8.js} +7 -7
- package/dist/{hooks-COiwxC3h.js → hooks-CURroqRe.js} +71 -11
- package/dist/{hr-ehtrddz3.js → hr-DH_mQhx3.js} +41 -0
- package/dist/{ht-CA5NNkri.js → ht-WUj810Lu.js} +41 -0
- package/dist/{hu-DYgOdNXH.js → hu-5eRJpCha.js} +42 -1
- package/dist/{icons-CLoob8B-.js → icons-ITXoYbiU.js} +2 -2
- package/dist/id/id.es.js +38 -37
- package/dist/id/styles.css +1 -1
- package/dist/id/styles.css.js +1 -1
- package/dist/{id-CMBxWcTV.js → id-TTXcsdiH.js} +42 -1
- package/dist/{id-back-of-card-BEAthtU0.js → id-back-of-card-DKYIVSmD.js} +1 -1
- package/dist/{id-back-of-card-vertical-Ce0d7tp5.js → id-back-of-card-vertical-BIe20rpj.js} +1 -1
- package/dist/{id-front-of-card-DS0lS9jP.js → id-front-of-card-DuSINoc3.js} +1 -1
- package/dist/{id-front-of-card-vertical-BLWn85NX.js → id-front-of-card-vertical-BiVBFC1a.js} +1 -1
- package/dist/id-ocr/styles.css +1 -1
- package/dist/id-ocr/styles.css.js +1 -1
- package/dist/id-selfie-flow/id-selfie-flow.es.js +13 -13
- package/dist/id-verification/id-verification.es.js +12 -7
- package/dist/{idFlipTransition-3z8Lqcab.js → idFlipTransition-DkkvK9uz.js} +13 -13
- package/dist/{idOcr-qPEZSG5D.js → idOcr-uP22wjZK.js} +18 -17
- package/dist/identity-reuse/identity-reuse.es.js +13 -12
- package/dist/identity-reuse/styles.css.js +1 -0
- package/dist/{incodeComponent-CxWTvgqz.js → incodeComponent-BcmOnlJA.js} +17 -29
- package/dist/{incodeModule-BQVPjhJE.js → incodeModule-DwyFqiFJ.js} +5 -5
- package/dist/index.es.js +3 -3
- package/dist/{it-DNcyH3GL.js → it-BCq9eMt-.js} +42 -1
- package/dist/{ja-BkVsn7yw.js → ja-BNauL2rS.js} +41 -0
- package/dist/{ja-JP-BI4iShf-.js → ja-JP-tA-OY0PX.js} +41 -0
- package/dist/{jv-Bpp0lYl-.js → jv-kUPY2Chu.js} +41 -0
- package/dist/{ka-__y8BNrb.js → ka-21B6qMG8.js} +41 -0
- package/dist/{kk-C8RZv7Y9.js → kk-CWDQml11.js} +41 -0
- package/dist/{km-CdNpEVlv.js → km-C0dV4RKH.js} +49 -8
- package/dist/{ko-Db8jh_Pq.js → ko-BZLrzvz5.js} +41 -0
- package/dist/{ko-KP-Cn4RuF_b.js → ko-KP-5W-jc8mZ.js} +41 -0
- package/dist/{ky-DljlRCIf.js → ky-CBGd9_yS.js} +41 -0
- package/dist/kyb-checks/kyb-checks.es.js +1 -1
- package/dist/kybChecksModule-B_Pruz4V.js +2 -0
- package/dist/{kybChecksModule-DGXAS1Sc.js → kybChecksModule-BoZXK1fj.js} +14 -14
- package/dist/{lo-DXJI47k7.js → lo-lOKwTA3u.js} +41 -0
- package/dist/{lt-CUHwdgrq.js → lt-Fo2QKh5F.js} +42 -1
- package/dist/{lv-BFrYWmGH.js → lv-BerNOcJ-.js} +41 -0
- package/dist/{mandatoryConsent-Dc0PQou0.js → mandatoryConsent-BNXbt0y6.js} +22 -30
- package/dist/{manualCaptureButton-DIlebb4i.js → manualCaptureButton-CWKYTNIL.js} +4 -4
- package/dist/{manualCaptureButton-t0b_hCKH.js → manualCaptureButton-peTYxITd.js} +10 -10
- package/dist/{mk-BRpnPevj.js → mk-DZHU5tnQ.js} +41 -0
- package/dist/{mn-tly7Lz7o.js → mn-CKd0cKM5.js} +41 -0
- package/dist/{ms-DFpRACK3.js → ms-C752xkBN.js} +41 -0
- package/dist/{my-G2jJl4tA.js → my-BOKFvVNu.js} +41 -0
- package/dist/{nb-NO-CaDPgzxb.js → nb-NO-BIFZBDSt.js} +41 -0
- package/dist/{ne-BaCq8Imv.js → ne-BiZ-Wkzy.js} +41 -0
- package/dist/{nl-BK-jT4yQ.js → nl-DZdJxK59.js} +42 -1
- package/dist/{optionAccessibleLabel-CDKKh7c3.js → optionAccessibleLabel-AuhITmx8.js} +7 -7
- package/dist/{otpInput-B4mH5be-.js → otpInput-DGUmkR-2.js} +6 -6
- package/dist/{page-5CklyQnq.js → page-xenWrHR6.js} +6 -6
- package/dist/{pageUiConfig-DZQHreIo.js → pageUiConfig-Es7xbC8U.js} +5 -5
- package/dist/{passport-horizontal-hint-JdWoLKa5.js → passport-horizontal-hint-DIKR-5je.js} +1 -1
- package/dist/{passport-vertical-hint-BgtJXbvC.js → passport-vertical-hint-BF_uLQ4Q.js} +1 -1
- package/dist/{passwordRequirements-bbbHZACR.js → passwordRequirements-D_ET0ptE.js} +2 -2
- package/dist/pdfViewer-Dcmf3PSp.js +2 -0
- package/dist/{pdfViewer-D4xu2J13.js → pdfViewer-e8ALUns_.js} +11 -6
- package/dist/{permissionInstructionList-Dmy2y4cX.js → permissionInstructionList-BUZ24MO2.js} +3 -3
- package/dist/{permissions-BPh2QNoI.js → permissions-DOpq5J68.js} +13 -13
- package/dist/phone/phone.es.js +15 -14
- package/dist/{phoneInputComposed-Dzt9xdrF.js → phoneInputComposed-KFw_1x_C.js} +101 -7
- package/dist/{pl-CoWZGdbr.js → pl-DbqvkT90.js} +41 -0
- package/dist/{preloadableLazy-2hqV2Q8z.js → preloadableLazy-DUgEtM_1.js} +1 -1
- package/dist/{processing-DStiN9XK.js → processing-ZeXhRIjd.js} +2 -2
- package/dist/{progressBar-CJqJXzAh.js → progressBar-rMzmizL2.js} +2 -2
- package/dist/{pt-BR-BRMyrqIN.js → pt-BR-BDUVqHgY.js} +42 -1
- package/dist/{pt-PT-CfwlYo6V.js → pt-PT-BICMgpFC.js} +41 -0
- package/dist/{pt-BDByRgpr.js → pt-cjI0RkJk.js} +42 -1
- package/dist/qe-signature/qe-signature.es.js +4 -4
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +14 -114
- package/dist/redirect-to-mobile/styles.css +1 -1
- package/dist/redirect-to-mobile/styles.css.js +1 -1
- package/dist/{registerIncodeElement-B5W7SqS3.js → registerIncodeElement-cSBlqcIo.js} +1 -1
- package/dist/{resendTimer-COMRdeDC.js → resendTimer-3QDHwxZI.js} +2 -2
- package/dist/{richText-BMvr5dhl.js → richText-N1OBgZ6y.js} +2 -2
- package/dist/richTextSegments-fTZp4nbH.js +69 -0
- package/dist/{ro-ju058j4P.js → ro-CQi3v92k.js} +41 -0
- package/dist/{ru-DYwhf4Hw.js → ru-D7liiYmK.js} +42 -1
- package/dist/{ru-RU-BAvJW-vp.js → ru-RU-hdx_ywjZ.js} +41 -0
- package/dist/selfie/selfie.es.js +13 -12
- package/dist/signature/signature.es.js +10 -797
- package/dist/signatureCanvas-C8H4ULgt.js +795 -0
- package/dist/{sk-Cl6F-Kaz.js → sk-BVu5NSkN.js} +43 -2
- package/dist/{sl-BxsNneWx.js → sl-CXdwhOlY.js} +41 -0
- package/dist/{smsTabContent-BLJM1Hbk.js → smsTabContent-DK-hG84A.js} +7 -7
- package/dist/{so-D8izvKPD.js → so-CzF0F0n4.js} +41 -0
- package/dist/{spacer-NanHQwzu.js → spacer-DodsS7Qo.js} +15 -15
- package/dist/{spinner-bRH4yw9e.js → spinner-_5giArqM.js} +3 -3
- package/dist/{sr-Latn-BTn5o62j.js → sr-Latn-_wIvvu69.js} +50 -9
- package/dist/{sr-YU-BNViLYA5.js → sr-YU-DuLCl_pC.js} +1 -1
- package/dist/{sr-BtsYxFKz.js → sr-p3K5p0q5.js} +41 -0
- package/dist/step-up/step-up.es.js +12 -12
- package/dist/step-up/styles.css +1 -1
- package/dist/{sv-SE-f5R8i8ue.js → sv-SE-CBOleWRj.js} +41 -0
- package/dist/{sw-BgHNoEGs.js → sw-CzVbqidu.js} +41 -0
- package/dist/tabs-fevCgpP_.js +104 -0
- package/dist/{th-aFkhFNxp.js → th-DIt4DNgZ.js} +41 -0
- package/dist/{th-TH-DmfU-a6A.js → th-TH-DeSsVCOR.js} +41 -0
- package/dist/themes/dark.css +1 -1
- package/dist/themes/light.css +1 -1
- package/dist/{tl-CA42NVfv.js → tl-CdRiPZeW.js} +41 -0
- package/dist/{tl-PH-DMCUe7pP.js → tl-PH-Dkoiua0V.js} +41 -0
- package/dist/{tr-BVjID0jl.js → tr-DjLZ63E7.js} +41 -0
- package/dist/{transitionSpinner-MclJtdHE.js → transitionSpinner-2gDSNi9L.js} +6 -6
- package/dist/{tutorial-fC2iei2v.js → tutorial-pd-jcY6T.js} +4 -4
- package/dist/types/document-signature.d.ts +212 -0
- package/dist/types/extensibility.d.ts +2 -0
- package/dist/types/identity-reuse.d.ts +1 -1
- package/dist/types/video-selfie.d.ts +1 -1
- package/dist/{typography-Dncyo-3D.js → typography-ByaPFg_r.js} +2 -2
- package/dist/{uk-HjZTXCOA.js → uk-DvMsFwYg.js} +41 -0
- package/dist/{uk-UA-ChpoWDcU.js → uk-UA-BaDnbZ4V.js} +41 -0
- package/dist/{ur-CZkQHBM4.js → ur-CZ_SUeWd.js} +41 -0
- package/dist/{useCameraPreview-DrteOjaq.js → useCameraPreview-JvLO-xAZ.js} +1 -1
- package/dist/{useCaptureHelpButton-B5zEGcaB.js → useCaptureHelpButton-B4OqTpGQ.js} +2 -2
- package/dist/{useIsDarkTheme-DAs5RhsW.js → useIsDarkTheme-DQk4EE9W.js} +1 -1
- package/dist/{useModuleLoader-C2fbLotc.js → useModuleLoader-BzjVLtMj.js} +25 -17
- package/dist/{uz-BCp_m_Om.js → uz-FklWYAYJ.js} +41 -0
- package/dist/{vendor-preact-HIccnts1.js → vendor-preact-D-eB0kEm.js} +129 -5
- package/dist/{verificationResult-sh4xut0K.js → verificationResult-DVH0lg9s.js} +8 -8
- package/dist/{vi-BvxcvDgc.js → vi-CuZ5UmSU.js} +41 -0
- package/dist/video-selfie/video-selfie.es.js +18 -16
- package/dist/watchlist/watchlist.es.js +6 -6
- package/dist/{watchlistForBusiness-DnS1r-Ml.js → watchlistForBusiness-DTjrlwVW.js} +17 -18
- package/dist/{withEndScreenTexts-CHWofhk5.js → withEndScreenTexts-o0-d3vPQ.js} +49 -28
- package/dist/workflow/styles.css +1 -1
- package/dist/workflow/workflow.es.js +1 -1
- package/dist/{workflow-DBS9eyu4.js → workflow-BCxpSFal.js} +16 -15
- package/dist/{zh-CN-DZRia1ir.js → zh-CN-BDrR44Mj.js} +42 -1
- package/dist/{zh-DN_kUZaR.js → zh-D7PsouEQ.js} +41 -0
- package/dist/{zh-HANT-DisU_Tal.js → zh-HANT-B82nGR9w.js} +41 -0
- package/dist/{zh-TW-BJzCsdPP.js → zh-TW-CE9n7tgc.js} +41 -0
- package/package.json +15 -5
- package/dist/cameraOverlay-Bciqav_0.js +0 -2
- package/dist/capture-Do7z-u0d.js +0 -3
- package/dist/capture-WaSNv1Wn.js +0 -2
- package/dist/captureButtonIcon-DVbAZ8TK.js +0 -1
- package/dist/dateInputComposed-BrpUtswb.js +0 -1
- package/dist/dateInputComposed-BzCDzTM3.js +0 -68
- package/dist/documentCapture-BdEStEoH.js +0 -2
- package/dist/dropdownComposed-C36c9ZOm.js +0 -1
- package/dist/ekybModule-ccZRVb7E.js +0 -2
- package/dist/ekycModule-CcZTIgGK.js +0 -2
- package/dist/ekycPrefillModule-Bou_Ig42.js +0 -2
- package/dist/faceMatch-B2n0FPIm.js +0 -2
- package/dist/fieldComparison-D-LmR1LR.js +0 -2
- package/dist/inputComposed-oWeKvdES.js +0 -99
- package/dist/kybChecksModule-B2nSWMuy.js +0 -2
- package/dist/pdfViewer-2NTW2bZn.js +0 -2
- /package/dist/{aligndevicelottie-DroBRtbt.js → aligndevicelottie-C5Nr_FF0.js} +0 -0
- /package/dist/{back-tutorial-ydxRtY-Y.js → back-tutorial-CsLjEe1h.js} +0 -0
- /package/dist/{backdevicelottie-hv8vbwYH.js → backdevicelottie-B-yh2vaH.js} +0 -0
- /package/dist/{blurdevicelottie-Cgu4hKn7.js → blurdevicelottie-B-MnEJJ9.js} +0 -0
- /package/dist/{flip-animation-CJhh7l_J.js → flip-animation-2ApKMmiz.js} +0 -0
- /package/dist/{frontdevicelottie-vyO3BJJe.js → frontdevicelottie-D5U9tg8-.js} +0 -0
- /package/dist/{glaredevicelottie-DrgkRjFh.js → glaredevicelottie-exDO2WQS.js} +0 -0
- /package/dist/{id-laser-h-CUz29uFc.js → id-laser-h-C1VNfV0z.js} +0 -0
- /package/dist/{id-laser-v-Bnf10QJp.js → id-laser-v-CwYRuzKJ.js} +0 -0
- /package/dist/{id-tutorial-DGwvKAMs.js → id-tutorial-Cp4YGXxy.js} +0 -0
- /package/dist/{lottie_light-BXXuEKyZ.js → lottie_light-eUA_bm5D.js} +0 -0
- /package/dist/{passport-tutorial-DoqqyBXo.js → passport-tutorial-CTGbQDlK.js} +0 -0
- /package/dist/{pdf-CLcY9ugT.js → pdf-BJqJc2y6.js} +0 -0
- /package/dist/{pdf.worker.min-Cm2oniEB.js → pdf.worker.min-CfLap51B.js} +0 -0
- /package/dist/{sanitizeSvg-BZoCoRr0.js → sanitizeSvg-BgtEnuqz.js} +0 -0
- /package/dist/{selfieTutorial-BTewRjM5.js → selfieTutorial-T41XPQa8.js} +0 -0
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
import { b as y, d as F, i as D, u as A, v as q, x as u } from "./vendor-preact-D-eB0kEm.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-CRYuXE79.js";
|
|
3
|
+
//#region ../../node_modules/.pnpm/signature_pad@5.1.3/node_modules/signature_pad/dist/signature_pad.js
|
|
4
|
+
/*!
|
|
5
|
+
* Signature Pad v5.1.3 | https://github.com/szimek/signature_pad
|
|
6
|
+
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
7
|
+
*/
|
|
8
|
+
var Point = class {
|
|
9
|
+
constructor(x, y, pressure, time) {
|
|
10
|
+
_defineProperty(this, "x", void 0);
|
|
11
|
+
_defineProperty(this, "y", void 0);
|
|
12
|
+
_defineProperty(this, "pressure", void 0);
|
|
13
|
+
_defineProperty(this, "time", void 0);
|
|
14
|
+
if (isNaN(x) || isNaN(y)) throw new Error(`Point is invalid: (${x}, ${y})`);
|
|
15
|
+
this.x = +x;
|
|
16
|
+
this.y = +y;
|
|
17
|
+
this.pressure = pressure || 0;
|
|
18
|
+
this.time = time || Date.now();
|
|
19
|
+
}
|
|
20
|
+
distanceTo(start) {
|
|
21
|
+
return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));
|
|
22
|
+
}
|
|
23
|
+
equals(other) {
|
|
24
|
+
return this.x === other.x && this.y === other.y && this.pressure === other.pressure && this.time === other.time;
|
|
25
|
+
}
|
|
26
|
+
velocityFrom(start) {
|
|
27
|
+
return this.time !== start.time ? this.distanceTo(start) / (this.time - start.time) : 0;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var Bezier = class _Bezier {
|
|
31
|
+
constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {
|
|
32
|
+
this.startPoint = startPoint;
|
|
33
|
+
this.control2 = control2;
|
|
34
|
+
this.control1 = control1;
|
|
35
|
+
this.endPoint = endPoint;
|
|
36
|
+
this.startWidth = startWidth;
|
|
37
|
+
this.endWidth = endWidth;
|
|
38
|
+
}
|
|
39
|
+
static fromPoints(points, widths) {
|
|
40
|
+
const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;
|
|
41
|
+
const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;
|
|
42
|
+
return new _Bezier(points[1], c2, c3, points[2], widths.start, widths.end);
|
|
43
|
+
}
|
|
44
|
+
static calculateControlPoints(s1, s2, s3) {
|
|
45
|
+
const dx1 = s1.x - s2.x;
|
|
46
|
+
const dy1 = s1.y - s2.y;
|
|
47
|
+
const dx2 = s2.x - s3.x;
|
|
48
|
+
const dy2 = s2.y - s3.y;
|
|
49
|
+
const m1 = {
|
|
50
|
+
x: (s1.x + s2.x) / 2,
|
|
51
|
+
y: (s1.y + s2.y) / 2
|
|
52
|
+
};
|
|
53
|
+
const m2 = {
|
|
54
|
+
x: (s2.x + s3.x) / 2,
|
|
55
|
+
y: (s2.y + s3.y) / 2
|
|
56
|
+
};
|
|
57
|
+
const l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
|
|
58
|
+
const l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
|
|
59
|
+
const dxm = m1.x - m2.x;
|
|
60
|
+
const dym = m1.y - m2.y;
|
|
61
|
+
const k = l1 + l2 == 0 ? 0 : l2 / (l1 + l2);
|
|
62
|
+
const cm = {
|
|
63
|
+
x: m2.x + dxm * k,
|
|
64
|
+
y: m2.y + dym * k
|
|
65
|
+
};
|
|
66
|
+
const tx = s2.x - cm.x;
|
|
67
|
+
const ty = s2.y - cm.y;
|
|
68
|
+
return {
|
|
69
|
+
c1: new Point(m1.x + tx, m1.y + ty),
|
|
70
|
+
c2: new Point(m2.x + tx, m2.y + ty)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
length() {
|
|
74
|
+
const steps = 10;
|
|
75
|
+
let length = 0;
|
|
76
|
+
let px;
|
|
77
|
+
let py;
|
|
78
|
+
for (let i = 0; i <= steps; i += 1) {
|
|
79
|
+
const t = i / steps;
|
|
80
|
+
const cx = this.point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);
|
|
81
|
+
const cy = this.point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
82
|
+
if (i > 0) {
|
|
83
|
+
const xdiff = cx - px;
|
|
84
|
+
const ydiff = cy - py;
|
|
85
|
+
length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);
|
|
86
|
+
}
|
|
87
|
+
px = cx;
|
|
88
|
+
py = cy;
|
|
89
|
+
}
|
|
90
|
+
return length;
|
|
91
|
+
}
|
|
92
|
+
point(t, start, c1, c2, end) {
|
|
93
|
+
return start * (1 - t) * (1 - t) * (1 - t) + 3 * c1 * (1 - t) * (1 - t) * t + 3 * c2 * (1 - t) * t * t + end * t * t * t;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var SignatureEventTarget = class {
|
|
97
|
+
constructor() {
|
|
98
|
+
_defineProperty(this, "_et", void 0);
|
|
99
|
+
try {
|
|
100
|
+
this._et = new EventTarget();
|
|
101
|
+
} catch {
|
|
102
|
+
this._et = document;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
addEventListener(type, listener, options) {
|
|
106
|
+
this._et.addEventListener(type, listener, options);
|
|
107
|
+
}
|
|
108
|
+
dispatchEvent(event) {
|
|
109
|
+
return this._et.dispatchEvent(event);
|
|
110
|
+
}
|
|
111
|
+
removeEventListener(type, callback, options) {
|
|
112
|
+
this._et.removeEventListener(type, callback, options);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
function throttle(fn, wait = 250) {
|
|
116
|
+
let previous = 0;
|
|
117
|
+
let timeout = null;
|
|
118
|
+
let result;
|
|
119
|
+
let storedContext;
|
|
120
|
+
let storedArgs;
|
|
121
|
+
const later = () => {
|
|
122
|
+
previous = Date.now();
|
|
123
|
+
timeout = null;
|
|
124
|
+
result = fn.apply(storedContext, storedArgs);
|
|
125
|
+
if (!timeout) {
|
|
126
|
+
storedContext = null;
|
|
127
|
+
storedArgs = [];
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
return function wrapper(...args) {
|
|
131
|
+
const now = Date.now();
|
|
132
|
+
const remaining = wait - (now - previous);
|
|
133
|
+
storedContext = this;
|
|
134
|
+
storedArgs = args;
|
|
135
|
+
if (remaining <= 0 || remaining > wait) {
|
|
136
|
+
if (timeout) {
|
|
137
|
+
clearTimeout(timeout);
|
|
138
|
+
timeout = null;
|
|
139
|
+
}
|
|
140
|
+
previous = now;
|
|
141
|
+
result = fn.apply(storedContext, storedArgs);
|
|
142
|
+
if (!timeout) {
|
|
143
|
+
storedContext = null;
|
|
144
|
+
storedArgs = [];
|
|
145
|
+
}
|
|
146
|
+
} else if (!timeout) timeout = window.setTimeout(later, remaining);
|
|
147
|
+
return result;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
var SignaturePad = class _SignaturePad extends SignatureEventTarget {
|
|
151
|
+
constructor(canvas, options = {}) {
|
|
152
|
+
super();
|
|
153
|
+
_defineProperty(this, "dotSize", void 0);
|
|
154
|
+
_defineProperty(this, "minWidth", void 0);
|
|
155
|
+
_defineProperty(this, "maxWidth", void 0);
|
|
156
|
+
_defineProperty(this, "penColor", void 0);
|
|
157
|
+
_defineProperty(this, "minDistance", void 0);
|
|
158
|
+
_defineProperty(this, "velocityFilterWeight", void 0);
|
|
159
|
+
_defineProperty(this, "compositeOperation", void 0);
|
|
160
|
+
_defineProperty(this, "backgroundColor", void 0);
|
|
161
|
+
_defineProperty(this, "throttle", void 0);
|
|
162
|
+
_defineProperty(this, "canvasContextOptions", void 0);
|
|
163
|
+
_defineProperty(this, "_ctx", void 0);
|
|
164
|
+
_defineProperty(this, "_drawingStroke", false);
|
|
165
|
+
_defineProperty(this, "_isEmpty", true);
|
|
166
|
+
_defineProperty(this, "_dataUrl", void 0);
|
|
167
|
+
_defineProperty(this, "_dataUrlOptions", void 0);
|
|
168
|
+
_defineProperty(this, "_lastPoints", []);
|
|
169
|
+
_defineProperty(this, "_data", []);
|
|
170
|
+
_defineProperty(this, "_lastVelocity", 0);
|
|
171
|
+
_defineProperty(this, "_lastWidth", 0);
|
|
172
|
+
_defineProperty(this, "_strokeMoveUpdate", void 0);
|
|
173
|
+
_defineProperty(this, "_strokePointerId", void 0);
|
|
174
|
+
this.canvas = canvas;
|
|
175
|
+
this.velocityFilterWeight = options.velocityFilterWeight || .7;
|
|
176
|
+
this.minWidth = options.minWidth || .5;
|
|
177
|
+
this.maxWidth = options.maxWidth || 2.5;
|
|
178
|
+
this.throttle = options.throttle ?? 16;
|
|
179
|
+
this.minDistance = options.minDistance ?? 5;
|
|
180
|
+
this.dotSize = options.dotSize || 0;
|
|
181
|
+
this.penColor = options.penColor || "black";
|
|
182
|
+
this.backgroundColor = options.backgroundColor || "rgba(0,0,0,0)";
|
|
183
|
+
this.compositeOperation = options.compositeOperation || "source-over";
|
|
184
|
+
this.canvasContextOptions = options.canvasContextOptions ?? {};
|
|
185
|
+
this._strokeMoveUpdate = this.throttle ? throttle(_SignaturePad.prototype._strokeUpdate, this.throttle) : _SignaturePad.prototype._strokeUpdate;
|
|
186
|
+
this._handleMouseDown = this._handleMouseDown.bind(this);
|
|
187
|
+
this._handleMouseMove = this._handleMouseMove.bind(this);
|
|
188
|
+
this._handleMouseUp = this._handleMouseUp.bind(this);
|
|
189
|
+
this._handleTouchStart = this._handleTouchStart.bind(this);
|
|
190
|
+
this._handleTouchMove = this._handleTouchMove.bind(this);
|
|
191
|
+
this._handleTouchEnd = this._handleTouchEnd.bind(this);
|
|
192
|
+
this._handlePointerDown = this._handlePointerDown.bind(this);
|
|
193
|
+
this._handlePointerMove = this._handlePointerMove.bind(this);
|
|
194
|
+
this._handlePointerUp = this._handlePointerUp.bind(this);
|
|
195
|
+
this._handlePointerCancel = this._handlePointerCancel.bind(this);
|
|
196
|
+
this._handleTouchCancel = this._handleTouchCancel.bind(this);
|
|
197
|
+
this._ctx = canvas.getContext("2d", this.canvasContextOptions);
|
|
198
|
+
this.clear();
|
|
199
|
+
this.on();
|
|
200
|
+
}
|
|
201
|
+
clear() {
|
|
202
|
+
const { _ctx: ctx, canvas } = this;
|
|
203
|
+
ctx.fillStyle = this.backgroundColor;
|
|
204
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
205
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
206
|
+
this._data = [];
|
|
207
|
+
this._reset(this._getPointGroupOptions());
|
|
208
|
+
this._isEmpty = true;
|
|
209
|
+
this._dataUrl = void 0;
|
|
210
|
+
this._dataUrlOptions = void 0;
|
|
211
|
+
this._strokePointerId = void 0;
|
|
212
|
+
}
|
|
213
|
+
redraw() {
|
|
214
|
+
const data = this._data;
|
|
215
|
+
const dataUrl = this._dataUrl;
|
|
216
|
+
const dataUrlOptions = this._dataUrlOptions;
|
|
217
|
+
this.clear();
|
|
218
|
+
if (dataUrl) this.fromDataURL(dataUrl, dataUrlOptions);
|
|
219
|
+
this.fromData(data, { clear: false });
|
|
220
|
+
}
|
|
221
|
+
fromDataURL(dataUrl, options = {}) {
|
|
222
|
+
return new Promise((resolve, reject) => {
|
|
223
|
+
const image = new Image();
|
|
224
|
+
const ratio = options.ratio || window.devicePixelRatio || 1;
|
|
225
|
+
const width = options.width || this.canvas.width / ratio;
|
|
226
|
+
const height = options.height || this.canvas.height / ratio;
|
|
227
|
+
const xOffset = options.xOffset || 0;
|
|
228
|
+
const yOffset = options.yOffset || 0;
|
|
229
|
+
this._reset(this._getPointGroupOptions());
|
|
230
|
+
image.onload = () => {
|
|
231
|
+
this._ctx.drawImage(image, xOffset, yOffset, width, height);
|
|
232
|
+
resolve();
|
|
233
|
+
};
|
|
234
|
+
image.onerror = (error) => {
|
|
235
|
+
reject(error);
|
|
236
|
+
};
|
|
237
|
+
image.crossOrigin = "anonymous";
|
|
238
|
+
image.src = dataUrl;
|
|
239
|
+
this._isEmpty = false;
|
|
240
|
+
this._dataUrl = dataUrl;
|
|
241
|
+
this._dataUrlOptions = { ...options };
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
toDataURL(type = "image/png", encoderOptions) {
|
|
245
|
+
switch (type) {
|
|
246
|
+
case "image/svg+xml":
|
|
247
|
+
if (typeof encoderOptions !== "object") encoderOptions = void 0;
|
|
248
|
+
return `data:image/svg+xml;base64,${btoa(this.toSVG(encoderOptions))}`;
|
|
249
|
+
default:
|
|
250
|
+
if (typeof encoderOptions !== "number") encoderOptions = void 0;
|
|
251
|
+
return this.canvas.toDataURL(type, encoderOptions);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
on() {
|
|
255
|
+
this.canvas.style.touchAction = "none";
|
|
256
|
+
this.canvas.style.msTouchAction = "none";
|
|
257
|
+
this.canvas.style.userSelect = "none";
|
|
258
|
+
this.canvas.style.webkitUserSelect = "none";
|
|
259
|
+
const isIOS = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
|
|
260
|
+
if (window.PointerEvent && !isIOS) this._handlePointerEvents();
|
|
261
|
+
else {
|
|
262
|
+
this._handleMouseEvents();
|
|
263
|
+
if ("ontouchstart" in window) this._handleTouchEvents();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
off() {
|
|
267
|
+
this.canvas.style.touchAction = "auto";
|
|
268
|
+
this.canvas.style.msTouchAction = "auto";
|
|
269
|
+
this.canvas.style.userSelect = "auto";
|
|
270
|
+
this.canvas.style.webkitUserSelect = "auto";
|
|
271
|
+
this.canvas.removeEventListener("pointerdown", this._handlePointerDown);
|
|
272
|
+
this.canvas.removeEventListener("mousedown", this._handleMouseDown);
|
|
273
|
+
this.canvas.removeEventListener("touchstart", this._handleTouchStart);
|
|
274
|
+
this._removeMoveUpEventListeners();
|
|
275
|
+
}
|
|
276
|
+
_getListenerFunctions() {
|
|
277
|
+
const canvasWindow = window.document === this.canvas.ownerDocument ? window : this.canvas.ownerDocument.defaultView ?? this.canvas.ownerDocument;
|
|
278
|
+
return {
|
|
279
|
+
addEventListener: canvasWindow.addEventListener.bind(canvasWindow),
|
|
280
|
+
removeEventListener: canvasWindow.removeEventListener.bind(canvasWindow)
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
_removeMoveUpEventListeners() {
|
|
284
|
+
const { removeEventListener } = this._getListenerFunctions();
|
|
285
|
+
removeEventListener("pointermove", this._handlePointerMove);
|
|
286
|
+
removeEventListener("pointerup", this._handlePointerUp);
|
|
287
|
+
removeEventListener("pointercancel", this._handlePointerCancel);
|
|
288
|
+
removeEventListener("mousemove", this._handleMouseMove);
|
|
289
|
+
removeEventListener("mouseup", this._handleMouseUp);
|
|
290
|
+
removeEventListener("touchmove", this._handleTouchMove);
|
|
291
|
+
removeEventListener("touchend", this._handleTouchEnd);
|
|
292
|
+
removeEventListener("touchcancel", this._handleTouchCancel);
|
|
293
|
+
}
|
|
294
|
+
isEmpty() {
|
|
295
|
+
return this._isEmpty;
|
|
296
|
+
}
|
|
297
|
+
fromData(pointGroups, { clear = true } = {}) {
|
|
298
|
+
if (clear) this.clear();
|
|
299
|
+
this._fromData(pointGroups, this._drawCurve.bind(this), this._drawDot.bind(this));
|
|
300
|
+
this._data = this._data.concat(pointGroups);
|
|
301
|
+
}
|
|
302
|
+
toData() {
|
|
303
|
+
return this._data;
|
|
304
|
+
}
|
|
305
|
+
_isLeftButtonPressed(event, only) {
|
|
306
|
+
if (only) return event.buttons === 1;
|
|
307
|
+
return (event.buttons & 1) === 1;
|
|
308
|
+
}
|
|
309
|
+
_pointerEventToSignatureEvent(event) {
|
|
310
|
+
return {
|
|
311
|
+
event,
|
|
312
|
+
type: event.type,
|
|
313
|
+
x: event.clientX,
|
|
314
|
+
y: event.clientY,
|
|
315
|
+
pressure: "pressure" in event ? event.pressure : 0
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
_touchEventToSignatureEvent(event) {
|
|
319
|
+
const touch = event.changedTouches[0];
|
|
320
|
+
return {
|
|
321
|
+
event,
|
|
322
|
+
type: event.type,
|
|
323
|
+
x: touch.clientX,
|
|
324
|
+
y: touch.clientY,
|
|
325
|
+
pressure: touch.force
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
_handleMouseDown(event) {
|
|
329
|
+
if (!this._isLeftButtonPressed(event, true) || this._drawingStroke) return;
|
|
330
|
+
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
331
|
+
}
|
|
332
|
+
_handleMouseMove(event) {
|
|
333
|
+
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
334
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
338
|
+
}
|
|
339
|
+
_handleMouseUp(event) {
|
|
340
|
+
if (this._isLeftButtonPressed(event)) return;
|
|
341
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
342
|
+
}
|
|
343
|
+
_handleTouchStart(event) {
|
|
344
|
+
if (event.targetTouches.length !== 1 || this._drawingStroke) return;
|
|
345
|
+
if (event.cancelable) event.preventDefault();
|
|
346
|
+
this._strokeBegin(this._touchEventToSignatureEvent(event));
|
|
347
|
+
}
|
|
348
|
+
_handleTouchMove(event) {
|
|
349
|
+
if (event.targetTouches.length !== 1) return;
|
|
350
|
+
if (event.cancelable) event.preventDefault();
|
|
351
|
+
if (!this._drawingStroke) {
|
|
352
|
+
this._strokeEnd(this._touchEventToSignatureEvent(event), false);
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
this._strokeMoveUpdate(this._touchEventToSignatureEvent(event));
|
|
356
|
+
}
|
|
357
|
+
_handleTouchEnd(event) {
|
|
358
|
+
if (event.targetTouches.length !== 0) return;
|
|
359
|
+
if (event.cancelable) event.preventDefault();
|
|
360
|
+
this._strokeEnd(this._touchEventToSignatureEvent(event));
|
|
361
|
+
}
|
|
362
|
+
_handlePointerCancel(event) {
|
|
363
|
+
if (!this._allowPointerId(event)) return;
|
|
364
|
+
event.preventDefault();
|
|
365
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
366
|
+
}
|
|
367
|
+
_handleTouchCancel(event) {
|
|
368
|
+
if (event.cancelable) event.preventDefault();
|
|
369
|
+
this._strokeEnd(this._touchEventToSignatureEvent(event), false);
|
|
370
|
+
}
|
|
371
|
+
_getPointerId(event) {
|
|
372
|
+
return event.persistentDeviceId || event.pointerId;
|
|
373
|
+
}
|
|
374
|
+
_allowPointerId(event, allowUndefined = false) {
|
|
375
|
+
if (typeof this._strokePointerId === "undefined") return allowUndefined;
|
|
376
|
+
return this._getPointerId(event) === this._strokePointerId;
|
|
377
|
+
}
|
|
378
|
+
_handlePointerDown(event) {
|
|
379
|
+
if (this._drawingStroke || !this._isLeftButtonPressed(event) || !this._allowPointerId(event, true)) return;
|
|
380
|
+
this._strokePointerId = this._getPointerId(event);
|
|
381
|
+
event.preventDefault();
|
|
382
|
+
this._strokeBegin(this._pointerEventToSignatureEvent(event));
|
|
383
|
+
}
|
|
384
|
+
_handlePointerMove(event) {
|
|
385
|
+
if (!this._allowPointerId(event)) return;
|
|
386
|
+
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
|
|
387
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event), false);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
event.preventDefault();
|
|
391
|
+
this._strokeMoveUpdate(this._pointerEventToSignatureEvent(event));
|
|
392
|
+
}
|
|
393
|
+
_handlePointerUp(event) {
|
|
394
|
+
if (this._isLeftButtonPressed(event) || !this._allowPointerId(event)) return;
|
|
395
|
+
event.preventDefault();
|
|
396
|
+
this._strokeEnd(this._pointerEventToSignatureEvent(event));
|
|
397
|
+
}
|
|
398
|
+
_getPointGroupOptions(group) {
|
|
399
|
+
return {
|
|
400
|
+
penColor: group && "penColor" in group ? group.penColor : this.penColor,
|
|
401
|
+
dotSize: group && "dotSize" in group ? group.dotSize : this.dotSize,
|
|
402
|
+
minWidth: group && "minWidth" in group ? group.minWidth : this.minWidth,
|
|
403
|
+
maxWidth: group && "maxWidth" in group ? group.maxWidth : this.maxWidth,
|
|
404
|
+
velocityFilterWeight: group && "velocityFilterWeight" in group ? group.velocityFilterWeight : this.velocityFilterWeight,
|
|
405
|
+
compositeOperation: group && "compositeOperation" in group ? group.compositeOperation : this.compositeOperation
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
_strokeBegin(event) {
|
|
409
|
+
if (!this.dispatchEvent(new CustomEvent("beginStroke", {
|
|
410
|
+
detail: event,
|
|
411
|
+
cancelable: true
|
|
412
|
+
}))) return;
|
|
413
|
+
const { addEventListener } = this._getListenerFunctions();
|
|
414
|
+
switch (event.event.type) {
|
|
415
|
+
case "mousedown":
|
|
416
|
+
addEventListener("mousemove", this._handleMouseMove, { passive: false });
|
|
417
|
+
addEventListener("mouseup", this._handleMouseUp, { passive: false });
|
|
418
|
+
break;
|
|
419
|
+
case "touchstart":
|
|
420
|
+
addEventListener("touchmove", this._handleTouchMove, { passive: false });
|
|
421
|
+
addEventListener("touchend", this._handleTouchEnd, { passive: false });
|
|
422
|
+
addEventListener("touchcancel", this._handleTouchCancel, { passive: false });
|
|
423
|
+
break;
|
|
424
|
+
case "pointerdown":
|
|
425
|
+
addEventListener("pointermove", this._handlePointerMove, { passive: false });
|
|
426
|
+
addEventListener("pointerup", this._handlePointerUp, { passive: false });
|
|
427
|
+
addEventListener("pointercancel", this._handlePointerCancel, { passive: false });
|
|
428
|
+
break;
|
|
429
|
+
default:
|
|
430
|
+
}
|
|
431
|
+
this._drawingStroke = true;
|
|
432
|
+
const pointGroupOptions = this._getPointGroupOptions();
|
|
433
|
+
const newPointGroup = {
|
|
434
|
+
...pointGroupOptions,
|
|
435
|
+
points: []
|
|
436
|
+
};
|
|
437
|
+
this._data.push(newPointGroup);
|
|
438
|
+
this._reset(pointGroupOptions);
|
|
439
|
+
this._strokeUpdate(event);
|
|
440
|
+
}
|
|
441
|
+
_strokeUpdate(event) {
|
|
442
|
+
if (!this._drawingStroke) return;
|
|
443
|
+
if (this._data.length === 0) {
|
|
444
|
+
this._strokeBegin(event);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: event }));
|
|
448
|
+
const point = this._createPoint(event.x, event.y, event.pressure);
|
|
449
|
+
const lastPointGroup = this._data[this._data.length - 1];
|
|
450
|
+
const lastPoints = lastPointGroup.points;
|
|
451
|
+
const lastPoint = lastPoints.length > 0 && lastPoints[lastPoints.length - 1];
|
|
452
|
+
const isLastPointTooClose = lastPoint ? point.distanceTo(lastPoint) <= this.minDistance : false;
|
|
453
|
+
const pointGroupOptions = this._getPointGroupOptions(lastPointGroup);
|
|
454
|
+
if (!lastPoint || !(lastPoint && isLastPointTooClose)) {
|
|
455
|
+
const curve = this._addPoint(point, pointGroupOptions);
|
|
456
|
+
if (!lastPoint) this._drawDot(point, pointGroupOptions);
|
|
457
|
+
else if (curve) this._drawCurve(curve, pointGroupOptions);
|
|
458
|
+
lastPoints.push({
|
|
459
|
+
time: point.time,
|
|
460
|
+
x: point.x,
|
|
461
|
+
y: point.y,
|
|
462
|
+
pressure: point.pressure
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: event }));
|
|
466
|
+
}
|
|
467
|
+
_strokeEnd(event, shouldUpdate = true) {
|
|
468
|
+
this._removeMoveUpEventListeners();
|
|
469
|
+
if (!this._drawingStroke) return;
|
|
470
|
+
if (shouldUpdate) this._strokeUpdate(event);
|
|
471
|
+
this._drawingStroke = false;
|
|
472
|
+
this._strokePointerId = void 0;
|
|
473
|
+
this.dispatchEvent(new CustomEvent("endStroke", { detail: event }));
|
|
474
|
+
}
|
|
475
|
+
_handlePointerEvents() {
|
|
476
|
+
this._drawingStroke = false;
|
|
477
|
+
this.canvas.addEventListener("pointerdown", this._handlePointerDown, { passive: false });
|
|
478
|
+
}
|
|
479
|
+
_handleMouseEvents() {
|
|
480
|
+
this._drawingStroke = false;
|
|
481
|
+
this.canvas.addEventListener("mousedown", this._handleMouseDown, { passive: false });
|
|
482
|
+
}
|
|
483
|
+
_handleTouchEvents() {
|
|
484
|
+
this.canvas.addEventListener("touchstart", this._handleTouchStart, { passive: false });
|
|
485
|
+
}
|
|
486
|
+
_reset(options) {
|
|
487
|
+
this._lastPoints = [];
|
|
488
|
+
this._lastVelocity = 0;
|
|
489
|
+
this._lastWidth = (options.minWidth + options.maxWidth) / 2;
|
|
490
|
+
this._ctx.fillStyle = options.penColor;
|
|
491
|
+
this._ctx.globalCompositeOperation = options.compositeOperation;
|
|
492
|
+
}
|
|
493
|
+
_createPoint(x, y, pressure) {
|
|
494
|
+
const rect = this.canvas.getBoundingClientRect();
|
|
495
|
+
return new Point(x - rect.left, y - rect.top, pressure, (/* @__PURE__ */ new Date()).getTime());
|
|
496
|
+
}
|
|
497
|
+
_addPoint(point, options) {
|
|
498
|
+
const { _lastPoints } = this;
|
|
499
|
+
_lastPoints.push(point);
|
|
500
|
+
if (_lastPoints.length > 2) {
|
|
501
|
+
if (_lastPoints.length === 3) _lastPoints.unshift(_lastPoints[0]);
|
|
502
|
+
const widths = this._calculateCurveWidths(_lastPoints[1], _lastPoints[2], options);
|
|
503
|
+
const curve = Bezier.fromPoints(_lastPoints, widths);
|
|
504
|
+
_lastPoints.shift();
|
|
505
|
+
return curve;
|
|
506
|
+
}
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
_calculateCurveWidths(startPoint, endPoint, options) {
|
|
510
|
+
const velocity = options.velocityFilterWeight * endPoint.velocityFrom(startPoint) + (1 - options.velocityFilterWeight) * this._lastVelocity;
|
|
511
|
+
const newWidth = this._strokeWidth(velocity, options);
|
|
512
|
+
const widths = {
|
|
513
|
+
end: newWidth,
|
|
514
|
+
start: this._lastWidth
|
|
515
|
+
};
|
|
516
|
+
this._lastVelocity = velocity;
|
|
517
|
+
this._lastWidth = newWidth;
|
|
518
|
+
return widths;
|
|
519
|
+
}
|
|
520
|
+
_strokeWidth(velocity, options) {
|
|
521
|
+
return Math.max(options.maxWidth / (velocity + 1), options.minWidth);
|
|
522
|
+
}
|
|
523
|
+
_drawCurveSegment(x, y, width) {
|
|
524
|
+
const ctx = this._ctx;
|
|
525
|
+
ctx.moveTo(x, y);
|
|
526
|
+
ctx.arc(x, y, width, 0, 2 * Math.PI, false);
|
|
527
|
+
this._isEmpty = false;
|
|
528
|
+
}
|
|
529
|
+
_drawCurve(curve, options) {
|
|
530
|
+
const ctx = this._ctx;
|
|
531
|
+
const widthDelta = curve.endWidth - curve.startWidth;
|
|
532
|
+
const drawSteps = Math.ceil(curve.length()) * 2;
|
|
533
|
+
ctx.beginPath();
|
|
534
|
+
ctx.fillStyle = options.penColor;
|
|
535
|
+
for (let i = 0; i < drawSteps; i += 1) {
|
|
536
|
+
const t = i / drawSteps;
|
|
537
|
+
const tt = t * t;
|
|
538
|
+
const ttt = tt * t;
|
|
539
|
+
const u = 1 - t;
|
|
540
|
+
const uu = u * u;
|
|
541
|
+
const uuu = uu * u;
|
|
542
|
+
let x = uuu * curve.startPoint.x;
|
|
543
|
+
x += 3 * uu * t * curve.control1.x;
|
|
544
|
+
x += 3 * u * tt * curve.control2.x;
|
|
545
|
+
x += ttt * curve.endPoint.x;
|
|
546
|
+
let y = uuu * curve.startPoint.y;
|
|
547
|
+
y += 3 * uu * t * curve.control1.y;
|
|
548
|
+
y += 3 * u * tt * curve.control2.y;
|
|
549
|
+
y += ttt * curve.endPoint.y;
|
|
550
|
+
const width = Math.min(curve.startWidth + ttt * widthDelta, options.maxWidth);
|
|
551
|
+
this._drawCurveSegment(x, y, width);
|
|
552
|
+
}
|
|
553
|
+
ctx.closePath();
|
|
554
|
+
ctx.fill();
|
|
555
|
+
}
|
|
556
|
+
_drawDot(point, options) {
|
|
557
|
+
const ctx = this._ctx;
|
|
558
|
+
const width = options.dotSize > 0 ? options.dotSize : (options.minWidth + options.maxWidth) / 2;
|
|
559
|
+
ctx.beginPath();
|
|
560
|
+
this._drawCurveSegment(point.x, point.y, width);
|
|
561
|
+
ctx.closePath();
|
|
562
|
+
ctx.fillStyle = options.penColor;
|
|
563
|
+
ctx.fill();
|
|
564
|
+
}
|
|
565
|
+
_fromData(pointGroups, drawCurve, drawDot) {
|
|
566
|
+
for (const group of pointGroups) {
|
|
567
|
+
const { points } = group;
|
|
568
|
+
const pointGroupOptions = this._getPointGroupOptions(group);
|
|
569
|
+
if (points.length > 1) for (let j = 0; j < points.length; j += 1) {
|
|
570
|
+
const basicPoint = points[j];
|
|
571
|
+
const point = new Point(basicPoint.x, basicPoint.y, basicPoint.pressure, basicPoint.time);
|
|
572
|
+
if (j === 0) this._reset(pointGroupOptions);
|
|
573
|
+
const curve = this._addPoint(point, pointGroupOptions);
|
|
574
|
+
if (curve) drawCurve(curve, pointGroupOptions);
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
this._reset(pointGroupOptions);
|
|
578
|
+
drawDot(points[0], pointGroupOptions);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
toSVG({ includeBackgroundColor = false, includeDataUrl = false } = {}) {
|
|
583
|
+
const pointGroups = this._data;
|
|
584
|
+
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
|
585
|
+
const minX = 0;
|
|
586
|
+
const minY = 0;
|
|
587
|
+
const maxX = this.canvas.width / ratio;
|
|
588
|
+
const maxY = this.canvas.height / ratio;
|
|
589
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
590
|
+
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
591
|
+
svg.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
|
|
592
|
+
svg.setAttribute("viewBox", `${minX} ${minY} ${maxX} ${maxY}`);
|
|
593
|
+
svg.setAttribute("width", maxX.toString());
|
|
594
|
+
svg.setAttribute("height", maxY.toString());
|
|
595
|
+
if (includeBackgroundColor && this.backgroundColor) {
|
|
596
|
+
const rect = document.createElement("rect");
|
|
597
|
+
rect.setAttribute("width", "100%");
|
|
598
|
+
rect.setAttribute("height", "100%");
|
|
599
|
+
rect.setAttribute("fill", this.backgroundColor);
|
|
600
|
+
svg.appendChild(rect);
|
|
601
|
+
}
|
|
602
|
+
if (includeDataUrl && this._dataUrl) {
|
|
603
|
+
const ratio2 = this._dataUrlOptions?.ratio || window.devicePixelRatio || 1;
|
|
604
|
+
const width = this._dataUrlOptions?.width || this.canvas.width / ratio2;
|
|
605
|
+
const height = this._dataUrlOptions?.height || this.canvas.height / ratio2;
|
|
606
|
+
const xOffset = this._dataUrlOptions?.xOffset || 0;
|
|
607
|
+
const yOffset = this._dataUrlOptions?.yOffset || 0;
|
|
608
|
+
const image = document.createElement("image");
|
|
609
|
+
image.setAttribute("x", xOffset.toString());
|
|
610
|
+
image.setAttribute("y", yOffset.toString());
|
|
611
|
+
image.setAttribute("width", width.toString());
|
|
612
|
+
image.setAttribute("height", height.toString());
|
|
613
|
+
image.setAttribute("preserveAspectRatio", "none");
|
|
614
|
+
image.setAttribute("href", this._dataUrl);
|
|
615
|
+
svg.appendChild(image);
|
|
616
|
+
}
|
|
617
|
+
this._fromData(pointGroups, (curve, { penColor }) => {
|
|
618
|
+
const path = document.createElement("path");
|
|
619
|
+
if (!isNaN(curve.control1.x) && !isNaN(curve.control1.y) && !isNaN(curve.control2.x) && !isNaN(curve.control2.y)) {
|
|
620
|
+
const attr = `M ${curve.startPoint.x.toFixed(3)},${curve.startPoint.y.toFixed(3)} C ${curve.control1.x.toFixed(3)},${curve.control1.y.toFixed(3)} ${curve.control2.x.toFixed(3)},${curve.control2.y.toFixed(3)} ${curve.endPoint.x.toFixed(3)},${curve.endPoint.y.toFixed(3)}`;
|
|
621
|
+
path.setAttribute("d", attr);
|
|
622
|
+
path.setAttribute("stroke-width", (curve.endWidth * 2.25).toFixed(3));
|
|
623
|
+
path.setAttribute("stroke", penColor);
|
|
624
|
+
path.setAttribute("fill", "none");
|
|
625
|
+
path.setAttribute("stroke-linecap", "round");
|
|
626
|
+
svg.appendChild(path);
|
|
627
|
+
}
|
|
628
|
+
}, (point, { penColor, dotSize, minWidth, maxWidth }) => {
|
|
629
|
+
const circle = document.createElement("circle");
|
|
630
|
+
const size = dotSize > 0 ? dotSize : (minWidth + maxWidth) / 2;
|
|
631
|
+
circle.setAttribute("r", size.toString());
|
|
632
|
+
circle.setAttribute("cx", point.x.toString());
|
|
633
|
+
circle.setAttribute("cy", point.y.toString());
|
|
634
|
+
circle.setAttribute("fill", penColor);
|
|
635
|
+
svg.appendChild(circle);
|
|
636
|
+
});
|
|
637
|
+
return svg.outerHTML;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region src/styles/resolveCssVariableToHex.ts
|
|
642
|
+
var resolveCssVariableToHex = (cssVar) => {
|
|
643
|
+
if (typeof document === "undefined") return null;
|
|
644
|
+
const tempEl = document.createElement("div");
|
|
645
|
+
tempEl.style.color = cssVar;
|
|
646
|
+
tempEl.style.position = "absolute";
|
|
647
|
+
tempEl.style.visibility = "hidden";
|
|
648
|
+
document.body.appendChild(tempEl);
|
|
649
|
+
const computedColor = getComputedStyle(tempEl).color;
|
|
650
|
+
document.body.removeChild(tempEl);
|
|
651
|
+
if (!computedColor || computedColor === "transparent") return null;
|
|
652
|
+
const rgbMatch = computedColor.match(/\d+/g);
|
|
653
|
+
if (rgbMatch && rgbMatch.length >= 3) {
|
|
654
|
+
const r = Number.parseInt(rgbMatch[0], 10);
|
|
655
|
+
const g = Number.parseInt(rgbMatch[1], 10);
|
|
656
|
+
const b = Number.parseInt(rgbMatch[2], 10);
|
|
657
|
+
const toHex = (n) => {
|
|
658
|
+
const hex = n.toString(16);
|
|
659
|
+
return hex.length === 1 ? `0${hex}` : hex;
|
|
660
|
+
};
|
|
661
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
662
|
+
}
|
|
663
|
+
return null;
|
|
664
|
+
};
|
|
665
|
+
//#endregion
|
|
666
|
+
//#region src/modules/signature/signatureCanvas.tsx
|
|
667
|
+
var SIGNATURE_PEN_COLOR = "var(--icon-neutral-800)";
|
|
668
|
+
/** Fixed white background for export (avoid transparency and theme dependency) */
|
|
669
|
+
var EXPORT_BACKGROUND_COLOR = "#ffffff";
|
|
670
|
+
var copyCanvasWithWhiteBackground = (source) => {
|
|
671
|
+
const target = document.createElement("canvas");
|
|
672
|
+
target.width = source.width;
|
|
673
|
+
target.height = source.height;
|
|
674
|
+
const ctx = target.getContext("2d");
|
|
675
|
+
if (!ctx) throw new Error("Canvas 2D context is not available");
|
|
676
|
+
ctx.fillStyle = EXPORT_BACKGROUND_COLOR;
|
|
677
|
+
ctx.fillRect(0, 0, target.width, target.height);
|
|
678
|
+
ctx.drawImage(source, 0, 0);
|
|
679
|
+
return target;
|
|
680
|
+
};
|
|
681
|
+
var canvasToBlob = (canvas, mimeType, quality) => {
|
|
682
|
+
return new Promise((resolve, reject) => {
|
|
683
|
+
canvas.toBlob((blob) => {
|
|
684
|
+
if (blob) resolve(blob);
|
|
685
|
+
else reject(/* @__PURE__ */ new Error("Canvas toBlob() returned null"));
|
|
686
|
+
}, mimeType, mimeType === "image/jpeg" || mimeType === "image/webp" ? quality : void 0);
|
|
687
|
+
});
|
|
688
|
+
};
|
|
689
|
+
var SignatureCanvas = D(({ onBeginStroke, onEndStroke, hasDrawing, placeholder, ariaLabel, customPenColor, customPenStrokeWidth, customBackgroundColor, customBorderColor }, ref) => {
|
|
690
|
+
const containerRef = A(null);
|
|
691
|
+
const canvasRef = A(null);
|
|
692
|
+
const signaturePadRef = A(null);
|
|
693
|
+
const onBeginStrokeRef = A(onBeginStroke);
|
|
694
|
+
onBeginStrokeRef.current = onBeginStroke;
|
|
695
|
+
const onEndStrokeRef = A(onEndStroke);
|
|
696
|
+
onEndStrokeRef.current = onEndStroke;
|
|
697
|
+
const resizeSignaturePad = q(() => {
|
|
698
|
+
const container = containerRef.current;
|
|
699
|
+
const canvas = canvasRef.current;
|
|
700
|
+
const pad = signaturePadRef.current;
|
|
701
|
+
if (!container || !canvas || !pad) return;
|
|
702
|
+
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
|
703
|
+
const context = canvas.getContext("2d");
|
|
704
|
+
const { width, height } = container.getBoundingClientRect();
|
|
705
|
+
if (width === 0 || height === 0 || !context) return;
|
|
706
|
+
const data = pad.isEmpty() ? null : pad.toData();
|
|
707
|
+
canvas.width = Math.floor(width * ratio);
|
|
708
|
+
canvas.height = Math.floor(height * ratio);
|
|
709
|
+
context.setTransform(ratio, 0, 0, ratio, 0, 0);
|
|
710
|
+
if (data) pad.fromData(data, { clear: true });
|
|
711
|
+
else pad.clear();
|
|
712
|
+
}, []);
|
|
713
|
+
F(ref, () => ({
|
|
714
|
+
clear: () => {
|
|
715
|
+
signaturePadRef.current?.clear();
|
|
716
|
+
},
|
|
717
|
+
isEmpty: () => signaturePadRef.current?.isEmpty() ?? true,
|
|
718
|
+
toDataURL: (type = "image/png", encoderOptions) => signaturePadRef.current?.toDataURL(type, encoderOptions) ?? "",
|
|
719
|
+
getCanvas: () => canvasRef.current,
|
|
720
|
+
getSignaturePad: () => signaturePadRef.current,
|
|
721
|
+
on: () => signaturePadRef.current?.on(),
|
|
722
|
+
off: () => signaturePadRef.current?.off(),
|
|
723
|
+
getSignatureWithWhiteBackground: () => {
|
|
724
|
+
const canvas = canvasRef.current;
|
|
725
|
+
if (!canvas) return null;
|
|
726
|
+
return copyCanvasWithWhiteBackground(canvas);
|
|
727
|
+
},
|
|
728
|
+
getBlob: (canvas = canvasRef.current ?? void 0, mimeType = "image/jpeg", quality = .92) => {
|
|
729
|
+
if (!canvas) return Promise.reject(/* @__PURE__ */ new Error("No canvas available for getBlob"));
|
|
730
|
+
return canvasToBlob(canvas, mimeType, quality);
|
|
731
|
+
}
|
|
732
|
+
}), []);
|
|
733
|
+
y(() => {
|
|
734
|
+
const container = containerRef.current;
|
|
735
|
+
const canvas = canvasRef.current;
|
|
736
|
+
if (!container || !canvas) return;
|
|
737
|
+
let resizeRafId = null;
|
|
738
|
+
const scheduleResizeSignaturePad = () => {
|
|
739
|
+
if (resizeRafId !== null) return;
|
|
740
|
+
resizeRafId = requestAnimationFrame(() => {
|
|
741
|
+
resizeRafId = null;
|
|
742
|
+
resizeSignaturePad();
|
|
743
|
+
});
|
|
744
|
+
};
|
|
745
|
+
const penColor = customPenColor ?? resolveCssVariableToHex(SIGNATURE_PEN_COLOR);
|
|
746
|
+
const signaturePad = new SignaturePad(canvas, {
|
|
747
|
+
...penColor ? { penColor } : {},
|
|
748
|
+
...customPenStrokeWidth ? { maxWidth: customPenStrokeWidth } : {}
|
|
749
|
+
});
|
|
750
|
+
signaturePadRef.current = signaturePad;
|
|
751
|
+
const onBegin = () => onBeginStrokeRef.current?.();
|
|
752
|
+
signaturePad.addEventListener("beginStroke", onBegin);
|
|
753
|
+
const onEnd = () => onEndStrokeRef.current?.(signaturePad);
|
|
754
|
+
signaturePad.addEventListener("endStroke", onEnd);
|
|
755
|
+
resizeSignaturePad();
|
|
756
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
757
|
+
scheduleResizeSignaturePad();
|
|
758
|
+
});
|
|
759
|
+
resizeObserver.observe(container);
|
|
760
|
+
return () => {
|
|
761
|
+
if (resizeRafId !== null) cancelAnimationFrame(resizeRafId);
|
|
762
|
+
resizeObserver.disconnect();
|
|
763
|
+
signaturePad.removeEventListener("beginStroke", onBegin);
|
|
764
|
+
signaturePad.removeEventListener("endStroke", onEnd);
|
|
765
|
+
signaturePad.off();
|
|
766
|
+
signaturePadRef.current = null;
|
|
767
|
+
};
|
|
768
|
+
}, [
|
|
769
|
+
resizeSignaturePad,
|
|
770
|
+
customPenColor,
|
|
771
|
+
customPenStrokeWidth
|
|
772
|
+
]);
|
|
773
|
+
return /* @__PURE__ */ u("div", {
|
|
774
|
+
class: "IncodeSignatureCanvasContainer",
|
|
775
|
+
style: customBackgroundColor || customBorderColor ? {
|
|
776
|
+
...customBackgroundColor ? { backgroundColor: customBackgroundColor } : {},
|
|
777
|
+
...customBorderColor ? { borderColor: customBorderColor } : {}
|
|
778
|
+
} : void 0,
|
|
779
|
+
ref: containerRef,
|
|
780
|
+
children: [/* @__PURE__ */ u("canvas", {
|
|
781
|
+
class: "IncodeSignatureCanvas",
|
|
782
|
+
ref: canvasRef,
|
|
783
|
+
role: "img",
|
|
784
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
785
|
+
"data-testid": "signature-canvas"
|
|
786
|
+
}), !hasDrawing && /* @__PURE__ */ u("p", {
|
|
787
|
+
class: "IncodeSignatureCanvasPlaceholder",
|
|
788
|
+
"aria-hidden": "true",
|
|
789
|
+
children: placeholder
|
|
790
|
+
})]
|
|
791
|
+
});
|
|
792
|
+
});
|
|
793
|
+
SignatureCanvas.displayName = "SignatureCanvas";
|
|
794
|
+
//#endregion
|
|
795
|
+
export { SignatureCanvas as t };
|