webs-sdk 0.18.82 → 0.18.84
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 +451 -451
- package/dist/components/ARFilters/ARFilters.js +54 -54
- package/dist/components/AvatarAI.js +6 -6
- package/dist/components/CookieConsent/constants.js +31 -31
- package/dist/components/CreativeFaceSwap.js +12 -12
- package/dist/components/MemeGenerator.js +12 -12
- package/dist/components/PasswordReset/constants.js +33 -33
- package/dist/components/RecoveryPassword/RecoveryPassword.d.ts +3 -0
- package/dist/components/RecoveryPassword/RecoveryPassword.d.ts.map +1 -0
- package/dist/components/RecoveryPassword/RecoveryPassword.js +133 -0
- package/dist/components/RecoveryPassword/RecoveryPassword.js.map +1 -0
- package/dist/components/RecoveryPassword/constants.d.ts +7 -0
- package/dist/components/RecoveryPassword/constants.d.ts.map +1 -0
- package/dist/components/RecoveryPassword/constants.js +55 -0
- package/dist/components/RecoveryPassword/constants.js.map +1 -0
- package/dist/components/RecoveryPassword/index.d.ts +4 -0
- package/dist/components/RecoveryPassword/index.d.ts.map +1 -0
- package/dist/components/RecoveryPassword/index.js +8 -0
- package/dist/components/RecoveryPassword/index.js.map +1 -0
- package/dist/components/RecoveryPassword/translations.d.ts +3 -0
- package/dist/components/RecoveryPassword/translations.d.ts.map +1 -0
- package/dist/components/RecoveryPassword/translations.js +335 -0
- package/dist/components/RecoveryPassword/translations.js.map +1 -0
- package/dist/components/RecoveryPassword/types.d.ts +54 -0
- package/dist/components/RecoveryPassword/types.d.ts.map +1 -0
- package/dist/components/RecoveryPassword/types.js +3 -0
- package/dist/components/RecoveryPassword/types.js.map +1 -0
- package/dist/components/SpinningWheel/SpinningWheel.js +7 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/libraries/globals.d.ts +17 -0
- package/dist/libraries/globals.d.ts.map +1 -0
- package/dist/libraries/globals.js +38 -0
- package/dist/libraries/globals.js.map +1 -0
- package/package.json +79 -79
- package/public/spin2win/assets/border-afristream.svg +26 -26
- package/public/spin2win/assets/border-efc.svg +23 -23
- package/public/spin2win/assets/border-totalgym.svg +27 -27
- package/public/spin2win/assets/border-womantoday.svg +26 -26
- package/public/spin2win/assets/indicator-afristream.svg +28 -28
- package/public/spin2win/assets/indicator-efc.svg +29 -29
- package/public/spin2win/assets/indicator-totalgym.svg +29 -29
- package/public/spin2win/fonts/switzer/README.md +22 -22
|
@@ -7,60 +7,60 @@ const useDeepAR_1 = require("./useDeepAR");
|
|
|
7
7
|
const FilterCarousel_1 = require("./FilterCarousel");
|
|
8
8
|
const Popups_1 = require("./Popups");
|
|
9
9
|
const constants_1 = require("./constants");
|
|
10
|
-
const DEEPAR_CSS = `
|
|
11
|
-
.deepar-container{position:relative;width:100%;max-width:800px;margin:0 auto;aspect-ratio:4/3;background-color:#000;border-radius:16px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.5),0 8px 16px rgba(0,0,0,.3)}
|
|
12
|
-
@media(max-width:768px){.deepar-container{max-width:100%;aspect-ratio:auto;height:70vh;max-height:600px;border-radius:8px}}
|
|
13
|
-
.deepar-canvas{width:100%;height:100%;object-fit:contain}
|
|
14
|
-
.deepar-loading-veil{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:10}
|
|
15
|
-
.deepar-loading-items{display:flex;flex-direction:column;align-items:center;gap:16px}
|
|
16
|
-
.deepar-loading-spinner{width:48px;height:48px;border:4px solid rgba(255,255,255,.1);border-top-color:#fff;border-radius:50%;animation:deepar-spin 1s linear infinite}
|
|
17
|
-
@keyframes deepar-spin{to{transform:rotate(360deg)}}
|
|
18
|
-
.deepar-loading-text{color:#fff;font-size:16px;font-weight:500}
|
|
19
|
-
.deepar-top-buttons{position:absolute;top:0;right:0;display:flex;gap:12px;padding:16px;z-index:20}
|
|
20
|
-
.deepar-fullscreen-button{display:flex;align-items:center;justify-content:center;width:48px;height:48px;background:rgba(0,0,0,.6);border:2px solid rgba(255,255,255,.3);border-radius:8px;cursor:pointer;transition:all .2s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
|
|
21
|
-
.deepar-fullscreen-button:hover{background:rgba(0,0,0,.8);border-color:rgba(255,255,255,.5)}
|
|
22
|
-
.deepar-fullscreen-button:active{transform:scale(.95);background:rgba(0,0,0,.9)}
|
|
23
|
-
@media(max-width:768px){.deepar-fullscreen-button{width:56px;height:56px;background:rgba(0,0,0,.7)}}
|
|
24
|
-
.deepar-recording-progress-bar{position:absolute;top:24px;left:50%;transform:translateX(-50%);width:calc(100% - 48px);max-width:400px;height:8px;background:rgba(255,255,255,.2);border-radius:17px;overflow:hidden;z-index:5}
|
|
25
|
-
.deepar-time-progress{height:100%;background:#dc2626;border-radius:17px;transition:width 100ms linear}
|
|
26
|
-
.deepar-pause-recording-container{position:absolute;bottom:48px;left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;z-index:5}
|
|
27
|
-
.deepar-pause-recording-button{display:flex;align-items:center;justify-content:center;width:80px;height:80px;background:rgba(0,0,0,.5);border:3px solid #fff;border-radius:50%;cursor:pointer;transition:all .2s}
|
|
28
|
-
.deepar-pause-recording-inner{width:24px;height:24px;background:#dc2626;border-radius:4px}
|
|
29
|
-
.deepar-carousel-container{position:absolute;bottom:0;left:0;width:100%;visibility:hidden;opacity:0;transition:opacity .3s;z-index:4}
|
|
30
|
-
.deepar-carousel-container.visible{visibility:visible;opacity:1}
|
|
31
|
-
.deepar-carousel-wrapper{position:relative;display:flex;align-items:center;justify-content:center;padding:24px 0;background:linear-gradient(to top,rgba(0,0,0,1) 0%,rgba(0,0,0,.95) 50%,rgba(0,0,0,0) 100%)}
|
|
32
|
-
.deepar-carousel-content{position:relative;display:flex;align-items:center;justify-content:center;flex:1}
|
|
33
|
-
.deepar-carousel{max-width:368px;overflow:hidden;padding:0 20px}
|
|
34
|
-
@media(max-width:768px){.deepar-carousel{max-width:280px;padding:0 10px}}
|
|
35
|
-
.deepar-carousel-slides{display:flex;gap:16px}
|
|
36
|
-
.deepar-carousel-slide{flex:0 0 auto;cursor:pointer;transition:all .3s ease;opacity:.6}
|
|
37
|
-
.deepar-carousel-slide:hover{opacity:.8}
|
|
38
|
-
.deepar-carousel-slide.active{opacity:1}
|
|
39
|
-
.deepar-filter-thumb{width:64px;height:64px;border-radius:50%;overflow:hidden;transition:all .3s ease;border:3px solid rgba(255,255,255,.2)}
|
|
40
|
-
.deepar-carousel-slide.active .deepar-filter-thumb{width:76px;height:76px;border:3px solid rgba(255,255,255,1);box-shadow:0 0 0 8px rgba(0,0,0,.4)}
|
|
41
|
-
.deepar-carousel-arrow{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:rgba(0,0,0,.4);border:1px solid rgba(255,255,255,.3);border-radius:50%;cursor:pointer;transition:all .3s;z-index:5;color:#fff}
|
|
42
|
-
.deepar-carousel-arrow.prev{left:16px}
|
|
43
|
-
.deepar-carousel-arrow.next{right:16px}
|
|
44
|
-
.deepar-carousel-arrow:hover:not(:disabled){transform:translateY(-50%) scale(1.1);background:rgba(0,0,0,.6)}
|
|
45
|
-
.deepar-carousel-arrow:disabled{opacity:.3;cursor:not-allowed}
|
|
46
|
-
.deepar-selection-ring{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:110px;height:110px;background:rgba(0,0,0,.4);border:4px solid rgba(255,255,255,.9);border-radius:50%;cursor:pointer;z-index:6;transition:all .3s;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 8px rgba(0,0,0,.3)}
|
|
47
|
-
.deepar-selection-ring:hover{transform:translate(-50%,-50%) scale(1.05);border-color:#fff}
|
|
48
|
-
.deepar-selection-ring-camera{color:#fff}
|
|
49
|
-
.deepar-creation-container{position:absolute;top:0;left:0;width:100%;height:100%;background:#000;z-index:8}
|
|
50
|
-
.deepar-created-video,.deepar-created-image{width:100%;height:100%;object-fit:cover}
|
|
51
|
-
.deepar-creation-buttons{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}
|
|
52
|
-
.deepar-creation-buttons>*{pointer-events:all}
|
|
53
|
-
.deepar-discard-button{position:absolute;top:24px;left:24px;display:flex;align-items:center;gap:8px;padding:12px 20px;background:rgba(0,0,0,.5);color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:all .2s}
|
|
54
|
-
.deepar-bottom-buttons-creation{position:absolute;bottom:42px;left:50%;transform:translateX(-50%);display:flex;gap:16px}
|
|
55
|
-
.deepar-creation-button{display:flex;align-items:center;justify-content:center;width:80px;height:80px;background:rgba(0,0,0,.5);border:3px solid #fff;border-radius:50%;cursor:pointer;transition:all .2s}
|
|
56
|
-
.deepar-creation-button:hover{background:rgba(0,0,0,.7);transform:scale(1.1)}
|
|
57
|
-
.deepar-popup{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:50}
|
|
58
|
-
.deepar-popup-box{background:#fff;border-radius:12px;padding:48px 32px;max-width:400px;width:90%;text-align:center}
|
|
59
|
-
.deepar-popup-image{margin:0 auto 20px;display:flex;align-items:center;justify-content:center}
|
|
60
|
-
.deepar-popup-title{font-size:18px;font-weight:600;color:#111;margin-bottom:24px}
|
|
61
|
-
.deepar-popup-button{display:inline-block;padding:14px 32px;border-radius:8px;font-size:16px;font-weight:600;border:none;cursor:pointer;transition:all .2s}
|
|
62
|
-
.deepar-popup-button:hover{transform:scale(1.05)}
|
|
63
|
-
.deepar-download-success{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);padding:16px 32px;background:rgba(34,197,94,.95);color:#fff;border-radius:8px;font-size:16px;font-weight:600;z-index:100}
|
|
10
|
+
const DEEPAR_CSS = `
|
|
11
|
+
.deepar-container{position:relative;width:100%;max-width:800px;margin:0 auto;aspect-ratio:4/3;background-color:#000;border-radius:16px;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.5),0 8px 16px rgba(0,0,0,.3)}
|
|
12
|
+
@media(max-width:768px){.deepar-container{max-width:100%;aspect-ratio:auto;height:70vh;max-height:600px;border-radius:8px}}
|
|
13
|
+
.deepar-canvas{width:100%;height:100%;object-fit:contain}
|
|
14
|
+
.deepar-loading-veil{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:10}
|
|
15
|
+
.deepar-loading-items{display:flex;flex-direction:column;align-items:center;gap:16px}
|
|
16
|
+
.deepar-loading-spinner{width:48px;height:48px;border:4px solid rgba(255,255,255,.1);border-top-color:#fff;border-radius:50%;animation:deepar-spin 1s linear infinite}
|
|
17
|
+
@keyframes deepar-spin{to{transform:rotate(360deg)}}
|
|
18
|
+
.deepar-loading-text{color:#fff;font-size:16px;font-weight:500}
|
|
19
|
+
.deepar-top-buttons{position:absolute;top:0;right:0;display:flex;gap:12px;padding:16px;z-index:20}
|
|
20
|
+
.deepar-fullscreen-button{display:flex;align-items:center;justify-content:center;width:48px;height:48px;background:rgba(0,0,0,.6);border:2px solid rgba(255,255,255,.3);border-radius:8px;cursor:pointer;transition:all .2s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
|
|
21
|
+
.deepar-fullscreen-button:hover{background:rgba(0,0,0,.8);border-color:rgba(255,255,255,.5)}
|
|
22
|
+
.deepar-fullscreen-button:active{transform:scale(.95);background:rgba(0,0,0,.9)}
|
|
23
|
+
@media(max-width:768px){.deepar-fullscreen-button{width:56px;height:56px;background:rgba(0,0,0,.7)}}
|
|
24
|
+
.deepar-recording-progress-bar{position:absolute;top:24px;left:50%;transform:translateX(-50%);width:calc(100% - 48px);max-width:400px;height:8px;background:rgba(255,255,255,.2);border-radius:17px;overflow:hidden;z-index:5}
|
|
25
|
+
.deepar-time-progress{height:100%;background:#dc2626;border-radius:17px;transition:width 100ms linear}
|
|
26
|
+
.deepar-pause-recording-container{position:absolute;bottom:48px;left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;z-index:5}
|
|
27
|
+
.deepar-pause-recording-button{display:flex;align-items:center;justify-content:center;width:80px;height:80px;background:rgba(0,0,0,.5);border:3px solid #fff;border-radius:50%;cursor:pointer;transition:all .2s}
|
|
28
|
+
.deepar-pause-recording-inner{width:24px;height:24px;background:#dc2626;border-radius:4px}
|
|
29
|
+
.deepar-carousel-container{position:absolute;bottom:0;left:0;width:100%;visibility:hidden;opacity:0;transition:opacity .3s;z-index:4}
|
|
30
|
+
.deepar-carousel-container.visible{visibility:visible;opacity:1}
|
|
31
|
+
.deepar-carousel-wrapper{position:relative;display:flex;align-items:center;justify-content:center;padding:24px 0;background:linear-gradient(to top,rgba(0,0,0,1) 0%,rgba(0,0,0,.95) 50%,rgba(0,0,0,0) 100%)}
|
|
32
|
+
.deepar-carousel-content{position:relative;display:flex;align-items:center;justify-content:center;flex:1}
|
|
33
|
+
.deepar-carousel{max-width:368px;overflow:hidden;padding:0 20px}
|
|
34
|
+
@media(max-width:768px){.deepar-carousel{max-width:280px;padding:0 10px}}
|
|
35
|
+
.deepar-carousel-slides{display:flex;gap:16px}
|
|
36
|
+
.deepar-carousel-slide{flex:0 0 auto;cursor:pointer;transition:all .3s ease;opacity:.6}
|
|
37
|
+
.deepar-carousel-slide:hover{opacity:.8}
|
|
38
|
+
.deepar-carousel-slide.active{opacity:1}
|
|
39
|
+
.deepar-filter-thumb{width:64px;height:64px;border-radius:50%;overflow:hidden;transition:all .3s ease;border:3px solid rgba(255,255,255,.2)}
|
|
40
|
+
.deepar-carousel-slide.active .deepar-filter-thumb{width:76px;height:76px;border:3px solid rgba(255,255,255,1);box-shadow:0 0 0 8px rgba(0,0,0,.4)}
|
|
41
|
+
.deepar-carousel-arrow{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:rgba(0,0,0,.4);border:1px solid rgba(255,255,255,.3);border-radius:50%;cursor:pointer;transition:all .3s;z-index:5;color:#fff}
|
|
42
|
+
.deepar-carousel-arrow.prev{left:16px}
|
|
43
|
+
.deepar-carousel-arrow.next{right:16px}
|
|
44
|
+
.deepar-carousel-arrow:hover:not(:disabled){transform:translateY(-50%) scale(1.1);background:rgba(0,0,0,.6)}
|
|
45
|
+
.deepar-carousel-arrow:disabled{opacity:.3;cursor:not-allowed}
|
|
46
|
+
.deepar-selection-ring{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:110px;height:110px;background:rgba(0,0,0,.4);border:4px solid rgba(255,255,255,.9);border-radius:50%;cursor:pointer;z-index:6;transition:all .3s;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 8px rgba(0,0,0,.3)}
|
|
47
|
+
.deepar-selection-ring:hover{transform:translate(-50%,-50%) scale(1.05);border-color:#fff}
|
|
48
|
+
.deepar-selection-ring-camera{color:#fff}
|
|
49
|
+
.deepar-creation-container{position:absolute;top:0;left:0;width:100%;height:100%;background:#000;z-index:8}
|
|
50
|
+
.deepar-created-video,.deepar-created-image{width:100%;height:100%;object-fit:cover}
|
|
51
|
+
.deepar-creation-buttons{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}
|
|
52
|
+
.deepar-creation-buttons>*{pointer-events:all}
|
|
53
|
+
.deepar-discard-button{position:absolute;top:24px;left:24px;display:flex;align-items:center;gap:8px;padding:12px 20px;background:rgba(0,0,0,.5);color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:all .2s}
|
|
54
|
+
.deepar-bottom-buttons-creation{position:absolute;bottom:42px;left:50%;transform:translateX(-50%);display:flex;gap:16px}
|
|
55
|
+
.deepar-creation-button{display:flex;align-items:center;justify-content:center;width:80px;height:80px;background:rgba(0,0,0,.5);border:3px solid #fff;border-radius:50%;cursor:pointer;transition:all .2s}
|
|
56
|
+
.deepar-creation-button:hover{background:rgba(0,0,0,.7);transform:scale(1.1)}
|
|
57
|
+
.deepar-popup{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:50}
|
|
58
|
+
.deepar-popup-box{background:#fff;border-radius:12px;padding:48px 32px;max-width:400px;width:90%;text-align:center}
|
|
59
|
+
.deepar-popup-image{margin:0 auto 20px;display:flex;align-items:center;justify-content:center}
|
|
60
|
+
.deepar-popup-title{font-size:18px;font-weight:600;color:#111;margin-bottom:24px}
|
|
61
|
+
.deepar-popup-button{display:inline-block;padding:14px 32px;border-radius:8px;font-size:16px;font-weight:600;border:none;cursor:pointer;transition:all .2s}
|
|
62
|
+
.deepar-popup-button:hover{transform:scale(1.05)}
|
|
63
|
+
.deepar-download-success{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);padding:16px 32px;background:rgba(34,197,94,.95);color:#fff;border-radius:8px;font-size:16px;font-weight:600;z-index:100}
|
|
64
64
|
`;
|
|
65
65
|
function ARFilters(props) {
|
|
66
66
|
(0, react_1.useEffect)(() => {
|
|
@@ -5,12 +5,12 @@ exports.AvatarAIForYouCard = AvatarAIForYouCard;
|
|
|
5
5
|
exports.AvatarAIPage = AvatarAIPage;
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const AVATAR_AI_CSS = `
|
|
9
|
-
.avatarai-styles-grid::-webkit-scrollbar { width: 6px; }
|
|
10
|
-
.avatarai-styles-grid::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
|
|
11
|
-
.avatarai-styles-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
|
|
12
|
-
@keyframes avatarai-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
|
|
13
|
-
@keyframes avatarai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
|
|
8
|
+
const AVATAR_AI_CSS = `
|
|
9
|
+
.avatarai-styles-grid::-webkit-scrollbar { width: 6px; }
|
|
10
|
+
.avatarai-styles-grid::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
|
|
11
|
+
.avatarai-styles-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
|
|
12
|
+
@keyframes avatarai-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
|
|
13
|
+
@keyframes avatarai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
|
|
14
14
|
`;
|
|
15
15
|
const defaultStyles = [
|
|
16
16
|
{ id: 1, name: 'Pirate', image: 'https://cdn.smarthubtech.net/upload/20240426_135427_99796_1_cuadrada.png' },
|
|
@@ -5,36 +5,36 @@ exports.COOKIE_CONSENT_COOKIE_NAME = 'cookieConsent';
|
|
|
5
5
|
exports.COOKIE_CONSENT_COOKIE_MAX_AGE = 60 * 60 * 24 * 365;
|
|
6
6
|
exports.TRACKING_PERMISSION_KEY = 'TRACKING_PERMISSION';
|
|
7
7
|
exports.FUNCTIONAL_PERMISSION_KEY = 'FUNCTIONAL_PERMISSION';
|
|
8
|
-
exports.COOKIE_CONSENT_CSS = `
|
|
9
|
-
.cc-overlay{position:fixed;bottom:0;left:0;right:0;z-index:9999;padding:16px;box-sizing:border-box}
|
|
10
|
-
.cc-banner{max-width:960px;margin:0 auto;padding:24px 28px;border-radius:12px;box-shadow:0 -4px 32px rgba(0,0,0,.18),0 2px 8px rgba(0,0,0,.12);display:flex;gap:20px;align-items:flex-start;flex-wrap:wrap}
|
|
11
|
-
@media(min-width:640px){.cc-banner{flex-wrap:nowrap;align-items:center}}
|
|
12
|
-
.cc-content{flex:1;min-width:0}
|
|
13
|
-
.cc-title{font-size:16px;font-weight:700;margin:0 0 6px 0;line-height:1.3}
|
|
14
|
-
.cc-description{font-size:13px;line-height:1.55;margin:0;opacity:.85}
|
|
15
|
-
.cc-link{text-decoration:underline;cursor:pointer;margin-left:4px}
|
|
16
|
-
.cc-actions{display:flex;gap:8px;flex-shrink:0;flex-direction:column;align-items:stretch}
|
|
17
|
-
@media(min-width:480px){.cc-actions{flex-direction:row;align-items:center}}
|
|
18
|
-
.cc-btn{padding:10px 20px;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;border:none;transition:opacity .2s;white-space:nowrap;line-height:1}
|
|
19
|
-
.cc-btn:hover{opacity:.88}
|
|
20
|
-
.cc-btn-essential{background:transparent}
|
|
21
|
-
.cc-config-link{background:none;border:none;cursor:pointer;font-size:12px;text-decoration:underline;padding:4px 0;font-family:inherit;line-height:1;opacity:.7;white-space:nowrap;display:block;text-align:center}
|
|
22
|
-
.cc-config-link:hover{opacity:1}
|
|
23
|
-
.cc-banner.cc-settings-mode{display:block}
|
|
24
|
-
.cc-settings-title{font-size:15px;font-weight:700;margin:0 0 14px 0}
|
|
25
|
-
.cc-settings-sep{border:none;border-top:1px solid rgba(255,255,255,.12);margin:0 0 16px}
|
|
26
|
-
.cc-category{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}
|
|
27
|
-
.cc-category:last-of-type{margin-bottom:0}
|
|
28
|
-
.cc-category-row{display:flex;align-items:center;gap:10px}
|
|
29
|
-
.cc-category-label{font-size:13px;font-weight:600;cursor:pointer;user-select:none;line-height:1.3}
|
|
30
|
-
.cc-category-label.cc-mandatory{cursor:default;opacity:.55}
|
|
31
|
-
.cc-category-desc{font-size:12px;line-height:1.55;opacity:.7;padding-left:26px;margin:0}
|
|
32
|
-
.cc-checkbox{width:15px;height:15px;flex-shrink:0;cursor:pointer;margin:0}
|
|
33
|
-
.cc-checkbox:disabled{cursor:default}
|
|
34
|
-
.cc-settings-footer{display:flex;justify-content:flex-end;margin-top:20px;padding-top:16px;border-top:1px solid rgba(255,255,255,.12)}
|
|
35
|
-
.cc-enter{animation:cc-slideup .28s ease-out}
|
|
36
|
-
.cc-exit{animation:cc-slidedown .22s ease-in forwards}
|
|
37
|
-
@keyframes cc-slideup{from{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}
|
|
38
|
-
@keyframes cc-slidedown{from{transform:translateY(0);opacity:1}to{transform:translateY(100%);opacity:0}}
|
|
8
|
+
exports.COOKIE_CONSENT_CSS = `
|
|
9
|
+
.cc-overlay{position:fixed;bottom:0;left:0;right:0;z-index:9999;padding:16px;box-sizing:border-box}
|
|
10
|
+
.cc-banner{max-width:960px;margin:0 auto;padding:24px 28px;border-radius:12px;box-shadow:0 -4px 32px rgba(0,0,0,.18),0 2px 8px rgba(0,0,0,.12);display:flex;gap:20px;align-items:flex-start;flex-wrap:wrap}
|
|
11
|
+
@media(min-width:640px){.cc-banner{flex-wrap:nowrap;align-items:center}}
|
|
12
|
+
.cc-content{flex:1;min-width:0}
|
|
13
|
+
.cc-title{font-size:16px;font-weight:700;margin:0 0 6px 0;line-height:1.3}
|
|
14
|
+
.cc-description{font-size:13px;line-height:1.55;margin:0;opacity:.85}
|
|
15
|
+
.cc-link{text-decoration:underline;cursor:pointer;margin-left:4px}
|
|
16
|
+
.cc-actions{display:flex;gap:8px;flex-shrink:0;flex-direction:column;align-items:stretch}
|
|
17
|
+
@media(min-width:480px){.cc-actions{flex-direction:row;align-items:center}}
|
|
18
|
+
.cc-btn{padding:10px 20px;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;border:none;transition:opacity .2s;white-space:nowrap;line-height:1}
|
|
19
|
+
.cc-btn:hover{opacity:.88}
|
|
20
|
+
.cc-btn-essential{background:transparent}
|
|
21
|
+
.cc-config-link{background:none;border:none;cursor:pointer;font-size:12px;text-decoration:underline;padding:4px 0;font-family:inherit;line-height:1;opacity:.7;white-space:nowrap;display:block;text-align:center}
|
|
22
|
+
.cc-config-link:hover{opacity:1}
|
|
23
|
+
.cc-banner.cc-settings-mode{display:block}
|
|
24
|
+
.cc-settings-title{font-size:15px;font-weight:700;margin:0 0 14px 0}
|
|
25
|
+
.cc-settings-sep{border:none;border-top:1px solid rgba(255,255,255,.12);margin:0 0 16px}
|
|
26
|
+
.cc-category{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}
|
|
27
|
+
.cc-category:last-of-type{margin-bottom:0}
|
|
28
|
+
.cc-category-row{display:flex;align-items:center;gap:10px}
|
|
29
|
+
.cc-category-label{font-size:13px;font-weight:600;cursor:pointer;user-select:none;line-height:1.3}
|
|
30
|
+
.cc-category-label.cc-mandatory{cursor:default;opacity:.55}
|
|
31
|
+
.cc-category-desc{font-size:12px;line-height:1.55;opacity:.7;padding-left:26px;margin:0}
|
|
32
|
+
.cc-checkbox{width:15px;height:15px;flex-shrink:0;cursor:pointer;margin:0}
|
|
33
|
+
.cc-checkbox:disabled{cursor:default}
|
|
34
|
+
.cc-settings-footer{display:flex;justify-content:flex-end;margin-top:20px;padding-top:16px;border-top:1px solid rgba(255,255,255,.12)}
|
|
35
|
+
.cc-enter{animation:cc-slideup .28s ease-out}
|
|
36
|
+
.cc-exit{animation:cc-slidedown .22s ease-in forwards}
|
|
37
|
+
@keyframes cc-slideup{from{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}
|
|
38
|
+
@keyframes cc-slidedown{from{transform:translateY(0);opacity:1}to{transform:translateY(100%);opacity:0}}
|
|
39
39
|
`;
|
|
40
40
|
//# sourceMappingURL=constants.js.map
|
|
@@ -11,18 +11,18 @@ const react_1 = require("react");
|
|
|
11
11
|
const link_1 = __importDefault(require("next/link"));
|
|
12
12
|
const ui_1 = require("./ui");
|
|
13
13
|
const utils_1 = require("../libraries/utils");
|
|
14
|
-
const FACESWAP_CSS = `
|
|
15
|
-
.faceswap-layout { display: flex; flex-direction: row; align-items: stretch; }
|
|
16
|
-
.faceswap-col-left { width: 30%; min-width: 280px; background: white; border: 1px solid #e5e7eb; display: flex; flex-direction: column; }
|
|
17
|
-
.faceswap-col-right { flex: 1; background: white; border: 1px solid #e5e7eb; border-left: none; display: flex; flex-direction: column; }
|
|
18
|
-
.faceswap-col-right > div:first-child { flex: 0 0 auto; }
|
|
19
|
-
.faceswap-col-right > div:last-child { flex: 1; display: flex; flex-direction: column; }
|
|
20
|
-
.faceswap-col-right > div:last-child > .faceswap-result-area { flex: 1; min-height: 0; }
|
|
21
|
-
@media (max-width: 768px) {
|
|
22
|
-
.faceswap-layout { flex-direction: column; }
|
|
23
|
-
.faceswap-col-left { width: 100%; min-width: unset; }
|
|
24
|
-
.faceswap-col-right { border-left: 1px solid #e5e7eb; border-top: none; width: 100%; }
|
|
25
|
-
}
|
|
14
|
+
const FACESWAP_CSS = `
|
|
15
|
+
.faceswap-layout { display: flex; flex-direction: row; align-items: stretch; }
|
|
16
|
+
.faceswap-col-left { width: 30%; min-width: 280px; background: white; border: 1px solid #e5e7eb; display: flex; flex-direction: column; }
|
|
17
|
+
.faceswap-col-right { flex: 1; background: white; border: 1px solid #e5e7eb; border-left: none; display: flex; flex-direction: column; }
|
|
18
|
+
.faceswap-col-right > div:first-child { flex: 0 0 auto; }
|
|
19
|
+
.faceswap-col-right > div:last-child { flex: 1; display: flex; flex-direction: column; }
|
|
20
|
+
.faceswap-col-right > div:last-child > .faceswap-result-area { flex: 1; min-height: 0; }
|
|
21
|
+
@media (max-width: 768px) {
|
|
22
|
+
.faceswap-layout { flex-direction: column; }
|
|
23
|
+
.faceswap-col-left { width: 100%; min-width: unset; }
|
|
24
|
+
.faceswap-col-right { border-left: 1px solid #e5e7eb; border-top: none; width: 100%; }
|
|
25
|
+
}
|
|
26
26
|
`;
|
|
27
27
|
function CreativeFaceSwapForYouCard({ title, description, ctaText, ctaHref, desktopImage, mobileImage, imageAlt = "", imageOnRight = true, titleColor = "#001B5E", descriptionColor = "#001B5E", ctaColor = "#FF5500", ctaHoverColor = "#ff1600", backgroundColor = "#F9F9F9", paddingClass = "py-12 md:py-16 lg:py-20", }) {
|
|
28
28
|
const effectiveMobileImage = mobileImage || desktopImage;
|
|
@@ -31,18 +31,18 @@ const defaultTexts = {
|
|
|
31
31
|
noMemes: 'No memes available',
|
|
32
32
|
};
|
|
33
33
|
const TEXT_SHADOW = '2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000';
|
|
34
|
-
const MEME_CSS = `
|
|
35
|
-
.memegen-grid {
|
|
36
|
-
display: grid;
|
|
37
|
-
grid-template-columns: 1fr;
|
|
38
|
-
gap: 24px;
|
|
39
|
-
align-items: stretch;
|
|
40
|
-
}
|
|
41
|
-
@media (min-width: 1024px) {
|
|
42
|
-
.memegen-grid {
|
|
43
|
-
grid-template-columns: 1fr 1fr;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
34
|
+
const MEME_CSS = `
|
|
35
|
+
.memegen-grid {
|
|
36
|
+
display: grid;
|
|
37
|
+
grid-template-columns: 1fr;
|
|
38
|
+
gap: 24px;
|
|
39
|
+
align-items: stretch;
|
|
40
|
+
}
|
|
41
|
+
@media (min-width: 1024px) {
|
|
42
|
+
.memegen-grid {
|
|
43
|
+
grid-template-columns: 1fr 1fr;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
46
|
`;
|
|
47
47
|
function MemeGenerator({ memes: memesProp, config, fonts = defaultFonts, defaultMemeIndex = 0, theme = {}, texts = {}, imageProxyUrl, onDownload, }) {
|
|
48
48
|
const mergedTheme = Object.assign(Object.assign({}, defaultTheme), theme);
|
|
@@ -23,38 +23,38 @@ exports.DEFAULT_PASSWORD_RULES = {
|
|
|
23
23
|
requireNumber: true,
|
|
24
24
|
requireSpecialChar: false,
|
|
25
25
|
};
|
|
26
|
-
exports.PASSWORD_RESET_CSS = `
|
|
27
|
-
.pr-page{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:24px 16px;box-sizing:border-box}
|
|
28
|
-
.pr-logo-wrap{margin-bottom:24px;text-align:center}
|
|
29
|
-
.pr-logo{display:block;max-width:200px;max-height:60px;width:auto;height:auto;object-fit:contain;margin:0 auto}
|
|
30
|
-
.pr-card{width:100%;max-width:var(--pr-card-max-width,400px);padding:32px 24px;border-radius:16px;box-sizing:border-box}
|
|
31
|
-
.pr-title{font-size:32px;font-weight:600;text-align:center;margin:0;line-height:1.2}
|
|
32
|
-
.pr-subtitle{font-size:20px;text-align:center;margin:24px 0 0 0;line-height:1.4;font-weight:400;opacity:0.8}
|
|
33
|
-
.pr-field{margin-bottom:16px}
|
|
34
|
-
.pr-label{display:block;font-size:20px;font-weight:500;margin-bottom:12px}
|
|
35
|
-
.pr-input-wrap{position:relative;display:flex;align-items:center}
|
|
36
|
-
.pr-input-icon{position:absolute;left:14px;width:20px;height:20px;flex-shrink:0;pointer-events:none;display:flex;align-items:center;justify-content:center}
|
|
37
|
-
.pr-input-icon svg{width:20px;height:20px;display:block}
|
|
38
|
-
.pr-input{width:100%;padding:14px 44px;border-radius:999px;border:1.5px solid;font-size:16px;outline:none;transition:border-color .18s,opacity .18s;box-sizing:border-box;font-family:inherit;line-height:1.4}
|
|
39
|
-
.pr-input::placeholder{color:var(--pr-ph,rgba(255,255,255,0.35))}
|
|
40
|
-
.pr-input:disabled{opacity:.6;cursor:not-allowed}
|
|
41
|
-
.pr-input-eye{position:absolute;right:14px;background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:opacity .18s;line-height:0}
|
|
42
|
-
.pr-input-eye:hover{opacity:.7}
|
|
43
|
-
.pr-input-eye svg{width:20px;height:20px;display:block}
|
|
44
|
-
.pr-btn{width:100%;padding:16px 24px;border-radius:999px;border:none;font-size:18px;font-weight:700;cursor:pointer;transition:opacity .18s,transform .1s;margin-top:12px;font-family:inherit;display:flex;align-items:center;justify-content:center;gap:8px;line-height:1}
|
|
45
|
-
.pr-btn:hover:not(:disabled){opacity:.85}
|
|
46
|
-
.pr-btn:active:not(:disabled){transform:scale(.98)}
|
|
47
|
-
.pr-btn:disabled{cursor:not-allowed;opacity:.5}
|
|
48
|
-
.pr-spinner{width:18px;height:18px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:pr-spin .65s linear infinite;flex-shrink:0}
|
|
49
|
-
@keyframes pr-spin{to{transform:rotate(360deg)}}
|
|
50
|
-
.pr-error-msg{font-size:15px;text-align:center;margin:16px 0 0 0;line-height:1.5}
|
|
51
|
-
.pr-success{text-align:center;padding:8px 0}
|
|
52
|
-
.pr-success-icon{font-size:52px;margin-bottom:24px;line-height:1}
|
|
53
|
-
.pr-success-text{font-size:18px;line-height:1.65;margin:0}
|
|
54
|
-
.pr-rules{margin:14px 0 4px 6px;display:flex;flex-direction:column;gap:10px}
|
|
55
|
-
.pr-rule{display:flex;align-items:center;gap:10px;font-size:15px;line-height:1.3;transition:color .2s}
|
|
56
|
-
.pr-rule-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;transition:background-color .2s}
|
|
57
|
-
@media(min-width:768px){.pr-card{max-width:var(--pr-card-max-width,448px);padding:32px}.pr-subtitle{margin:32px 0 0 0}.pr-field{margin-bottom:20px}}
|
|
58
|
-
@media(min-width:1024px){.pr-card{max-width:var(--pr-card-max-width,512px);padding:40px}.pr-subtitle{margin:40px 0 0 0}.pr-field{margin-bottom:24px}}
|
|
26
|
+
exports.PASSWORD_RESET_CSS = `
|
|
27
|
+
.pr-page{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:24px 16px;box-sizing:border-box}
|
|
28
|
+
.pr-logo-wrap{margin-bottom:24px;text-align:center}
|
|
29
|
+
.pr-logo{display:block;max-width:200px;max-height:60px;width:auto;height:auto;object-fit:contain;margin:0 auto}
|
|
30
|
+
.pr-card{width:100%;max-width:var(--pr-card-max-width,400px);padding:32px 24px;border-radius:16px;box-sizing:border-box}
|
|
31
|
+
.pr-title{font-size:32px;font-weight:600;text-align:center;margin:0;line-height:1.2}
|
|
32
|
+
.pr-subtitle{font-size:20px;text-align:center;margin:24px 0 0 0;line-height:1.4;font-weight:400;opacity:0.8}
|
|
33
|
+
.pr-field{margin-bottom:16px}
|
|
34
|
+
.pr-label{display:block;font-size:20px;font-weight:500;margin-bottom:12px}
|
|
35
|
+
.pr-input-wrap{position:relative;display:flex;align-items:center}
|
|
36
|
+
.pr-input-icon{position:absolute;left:14px;width:20px;height:20px;flex-shrink:0;pointer-events:none;display:flex;align-items:center;justify-content:center}
|
|
37
|
+
.pr-input-icon svg{width:20px;height:20px;display:block}
|
|
38
|
+
.pr-input{width:100%;padding:14px 44px;border-radius:999px;border:1.5px solid;font-size:16px;outline:none;transition:border-color .18s,opacity .18s;box-sizing:border-box;font-family:inherit;line-height:1.4}
|
|
39
|
+
.pr-input::placeholder{color:var(--pr-ph,rgba(255,255,255,0.35))}
|
|
40
|
+
.pr-input:disabled{opacity:.6;cursor:not-allowed}
|
|
41
|
+
.pr-input-eye{position:absolute;right:14px;background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:opacity .18s;line-height:0}
|
|
42
|
+
.pr-input-eye:hover{opacity:.7}
|
|
43
|
+
.pr-input-eye svg{width:20px;height:20px;display:block}
|
|
44
|
+
.pr-btn{width:100%;padding:16px 24px;border-radius:999px;border:none;font-size:18px;font-weight:700;cursor:pointer;transition:opacity .18s,transform .1s;margin-top:12px;font-family:inherit;display:flex;align-items:center;justify-content:center;gap:8px;line-height:1}
|
|
45
|
+
.pr-btn:hover:not(:disabled){opacity:.85}
|
|
46
|
+
.pr-btn:active:not(:disabled){transform:scale(.98)}
|
|
47
|
+
.pr-btn:disabled{cursor:not-allowed;opacity:.5}
|
|
48
|
+
.pr-spinner{width:18px;height:18px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:pr-spin .65s linear infinite;flex-shrink:0}
|
|
49
|
+
@keyframes pr-spin{to{transform:rotate(360deg)}}
|
|
50
|
+
.pr-error-msg{font-size:15px;text-align:center;margin:16px 0 0 0;line-height:1.5}
|
|
51
|
+
.pr-success{text-align:center;padding:8px 0}
|
|
52
|
+
.pr-success-icon{font-size:52px;margin-bottom:24px;line-height:1}
|
|
53
|
+
.pr-success-text{font-size:18px;line-height:1.65;margin:0}
|
|
54
|
+
.pr-rules{margin:14px 0 4px 6px;display:flex;flex-direction:column;gap:10px}
|
|
55
|
+
.pr-rule{display:flex;align-items:center;gap:10px;font-size:15px;line-height:1.3;transition:color .2s}
|
|
56
|
+
.pr-rule-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;transition:background-color .2s}
|
|
57
|
+
@media(min-width:768px){.pr-card{max-width:var(--pr-card-max-width,448px);padding:32px}.pr-subtitle{margin:32px 0 0 0}.pr-field{margin-bottom:20px}}
|
|
58
|
+
@media(min-width:1024px){.pr-card{max-width:var(--pr-card-max-width,512px);padding:40px}.pr-subtitle{margin:40px 0 0 0}.pr-field{margin-bottom:24px}}
|
|
59
59
|
`;
|
|
60
60
|
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RecoveryPasswordProps } from './types';
|
|
2
|
+
export declare function RecoveryPassword({ websiteId, identifierType, locale, logoUrl, logoAlt, theme: themeProp, texts: textsProp, sendPinEndpoint, onSuccess, onError, }: RecoveryPasswordProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=RecoveryPassword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecoveryPassword.d.ts","sourceRoot":"","sources":["../../../src/components/RecoveryPassword/RecoveryPassword.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAiErD,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,cAAwB,EACxB,MAAa,EACb,OAAO,EACP,OAAY,EACZ,KAAK,EAAE,SAAc,EACrB,KAAK,EAAE,SAAc,EACrB,eAAe,EACf,SAAS,EACT,OAAO,GACR,EAAE,qBAAqB,2CAqLvB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RecoveryPassword = RecoveryPassword;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const translations_1 = require("./translations");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
function injectStyles(css) {
|
|
10
|
+
if (typeof document === 'undefined')
|
|
11
|
+
return;
|
|
12
|
+
if (document.getElementById(constants_1.RECOVERY_STYLE_ID))
|
|
13
|
+
return;
|
|
14
|
+
const style = document.createElement('style');
|
|
15
|
+
style.id = constants_1.RECOVERY_STYLE_ID;
|
|
16
|
+
style.textContent = css;
|
|
17
|
+
document.head.appendChild(style);
|
|
18
|
+
}
|
|
19
|
+
function isValidEmail(value) {
|
|
20
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
21
|
+
}
|
|
22
|
+
function IconPhone({ color }) {
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: (0, jsx_runtime_1.jsx)("path", { d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 12 19.79 19.79 0 0 1 1.61 3.42 2 2 0 0 1 3.6 1.27h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.91 8.91a16 16 0 0 0 6 6l.92-.92a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z" }) }));
|
|
24
|
+
}
|
|
25
|
+
function IconEmail({ color }) {
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2" }), (0, jsx_runtime_1.jsx)("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })] }));
|
|
27
|
+
}
|
|
28
|
+
function IconUser({ color }) {
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "8", r: "4" }), (0, jsx_runtime_1.jsx)("path", { d: "M4 20c0-4 3.6-7 8-7s8 3 8 7" })] }));
|
|
30
|
+
}
|
|
31
|
+
function resolveApiError(reason, texts) {
|
|
32
|
+
switch (reason) {
|
|
33
|
+
case 'USER_HAVE_NOT_SUBSCRIPTION':
|
|
34
|
+
return texts.errorNoSubscription;
|
|
35
|
+
case 'INVALID_WEBSITE_ID':
|
|
36
|
+
return texts.errorInvalidWebsite;
|
|
37
|
+
case 'MISSING_PARAMETER_WEBSITE_ID':
|
|
38
|
+
return texts.errorMissingParam;
|
|
39
|
+
case 'ERROR_EN_ENVIO_SMS':
|
|
40
|
+
case 'ERROR_EN_ENVIO_MAIL':
|
|
41
|
+
return texts.errorSendFailed;
|
|
42
|
+
default:
|
|
43
|
+
return texts.errorUnknown;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function RecoveryPassword({ websiteId, identifierType = 'phone', locale = 'en', logoUrl, logoAlt = '', theme: themeProp = {}, texts: textsProp = {}, sendPinEndpoint, onSuccess, onError, }) {
|
|
47
|
+
const [user, setUser] = (0, react_1.useState)('');
|
|
48
|
+
const [status, setStatus] = (0, react_1.useState)('idle');
|
|
49
|
+
const [errorMessage, setErrorMessage] = (0, react_1.useState)('');
|
|
50
|
+
const theme = Object.assign(Object.assign({}, constants_1.DEFAULT_RECOVERY_THEME), themeProp);
|
|
51
|
+
const texts = Object.assign(Object.assign({}, (0, translations_1.getRecoveryPasswordTexts)(locale)), textsProp);
|
|
52
|
+
(0, react_1.useEffect)(() => {
|
|
53
|
+
injectStyles(constants_1.RECOVERY_CSS);
|
|
54
|
+
}, []);
|
|
55
|
+
const title = identifierType === 'email' ? texts.titleEmail :
|
|
56
|
+
identifierType === 'phone' ? texts.titlePhone :
|
|
57
|
+
texts.titleUsername;
|
|
58
|
+
const subtitle = identifierType === 'email' ? texts.subtitleEmail :
|
|
59
|
+
identifierType === 'phone' ? texts.subtitlePhone :
|
|
60
|
+
texts.subtitleUsername;
|
|
61
|
+
const inputLabel = identifierType === 'email' ? texts.inputLabelEmail :
|
|
62
|
+
identifierType === 'phone' ? texts.inputLabelPhone :
|
|
63
|
+
texts.inputLabelUsername;
|
|
64
|
+
const inputPlaceholder = identifierType === 'email' ? texts.inputPlaceholderEmail :
|
|
65
|
+
identifierType === 'phone' ? texts.inputPlaceholderPhone :
|
|
66
|
+
texts.inputPlaceholderUsername;
|
|
67
|
+
const inputType = identifierType === 'email' ? 'email' :
|
|
68
|
+
identifierType === 'phone' ? 'tel' :
|
|
69
|
+
'text';
|
|
70
|
+
const InputIcon = identifierType === 'email' ? IconEmail :
|
|
71
|
+
identifierType === 'phone' ? IconPhone :
|
|
72
|
+
IconUser;
|
|
73
|
+
const handleSubmit = async (e) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
const trimmed = user.trim();
|
|
77
|
+
if (!trimmed) {
|
|
78
|
+
setErrorMessage(texts.errorRequired);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (identifierType === 'email' && !isValidEmail(trimmed)) {
|
|
82
|
+
setErrorMessage(texts.errorInvalidEmail);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setErrorMessage('');
|
|
86
|
+
setStatus('loading');
|
|
87
|
+
try {
|
|
88
|
+
const res = await fetch(sendPinEndpoint, {
|
|
89
|
+
method: 'POST',
|
|
90
|
+
headers: { 'Content-Type': 'application/json' },
|
|
91
|
+
body: JSON.stringify({ user: trimmed, website_id: websiteId }),
|
|
92
|
+
});
|
|
93
|
+
const data = await res.json();
|
|
94
|
+
if (data === null || data === void 0 ? void 0 : data.success) {
|
|
95
|
+
setStatus('success');
|
|
96
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const reason = (_b = (_a = data === null || data === void 0 ? void 0 : data.error) === null || _a === void 0 ? void 0 : _a.reason) !== null && _b !== void 0 ? _b : '';
|
|
100
|
+
const msg = resolveApiError(reason, texts);
|
|
101
|
+
setStatus('error');
|
|
102
|
+
setErrorMessage(msg);
|
|
103
|
+
onError === null || onError === void 0 ? void 0 : onError(new Error(msg));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (_c) {
|
|
107
|
+
setStatus('error');
|
|
108
|
+
setErrorMessage(texts.errorGeneric);
|
|
109
|
+
onError === null || onError === void 0 ? void 0 : onError(new Error(texts.errorGeneric));
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const iconColor = theme.mutedTextColor;
|
|
113
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "rp-page", style: {
|
|
114
|
+
backgroundColor: theme.backgroundColor,
|
|
115
|
+
fontFamily: theme.fontFamily,
|
|
116
|
+
color: theme.textColor,
|
|
117
|
+
['--rp-ph']: theme.mutedTextColor,
|
|
118
|
+
['--rp-card-max-width']: theme.cardMaxWidth,
|
|
119
|
+
}, children: [logoUrl && ((0, jsx_runtime_1.jsx)("div", { className: "rp-logo-wrap", children: (0, jsx_runtime_1.jsx)("img", { src: logoUrl, alt: logoAlt, className: "rp-logo" }) })), (0, jsx_runtime_1.jsx)("div", { className: "rp-card", style: {
|
|
120
|
+
backgroundColor: theme.cardBackgroundColor,
|
|
121
|
+
borderRadius: theme.cardBorderRadius,
|
|
122
|
+
border: `1px solid ${theme.cardBorderColor}`,
|
|
123
|
+
}, children: status === 'success' ? ((0, jsx_runtime_1.jsxs)("div", { className: "rp-success", children: [(0, jsx_runtime_1.jsx)("div", { className: "rp-success-icon", "aria-hidden": "true", children: "\u2709\uFE0F" }), (0, jsx_runtime_1.jsx)("p", { className: "rp-success-text", style: { color: theme.textColor }, children: texts.successMessage })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h1", { className: "rp-title", style: { color: theme.textColor }, children: title }), (0, jsx_runtime_1.jsx)("p", { className: "rp-subtitle", style: { color: theme.mutedTextColor }, children: subtitle }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: handleSubmit, noValidate: true, children: [(0, jsx_runtime_1.jsxs)("div", { className: "rp-field", children: [(0, jsx_runtime_1.jsx)("label", { className: "rp-label", style: { color: theme.textColor }, children: inputLabel }), (0, jsx_runtime_1.jsxs)("div", { className: "rp-input-wrap", children: [(0, jsx_runtime_1.jsx)("span", { className: "rp-input-icon", children: (0, jsx_runtime_1.jsx)(InputIcon, { color: iconColor }) }), (0, jsx_runtime_1.jsx)("input", { className: "rp-input", type: inputType, value: user, onChange: (e) => {
|
|
124
|
+
setUser(e.target.value);
|
|
125
|
+
if (errorMessage)
|
|
126
|
+
setErrorMessage('');
|
|
127
|
+
}, placeholder: inputPlaceholder, disabled: status === 'loading', autoComplete: inputType === 'email' ? 'email' : inputType === 'tel' ? 'tel' : 'username', style: {
|
|
128
|
+
backgroundColor: theme.inputBackgroundColor,
|
|
129
|
+
borderColor: errorMessage ? theme.errorColor : theme.inputBorderColor,
|
|
130
|
+
color: theme.textColor,
|
|
131
|
+
} })] })] }), (status === 'error' || errorMessage) && ((0, jsx_runtime_1.jsx)("p", { className: "rp-error-msg", role: "alert", style: { color: theme.errorColor }, children: errorMessage })), (0, jsx_runtime_1.jsxs)("button", { type: "submit", className: "rp-btn", disabled: status === 'loading', style: { backgroundColor: theme.accentColor, color: '#ffffff' }, children: [status === 'loading' && (0, jsx_runtime_1.jsx)("span", { className: "rp-spinner", "aria-hidden": "true" }), status === 'loading' ? texts.submitLoadingButton : texts.submitButton] })] })] })) })] }));
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=RecoveryPassword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecoveryPassword.js","sourceRoot":"","sources":["../../../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AY,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,EACxF,KAAK,EAAE;wDACL,eAAe,EAAE,KAAK,CAAC,oBAAoB;wDAC3C,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB;wDACrE,KAAK,EAAE,KAAK,CAAC,SAAS;qDACvB,GACD,IACE,IACF,EAEL,CAAC,MAAM,KAAK,OAAO,IAAI,YAAY,CAAC,IAAI,CACvC,8BAAG,SAAS,EAAC,cAAc,EAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,YACxE,YAAY,GACX,CACL,EAED,oCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,QAAQ,EAClB,QAAQ,EAAE,MAAM,KAAK,SAAS,EAC9B,KAAK,EAAE,EAAE,eAAe,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,aAE9D,MAAM,KAAK,SAAS,IAAI,iCAAM,SAAS,EAAC,YAAY,iBAAa,MAAM,GAAG,EAC1E,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,IAC/D,IACJ,IACN,CACJ,GACG,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RecoveryPasswordTheme } from './types';
|
|
2
|
+
export declare const RECOVERY_STYLE_ID = "webs-sdk-recovery-password";
|
|
3
|
+
export declare const DEFAULT_RECOVERY_THEME: Required<RecoveryPasswordTheme>;
|
|
4
|
+
export declare const SENDPIN_ERROR_REASONS: readonly ["USER_HAVE_NOT_SUBSCRIPTION", "INVALID_WEBSITE_ID", "MISSING_PARAMETER_WEBSITE_ID", "ERROR_EN_ENVIO_SMS", "ERROR_EN_ENVIO_MAIL"];
|
|
5
|
+
export type SendpinErrorReason = typeof SENDPIN_ERROR_REASONS[number];
|
|
6
|
+
export declare const RECOVERY_CSS = "\n.rp-page{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:24px 16px;box-sizing:border-box}\n.rp-logo-wrap{margin-bottom:24px;text-align:center}\n.rp-logo{display:block;max-width:200px;max-height:60px;width:auto;height:auto;object-fit:contain;margin:0 auto}\n.rp-card{width:100%;max-width:var(--rp-card-max-width,448px);padding:32px 24px;border-radius:16px;box-sizing:border-box}\n.rp-title{font-size:24px;font-weight:600;text-align:center;margin:0 0 12px 0;line-height:1.3}\n.rp-subtitle{font-size:16px;text-align:center;margin:0 0 24px 0;line-height:1.6;font-weight:400;opacity:0.8}\n.rp-field{margin-bottom:16px}\n.rp-label{display:block;font-size:15px;font-weight:500;margin-bottom:8px}\n.rp-input-wrap{position:relative;display:flex;align-items:center}\n.rp-input-icon{position:absolute;left:14px;width:20px;height:20px;flex-shrink:0;pointer-events:none;display:flex;align-items:center;justify-content:center}\n.rp-input-icon svg{width:20px;height:20px;display:block}\n.rp-input{width:100%;padding:14px 44px;border-radius:999px;border:1.5px solid;font-size:16px;outline:none;transition:border-color .18s,opacity .18s;box-sizing:border-box;font-family:inherit;line-height:1.4}\n.rp-input::placeholder{color:var(--rp-ph,rgba(255,255,255,0.35))}\n.rp-input:disabled{opacity:.6;cursor:not-allowed}\n.rp-btn{width:100%;padding:14px 24px;border-radius:999px;border:none;font-size:16px;font-weight:700;cursor:pointer;transition:opacity .18s,transform .1s;margin-top:8px;font-family:inherit;display:flex;align-items:center;justify-content:center;gap:8px;line-height:1}\n.rp-btn:hover:not(:disabled){opacity:.85}\n.rp-btn:active:not(:disabled){transform:scale(.98)}\n.rp-btn:disabled{cursor:not-allowed;opacity:.5}\n.rp-spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:rp-spin .65s linear infinite;flex-shrink:0}\n@keyframes rp-spin{to{transform:rotate(360deg)}}\n.rp-error-msg{font-size:14px;text-align:center;margin:12px 0 0 0;line-height:1.5}\n.rp-success{text-align:center;padding:8px 0}\n.rp-success-icon{font-size:48px;margin-bottom:20px;line-height:1}\n.rp-success-text{font-size:17px;line-height:1.65;margin:0}\n@media(min-width:768px){.rp-card{max-width:var(--rp-card-max-width,448px);padding:32px}}\n@media(min-width:1024px){.rp-card{max-width:var(--rp-card-max-width,512px);padding:40px}}\n";
|
|
7
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/RecoveryPassword/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAE9D,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,qBAAqB,CAclE,CAAC;AAGF,eAAO,MAAM,qBAAqB,4IAMxB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAEtE,eAAO,MAAM,YAAY,03EA2BxB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RECOVERY_CSS = exports.SENDPIN_ERROR_REASONS = exports.DEFAULT_RECOVERY_THEME = exports.RECOVERY_STYLE_ID = void 0;
|
|
4
|
+
exports.RECOVERY_STYLE_ID = 'webs-sdk-recovery-password';
|
|
5
|
+
exports.DEFAULT_RECOVERY_THEME = {
|
|
6
|
+
backgroundColor: '#000000',
|
|
7
|
+
cardBackgroundColor: '#1c1c1c',
|
|
8
|
+
accentColor: '#e53e3e',
|
|
9
|
+
textColor: '#ffffff',
|
|
10
|
+
mutedTextColor: 'rgba(255,255,255,0.45)',
|
|
11
|
+
inputBackgroundColor: '#2a2a2a',
|
|
12
|
+
inputBorderColor: 'transparent',
|
|
13
|
+
errorColor: '#fc8181',
|
|
14
|
+
successColor: '#68d391',
|
|
15
|
+
cardBorderRadius: '16px',
|
|
16
|
+
cardBorderColor: 'transparent',
|
|
17
|
+
cardMaxWidth: '448px',
|
|
18
|
+
fontFamily: 'inherit',
|
|
19
|
+
};
|
|
20
|
+
exports.SENDPIN_ERROR_REASONS = [
|
|
21
|
+
'USER_HAVE_NOT_SUBSCRIPTION',
|
|
22
|
+
'INVALID_WEBSITE_ID',
|
|
23
|
+
'MISSING_PARAMETER_WEBSITE_ID',
|
|
24
|
+
'ERROR_EN_ENVIO_SMS',
|
|
25
|
+
'ERROR_EN_ENVIO_MAIL',
|
|
26
|
+
];
|
|
27
|
+
exports.RECOVERY_CSS = `
|
|
28
|
+
.rp-page{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:24px 16px;box-sizing:border-box}
|
|
29
|
+
.rp-logo-wrap{margin-bottom:24px;text-align:center}
|
|
30
|
+
.rp-logo{display:block;max-width:200px;max-height:60px;width:auto;height:auto;object-fit:contain;margin:0 auto}
|
|
31
|
+
.rp-card{width:100%;max-width:var(--rp-card-max-width,448px);padding:32px 24px;border-radius:16px;box-sizing:border-box}
|
|
32
|
+
.rp-title{font-size:24px;font-weight:600;text-align:center;margin:0 0 12px 0;line-height:1.3}
|
|
33
|
+
.rp-subtitle{font-size:16px;text-align:center;margin:0 0 24px 0;line-height:1.6;font-weight:400;opacity:0.8}
|
|
34
|
+
.rp-field{margin-bottom:16px}
|
|
35
|
+
.rp-label{display:block;font-size:15px;font-weight:500;margin-bottom:8px}
|
|
36
|
+
.rp-input-wrap{position:relative;display:flex;align-items:center}
|
|
37
|
+
.rp-input-icon{position:absolute;left:14px;width:20px;height:20px;flex-shrink:0;pointer-events:none;display:flex;align-items:center;justify-content:center}
|
|
38
|
+
.rp-input-icon svg{width:20px;height:20px;display:block}
|
|
39
|
+
.rp-input{width:100%;padding:14px 44px;border-radius:999px;border:1.5px solid;font-size:16px;outline:none;transition:border-color .18s,opacity .18s;box-sizing:border-box;font-family:inherit;line-height:1.4}
|
|
40
|
+
.rp-input::placeholder{color:var(--rp-ph,rgba(255,255,255,0.35))}
|
|
41
|
+
.rp-input:disabled{opacity:.6;cursor:not-allowed}
|
|
42
|
+
.rp-btn{width:100%;padding:14px 24px;border-radius:999px;border:none;font-size:16px;font-weight:700;cursor:pointer;transition:opacity .18s,transform .1s;margin-top:8px;font-family:inherit;display:flex;align-items:center;justify-content:center;gap:8px;line-height:1}
|
|
43
|
+
.rp-btn:hover:not(:disabled){opacity:.85}
|
|
44
|
+
.rp-btn:active:not(:disabled){transform:scale(.98)}
|
|
45
|
+
.rp-btn:disabled{cursor:not-allowed;opacity:.5}
|
|
46
|
+
.rp-spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:rp-spin .65s linear infinite;flex-shrink:0}
|
|
47
|
+
@keyframes rp-spin{to{transform:rotate(360deg)}}
|
|
48
|
+
.rp-error-msg{font-size:14px;text-align:center;margin:12px 0 0 0;line-height:1.5}
|
|
49
|
+
.rp-success{text-align:center;padding:8px 0}
|
|
50
|
+
.rp-success-icon{font-size:48px;margin-bottom:20px;line-height:1}
|
|
51
|
+
.rp-success-text{font-size:17px;line-height:1.65;margin:0}
|
|
52
|
+
@media(min-width:768px){.rp-card{max-width:var(--rp-card-max-width,448px);padding:32px}}
|
|
53
|
+
@media(min-width:1024px){.rp-card{max-width:var(--rp-card-max-width,512px);padding:40px}}
|
|
54
|
+
`;
|
|
55
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/RecoveryPassword/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,iBAAiB,GAAG,4BAA4B,CAAC;AAEjD,QAAA,sBAAsB,GAAoC;IACrE,eAAe,EAAE,SAAS;IAC1B,mBAAmB,EAAE,SAAS;IAC9B,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,wBAAwB;IACxC,oBAAoB,EAAE,SAAS;IAC/B,gBAAgB,EAAE,aAAa;IAC/B,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,gBAAgB,EAAE,MAAM;IACxB,eAAe,EAAE,aAAa;IAC9B,YAAY,EAAE,OAAO;IACrB,UAAU,EAAE,SAAS;CACtB,CAAC;AAGW,QAAA,qBAAqB,GAAG;IACnC,4BAA4B;IAC5B,oBAAoB;IACpB,8BAA8B;IAC9B,oBAAoB;IACpB,qBAAqB;CACb,CAAC;AAIE,QAAA,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2B3B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { RecoveryPassword } from './RecoveryPassword';
|
|
2
|
+
export { getRecoveryPasswordTexts } from './translations';
|
|
3
|
+
export type { RecoveryPasswordProps, RecoveryPasswordTheme, RecoveryPasswordTexts, RecoveryIdentifierType, } from './types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RecoveryPassword/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,SAAS,CAAC"}
|