@ezeep/ezeep-js 1.0.267 → 1.0.269

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 (170) hide show
  1. package/dist/cjs/app-globals-D7ISNeUi.js +16 -0
  2. package/dist/cjs/ezeep.cjs.js +43 -12
  3. package/dist/cjs/ezp-auth_15.cjs.entry.js +27992 -26047
  4. package/dist/cjs/index-dv_gozsq.js +4694 -0
  5. package/dist/cjs/loader.cjs.js +7 -17
  6. package/dist/collection/collection-manifest.json +19 -18
  7. package/dist/collection/components/ezp-auth/ezp-auth.js +266 -245
  8. package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +93 -81
  9. package/dist/collection/components/ezp-dialog/ezp-dialog.js +226 -210
  10. package/dist/collection/components/ezp-icon/ezp-icon.js +117 -102
  11. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +181 -159
  12. package/dist/collection/components/ezp-input/ezp-input.css +5 -5
  13. package/dist/collection/components/ezp-input/ezp-input.js +227 -205
  14. package/dist/collection/components/ezp-label/ezp-label.css +5 -5
  15. package/dist/collection/components/ezp-label/ezp-label.js +151 -132
  16. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +5 -5
  17. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +1134 -1107
  18. package/dist/collection/components/ezp-printing/ezp-printing.css +183 -125
  19. package/dist/collection/components/ezp-printing/ezp-printing.js +872 -807
  20. package/dist/collection/components/ezp-select/ezp-select.css +4 -4
  21. package/dist/collection/components/ezp-select/ezp-select.js +376 -351
  22. package/dist/collection/components/ezp-status/ezp-status.css +5 -5
  23. package/dist/collection/components/ezp-status/ezp-status.js +238 -223
  24. package/dist/collection/components/ezp-stepper/ezp-stepper.css +5 -5
  25. package/dist/collection/components/ezp-stepper/ezp-stepper.js +256 -243
  26. package/dist/collection/components/ezp-text-button/ezp-text-button.js +196 -174
  27. package/dist/collection/components/ezp-upload/ezp-upload.js +134 -141
  28. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +5 -5
  29. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +180 -185
  30. package/dist/collection/services/auth.js +133 -133
  31. package/dist/collection/services/print.js +167 -167
  32. package/dist/collection/services/user.js +16 -16
  33. package/dist/collection/shared/global.js +7 -7
  34. package/dist/collection/types/shared/types.d.ts +1 -0
  35. package/dist/collection/utils/utils.js +89 -89
  36. package/dist/components/auth.js +1 -0
  37. package/dist/components/ezp-auth.d.ts +11 -0
  38. package/dist/components/ezp-auth.js +1 -0
  39. package/dist/components/ezp-auth2.js +1 -0
  40. package/dist/components/ezp-backdrop.d.ts +11 -0
  41. package/dist/components/ezp-backdrop.js +1 -0
  42. package/dist/components/ezp-backdrop2.js +1 -0
  43. package/dist/components/ezp-dialog.d.ts +11 -0
  44. package/dist/components/ezp-dialog.js +1 -0
  45. package/dist/components/ezp-dialog2.js +1 -0
  46. package/dist/components/ezp-icon-button.d.ts +11 -0
  47. package/dist/components/ezp-icon-button.js +1 -0
  48. package/dist/components/ezp-icon-button2.js +1 -0
  49. package/dist/components/ezp-icon.d.ts +11 -0
  50. package/dist/components/ezp-icon.js +1 -0
  51. package/dist/components/ezp-icon2.js +1 -0
  52. package/dist/components/ezp-input.d.ts +11 -0
  53. package/dist/components/ezp-input.js +1 -0
  54. package/dist/components/ezp-input2.js +1 -0
  55. package/dist/components/ezp-label.d.ts +11 -0
  56. package/dist/components/ezp-label.js +1 -0
  57. package/dist/components/ezp-label2.js +1 -0
  58. package/dist/components/ezp-printer-selection.d.ts +11 -0
  59. package/dist/components/ezp-printer-selection.js +1 -0
  60. package/dist/components/ezp-printer-selection2.js +1 -0
  61. package/dist/components/ezp-printing.d.ts +11 -0
  62. package/dist/components/ezp-printing.js +1 -0
  63. package/dist/components/ezp-select.d.ts +11 -0
  64. package/dist/components/ezp-select.js +1 -0
  65. package/dist/components/ezp-select2.js +1 -0
  66. package/dist/components/ezp-status.d.ts +11 -0
  67. package/dist/components/ezp-status.js +1 -0
  68. package/dist/components/ezp-status2.js +1 -0
  69. package/dist/components/ezp-stepper.d.ts +11 -0
  70. package/dist/components/ezp-stepper.js +1 -0
  71. package/dist/components/ezp-stepper2.js +1 -0
  72. package/dist/components/ezp-text-button.d.ts +11 -0
  73. package/dist/components/ezp-text-button.js +1 -0
  74. package/dist/components/ezp-text-button2.js +1 -0
  75. package/dist/components/ezp-upload.d.ts +11 -0
  76. package/dist/components/ezp-upload.js +1 -0
  77. package/dist/components/ezp-upload2.js +1 -0
  78. package/dist/components/ezp-user-menu.d.ts +11 -0
  79. package/dist/components/ezp-user-menu.js +1 -0
  80. package/dist/components/ezp-user-menu2.js +1 -0
  81. package/dist/components/i18next.js +1 -0
  82. package/dist/components/index.d.ts +35 -0
  83. package/dist/components/index.js +1 -0
  84. package/dist/directives/angular-component-lib/utils.ts +33 -14
  85. package/dist/directives/proxies.ts +231 -111
  86. package/dist/esm/app-globals-CpP67t2l.js +14 -0
  87. package/dist/esm/ezeep.js +41 -12
  88. package/dist/esm/ezp-auth_15.entry.js +27996 -26049
  89. package/dist/esm/index-BTfWEHH9.js +4677 -0
  90. package/dist/esm/loader.js +7 -15
  91. package/dist/esm-es5/app-globals-CpP67t2l.js +1 -0
  92. package/dist/esm-es5/ezeep.js +1 -1
  93. package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
  94. package/dist/esm-es5/index-BTfWEHH9.js +13 -0
  95. package/dist/esm-es5/loader.js +1 -1
  96. package/dist/ezeep/ezeep.esm.js +1 -1
  97. package/dist/ezeep/ezeep.js +16 -19
  98. package/dist/ezeep/p-2177b8f4.system.entry.js +7 -0
  99. package/dist/ezeep/p-5ok9OZMg.system.js +1 -0
  100. package/dist/ezeep/p-BTfWEHH9.js +2 -0
  101. package/dist/ezeep/p-CfQRcOh8.system.js +1 -0
  102. package/dist/ezeep/p-CpP67t2l.js +1 -0
  103. package/dist/ezeep/p-DhXN1yGM.system.js +13 -0
  104. package/dist/ezeep/p-de8f6583.entry.js +1 -0
  105. package/dist/ezeep/types/shared/types.d.ts +1 -0
  106. package/dist/types/components/ezp-auth/ezp-auth.d.ts +20 -20
  107. package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +7 -7
  108. package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +38 -38
  109. package/dist/types/components/ezp-icon/ezp-icon.d.ts +24 -24
  110. package/dist/types/components/ezp-icon-button/ezp-icon-button.d.ts +23 -23
  111. package/dist/types/components/ezp-input/ezp-input.d.ts +38 -38
  112. package/dist/types/components/ezp-label/ezp-label.d.ts +21 -21
  113. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +116 -116
  114. package/dist/types/components/ezp-printing/ezp-printing.d.ts +83 -83
  115. package/dist/types/components/ezp-select/ezp-select.d.ts +80 -80
  116. package/dist/types/components/ezp-status/ezp-status.d.ts +40 -40
  117. package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +65 -65
  118. package/dist/types/components/ezp-text-button/ezp-text-button.d.ts +25 -25
  119. package/dist/types/components/ezp-upload/ezp-upload.d.ts +38 -38
  120. package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +43 -43
  121. package/dist/types/components.d.ts +493 -50
  122. package/dist/types/services/auth.d.ts +27 -27
  123. package/dist/types/services/print.d.ts +32 -32
  124. package/dist/types/services/user.d.ts +4 -4
  125. package/dist/types/shared/types.d.ts +1 -0
  126. package/dist/types/stencil-public-runtime.d.ts +335 -40
  127. package/dist/types/utils/utils.d.ts +6 -6
  128. package/loader/cdn.js +1 -2
  129. package/loader/index.cjs.js +1 -2
  130. package/loader/index.d.ts +13 -1
  131. package/loader/index.es2017.js +1 -2
  132. package/loader/index.js +1 -2
  133. package/package.json +10 -10
  134. package/www/build/ezeep.esm.js +1 -1
  135. package/www/build/ezeep.js +16 -19
  136. package/www/build/p-2177b8f4.system.entry.js +7 -0
  137. package/www/build/p-256870db.js +1 -0
  138. package/www/build/p-5ok9OZMg.system.js +1 -0
  139. package/www/build/p-BTfWEHH9.js +2 -0
  140. package/www/build/p-CfQRcOh8.system.js +1 -0
  141. package/www/build/p-CpP67t2l.js +1 -0
  142. package/www/build/p-DhXN1yGM.system.js +13 -0
  143. package/www/build/p-de8f6583.entry.js +1 -0
  144. package/www/index.html +1 -1
  145. package/dist/cjs/app-globals-53afb196.js +0 -15
  146. package/dist/cjs/index-1f953145.js +0 -1482
  147. package/dist/custom-elements/index.d.ts +0 -129
  148. package/dist/custom-elements/index.js +0 -34555
  149. package/dist/esm/app-globals-28960cbc.js +0 -13
  150. package/dist/esm/index-3ac1b749.js +0 -1450
  151. package/dist/esm/polyfills/css-shim.js +0 -1
  152. package/dist/esm-es5/app-globals-28960cbc.js +0 -1
  153. package/dist/esm-es5/index-3ac1b749.js +0 -1
  154. package/dist/ezeep/p-0cc2026d.system.js +0 -1
  155. package/dist/ezeep/p-312f40d7.js +0 -1
  156. package/dist/ezeep/p-4a7d6c3a.system.entry.js +0 -7
  157. package/dist/ezeep/p-84bd195a.system.js +0 -1
  158. package/dist/ezeep/p-a4d37138.js +0 -1
  159. package/dist/ezeep/p-ded04529.system.js +0 -1
  160. package/dist/ezeep/p-e20ee337.entry.js +0 -1
  161. package/loader/package.json +0 -10
  162. package/www/build/p-0cc2026d.system.js +0 -1
  163. package/www/build/p-312f40d7.js +0 -1
  164. package/www/build/p-4a7d6c3a.system.entry.js +0 -7
  165. package/www/build/p-84bd195a.system.js +0 -1
  166. package/www/build/p-a4d37138.js +0 -1
  167. package/www/build/p-ded04529.system.js +0 -1
  168. package/www/build/p-e20ee337.entry.js +0 -1
  169. /package/dist/ezeep/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
  170. /package/www/build/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
@@ -1,795 +1,802 @@
1
- import { Component, Host, Listen, Event, State, h, Prop, Fragment, } from '@stencil/core';
2
- import i18next from 'i18next';
3
- import authStore from '../../services/auth';
4
- import printStore, { EzpPrintService } from '../../services/print';
5
- import userStore, { EzpUserService } from '../../services/user';
6
- import { managePaperDimensions, poll, removeEmptyStrings } from '../../utils/utils';
7
- import { PAPER_ID, validatePageRange, formatPageRange } from '../../utils/utils';
1
+ import { Host, h, Fragment, } from "@stencil/core";
2
+ import i18next from "i18next";
3
+ import authStore from "../../services/auth";
4
+ import printStore, { EzpPrintService } from "../../services/print";
5
+ import userStore, { EzpUserService } from "../../services/user";
6
+ import { managePaperDimensions, poll, removeEmptyStrings } from "../../utils/utils";
7
+ import { PAPER_ID, validatePageRange, formatPageRange } from "../../utils/utils";
8
8
  export class EzpPrinterSelection {
9
- constructor() {
10
- this.fileExtension = '';
11
- this.duplexOptions = [
12
- {
13
- id: 1,
14
- title: i18next.t('printer_selection.duplex_none'),
15
- },
16
- {
17
- id: 2,
18
- title: i18next.t('printer_selection.duplex_long'),
19
- },
20
- {
21
- id: 3,
22
- title: i18next.t('printer_selection.duplex_short'),
23
- },
24
- ];
25
- this.ColorOptions = [
26
- {
27
- id: 1,
28
- title: i18next.t('printer_selection.color_color'),
29
- },
30
- {
31
- id: 2,
32
- title: i18next.t('printer_selection.color_grayscale'),
33
- },
34
- ];
35
- this.hidemenu = false;
36
- this.hideheader = false;
37
- /**
38
- *
39
- * States
40
- *
41
- */
42
- this.loading = true;
43
- this.printProcessing = false;
44
- this.pageRangeInvalid = false;
45
- this.uploading = false;
46
- this.preparingUpload = false;
47
- this.printSuccess = false;
48
- this.printFailed = false;
49
- this.notSupported = false;
50
- this.noPrinters = false;
51
- this.hubDriverError = false;
52
- this.userMenuOpen = false;
53
- this.printStopped = false;
54
- this.selectedPrinterConfig = {
55
- Default: {
56
- Color: '',
57
- Duplex: '',
58
- Paper: '',
59
- Orientation: '',
60
- Resolution: '',
61
- Tray: '',
62
- },
63
- OrientationsSupported: [],
64
- PaperFormats: [],
65
- Resolutions: [],
66
- DuplexSupported: false,
67
- Color: false,
68
- Trays: [],
69
- };
70
- // needs to be initialised with empty strings
71
- this.selectedProperties = {
72
- paper: '',
73
- paperid: '',
74
- color: false,
75
- duplex: true,
76
- duplexmode: 1,
77
- orientation: 1,
78
- copies: '',
79
- resolution: 0,
80
- paperlength: 0,
81
- paperwidth: 0,
82
- defaultSource: '',
83
- trayname: '',
84
- PageRanges: '',
85
- };
86
- this.currentFileIndex = 0;
87
- this.totalFiles = 0;
88
- this.failedFiles = [];
89
- this.successfulFiles = [];
90
- this.partialSuccess = false;
91
- /**
92
- *
93
- * Private methods
94
- *
95
- */
96
- /** Description... */
97
- this.handleCancel = () => {
98
- this.failedFiles = [];
99
- this.successfulFiles = [];
100
- this.partialSuccess = false;
101
- this.hubDriverError = false;
102
- this.printCancel.emit();
103
- };
104
- this.validateData = (data) => {
105
- console.log('[validateData] Checking data:', data);
106
- const { jobstatus } = data;
107
- // Define status handlers
108
- const statusHandlers = {
109
- 0: () => {
110
- // Success
111
- this.printSuccess = true;
112
- this.printProcessing = false;
113
- return true;
114
- },
115
- 1246: () => false,
116
- 129: () => false,
117
- 3011: () => {
118
- // Failure
119
- this.printFailed = true;
120
- this.printProcessing = false;
121
- return true;
122
- },
123
- 2: () => {
124
- // Failure
125
- this.printFailed = true;
126
- this.printProcessing = false;
127
- return true;
128
- },
129
- };
130
- // Check for hub printer driver errors
131
- const hubDriverErrorCodes = [412, 500, 503, 1048579];
132
- if (hubDriverErrorCodes.includes(jobstatus) && this.selectedPrinter.is_queue) {
133
- this.hubDriverError = true;
9
+ constructor() {
10
+ this.fileExtension = '';
11
+ this.duplexOptions = [
12
+ {
13
+ id: 1,
14
+ title: i18next.t('printer_selection.duplex_none'),
15
+ },
16
+ {
17
+ id: 2,
18
+ title: i18next.t('printer_selection.duplex_long'),
19
+ },
20
+ {
21
+ id: 3,
22
+ title: i18next.t('printer_selection.duplex_short'),
23
+ },
24
+ ];
25
+ this.ColorOptions = [
26
+ {
27
+ id: 1,
28
+ title: i18next.t('printer_selection.color_color'),
29
+ },
30
+ {
31
+ id: 2,
32
+ title: i18next.t('printer_selection.color_grayscale'),
33
+ },
34
+ ];
35
+ this.hidemenu = false;
36
+ this.hideheader = false;
37
+ /**
38
+ *
39
+ * States
40
+ *
41
+ */
42
+ this.loading = true;
134
43
  this.printProcessing = false;
135
- return true;
136
- }
137
- // Use handler if exists, otherwise treat as failure
138
- const handler = statusHandlers[jobstatus];
139
- if (handler) {
140
- return handler();
141
- }
142
- // Unknown status, treat as failure for safety
143
- this.printFailed = true;
144
- this.printProcessing = false;
145
- return true;
146
- };
147
- this.POLL_INTERVAL = 2000;
148
- this.MAX_POLL_ATTEMPTS = Infinity;
149
- this.HUB_TIMEOUT = 30000; // 30 seconds timeout for hub printers
150
- /** Description... */
151
- this.handlePrint = async () => {
152
- this.printButton.blur();
153
- this.printProcessing = true;
154
- this.failedFiles = [];
155
- this.successfulFiles = [];
156
- this.partialSuccess = false;
157
- this.hubDriverError = false;
158
- // Set up timeout for hub printers to prevent infinite loading
159
- let hubTimeout;
160
- if (this.selectedPrinter.is_queue) {
161
- hubTimeout = setTimeout(() => {
162
- console.log('[handlePrint] Hub printer timeout reached, setting driver error');
163
- this.hubDriverError = true;
164
- this.printProcessing = false;
165
- }, this.HUB_TIMEOUT);
166
- }
167
- // we have to initialse this obj with empty strings to display the select component
168
- // but don't want to send any attributes with empty strings to the API
169
- if (this.selectedPrinterConfig.Trays &&
170
- this.selectedPrinterConfig.Trays.length >= 0 &&
171
- this.selectedPrinterConfig.Trays[0] == null) {
172
- delete this.selectedProperties.trayname;
173
- delete this.selectedProperties.defaultSource;
174
- }
175
- let cleanPrintProperties = removeEmptyStrings(this.selectedProperties);
176
- cleanPrintProperties = managePaperDimensions(cleanPrintProperties);
177
- if (cleanPrintProperties.PageRanges)
178
- cleanPrintProperties.PageRanges = formatPageRange(cleanPrintProperties.PageRanges);
179
- // put it in store for further use
180
- printStore.state.fileUrl = this.fileurl;
181
- printStore.state.fileID = this.fileid;
182
- printStore.state.fileType = this.filetype;
183
- printStore.state.printerID = this.selectedPrinter.id;
184
- printStore.state.printerProperties = this.selectedProperties;
185
- printStore.state.fileName = this.filename;
186
- if (this.fileurl) {
187
- this.printService
188
- .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
189
- .then((response) => {
190
- if (response.status === 200 && this.selectedPrinter.is_queue) {
191
- this.printProcessing = false;
192
- this.printSuccess = true;
193
- if (hubTimeout)
194
- clearTimeout(hubTimeout);
195
- }
196
- if (response.status === 412) {
197
- response.json().then((data) => (this.fileid = data.fileid));
198
- this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
199
- }
200
- else {
201
- return response.json();
202
- }
203
- })
204
- .then((data) => {
205
- if (data.code === 804) {
44
+ this.pageRangeInvalid = false;
45
+ this.uploading = false;
46
+ this.preparingUpload = false;
47
+ this.printSuccess = false;
48
+ this.printFailed = false;
49
+ this.notSupported = false;
50
+ this.noPrinters = false;
51
+ this.hubDriverError = false;
52
+ this.userMenuOpen = false;
53
+ this.printStopped = false;
54
+ this.selectedPrinterConfig = {
55
+ Default: {
56
+ Color: '',
57
+ Duplex: '',
58
+ Paper: '',
59
+ Orientation: '',
60
+ Resolution: '',
61
+ Tray: '',
62
+ },
63
+ OrientationsSupported: [],
64
+ PaperFormats: [],
65
+ Resolutions: [],
66
+ DuplexSupported: false,
67
+ Color: false,
68
+ Trays: [],
69
+ };
70
+ // needs to be initialised with empty strings
71
+ this.selectedProperties = {
72
+ paper: '',
73
+ paperid: '',
74
+ color: false,
75
+ duplex: true,
76
+ duplexmode: 1,
77
+ orientation: 1,
78
+ copies: '',
79
+ resolution: 0,
80
+ paperlength: 0,
81
+ paperwidth: 0,
82
+ defaultSource: '',
83
+ trayname: '',
84
+ PageRanges: '',
85
+ };
86
+ this.currentFileIndex = 0;
87
+ this.totalFiles = 0;
88
+ this.failedFiles = [];
89
+ this.successfulFiles = [];
90
+ this.partialSuccess = false;
91
+ /**
92
+ *
93
+ * Private methods
94
+ *
95
+ */
96
+ /** Description... */
97
+ this.handleCancel = () => {
98
+ this.failedFiles = [];
99
+ this.successfulFiles = [];
100
+ this.partialSuccess = false;
101
+ this.hubDriverError = false;
102
+ this.printCancel.emit();
103
+ };
104
+ this.validateData = (data) => {
105
+ console.log('[validateData] Checking data:', data);
106
+ const { jobstatus } = data;
107
+ // Define status handlers
108
+ const statusHandlers = {
109
+ 0: () => {
110
+ // Success
111
+ this.printSuccess = true;
112
+ this.printProcessing = false;
113
+ return true;
114
+ },
115
+ 1246: () => false, // Still processing
116
+ 129: () => false, // Still processing
117
+ 3011: () => {
118
+ // Failure
119
+ this.printFailed = true;
120
+ this.printProcessing = false;
121
+ return true;
122
+ },
123
+ 2: () => {
124
+ // Failure
125
+ this.printFailed = true;
126
+ this.printProcessing = false;
127
+ return true;
128
+ },
129
+ };
130
+ // Check for hub printer driver errors
131
+ const hubDriverErrorCodes = [412, 500, 503, 1048579];
132
+ if (hubDriverErrorCodes.includes(jobstatus) && this.selectedPrinter.is_queue) {
133
+ this.hubDriverError = true;
134
+ this.printProcessing = false;
135
+ return true;
136
+ }
137
+ // Use handler if exists, otherwise treat as failure
138
+ const handler = statusHandlers[jobstatus];
139
+ if (handler) {
140
+ return handler();
141
+ }
142
+ // Unknown status, treat as failure for safety
206
143
  this.printFailed = true;
207
144
  this.printProcessing = false;
208
- if (hubTimeout)
209
- clearTimeout(hubTimeout);
210
- }
211
- else if (this.selectedPrinter.is_queue &&
212
- (data.code === 412 || data.code === 500 || data.code === 503 || data.code === 1048579)) {
213
- // Hub printer specific errors - likely driver not assigned
214
- console.log('[handlePrint] Hub printer driver error detected:', data);
215
- this.hubDriverError = true;
216
- this.printProcessing = false;
217
- if (hubTimeout)
218
- clearTimeout(hubTimeout);
219
- }
220
- else if (data.jobid) {
221
- printStore.state.jobID = data.jobid;
222
- poll({
223
- fn: this.printService.getPrintStatus,
224
- validate: this.validateData,
225
- interval: this.POLL_INTERVAL,
226
- maxAttempts: this.MAX_POLL_ATTEMPTS,
227
- }).catch((err) => {
228
- console.warn('[handlePrint] Polling error:', err);
229
- // Check if this is a hub printer and the error might be driver-related
230
- if (this.selectedPrinter.is_queue) {
231
- this.hubDriverError = true;
232
- }
233
- else {
234
- this.printFailed = true;
235
- }
236
- this.printProcessing = false;
237
- if (hubTimeout)
238
- clearTimeout(hubTimeout);
239
- });
240
- }
241
- else {
242
- // No job ID returned - check if it's a hub printer
145
+ return true;
146
+ };
147
+ this.POLL_INTERVAL = 2000;
148
+ this.MAX_POLL_ATTEMPTS = Infinity;
149
+ this.HUB_TIMEOUT = 30000; // 30 seconds timeout for hub printers
150
+ /** Description... */
151
+ this.handlePrint = async () => {
152
+ this.printButton.blur();
153
+ this.printProcessing = true;
154
+ this.failedFiles = [];
155
+ this.successfulFiles = [];
156
+ this.partialSuccess = false;
157
+ this.hubDriverError = false;
158
+ // Set up timeout for hub printers to prevent infinite loading
159
+ let hubTimeout;
243
160
  if (this.selectedPrinter.is_queue) {
244
- this.hubDriverError = true;
161
+ hubTimeout = setTimeout(() => {
162
+ console.log('[handlePrint] Hub printer timeout reached, setting driver error');
163
+ this.hubDriverError = true;
164
+ this.printProcessing = false;
165
+ }, this.HUB_TIMEOUT);
245
166
  }
246
- else {
247
- this.printFailed = true;
167
+ // we have to initialse this obj with empty strings to display the select component
168
+ // but don't want to send any attributes with empty strings to the API
169
+ if (this.selectedPrinterConfig.Trays &&
170
+ this.selectedPrinterConfig.Trays.length >= 0 &&
171
+ this.selectedPrinterConfig.Trays[0] == null) {
172
+ delete this.selectedProperties.trayname;
173
+ delete this.selectedProperties.defaultSource;
174
+ }
175
+ let cleanPrintProperties = removeEmptyStrings(this.selectedProperties);
176
+ cleanPrintProperties = managePaperDimensions(cleanPrintProperties);
177
+ if (cleanPrintProperties.PageRanges)
178
+ cleanPrintProperties.PageRanges = formatPageRange(cleanPrintProperties.PageRanges);
179
+ // put it in store for further use
180
+ printStore.state.fileUrl = this.fileurl;
181
+ printStore.state.fileID = this.fileid;
182
+ printStore.state.fileType = this.filetype;
183
+ printStore.state.printerID = this.selectedPrinter.id;
184
+ printStore.state.printerProperties = this.selectedProperties;
185
+ printStore.state.fileName = this.filename;
186
+ if (this.fileurl) {
187
+ this.printService
188
+ .printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
189
+ .then((response) => {
190
+ if (response.status === 200 && this.selectedPrinter.is_queue) {
191
+ this.printProcessing = false;
192
+ this.printSuccess = true;
193
+ if (hubTimeout)
194
+ clearTimeout(hubTimeout);
195
+ }
196
+ if (response.status === 412) {
197
+ response.json().then((data) => (this.fileid = data.fileid));
198
+ this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
199
+ }
200
+ else {
201
+ return response.json();
202
+ }
203
+ })
204
+ .then((data) => {
205
+ if (data.code === 804) {
206
+ this.printFailed = true;
207
+ this.printProcessing = false;
208
+ if (hubTimeout)
209
+ clearTimeout(hubTimeout);
210
+ }
211
+ else if (this.selectedPrinter.is_queue &&
212
+ (data.code === 412 || data.code === 500 || data.code === 503 || data.code === 1048579)) {
213
+ // Hub printer specific errors - likely driver not assigned
214
+ console.log('[handlePrint] Hub printer driver error detected:', data);
215
+ this.hubDriverError = true;
216
+ this.printProcessing = false;
217
+ if (hubTimeout)
218
+ clearTimeout(hubTimeout);
219
+ }
220
+ else if (data.jobid) {
221
+ printStore.state.jobID = data.jobid;
222
+ poll({
223
+ fn: this.printService.getPrintStatus,
224
+ validate: this.validateData,
225
+ interval: this.POLL_INTERVAL,
226
+ maxAttempts: this.MAX_POLL_ATTEMPTS,
227
+ }).catch((err) => {
228
+ console.warn('[handlePrint] Polling error:', err);
229
+ // Check if this is a hub printer and the error might be driver-related
230
+ if (this.selectedPrinter.is_queue) {
231
+ this.hubDriverError = true;
232
+ }
233
+ else {
234
+ this.printFailed = true;
235
+ }
236
+ this.printProcessing = false;
237
+ if (hubTimeout)
238
+ clearTimeout(hubTimeout);
239
+ });
240
+ }
241
+ else {
242
+ // No job ID returned - check if it's a hub printer
243
+ if (this.selectedPrinter.is_queue) {
244
+ this.hubDriverError = true;
245
+ }
246
+ else {
247
+ this.printFailed = true;
248
+ }
249
+ this.printProcessing = false;
250
+ if (hubTimeout)
251
+ clearTimeout(hubTimeout);
252
+ }
253
+ })
254
+ .catch((error) => {
255
+ console.log('[handlePrint] Error caught:', error);
256
+ // Check if this is a hub printer and the error might be driver-related
257
+ if (this.selectedPrinter.is_queue) {
258
+ this.hubDriverError = true;
259
+ }
260
+ else {
261
+ this.printFailed = true;
262
+ }
263
+ this.printProcessing = false;
264
+ if (hubTimeout)
265
+ clearTimeout(hubTimeout);
266
+ });
267
+ }
268
+ else if (this.files && this.files.length > 1) {
269
+ await this.processMultipleFiles(this.files, cleanPrintProperties);
270
+ if (hubTimeout)
271
+ clearTimeout(hubTimeout);
248
272
  }
273
+ else if (this.files && this.files.length === 1) {
274
+ // --- Begin: Consistent single file handling ---
275
+ this.totalFiles = 1;
276
+ this.currentFileIndex = 0;
277
+ this.failedFiles = [];
278
+ this.successfulFiles = [];
279
+ try {
280
+ await this.processSingleFile(this.files[0], cleanPrintProperties);
281
+ this.successfulFiles.push(this.files[0].name);
282
+ this.printSuccess = true;
283
+ this.partialSuccess = false;
284
+ this.printProcessing = false;
285
+ }
286
+ catch (error) {
287
+ console.error(`Error processing file ${this.files[0].name}:`, error);
288
+ this.failedFiles.push(this.files[0].name);
289
+ this.printFailed = true;
290
+ this.partialSuccess = false;
291
+ this.printProcessing = false;
292
+ // Check if this is a hub driver error
293
+ if (error.message && error.message.includes('Hub printer driver error')) {
294
+ this.hubDriverError = true;
295
+ }
296
+ }
297
+ if (hubTimeout)
298
+ clearTimeout(hubTimeout);
299
+ // --- End: Consistent single file handling ---
300
+ }
301
+ localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
302
+ localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
303
+ this.printStopped = false;
304
+ };
305
+ this.handleUserMenu = () => {
306
+ this.userMenuOpen = true;
307
+ };
308
+ this.validateFileType = async (name) => {
309
+ const extension = name.split('.').pop();
310
+ this.fileExtension = extension.toLowerCase();
311
+ return printStore.state.supportedFileExtensions.includes(`${this.fileExtension}`);
312
+ };
313
+ }
314
+ /**
315
+ *
316
+ * Listeners
317
+ *
318
+ */
319
+ listenInputValueChanged(event) {
320
+ this.setSelectedProperties(event.detail);
321
+ }
322
+ listenSelectSelection(event) {
323
+ this.setSelectedProperties(event.detail);
324
+ }
325
+ listenStepperChanged(event) {
326
+ this.selectedProperties.copies = event.detail;
327
+ }
328
+ listenUserMenuClosure() {
329
+ this.userMenuOpen = false;
330
+ }
331
+ listenLogout() {
332
+ this.printCancel.emit();
333
+ this.logout.emit();
334
+ }
335
+ listenStatusCancel(event) {
336
+ if (event.detail === 'print-processing') {
337
+ this.printStopped = true;
249
338
  this.printProcessing = false;
250
- if (hubTimeout)
251
- clearTimeout(hubTimeout);
252
- }
253
- })
254
- .catch((error) => {
255
- console.log('[handlePrint] Error caught:', error);
256
- // Check if this is a hub printer and the error might be driver-related
257
- if (this.selectedPrinter.is_queue) {
258
- this.hubDriverError = true;
259
- }
260
- else {
261
- this.printFailed = true;
262
- }
263
- this.printProcessing = false;
264
- if (hubTimeout)
265
- clearTimeout(hubTimeout);
266
- });
267
- }
268
- else if (this.files && this.files.length > 1) {
269
- await this.processMultipleFiles(this.files, cleanPrintProperties);
270
- if (hubTimeout)
271
- clearTimeout(hubTimeout);
272
- }
273
- else if (this.files && this.files.length === 1) {
274
- // --- Begin: Consistent single file handling ---
275
- this.totalFiles = 1;
276
- this.currentFileIndex = 0;
277
- this.failedFiles = [];
278
- this.successfulFiles = [];
279
- try {
280
- await this.processSingleFile(this.files[0], cleanPrintProperties);
281
- this.successfulFiles.push(this.files[0].name);
282
- this.printSuccess = true;
283
- this.partialSuccess = false;
284
- this.printProcessing = false;
339
+ // Abort the print request
340
+ this.printService.abortPrint();
285
341
  }
286
- catch (error) {
287
- console.error(`Error processing file ${this.files[0].name}:`, error);
288
- this.failedFiles.push(this.files[0].name);
289
- this.printFailed = true;
290
- this.partialSuccess = false;
291
- this.printProcessing = false;
292
- // Check if this is a hub driver error
293
- if (error.message && error.message.includes('Hub printer driver error')) {
294
- this.hubDriverError = true;
295
- }
342
+ }
343
+ listenStatusClose(event) {
344
+ switch (event.detail) {
345
+ case 'print-success':
346
+ this.printSuccess = false;
347
+ this.partialSuccess = false;
348
+ this.failedFiles = [];
349
+ this.successfulFiles = [];
350
+ this.printCancel.emit();
351
+ break;
352
+ case 'print-failed':
353
+ this.printFailed = false;
354
+ break;
355
+ case 'hub-driver-error':
356
+ this.hubDriverError = false;
357
+ break;
358
+ case 'not-supported':
359
+ this.noPrinters = false;
360
+ break;
361
+ case 'no-printers':
362
+ this.noPrinters = false;
363
+ this.printCancel.emit();
364
+ break;
296
365
  }
297
- if (hubTimeout)
298
- clearTimeout(hubTimeout);
299
- // --- End: Consistent single file handling ---
300
- }
301
- localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
302
- localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
303
- this.printStopped = false;
304
- };
305
- this.handleUserMenu = () => {
306
- this.userMenuOpen = true;
307
- };
308
- this.validateFileType = async (name) => {
309
- const extension = name.split('.').pop();
310
- this.fileExtension = extension.toLowerCase();
311
- return printStore.state.supportedFileExtensions.includes(`${this.fileExtension}`);
312
- };
313
- }
314
- /**
315
- *
316
- * Listeners
317
- *
318
- */
319
- listenInputValueChanged(event) {
320
- this.setSelectedProperties(event.detail);
321
- }
322
- listenSelectSelection(event) {
323
- this.setSelectedProperties(event.detail);
324
- }
325
- listenStepperChanged(event) {
326
- this.selectedProperties.copies = event.detail;
327
- }
328
- listenUserMenuClosure() {
329
- this.userMenuOpen = false;
330
- }
331
- listenLogout() {
332
- this.printCancel.emit();
333
- this.logout.emit();
334
- }
335
- listenStatusCancel(event) {
336
- if (event.detail === 'print-processing') {
337
- this.printStopped = true;
338
- this.printProcessing = false;
339
- // Abort the print request
340
- this.printService.abortPrint();
341
366
  }
342
- }
343
- listenStatusClose(event) {
344
- switch (event.detail) {
345
- case 'print-success':
346
- this.printSuccess = false;
347
- this.partialSuccess = false;
348
- this.failedFiles = [];
349
- this.successfulFiles = [];
350
- this.printCancel.emit();
351
- break;
352
- case 'print-failed':
353
- this.printFailed = false;
354
- break;
355
- case 'hub-driver-error':
356
- this.hubDriverError = false;
357
- break;
358
- case 'not-supported':
359
- this.noPrinters = false;
360
- break;
361
- case 'no-printers':
362
- this.noPrinters = false;
363
- this.printCancel.emit();
364
- break;
367
+ listenStatusRetry(event) {
368
+ switch (event.detail) {
369
+ case 'not-supported':
370
+ this.printCancel.emit();
371
+ break;
372
+ case 'print-failed':
373
+ this.printFailed = false;
374
+ this.printProcessing = false;
375
+ this.handlePrint();
376
+ break;
377
+ case 'hub-driver-error':
378
+ this.hubDriverError = false;
379
+ this.printProcessing = false;
380
+ this.handlePrint();
381
+ break;
382
+ }
365
383
  }
366
- }
367
- listenStatusRetry(event) {
368
- switch (event.detail) {
369
- case 'not-supported':
370
- this.printCancel.emit();
371
- break;
372
- case 'print-failed':
373
- this.printFailed = false;
374
- this.printProcessing = false;
375
- this.handlePrint();
376
- break;
377
- case 'hub-driver-error':
378
- this.hubDriverError = false;
379
- this.printProcessing = false;
380
- this.handlePrint();
381
- break;
384
+ getPropertiesFromLocalStorage() {
385
+ if (localStorage.getItem('properties')) {
386
+ this.selectedProperties = JSON.parse(localStorage.getItem('properties'));
387
+ }
388
+ if (localStorage.getItem('printer')) {
389
+ const savedPrinter = JSON.parse(localStorage.getItem('printer'));
390
+ if (this.printers.some((printer) => printer.id === savedPrinter.id)) {
391
+ this.selectedPrinter = savedPrinter;
392
+ }
393
+ else {
394
+ this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
395
+ localStorage.removeItem('printer');
396
+ localStorage.removeItem('properties');
397
+ }
398
+ }
399
+ else {
400
+ this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
401
+ }
402
+ this.setPaperid();
382
403
  }
383
- }
384
- getPropertiesFromLocalStorage() {
385
- if (localStorage.getItem('properties')) {
386
- this.selectedProperties = JSON.parse(localStorage.getItem('properties'));
404
+ setPaperid() {
405
+ this.paperid = this.selectedProperties.paperid;
387
406
  }
388
- if (localStorage.getItem('printer')) {
389
- const savedPrinter = JSON.parse(localStorage.getItem('printer'));
390
- if (this.printers.some((printer) => printer.id === savedPrinter.id)) {
391
- this.selectedPrinter = savedPrinter;
392
- }
393
- else {
394
- this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
395
- localStorage.removeItem('printer');
396
- localStorage.removeItem('properties');
397
- }
407
+ getUserInfo() {
408
+ const userService = new EzpUserService();
409
+ return userService.getUserInfo().then((user) => {
410
+ userStore.state.user = user;
411
+ this.userName = userStore.state.user.display_name;
412
+ });
398
413
  }
399
- else {
400
- this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
414
+ async setSelectedProperties(eventDetails) {
415
+ switch (eventDetails.type) {
416
+ case 'printer':
417
+ this.selectedPrinter.id = eventDetails.id;
418
+ this.selectedPrinter.name = eventDetails.title;
419
+ this.selectedPrinter.is_queue = eventDetails.is_queue;
420
+ await this.printService
421
+ .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
422
+ .then((data) => {
423
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
424
+ this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
425
+ this.selectedProperties.color =
426
+ ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
427
+ const defaultOrientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
428
+ const defaultOrientationIndex = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.OrientationIndex;
429
+ let orientationFallback;
430
+ if (defaultOrientation) {
431
+ const idx = (_d = this.selectedPrinterConfig.OrientationsSupported) === null || _d === void 0 ? void 0 : _d.indexOf(defaultOrientation);
432
+ if (typeof idx === 'number' && idx >= 0)
433
+ orientationFallback = idx + 1;
434
+ }
435
+ this.selectedProperties.orientation = defaultOrientationIndex !== null && defaultOrientationIndex !== void 0 ? defaultOrientationIndex : orientationFallback;
436
+ this.selectedProperties.resolution = (_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Resolution;
437
+ let defaultPaper = (_f = this.selectedPrinterConfig.PaperFormats) === null || _f === void 0 ? void 0 : _f.find((obj) => obj.Default === true);
438
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
439
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
440
+ let defaultSource = (_g = this.selectedPrinterConfig.Trays) === null || _g === void 0 ? void 0 : _g.find((obj) => obj.Default === true);
441
+ if (this.selectedPrinterConfig.Trays &&
442
+ this.selectedPrinterConfig.Trays.length >= 1 &&
443
+ this.selectedPrinterConfig.Trays[0] != null) {
444
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
445
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
446
+ }
447
+ if (this.selectedPrinterConfig.Trays &&
448
+ this.selectedPrinterConfig.Trays.length >= 0 &&
449
+ this.selectedPrinterConfig.Trays[0] == null) {
450
+ delete this.selectedProperties.trayname;
451
+ delete this.selectedProperties.defaultSource;
452
+ }
453
+ this.selectedProperties.duplex = (_h = this.selectedPrinterConfig) === null || _h === void 0 ? void 0 : _h.DuplexSupported;
454
+ this.selectedProperties.duplexmode = (_j = this.selectedPrinterConfig) === null || _j === void 0 ? void 0 : _j.DuplexMode;
455
+ delete this.selectedProperties.PageRanges;
456
+ });
457
+ // this.setDefaultPaperFormat()
458
+ break;
459
+ case 'color':
460
+ this.selectedProperties.color =
461
+ eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
462
+ break;
463
+ case 'orientation':
464
+ this.selectedProperties.orientation = eventDetails.id;
465
+ break;
466
+ case 'format':
467
+ this.selectedProperties.paper = eventDetails.title;
468
+ this.selectedProperties.paperid = eventDetails.id;
469
+ break;
470
+ case 'quality':
471
+ this.selectedProperties.resolution = eventDetails.title;
472
+ break;
473
+ case 'length':
474
+ this.selectedProperties.paperlength = eventDetails.value;
475
+ break;
476
+ case 'width':
477
+ this.selectedProperties.paperwidth = eventDetails.value;
478
+ break;
479
+ case 'tray':
480
+ if (this.selectedPrinterConfig.Trays &&
481
+ this.selectedPrinterConfig.Trays.length >= 0 &&
482
+ this.selectedPrinterConfig.Trays[0] == null) {
483
+ delete this.selectedProperties.trayname;
484
+ delete this.selectedProperties.defaultSource;
485
+ }
486
+ if (this.selectedPrinterConfig.Trays &&
487
+ this.selectedPrinterConfig.Trays.length >= 1 &&
488
+ this.selectedPrinterConfig.Trays[0] != null) {
489
+ this.selectedProperties.trayname = eventDetails.title;
490
+ this.selectedProperties.defaultSource = eventDetails.id;
491
+ }
492
+ break;
493
+ case 'paper_ranges':
494
+ this.selectedProperties.PageRanges = eventDetails.value;
495
+ this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
496
+ break;
497
+ case 'duplex':
498
+ if (eventDetails.title == i18next.t('printer_selection.duplex_none') ||
499
+ eventDetails.title == i18next.t('printer_selection.duplex_long') ||
500
+ eventDetails.title == i18next.t('printer_selection.duplex_short')) {
501
+ this.selectedProperties.duplex = true;
502
+ }
503
+ else {
504
+ this.selectedProperties.duplex = false;
505
+ }
506
+ this.selectedProperties.duplexmode = eventDetails.id;
507
+ break;
508
+ default:
509
+ break;
510
+ }
511
+ this.setPaperid();
401
512
  }
402
- this.setPaperid();
403
- }
404
- setPaperid() {
405
- this.paperid = this.selectedProperties.paperid;
406
- }
407
- getUserInfo() {
408
- const userService = new EzpUserService();
409
- return userService.getUserInfo().then((user) => {
410
- userStore.state.user = user;
411
- this.userName = userStore.state.user.display_name;
412
- });
413
- }
414
- async setSelectedProperties(eventDetails) {
415
- switch (eventDetails.type) {
416
- case 'printer':
417
- this.selectedPrinter.id = eventDetails.id;
418
- this.selectedPrinter.name = eventDetails.title;
419
- this.selectedPrinter.is_queue = eventDetails.is_queue;
420
- await this.printService
421
- .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
422
- .then((data) => {
423
- var _a, _b, _c, _d, _e, _f, _g;
424
- this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
425
- this.selectedProperties.color =
426
- ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
427
- this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
428
- this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
429
- let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
430
- this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
431
- this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
432
- let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
433
- if (this.selectedPrinterConfig.Trays &&
434
- this.selectedPrinterConfig.Trays.length >= 1 &&
435
- this.selectedPrinterConfig.Trays[0] != null) {
436
- this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
437
- this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
438
- }
439
- if (this.selectedPrinterConfig.Trays &&
440
- this.selectedPrinterConfig.Trays.length >= 0 &&
441
- this.selectedPrinterConfig.Trays[0] == null) {
442
- delete this.selectedProperties.trayname;
443
- delete this.selectedProperties.defaultSource;
444
- }
445
- this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
446
- this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
447
- delete this.selectedProperties.PageRanges;
448
- });
449
- // this.setDefaultPaperFormat()
450
- break;
451
- case 'color':
452
- this.selectedProperties.color =
453
- eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
454
- break;
455
- case 'orientation':
456
- this.selectedProperties.orientation = eventDetails.id;
457
- break;
458
- case 'format':
459
- this.selectedProperties.paper = eventDetails.title;
460
- this.selectedProperties.paperid = eventDetails.id;
461
- break;
462
- case 'quality':
463
- this.selectedProperties.resolution = eventDetails.title;
464
- break;
465
- case 'length':
466
- this.selectedProperties.paperlength = eventDetails.value;
467
- break;
468
- case 'width':
469
- this.selectedProperties.paperwidth = eventDetails.value;
470
- break;
471
- case 'tray':
472
- if (this.selectedPrinterConfig.Trays &&
473
- this.selectedPrinterConfig.Trays.length >= 0 &&
474
- this.selectedPrinterConfig.Trays[0] == null) {
475
- delete this.selectedProperties.trayname;
476
- delete this.selectedProperties.defaultSource;
513
+ async handleFiles(files, printPorperties) {
514
+ this.totalFiles = files.length;
515
+ this.currentFileIndex = 0;
516
+ this.failedFiles = [];
517
+ this.successfulFiles = [];
518
+ // Process each file individually
519
+ for (let i = 0; i < files.length; i++) {
520
+ this.currentFileIndex = i;
521
+ const file = files[i];
522
+ try {
523
+ await this.processSingleFile(file, printPorperties);
524
+ this.successfulFiles.push(file.name);
525
+ }
526
+ catch (error) {
527
+ console.error(`Error processing file ${file.name}:`, error);
528
+ this.failedFiles.push(file.name);
529
+ // Check if this is a hub driver error
530
+ if (error.message && error.message.includes('Hub printer driver error')) {
531
+ this.hubDriverError = true;
532
+ this.printProcessing = false;
533
+ return; // Stop processing other files if it's a hub driver issue
534
+ }
535
+ // Continue with the next file
536
+ }
477
537
  }
478
- if (this.selectedPrinterConfig.Trays &&
479
- this.selectedPrinterConfig.Trays.length >= 1 &&
480
- this.selectedPrinterConfig.Trays[0] != null) {
481
- this.selectedProperties.trayname = eventDetails.title;
482
- this.selectedProperties.defaultSource = eventDetails.id;
538
+ // Determine final status based on results
539
+ if (this.failedFiles.length === 0) {
540
+ // All files processed successfully
541
+ this.printSuccess = true;
542
+ this.partialSuccess = false;
543
+ this.printProcessing = false;
483
544
  }
484
- break;
485
- case 'paper_ranges':
486
- this.selectedProperties.PageRanges = eventDetails.value;
487
- this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
488
- break;
489
- case 'duplex':
490
- if (eventDetails.title == i18next.t('printer_selection.duplex_none') ||
491
- eventDetails.title == i18next.t('printer_selection.duplex_long') ||
492
- eventDetails.title == i18next.t('printer_selection.duplex_short')) {
493
- this.selectedProperties.duplex = true;
545
+ else if (this.successfulFiles.length === 0) {
546
+ // All files failed
547
+ this.printFailed = true;
548
+ this.partialSuccess = false;
549
+ this.printProcessing = false;
494
550
  }
495
551
  else {
496
- this.selectedProperties.duplex = false;
552
+ // Some files succeeded, some failed - show partial success
553
+ this.printSuccess = true;
554
+ this.partialSuccess = true;
555
+ this.printProcessing = false;
497
556
  }
498
- this.selectedProperties.duplexmode = eventDetails.id;
499
- break;
500
- default:
501
- break;
502
557
  }
503
- this.setPaperid();
504
- }
505
- async handleFiles(files, printPorperties) {
506
- this.totalFiles = files.length;
507
- this.currentFileIndex = 0;
508
- this.failedFiles = [];
509
- this.successfulFiles = [];
510
- // Process each file individually
511
- for (let i = 0; i < files.length; i++) {
512
- this.currentFileIndex = i;
513
- const file = files[i];
514
- try {
515
- await this.processSingleFile(file, printPorperties);
516
- this.successfulFiles.push(file.name);
517
- }
518
- catch (error) {
519
- console.error(`Error processing file ${file.name}:`, error);
520
- this.failedFiles.push(file.name);
521
- // Check if this is a hub driver error
522
- if (error.message && error.message.includes('Hub printer driver error')) {
523
- this.hubDriverError = true;
524
- this.printProcessing = false;
525
- return; // Stop processing other files if it's a hub driver issue
558
+ async processSingleFile(file, printProperties) {
559
+ this.preparingUpload = true;
560
+ const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
561
+ this.preparingUpload = false;
562
+ const fileid = response.fileid;
563
+ const sasUri = response.sasUri;
564
+ const filetype = this.getFileExtension(file.name);
565
+ this.uploading = true;
566
+ try {
567
+ // Upload the file
568
+ const res = await this.printService.uploadBlobFiles(sasUri, file);
569
+ if (res._response.status === 201) {
570
+ // Print the file
571
+ const data = await this.printService.printByFileID(authStore.state.accessToken, fileid, filetype, this.selectedPrinter.id, printProperties, file.name);
572
+ if (data.code === 804) {
573
+ throw new Error(`Print failed for file: ${file.name}`);
574
+ }
575
+ // Check for hub printer driver errors
576
+ if (this.selectedPrinter.is_queue &&
577
+ (data.code === 412 || data.code === 500 || data.code === 503)) {
578
+ throw new Error(`Hub printer driver error for file: ${file.name}`);
579
+ }
580
+ if (data.jobid) {
581
+ printStore.state.jobID = data.jobid;
582
+ // Wait for this print job to complete before processing the next file
583
+ await this.waitForPrintCompletion();
584
+ }
585
+ else {
586
+ throw new Error(`No job ID returned for file: ${file.name}`);
587
+ }
588
+ }
589
+ else {
590
+ throw new Error(`Upload failed for file: ${file.name}`);
591
+ }
526
592
  }
527
- // Continue with the next file
528
- }
529
- }
530
- // Determine final status based on results
531
- if (this.failedFiles.length === 0) {
532
- // All files processed successfully
533
- this.printSuccess = true;
534
- this.partialSuccess = false;
535
- this.printProcessing = false;
593
+ catch (error) {
594
+ this.uploading = false;
595
+ throw error;
596
+ }
597
+ this.uploading = false;
536
598
  }
537
- else if (this.successfulFiles.length === 0) {
538
- // All files failed
539
- this.printFailed = true;
540
- this.partialSuccess = false;
541
- this.printProcessing = false;
599
+ async waitForPrintCompletion() {
600
+ while (true) {
601
+ try {
602
+ const data = await this.printService.getPrintStatus();
603
+ console.log('[waitForPrintCompletion] Poll response:', data);
604
+ if (data.jobstatus === 0) {
605
+ // Success
606
+ return;
607
+ }
608
+ else if (data.jobstatus === 1246 || data.jobstatus === 129) {
609
+ // Still processing, wait before next poll
610
+ await new Promise((resolve) => setTimeout(resolve, this.POLL_INTERVAL));
611
+ }
612
+ else if (data.jobstatus === 3011 || data.jobstatus === 2) {
613
+ // Failure
614
+ throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
615
+ }
616
+ else if (this.selectedPrinter.is_queue &&
617
+ (data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
618
+ // Hub printer driver error
619
+ throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
620
+ }
621
+ else {
622
+ // Unknown status, treat as failure for safety
623
+ throw new Error('Unknown print job status: ' + data.jobstatus);
624
+ }
625
+ }
626
+ catch (error) {
627
+ throw error;
628
+ }
629
+ }
542
630
  }
543
- else {
544
- // Some files succeeded, some failed - show partial success
545
- this.printSuccess = true;
546
- this.partialSuccess = true;
547
- this.printProcessing = false;
631
+ getFileExtension(filename) {
632
+ const extension = filename.split('.').pop();
633
+ return extension ? extension.toLowerCase() : '';
548
634
  }
549
- }
550
- async processSingleFile(file, printProperties) {
551
- this.preparingUpload = true;
552
- const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
553
- this.preparingUpload = false;
554
- const fileid = response.fileid;
555
- const sasUri = response.sasUri;
556
- const filetype = this.getFileExtension(file.name);
557
- this.uploading = true;
558
- try {
559
- // Upload the file
560
- const res = await this.printService.uploadBlobFiles(sasUri, file);
561
- if (res._response.status === 201) {
562
- // Print the file
563
- const data = await this.printService.printByFileID(authStore.state.accessToken, fileid, filetype, this.selectedPrinter.id, printProperties, file.name);
564
- if (data.code === 804) {
565
- throw new Error(`Print failed for file: ${file.name}`);
635
+ setDefaultPaperFormat() {
636
+ var _a, _b, _c, _d, _e;
637
+ let format;
638
+ const language = navigator.language;
639
+ if (language === 'en-US') {
640
+ format = 'Letter';
566
641
  }
567
- // Check for hub printer driver errors
568
- if (this.selectedPrinter.is_queue &&
569
- (data.code === 412 || data.code === 500 || data.code === 503)) {
570
- throw new Error(`Hub printer driver error for file: ${file.name}`);
642
+ else if (language === 'my') {
643
+ format = 'Letter';
644
+ }
645
+ else {
646
+ format = 'A4';
571
647
  }
572
- if (data.jobid) {
573
- printStore.state.jobID = data.jobid;
574
- // Wait for this print job to complete before processing the next file
575
- await this.waitForPrintCompletion();
648
+ if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
649
+ this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
650
+ this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
576
651
  }
577
652
  else {
578
- throw new Error(`No job ID returned for file: ${file.name}`);
653
+ this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
654
+ this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
579
655
  }
580
- }
581
- else {
582
- throw new Error(`Upload failed for file: ${file.name}`);
583
- }
656
+ this.setPaperid();
584
657
  }
585
- catch (error) {
586
- this.uploading = false;
587
- throw error;
588
- }
589
- this.uploading = false;
590
- }
591
- async waitForPrintCompletion() {
592
- while (true) {
593
- try {
594
- const data = await this.printService.getPrintStatus();
595
- console.log('[waitForPrintCompletion] Poll response:', data);
596
- if (data.jobstatus === 0) {
597
- // Success
598
- return;
599
- }
600
- else if (data.jobstatus === 1246 || data.jobstatus === 129) {
601
- // Still processing, wait before next poll
602
- await new Promise((resolve) => setTimeout(resolve, this.POLL_INTERVAL));
658
+ async processMultipleFiles(files, printProperties) {
659
+ this.totalFiles = files.length;
660
+ this.currentFileIndex = 0;
661
+ this.failedFiles = [];
662
+ this.successfulFiles = [];
663
+ for (let i = 0; i < files.length; i++) {
664
+ this.currentFileIndex = i;
665
+ const file = files[i];
666
+ try {
667
+ await this.processSingleFile(file, printProperties);
668
+ this.successfulFiles.push(file.name);
669
+ }
670
+ catch (error) {
671
+ console.error(`Error processing file ${file.name}:`, error);
672
+ this.failedFiles.push(file.name);
673
+ // Continue with the next file
674
+ }
603
675
  }
604
- else if (data.jobstatus === 3011 || data.jobstatus === 2) {
605
- // Failure
606
- throw new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus));
676
+ // Set UI state
677
+ if (this.failedFiles.length === 0) {
678
+ this.printSuccess = true;
679
+ this.partialSuccess = false;
680
+ this.printProcessing = false;
607
681
  }
608
- else if (this.selectedPrinter.is_queue &&
609
- (data.jobstatus === 412 || data.jobstatus === 500 || data.jobstatus === 503)) {
610
- // Hub printer driver error
611
- throw new Error('Hub printer driver error: ' + (data.jobstatusstring || data.jobstatus));
682
+ else if (this.successfulFiles.length === 0) {
683
+ this.printFailed = true;
684
+ this.partialSuccess = false;
685
+ this.printProcessing = false;
612
686
  }
613
687
  else {
614
- // Unknown status, treat as failure for safety
615
- throw new Error('Unknown print job status: ' + data.jobstatus);
688
+ this.printSuccess = true;
689
+ this.partialSuccess = true;
690
+ this.printProcessing = false;
616
691
  }
617
- }
618
- catch (error) {
619
- throw error;
620
- }
621
- }
622
- }
623
- getFileExtension(filename) {
624
- const extension = filename.split('.').pop();
625
- return extension ? extension.toLowerCase() : '';
626
- }
627
- setDefaultPaperFormat() {
628
- var _a, _b, _c, _d, _e;
629
- let format;
630
- const language = navigator.language;
631
- if (language === 'en-US') {
632
- format = 'Letter';
633
692
  }
634
- else if (language === 'my') {
635
- format = 'Letter';
636
- }
637
- else {
638
- format = 'A4';
639
- }
640
- if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
641
- this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
642
- this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
643
- }
644
- else {
645
- this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
646
- this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
647
- }
648
- this.setPaperid();
649
- }
650
- async processMultipleFiles(files, printProperties) {
651
- this.totalFiles = files.length;
652
- this.currentFileIndex = 0;
653
- this.failedFiles = [];
654
- this.successfulFiles = [];
655
- for (let i = 0; i < files.length; i++) {
656
- this.currentFileIndex = i;
657
- const file = files[i];
658
- try {
659
- await this.processSingleFile(file, printProperties);
660
- this.successfulFiles.push(file.name);
661
- }
662
- catch (error) {
663
- console.error(`Error processing file ${file.name}:`, error);
664
- this.failedFiles.push(file.name);
665
- // Continue with the next file
666
- }
667
- }
668
- // Set UI state
669
- if (this.failedFiles.length === 0) {
670
- this.printSuccess = true;
671
- this.partialSuccess = false;
672
- this.printProcessing = false;
673
- }
674
- else if (this.successfulFiles.length === 0) {
675
- this.printFailed = true;
676
- this.partialSuccess = false;
677
- this.printProcessing = false;
678
- }
679
- else {
680
- this.printSuccess = true;
681
- this.partialSuccess = true;
682
- this.printProcessing = false;
683
- }
684
- }
685
- /**
686
- *
687
- * Lifecycle methods
688
- *
689
- */
690
- /** Description... */
691
- async connectedCallback() {
692
- this.printService = new EzpPrintService(this.redirectURI, this.clientID);
693
- this.printService.registerFetchInterceptor();
694
- await this.getUserInfo();
695
- await this.printService
696
- .getPrinterList(authStore.state.accessToken)
697
- .then((printers) => {
698
- this.printers = printers;
699
- if (!(this.printers.length > 0)) {
700
- this.noPrinters = true;
701
- }
702
- });
703
- this.getPropertiesFromLocalStorage();
704
- // if printer is stored from previous print, get the config to enable property selection
705
- if (this.selectedPrinter.id != '') {
706
- await this.printService
707
- .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
708
- .then((data) => {
709
- var _a, _b, _c, _d, _e, _f, _g;
710
- this.selectedPrinterConfig = data[0];
711
- this.selectedProperties.color =
712
- ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
713
- this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
714
- this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
715
- let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
716
- this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
717
- this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
718
- let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
719
- if (this.selectedPrinterConfig.Trays &&
720
- this.selectedPrinterConfig.Trays.length >= 1 &&
721
- this.selectedPrinterConfig.Trays[0] != null) {
722
- this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
723
- this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
693
+ /**
694
+ *
695
+ * Lifecycle methods
696
+ *
697
+ */
698
+ /** Description... */
699
+ async connectedCallback() {
700
+ this.printService = new EzpPrintService(this.redirectURI, this.clientID);
701
+ this.printService.registerFetchInterceptor();
702
+ await this.getUserInfo();
703
+ await this.printService
704
+ .getPrinterList(authStore.state.accessToken)
705
+ .then((printers) => {
706
+ this.printers = printers;
707
+ if (!(this.printers.length > 0)) {
708
+ this.noPrinters = true;
709
+ }
710
+ });
711
+ this.getPropertiesFromLocalStorage();
712
+ // if printer is stored from previous print, get the config to enable property selection
713
+ if (this.selectedPrinter.id != '') {
714
+ await this.printService
715
+ .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
716
+ .then((data) => {
717
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
718
+ this.selectedPrinterConfig = data[0];
719
+ this.selectedProperties.color =
720
+ ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
721
+ const defaultOrientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
722
+ const defaultOrientationIndex = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.OrientationIndex;
723
+ let orientationFallback;
724
+ if (defaultOrientation) {
725
+ const idx = (_d = this.selectedPrinterConfig.OrientationsSupported) === null || _d === void 0 ? void 0 : _d.indexOf(defaultOrientation);
726
+ if (typeof idx === 'number' && idx >= 0)
727
+ orientationFallback = idx + 1;
728
+ }
729
+ this.selectedProperties.orientation = defaultOrientationIndex !== null && defaultOrientationIndex !== void 0 ? defaultOrientationIndex : orientationFallback;
730
+ this.selectedProperties.resolution = (_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Resolution;
731
+ let defaultPaper = (_f = this.selectedPrinterConfig.PaperFormats) === null || _f === void 0 ? void 0 : _f.find((obj) => obj.Default === true);
732
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
733
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
734
+ let defaultSource = (_g = this.selectedPrinterConfig.Trays) === null || _g === void 0 ? void 0 : _g.find((obj) => obj.Default === true);
735
+ if (this.selectedPrinterConfig.Trays &&
736
+ this.selectedPrinterConfig.Trays.length >= 1 &&
737
+ this.selectedPrinterConfig.Trays[0] != null) {
738
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
739
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
740
+ }
741
+ if (this.selectedPrinterConfig.Trays &&
742
+ this.selectedPrinterConfig.Trays.length >= 0 &&
743
+ this.selectedPrinterConfig.Trays[0] == null) {
744
+ delete this.selectedProperties.trayname;
745
+ delete this.selectedProperties.defaultSource;
746
+ }
747
+ this.selectedProperties.duplex = (_h = this.selectedPrinterConfig) === null || _h === void 0 ? void 0 : _h.DuplexSupported;
748
+ this.selectedProperties.duplexmode = (_j = this.selectedPrinterConfig) === null || _j === void 0 ? void 0 : _j.DuplexMode;
749
+ delete this.selectedProperties.PageRanges;
750
+ });
751
+ if (this.selectedProperties.paper === '') {
752
+ this.setDefaultPaperFormat();
753
+ }
724
754
  }
725
- if (this.selectedPrinterConfig.Trays &&
726
- this.selectedPrinterConfig.Trays.length >= 0 &&
727
- this.selectedPrinterConfig.Trays[0] == null) {
728
- delete this.selectedProperties.trayname;
729
- delete this.selectedProperties.defaultSource;
755
+ await (await this.printService.getConfig(authStore.state.accessToken))
756
+ .json()
757
+ .then((response) => {
758
+ printStore.state.supportedFileExtensions = response.System.FILEEXT;
759
+ });
760
+ await this.printService
761
+ .getAllPrinterProperties(authStore.state.accessToken)
762
+ .then((printerConfig) => {
763
+ this.printerConfig = printerConfig;
764
+ });
765
+ if (this.files && this.files.length > 0) {
766
+ // Validate all files
767
+ const validationPromises = this.files.map((file) => this.validateFileType(file.name));
768
+ const validationResults = await Promise.all(validationPromises);
769
+ const allValid = validationResults.every((valid) => valid);
770
+ this.notSupported = !allValid;
730
771
  }
731
- this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
732
- this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
733
- delete this.selectedProperties.PageRanges;
734
- });
735
- if (this.selectedProperties.paper === '') {
736
- this.setDefaultPaperFormat();
737
- }
738
- }
739
- await (await this.printService.getConfig(authStore.state.accessToken))
740
- .json()
741
- .then((response) => {
742
- printStore.state.supportedFileExtensions = response.System.FILEEXT;
743
- });
744
- await this.printService
745
- .getAllPrinterProperties(authStore.state.accessToken)
746
- .then((printerConfig) => {
747
- this.printerConfig = printerConfig;
748
- });
749
- if (this.files && this.files.length > 0) {
750
- // Validate all files
751
- const validationPromises = this.files.map((file) => this.validateFileType(file.name));
752
- const validationResults = await Promise.all(validationPromises);
753
- const allValid = validationResults.every((valid) => valid);
754
- this.notSupported = !allValid;
772
+ this.loading = false;
755
773
  }
756
- this.loading = false;
757
- }
758
- /**
759
- *
760
- * Render method
761
- *
762
- */
763
- render() {
764
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
765
- return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } },
766
- h("div", { id: "box", "data-backdrop-surface": true },
767
- !this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.totalFiles > 1
768
- ? `${i18next.t('printer_selection.print_processing')} (${this.currentFileIndex + 1}/${this.totalFiles})`
769
- : this.preparingUpload
770
- ? i18next.t('printer_selection.prepare_upload')
771
- : this.uploading
772
- ? i18next.t('printer_selection.uploading')
773
- : i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: this.totalFiles > 1
774
- ? this.failedFiles.length > 0
775
- ? `${i18next.t('printer_selection.pull_print_success')} (${this.successfulFiles.length}/${this.totalFiles} files)`
776
- : `${i18next.t('printer_selection.pull_print_success')} (${this.totalFiles} files)`
777
- : i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: this.partialSuccess ? 'exclamation-mark' : 'checkmark-alt', description: this.totalFiles > 1
778
- ? this.partialSuccess
779
- ? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
780
- : `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
781
- : i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
782
- !this.hideheader && (h("div", { id: "header" },
783
- h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }),
784
- h("ezp-label", { text: !this.notSupported
785
- ? this.files && this.files.length > 1
786
- ? i18next.t('printer_selection.files_selected', { count: this.files.length })
787
- : this.filename
788
- : '', ellipsis: true }),
789
- !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })))),
790
- h("div", { id: "body" },
791
- h("div", { id: "printer" },
792
- h("ezp-select", { label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
774
+ /**
775
+ *
776
+ * Render method
777
+ *
778
+ */
779
+ render() {
780
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
781
+ return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } }, h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.totalFiles > 1
782
+ ? `${i18next.t('printer_selection.print_processing')} (${this.currentFileIndex + 1}/${this.totalFiles})`
783
+ : this.preparingUpload
784
+ ? i18next.t('printer_selection.prepare_upload')
785
+ : this.uploading
786
+ ? i18next.t('printer_selection.uploading')
787
+ : i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: this.totalFiles > 1
788
+ ? this.failedFiles.length > 0
789
+ ? `${i18next.t('printer_selection.pull_print_success')} (${this.successfulFiles.length}/${this.totalFiles} files)`
790
+ : `${i18next.t('printer_selection.pull_print_success')} (${this.totalFiles} files)`
791
+ : i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: this.partialSuccess ? 'exclamation-mark' : 'checkmark-alt', description: this.totalFiles > 1
792
+ ? this.partialSuccess
793
+ ? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
794
+ : `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
795
+ : i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.hubDriverError ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "hub-driver-error", close: true, retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), !this.hideheader && (h("div", { id: "header" }, h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), h("ezp-label", { text: !this.notSupported
796
+ ? this.files && this.files.length > 1
797
+ ? i18next.t('printer_selection.files_selected', { count: this.files.length })
798
+ : this.filename
799
+ : '', ellipsis: true }), !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })))), h("div", { id: "body" }, h("div", { id: "printer" }, h("ezp-select", { label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
793
800
  ? i18next.t('printer_selection.select_printer')
794
801
  : i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
795
802
  id: printer.id,
@@ -797,392 +804,412 @@ export class EzpPrinterSelection {
797
804
  meta: printer.location !== '' ? printer.location : '',
798
805
  type: 'printer',
799
806
  is_queue: printer.is_queue,
800
- })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })),
801
- h("div", { id: "options" },
802
- h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: (_a = this.ColorOptions) === null || _a === void 0 ? void 0 : _a.map((option) => ({
807
+ })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), h("div", { id: "options" }, h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: (_a = this.ColorOptions) === null || _a === void 0 ? void 0 : _a.map((option) => ({
803
808
  id: option.id,
804
809
  title: option.title,
805
810
  meta: '',
806
811
  type: 'color',
807
- })), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
812
+ })), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
808
813
  ? i18next.t('printer_selection.color_color')
809
- : i18next.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }),
810
- h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_c = this.duplexOptions) === null || _c === void 0 ? void 0 : _c.map((option) => ({
814
+ : i18next.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }), h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_c = this.duplexOptions) === null || _c === void 0 ? void 0 : _c.map((option) => ({
811
815
  id: option.id,
812
816
  title: option.title,
813
817
  meta: '',
814
818
  type: 'duplex',
815
- })), preSelected: this.selectedPrinter.id &&
819
+ })), preSelected: this.selectedPrinter.id &&
816
820
  ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
817
821
  ? i18next.t('printer_selection.duplex_none')
818
822
  : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
819
- ? i18next.t('printer_selection.duplex_long')
820
- : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
821
- ? i18next.t('printer_selection.duplex_short')
822
- : null, disabled: !this.selectedPrinterConfig.DuplexSupported }),
823
- h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
823
+ ? i18next.t('printer_selection.duplex_long')
824
+ : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
825
+ ? i18next.t('printer_selection.duplex_short')
826
+ : null, disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
824
827
  this.selectedPrinterConfig.PaperFormats.map((format) => ({
825
- id: format.Id,
826
- title: format.Name,
827
- meta: `${format.XRes} x ${format.YRes}`,
828
- type: 'format',
828
+ id: format.Id,
829
+ title: format.Name,
830
+ meta: `${format.XRes} x ${format.YRes}`,
831
+ type: 'format',
829
832
  })), preSelected: this.selectedPrinter.id &&
830
833
  ((_g = this.selectedPrinterConfig.PaperFormats) === null || _g === void 0 ? void 0 : _g.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper); }))
831
834
  ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
832
- : null, disabled: !(((_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) > 0) }),
833
- this.paperid == PAPER_ID ? (h(Fragment, null,
834
- h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }),
835
- h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null,
836
- h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.OrientationsSupported.map((orientation, index) => ({
835
+ : null, disabled: !(((_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) > 0) }), this.paperid == PAPER_ID ? (h(Fragment, null, h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }), h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null, h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.OrientationsSupported.map((orientation, index) => ({
837
836
  id: index + 1,
838
837
  title: i18next.t(`printer_selection.orientation_${orientation}`),
839
838
  meta: '',
840
839
  type: 'orientation',
841
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
842
- h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.map((option, index) => ({
840
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.map((option, index) => ({
843
841
  id: index,
844
842
  title: option,
845
843
  meta: '',
846
844
  type: 'quality',
847
- })), preSelected: this.selectedPrinter.id &&
845
+ })), preSelected: this.selectedPrinter.id &&
848
846
  ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
849
847
  ? this.selectedPrinterConfig.Default.Resolution
850
- : null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }),
851
- this.selectedPrinterConfig.Trays &&
852
- this.selectedPrinterConfig.Trays.length >= 1 &&
853
- this.selectedPrinterConfig.Trays[0] != null ? (h("ezp-select", { label: i18next.t('printer_selection.trays'), icon: "trays", placeholder: i18next.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays &&
848
+ : null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays &&
849
+ this.selectedPrinterConfig.Trays.length >= 1 &&
850
+ this.selectedPrinterConfig.Trays[0] != null ? (h("ezp-select", { label: i18next.t('printer_selection.trays'), icon: "trays", placeholder: i18next.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays &&
854
851
  this.selectedPrinterConfig.Trays.length >= 1 &&
855
852
  this.selectedPrinterConfig.Trays.map((trays) => ({
856
- title: trays.Name,
857
- id: trays.Index,
858
- meta: '',
859
- type: 'tray',
853
+ title: trays.Name,
854
+ id: trays.Index,
855
+ meta: '',
856
+ type: 'tray',
860
857
  })), preSelected: this.selectedPrinter.id &&
861
858
  ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
862
859
  ? this.selectedPrinterConfig.Default.Tray
863
- : null })) : null,
864
- h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })),
865
- h("ezp-stepper", { label: i18next.t('printer_selection.copies'), icon: "copies" })),
866
- h("div", { id: "footer" },
867
- h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }),
868
- h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })),
869
- !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
870
- }
871
- static get is() { return "ezp-printer-selection"; }
872
- static get encapsulation() { return "shadow"; }
873
- static get originalStyleUrls() { return {
874
- "$": ["ezp-printer-selection.scss"]
875
- }; }
876
- static get styleUrls() { return {
877
- "$": ["ezp-printer-selection.css"]
878
- }; }
879
- static get properties() { return {
880
- "clientID": {
881
- "type": "string",
882
- "mutable": false,
883
- "complexType": {
884
- "original": "string",
885
- "resolved": "string",
886
- "references": {}
887
- },
888
- "required": false,
889
- "optional": false,
890
- "docs": {
891
- "tags": [],
892
- "text": "\nProperties"
893
- },
894
- "attribute": "client-i-d",
895
- "reflect": false
896
- },
897
- "redirectURI": {
898
- "type": "string",
899
- "mutable": false,
900
- "complexType": {
901
- "original": "string",
902
- "resolved": "string",
903
- "references": {}
904
- },
905
- "required": false,
906
- "optional": false,
907
- "docs": {
908
- "tags": [],
909
- "text": ""
910
- },
911
- "attribute": "redirect-u-r-i",
912
- "reflect": false
913
- },
914
- "filename": {
915
- "type": "string",
916
- "mutable": true,
917
- "complexType": {
918
- "original": "string",
919
- "resolved": "string",
920
- "references": {}
921
- },
922
- "required": false,
923
- "optional": false,
924
- "docs": {
925
- "tags": [],
926
- "text": ""
927
- },
928
- "attribute": "filename",
929
- "reflect": false
930
- },
931
- "fileurl": {
932
- "type": "string",
933
- "mutable": false,
934
- "complexType": {
935
- "original": "string",
936
- "resolved": "string",
937
- "references": {}
938
- },
939
- "required": false,
940
- "optional": false,
941
- "docs": {
942
- "tags": [],
943
- "text": ""
944
- },
945
- "attribute": "fileurl",
946
- "reflect": false
947
- },
948
- "filetype": {
949
- "type": "string",
950
- "mutable": true,
951
- "complexType": {
952
- "original": "string",
953
- "resolved": "string",
954
- "references": {}
955
- },
956
- "required": false,
957
- "optional": false,
958
- "docs": {
959
- "tags": [],
960
- "text": ""
961
- },
962
- "attribute": "filetype",
963
- "reflect": false
964
- },
965
- "fileid": {
966
- "type": "string",
967
- "mutable": true,
968
- "complexType": {
969
- "original": "string",
970
- "resolved": "string",
971
- "references": {}
972
- },
973
- "required": false,
974
- "optional": false,
975
- "docs": {
976
- "tags": [],
977
- "text": ""
978
- },
979
- "attribute": "fileid",
980
- "reflect": false
981
- },
982
- "files": {
983
- "type": "unknown",
984
- "mutable": false,
985
- "complexType": {
986
- "original": "File[]",
987
- "resolved": "File[]",
988
- "references": {
989
- "File": {
990
- "location": "global"
991
- }
992
- }
993
- },
994
- "required": false,
995
- "optional": false,
996
- "docs": {
997
- "tags": [],
998
- "text": ""
999
- }
1000
- },
1001
- "hidemenu": {
1002
- "type": "boolean",
1003
- "mutable": false,
1004
- "complexType": {
1005
- "original": "boolean",
1006
- "resolved": "boolean",
1007
- "references": {}
1008
- },
1009
- "required": false,
1010
- "optional": false,
1011
- "docs": {
1012
- "tags": [],
1013
- "text": ""
1014
- },
1015
- "attribute": "hidemenu",
1016
- "reflect": false,
1017
- "defaultValue": "false"
1018
- },
1019
- "hideheader": {
1020
- "type": "boolean",
1021
- "mutable": false,
1022
- "complexType": {
1023
- "original": "boolean",
1024
- "resolved": "boolean",
1025
- "references": {}
1026
- },
1027
- "required": false,
1028
- "optional": false,
1029
- "docs": {
1030
- "tags": [],
1031
- "text": ""
1032
- },
1033
- "attribute": "hideheader",
1034
- "reflect": false,
1035
- "defaultValue": "false"
1036
- },
1037
- "seamless": {
1038
- "type": "boolean",
1039
- "mutable": false,
1040
- "complexType": {
1041
- "original": "boolean",
1042
- "resolved": "boolean",
1043
- "references": {}
1044
- },
1045
- "required": false,
1046
- "optional": false,
1047
- "docs": {
1048
- "tags": [],
1049
- "text": ""
1050
- },
1051
- "attribute": "seamless",
1052
- "reflect": false
860
+ : null })) : null, h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), h("ezp-stepper", { label: i18next.t('printer_selection.copies'), icon: "copies" })), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
861
+ }
862
+ static get is() { return "ezp-printer-selection"; }
863
+ static get encapsulation() { return "shadow"; }
864
+ static get originalStyleUrls() {
865
+ return {
866
+ "$": ["ezp-printer-selection.scss"]
867
+ };
868
+ }
869
+ static get styleUrls() {
870
+ return {
871
+ "$": ["ezp-printer-selection.css"]
872
+ };
873
+ }
874
+ static get properties() {
875
+ return {
876
+ "clientID": {
877
+ "type": "string",
878
+ "mutable": false,
879
+ "complexType": {
880
+ "original": "string",
881
+ "resolved": "string",
882
+ "references": {}
883
+ },
884
+ "required": false,
885
+ "optional": false,
886
+ "docs": {
887
+ "tags": [],
888
+ "text": "\nProperties"
889
+ },
890
+ "getter": false,
891
+ "setter": false,
892
+ "reflect": false,
893
+ "attribute": "client-i-d"
894
+ },
895
+ "redirectURI": {
896
+ "type": "string",
897
+ "mutable": false,
898
+ "complexType": {
899
+ "original": "string",
900
+ "resolved": "string",
901
+ "references": {}
902
+ },
903
+ "required": false,
904
+ "optional": false,
905
+ "docs": {
906
+ "tags": [],
907
+ "text": ""
908
+ },
909
+ "getter": false,
910
+ "setter": false,
911
+ "reflect": false,
912
+ "attribute": "redirect-u-r-i"
913
+ },
914
+ "filename": {
915
+ "type": "string",
916
+ "mutable": true,
917
+ "complexType": {
918
+ "original": "string",
919
+ "resolved": "string",
920
+ "references": {}
921
+ },
922
+ "required": false,
923
+ "optional": false,
924
+ "docs": {
925
+ "tags": [],
926
+ "text": ""
927
+ },
928
+ "getter": false,
929
+ "setter": false,
930
+ "reflect": false,
931
+ "attribute": "filename"
932
+ },
933
+ "fileurl": {
934
+ "type": "string",
935
+ "mutable": false,
936
+ "complexType": {
937
+ "original": "string",
938
+ "resolved": "string",
939
+ "references": {}
940
+ },
941
+ "required": false,
942
+ "optional": false,
943
+ "docs": {
944
+ "tags": [],
945
+ "text": ""
946
+ },
947
+ "getter": false,
948
+ "setter": false,
949
+ "reflect": false,
950
+ "attribute": "fileurl"
951
+ },
952
+ "filetype": {
953
+ "type": "string",
954
+ "mutable": true,
955
+ "complexType": {
956
+ "original": "string",
957
+ "resolved": "string",
958
+ "references": {}
959
+ },
960
+ "required": false,
961
+ "optional": false,
962
+ "docs": {
963
+ "tags": [],
964
+ "text": ""
965
+ },
966
+ "getter": false,
967
+ "setter": false,
968
+ "reflect": false,
969
+ "attribute": "filetype"
970
+ },
971
+ "fileid": {
972
+ "type": "string",
973
+ "mutable": true,
974
+ "complexType": {
975
+ "original": "string",
976
+ "resolved": "string",
977
+ "references": {}
978
+ },
979
+ "required": false,
980
+ "optional": false,
981
+ "docs": {
982
+ "tags": [],
983
+ "text": ""
984
+ },
985
+ "getter": false,
986
+ "setter": false,
987
+ "reflect": false,
988
+ "attribute": "fileid"
989
+ },
990
+ "files": {
991
+ "type": "unknown",
992
+ "mutable": false,
993
+ "complexType": {
994
+ "original": "File[]",
995
+ "resolved": "File[]",
996
+ "references": {
997
+ "File": {
998
+ "location": "global",
999
+ "id": "global::File"
1000
+ }
1001
+ }
1002
+ },
1003
+ "required": false,
1004
+ "optional": false,
1005
+ "docs": {
1006
+ "tags": [],
1007
+ "text": ""
1008
+ },
1009
+ "getter": false,
1010
+ "setter": false
1011
+ },
1012
+ "hidemenu": {
1013
+ "type": "boolean",
1014
+ "mutable": false,
1015
+ "complexType": {
1016
+ "original": "boolean",
1017
+ "resolved": "boolean",
1018
+ "references": {}
1019
+ },
1020
+ "required": false,
1021
+ "optional": false,
1022
+ "docs": {
1023
+ "tags": [],
1024
+ "text": ""
1025
+ },
1026
+ "getter": false,
1027
+ "setter": false,
1028
+ "reflect": false,
1029
+ "attribute": "hidemenu",
1030
+ "defaultValue": "false"
1031
+ },
1032
+ "hideheader": {
1033
+ "type": "boolean",
1034
+ "mutable": false,
1035
+ "complexType": {
1036
+ "original": "boolean",
1037
+ "resolved": "boolean",
1038
+ "references": {}
1039
+ },
1040
+ "required": false,
1041
+ "optional": false,
1042
+ "docs": {
1043
+ "tags": [],
1044
+ "text": ""
1045
+ },
1046
+ "getter": false,
1047
+ "setter": false,
1048
+ "reflect": false,
1049
+ "attribute": "hideheader",
1050
+ "defaultValue": "false"
1051
+ },
1052
+ "seamless": {
1053
+ "type": "boolean",
1054
+ "mutable": false,
1055
+ "complexType": {
1056
+ "original": "boolean",
1057
+ "resolved": "boolean",
1058
+ "references": {}
1059
+ },
1060
+ "required": false,
1061
+ "optional": false,
1062
+ "docs": {
1063
+ "tags": [],
1064
+ "text": ""
1065
+ },
1066
+ "getter": false,
1067
+ "setter": false,
1068
+ "reflect": false,
1069
+ "attribute": "seamless"
1070
+ }
1071
+ };
1072
+ }
1073
+ static get states() {
1074
+ return {
1075
+ "loading": {},
1076
+ "printProcessing": {},
1077
+ "pageRangeInvalid": {},
1078
+ "uploading": {},
1079
+ "preparingUpload": {},
1080
+ "printSuccess": {},
1081
+ "printFailed": {},
1082
+ "notSupported": {},
1083
+ "noPrinters": {},
1084
+ "hubDriverError": {},
1085
+ "userMenuOpen": {},
1086
+ "printStopped": {},
1087
+ "userName": {},
1088
+ "printers": {},
1089
+ "selectedPrinter": {},
1090
+ "printerConfig": {},
1091
+ "selectedPrinterConfig": {},
1092
+ "selectedProperties": {},
1093
+ "paperid": {},
1094
+ "currentFileIndex": {},
1095
+ "totalFiles": {},
1096
+ "failedFiles": {},
1097
+ "successfulFiles": {},
1098
+ "partialSuccess": {}
1099
+ };
1100
+ }
1101
+ static get events() {
1102
+ return [{
1103
+ "method": "printCancel",
1104
+ "name": "printCancel",
1105
+ "bubbles": true,
1106
+ "cancelable": true,
1107
+ "composed": true,
1108
+ "docs": {
1109
+ "tags": [],
1110
+ "text": "Description..."
1111
+ },
1112
+ "complexType": {
1113
+ "original": "MouseEvent",
1114
+ "resolved": "MouseEvent",
1115
+ "references": {
1116
+ "MouseEvent": {
1117
+ "location": "global",
1118
+ "id": "global::MouseEvent"
1119
+ }
1120
+ }
1121
+ }
1122
+ }, {
1123
+ "method": "printSubmit",
1124
+ "name": "printSubmit",
1125
+ "bubbles": true,
1126
+ "cancelable": true,
1127
+ "composed": true,
1128
+ "docs": {
1129
+ "tags": [],
1130
+ "text": "Description..."
1131
+ },
1132
+ "complexType": {
1133
+ "original": "MouseEvent",
1134
+ "resolved": "MouseEvent",
1135
+ "references": {
1136
+ "MouseEvent": {
1137
+ "location": "global",
1138
+ "id": "global::MouseEvent"
1139
+ }
1140
+ }
1141
+ }
1142
+ }, {
1143
+ "method": "logout",
1144
+ "name": "logout",
1145
+ "bubbles": true,
1146
+ "cancelable": true,
1147
+ "composed": true,
1148
+ "docs": {
1149
+ "tags": [],
1150
+ "text": ""
1151
+ },
1152
+ "complexType": {
1153
+ "original": "MouseEvent",
1154
+ "resolved": "MouseEvent",
1155
+ "references": {
1156
+ "MouseEvent": {
1157
+ "location": "global",
1158
+ "id": "global::MouseEvent"
1159
+ }
1160
+ }
1161
+ }
1162
+ }];
1163
+ }
1164
+ static get listeners() {
1165
+ return [{
1166
+ "name": "inputValueChanged",
1167
+ "method": "listenInputValueChanged",
1168
+ "target": undefined,
1169
+ "capture": false,
1170
+ "passive": false
1171
+ }, {
1172
+ "name": "selectSelection",
1173
+ "method": "listenSelectSelection",
1174
+ "target": undefined,
1175
+ "capture": false,
1176
+ "passive": false
1177
+ }, {
1178
+ "name": "stepperChanged",
1179
+ "method": "listenStepperChanged",
1180
+ "target": undefined,
1181
+ "capture": false,
1182
+ "passive": false
1183
+ }, {
1184
+ "name": "userMenuClosure",
1185
+ "method": "listenUserMenuClosure",
1186
+ "target": undefined,
1187
+ "capture": false,
1188
+ "passive": false
1189
+ }, {
1190
+ "name": "logoutEmitter",
1191
+ "method": "listenLogout",
1192
+ "target": undefined,
1193
+ "capture": false,
1194
+ "passive": false
1195
+ }, {
1196
+ "name": "statusCancel",
1197
+ "method": "listenStatusCancel",
1198
+ "target": undefined,
1199
+ "capture": false,
1200
+ "passive": false
1201
+ }, {
1202
+ "name": "statusClose",
1203
+ "method": "listenStatusClose",
1204
+ "target": undefined,
1205
+ "capture": false,
1206
+ "passive": false
1207
+ }, {
1208
+ "name": "statusRetry",
1209
+ "method": "listenStatusRetry",
1210
+ "target": undefined,
1211
+ "capture": false,
1212
+ "passive": false
1213
+ }];
1053
1214
  }
1054
- }; }
1055
- static get states() { return {
1056
- "loading": {},
1057
- "printProcessing": {},
1058
- "pageRangeInvalid": {},
1059
- "uploading": {},
1060
- "preparingUpload": {},
1061
- "printSuccess": {},
1062
- "printFailed": {},
1063
- "notSupported": {},
1064
- "noPrinters": {},
1065
- "hubDriverError": {},
1066
- "userMenuOpen": {},
1067
- "printStopped": {},
1068
- "userName": {},
1069
- "printers": {},
1070
- "selectedPrinter": {},
1071
- "printerConfig": {},
1072
- "selectedPrinterConfig": {},
1073
- "selectedProperties": {},
1074
- "paperid": {},
1075
- "currentFileIndex": {},
1076
- "totalFiles": {},
1077
- "failedFiles": {},
1078
- "successfulFiles": {},
1079
- "partialSuccess": {}
1080
- }; }
1081
- static get events() { return [{
1082
- "method": "printCancel",
1083
- "name": "printCancel",
1084
- "bubbles": true,
1085
- "cancelable": true,
1086
- "composed": true,
1087
- "docs": {
1088
- "tags": [],
1089
- "text": "Description..."
1090
- },
1091
- "complexType": {
1092
- "original": "MouseEvent",
1093
- "resolved": "MouseEvent",
1094
- "references": {
1095
- "MouseEvent": {
1096
- "location": "global"
1097
- }
1098
- }
1099
- }
1100
- }, {
1101
- "method": "printSubmit",
1102
- "name": "printSubmit",
1103
- "bubbles": true,
1104
- "cancelable": true,
1105
- "composed": true,
1106
- "docs": {
1107
- "tags": [],
1108
- "text": "Description..."
1109
- },
1110
- "complexType": {
1111
- "original": "MouseEvent",
1112
- "resolved": "MouseEvent",
1113
- "references": {
1114
- "MouseEvent": {
1115
- "location": "global"
1116
- }
1117
- }
1118
- }
1119
- }, {
1120
- "method": "logout",
1121
- "name": "logout",
1122
- "bubbles": true,
1123
- "cancelable": true,
1124
- "composed": true,
1125
- "docs": {
1126
- "tags": [],
1127
- "text": ""
1128
- },
1129
- "complexType": {
1130
- "original": "MouseEvent",
1131
- "resolved": "MouseEvent",
1132
- "references": {
1133
- "MouseEvent": {
1134
- "location": "global"
1135
- }
1136
- }
1137
- }
1138
- }]; }
1139
- static get listeners() { return [{
1140
- "name": "inputValueChanged",
1141
- "method": "listenInputValueChanged",
1142
- "target": undefined,
1143
- "capture": false,
1144
- "passive": false
1145
- }, {
1146
- "name": "selectSelection",
1147
- "method": "listenSelectSelection",
1148
- "target": undefined,
1149
- "capture": false,
1150
- "passive": false
1151
- }, {
1152
- "name": "stepperChanged",
1153
- "method": "listenStepperChanged",
1154
- "target": undefined,
1155
- "capture": false,
1156
- "passive": false
1157
- }, {
1158
- "name": "userMenuClosure",
1159
- "method": "listenUserMenuClosure",
1160
- "target": undefined,
1161
- "capture": false,
1162
- "passive": false
1163
- }, {
1164
- "name": "logoutEmitter",
1165
- "method": "listenLogout",
1166
- "target": undefined,
1167
- "capture": false,
1168
- "passive": false
1169
- }, {
1170
- "name": "statusCancel",
1171
- "method": "listenStatusCancel",
1172
- "target": undefined,
1173
- "capture": false,
1174
- "passive": false
1175
- }, {
1176
- "name": "statusClose",
1177
- "method": "listenStatusClose",
1178
- "target": undefined,
1179
- "capture": false,
1180
- "passive": false
1181
- }, {
1182
- "name": "statusRetry",
1183
- "method": "listenStatusRetry",
1184
- "target": undefined,
1185
- "capture": false,
1186
- "passive": false
1187
- }]; }
1188
1215
  }