pwa-auth 3.2.3 → 3.2.5

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 (84) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README.md +55 -33
  3. package/base/css/form/button.d.ts +2 -2
  4. package/base/css/form/button.js +2 -2
  5. package/base/css/form/input.d.ts +2 -2
  6. package/base/css/form/input.js +2 -2
  7. package/base/css/form/label.d.ts +2 -2
  8. package/base/css/form/label.js +2 -2
  9. package/base/css/form/list.d.ts +2 -2
  10. package/base/css/form/list.js +2 -2
  11. package/base/css/svg.d.ts +3 -3
  12. package/base/css/svg.js +4 -4
  13. package/base/css/toggle.d.ts +1 -1
  14. package/base/css/toggle.js +2 -2
  15. package/base/export/pwa-auth.d.ts +4 -4
  16. package/base/export/pwa-auth.js +4 -4
  17. package/base/firebase/authentication.d.ts +10 -10
  18. package/base/firebase/authentication.js +10 -10
  19. package/base/firebase/interface.d.ts +4 -4
  20. package/base/firebase/interface.js +79 -79
  21. package/base/firebase/interface.js.map +1 -1
  22. package/base/redux/backend.d.ts +122 -113
  23. package/base/redux/backend.js +43 -43
  24. package/base/redux/drawer.d.ts +19 -17
  25. package/base/redux/drawer.js +21 -21
  26. package/base/redux/drawer.js.map +1 -1
  27. package/base/redux/frontend.d.ts +171 -159
  28. package/base/redux/frontend.js +67 -67
  29. package/base/redux/frontend.js.map +1 -1
  30. package/base/store.d.ts +60 -60
  31. package/base/store.js +13 -13
  32. package/base/webcomponents/drawer/css/drawer.d.ts +2 -2
  33. package/base/webcomponents/drawer/css/drawer.js +2 -2
  34. package/base/webcomponents/drawer/css/exit.d.ts +2 -2
  35. package/base/webcomponents/drawer/css/exit.js +2 -2
  36. package/base/webcomponents/drawer/css/link.d.ts +2 -2
  37. package/base/webcomponents/drawer/css/link.js +2 -2
  38. package/base/webcomponents/drawer/css/paragraph.d.ts +2 -2
  39. package/base/webcomponents/drawer/css/paragraph.js +2 -2
  40. package/base/webcomponents/drawer/css/toggle.d.ts +2 -2
  41. package/base/webcomponents/drawer/css/toggle.js +2 -2
  42. package/base/webcomponents/drawer/drawer.d.ts +57 -57
  43. package/base/webcomponents/drawer/drawer.js +93 -95
  44. package/base/webcomponents/drawer/drawer.js.map +1 -1
  45. package/base/webcomponents/drawer/input/login.d.ts +19 -19
  46. package/base/webcomponents/drawer/input/login.js +81 -83
  47. package/base/webcomponents/drawer/input/login.js.map +1 -1
  48. package/base/webcomponents/drawer/input/sign-up.d.ts +19 -19
  49. package/base/webcomponents/drawer/input/sign-up.js +88 -90
  50. package/base/webcomponents/drawer/input/sign-up.js.map +1 -1
  51. package/base/webcomponents/icon/css/icon.d.ts +1 -1
  52. package/base/webcomponents/icon/css/icon.js +2 -2
  53. package/base/webcomponents/icon/icon.d.ts +53 -53
  54. package/base/webcomponents/icon/icon.js +57 -59
  55. package/base/webcomponents/icon/icon.js.map +1 -1
  56. package/base/webcomponents/settings/css/navigation.d.ts +1 -1
  57. package/base/webcomponents/settings/css/navigation.js +2 -2
  58. package/base/webcomponents/settings/input/delete.d.ts +54 -54
  59. package/base/webcomponents/settings/input/delete.js +71 -73
  60. package/base/webcomponents/settings/input/delete.js.map +1 -1
  61. package/base/webcomponents/settings/input/email.d.ts +54 -54
  62. package/base/webcomponents/settings/input/email.js +70 -72
  63. package/base/webcomponents/settings/input/email.js.map +1 -1
  64. package/base/webcomponents/settings/input/name.d.ts +53 -53
  65. package/base/webcomponents/settings/input/name.js +65 -67
  66. package/base/webcomponents/settings/input/name.js.map +1 -1
  67. package/base/webcomponents/settings/input/password.d.ts +56 -56
  68. package/base/webcomponents/settings/input/password.js +95 -97
  69. package/base/webcomponents/settings/input/password.js.map +1 -1
  70. package/base/webcomponents/settings/input/uploader.d.ts +57 -57
  71. package/base/webcomponents/settings/input/uploader.js +150 -150
  72. package/base/webcomponents/settings/input/uploader.js.map +1 -1
  73. package/base/webcomponents/settings/settings.d.ts +57 -57
  74. package/base/webcomponents/settings/settings.js +76 -78
  75. package/base/webcomponents/settings/settings.js.map +1 -1
  76. package/export/pwa-auth.ts +5 -4
  77. package/package.json +1 -1
  78. package/source/esm/pwa-auth.js.map +1 -1
  79. package/base/export/auth-helpers.d.ts +0 -1
  80. package/base/export/auth-helpers.js +0 -2
  81. package/base/export/auth-helpers.js.map +0 -1
  82. package/base/redux/object.d.ts +0 -23
  83. package/base/redux/object.js +0 -2
  84. package/base/redux/object.js.map +0 -1
@@ -1,58 +1,43 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { LitElement, css, html } from "lit";
11
- import { property, state } from "lit/decorators.js";
12
- import { connect } from "pwa-helpers";
13
- import { store } from "../../../store";
14
- import { updateProfile } from "firebase/auth";
15
- import { accName } from "../../../redux/backend";
16
- import { auth } from "../../../firebase/authentication";
17
- import { labelStyle } from "../../../css/form/label";
18
- import { inputStyle } from "../../../css/form/input";
19
- import { buttonStyle } from "../../../css/form/button";
20
- export class InputName extends connect(store)(LitElement) {
21
- constructor() {
22
- super();
23
- this.value = '';
24
- this.login = false;
25
- this.default = (e) => {
26
- e.preventDefault();
27
- };
28
- this.alertProfile = async () => {
29
- if (auth.currentUser) {
30
- await updateProfile(auth.currentUser, { displayName: this.value })
31
- .then(() => { store.dispatch(accName(this.value)); })
32
- .then(() => { alert('updated name:' + this.value); });
33
- }
34
- else {
35
- alert('Please Login');
36
- }
37
- };
38
- }
39
- stateChanged(state) {
40
- this.login = state.frontend.login;
41
- this.value = state.backend.name;
42
- }
43
- static get styles() {
44
- return [
45
- labelStyle,
46
- inputStyle,
47
- buttonStyle,
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { LitElement, css, html } from "lit";
11
+ import { property, state } from "lit/decorators.js";
12
+ import { connect } from "pwa-helpers";
13
+ import { store } from "../../../store";
14
+ import { updateProfile } from "firebase/auth";
15
+ import { accName } from "../../../redux/backend";
16
+ import { auth } from "../../../firebase/authentication";
17
+ import { labelStyle } from "../../../css/form/label";
18
+ import { inputStyle } from "../../../css/form/input";
19
+ import { buttonStyle } from "../../../css/form/button";
20
+ export class InputName extends connect(store)(LitElement) {
21
+ value = '';
22
+ login = false;
23
+ constructor() { super(); }
24
+ stateChanged(state) {
25
+ this.login = state.frontend.login;
26
+ this.value = state.backend.name;
27
+ }
28
+ static get styles() {
29
+ return [
30
+ labelStyle,
31
+ inputStyle,
32
+ buttonStyle,
48
33
  css `
49
34
 
50
35
  :host, form { display: grid; }
51
36
 
52
- `
53
- ];
54
- }
55
- render() {
37
+ `
38
+ ];
39
+ }
40
+ render() {
56
41
  return html `
57
42
 
58
43
  <form
@@ -77,20 +62,33 @@ export class InputName extends connect(store)(LitElement) {
77
62
 
78
63
  </form>
79
64
 
80
- `;
81
- }
82
- handleInput(event) {
83
- const input = event.target;
84
- this.value = input.value;
85
- }
86
- }
87
- __decorate([
88
- property({ type: String, reflect: true }),
89
- __metadata("design:type", Object)
90
- ], InputName.prototype, "value", void 0);
91
- __decorate([
92
- state(),
93
- __metadata("design:type", Boolean)
94
- ], InputName.prototype, "login", void 0);
95
- customElements.define('input-name', InputName);
65
+ `;
66
+ }
67
+ default = (e) => {
68
+ e.preventDefault();
69
+ };
70
+ handleInput(event) {
71
+ const input = event.target;
72
+ this.value = input.value;
73
+ }
74
+ alertProfile = async () => {
75
+ if (auth.currentUser) {
76
+ await updateProfile(auth.currentUser, { displayName: this.value })
77
+ .then(() => { store.dispatch(accName(this.value)); })
78
+ .then(() => { alert('updated name:' + this.value); });
79
+ }
80
+ else {
81
+ alert('Please Login');
82
+ }
83
+ };
84
+ }
85
+ __decorate([
86
+ property({ type: String, reflect: true }),
87
+ __metadata("design:type", Object)
88
+ ], InputName.prototype, "value", void 0);
89
+ __decorate([
90
+ state(),
91
+ __metadata("design:type", Boolean)
92
+ ], InputName.prototype, "login", void 0);
93
+ customElements.define('input-name', InputName);
96
94
  //# sourceMappingURL=name.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"name.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/input/name.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAkB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAS,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAiB,aAAa,CAAC;AACjD,OAAO,EAAE,KAAK,EAAY,MAAS,gBAAgB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAW,eAAe,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAiB,wBAAwB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAoB,kCAAkC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,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K,CAAC,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAExD;aAAM;YAAE,KAAK,CAAC,cAAc,CAAC,CAAC;SAAE;IAEnC,CAAC,CAAA;CAKF;AA5EC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;wCAAmB;AAE5D;IAAC,KAAK,EAAE;;wCAAiC;AA4E3C,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC"}
@@ -1,56 +1,56 @@
1
- import { CSSResultArray, LitElement } from "lit";
2
- import { AppState } from "../../../store";
3
- declare const InputPassword_base: (new (...args: any[]) => {
4
- _storeUnsubscribe: import("redux").Unsubscribe;
5
- connectedCallback(): void;
6
- disconnectedCallback(): void;
7
- stateChanged(_state: {
8
- frontend: {
9
- settings: string;
10
- login: boolean;
11
- drawer: boolean;
12
- register: boolean;
13
- userId: string;
14
- customer: string;
15
- profileChoice: string;
16
- name: string;
17
- photoURL: string;
18
- phone: string;
19
- email: string;
20
- };
21
- drawer: {
22
- drawer: boolean;
23
- };
24
- backend: {
25
- verified: boolean;
26
- anon: boolean;
27
- userId: string;
28
- name: string;
29
- email: string;
30
- photoURL: string;
31
- phone: string;
32
- msgToken: string;
33
- };
34
- }): void;
35
- readonly isConnected: boolean;
36
- }) & typeof LitElement;
37
- export declare class InputPassword extends InputPassword_base {
38
- private message;
39
- private password;
40
- private login;
41
- constructor();
42
- protected firstUpdated(): void;
43
- stateChanged(state: AppState): void;
44
- private handleInputChange;
45
- static get styles(): CSSResultArray;
46
- render(): import("lit-html").TemplateResult<1>;
47
- private default;
48
- private alertPassword;
49
- private updatePass;
50
- }
51
- declare global {
52
- interface HTMLElementTagNameMap {
53
- 'input-password': InputPassword;
54
- }
55
- }
56
- export {};
1
+ import { CSSResultArray, LitElement } from "lit";
2
+ import { AppState } from "../../../store";
3
+ declare const InputPassword_base: (new (...args: any[]) => {
4
+ _storeUnsubscribe: import("redux").Unsubscribe;
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ stateChanged(_state: {
8
+ frontend: {
9
+ settings: string;
10
+ login: boolean;
11
+ drawer: boolean;
12
+ register: boolean;
13
+ userId: string;
14
+ customer: string;
15
+ profileChoice: string;
16
+ name: string;
17
+ photoURL: string;
18
+ phone: string;
19
+ email: string;
20
+ };
21
+ drawer: {
22
+ drawer: boolean;
23
+ };
24
+ backend: {
25
+ verified: boolean;
26
+ anon: boolean;
27
+ userId: string;
28
+ name: string;
29
+ email: string;
30
+ photoURL: string;
31
+ phone: string;
32
+ msgToken: string;
33
+ };
34
+ }): void;
35
+ readonly isConnected: boolean;
36
+ }) & typeof LitElement;
37
+ export declare class InputPassword extends InputPassword_base {
38
+ private message;
39
+ private password;
40
+ private login;
41
+ constructor();
42
+ protected firstUpdated(): void;
43
+ stateChanged(state: AppState): void;
44
+ private handleInputChange;
45
+ static get styles(): CSSResultArray;
46
+ render(): import("lit-html").TemplateResult<1>;
47
+ private default;
48
+ private alertPassword;
49
+ private updatePass;
50
+ }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ 'input-password': InputPassword;
54
+ }
55
+ }
56
+ export {};
@@ -1,58 +1,43 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { LitElement, css, html } from "lit";
11
- import { state } from "lit/decorators.js";
12
- import { connect } from "pwa-helpers";
13
- import store from "../../../store";
14
- import { auth } from "../../../firebase/authentication";
15
- import { labelStyle } from "../../../css/form/label";
16
- import { inputStyle } from "../../../css/form/input";
17
- import { buttonStyle } from "../../../css/form/button";
18
- import { updatePassword } from "firebase/auth";
19
- export class InputPassword extends connect(store)(LitElement) {
20
- constructor() {
21
- super();
22
- this.message = '';
23
- this.password = '';
24
- this.login = false;
25
- this.default = (e) => {
26
- e.preventDefault();
27
- };
28
- this.updatePass = async (newPassword) => {
29
- if (auth.currentUser) {
30
- await updatePassword(auth.currentUser, newPassword)
31
- .then(() => { console.log("Password successful!"); })
32
- .catch((error) => { console.log("Problem: " + error.messge); });
33
- }
34
- else {
35
- alert('Please Login');
36
- }
37
- };
38
- }
39
- firstUpdated() {
40
- this.shadowRoot.querySelector('.pass').addEventListener('click', () => {
41
- this.alertPassword();
42
- });
43
- }
44
- stateChanged(state) {
45
- this.login = state.frontend.login;
46
- }
47
- handleInputChange(event) {
48
- const input = event.target;
49
- this.password = input.value;
50
- }
51
- static get styles() {
52
- return [
53
- labelStyle,
54
- inputStyle,
55
- buttonStyle,
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { LitElement, css, html } from "lit";
11
+ import { state } from "lit/decorators.js";
12
+ import { connect } from "pwa-helpers";
13
+ import store from "../../../store";
14
+ import { auth } from "../../../firebase/authentication";
15
+ import { labelStyle } from "../../../css/form/label";
16
+ import { inputStyle } from "../../../css/form/input";
17
+ import { buttonStyle } from "../../../css/form/button";
18
+ import { updatePassword } from "firebase/auth";
19
+ export class InputPassword extends connect(store)(LitElement) {
20
+ message = '';
21
+ password = '';
22
+ login = false;
23
+ constructor() { super(); }
24
+ firstUpdated() {
25
+ this.shadowRoot.querySelector('.pass').addEventListener('click', () => {
26
+ this.alertPassword();
27
+ });
28
+ }
29
+ stateChanged(state) {
30
+ this.login = state.frontend.login;
31
+ }
32
+ handleInputChange(event) {
33
+ const input = event.target;
34
+ this.password = input.value;
35
+ }
36
+ static get styles() {
37
+ return [
38
+ labelStyle,
39
+ inputStyle,
40
+ buttonStyle,
56
41
  css `
57
42
 
58
43
  :host{
@@ -63,10 +48,10 @@ export class InputPassword extends connect(store)(LitElement) {
63
48
 
64
49
  p.error { color: red; }
65
50
 
66
- `
67
- ];
68
- }
69
- render() {
51
+ `
52
+ ];
53
+ }
54
+ render() {
70
55
  return html `
71
56
 
72
57
  <form
@@ -111,42 +96,55 @@ export class InputPassword extends connect(store)(LitElement) {
111
96
 
112
97
  </form>
113
98
 
114
- `;
115
- }
116
- alertPassword() {
117
- if (!this.password) {
118
- this.message = 'Please enter a password';
119
- }
120
- else if (this.password.length < 8) {
121
- this.message = 'Password must be at least 8 characters long';
122
- }
123
- else {
124
- this.message = `Password entered:`;
125
- if (!/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/.test(this.password)) {
126
- this.message = 'Password must include letters, numbers, and be 8+ characters';
127
- }
128
- else {
129
- if (auth.currentUser) {
130
- this.updatePass(this.password);
131
- }
132
- else {
133
- alert('Please Login');
134
- }
135
- }
136
- }
137
- }
138
- }
139
- __decorate([
140
- state(),
141
- __metadata("design:type", String)
142
- ], InputPassword.prototype, "message", void 0);
143
- __decorate([
144
- state(),
145
- __metadata("design:type", String)
146
- ], InputPassword.prototype, "password", void 0);
147
- __decorate([
148
- state(),
149
- __metadata("design:type", Boolean)
150
- ], InputPassword.prototype, "login", void 0);
151
- customElements.define('input-password', InputPassword);
99
+ `;
100
+ }
101
+ default = (e) => {
102
+ e.preventDefault();
103
+ };
104
+ alertPassword() {
105
+ if (!this.password) {
106
+ this.message = 'Please enter a password';
107
+ }
108
+ else if (this.password.length < 8) {
109
+ this.message = 'Password must be at least 8 characters long';
110
+ }
111
+ else {
112
+ this.message = `Password entered:`;
113
+ if (!/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/.test(this.password)) {
114
+ this.message = 'Password must include letters, numbers, and be 8+ characters';
115
+ }
116
+ else {
117
+ if (auth.currentUser) {
118
+ this.updatePass(this.password);
119
+ }
120
+ else {
121
+ alert('Please Login');
122
+ }
123
+ }
124
+ }
125
+ }
126
+ updatePass = async (newPassword) => {
127
+ if (auth.currentUser) {
128
+ await updatePassword(auth.currentUser, newPassword)
129
+ .then(() => { console.log("Password successful!"); })
130
+ .catch((error) => { console.log("Problem: " + error.messge); });
131
+ }
132
+ else {
133
+ alert('Please Login');
134
+ }
135
+ };
136
+ }
137
+ __decorate([
138
+ state(),
139
+ __metadata("design:type", String)
140
+ ], InputPassword.prototype, "message", void 0);
141
+ __decorate([
142
+ state(),
143
+ __metadata("design:type", String)
144
+ ], InputPassword.prototype, "password", void 0);
145
+ __decorate([
146
+ state(),
147
+ __metadata("design:type", Boolean)
148
+ ], InputPassword.prototype, "login", void 0);
149
+ customElements.define('input-password', InputPassword);
152
150
  //# sourceMappingURL=password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password.js","sourceRoot":"","sources":["../../../../typescript/webcomponents/settings/input/password.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAkB,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAiB,mBAAmB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAe,aAAa,CAAC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) => {
4
- _storeUnsubscribe: import("redux").Unsubscribe;
5
- connectedCallback(): void;
6
- disconnectedCallback(): void;
7
- stateChanged(_state: {
8
- frontend: {
9
- settings: string;
10
- login: boolean;
11
- drawer: boolean;
12
- register: boolean;
13
- userId: string;
14
- customer: string;
15
- profileChoice: string;
16
- name: string;
17
- photoURL: string;
18
- phone: string;
19
- email: string;
20
- };
21
- drawer: {
22
- drawer: boolean;
23
- };
24
- backend: {
25
- verified: boolean;
26
- anon: boolean;
27
- userId: string;
28
- name: string;
29
- email: string;
30
- photoURL: string;
31
- phone: string;
32
- msgToken: string;
33
- };
34
- }): void;
35
- readonly isConnected: boolean;
36
- }) & typeof LitElement;
37
- export declare class ContactPhoto extends ContactPhoto_base {
38
- photo: string | void | any;
39
- emptyArtwork: string;
40
- private user;
41
- private login;
42
- private progress;
43
- private error;
44
- private status;
45
- constructor();
46
- stateChanged(state: AppState): void;
47
- static get styles(): CSSResultArray;
48
- protected render(): import("lit-html").TemplateResult<1>;
49
- private saveImage;
50
- private dispatchPhoto;
51
- }
52
- declare global {
53
- interface HTMLElementTagNameMap {
54
- 'contact-photo': ContactPhoto;
55
- }
56
- }
57
- export {};
1
+ import { LitElement, CSSResultArray } from 'lit';
2
+ import { AppState } from '../../../store';
3
+ declare const ContactPhoto_base: (new (...args: any[]) => {
4
+ _storeUnsubscribe: import("redux").Unsubscribe;
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ stateChanged(_state: {
8
+ frontend: {
9
+ settings: string;
10
+ login: boolean;
11
+ drawer: boolean;
12
+ register: boolean;
13
+ userId: string;
14
+ customer: string;
15
+ profileChoice: string;
16
+ name: string;
17
+ photoURL: string;
18
+ phone: string;
19
+ email: string;
20
+ };
21
+ drawer: {
22
+ drawer: boolean;
23
+ };
24
+ backend: {
25
+ verified: boolean;
26
+ anon: boolean;
27
+ userId: string;
28
+ name: string;
29
+ email: string;
30
+ photoURL: string;
31
+ phone: string;
32
+ msgToken: string;
33
+ };
34
+ }): void;
35
+ readonly isConnected: boolean;
36
+ }) & typeof LitElement;
37
+ export declare class ContactPhoto extends ContactPhoto_base {
38
+ photo: string | void | any;
39
+ emptyArtwork: string;
40
+ private user;
41
+ private login;
42
+ private progress;
43
+ private error;
44
+ private status;
45
+ constructor();
46
+ stateChanged(state: AppState): void;
47
+ static get styles(): CSSResultArray;
48
+ protected render(): import("lit-html").TemplateResult<1>;
49
+ private saveImage;
50
+ private dispatchPhoto;
51
+ }
52
+ declare global {
53
+ interface HTMLElementTagNameMap {
54
+ 'contact-photo': ContactPhoto;
55
+ }
56
+ }
57
+ export {};