@orechio/platform-angular 0.6.0 → 0.7.2

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.
Files changed (40) hide show
  1. package/README.md +134 -64
  2. package/fesm2022/orechio-platform-angular-account-account-client-mPl0tzMg.mjs.map +1 -1
  3. package/fesm2022/{orechio-platform-angular-account-forgot-password.page-5_8R5B4m.mjs → orechio-platform-angular-account-forgot-password.page-L-Z-s49p.mjs} +85 -85
  4. package/fesm2022/orechio-platform-angular-account-forgot-password.page-L-Z-s49p.mjs.map +1 -0
  5. package/fesm2022/{orechio-platform-angular-account-initial-branch.page-Cmy07JGF.mjs → orechio-platform-angular-account-initial-branch.page-C8a1eU3L.mjs} +61 -61
  6. package/fesm2022/orechio-platform-angular-account-initial-branch.page-C8a1eU3L.mjs.map +1 -0
  7. package/fesm2022/{orechio-platform-angular-account-resend-verification.page-qckKAlPk.mjs → orechio-platform-angular-account-resend-verification.page-C3lk1vNj.mjs} +69 -69
  8. package/fesm2022/orechio-platform-angular-account-resend-verification.page-C3lk1vNj.mjs.map +1 -0
  9. package/fesm2022/{orechio-platform-angular-account-token-password.page-AHqb8mFk.mjs → orechio-platform-angular-account-token-password.page-1vn5XGVu.mjs} +73 -73
  10. package/fesm2022/orechio-platform-angular-account-token-password.page-1vn5XGVu.mjs.map +1 -0
  11. package/fesm2022/{orechio-platform-angular-account-verify-email.page-CHs0EwDf.mjs → orechio-platform-angular-account-verify-email.page-xulVDiOn.mjs} +35 -35
  12. package/fesm2022/orechio-platform-angular-account-verify-email.page-xulVDiOn.mjs.map +1 -0
  13. package/fesm2022/orechio-platform-angular-account.mjs +6 -6
  14. package/fesm2022/orechio-platform-angular-account.mjs.map +1 -1
  15. package/fesm2022/orechio-platform-angular-billing-billing-format-DFY2U19Y.mjs +303 -0
  16. package/fesm2022/orechio-platform-angular-billing-billing-format-DFY2U19Y.mjs.map +1 -0
  17. package/fesm2022/orechio-platform-angular-billing-checkout.page-CNl0PPiE.mjs +186 -0
  18. package/fesm2022/orechio-platform-angular-billing-checkout.page-CNl0PPiE.mjs.map +1 -0
  19. package/fesm2022/orechio-platform-angular-billing-invoice.page-CLojIJkf.mjs +136 -0
  20. package/fesm2022/orechio-platform-angular-billing-invoice.page-CLojIJkf.mjs.map +1 -0
  21. package/fesm2022/orechio-platform-angular-billing-invoices.page-COsCT5NY.mjs +105 -0
  22. package/fesm2022/orechio-platform-angular-billing-invoices.page-COsCT5NY.mjs.map +1 -0
  23. package/fesm2022/orechio-platform-angular-billing-pix-panel.component-fdORTehK.mjs +83 -0
  24. package/fesm2022/orechio-platform-angular-billing-pix-panel.component-fdORTehK.mjs.map +1 -0
  25. package/fesm2022/orechio-platform-angular-billing-profile.page-DHjsB3jJ.mjs +309 -0
  26. package/fesm2022/orechio-platform-angular-billing-profile.page-DHjsB3jJ.mjs.map +1 -0
  27. package/fesm2022/orechio-platform-angular-billing-subscription.page-Cotupt22.mjs +160 -0
  28. package/fesm2022/orechio-platform-angular-billing-subscription.page-Cotupt22.mjs.map +1 -0
  29. package/fesm2022/orechio-platform-angular-billing.mjs +69 -0
  30. package/fesm2022/orechio-platform-angular-billing.mjs.map +1 -0
  31. package/fesm2022/orechio-platform-angular.mjs +8 -4
  32. package/fesm2022/orechio-platform-angular.mjs.map +1 -1
  33. package/package.json +5 -1
  34. package/types/orechio-platform-angular-billing.d.ts +32 -0
  35. package/types/orechio-platform-angular.d.ts +8 -4
  36. package/fesm2022/orechio-platform-angular-account-forgot-password.page-5_8R5B4m.mjs.map +0 -1
  37. package/fesm2022/orechio-platform-angular-account-initial-branch.page-Cmy07JGF.mjs.map +0 -1
  38. package/fesm2022/orechio-platform-angular-account-resend-verification.page-qckKAlPk.mjs.map +0 -1
  39. package/fesm2022/orechio-platform-angular-account-token-password.page-AHqb8mFk.mjs.map +0 -1
  40. package/fesm2022/orechio-platform-angular-account-verify-email.page-CHs0EwDf.mjs.map +0 -1
package/README.md CHANGED
@@ -1,64 +1,134 @@
1
- # PlatformAngular
2
-
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 22.1.0.
4
-
5
- ## Code scaffolding
6
-
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
-
9
- ```bash
10
- ng generate component component-name
11
- ```
12
-
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
-
15
- ```bash
16
- ng generate --help
17
- ```
18
-
19
- ## Building
20
-
21
- To build the library, run:
22
-
23
- ```bash
24
- ng build platform-angular
25
- ```
26
-
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
-
29
- ### Publishing the Library
30
-
31
- Once the project is built, you can publish your library by following these steps:
32
-
33
- 1. Navigate to the `dist` directory:
34
-
35
- ```bash
36
- cd dist/platform-angular
37
- ```
38
-
39
- 2. Run the `npm publish` command to publish your library to the npm registry:
40
- ```bash
41
- npm publish
42
- ```
43
-
44
- ## Running unit tests
45
-
46
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
47
-
48
- ```bash
49
- ng test
50
- ```
51
-
52
- ## Running end-to-end tests
53
-
54
- For end-to-end (e2e) testing, run:
55
-
56
- ```bash
57
- ng e2e
58
- ```
59
-
60
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
61
-
62
- ## Additional Resources
63
-
64
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
1
+ # PlatformAngular
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 22.1.0.
4
+
5
+ ## Entry points
6
+
7
+ | Import | Contents |
8
+ | --- | --- |
9
+ | `@orechio/platform-angular` | Session, login, interceptors, capabilities, problem-details, pagination. |
10
+ | `@orechio/platform-angular/account` | The shared account onboarding screens (since 0.6.0). |
11
+ | `@orechio/platform-angular/billing` | The account holder's billing screens (since 0.7.0). |
12
+
13
+ ### `@orechio/platform-angular/account`
14
+
15
+ Six screens — e-mail verification, first operating unit, password recovery, password reset,
16
+ invite acceptance and verification resend — as routes the host mounts wherever it wants.
17
+
18
+ ```ts
19
+ import { provideOrechioAccount, ORECHIO_ACCOUNT_ROUTES } from '@orechio/platform-angular/account';
20
+
21
+ provideOrechioAccount({
22
+ basePath: '/api/account', // the product's own BFF, same-origin
23
+ branchLabel: 'loja', // whatever the product calls its first unit
24
+ onCompleted: () => '/painel', // where an operational account goes next
25
+ });
26
+
27
+ // routes:
28
+ { path: 'conta', children: ORECHIO_ACCOUNT_ROUTES }
29
+ ```
30
+
31
+ `onCompleted` is required and validated at bootstrap — the package deliberately has no
32
+ default destination, because a wrong one is only discovered by the first real customer
33
+ finishing the flow, once, with no way to retry the step.
34
+
35
+ The host must serve the six routes of **`Orechio.Platform.Bff.Account` 0.1.1 or newer**
36
+ under `basePath`. No token ever reaches the browser: the BFF exchanges with the Platform
37
+ and hands the session to the host's own cookie writer.
38
+
39
+ ### Cobrança — `@orechio/platform-angular/billing`
40
+
41
+ As telas de cobrança do titular (ADR-021 §3.5): situação da assinatura, dados de cobrança,
42
+ pagar por PIX e faturas.
43
+
44
+ ```ts
45
+ import { provideOrechioBilling, ORECHIO_BILLING_ROUTES } from '@orechio/platform-angular/billing';
46
+
47
+ provideOrechioBilling(); // basePath default: '/api/billing'
48
+ provideOrechioBilling({ basePath: '/bff/cobranca' }); // se o host mudou o prefixo no BFF
49
+
50
+ // rotas — em /billing, sempre:
51
+ { path: 'billing', children: ORECHIO_BILLING_ROUTES }
52
+ ```
53
+
54
+ **Monte em `/billing`.** Os e-mails de cobrança da Platform apontam para `{base}/billing`
55
+ (ADR-021 §3.2); montar em outro caminho quebra todo link já enviado.
56
+
57
+ **O que o host precisa ter no BFF:** `Orechio.Platform.Bff.Account` **0.2.0** com
58
+ `app.MapOrechioBillingEndpoints()` — as rotas de cobrança são opt-in no BFF. O prefixo do BFF
59
+ (`BillingRoutePrefix`, default `/api/billing`) e o `basePath` daqui têm de ser o mesmo. A
60
+ sessão é a que o host já registra como `IAccountSessionAccessor` para o onboarding; nenhum
61
+ token chega ao browser.
62
+
63
+ | Tela | Rota | Chama no BFF |
64
+ | --- | --- | --- |
65
+ | Situação | `/billing` | `GET subscription` · `GET invoices` (só em carência e suspensão) |
66
+ | Dados de cobrança | `/billing/profile` | `GET profile` · `POST profile` · `PATCH profile/contact` · `PATCH profile/address` |
67
+ | Pagar | `/billing/checkout` | `GET subscription` · `GET profile` · `GET pricing/preview` (um por ciclo) · `POST checkout` |
68
+ | Faturas | `/billing/invoices` | `GET invoices` |
69
+ | Fatura | `/billing/invoices/:id` | `GET invoices/{id}` · `POST invoices/{id}/refresh` |
70
+
71
+ A v1 mostra só PIX; trocar de plano, cancelar e reativar ficam para a v2. Erros aparecem em
72
+ português por `code`; um `code` desconhecido mostra uma mensagem genérica com o
73
+ `correlation_id`, que é o que o suporte usa para achar o caso no log.
74
+
75
+ ## Code scaffolding
76
+
77
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
78
+
79
+ ```bash
80
+ ng generate component component-name
81
+ ```
82
+
83
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
84
+
85
+ ```bash
86
+ ng generate --help
87
+ ```
88
+
89
+ ## Building
90
+
91
+ To build the library, run:
92
+
93
+ ```bash
94
+ ng build platform-angular
95
+ ```
96
+
97
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
98
+
99
+ ### Publishing the Library
100
+
101
+ Once the project is built, you can publish your library by following these steps:
102
+
103
+ 1. Navigate to the `dist` directory:
104
+
105
+ ```bash
106
+ cd dist/platform-angular
107
+ ```
108
+
109
+ 2. Run the `npm publish` command to publish your library to the npm registry:
110
+ ```bash
111
+ npm publish
112
+ ```
113
+
114
+ ## Running unit tests
115
+
116
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
117
+
118
+ ```bash
119
+ ng test
120
+ ```
121
+
122
+ ## Running end-to-end tests
123
+
124
+ For end-to-end (e2e) testing, run:
125
+
126
+ ```bash
127
+ ng e2e
128
+ ```
129
+
130
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
131
+
132
+ ## Additional Resources
133
+
134
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -1 +1 @@
1
- {"version":3,"file":"orechio-platform-angular-account-account-client-mPl0tzMg.mjs","sources":["../../../projects/platform-angular/account/src/account-client.ts"],"sourcesContent":["import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable, catchError, map, throwError } from 'rxjs';\nimport { ProblemDetails, normalizeProblemDetails } from '@orechio/platform-angular';\nimport { AccountCompletionResult, ORECHIO_ACCOUNT_CONFIG } from './account-config';\n\nexport interface VerifyEmailResult {\n status: string;\n provisioningRequired: boolean;\n}\n\n/** Resposta dos fluxos anti-enumeration. Opaca por desenho. */\nexport interface OpaqueAcknowledgement {\n message: string;\n}\n\n/**\n * O cliente do BFF de conta.\n *\n * <p>\n * Fala só com o BFF do próprio host, same-origin — nunca com a Platform. É essa indireção\n * que mantém o token fora do browser: o BFF recebe o par da Platform, entrega ao mecanismo\n * de sessão, e devolve aqui apenas estado.\n * </p>\n *\n * <p>\n * Todo erro sai normalizado como <c>ProblemDetails</c>, reusando o\n * <c>normalizeProblemDetails</c> do entry primário. Um segundo normalizador aqui divergiria\n * do primeiro na primeira mudança de contrato.\n * </p>\n */\n@Injectable({ providedIn: 'root' })\nexport class AccountClient {\n private readonly http = inject(HttpClient);\n private readonly config = inject(ORECHIO_ACCOUNT_CONFIG);\n\n verifyEmail(token: string): Observable<VerifyEmailResult> {\n return this.post<VerifyEmailResult>(this.config.paths.verifyEmail, { token });\n }\n\n createInitialBranch(name: string): Observable<AccountCompletionResult> {\n return this.post<AccountCompletionResult>(this.config.paths.initialBranch, { name });\n }\n\n forgotPassword(email: string): Observable<OpaqueAcknowledgement> {\n return this.post<OpaqueAcknowledgement>(this.config.paths.forgotPassword, { email });\n }\n\n resetPassword(token: string, newPassword: string): Observable<OpaqueAcknowledgement> {\n return this.post<OpaqueAcknowledgement>(this.config.paths.resetPassword, { token, newPassword });\n }\n\n acceptInvite(token: string, password: string): Observable<OpaqueAcknowledgement> {\n return this.post<OpaqueAcknowledgement>(this.config.paths.acceptInvite, { token, password });\n }\n\n resendVerification(email: string): Observable<OpaqueAcknowledgement> {\n return this.post<OpaqueAcknowledgement>(this.config.paths.resendVerification, { email });\n }\n\n private post<T>(path: string, body: unknown): Observable<T> {\n return this.http.post<T>(`${this.config.basePath}${path}`, body).pipe(\n map((response) => response as T),\n catchError((error: HttpErrorResponse) =>\n throwError((): ProblemDetails => normalizeProblemDetails(error)),\n ),\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;AAgBA;;;;;;;;;;;;;;AAcG;MAEU,aAAa,CAAA;AACP,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAExD,IAAA,WAAW,CAAC,KAAa,EAAA;AACvB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAoB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC;IAC/E;AAEA,IAAA,mBAAmB,CAAC,IAAY,EAAA;AAC9B,QAAA,OAAO,IAAI,CAAC,IAAI,CAA0B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC;IACtF;AAEA,IAAA,cAAc,CAAC,KAAa,EAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,CAAC;IACtF;IAEA,aAAa,CAAC,KAAa,EAAE,WAAmB,EAAA;AAC9C,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAClG;IAEA,YAAY,CAAC,KAAa,EAAE,QAAgB,EAAA;AAC1C,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC9F;AAEA,IAAA,kBAAkB,CAAC,KAAa,EAAA;AAC9B,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,CAAC;IAC1F;IAEQ,IAAI,CAAI,IAAY,EAAE,IAAa,EAAA;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAI,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAA,EAAG,IAAI,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CACnE,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAa,CAAC,EAChC,UAAU,CAAC,CAAC,KAAwB,KAClC,UAAU,CAAC,MAAsB,uBAAuB,CAAC,KAAK,CAAC,CAAC,CACjE,CACF;IACH;uGAnCW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"orechio-platform-angular-account-account-client-mPl0tzMg.mjs","sources":["../../../projects/platform-angular/account/src/account-client.ts"],"sourcesContent":["import { HttpClient, HttpErrorResponse } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { Observable, catchError, map, throwError } from 'rxjs';\r\nimport { ProblemDetails, normalizeProblemDetails } from '@orechio/platform-angular';\r\nimport { AccountCompletionResult, ORECHIO_ACCOUNT_CONFIG } from './account-config';\r\n\r\nexport interface VerifyEmailResult {\r\n status: string;\r\n provisioningRequired: boolean;\r\n}\r\n\r\n/** Resposta dos fluxos anti-enumeration. Opaca por desenho. */\r\nexport interface OpaqueAcknowledgement {\r\n message: string;\r\n}\r\n\r\n/**\r\n * O cliente do BFF de conta.\r\n *\r\n * <p>\r\n * Fala só com o BFF do próprio host, same-origin — nunca com a Platform. É essa indireção\r\n * que mantém o token fora do browser: o BFF recebe o par da Platform, entrega ao mecanismo\r\n * de sessão, e devolve aqui apenas estado.\r\n * </p>\r\n *\r\n * <p>\r\n * Todo erro sai normalizado como <c>ProblemDetails</c>, reusando o\r\n * <c>normalizeProblemDetails</c> do entry primário. Um segundo normalizador aqui divergiria\r\n * do primeiro na primeira mudança de contrato.\r\n * </p>\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class AccountClient {\r\n private readonly http = inject(HttpClient);\r\n private readonly config = inject(ORECHIO_ACCOUNT_CONFIG);\r\n\r\n verifyEmail(token: string): Observable<VerifyEmailResult> {\r\n return this.post<VerifyEmailResult>(this.config.paths.verifyEmail, { token });\r\n }\r\n\r\n createInitialBranch(name: string): Observable<AccountCompletionResult> {\r\n return this.post<AccountCompletionResult>(this.config.paths.initialBranch, { name });\r\n }\r\n\r\n forgotPassword(email: string): Observable<OpaqueAcknowledgement> {\r\n return this.post<OpaqueAcknowledgement>(this.config.paths.forgotPassword, { email });\r\n }\r\n\r\n resetPassword(token: string, newPassword: string): Observable<OpaqueAcknowledgement> {\r\n return this.post<OpaqueAcknowledgement>(this.config.paths.resetPassword, { token, newPassword });\r\n }\r\n\r\n acceptInvite(token: string, password: string): Observable<OpaqueAcknowledgement> {\r\n return this.post<OpaqueAcknowledgement>(this.config.paths.acceptInvite, { token, password });\r\n }\r\n\r\n resendVerification(email: string): Observable<OpaqueAcknowledgement> {\r\n return this.post<OpaqueAcknowledgement>(this.config.paths.resendVerification, { email });\r\n }\r\n\r\n private post<T>(path: string, body: unknown): Observable<T> {\r\n return this.http.post<T>(`${this.config.basePath}${path}`, body).pipe(\r\n map((response) => response as T),\r\n catchError((error: HttpErrorResponse) =>\r\n throwError((): ProblemDetails => normalizeProblemDetails(error)),\r\n ),\r\n );\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;AAgBA;;;;;;;;;;;;;;AAcG;MAEU,aAAa,CAAA;AACP,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAExD,IAAA,WAAW,CAAC,KAAa,EAAA;AACvB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAoB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC;IAC/E;AAEA,IAAA,mBAAmB,CAAC,IAAY,EAAA;AAC9B,QAAA,OAAO,IAAI,CAAC,IAAI,CAA0B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC;IACtF;AAEA,IAAA,cAAc,CAAC,KAAa,EAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,CAAC;IACtF;IAEA,aAAa,CAAC,KAAa,EAAE,WAAmB,EAAA;AAC9C,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAClG;IAEA,YAAY,CAAC,KAAa,EAAE,QAAgB,EAAA;AAC1C,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC9F;AAEA,IAAA,kBAAkB,CAAC,KAAa,EAAA;AAC9B,QAAA,OAAO,IAAI,CAAC,IAAI,CAAwB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,CAAC;IAC1F;IAEQ,IAAI,CAAI,IAAY,EAAE,IAAa,EAAA;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAI,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAA,EAAG,IAAI,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CACnE,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAa,CAAC,EAChC,UAAU,CAAC,CAAC,KAAwB,KAClC,UAAU,CAAC,MAAsB,uBAAuB,CAAC,KAAK,CAAC,CAAC,CACjE,CACF;IACH;uGAnCW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cADA,MAAM,EAAA,CAAA;;2FACnB,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -41,96 +41,96 @@ class ForgotPasswordPage {
41
41
  });
42
42
  }
43
43
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ForgotPasswordPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
44
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: ForgotPasswordPage, isStandalone: true, selector: "orechio-account-forgot-password", ngImport: i0, template: `
45
- <section class="orechio-account">
46
- <ng-content select="[orechioAccountBrand]"></ng-content>
47
-
48
- @if (enviado()) {
49
- <h1>Verifique seu e-mail</h1>
50
- <!--
51
- O texto NÃO confirma que a conta existe, e isso é deliberado.
52
-
53
- A Platform responde 202 idêntico para e-mail conhecido e desconhecido — defesa
54
- anti-enumeration, provada byte a byte no ACCOUNT-1B. Uma tela que dissesse
55
- "enviamos para você" só quando a conta existe desfaria a defesa na camada de cima:
56
- bastaria comparar as duas telas para descobrir quem tem conta aqui.
57
- -->
58
- <p>Se houver uma conta com esse endereço, as instruções chegarão em instantes.</p>
59
- <p class="orechio-account__muted">Confira também a caixa de spam.</p>
60
- } @else {
61
- <h1>Recuperar acesso</h1>
62
- <p class="orechio-account__muted">Informe o e-mail da sua conta.</p>
63
-
64
- <form (ngSubmit)="enviar()">
65
- <label for="orechio-account-forgot-email">E-mail</label>
66
- <input
67
- id="orechio-account-forgot-email"
68
- name="email"
69
- type="email"
70
- autocomplete="email"
71
- [(ngModel)]="email"
72
- [disabled]="enviando()"
73
- required
74
- />
75
-
76
- @if (erro()) {
77
- <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
78
- }
79
-
80
- <button type="submit" [disabled]="enviando() || !email.trim()">
81
- {{ enviando() ? 'Enviando…' : 'Enviar instruções' }}
82
- </button>
83
- </form>
84
- }
85
- </section>
44
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: ForgotPasswordPage, isStandalone: true, selector: "orechio-account-forgot-password", ngImport: i0, template: `
45
+ <section class="orechio-account">
46
+ <ng-content select="[orechioAccountBrand]"></ng-content>
47
+
48
+ @if (enviado()) {
49
+ <h1>Verifique seu e-mail</h1>
50
+ <!--
51
+ O texto NÃO confirma que a conta existe, e isso é deliberado.
52
+
53
+ A Platform responde 202 idêntico para e-mail conhecido e desconhecido — defesa
54
+ anti-enumeration, provada byte a byte no ACCOUNT-1B. Uma tela que dissesse
55
+ "enviamos para você" só quando a conta existe desfaria a defesa na camada de cima:
56
+ bastaria comparar as duas telas para descobrir quem tem conta aqui.
57
+ -->
58
+ <p>Se houver uma conta com esse endereço, as instruções chegarão em instantes.</p>
59
+ <p class="orechio-account__muted">Confira também a caixa de spam.</p>
60
+ } @else {
61
+ <h1>Recuperar acesso</h1>
62
+ <p class="orechio-account__muted">Informe o e-mail da sua conta.</p>
63
+
64
+ <form (ngSubmit)="enviar()">
65
+ <label for="orechio-account-forgot-email">E-mail</label>
66
+ <input
67
+ id="orechio-account-forgot-email"
68
+ name="email"
69
+ type="email"
70
+ autocomplete="email"
71
+ [(ngModel)]="email"
72
+ [disabled]="enviando()"
73
+ required
74
+ />
75
+
76
+ @if (erro()) {
77
+ <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
78
+ }
79
+
80
+ <button type="submit" [disabled]="enviando() || !email.trim()">
81
+ {{ enviando() ? 'Enviando…' : 'Enviar instruções' }}
82
+ </button>
83
+ </form>
84
+ }
85
+ </section>
86
86
  `, isInline: true, styles: [".orechio-account{display:flex;flex-direction:column;gap:var(--orechio-space-3, .75rem);max-width:28rem;margin:0 auto;padding:var(--orechio-space-6, 1.5rem);color:var(--orechio-color-text, inherit);font-family:var(--orechio-font-body, inherit)}.orechio-account form{display:flex;flex-direction:column;gap:var(--orechio-space-2, .5rem)}.orechio-account__muted{color:var(--orechio-color-text-muted, #666)}.orechio-account__error{color:var(--orechio-color-danger, #b00020)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
87
87
  }
88
88
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: ForgotPasswordPage, decorators: [{
89
89
  type: Component,
90
- args: [{ selector: 'orechio-account-forgot-password', standalone: true, imports: [FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
91
- <section class="orechio-account">
92
- <ng-content select="[orechioAccountBrand]"></ng-content>
93
-
94
- @if (enviado()) {
95
- <h1>Verifique seu e-mail</h1>
96
- <!--
97
- O texto NÃO confirma que a conta existe, e isso é deliberado.
98
-
99
- A Platform responde 202 idêntico para e-mail conhecido e desconhecido — defesa
100
- anti-enumeration, provada byte a byte no ACCOUNT-1B. Uma tela que dissesse
101
- "enviamos para você" só quando a conta existe desfaria a defesa na camada de cima:
102
- bastaria comparar as duas telas para descobrir quem tem conta aqui.
103
- -->
104
- <p>Se houver uma conta com esse endereço, as instruções chegarão em instantes.</p>
105
- <p class="orechio-account__muted">Confira também a caixa de spam.</p>
106
- } @else {
107
- <h1>Recuperar acesso</h1>
108
- <p class="orechio-account__muted">Informe o e-mail da sua conta.</p>
109
-
110
- <form (ngSubmit)="enviar()">
111
- <label for="orechio-account-forgot-email">E-mail</label>
112
- <input
113
- id="orechio-account-forgot-email"
114
- name="email"
115
- type="email"
116
- autocomplete="email"
117
- [(ngModel)]="email"
118
- [disabled]="enviando()"
119
- required
120
- />
121
-
122
- @if (erro()) {
123
- <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
124
- }
125
-
126
- <button type="submit" [disabled]="enviando() || !email.trim()">
127
- {{ enviando() ? 'Enviando…' : 'Enviar instruções' }}
128
- </button>
129
- </form>
130
- }
131
- </section>
90
+ args: [{ selector: 'orechio-account-forgot-password', standalone: true, imports: [FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
91
+ <section class="orechio-account">
92
+ <ng-content select="[orechioAccountBrand]"></ng-content>
93
+
94
+ @if (enviado()) {
95
+ <h1>Verifique seu e-mail</h1>
96
+ <!--
97
+ O texto NÃO confirma que a conta existe, e isso é deliberado.
98
+
99
+ A Platform responde 202 idêntico para e-mail conhecido e desconhecido — defesa
100
+ anti-enumeration, provada byte a byte no ACCOUNT-1B. Uma tela que dissesse
101
+ "enviamos para você" só quando a conta existe desfaria a defesa na camada de cima:
102
+ bastaria comparar as duas telas para descobrir quem tem conta aqui.
103
+ -->
104
+ <p>Se houver uma conta com esse endereço, as instruções chegarão em instantes.</p>
105
+ <p class="orechio-account__muted">Confira também a caixa de spam.</p>
106
+ } @else {
107
+ <h1>Recuperar acesso</h1>
108
+ <p class="orechio-account__muted">Informe o e-mail da sua conta.</p>
109
+
110
+ <form (ngSubmit)="enviar()">
111
+ <label for="orechio-account-forgot-email">E-mail</label>
112
+ <input
113
+ id="orechio-account-forgot-email"
114
+ name="email"
115
+ type="email"
116
+ autocomplete="email"
117
+ [(ngModel)]="email"
118
+ [disabled]="enviando()"
119
+ required
120
+ />
121
+
122
+ @if (erro()) {
123
+ <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
124
+ }
125
+
126
+ <button type="submit" [disabled]="enviando() || !email.trim()">
127
+ {{ enviando() ? 'Enviando…' : 'Enviar instruções' }}
128
+ </button>
129
+ </form>
130
+ }
131
+ </section>
132
132
  `, styles: [".orechio-account{display:flex;flex-direction:column;gap:var(--orechio-space-3, .75rem);max-width:28rem;margin:0 auto;padding:var(--orechio-space-6, 1.5rem);color:var(--orechio-color-text, inherit);font-family:var(--orechio-font-body, inherit)}.orechio-account form{display:flex;flex-direction:column;gap:var(--orechio-space-2, .5rem)}.orechio-account__muted{color:var(--orechio-color-text-muted, #666)}.orechio-account__error{color:var(--orechio-color-danger, #b00020)}\n"] }]
133
133
  }] });
134
134
 
135
135
  export { ForgotPasswordPage };
136
- //# sourceMappingURL=orechio-platform-angular-account-forgot-password.page-5_8R5B4m.mjs.map
136
+ //# sourceMappingURL=orechio-platform-angular-account-forgot-password.page-L-Z-s49p.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orechio-platform-angular-account-forgot-password.page-L-Z-s49p.mjs","sources":["../../../projects/platform-angular/account/src/pages/forgot-password.page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { ProblemDetails } from '@orechio/platform-angular';\r\nimport { AccountClient } from '../account-client';\r\n\r\n@Component({\r\n selector: 'orechio-account-forgot-password',\r\n standalone: true,\r\n imports: [FormsModule],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <section class=\"orechio-account\">\r\n <ng-content select=\"[orechioAccountBrand]\"></ng-content>\r\n\r\n @if (enviado()) {\r\n <h1>Verifique seu e-mail</h1>\r\n <!--\r\n O texto NÃO confirma que a conta existe, e isso é deliberado.\r\n\r\n A Platform responde 202 idêntico para e-mail conhecido e desconhecido — defesa\r\n anti-enumeration, provada byte a byte no ACCOUNT-1B. Uma tela que dissesse\r\n \"enviamos para você\" só quando a conta existe desfaria a defesa na camada de cima:\r\n bastaria comparar as duas telas para descobrir quem tem conta aqui.\r\n -->\r\n <p>Se houver uma conta com esse endereço, as instruções chegarão em instantes.</p>\r\n <p class=\"orechio-account__muted\">Confira também a caixa de spam.</p>\r\n } @else {\r\n <h1>Recuperar acesso</h1>\r\n <p class=\"orechio-account__muted\">Informe o e-mail da sua conta.</p>\r\n\r\n <form (ngSubmit)=\"enviar()\">\r\n <label for=\"orechio-account-forgot-email\">E-mail</label>\r\n <input\r\n id=\"orechio-account-forgot-email\"\r\n name=\"email\"\r\n type=\"email\"\r\n autocomplete=\"email\"\r\n [(ngModel)]=\"email\"\r\n [disabled]=\"enviando()\"\r\n required\r\n />\r\n\r\n @if (erro()) {\r\n <p class=\"orechio-account__error\">{{ mensagemDeErro() }}</p>\r\n }\r\n\r\n <button type=\"submit\" [disabled]=\"enviando() || !email.trim()\">\r\n {{ enviando() ? 'Enviando…' : 'Enviar instruções' }}\r\n </button>\r\n </form>\r\n }\r\n </section>\r\n `,\r\n styles: `\r\n .orechio-account {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--orechio-space-3, 0.75rem);\r\n max-width: 28rem;\r\n margin: 0 auto;\r\n padding: var(--orechio-space-6, 1.5rem);\r\n color: var(--orechio-color-text, inherit);\r\n font-family: var(--orechio-font-body, inherit);\r\n }\r\n .orechio-account form { display: flex; flex-direction: column; gap: var(--orechio-space-2, 0.5rem); }\r\n .orechio-account__muted { color: var(--orechio-color-text-muted, #666); }\r\n .orechio-account__error { color: var(--orechio-color-danger, #b00020); }\r\n `,\r\n})\r\nexport class ForgotPasswordPage {\r\n private readonly client = inject(AccountClient);\r\n\r\n protected email = '';\r\n protected readonly enviando = signal(false);\r\n protected readonly enviado = signal(false);\r\n protected readonly erro = signal<ProblemDetails | null>(null);\r\n\r\n protected mensagemDeErro(): string {\r\n const code = this.erro()?.code;\r\n if (code === 'rate_limit_exceeded') return 'Muitas tentativas. Aguarde alguns minutos.';\r\n if (code === 'platform.unavailable') return 'Serviço indisponível. Tente novamente em instantes.';\r\n return 'Não foi possível enviar. Tente novamente.';\r\n }\r\n\r\n protected enviar(): void {\r\n const email = this.email.trim();\r\n if (!email || this.enviando()) return;\r\n\r\n this.enviando.set(true);\r\n this.erro.set(null);\r\n\r\n this.client.forgotPassword(email).subscribe({\r\n // Sucesso é sucesso, sem olhar o corpo: a resposta é opaca por desenho, e inspecioná-la\r\n // para decidir o texto seria a porta dos fundos da enumeração.\r\n next: () => {\r\n this.enviado.set(true);\r\n this.enviando.set(false);\r\n },\r\n error: (problema: ProblemDetails) => {\r\n this.erro.set(problema);\r\n this.enviando.set(false);\r\n },\r\n });\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;MAqEa,kBAAkB,CAAA;AACZ,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;IAErC,KAAK,GAAG,EAAE;IACD,QAAQ,GAAG,MAAM,CAAC,KAAK;iFAAC;IACxB,OAAO,GAAG,MAAM,CAAC,KAAK;gFAAC;IACvB,IAAI,GAAG,MAAM,CAAwB,IAAI;6EAAC;IAEnD,cAAc,GAAA;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI;QAC9B,IAAI,IAAI,KAAK,qBAAqB;AAAE,YAAA,OAAO,4CAA4C;QACvF,IAAI,IAAI,KAAK,sBAAsB;AAAE,YAAA,OAAO,qDAAqD;AACjG,QAAA,OAAO,2CAA2C;IACpD;IAEU,MAAM,GAAA;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;AAC/B,QAAA,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YAAE;AAE/B,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACvB,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QAEnB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;;;YAG1C,IAAI,EAAE,MAAK;AACT,gBAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;AACtB,gBAAA,IAAI,CAAC,QAAQ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AAA,CAAA,iBAAA,EAAA,QAAA,EAAA,wIAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,QAAA,EAAA,yEAAA,EAAA,MAAA,EAAA,CAAA,eAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FA6DV,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAhE9B,SAAS;+BACE,iCAAiC,EAAA,UAAA,EAC/B,IAAI,EAAA,OAAA,EACP,CAAC,WAAW,CAAC,EAAA,eAAA,EACL,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,ydAAA,CAAA,EAAA;;;;;"}
@@ -50,72 +50,72 @@ class InitialBranchPage {
50
50
  });
51
51
  }
52
52
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: InitialBranchPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
53
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: InitialBranchPage, isStandalone: true, selector: "orechio-account-initial-branch", ngImport: i0, template: `
54
- <section class="orechio-account">
55
- <ng-content select="[orechioAccountBrand]"></ng-content>
56
-
57
- <h1>Configure sua primeira {{ rotulo }}</h1>
58
- <p class="orechio-account__muted">
59
- É onde seus lançamentos vão nascer. Dá para criar outras depois.
60
- </p>
61
-
62
- <form (ngSubmit)="enviar()">
63
- <label for="orechio-account-branch-name">Nome da {{ rotulo }}</label>
64
- <input
65
- id="orechio-account-branch-name"
66
- name="nome"
67
- type="text"
68
- autocomplete="organization"
69
- [(ngModel)]="nome"
70
- [disabled]="enviando()"
71
- required
72
- />
73
-
74
- @if (erro()) {
75
- <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
76
- }
77
-
78
- <button type="submit" [disabled]="enviando() || !nome.trim()">
79
- {{ enviando() ? 'Criando…' : 'Concluir' }}
80
- </button>
81
- </form>
82
- </section>
53
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: InitialBranchPage, isStandalone: true, selector: "orechio-account-initial-branch", ngImport: i0, template: `
54
+ <section class="orechio-account">
55
+ <ng-content select="[orechioAccountBrand]"></ng-content>
56
+
57
+ <h1>Configure sua primeira {{ rotulo }}</h1>
58
+ <p class="orechio-account__muted">
59
+ É onde seus lançamentos vão nascer. Dá para criar outras depois.
60
+ </p>
61
+
62
+ <form (ngSubmit)="enviar()">
63
+ <label for="orechio-account-branch-name">Nome da {{ rotulo }}</label>
64
+ <input
65
+ id="orechio-account-branch-name"
66
+ name="nome"
67
+ type="text"
68
+ autocomplete="organization"
69
+ [(ngModel)]="nome"
70
+ [disabled]="enviando()"
71
+ required
72
+ />
73
+
74
+ @if (erro()) {
75
+ <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
76
+ }
77
+
78
+ <button type="submit" [disabled]="enviando() || !nome.trim()">
79
+ {{ enviando() ? 'Criando…' : 'Concluir' }}
80
+ </button>
81
+ </form>
82
+ </section>
83
83
  `, isInline: true, styles: [".orechio-account{display:flex;flex-direction:column;gap:var(--orechio-space-3, .75rem);max-width:28rem;margin:0 auto;padding:var(--orechio-space-6, 1.5rem);color:var(--orechio-color-text, inherit);font-family:var(--orechio-font-body, inherit)}.orechio-account form{display:flex;flex-direction:column;gap:var(--orechio-space-2, .5rem)}.orechio-account__muted{color:var(--orechio-color-text-muted, #666)}.orechio-account__error{color:var(--orechio-color-danger, #b00020)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
84
  }
85
85
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: InitialBranchPage, decorators: [{
86
86
  type: Component,
87
- args: [{ selector: 'orechio-account-initial-branch', standalone: true, imports: [FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
88
- <section class="orechio-account">
89
- <ng-content select="[orechioAccountBrand]"></ng-content>
90
-
91
- <h1>Configure sua primeira {{ rotulo }}</h1>
92
- <p class="orechio-account__muted">
93
- É onde seus lançamentos vão nascer. Dá para criar outras depois.
94
- </p>
95
-
96
- <form (ngSubmit)="enviar()">
97
- <label for="orechio-account-branch-name">Nome da {{ rotulo }}</label>
98
- <input
99
- id="orechio-account-branch-name"
100
- name="nome"
101
- type="text"
102
- autocomplete="organization"
103
- [(ngModel)]="nome"
104
- [disabled]="enviando()"
105
- required
106
- />
107
-
108
- @if (erro()) {
109
- <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
110
- }
111
-
112
- <button type="submit" [disabled]="enviando() || !nome.trim()">
113
- {{ enviando() ? 'Criando…' : 'Concluir' }}
114
- </button>
115
- </form>
116
- </section>
87
+ args: [{ selector: 'orechio-account-initial-branch', standalone: true, imports: [FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
88
+ <section class="orechio-account">
89
+ <ng-content select="[orechioAccountBrand]"></ng-content>
90
+
91
+ <h1>Configure sua primeira {{ rotulo }}</h1>
92
+ <p class="orechio-account__muted">
93
+ É onde seus lançamentos vão nascer. Dá para criar outras depois.
94
+ </p>
95
+
96
+ <form (ngSubmit)="enviar()">
97
+ <label for="orechio-account-branch-name">Nome da {{ rotulo }}</label>
98
+ <input
99
+ id="orechio-account-branch-name"
100
+ name="nome"
101
+ type="text"
102
+ autocomplete="organization"
103
+ [(ngModel)]="nome"
104
+ [disabled]="enviando()"
105
+ required
106
+ />
107
+
108
+ @if (erro()) {
109
+ <p class="orechio-account__error">{{ mensagemDeErro() }}</p>
110
+ }
111
+
112
+ <button type="submit" [disabled]="enviando() || !nome.trim()">
113
+ {{ enviando() ? 'Criando…' : 'Concluir' }}
114
+ </button>
115
+ </form>
116
+ </section>
117
117
  `, styles: [".orechio-account{display:flex;flex-direction:column;gap:var(--orechio-space-3, .75rem);max-width:28rem;margin:0 auto;padding:var(--orechio-space-6, 1.5rem);color:var(--orechio-color-text, inherit);font-family:var(--orechio-font-body, inherit)}.orechio-account form{display:flex;flex-direction:column;gap:var(--orechio-space-2, .5rem)}.orechio-account__muted{color:var(--orechio-color-text-muted, #666)}.orechio-account__error{color:var(--orechio-color-danger, #b00020)}\n"] }]
118
118
  }] });
119
119
 
120
120
  export { InitialBranchPage };
121
- //# sourceMappingURL=orechio-platform-angular-account-initial-branch.page-Cmy07JGF.mjs.map
121
+ //# sourceMappingURL=orechio-platform-angular-account-initial-branch.page-C8a1eU3L.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orechio-platform-angular-account-initial-branch.page-C8a1eU3L.mjs","sources":["../../../projects/platform-angular/account/src/pages/initial-branch.page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { Router } from '@angular/router';\r\nimport { ProblemDetails } from '@orechio/platform-angular';\r\nimport { AccountClient } from '../account-client';\r\nimport { ORECHIO_ACCOUNT_CONFIG } from '../account-config';\r\n\r\n@Component({\r\n selector: 'orechio-account-initial-branch',\r\n standalone: true,\r\n imports: [FormsModule],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <section class=\"orechio-account\">\r\n <ng-content select=\"[orechioAccountBrand]\"></ng-content>\r\n\r\n <h1>Configure sua primeira {{ rotulo }}</h1>\r\n <p class=\"orechio-account__muted\">\r\n É onde seus lançamentos vão nascer. Dá para criar outras depois.\r\n </p>\r\n\r\n <form (ngSubmit)=\"enviar()\">\r\n <label for=\"orechio-account-branch-name\">Nome da {{ rotulo }}</label>\r\n <input\r\n id=\"orechio-account-branch-name\"\r\n name=\"nome\"\r\n type=\"text\"\r\n autocomplete=\"organization\"\r\n [(ngModel)]=\"nome\"\r\n [disabled]=\"enviando()\"\r\n required\r\n />\r\n\r\n @if (erro()) {\r\n <p class=\"orechio-account__error\">{{ mensagemDeErro() }}</p>\r\n }\r\n\r\n <button type=\"submit\" [disabled]=\"enviando() || !nome.trim()\">\r\n {{ enviando() ? 'Criando…' : 'Concluir' }}\r\n </button>\r\n </form>\r\n </section>\r\n `,\r\n styles: `\r\n .orechio-account {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--orechio-space-3, 0.75rem);\r\n max-width: 28rem;\r\n margin: 0 auto;\r\n padding: var(--orechio-space-6, 1.5rem);\r\n color: var(--orechio-color-text, inherit);\r\n font-family: var(--orechio-font-body, inherit);\r\n }\r\n .orechio-account form { display: flex; flex-direction: column; gap: var(--orechio-space-2, 0.5rem); }\r\n .orechio-account__muted { color: var(--orechio-color-text-muted, #666); }\r\n .orechio-account__error { color: var(--orechio-color-danger, #b00020); }\r\n `,\r\n})\r\nexport class InitialBranchPage {\r\n private readonly router = inject(Router);\r\n private readonly client = inject(AccountClient);\r\n private readonly config = inject(ORECHIO_ACCOUNT_CONFIG);\r\n\r\n protected readonly rotulo = this.config.branchLabel;\r\n protected nome = '';\r\n protected readonly enviando = signal(false);\r\n protected readonly erro = signal<ProblemDetails | null>(null);\r\n\r\n protected mensagemDeErro(): string {\r\n const code = this.erro()?.code;\r\n if (code === 'onboarding.branch_already_exists') return `Esta ${this.rotulo} já foi criada.`;\r\n if (code === 'session.missing') return 'Sua sessão expirou. Abra o link do e-mail novamente.';\r\n if (code === 'onboarding.not_in_provisioning') return 'Este passo já foi concluído.';\r\n if (code === 'rate_limit_exceeded') return 'Muitas tentativas. Aguarde alguns minutos.';\r\n if (code?.startsWith('branch.')) return 'Escolha um nome válido.';\r\n return 'Não foi possível concluir. Tente novamente.';\r\n }\r\n\r\n protected enviar(): void {\r\n const nome = this.nome.trim();\r\n if (!nome || this.enviando()) return;\r\n\r\n this.enviando.set(true);\r\n this.erro.set(null);\r\n\r\n this.client.createInitialBranch(nome).subscribe({\r\n next: async (resultado) => {\r\n // O pacote entrega o resultado e sai. Quem decide para onde ir é o host —\r\n // `nextStep` é repassado inteiro, sem interpretação (ADR-019 §3).\r\n const destino = this.config.onCompleted(resultado);\r\n await this.router.navigateByUrl(destino, { replaceUrl: true });\r\n },\r\n error: (problema: ProblemDetails) => {\r\n this.erro.set(problema);\r\n this.enviando.set(false);\r\n },\r\n });\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;MA2Da,iBAAiB,CAAA;AACX,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAErC,IAAA,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW;IACzC,IAAI,GAAG,EAAE;IACA,QAAQ,GAAG,MAAM,CAAC,KAAK;iFAAC;IACxB,IAAI,GAAG,MAAM,CAAwB,IAAI;6EAAC;IAEnD,cAAc,GAAA;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI;QAC9B,IAAI,IAAI,KAAK,kCAAkC;AAAE,YAAA,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAC,MAAM,iBAAiB;QAC5F,IAAI,IAAI,KAAK,iBAAiB;AAAE,YAAA,OAAO,sDAAsD;QAC7F,IAAI,IAAI,KAAK,gCAAgC;AAAE,YAAA,OAAO,8BAA8B;QACpF,IAAI,IAAI,KAAK,qBAAqB;AAAE,YAAA,OAAO,4CAA4C;AACvF,QAAA,IAAI,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC;AAAE,YAAA,OAAO,yBAAyB;AACjE,QAAA,OAAO,6CAA6C;IACtD;IAEU,MAAM,GAAA;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AAC7B,QAAA,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;YAAE;AAE9B,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACvB,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QAE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