4dc4cf635ebd3204be7eba4618cf106527e3daf03e370b5ca7291fec486bbca4.json raw

   1  {"ast":null,"code":"import _asyncToGenerator from \"/home/mleku/src/orly.dev/next/signer/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { inject } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { BrowserSyncFlow, StorageService } from '@common';\nimport * as i0 from \"@angular/core\";\nexport let WelcomeComponent = /*#__PURE__*/(() => {\n  class WelcomeComponent {\n    router = inject(Router);\n    #storage = inject(StorageService);\n    onClickSync(enabled) {\n      var _this = this;\n      return _asyncToGenerator(function* () {\n        const flow = enabled ? BrowserSyncFlow.BROWSER_SYNC : BrowserSyncFlow.NO_SYNC;\n        yield _this.#storage.enableBrowserSyncFlow(flow);\n        // In case the user has selected the BROWSER_SYNC flow,\n        // we have to check if there is sync data available (e.g. from\n        // another browser instance).\n        // If so, navigate to /vault-login, otherwise to /vault-create/home.\n        if (flow === BrowserSyncFlow.BROWSER_SYNC) {\n          const browserSyncData = yield _this.#storage.loadAndMigrateBrowserSyncData();\n          if (typeof browserSyncData !== 'undefined' && Object.keys(browserSyncData).length > 0) {\n            yield _this.router.navigateByUrl('/vault-login');\n            return;\n          }\n        }\n        yield _this.router.navigateByUrl('/vault-create/home');\n      })();\n    }\n    static ɵfac = function WelcomeComponent_Factory(__ngFactoryType__) {\n      return new (__ngFactoryType__ || WelcomeComponent)();\n    };\n    static ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n      type: WelcomeComponent,\n      selectors: [[\"app-welcome\"]],\n      decls: 37,\n      vars: 0,\n      consts: [[1, \"sam-text-header\", \"sam-mb-h\"], [1, \"sam-text-muted\", \"sam-text-md\", \"sam-text-align-center2\"], [1, \"sam-mt\", \"sam-text-lg\"], [\"type\", \"button\", 1, \"sam-mt\", \"btn\", \"btn-primary\", 3, \"click\"], [1, \"sam-text-muted\", \"sam-text-md\"], [\"type\", \"button\", 1, \"sam-mt\", \"sam-mb-2\", \"btn\", \"btn-secondary\", 3, \"click\"], [1, \"storage-info\"], [1, \"sam-flex-grow\"], [1, \"sam-text-muted\", \"sam-text-md\", \"sam-mb\"]],\n      template: function WelcomeComponent_Template(rf, ctx) {\n        if (rf & 1) {\n          i0.ɵɵelementStart(0, \"div\", 0)(1, \"span\");\n          i0.ɵɵtext(2, \"Smesh Signer Setup - Sync Preference\");\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(3, \"span\", 1);\n          i0.ɵɵtext(4, \" Smesh Signer always encrypts sensitive data like private keys and site permissions independent of the chosen sync mode.\\n\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(5, \"span\", 2);\n          i0.ɵɵtext(6, \"Sync : Mozilla Firefox\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(7, \"span\", 1);\n          i0.ɵɵtext(8, \" Your encrypted data is synced between browser instances. You need to be signed in with your account.\\n\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(9, \"button\", 3);\n          i0.ɵɵlistener(\"click\", function WelcomeComponent_Template_button_click_9_listener() {\n            return ctx.onClickSync(true);\n          });\n          i0.ɵɵelementStart(10, \"span\");\n          i0.ɵɵtext(11, \" Sync ON\");\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(12, \"span\", 2);\n          i0.ɵɵtext(13, \"Offline\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(14, \"span\", 4);\n          i0.ɵɵtext(15, \" Your encrypted data is never uploaded to any servers. It remains in your local browser instance.\\n\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(16, \"button\", 5);\n          i0.ɵɵlistener(\"click\", function WelcomeComponent_Template_button_click_16_listener() {\n            return ctx.onClickSync(false);\n          });\n          i0.ɵɵelementStart(17, \"span\");\n          i0.ɵɵtext(18, \" Sync OFF\");\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(19, \"div\", 6)(20, \"details\")(21, \"summary\");\n          i0.ɵɵtext(22, \"Important for Cashu wallet users\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(23, \"p\");\n          i0.ɵɵtext(24, \" Browser sync storage is limited to ~100KB shared across all data (identities, permissions, relays, and Cashu tokens). \");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(25, \"p\");\n          i0.ɵɵtext(26, \" If you plan to use the Cashu ecash wallet with significant balances, choose \");\n          i0.ɵɵelementStart(27, \"strong\");\n          i0.ɵɵtext(28, \"\\\"Sync OFF\\\"\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵtext(29, \" which provides ~5MB of local storage (enough for ~18,000+ tokens vs ~300-400 with sync). \");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(30, \"p\")(31, \"strong\");\n          i0.ɵɵtext(32, \"Note:\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵtext(33, \" Cashu tokens are bearer assets. If you lose your vault backup, you lose your tokens permanently. Make sure to configure regular backups. \");\n          i0.ɵɵelementEnd()()();\n          i0.ɵɵelement(34, \"div\", 7);\n          i0.ɵɵelementStart(35, \"span\", 8);\n          i0.ɵɵtext(36, \" Your preference can later be changed at any time.\\n\");\n          i0.ɵɵelementEnd();\n        }\n      },\n      styles: [\"[_nghost-%COMP%] {\\n  height: 100%;\\n  display: flex;\\n  flex-direction: column;\\n  padding-left: var(--size);\\n  padding-right: var(--size);\\n}\\n\\n.storage-info[_ngcontent-%COMP%] {\\n  margin-top: 1rem;\\n  width: 100%;\\n}\\n.storage-info[_ngcontent-%COMP%]   details[_ngcontent-%COMP%] {\\n  background: rgba(255, 193, 7, 0.1);\\n  border: 1px solid var(--warning, #ffc107);\\n  border-radius: 6px;\\n  padding: 0.5rem;\\n}\\n.storage-info[_ngcontent-%COMP%]   details[_ngcontent-%COMP%]   summary[_ngcontent-%COMP%] {\\n  cursor: pointer;\\n  font-weight: 500;\\n  font-size: 0.9rem;\\n  color: var(--warning, #ffc107);\\n}\\n.storage-info[_ngcontent-%COMP%]   details[_ngcontent-%COMP%]   summary[_ngcontent-%COMP%]:hover {\\n  text-decoration: underline;\\n}\\n.storage-info[_ngcontent-%COMP%]   details[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\\n  margin: 0.75rem 0 0 0;\\n  font-size: 0.85rem;\\n  line-height: 1.4;\\n  color: var(--text-muted, #6c757d);\\n}\\n.storage-info[_ngcontent-%COMP%]   details[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]:last-child {\\n  margin-bottom: 0.5rem;\\n}\\n.storage-info[_ngcontent-%COMP%]   details[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%] {\\n  color: var(--text, #212529);\\n}\"]\n    });\n  }\n  return WelcomeComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}