@cirkay-eng/cirkay-components 0.7.2 → 0.7.4
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/base/magic/MagicAPI.d.ts.map +1 -1
- package/dist/base/magic/MagicAPI.js +4 -3
- package/dist/base/magic/MagicAPI.js.map +1 -1
- package/dist/base/n3xus/N3xusAPI.d.ts +8 -5
- package/dist/base/n3xus/N3xusAPI.d.ts.map +1 -1
- package/dist/base/n3xus/N3xusAPI.js +110 -49
- package/dist/base/n3xus/N3xusAPI.js.map +1 -1
- package/dist/base/n3xus/types.d.ts +67 -24
- package/dist/base/n3xus/types.d.ts.map +1 -1
- package/dist/base/n3xus/types.js +1 -0
- package/dist/base/n3xus/types.js.map +1 -1
- package/dist/components/connected/connected.d.ts +33 -0
- package/dist/components/connected/connected.d.ts.map +1 -0
- package/dist/components/connected/connected.js +586 -0
- package/dist/components/connected/connected.js.map +1 -0
- package/dist/components/connected/index.d.ts +8 -0
- package/dist/components/connected/index.d.ts.map +1 -0
- package/dist/components/connected/index.js +6 -0
- package/dist/components/connected/index.js.map +1 -0
- package/dist/components/error-screen/error-screen.d.ts +4 -3
- package/dist/components/error-screen/error-screen.d.ts.map +1 -1
- package/dist/components/error-screen/error-screen.js +6 -11
- package/dist/components/error-screen/error-screen.js.map +1 -1
- package/dist/components/error-screen/index.d.ts +6 -1
- package/dist/components/error-screen/index.d.ts.map +1 -1
- package/dist/components/error-screen/index.js +6 -0
- package/dist/components/error-screen/index.js.map +1 -0
- package/dist/components/fan-pass-claim/fan-pass-claim.d.ts +32 -14
- package/dist/components/fan-pass-claim/fan-pass-claim.d.ts.map +1 -1
- package/dist/components/fan-pass-claim/fan-pass-claim.js +749 -322
- package/dist/components/fan-pass-claim/fan-pass-claim.js.map +1 -1
- package/dist/components/fan-pass-claim/index.d.ts +8 -2
- package/dist/components/fan-pass-claim/index.d.ts.map +1 -1
- package/dist/components/fan-pass-claim/index.js +6 -0
- package/dist/components/fan-pass-claim/index.js.map +1 -0
- package/dist/components/fan-pass-claim/types.d.ts +7 -0
- package/dist/components/fan-pass-claim/types.d.ts.map +1 -1
- package/dist/components/fan-pass-claim/types.js +9 -1
- package/dist/components/fan-pass-claim/types.js.map +1 -1
- package/dist/components/fan-pass-unlock/fan-pass-unlock.d.ts +31 -17
- package/dist/components/fan-pass-unlock/fan-pass-unlock.d.ts.map +1 -1
- package/dist/components/fan-pass-unlock/fan-pass-unlock.js +539 -198
- package/dist/components/fan-pass-unlock/fan-pass-unlock.js.map +1 -1
- package/dist/components/fan-pass-unlock/index.d.ts +8 -2
- package/dist/components/fan-pass-unlock/index.d.ts.map +1 -1
- package/dist/components/fan-pass-unlock/index.js +6 -0
- package/dist/components/fan-pass-unlock/index.js.map +1 -0
- package/dist/components/frame/frame.d.ts +1 -0
- package/dist/components/frame/frame.d.ts.map +1 -1
- package/dist/components/frame/frame.js +48 -20
- package/dist/components/frame/frame.js.map +1 -1
- package/dist/components/frame/index.d.ts +6 -1
- package/dist/components/frame/index.d.ts.map +1 -1
- package/dist/components/frame/index.js +6 -0
- package/dist/components/frame/index.js.map +1 -0
- package/dist/components/index.d.ts +4 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -3
- package/dist/components/index.js.map +1 -1
- package/dist/components/login/index.d.ts +6 -1
- package/dist/components/login/index.d.ts.map +1 -1
- package/dist/components/login/index.js +6 -0
- package/dist/components/login/index.js.map +1 -0
- package/dist/components/login/login.d.ts +4 -3
- package/dist/components/login/login.d.ts.map +1 -1
- package/dist/components/login/login.js +97 -38
- package/dist/components/login/login.js.map +1 -1
- package/dist/components/login/types.d.ts +4 -0
- package/dist/components/login/types.d.ts.map +1 -1
- package/dist/components/mobile-pass/index.d.ts +8 -0
- package/dist/components/mobile-pass/index.d.ts.map +1 -0
- package/dist/components/mobile-pass/index.js +6 -0
- package/dist/components/mobile-pass/index.js.map +1 -0
- package/dist/components/mobile-pass/mobile-pass.d.ts +20 -0
- package/dist/components/mobile-pass/mobile-pass.d.ts.map +1 -0
- package/dist/components/mobile-pass/mobile-pass.js +150 -0
- package/dist/components/mobile-pass/mobile-pass.js.map +1 -0
- package/dist/constants/components.d.ts +1 -1
- package/dist/constants/components.d.ts.map +1 -1
- package/dist/constants/components.js +1 -1
- package/dist/controllers/LoginController.d.ts +33 -5
- package/dist/controllers/LoginController.d.ts.map +1 -1
- package/dist/controllers/LoginController.js +38 -24
- package/dist/controllers/LoginController.js.map +1 -1
- package/dist/docs/error-screen/designTokens.d.ts +1 -3
- package/dist/docs/error-screen/designTokens.d.ts.map +1 -1
- package/dist/docs/fan-pass-claim/designTokens.d.ts.map +1 -1
- package/dist/docs/fan-pass-claim/fan-pass-claim.stories.d.ts +1 -1
- package/dist/docs/fan-pass-claim/fan-pass-claim.stories.d.ts.map +1 -1
- package/dist/docs/fan-pass-unlock/designTokens.d.ts.map +1 -1
- package/dist/docs/fan-pass-unlock/fan-pass-unlock.stories.d.ts +1 -1
- package/dist/docs/fan-pass-unlock/fan-pass-unlock.stories.d.ts.map +1 -1
- package/dist/docs/login/designTokens.d.ts +1 -3
- package/dist/docs/login/designTokens.d.ts.map +1 -1
- package/dist/docs/login/login.stories.d.ts +1 -1
- package/dist/docs/login/login.stories.d.ts.map +1 -1
- package/dist/docs/mobile-pass/designTokens.d.ts +3 -0
- package/dist/docs/mobile-pass/designTokens.d.ts.map +1 -0
- package/dist/docs/mobile-pass/mobile-pass.stories.d.ts +6 -0
- package/dist/docs/mobile-pass/mobile-pass.stories.d.ts.map +1 -0
- package/dist/events/claim.d.ts +2 -1
- package/dist/events/claim.d.ts.map +1 -1
- package/dist/events/claim.js.map +1 -1
- package/dist/events/login.d.ts +8 -1
- package/dist/events/login.d.ts.map +1 -1
- package/dist/events/login.js +1 -0
- package/dist/events/login.js.map +1 -1
- package/dist/events/unlock.d.ts +15 -1
- package/dist/events/unlock.d.ts.map +1 -1
- package/dist/events/unlock.js +2 -0
- package/dist/events/unlock.js.map +1 -1
- package/dist/internal/CirkayElement.d.ts.map +1 -1
- package/dist/internal/CirkayElement.js +0 -2
- package/dist/internal/CirkayElement.js.map +1 -1
- package/dist/node_modules/.pnpm/@magic-sdk_provider@28.20.0_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.js +10 -0
- package/dist/node_modules/.pnpm/@magic-sdk_provider@28.20.0_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@magic-sdk_types@24.18.0/node_modules/@magic-sdk/types/dist/es/index.js +4 -0
- package/dist/node_modules/.pnpm/@magic-sdk_types@24.18.0/node_modules/@magic-sdk/types/dist/es/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.2_rollup@4.29.1_tslib@2.8.1_typescript@5.7.2 → @rollup_plugin-typescript@12.1.2_rollup@4.34.6_tslib@2.8.1_typescript@5.7.3}/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.34.8_tslib@2.8.1_typescript@5.7.3/node_modules/tslib/tslib.es6.js +31 -0
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.34.8_tslib@2.8.1_typescript@5.7.3/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/node_modules/.pnpm/magic-sdk@28.21.1/node_modules/magic-sdk/dist/es/index.js +9 -0
- package/dist/node_modules/.pnpm/magic-sdk@28.21.1/node_modules/magic-sdk/dist/es/index.js.map +1 -0
- package/dist/utils/helpers.d.ts +26 -2
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +65 -7
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +21 -16
- package/dist/_virtual/_commonjsHelpers.js +0 -6
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/index.js +0 -8
- package/dist/_virtual/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios-rate-limit@1.4.0_axios@1.7.9/node_modules/axios-rate-limit/src/index.js +0 -182
- package/dist/node_modules/.pnpm/axios-rate-limit@1.4.0_axios@1.7.9/node_modules/axios-rate-limit/src/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/adapters.js +0 -82
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/adapters.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/fetch.js +0 -230
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/fetch.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/xhr.js +0 -200
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/xhr.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/axios.js +0 -87
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/axios.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CancelToken.js +0 -134
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CancelToken.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CanceledError.js +0 -24
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CanceledError.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/isCancel.js +0 -6
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/isCancel.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/Axios.js +0 -232
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/Axios.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosError.js +0 -102
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosError.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosHeaders.js +0 -301
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosHeaders.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/InterceptorManager.js +0 -70
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/InterceptorManager.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/buildFullPath.js +0 -22
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/buildFullPath.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/dispatchRequest.js +0 -82
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/dispatchRequest.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/mergeConfig.js +0 -107
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/mergeConfig.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/settle.js +0 -28
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/settle.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/transformData.js +0 -29
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/transformData.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/index.js +0 -160
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/transitional.js +0 -8
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/transitional.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/env/data.js +0 -4
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/env/data.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -57
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/AxiosURLSearchParams.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -72
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/HttpStatusCode.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/bind.js +0 -8
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/bind.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/buildURL.js +0 -70
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/buildURL.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/combineURLs.js +0 -16
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/combineURLs.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/composeSignals.js +0 -49
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/composeSignals.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/cookies.js +0 -44
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/cookies.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/formDataToJSON.js +0 -94
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/formDataToJSON.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -16
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAbsoluteURL.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAxiosError.js +0 -15
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAxiosError.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -17
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isURLSameOrigin.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/null.js +0 -5
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/null.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseHeaders.js +0 -56
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseHeaders.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseProtocol.js +0 -7
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseProtocol.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/progressEventReducer.js +0 -47
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/progressEventReducer.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/resolveConfig.js +0 -59
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/resolveConfig.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/speedometer.js +0 -54
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/speedometer.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/spread.js +0 -29
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/spread.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/throttle.js +0 -45
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/throttle.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toFormData.js +0 -216
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toFormData.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toURLEncodedForm.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/trackStream.js +0 -89
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/trackStream.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/validator.js +0 -100
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/validator.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -4
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/Blob.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -4
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/FormData.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -6
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/index.js +0 -16
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/common/utils.js +0 -46
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/common/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/index.js +0 -10
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/utils.js +0 -761
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/utils.js.map +0 -1
- package/dist/utils/settings.js +0 -7
- package/dist/utils/settings.js.map +0 -1
- /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.2_rollup@4.29.1_tslib@2.8.1_typescript@5.7.2 → @rollup_plugin-typescript@12.1.2_rollup@4.34.6_tslib@2.8.1_typescript@5.7.3}/node_modules/tslib/tslib.es6.js +0 -0
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.
|
|
1
|
+
import { __decorate } from '../../node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.34.8_tslib@2.8.1_typescript@5.7.3/node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import { css, html } from 'lit';
|
|
3
|
-
import { property,
|
|
3
|
+
import { property, query } from 'lit/decorators.js';
|
|
4
4
|
import { state } from 'lit/decorators/state.js';
|
|
5
5
|
import '@pushengineering/push-web-components/overlay';
|
|
6
6
|
import '@pushengineering/push-web-components/button';
|
|
7
7
|
import '@pushengineering/push-web-components/header-drawer';
|
|
8
|
-
import
|
|
8
|
+
import '@pushengineering/push-web-components/horizontal-stack';
|
|
9
9
|
import N3xusApi from '../../base/n3xus/N3xusAPI.js';
|
|
10
10
|
import CirkayElement from '../../internal/CirkayElement.js';
|
|
11
11
|
import { UnlockEvents } from '../../events/unlock.js';
|
|
12
|
-
import {
|
|
12
|
+
import { preloadLogos, getLatestSession, clearStoredSession, addSession } from '../../utils/helpers.js';
|
|
13
13
|
import { UnlockStateTypes, LoginState } from './types.js';
|
|
14
14
|
import { LoginController } from '../../controllers/LoginController.js';
|
|
15
|
-
import '../login/
|
|
16
|
-
import '../frame/
|
|
17
|
-
import '../error-screen/
|
|
15
|
+
import '../login/index.js';
|
|
16
|
+
import '../frame/index.js';
|
|
17
|
+
import '../error-screen/index.js';
|
|
18
|
+
import '../connected/index.js';
|
|
19
|
+
import { LoginStateTypes } from '../login/types.js';
|
|
18
20
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
21
|
+
import { LoginEvents } from '../../events/login.js';
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
class FanPassUnlock extends CirkayElement {
|
|
21
24
|
constructor() {
|
|
22
25
|
super();
|
|
23
26
|
this.loginController = null;
|
|
27
|
+
this.interval = null;
|
|
28
|
+
this.walletCheckResponse = undefined;
|
|
29
|
+
this.unlockedContent = false;
|
|
30
|
+
this.nexusAPI = undefined;
|
|
24
31
|
this._unlockState = UnlockStateTypes.locked;
|
|
25
|
-
this.as = 'page';
|
|
26
32
|
this.apiKey = '';
|
|
27
33
|
this.inline = false;
|
|
28
|
-
this.fanPassTitle = '
|
|
34
|
+
this.fanPassTitle = 'Clash Pass';
|
|
35
|
+
this.buttonLabel = 'Unlock';
|
|
29
36
|
this.logoSet = {
|
|
30
37
|
large: {
|
|
31
38
|
src: 'https://n3xus-store.s3.eu-west-2.amazonaws.com/staging/assets/cirkay-logo-transparent-no-padding.webp',
|
|
@@ -41,46 +48,122 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
41
48
|
this.loading = false;
|
|
42
49
|
this.validLoadingState = true;
|
|
43
50
|
this.unlocked = false;
|
|
44
|
-
this.staging =
|
|
51
|
+
this.staging = false;
|
|
45
52
|
this.debugLogging = false;
|
|
46
53
|
this.error = null;
|
|
47
|
-
this.
|
|
54
|
+
this.cta = false;
|
|
55
|
+
this.ctaText = 'Connect to unlock';
|
|
56
|
+
this.unlockDescription = '';
|
|
57
|
+
this.ctaBackgroundColor = '#000000';
|
|
58
|
+
this.ctaTextColor = '#FFFFFF';
|
|
48
59
|
this.btnBackgroundColor = '#D60455';
|
|
49
60
|
this.btnTextColor = '#FFFFFF';
|
|
50
61
|
this.faqUrl = 'https://cirkay.com/faq/';
|
|
51
62
|
this._pageNumber = 1;
|
|
52
|
-
this._nexusAPI = undefined;
|
|
53
63
|
this._user = undefined;
|
|
54
64
|
this._loggingState = LoginState.initialising;
|
|
55
|
-
const
|
|
56
|
-
|
|
65
|
+
const imgApple = new Image();
|
|
66
|
+
imgApple.src = 'https://cdn.n3xus.services/production/assets/images/US-UK_Add_to_Apple_Wallet_RGB_101421.svg';
|
|
67
|
+
const imgGoogle = new Image();
|
|
68
|
+
imgGoogle.src = 'https://cdn.n3xus.services/production/assets/images/enGB_add_to_google_wallet_wallet-button.svg';
|
|
69
|
+
const imgCirkay = new Image();
|
|
70
|
+
imgCirkay.src = 'https://n3xus-store.s3.eu-west-2.amazonaws.com/staging/assets/cirkay-logo-transparent-no-padding.webp';
|
|
57
71
|
}
|
|
58
72
|
connectedCallback() {
|
|
73
|
+
try {
|
|
74
|
+
preloadLogos(this.logoSet);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.warn('Error loading logo images', error);
|
|
78
|
+
}
|
|
79
|
+
this.loading = true;
|
|
59
80
|
super.connectedCallback();
|
|
81
|
+
const magicApiOptions = {
|
|
82
|
+
staging: this.staging,
|
|
83
|
+
};
|
|
60
84
|
const n3xusOptions = {
|
|
61
85
|
apiKey: this.apiKey,
|
|
62
86
|
stagging: this.staging,
|
|
63
87
|
};
|
|
64
|
-
this.
|
|
65
|
-
if (!this.logoSet.alt) {
|
|
66
|
-
this.logoSet.alt = this.fanPassTitle;
|
|
67
|
-
}
|
|
68
|
-
const magicApiOptions = {
|
|
69
|
-
staging: this.staging,
|
|
70
|
-
};
|
|
88
|
+
this.nexusAPI = new N3xusApi(n3xusOptions);
|
|
71
89
|
this.loginController = LoginController.getInstance(magicApiOptions, this.debugLogging);
|
|
72
90
|
this.loginController.addHost(this);
|
|
91
|
+
const session = getLatestSession(this.apiKey);
|
|
92
|
+
const minutesAgo = Date.now() - 3.5 * 60 * 1000;
|
|
93
|
+
if (session && !(session.issueTS < minutesAgo)) {
|
|
94
|
+
this.unlock(session.didToken, session.token, session);
|
|
95
|
+
}
|
|
96
|
+
if (!this.logoSet.alt) {
|
|
97
|
+
this.logoSet.alt = `${this.fanPassTitle} logo`;
|
|
98
|
+
}
|
|
99
|
+
this.loading = false;
|
|
73
100
|
}
|
|
74
101
|
async handleLogout() {
|
|
75
|
-
await this.loginController?.logout();
|
|
76
102
|
this._unlockState = UnlockStateTypes.locked;
|
|
103
|
+
this.emit(LoginEvents.Logout, {
|
|
104
|
+
bubbles: true,
|
|
105
|
+
composed: true,
|
|
106
|
+
detail: {
|
|
107
|
+
LoggedIn: false,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
await this.loginController?.logout();
|
|
77
111
|
}
|
|
78
|
-
async
|
|
79
|
-
|
|
112
|
+
async willUpdate(changedProperties) {
|
|
113
|
+
if (changedProperties.has('apiKey')) {
|
|
114
|
+
const n3xusOptions = {
|
|
115
|
+
apiKey: this.apiKey,
|
|
116
|
+
stagging: this.staging,
|
|
117
|
+
};
|
|
118
|
+
this.nexusAPI = new N3xusApi(n3xusOptions);
|
|
119
|
+
}
|
|
120
|
+
if ((UnlockStateTypes.unlocked === this._unlockState
|
|
121
|
+
|| UnlockStateTypes.lockedLoggingIn === this._unlockState)
|
|
122
|
+
&& this.loginController?.loginInit
|
|
123
|
+
&& !this.loginController?.loggedIn) {
|
|
124
|
+
this.walletCheckResponse = undefined;
|
|
125
|
+
this.stopPolling();
|
|
126
|
+
this._unlockState = UnlockStateTypes.locked;
|
|
127
|
+
}
|
|
128
|
+
if ((UnlockStateTypes.unlocked === this._unlockState &&
|
|
129
|
+
this.loginController?.loginInit &&
|
|
130
|
+
!this.loginController?.loggedIn) ||
|
|
131
|
+
(UnlockStateTypes.lockedLoggingIn === this._unlockState &&
|
|
132
|
+
this.loginController?.loggedIn &&
|
|
133
|
+
this.loginController?.loginInit) || (UnlockStateTypes.lockedLoggingIn === this._unlockState &&
|
|
134
|
+
this.loginController?.loginInit &&
|
|
135
|
+
!this.loginController?.loggedIn)) {
|
|
136
|
+
this.unlockedContent = false;
|
|
137
|
+
this.stopPolling();
|
|
138
|
+
this.emit(LoginEvents.Logout, {
|
|
139
|
+
bubbles: true,
|
|
140
|
+
composed: true,
|
|
141
|
+
detail: {
|
|
142
|
+
isLoggedin: false,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
}
|
|
80
146
|
if (this.loginController?.loggedIn &&
|
|
81
147
|
this._unlockState === UnlockStateTypes.locked) {
|
|
82
148
|
await this.handleUnlock();
|
|
83
149
|
}
|
|
150
|
+
else if (!this.interval && this.loginController?.loggedIn) {
|
|
151
|
+
this.startPolling();
|
|
152
|
+
this.checkSessionStatus();
|
|
153
|
+
}
|
|
154
|
+
if (this.loginController?.loginInit &&
|
|
155
|
+
!this.loginController?.loggedIn) {
|
|
156
|
+
this.unlockedContent = false;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
ctaStyles() {
|
|
160
|
+
let styles = {};
|
|
161
|
+
styles = {
|
|
162
|
+
...styles,
|
|
163
|
+
'--cta-color-background': this.ctaBackgroundColor,
|
|
164
|
+
'--cta-color-text': this.ctaTextColor,
|
|
165
|
+
};
|
|
166
|
+
return styles;
|
|
84
167
|
}
|
|
85
168
|
async handleUnlock() {
|
|
86
169
|
this.emit(UnlockEvents.Started, { bubbles: true, composed: true });
|
|
@@ -88,39 +171,145 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
88
171
|
if (!didToken) {
|
|
89
172
|
didToken = await this.loginController?.getDidToken();
|
|
90
173
|
}
|
|
91
|
-
if (!didToken || !this.
|
|
174
|
+
if (!didToken || !this.nexusAPI) {
|
|
92
175
|
console.error('No did token or api');
|
|
93
176
|
return;
|
|
94
177
|
}
|
|
95
|
-
this._unlockState
|
|
96
|
-
|
|
97
|
-
const data = walletCheckResponse.data;
|
|
98
|
-
if (!data) {
|
|
99
|
-
console.error('No data in wallet check response');
|
|
100
|
-
return;
|
|
178
|
+
if (this._unlockState !== UnlockStateTypes.unlocked) {
|
|
179
|
+
this._unlockState = UnlockStateTypes.unlocking;
|
|
101
180
|
}
|
|
102
|
-
if (
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
181
|
+
if (this.error == null) {
|
|
182
|
+
await this.unlock(didToken);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async checkSessionStatus() {
|
|
186
|
+
const session = getLatestSession(this.apiKey);
|
|
187
|
+
const minutesAgo = Date.now() - 3.5 * 60 * 1000;
|
|
188
|
+
if (session && session.issueTS > minutesAgo) {
|
|
189
|
+
const did = await this.loginController?.getDidToken();
|
|
190
|
+
if (did && this.loginController?.loggedIn) {
|
|
191
|
+
this.unlock(did);
|
|
109
192
|
}
|
|
110
|
-
this.emit(UnlockEvents.Unlocked, {
|
|
111
|
-
bubbles: true,
|
|
112
|
-
composed: true,
|
|
113
|
-
detail: {
|
|
114
|
-
sessionToken: data.sessionToken,
|
|
115
|
-
email: this.loginController?.user?.email,
|
|
116
|
-
apiKey: this.apiKey,
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
193
|
}
|
|
120
194
|
else {
|
|
121
|
-
|
|
195
|
+
clearStoredSession();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
startPolling() {
|
|
199
|
+
if (!this.interval) {
|
|
200
|
+
this.interval = setInterval(() => this.checkSessionStatus(), 30000);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
stopPolling() {
|
|
204
|
+
if (this.interval) {
|
|
205
|
+
clearInterval(this.interval);
|
|
206
|
+
this.interval = null;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
async unlock(didToken, sessionToken = null, session = null) {
|
|
210
|
+
if (!sessionToken) {
|
|
211
|
+
try {
|
|
212
|
+
this.walletCheckResponse =
|
|
213
|
+
await this.nexusAPI?.checkWalletForNft(this.unlockDescription, didToken);
|
|
214
|
+
if (this.walletCheckResponse) {
|
|
215
|
+
const data = this.walletCheckResponse.data;
|
|
216
|
+
if (!data) {
|
|
217
|
+
console.error('No data in wallet check response');
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (data.holds == true && data.expired == false) {
|
|
221
|
+
this._unlockState = UnlockStateTypes.unlocked;
|
|
222
|
+
addSession({
|
|
223
|
+
token: data.sessionToken,
|
|
224
|
+
issueTS: Date.now(),
|
|
225
|
+
didToken: didToken,
|
|
226
|
+
apiKey: this.apiKey,
|
|
227
|
+
mobilePass: this.walletCheckResponse?.data?.mobilePasses,
|
|
228
|
+
});
|
|
229
|
+
if (this.unlockedContent === false) {
|
|
230
|
+
this.unlockedContent = true;
|
|
231
|
+
this.emit(UnlockEvents.UnlockComplete, {
|
|
232
|
+
bubbles: true,
|
|
233
|
+
composed: true,
|
|
234
|
+
detail: {
|
|
235
|
+
sessionToken: data.sessionToken,
|
|
236
|
+
email: this.loginController?.user?.email,
|
|
237
|
+
apiKey: this.apiKey,
|
|
238
|
+
unlocked: true,
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
this.emit(UnlockEvents.MobilePassData, {
|
|
243
|
+
bubbles: true,
|
|
244
|
+
composed: true,
|
|
245
|
+
detail: {
|
|
246
|
+
sessionToken: sessionToken,
|
|
247
|
+
email: this.loginController?.user?.email,
|
|
248
|
+
apiKey: this.apiKey,
|
|
249
|
+
unlocked: true,
|
|
250
|
+
mobilePass: this.walletCheckResponse.data?.mobilePasses,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
this._unlockState = UnlockStateTypes.lockedLoggingIn;
|
|
256
|
+
if (this.unlockedContent === false) {
|
|
257
|
+
this.unlockedContent = true;
|
|
258
|
+
this.emit(UnlockEvents.UnlockComplete, {
|
|
259
|
+
bubbles: true,
|
|
260
|
+
composed: true,
|
|
261
|
+
detail: {
|
|
262
|
+
unlocked: false,
|
|
263
|
+
email: this.loginController?.user?.email,
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
this.loading = false;
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
if (err instanceof Error) {
|
|
273
|
+
this._unlockState = UnlockStateTypes.locked;
|
|
274
|
+
this.error = err.message;
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
this.error = 'An unknown error occurred';
|
|
278
|
+
}
|
|
279
|
+
this._unlockState = UnlockStateTypes.locked;
|
|
280
|
+
await this.handleLogout();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
this._unlockState = UnlockStateTypes.unlocked;
|
|
285
|
+
if (this.unlockedContent === false) {
|
|
286
|
+
this.unlockedContent = true;
|
|
287
|
+
this.emit(UnlockEvents.UnlockComplete, {
|
|
288
|
+
bubbles: true,
|
|
289
|
+
composed: true,
|
|
290
|
+
detail: {
|
|
291
|
+
sessionToken: sessionToken,
|
|
292
|
+
email: this.loginController?.user?.email,
|
|
293
|
+
apiKey: this.apiKey,
|
|
294
|
+
unlocked: true,
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
if (session) {
|
|
298
|
+
this.emit(UnlockEvents.MobilePassData, {
|
|
299
|
+
bubbles: true,
|
|
300
|
+
composed: true,
|
|
301
|
+
detail: {
|
|
302
|
+
sessionToken: sessionToken,
|
|
303
|
+
email: this.loginController?.user?.email,
|
|
304
|
+
apiKey: this.apiKey,
|
|
305
|
+
unlocked: true,
|
|
306
|
+
mobilePass: session?.mobilePass ? session?.mobilePass : undefined,
|
|
307
|
+
},
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
this.loading = false;
|
|
122
312
|
}
|
|
123
|
-
this.loading = false;
|
|
124
313
|
}
|
|
125
314
|
closeOverlay(e) {
|
|
126
315
|
const overlay = this.shadowRoot?.getElementById('fb-modal');
|
|
@@ -143,10 +332,35 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
143
332
|
};
|
|
144
333
|
return styles;
|
|
145
334
|
}
|
|
335
|
+
setPageNumber(number) {
|
|
336
|
+
if (number !== undefined) {
|
|
337
|
+
this._pageNumber = number;
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const loginState = this._loginComponent?.getCurrentState();
|
|
341
|
+
switch (loginState) {
|
|
342
|
+
case LoginStateTypes.initialising:
|
|
343
|
+
case LoginStateTypes.initialised:
|
|
344
|
+
this._pageNumber = 1;
|
|
345
|
+
break;
|
|
346
|
+
case LoginStateTypes.requestCode:
|
|
347
|
+
case LoginStateTypes.enterLoginCode:
|
|
348
|
+
case LoginStateTypes.optCodeSubmited:
|
|
349
|
+
case LoginStateTypes.isLoggedInLoading:
|
|
350
|
+
this._pageNumber = 2;
|
|
351
|
+
break;
|
|
352
|
+
case LoginStateTypes.optFailed:
|
|
353
|
+
case LoginStateTypes.isLoggedIn:
|
|
354
|
+
this._pageNumber = 3;
|
|
355
|
+
break;
|
|
356
|
+
default:
|
|
357
|
+
this._pageNumber = 1;
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
146
361
|
renderContent() {
|
|
147
362
|
switch (this._unlockState) {
|
|
148
363
|
case UnlockStateTypes.locked:
|
|
149
|
-
this._pageNumber = 1;
|
|
150
364
|
return html `
|
|
151
365
|
${this.error
|
|
152
366
|
? html `
|
|
@@ -157,7 +371,7 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
157
371
|
type="button"
|
|
158
372
|
class="button"
|
|
159
373
|
name="disconnect"
|
|
160
|
-
size="
|
|
374
|
+
size="medium"
|
|
161
375
|
buttonstyle="solid"
|
|
162
376
|
>
|
|
163
377
|
<pu-text
|
|
@@ -176,6 +390,7 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
176
390
|
<fp-login
|
|
177
391
|
id="login"
|
|
178
392
|
buttonLabel="Submit"
|
|
393
|
+
logoSet=${JSON.stringify(this.logoSet)}
|
|
179
394
|
apiKey=${this.apiKey}
|
|
180
395
|
btnBackgroundColor=${this.btnBackgroundColor}
|
|
181
396
|
btnTextColor=${this.btnTextColor}
|
|
@@ -187,10 +402,10 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
187
402
|
`}
|
|
188
403
|
`;
|
|
189
404
|
case UnlockStateTypes.unlocking:
|
|
190
|
-
this.
|
|
405
|
+
this.setPageNumber(2);
|
|
191
406
|
return html `
|
|
192
407
|
<pu-text as="p" variant="bodyLg" withoutMargin>
|
|
193
|
-
|
|
408
|
+
Connecting...
|
|
194
409
|
</pu-text>
|
|
195
410
|
<svg
|
|
196
411
|
class="loading__spinner"
|
|
@@ -208,7 +423,7 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
208
423
|
</svg>
|
|
209
424
|
`;
|
|
210
425
|
case UnlockStateTypes.unlocked:
|
|
211
|
-
this.
|
|
426
|
+
this.setPageNumber(3);
|
|
212
427
|
return html `
|
|
213
428
|
<pu-text as="p" variant="bodyLg" withoutMargin>
|
|
214
429
|
You are connected!
|
|
@@ -222,7 +437,7 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
222
437
|
class="button"
|
|
223
438
|
style="${styleMap(this.buttonStyles())}"
|
|
224
439
|
name="disconnect"
|
|
225
|
-
size="
|
|
440
|
+
size="medium"
|
|
226
441
|
buttonstyle="solid"
|
|
227
442
|
>
|
|
228
443
|
<pu-text
|
|
@@ -237,8 +452,100 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
237
452
|
</pu-button>
|
|
238
453
|
`;
|
|
239
454
|
case UnlockStateTypes.lockedLoggingIn:
|
|
240
|
-
this.
|
|
455
|
+
this.setPageNumber(3);
|
|
456
|
+
return html `
|
|
457
|
+
<fp-error-screen
|
|
458
|
+
errorText="You don't seem to have a valid ${this
|
|
459
|
+
.fanPassTitle}"
|
|
460
|
+
>
|
|
461
|
+
<pu-button
|
|
462
|
+
slot="button"
|
|
463
|
+
style="${styleMap(this.buttonStyles())}"
|
|
464
|
+
@click=${this.handleLogout}
|
|
465
|
+
type="button"
|
|
466
|
+
class="button"
|
|
467
|
+
name="disconnect"
|
|
468
|
+
size="medium"
|
|
469
|
+
buttonstyle="solid"
|
|
470
|
+
>
|
|
471
|
+
<pu-text
|
|
472
|
+
as="span"
|
|
473
|
+
variant="bodyMd"
|
|
474
|
+
fontWeight="regular"
|
|
475
|
+
withoutMargin
|
|
476
|
+
spacing="loose"
|
|
477
|
+
>
|
|
478
|
+
Start over
|
|
479
|
+
</pu-text>
|
|
480
|
+
</pu-button>
|
|
481
|
+
</fp-error-screen>
|
|
482
|
+
`;
|
|
483
|
+
default:
|
|
484
|
+
this.setPageNumber(3);
|
|
241
485
|
return html `
|
|
486
|
+
<fp-error-screen errorText="Something went wrong">
|
|
487
|
+
<pu-button
|
|
488
|
+
slot="button"
|
|
489
|
+
style="${styleMap(this.buttonStyles())}"
|
|
490
|
+
@click=${this.handleLogout}
|
|
491
|
+
type="button"
|
|
492
|
+
class="button"
|
|
493
|
+
name="disconnect"
|
|
494
|
+
size="medium"
|
|
495
|
+
buttonstyle="solid"
|
|
496
|
+
>
|
|
497
|
+
<pu-text
|
|
498
|
+
as="span"
|
|
499
|
+
variant="bodyMd"
|
|
500
|
+
fontWeight="regular"
|
|
501
|
+
withoutMargin
|
|
502
|
+
spacing="loose"
|
|
503
|
+
>
|
|
504
|
+
Start over
|
|
505
|
+
</pu-text>
|
|
506
|
+
</pu-button>
|
|
507
|
+
</fp-error-screen>
|
|
508
|
+
`;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
connectedRender(content = '') {
|
|
512
|
+
return html `
|
|
513
|
+
<fp-connected
|
|
514
|
+
fanPassTitle=${this.fanPassTitle}
|
|
515
|
+
?showMobilePassButtons=${false}
|
|
516
|
+
displayText=${this._unlockState === UnlockStateTypes.unlocked ? "You're connected!" : `You don't have a valid ${this.fanPassTitle}`}
|
|
517
|
+
apiKey=${this.apiKey}
|
|
518
|
+
?stagging=${this.staging}
|
|
519
|
+
?debugLogging=${this.debugLogging}
|
|
520
|
+
?ownsFp=${this._unlockState === UnlockStateTypes.unlocked ? true : false}
|
|
521
|
+
>
|
|
522
|
+
<div slot="form-content">
|
|
523
|
+
<form>
|
|
524
|
+
<label>
|
|
525
|
+
<input type="checkbox" name="emailSignup" value="true">
|
|
526
|
+
Sign up for email updates
|
|
527
|
+
</label>
|
|
528
|
+
</form>
|
|
529
|
+
</div>
|
|
530
|
+
<slot>${content}</slot>
|
|
531
|
+
</fp-connected>
|
|
532
|
+
`;
|
|
533
|
+
}
|
|
534
|
+
renderConnectButton() {
|
|
535
|
+
if (this._unlockState === UnlockStateTypes.unlocked) {
|
|
536
|
+
return html ``;
|
|
537
|
+
}
|
|
538
|
+
return html `<pu-button
|
|
539
|
+
class="button"
|
|
540
|
+
style="${styleMap(this.buttonStyles())}"
|
|
541
|
+
@click=${this.openOverlay}
|
|
542
|
+
type="button"
|
|
543
|
+
name="unlock"
|
|
544
|
+
size="medium"
|
|
545
|
+
?disabled=${this.loading || (this.loginController?.loginInit === false) || (!this.walletCheckResponse && this.loginController?.loggedIn)}
|
|
546
|
+
?loading=${(this.loginController?.loginInit === false || (!this.walletCheckResponse && this.loginController?.loggedIn))}
|
|
547
|
+
buttonstyle="solid"
|
|
548
|
+
>
|
|
242
549
|
<pu-text
|
|
243
550
|
as="span"
|
|
244
551
|
variant="bodyMd"
|
|
@@ -246,154 +553,125 @@ let FanPassUnlock = class FanPassUnlock extends CirkayElement {
|
|
|
246
553
|
withoutMargin
|
|
247
554
|
spacing="loose"
|
|
248
555
|
>
|
|
249
|
-
|
|
556
|
+
${this.buttonLabel}
|
|
250
557
|
</pu-text>
|
|
251
|
-
|
|
252
|
-
class="button"
|
|
253
|
-
style="${styleMap(this.buttonStyles())}"
|
|
254
|
-
@click=${this.handleLogout}
|
|
255
|
-
type="button"
|
|
256
|
-
name="claim"
|
|
257
|
-
size="large"
|
|
258
|
-
buttonstyle="solid"
|
|
259
|
-
>
|
|
260
|
-
<pu-text
|
|
261
|
-
as="span"
|
|
262
|
-
variant="bodyMd"
|
|
263
|
-
fontWeight="regular"
|
|
264
|
-
withoutMargin
|
|
265
|
-
spacing="loose"
|
|
266
|
-
>
|
|
267
|
-
Start over
|
|
268
|
-
</pu-text>
|
|
269
|
-
</pu-button>
|
|
270
|
-
`;
|
|
271
|
-
default:
|
|
272
|
-
this._pageNumber = 3;
|
|
273
|
-
return html ` <fp-error-screen
|
|
274
|
-
slot="errorScreen"
|
|
275
|
-
errorText="Something went wrong"
|
|
276
|
-
>
|
|
277
|
-
<pu-button
|
|
278
|
-
slot="button"
|
|
279
|
-
style="${styleMap(this.buttonStyles())}"
|
|
280
|
-
@click=${this.handleLogout}
|
|
281
|
-
type="button"
|
|
282
|
-
class="button"
|
|
283
|
-
name="disconnect"
|
|
284
|
-
size="large"
|
|
285
|
-
buttonstyle="solid"
|
|
286
|
-
>
|
|
287
|
-
<pu-text
|
|
288
|
-
as="span"
|
|
289
|
-
variant="bodyMd"
|
|
290
|
-
fontWeight="regular"
|
|
291
|
-
withoutMargin
|
|
292
|
-
spacing="loose"
|
|
293
|
-
>
|
|
294
|
-
Start over
|
|
295
|
-
</pu-text>
|
|
296
|
-
</pu-button>
|
|
297
|
-
</fp-error-screen>`;
|
|
298
|
-
}
|
|
558
|
+
</pu-button>`;
|
|
299
559
|
}
|
|
300
560
|
render() {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
fontWeight="regular"
|
|
307
|
-
withoutMargin
|
|
308
|
-
spacing="loose"
|
|
309
|
-
>
|
|
310
|
-
Content unlocked
|
|
311
|
-
</pu-text>
|
|
312
|
-
<pu-button
|
|
313
|
-
slot="button"
|
|
314
|
-
@click=${this.handleLogout}
|
|
315
|
-
type="button"
|
|
316
|
-
class="button"
|
|
317
|
-
name="disconnect"
|
|
318
|
-
size="large"
|
|
319
|
-
buttonstyle="solid"
|
|
320
|
-
>
|
|
321
|
-
<pu-text
|
|
322
|
-
as="span"
|
|
323
|
-
variant="bodyMd"
|
|
324
|
-
fontWeight="regular"
|
|
325
|
-
withoutMargin
|
|
326
|
-
spacing="loose"
|
|
327
|
-
>
|
|
328
|
-
Disconnect
|
|
329
|
-
</pu-text>
|
|
330
|
-
</pu-button>
|
|
331
|
-
|
|
332
|
-
`;
|
|
561
|
+
this.setPageNumber();
|
|
562
|
+
if ((this._unlockState === UnlockStateTypes.unlocked)
|
|
563
|
+
||
|
|
564
|
+
this.walletCheckResponse) {
|
|
565
|
+
return this.connectedRender();
|
|
333
566
|
}
|
|
334
567
|
if (this.inline) {
|
|
335
568
|
return html `
|
|
336
|
-
<fp-frame
|
|
337
|
-
fanPassTitle=${this.fanPassTitle}
|
|
338
|
-
maxPages=${3}
|
|
339
|
-
currentPageNumber=${this._pageNumber}
|
|
340
|
-
.logoSet=${this.logoSet}
|
|
341
|
-
>
|
|
342
|
-
${this.renderContent()}
|
|
343
|
-
</fp-frame>
|
|
344
|
-
`;
|
|
345
|
-
}
|
|
346
|
-
return html `
|
|
347
|
-
<pu-button
|
|
348
|
-
class="button"
|
|
349
|
-
style="${styleMap(this.buttonStyles())}"
|
|
350
|
-
@click=${this.openOverlay}
|
|
351
|
-
type="button"
|
|
352
|
-
name="unlock"
|
|
353
|
-
size="large"
|
|
354
|
-
buttonstyle="solid"
|
|
355
|
-
>
|
|
356
|
-
<pu-text
|
|
357
|
-
as="span"
|
|
358
|
-
variant="bodyMd"
|
|
359
|
-
fontWeight="regular"
|
|
360
|
-
withoutMargin
|
|
361
|
-
spacing="loose"
|
|
362
|
-
>
|
|
363
|
-
Unlock
|
|
364
|
-
</pu-text>
|
|
365
|
-
</pu-button>
|
|
366
|
-
<pu-overlay id="fb-modal">
|
|
367
|
-
<pu-box slot="content" class="modalContentBox" padding=${100}>
|
|
368
569
|
<fp-frame
|
|
369
570
|
fanPassTitle=${this.fanPassTitle}
|
|
370
|
-
maxPages=${
|
|
571
|
+
maxPages=${3}
|
|
572
|
+
currentPageNumber=${this._pageNumber}
|
|
371
573
|
.logoSet=${this.logoSet}
|
|
372
574
|
>
|
|
575
|
+
<pu-text as="p" variant="bodyLg" withoutMargin>
|
|
576
|
+
${this.fanPassTitle}
|
|
577
|
+
</pu-text>
|
|
373
578
|
${this.renderContent()}
|
|
374
579
|
</fp-frame>
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
580
|
+
`;
|
|
581
|
+
}
|
|
582
|
+
return html `
|
|
583
|
+
${this.cta ? html `
|
|
584
|
+
<pu-horizontal-stack
|
|
585
|
+
spacing="24"
|
|
586
|
+
align="center"
|
|
587
|
+
mobileAlign="center"
|
|
588
|
+
justify="center"
|
|
589
|
+
mobileJustify="center"
|
|
590
|
+
class="cta"
|
|
591
|
+
style="${styleMap(this.ctaStyles())}"
|
|
592
|
+
>
|
|
593
|
+
|
|
594
|
+
<pu-text
|
|
595
|
+
as="span"
|
|
596
|
+
variant="bodyMd"
|
|
597
|
+
fontWeight="regular"
|
|
598
|
+
withoutMargin
|
|
599
|
+
spacing="loose"
|
|
600
|
+
|
|
383
601
|
>
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
602
|
+
${this.ctaText}
|
|
603
|
+
</pu-text>
|
|
604
|
+
${this.renderConnectButton()}
|
|
605
|
+
</pu-horizontal-stack>
|
|
606
|
+
` : this.renderConnectButton()}
|
|
607
|
+
|
|
608
|
+
<pu-overlay id="fb-modal" class="fb-modal">
|
|
609
|
+
<pu-box slot="content" class="modalContentBox" padding=${100} mobilePadding='60, 0'>
|
|
610
|
+
<fp-frame
|
|
611
|
+
fanPassTitle=${this.fanPassTitle}
|
|
612
|
+
maxPages=${3}
|
|
613
|
+
currentPageNumber=${this._pageNumber}
|
|
614
|
+
.logoSet=${this.logoSet}
|
|
615
|
+
>
|
|
616
|
+
<pu-text as="p" variant="bodyLg" withoutMargin>
|
|
617
|
+
${this.fanPassTitle}
|
|
618
|
+
</pu-text>
|
|
619
|
+
${this.renderContent()}
|
|
620
|
+
</fp-frame>
|
|
621
|
+
<button
|
|
622
|
+
part="button-icon"
|
|
623
|
+
class="button-icon"
|
|
624
|
+
style="position: absolute; top: 1rem; right: 1rem; z-index: 501"
|
|
625
|
+
type="button"
|
|
626
|
+
aria-label="Close modal"
|
|
627
|
+
aria-controls="overlay"
|
|
628
|
+
@click=${this.closeOverlay}
|
|
629
|
+
>
|
|
630
|
+
<svg
|
|
631
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
632
|
+
id="close"
|
|
633
|
+
class="icon"
|
|
634
|
+
width="1em"
|
|
635
|
+
height="1em"
|
|
636
|
+
viewBox="0 0 384 512"
|
|
637
|
+
role="presentation"
|
|
638
|
+
aria-hidden="true"
|
|
639
|
+
focusable="false"
|
|
640
|
+
fill="currentColor"
|
|
641
|
+
>
|
|
642
|
+
<path
|
|
643
|
+
d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"
|
|
644
|
+
/>
|
|
645
|
+
</svg>
|
|
646
|
+
</button>
|
|
647
|
+
</pu-box>
|
|
648
|
+
</pu-overlay>
|
|
387
649
|
`;
|
|
388
650
|
}
|
|
389
|
-
}
|
|
651
|
+
}
|
|
390
652
|
FanPassUnlock.styles = css `
|
|
391
|
-
|
|
653
|
+
.cta {
|
|
654
|
+
background-color: var(--cta-color-background, #000000);
|
|
655
|
+
color: var(--cta-color-text, #ffffff);
|
|
656
|
+
border-radius: 1.5rem;
|
|
657
|
+
padding: 1.5rem 1.5rem 1.5rem 1.5rem;
|
|
658
|
+
}
|
|
659
|
+
.fb-modal {
|
|
660
|
+
--pu-color-overlay-background: rgba(0, 0, 0, 0.2);
|
|
661
|
+
position: fixed;
|
|
662
|
+
z-index: 999999;
|
|
663
|
+
width: 100%;
|
|
664
|
+
height: 100%;
|
|
665
|
+
top: 0;
|
|
666
|
+
left: 0;
|
|
667
|
+
right: 0;
|
|
668
|
+
pointer-events: none;
|
|
669
|
+
bottom: 0;
|
|
670
|
+
}
|
|
392
671
|
.modalContentBox {
|
|
393
672
|
background-color: #fff;
|
|
394
673
|
position: relative;
|
|
395
|
-
height:
|
|
396
|
-
/* max-height: 800px; */
|
|
674
|
+
height: 100vh;
|
|
397
675
|
|
|
398
676
|
@media only screen and (min-width: 48.06rem) {
|
|
399
677
|
--pu-border-base-corner-radius: var(
|
|
@@ -403,20 +681,74 @@ FanPassUnlock.styles = css `
|
|
|
403
681
|
border-radius: var(--pu-border-base-corner-radius);
|
|
404
682
|
box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.25);
|
|
405
683
|
max-width: 800px;
|
|
684
|
+
height: max-content;
|
|
685
|
+
|
|
406
686
|
}
|
|
407
687
|
}
|
|
408
688
|
|
|
689
|
+
|
|
690
|
+
/* buttons */
|
|
409
691
|
.button::part(button) {
|
|
410
692
|
--pu-border-button-corner-radius: var(--pu-border-radius-20, 12px);
|
|
411
693
|
}
|
|
412
694
|
|
|
695
|
+
.disconnectButton {
|
|
696
|
+
--pu-size-button-height: 1rem;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.button-icon {
|
|
700
|
+
position: absolute;
|
|
701
|
+
top: 1rem;
|
|
702
|
+
right: 1rem;
|
|
703
|
+
z-index: 501;
|
|
704
|
+
cursor: pointer;
|
|
705
|
+
border: none;
|
|
706
|
+
border-radius: var(
|
|
707
|
+
--pu-border-icon-corner-radius,
|
|
708
|
+
var(--pu-border-base-corner-radius, 0)
|
|
709
|
+
);
|
|
710
|
+
font-size: var(--pu-font-size-icon, 1.5rem);
|
|
711
|
+
padding: 0;
|
|
712
|
+
color: var(--pu-color-icon-text, inherit);
|
|
713
|
+
background-color: var(--pu-color-icon-background, inherit);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
@supports (color: rgb(from white r g b)) {
|
|
717
|
+
.button-icon {
|
|
718
|
+
color: rgb(
|
|
719
|
+
from var(--pu-color-icon-text, inherit) r g b / alpha
|
|
720
|
+
);
|
|
721
|
+
background-color: rgb(
|
|
722
|
+
from var(--pu-color-icon-background, inherit) r g b / alpha
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.button-icon > * {
|
|
728
|
+
position: relative;
|
|
729
|
+
display: block;
|
|
730
|
+
padding: var(
|
|
731
|
+
--pu-space-icon-padding,
|
|
732
|
+
var(--pu-space-padding, 0.5rem)
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
.button-icon:hover {
|
|
737
|
+
opacity: 0.7;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.button-icon[disabled]:hover {
|
|
741
|
+
opacity: 0.7;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/* loading spinner animation */
|
|
413
745
|
.loading__spinner {
|
|
414
746
|
animation-name: spin;
|
|
415
747
|
animation-duration: 500ms;
|
|
416
748
|
animation-timing-function: cubic-bezier(0, 0, 1, 1);
|
|
417
749
|
animation-iteration-count: infinite;
|
|
418
750
|
fill: currentcolor;
|
|
419
|
-
color: var(--pu-color-base-text);
|
|
751
|
+
color: var(--pu-color-base-text, rgb(160, 160, 160));
|
|
420
752
|
height: 3rem;
|
|
421
753
|
width: 3rem;
|
|
422
754
|
left: 50%;
|
|
@@ -433,9 +765,6 @@ FanPassUnlock.styles = css `
|
|
|
433
765
|
__decorate([
|
|
434
766
|
state()
|
|
435
767
|
], FanPassUnlock.prototype, "_unlockState", void 0);
|
|
436
|
-
__decorate([
|
|
437
|
-
property({ type: String })
|
|
438
|
-
], FanPassUnlock.prototype, "as", void 0);
|
|
439
768
|
__decorate([
|
|
440
769
|
property({ type: String })
|
|
441
770
|
], FanPassUnlock.prototype, "apiKey", void 0);
|
|
@@ -445,6 +774,9 @@ __decorate([
|
|
|
445
774
|
__decorate([
|
|
446
775
|
property({ type: String })
|
|
447
776
|
], FanPassUnlock.prototype, "fanPassTitle", void 0);
|
|
777
|
+
__decorate([
|
|
778
|
+
property({ type: String })
|
|
779
|
+
], FanPassUnlock.prototype, "buttonLabel", void 0);
|
|
448
780
|
__decorate([
|
|
449
781
|
property({ type: Object })
|
|
450
782
|
], FanPassUnlock.prototype, "logoSet", void 0);
|
|
@@ -468,7 +800,19 @@ __decorate([
|
|
|
468
800
|
], FanPassUnlock.prototype, "error", void 0);
|
|
469
801
|
__decorate([
|
|
470
802
|
property({ type: Boolean })
|
|
471
|
-
], FanPassUnlock.prototype, "
|
|
803
|
+
], FanPassUnlock.prototype, "cta", void 0);
|
|
804
|
+
__decorate([
|
|
805
|
+
property({ type: String })
|
|
806
|
+
], FanPassUnlock.prototype, "ctaText", void 0);
|
|
807
|
+
__decorate([
|
|
808
|
+
property({ type: String })
|
|
809
|
+
], FanPassUnlock.prototype, "unlockDescription", void 0);
|
|
810
|
+
__decorate([
|
|
811
|
+
property({ type: String })
|
|
812
|
+
], FanPassUnlock.prototype, "ctaBackgroundColor", void 0);
|
|
813
|
+
__decorate([
|
|
814
|
+
property({ type: String })
|
|
815
|
+
], FanPassUnlock.prototype, "ctaTextColor", void 0);
|
|
472
816
|
__decorate([
|
|
473
817
|
property({ type: String })
|
|
474
818
|
], FanPassUnlock.prototype, "btnBackgroundColor", void 0);
|
|
@@ -481,18 +825,15 @@ __decorate([
|
|
|
481
825
|
__decorate([
|
|
482
826
|
state()
|
|
483
827
|
], FanPassUnlock.prototype, "_pageNumber", void 0);
|
|
484
|
-
__decorate([
|
|
485
|
-
state()
|
|
486
|
-
], FanPassUnlock.prototype, "_nexusAPI", void 0);
|
|
487
828
|
__decorate([
|
|
488
829
|
state()
|
|
489
830
|
], FanPassUnlock.prototype, "_user", void 0);
|
|
490
831
|
__decorate([
|
|
491
832
|
state()
|
|
492
833
|
], FanPassUnlock.prototype, "_loggingState", void 0);
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
], FanPassUnlock);
|
|
834
|
+
__decorate([
|
|
835
|
+
query('fp-login')
|
|
836
|
+
], FanPassUnlock.prototype, "_loginComponent", void 0);
|
|
496
837
|
|
|
497
|
-
export { FanPassUnlock };
|
|
838
|
+
export { FanPassUnlock as default };
|
|
498
839
|
//# sourceMappingURL=fan-pass-unlock.js.map
|