@aidc-toolkit/app-extension 1.0.52-beta → 1.0.52

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 (182) hide show
  1. package/dist/character-set-proxy-CQCOcqR3.d.cts +473 -0
  2. package/dist/character-set-proxy-CQCOcqR3.d.ts +473 -0
  3. package/dist/chunk-4BTJEN4N.js +1 -0
  4. package/dist/chunk-G5IU2ZOV.js +1 -0
  5. package/dist/chunk-WLXID4YR.js +1 -0
  6. package/dist/{descriptor.d.ts → descriptor-Df-lif4q.d.cts} +13 -13
  7. package/dist/descriptor-Df-lif4q.d.ts +185 -0
  8. package/dist/generator/index.cjs +17 -0
  9. package/dist/generator/index.d.cts +224 -0
  10. package/dist/generator/index.d.ts +223 -18
  11. package/dist/generator/index.js +1 -3
  12. package/dist/gs1/index.cjs +1 -0
  13. package/dist/gs1/index.d.cts +185 -0
  14. package/dist/gs1/index.d.ts +185 -11
  15. package/dist/gs1/index.js +1 -11
  16. package/dist/index.cjs +17 -0
  17. package/dist/{locale/en/locale-resources.d.ts → index.d.cts} +98 -2
  18. package/dist/index.d.ts +847 -22
  19. package/dist/index.js +1 -7
  20. package/package.json +1 -1
  21. package/src/version.ts +1 -1
  22. package/tsconfig-src.tsbuildinfo +1 -1
  23. package/dist/app-extension-options.d.ts +0 -52
  24. package/dist/app-extension-options.d.ts.map +0 -1
  25. package/dist/app-extension-options.js +0 -2
  26. package/dist/app-extension-options.js.map +0 -1
  27. package/dist/app-extension.d.ts +0 -194
  28. package/dist/app-extension.d.ts.map +0 -1
  29. package/dist/app-extension.js +0 -141
  30. package/dist/app-extension.js.map +0 -1
  31. package/dist/app-helper-proxy.d.ts +0 -57
  32. package/dist/app-helper-proxy.d.ts.map +0 -1
  33. package/dist/app-helper-proxy.js +0 -354
  34. package/dist/app-helper-proxy.js.map +0 -1
  35. package/dist/descriptor.d.ts.map +0 -1
  36. package/dist/descriptor.js +0 -44
  37. package/dist/descriptor.js.map +0 -1
  38. package/dist/generator/functions-generator.d.ts +0 -103
  39. package/dist/generator/functions-generator.d.ts.map +0 -1
  40. package/dist/generator/functions-generator.js +0 -179
  41. package/dist/generator/functions-generator.js.map +0 -1
  42. package/dist/generator/generator.d.ts +0 -121
  43. package/dist/generator/generator.d.ts.map +0 -1
  44. package/dist/generator/generator.js +0 -186
  45. package/dist/generator/generator.js.map +0 -1
  46. package/dist/generator/index.d.ts.map +0 -1
  47. package/dist/generator/index.js.map +0 -1
  48. package/dist/generator/locale-resources-generator.d.ts +0 -2
  49. package/dist/generator/locale-resources-generator.d.ts.map +0 -1
  50. package/dist/generator/locale-resources-generator.js +0 -333
  51. package/dist/generator/locale-resources-generator.js.map +0 -1
  52. package/dist/gs1/character-set-proxy.d.ts +0 -12
  53. package/dist/gs1/character-set-proxy.d.ts.map +0 -1
  54. package/dist/gs1/character-set-proxy.js +0 -126
  55. package/dist/gs1/character-set-proxy.js.map +0 -1
  56. package/dist/gs1/check-proxy.d.ts +0 -11
  57. package/dist/gs1/check-proxy.d.ts.map +0 -1
  58. package/dist/gs1/check-proxy.js +0 -163
  59. package/dist/gs1/check-proxy.js.map +0 -1
  60. package/dist/gs1/gcp-length-proxy.d.ts +0 -11
  61. package/dist/gs1/gcp-length-proxy.d.ts.map +0 -1
  62. package/dist/gs1/gcp-length-proxy.js +0 -187
  63. package/dist/gs1/gcp-length-proxy.js.map +0 -1
  64. package/dist/gs1/gtin-creator-proxy.d.ts +0 -10
  65. package/dist/gs1/gtin-creator-proxy.d.ts.map +0 -1
  66. package/dist/gs1/gtin-creator-proxy.js +0 -85
  67. package/dist/gs1/gtin-creator-proxy.js.map +0 -1
  68. package/dist/gs1/gtin-descriptor.d.ts +0 -3
  69. package/dist/gs1/gtin-descriptor.d.ts.map +0 -1
  70. package/dist/gs1/gtin-descriptor.js +0 -8
  71. package/dist/gs1/gtin-descriptor.js.map +0 -1
  72. package/dist/gs1/gtin-validator-proxy.d.ts +0 -26
  73. package/dist/gs1/gtin-validator-proxy.d.ts.map +0 -1
  74. package/dist/gs1/gtin-validator-proxy.js +0 -256
  75. package/dist/gs1/gtin-validator-proxy.js.map +0 -1
  76. package/dist/gs1/identifier-creator-proxy.d.ts +0 -30
  77. package/dist/gs1/identifier-creator-proxy.d.ts.map +0 -1
  78. package/dist/gs1/identifier-creator-proxy.js +0 -318
  79. package/dist/gs1/identifier-creator-proxy.js.map +0 -1
  80. package/dist/gs1/identifier-descriptor.d.ts +0 -4
  81. package/dist/gs1/identifier-descriptor.d.ts.map +0 -1
  82. package/dist/gs1/identifier-descriptor.js +0 -14
  83. package/dist/gs1/identifier-descriptor.js.map +0 -1
  84. package/dist/gs1/identifier-type.d.ts +0 -22
  85. package/dist/gs1/identifier-type.d.ts.map +0 -1
  86. package/dist/gs1/identifier-type.js +0 -34
  87. package/dist/gs1/identifier-type.js.map +0 -1
  88. package/dist/gs1/identifier-validator-proxy.d.ts +0 -29
  89. package/dist/gs1/identifier-validator-proxy.d.ts.map +0 -1
  90. package/dist/gs1/identifier-validator-proxy.js +0 -212
  91. package/dist/gs1/identifier-validator-proxy.js.map +0 -1
  92. package/dist/gs1/index.d.ts.map +0 -1
  93. package/dist/gs1/index.js.map +0 -1
  94. package/dist/gs1/non-gtin-creator-proxy.d.ts +0 -37
  95. package/dist/gs1/non-gtin-creator-proxy.d.ts.map +0 -1
  96. package/dist/gs1/non-gtin-creator-proxy.js +0 -301
  97. package/dist/gs1/non-gtin-creator-proxy.js.map +0 -1
  98. package/dist/gs1/non-gtin-validator-proxy.d.ts +0 -36
  99. package/dist/gs1/non-gtin-validator-proxy.d.ts.map +0 -1
  100. package/dist/gs1/non-gtin-validator-proxy.js +0 -302
  101. package/dist/gs1/non-gtin-validator-proxy.js.map +0 -1
  102. package/dist/gs1/prefix-definition-descriptor.d.ts +0 -4
  103. package/dist/gs1/prefix-definition-descriptor.d.ts.map +0 -1
  104. package/dist/gs1/prefix-definition-descriptor.js +0 -16
  105. package/dist/gs1/prefix-definition-descriptor.js.map +0 -1
  106. package/dist/gs1/prefix-manager-proxy.d.ts +0 -8
  107. package/dist/gs1/prefix-manager-proxy.d.ts.map +0 -1
  108. package/dist/gs1/prefix-manager-proxy.js +0 -94
  109. package/dist/gs1/prefix-manager-proxy.js.map +0 -1
  110. package/dist/gs1/variable-measure-proxy.d.ts +0 -7
  111. package/dist/gs1/variable-measure-proxy.d.ts.map +0 -1
  112. package/dist/gs1/variable-measure-proxy.js +0 -114
  113. package/dist/gs1/variable-measure-proxy.js.map +0 -1
  114. package/dist/gs1/verified-by-gs1-proxy.d.ts +0 -7
  115. package/dist/gs1/verified-by-gs1-proxy.d.ts.map +0 -1
  116. package/dist/gs1/verified-by-gs1-proxy.js +0 -100
  117. package/dist/gs1/verified-by-gs1-proxy.js.map +0 -1
  118. package/dist/index.d.ts.map +0 -1
  119. package/dist/index.js.map +0 -1
  120. package/dist/lib-proxy.d.ts +0 -121
  121. package/dist/lib-proxy.d.ts.map +0 -1
  122. package/dist/lib-proxy.js +0 -259
  123. package/dist/lib-proxy.js.map +0 -1
  124. package/dist/locale/en/locale-resources.d.ts.map +0 -1
  125. package/dist/locale/en/locale-resources.js +0 -754
  126. package/dist/locale/en/locale-resources.js.map +0 -1
  127. package/dist/locale/fr/locale-resources.d.ts +0 -755
  128. package/dist/locale/fr/locale-resources.d.ts.map +0 -1
  129. package/dist/locale/fr/locale-resources.js +0 -754
  130. package/dist/locale/fr/locale-resources.js.map +0 -1
  131. package/dist/locale/i18n.d.ts +0 -27
  132. package/dist/locale/i18n.d.ts.map +0 -1
  133. package/dist/locale/i18n.js +0 -36
  134. package/dist/locale/i18n.js.map +0 -1
  135. package/dist/proxy.d.ts +0 -135
  136. package/dist/proxy.d.ts.map +0 -1
  137. package/dist/proxy.js +0 -291
  138. package/dist/proxy.js.map +0 -1
  139. package/dist/streaming.d.ts +0 -10
  140. package/dist/streaming.d.ts.map +0 -1
  141. package/dist/streaming.js +0 -2
  142. package/dist/streaming.js.map +0 -1
  143. package/dist/type.d.ts +0 -72
  144. package/dist/type.d.ts.map +0 -1
  145. package/dist/type.js +0 -2
  146. package/dist/type.js.map +0 -1
  147. package/dist/utility/character-set-descriptor.d.ts +0 -6
  148. package/dist/utility/character-set-descriptor.d.ts.map +0 -1
  149. package/dist/utility/character-set-descriptor.js +0 -28
  150. package/dist/utility/character-set-descriptor.js.map +0 -1
  151. package/dist/utility/character-set-proxy.d.ts +0 -32
  152. package/dist/utility/character-set-proxy.d.ts.map +0 -1
  153. package/dist/utility/character-set-proxy.js +0 -278
  154. package/dist/utility/character-set-proxy.js.map +0 -1
  155. package/dist/utility/index.d.ts +0 -4
  156. package/dist/utility/index.d.ts.map +0 -1
  157. package/dist/utility/index.js +0 -4
  158. package/dist/utility/index.js.map +0 -1
  159. package/dist/utility/reg-exp-proxy.d.ts +0 -8
  160. package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
  161. package/dist/utility/reg-exp-proxy.js +0 -103
  162. package/dist/utility/reg-exp-proxy.js.map +0 -1
  163. package/dist/utility/string-descriptor.d.ts +0 -4
  164. package/dist/utility/string-descriptor.d.ts.map +0 -1
  165. package/dist/utility/string-descriptor.js +0 -12
  166. package/dist/utility/string-descriptor.js.map +0 -1
  167. package/dist/utility/string-proxy.d.ts +0 -7
  168. package/dist/utility/string-proxy.d.ts.map +0 -1
  169. package/dist/utility/string-proxy.js +0 -63
  170. package/dist/utility/string-proxy.js.map +0 -1
  171. package/dist/utility/transformer-descriptor.d.ts +0 -6
  172. package/dist/utility/transformer-descriptor.d.ts.map +0 -1
  173. package/dist/utility/transformer-descriptor.js +0 -24
  174. package/dist/utility/transformer-descriptor.js.map +0 -1
  175. package/dist/utility/transformer-proxy.d.ts +0 -10
  176. package/dist/utility/transformer-proxy.d.ts.map +0 -1
  177. package/dist/utility/transformer-proxy.js +0 -111
  178. package/dist/utility/transformer-proxy.js.map +0 -1
  179. package/dist/version.d.ts +0 -5
  180. package/dist/version.d.ts.map +0 -1
  181. package/dist/version.js +0 -5
  182. package/dist/version.js.map +0 -1
@@ -0,0 +1,473 @@
1
+ import { MemoryTransport, Promisable, AppDataStorage, HTTPFetch, Hyperlink, Nullishable } from '@aidc-toolkit/core';
2
+ import { StringValidation, StringValidator, CharacterSetValidator, Exclusion, CharacterSetCreator } from '@aidc-toolkit/utility';
3
+ import { Logger } from 'tslog';
4
+
5
+ /**
6
+ * Application extension options. Never instantiated; used only as extension point for custom application extension
7
+ * options to define types.
8
+ */
9
+ interface AppExtensionOptions {
10
+ /**
11
+ * If true, errors are reported through the throw/catch mechanism.
12
+ */
13
+ ThrowError: boolean;
14
+ /**
15
+ * Application error.
16
+ */
17
+ ApplicationError: object;
18
+ /**
19
+ * Invocation context.
20
+ */
21
+ InvocationContext: unknown;
22
+ /**
23
+ * Streaming context.
24
+ */
25
+ StreamingContext: unknown;
26
+ /**
27
+ * Big integer representation.
28
+ */
29
+ BigInteger: number | bigint;
30
+ }
31
+ /**
32
+ * Custom application extension options.
33
+ */
34
+ interface CustomAppExtensionOptions extends AppExtensionOptions {
35
+ }
36
+ /**
37
+ * If true, errors are reported through the throw/catch mechanism.
38
+ */
39
+ type ThrowError = CustomAppExtensionOptions["ThrowError"];
40
+ /**
41
+ * Application error type.
42
+ */
43
+ type ApplicationError = CustomAppExtensionOptions["ApplicationError"];
44
+ /**
45
+ * Invocation context type.
46
+ */
47
+ type InvocationContext = CustomAppExtensionOptions["InvocationContext"];
48
+ /**
49
+ * Streaming context type.
50
+ */
51
+ type StreamingContext = CustomAppExtensionOptions["StreamingContext"];
52
+ /**
53
+ * Big integer representation type.
54
+ */
55
+ type BigInteger = CustomAppExtensionOptions["BigInteger"];
56
+
57
+ /**
58
+ * Sheet.
59
+ */
60
+ interface Sheet {
61
+ /**
62
+ * Sheet name.
63
+ */
64
+ readonly name: string;
65
+ }
66
+ /**
67
+ * Single cell address.
68
+ */
69
+ interface Address {
70
+ /**
71
+ * Zero-indexed row.
72
+ */
73
+ readonly rowIndex: number;
74
+ /**
75
+ * Zero-indexed column.
76
+ */
77
+ readonly columnIndex: number;
78
+ }
79
+ /**
80
+ * Sheet address.
81
+ */
82
+ interface SheetAddress extends Sheet, Address {
83
+ }
84
+ /**
85
+ * Range of cells.
86
+ */
87
+ interface Range {
88
+ /**
89
+ * Start address, inclusive.
90
+ */
91
+ readonly startAddress: Address;
92
+ /**
93
+ * End address, exclusive.
94
+ */
95
+ readonly endAddress: Address;
96
+ }
97
+ /**
98
+ * Sheet range.
99
+ */
100
+ interface SheetRange extends Sheet, Range {
101
+ }
102
+ /**
103
+ * Matrix type; shorthand for defining a two-dimensional matrix (array of array) of a type.
104
+ *
105
+ * @template T
106
+ * Type.
107
+ */
108
+ type Matrix<T> = T[][];
109
+ /**
110
+ * Function singleton return, possibly including an error return. If the application extension reports errors through
111
+ * the return value, the result is the union of the return type and the error type; otherwise, it's just the return
112
+ * type.
113
+ *
114
+ * @template TResult
115
+ * Result type.
116
+ */
117
+ type SingletonResult<TResult> = ThrowError extends true ? TResult : TResult | ApplicationError;
118
+ /**
119
+ * Function matrix return, possibly including an error return in each element. If the application extension reports
120
+ * errors through the return value, the individual element result is the union of the return type and the error type;
121
+ * otherwise, it's just the return type.
122
+ *
123
+ * @template TResult
124
+ * Result type.
125
+ */
126
+ type MatrixResult<TResult> = Matrix<SingletonResult<TResult>>;
127
+
128
+ /**
129
+ * Streaming consumer callback, returned by application extension implementation.
130
+ */
131
+ type StreamingConsumerCallback<TResult> = (result: MatrixResult<TResult>) => void;
132
+ /**
133
+ * Streaming cancelled callback, passed to application extension implementation.
134
+ */
135
+ type StreamingCancelledCallback = () => void;
136
+
137
+ /**
138
+ * Library proxy.
139
+ */
140
+ declare abstract class LibProxy {
141
+ #private;
142
+ /**
143
+ * Constructor.
144
+ *
145
+ * @param appExtension
146
+ * Application extension.
147
+ */
148
+ constructor(appExtension: AppExtension);
149
+ /**
150
+ * Get the application extension.
151
+ */
152
+ get appExtension(): AppExtension;
153
+ /**
154
+ * Map big integer to another type if necessary.
155
+ *
156
+ * @param value
157
+ * Big integer value to map.
158
+ *
159
+ * @returns
160
+ * Mapped big integer value.
161
+ */
162
+ mapBigInt(value: bigint): SingletonResult<BigInteger>;
163
+ /**
164
+ * Call a singleton result function with error handling.
165
+ *
166
+ * @param callback
167
+ * Callback.
168
+ *
169
+ * @returns
170
+ * Callback return or error if errors are not thrown.
171
+ */
172
+ singletonResult<TResult>(callback: () => SingletonResult<TResult>): SingletonResult<TResult>;
173
+ /**
174
+ * Call a matrix result function with error handling.
175
+ *
176
+ * @param matrixValues
177
+ * Matrix of values.
178
+ *
179
+ * @param valueCallback
180
+ * Callback to process value.
181
+ *
182
+ * @returns
183
+ * Matrix of callback results and errors if errors are not thrown.
184
+ */
185
+ protected matrixResult<TValue, TResult>(matrixValues: Matrix<TValue>, valueCallback: (value: TValue) => SingletonResult<TResult>): MatrixResult<TResult>;
186
+ /**
187
+ * Map a matrix of validate string results to boolean. If the string is empty, the result is true, indicating that
188
+ * there is no error.
189
+ *
190
+ * @param matrixValidateResults
191
+ * Matrix of results from a call to a validate function.
192
+ *
193
+ * @returns
194
+ * Matrix of boolean values, true if corresponding string is empty.
195
+ */
196
+ protected isValidString(matrixValidateResults: MatrixResult<string>): Matrix<boolean>;
197
+ /**
198
+ * Set up a mapping and call a matrix result function with error handling.
199
+ *
200
+ * @param setUpCallback
201
+ * Callback to set up the mapping.
202
+ *
203
+ * @param matrixValues
204
+ * Matrix of values.
205
+ *
206
+ * @param valueCallback
207
+ * Callback to process value.
208
+ *
209
+ * @returns
210
+ * Matrix of callback results and errors if errors are not thrown.
211
+ */
212
+ protected setUpMatrixResult<TSetup, TValue, TResult>(setUpCallback: () => TSetup, matrixValues: Matrix<TValue>, valueCallback: (setup: TSetup, value: TValue) => SingletonResult<TResult>): MatrixResult<TResult>;
213
+ /**
214
+ * Call an array result function with error handling and map to a matrix.
215
+ *
216
+ * @param matrixValues
217
+ * Matrix of values.
218
+ *
219
+ * @param callback
220
+ * Callback.
221
+ *
222
+ * @returns
223
+ * Matrix of callback results and errors if errors are not thrown.
224
+ */
225
+ protected arrayResult<TValue, TResult>(matrixValues: Matrix<TValue>, callback: (value: TValue) => Array<SingletonResult<TResult>>): MatrixResult<TResult>;
226
+ /**
227
+ * Call a matrix result function with error handling and map a non-error result to an empty string and {@linkcode
228
+ * RangeError} to the string error message.
229
+ *
230
+ * @param matrixValues
231
+ * Matrix of values.
232
+ *
233
+ * @param callback
234
+ * Callback that either returns or throws an exception.
235
+ *
236
+ * @returns
237
+ * Matrix of strings.
238
+ */
239
+ protected matrixErrorResult<TValue>(matrixValues: Matrix<TValue>, callback: (value: TValue) => void): Matrix<string>;
240
+ /**
241
+ * Call an iterable result function with error handling and map to a matrix. Although the natural approach would be
242
+ * to map to a single-element array containing an array of *N* results (i.e., [[r0, r1, r2, ..., r*N*]]), this is
243
+ * rendered visually as a single row. The more readable approach is as a single column, so the mapping is to an
244
+ * *N*-element array of single-element result arrays (i.e., [[r0], [r1], [r2], ..., [r*N*]]).
245
+ *
246
+ * @param iterableCallback
247
+ * Iterable callback.
248
+ *
249
+ * @returns
250
+ * Matrix of callback results.
251
+ */
252
+ protected iterableResult<TResult>(iterableCallback: () => Iterable<SingletonResult<TResult>>): MatrixResult<TResult>;
253
+ }
254
+
255
+ /**
256
+ * Application extension.
257
+ */
258
+ declare abstract class AppExtension {
259
+ #private;
260
+ /**
261
+ * Application name.
262
+ */
263
+ static readonly APPLICATION_NAME = "AIDCToolkit";
264
+ /**
265
+ * Version property name.
266
+ */
267
+ static readonly VERSION_NAME: string;
268
+ /**
269
+ * Constructor.
270
+ *
271
+ * @param version
272
+ * Application version.
273
+ *
274
+ * @param maximumSequenceCount
275
+ * Maximum sequence count supported by application.
276
+ *
277
+ * @param throwError
278
+ * If true, errors are reported through the throw/catch mechanism.
279
+ */
280
+ protected constructor(version: string, maximumSequenceCount: number, throwError: ThrowError);
281
+ /**
282
+ * Initialize the application extension.
283
+ */
284
+ initialize(): Promise<void>;
285
+ /**
286
+ * Get the version.
287
+ *
288
+ * @returns
289
+ * Version.
290
+ */
291
+ get version(): string;
292
+ /**
293
+ * Determine if errors are reported through the throw/catch mechanism.
294
+ */
295
+ get throwError(): ThrowError;
296
+ /**
297
+ * Get the logger.
298
+ */
299
+ get logger(): Logger<object>;
300
+ /**
301
+ * Get the logger memory transport.
302
+ */
303
+ get memoryTransport(): MemoryTransport<object>;
304
+ /**
305
+ * Get the maximum width supported by the application.
306
+ */
307
+ abstract get maximumWidth(): number;
308
+ /**
309
+ * Get the maximum height supported by the application.
310
+ */
311
+ abstract get maximumHeight(): number;
312
+ /**
313
+ * Get a proxy instance. The use of a weak map ensures that proxies are loaded only as needed and may be garbage
314
+ * collected if required.
315
+ *
316
+ * @param ProxyConstructor
317
+ * Proxy constructor.
318
+ *
319
+ * @returns
320
+ * Proxy instance.
321
+ */
322
+ getProxy<T extends LibProxy>(ProxyConstructor: new (appExtension: AppExtension) => T): T;
323
+ /**
324
+ * Get the sheet address from an invocation context.
325
+ *
326
+ * @param invocationContext
327
+ * Invocation context.
328
+ *
329
+ * @returns
330
+ * Sheet address.
331
+ */
332
+ abstract getSheetAddress(invocationContext: InvocationContext): Promisable<SheetAddress>;
333
+ /**
334
+ * Get a parameter range from an invocation context.
335
+ *
336
+ * @param invocationContext
337
+ * Invocation context.
338
+ *
339
+ * @param parameterNumber
340
+ * Parameter number.
341
+ *
342
+ * @returns
343
+ * Sheet range or null if parameter is not a range.
344
+ */
345
+ abstract getParameterSheetRange(invocationContext: InvocationContext, parameterNumber: number): Promisable<SheetRange | null>;
346
+ /**
347
+ * Install a streaming function.
348
+ *
349
+ * @param streamingContext
350
+ * Streaming context.
351
+ *
352
+ * @param streamingCancelledCallback
353
+ * Streaming cancelled callback, called when streaming is cancelled.
354
+ *
355
+ * @returns
356
+ * Streaming consumer callback, called when stream contents updated.
357
+ */
358
+ abstract installStreaming<TResult>(streamingContext: StreamingContext, streamingCancelledCallback: StreamingCancelledCallback): StreamingConsumerCallback<TResult>;
359
+ /**
360
+ * Get a property stored within the active document.
361
+ *
362
+ * @param name
363
+ * Property name.
364
+ *
365
+ * @returns
366
+ * Property value or undefined if no value is stored under the given name.
367
+ */
368
+ abstract getDocumentProperty(name: string): Promisable<string | undefined>;
369
+ /**
370
+ * Set a property to be stored within the active document.
371
+ *
372
+ * @param name
373
+ * Property name.
374
+ *
375
+ * @param value
376
+ * Property value.
377
+ */
378
+ abstract setDocumentProperty(name: string, value: string): Promisable<void>;
379
+ /**
380
+ * Delete a property from the active document.
381
+ *
382
+ * @param name
383
+ * Property name.
384
+ */
385
+ abstract deleteDocumentProperty(name: string): Promisable<void>;
386
+ /**
387
+ * Get application data storage for the current document.
388
+ */
389
+ abstract get documentAppDataStorage(): AppDataStorage<boolean>;
390
+ /**
391
+ * Get application data storage shared across multiple documents.
392
+ */
393
+ abstract get sharedAppDataStorage(): AppDataStorage<boolean>;
394
+ /**
395
+ * Get HTTP fetch function.
396
+ */
397
+ abstract get httpFetch(): HTTPFetch;
398
+ /**
399
+ * Validate a sequence count against the maximum supported by application.
400
+ *
401
+ * @param sequenceCount
402
+ * Sequence count.
403
+ */
404
+ validateSequenceCount(sequenceCount: number): void;
405
+ /**
406
+ * Map a big integer to its representation type.
407
+ *
408
+ * @param value
409
+ * Big integer value to map.
410
+ *
411
+ * @returns
412
+ * Mapped big integer value.
413
+ */
414
+ abstract mapBigInt(value: bigint): SingletonResult<BigInteger>;
415
+ /**
416
+ * Map hyperlink results to a form suitable for the application.
417
+ *
418
+ * @param matrixHyperlinkResults
419
+ * Matrix of hyperlink results from function call.
420
+ *
421
+ * @returns
422
+ * Matrix of results in a form suitable for the application.
423
+ */
424
+ abstract mapHyperlinkResults(matrixHyperlinkResults: MatrixResult<Hyperlink>): Promisable<MatrixResult<unknown>>;
425
+ /**
426
+ * Map a range error (thrown by the library) to an application-specific error. If errors are reported through the
427
+ * throw/catch mechanism, the implementation may return the range error unmodified if that is supported.
428
+ *
429
+ * @param rangeError
430
+ * Range error.
431
+ */
432
+ abstract mapRangeError(rangeError: RangeError): ApplicationError;
433
+ /**
434
+ * Handle an error with a message; called when an exception occurs outside the control of the AIDC Toolkit library.
435
+ * Implementation must not return, most likely by throwing the message wrapped in an error type.
436
+ *
437
+ * @param message
438
+ * Message to include in the error.
439
+ */
440
+ abstract handleError(message: string): never;
441
+ }
442
+
443
+ declare abstract class StringProxy extends LibProxy {
444
+ protected validateString<TStringValidation extends StringValidation>(validator: StringValidator<TStringValidation>, matrixSs: Matrix<string>, validation?: TStringValidation): Matrix<string>;
445
+ }
446
+
447
+ declare abstract class CharacterSetValidatorProxy extends StringProxy {
448
+ #private;
449
+ constructor(appExtension: AppExtension, characterSetValidator: CharacterSetValidator);
450
+ validate(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>): Matrix<string>;
451
+ isValid(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>): Matrix<boolean>;
452
+ }
453
+ declare abstract class CharacterSetCreatorProxy extends CharacterSetValidatorProxy {
454
+ #private;
455
+ constructor(appExtension: AppExtension, characterSetCreator: CharacterSetCreator);
456
+ create(length: number, matrixValues: Matrix<number | bigint>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string>;
457
+ createSequence(length: number, startValue: number, count: number, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string>;
458
+ valueFor(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger>;
459
+ }
460
+ declare class NumericProxy extends CharacterSetCreatorProxy {
461
+ constructor(appExtension: AppExtension);
462
+ }
463
+ declare class HexadecimalProxy extends CharacterSetCreatorProxy {
464
+ constructor(appExtension: AppExtension);
465
+ }
466
+ declare class AlphabeticProxy extends CharacterSetCreatorProxy {
467
+ constructor(appExtension: AppExtension);
468
+ }
469
+ declare class AlphanumericProxy extends CharacterSetCreatorProxy {
470
+ constructor(appExtension: AppExtension);
471
+ }
472
+
473
+ export { type Address as A, type BigInteger as B, CharacterSetCreatorProxy as C, HexadecimalProxy as H, type InvocationContext as I, LibProxy as L, type Matrix as M, NumericProxy as N, type Range as R, type StreamingContext as S, type ThrowError as T, type MatrixResult as a, StringProxy as b, AlphabeticProxy as c, AlphanumericProxy as d, AppExtension as e, type AppExtensionOptions as f, type ApplicationError as g, CharacterSetValidatorProxy as h, type CustomAppExtensionOptions as i, type Sheet as j, type SheetAddress as k, type SheetRange as l, type SingletonResult as m, type StreamingCancelledCallback as n, type StreamingConsumerCallback as o };
@@ -0,0 +1 @@
1
+ import{A as Je,a as Ai,b as c,c as s,d as r,e as Ne,f as Xe,g as At,h as ze,k as R,m as d,n as a,o as n,p as Se,q as i,r as Re,s as kt,t as Ct,v as wt,x as Ye,y as B,z as Ot}from"./chunk-WLXID4YR.js";var Bs={};Ai(Bs,{AI39Proxy:()=>H,AI64Proxy:()=>$,AI82Proxy:()=>_,CPIDCreatorProxy:()=>Te,CPIDValidatorProxy:()=>ce,CheckProxy:()=>x,GCNCreatorProxy:()=>Me,GCNValidatorProxy:()=>ae,GCPLengthProxy:()=>v,GDTICreatorProxy:()=>ge,GDTIValidatorProxy:()=>se,GIAICreatorProxy:()=>fe,GIAIValidatorProxy:()=>re,GINCCreatorProxy:()=>he,GINCValidatorProxy:()=>ne,GLNCreatorProxy:()=>le,GLNValidatorProxy:()=>V,GMNCreatorProxy:()=>be,GMNValidatorProxy:()=>oe,GRAICreatorProxy:()=>de,GRAIValidatorProxy:()=>te,GSINCreatorProxy:()=>De,GSINValidatorProxy:()=>pe,GSRNCreatorProxy:()=>xe,GSRNValidatorProxy:()=>ie,GTIN12ValidatorProxy:()=>Z,GTIN13ValidatorProxy:()=>Q,GTIN8ValidatorProxy:()=>P,GTINCreatorProxy:()=>F,GTINValidatorStaticProxy:()=>f,PrefixManagerProxy:()=>L,SSCCCreatorProxy:()=>ue,SSCCValidatorProxy:()=>ee,VariableMeasureProxy:()=>C,VerifiedByGS1Proxy:()=>G});import{AI39_CREATOR as ki,AI64_VALIDATOR as Ci,AI82_CREATOR as wi}from"@aidc-toolkit/gs1";var qt,Ke,Oi;qt=[i.describeClass(!1,{namespace:"GS1",methodInfix:"AI82",replacementParameterDescriptors:[{name:Se(Ye).name,replacement:B}]})];var _=class extends(Oi=Je){constructor(t){super(t,wi)}};Ke=c(Oi),_=r(Ke,0,"AI82Proxy",qt,_),s(Ke,1,_);var zt,Qe,qi;zt=[i.describeClass(!1,{namespace:"GS1",methodInfix:"AI39",replacementParameterDescriptors:[{name:Se(Ye).name,replacement:B}]})];var H=class extends(qi=Je){constructor(t){super(t,ki)}};Qe=c(qi),H=r(Qe,0,"AI39Proxy",zt,H),s(Qe,1,H);var Lt,Ze,zi;Lt=[i.describeClass(!1,{namespace:"GS1",methodInfix:"AI64"})];var $=class extends(zi=Ot){constructor(t){super(t,Ci)}};Ze=c(zi),$=r(Ze,0,"AI64Proxy",Lt,$),s(Ze,1,$);import{checkCharacterPair as Li,checkDigit as Ui,hasValidCheckCharacterPair as ji,hasValidCheckDigit as Fi,isValidPriceOrWeightCheckDigit as Gi,priceOrWeightCheckDigit as Wi}from"@aidc-toolkit/gs1";var Xt={name:"checkS",type:a.String,multiplicity:n.Matrix,isRequired:!0},Le={extendsDescriptor:Xt,name:"numericS"},Ut={extendsDescriptor:Le,sortOrder:0,name:"numericSFourOrFiveDigits"},Bi={extendsDescriptor:Le,sortOrder:1,name:"numericSWithCheckDigit"},_i={extendsDescriptor:Le,sortOrder:2,name:"checkDigit",multiplicity:n.Singleton},Yt={extendsDescriptor:Xt,name:"ai82S"},Hi={extendsDescriptor:Yt,name:"ai82SWithCheckCharacterPair"},jt,Ft,Gt,Wt,Bt,_t,Ht,$t,N;$t=[i.describeClass(!1,{namespace:"GS1",category:"checkCharacter"})];var x=class extends(Ht=d,_t=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Le]})],Bt=[i.describeMethod({type:a.Boolean,multiplicity:n.Matrix,parameterDescriptors:[Bi]})],Wt=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Ut]})],Gt=[i.describeMethod({type:a.Boolean,multiplicity:n.Singleton,parameterDescriptors:[{...Ut,multiplicity:n.Singleton},_i]})],Ft=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Yt]})],jt=[i.describeMethod({type:a.Boolean,multiplicity:n.Matrix,parameterDescriptors:[Hi]})],Ht){constructor(){super(...arguments);s(N,5,this)}checkDigit(e){return this.matrixResult(e,p=>Ui(p))}hasValidCheckDigit(e){return this.matrixResult(e,p=>Fi(p))}priceOrWeightCheckDigit(e){return this.matrixResult(e,p=>Wi(p))}isValidPriceOrWeightCheckDigit(e,p){return this.singletonResult(()=>Gi(e,p))}checkCharacterPair(e){return this.matrixResult(e,p=>Li(p))}hasValidCheckCharacterPair(e){return this.matrixResult(e,p=>ji(p))}};N=c(Ht),r(N,1,"checkDigit",_t,x),r(N,1,"hasValidCheckDigit",Bt,x),r(N,1,"priceOrWeightCheckDigit",Wt,x),r(N,1,"isValidPriceOrWeightCheckDigit",Gt,x),r(N,1,"checkCharacterPair",Ft,x),r(N,1,"hasValidCheckCharacterPair",jt,x),x=r(N,0,"CheckProxy",$t,x),s(N,1,x);import{GTINLengths as rt,GTINValidator as K,IdentifierValidators as it}from"@aidc-toolkit/gs1";var Ue={name:"indicatorDigit",type:a.String,multiplicity:n.Singleton,isRequired:!0};var je={name:"identifierType",type:a.String,multiplicity:n.Singleton,isRequired:!0},u={name:"identifier",type:a.String,multiplicity:n.Matrix,isRequired:!0};var Fe={extendsDescriptor:u,sortOrder:0,name:"validateIdentifier"},$i={extendsDescriptor:u,sortOrder:1,name:"splitIdentifier",multiplicity:n.Array},Jt,Pe,Xi;Jt=[i.describeClass(!0,{namespace:"GS1",category:"identifierValidation"})];var q=class extends(Xi=wt){#e;constructor(t,e){super(t),this.#e=e}get validator(){return this.#e}};Pe=c(Xi),q=r(Pe,0,"IdentifierValidatorProxy",Jt,q),s(Pe,1,q);var Kt,Qt,Zt,Pt,X;Pt=[i.describeClass(!0)];var E=class extends(Zt=q,Qt=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Fe]})],Kt=[i.describeMethod({type:a.Boolean,multiplicity:n.Matrix,parameterDescriptors:[Fe]})],Zt){constructor(){super(...arguments);s(X,5,this)}validate(e){return this.validateString(this.validator,e)}isValid(e){return this.isValidString(this.validate(e))}};X=c(Zt),r(X,1,"validate",Qt,E),r(X,1,"isValid",Kt,E),E=r(X,0,"NumericIdentifierValidatorProxy",Pt,E),s(X,1,E);var J=class extends E{},Ge=class extends E{},z=class extends Ge{},Vt,er,tr,Ee;tr=[i.describeClass(!0)];var S=class extends(er=Ge,Vt=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[$i]})],er){constructor(){super(...arguments);s(Ee,5,this)}split(e){return this.arrayResult(e,p=>{let m=this.validator.split(p);return[m.baseIdentifier,m.serialComponent]})}};Ee=c(er),r(Ee,1,"split",Vt,S),S=r(Ee,0,"SerializableNumericIdentifierValidatorProxy",tr,S),s(Ee,1,S);var rr,ir,sr,nr,Y;nr=[i.describeClass(!0)];var g=class extends(sr=q,ir=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Fe,B]})],rr=[i.describeMethod({type:a.Boolean,multiplicity:n.Matrix,parameterDescriptors:[Fe,B]})],sr){constructor(){super(...arguments);s(Y,5,this)}validate(e,p){return this.validateString(this.validator,e,{exclusion:p??void 0})}isValid(e,p){return this.isValidString(this.validate(e,p))}};Y=c(sr),r(Y,1,"validate",ir,g),r(Y,1,"isValid",rr,g),g=r(Y,0,"NonNumericIdentifierValidatorProxy",nr,g),s(Y,1,g);var or,Ve,Zi;or=[i.describeClass(!1,{methodInfix:"GTIN13"})];var Q=class extends(Zi=J){constructor(t){super(t,it.GTIN[rt.GTIN13])}};Ve=c(Zi),Q=r(Ve,0,"GTIN13ValidatorProxy",or,Q),s(Ve,1,Q);var mr,et,Pi;mr=[i.describeClass(!1,{methodInfix:"GTIN12"})];var Z=class extends(Pi=J){constructor(t){super(t,it.GTIN[rt.GTIN12])}};et=c(Pi),Z=r(et,0,"GTIN12ValidatorProxy",mr,Z),s(et,1,Z);var lr,tt,Vi;lr=[i.describeClass(!1,{methodInfix:"GTIN8"})];var P=class extends(Vi=J){constructor(t){super(t,it.GTIN[rt.GTIN8])}};tt=c(Vi),P=r(tt,0,"GTIN8ValidatorProxy",lr,P),s(tt,1,P);var Yi={extendsDescriptor:u,name:"zeroSuppressibleGTIN12"},Ji={extendsDescriptor:u,name:"zeroSuppressedGTIN12"},Ki={extendsDescriptor:u,name:"convertGTIN"},Qi={extendsDescriptor:u,name:"normalizeGTIN"},pr={extendsDescriptor:u,name:"validateGTIN"},ar={name:"gtinLevel",type:a.Number,multiplicity:n.Singleton,isRequired:!1},cr={extendsDescriptor:u,name:"validateGTIN14"},ur,dr,fr,xr,gr,hr,Dr,Mr,Tr,br,h;br=[i.describeClass(!1,{namespace:"GS1",category:"identifierValidation"})];var f=class extends(Tr=d,Mr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Yi]})],Dr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Ji]})],hr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Ue,Ki]})],gr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[Qi]})],xr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[pr,ar]})],fr=[i.describeMethod({type:a.Boolean,multiplicity:n.Matrix,parameterDescriptors:[pr,ar]})],dr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[cr]})],ur=[i.describeMethod({type:a.Boolean,multiplicity:n.Matrix,parameterDescriptors:[cr]})],Tr){constructor(){super(...arguments);s(h,5,this)}zeroSuppressGTIN12(e){return this.matrixResult(e,p=>K.zeroSuppress(p))}zeroExpandGTIN12(e){return this.matrixResult(e,p=>K.zeroExpand(p))}convertToGTIN14(e,p){return this.matrixResult(p,m=>K.convertToGTIN14(e,m))}normalizeGTIN(e){return this.matrixResult(e,p=>K.normalize(p))}validateGTIN(e,p){let m=p??void 0;return this.matrixErrorResult(e,l=>{K.validateAny(l,m)})}isValidGTIN(e,p){return this.isValidString(this.validateGTIN(e,p))}validateGTIN14(e){return this.matrixErrorResult(e,p=>{K.validateGTIN14(p)})}isValidGTIN14(e){return this.isValidString(this.validateGTIN14(e))}};h=c(Tr),r(h,1,"zeroSuppressGTIN12",Mr,f),r(h,1,"zeroExpandGTIN12",Dr,f),r(h,1,"convertToGTIN14",hr,f),r(h,1,"normalizeGTIN",gr,f),r(h,1,"validateGTIN",xr,f),r(h,1,"isValidGTIN",fr,f),r(h,1,"validateGTIN14",dr,f),r(h,1,"isValidGTIN14",ur,f),f=r(h,0,"GTINValidatorStaticProxy",br,f),s(h,1,f);import{IdentifierValidators as M}from"@aidc-toolkit/gs1";var yr,st,es;yr=[i.describeClass(!1,{methodInfix:"GLN"})];var V=class extends(es=z){constructor(t){super(t,M.GLN)}};st=c(es),V=r(st,0,"GLNValidatorProxy",yr,V),s(st,1,V);var Ir,nt,ts;Ir=[i.describeClass(!1,{methodInfix:"SSCC"})];var ee=class extends(ts=z){constructor(t){super(t,M.SSCC)}};nt=c(ts),ee=r(nt,0,"SSCCValidatorProxy",Ir,ee),s(nt,1,ee);var Nr,pt,rs;Nr=[i.describeClass(!1,{methodInfix:"GRAI"})];var te=class extends(rs=S){constructor(t){super(t,M.GRAI)}};pt=c(rs),te=r(pt,0,"GRAIValidatorProxy",Nr,te),s(pt,1,te);var Sr,at,is;Sr=[i.describeClass(!1,{methodInfix:"GIAI"})];var re=class extends(is=g){constructor(t){super(t,M.GIAI)}};at=c(is),re=r(at,0,"GIAIValidatorProxy",Sr,re),s(at,1,re);var Rr,ct,ss;Rr=[i.describeClass(!1,{methodInfix:"GSRN"})];var ie=class extends(ss=z){constructor(t){super(t,M.GSRN)}};ct=c(ss),ie=r(ct,0,"GSRNValidatorProxy",Rr,ie),s(ct,1,ie);var Er,ot,ns;Er=[i.describeClass(!1,{methodInfix:"GDTI"})];var se=class extends(ns=S){constructor(t){super(t,M.GDTI)}};ot=c(ns),se=r(ot,0,"GDTIValidatorProxy",Er,se),s(ot,1,se);var vr,mt,ps;vr=[i.describeClass(!1,{methodInfix:"GINC"})];var ne=class extends(ps=g){constructor(t){super(t,M.GINC)}};mt=c(ps),ne=r(mt,0,"GINCValidatorProxy",vr,ne),s(mt,1,ne);var Ar,lt,as;Ar=[i.describeClass(!1,{methodInfix:"GSIN"})];var pe=class extends(as=z){constructor(t){super(t,M.GSIN)}};lt=c(as),pe=r(lt,0,"GSINValidatorProxy",Ar,pe),s(lt,1,pe);var kr,ut,cs;kr=[i.describeClass(!1,{methodInfix:"GCN"})];var ae=class extends(cs=S){constructor(t){super(t,M.GCN)}};ut=c(cs),ae=r(ut,0,"GCNValidatorProxy",kr,ae),s(ut,1,ae);var Cr,dt,os;Cr=[i.describeClass(!1,{methodInfix:"CPID"})];var ce=class extends(os=g){constructor(t){super(t,M.CPID)}};dt=c(os),ce=r(dt,0,"CPIDValidatorProxy",Cr,ce),s(dt,1,ce);var wr,ft,ms;wr=[i.describeClass(!1,{methodInfix:"GMN"})];var oe=class extends(ms=g){constructor(t){super(t,M.GMN)}};ft=c(ms),oe=r(ft,0,"GMNValidatorProxy",wr,oe),s(ft,1,oe);var ls={name:"prefix",type:a.String,multiplicity:n.Singleton,isRequired:!0},us={name:"prefixType",type:a.Number,multiplicity:n.Singleton,isRequired:!1},ds={name:"tweakFactor",type:a.Number,multiplicity:n.Singleton,isRequired:!1},Or,qr,zr,ve;zr=[i.describeClass(!1,{namespace:"GS1",category:"prefix"})];var L=class extends(qr=d,Or=[i.describeMethod({type:a.Any,multiplicity:n.SingletonArray,parameterDescriptors:[ls,us,ds]})],qr){constructor(){super(...arguments);s(ve,5,this)}definePrefix(e,p,m){return[[e,p,m]]}};ve=c(qr),r(ve,1,"definePrefix",Or,L),L=r(ve,0,"PrefixManagerProxy",zr,L),s(ve,1,L);import{isNullish as Ur}from"@aidc-toolkit/core";import{PrefixManager as fs,PrefixTypes as We,PrefixValidator as jr}from"@aidc-toolkit/gs1";import{Sequence as xs}from"@aidc-toolkit/utility";var Lr={name:"prefixDefinition",type:a.Any,multiplicity:n.SingletonArray,isRequired:!0},A={extendsDescriptor:Lr,name:"prefixDefinitionGS1UPC"},xt={extendsDescriptor:Lr,name:"prefixDefinitionAny"};var Gr,gt,Ms;Gr=[i.describeClass(!0,{namespace:"GS1",category:"identifierCreation"})];var k=class k extends(Ms=d){static#e=[We.GS1CompanyPrefix,We.UPCCompanyPrefix,We.GS18Prefix];#t;constructor(t,e){super(t),this.#t=e}getCreator(t){let e=t.length===1?t[0]:t.map(Oe=>{if(Oe.length!==1)throw new RangeError(R.t("IdentifierCreatorProxy.prefixDefinitionMustBeOneDimensional"));return Oe[0]});if(e.length>3)throw new RangeError(R.t("IdentifierCreatorProxy.prefixDefinitionMustHaveMaximumThreeElements"));let p=e[0];if(typeof p!="string")throw new RangeError(R.t("IdentifierCreatorProxy.prefixMustBeString"));function m(Oe,vi){let qe=e[Oe];return!Ur(qe)&&qe!==0&&qe!==""?qe:vi}let l=m(1,0);if(typeof l!="number"||l<0||l>=k.#e.length)throw new RangeError(R.t("IdentifierCreatorProxy.prefixTypeMustBeNumber",{maximumPrefixType:k.#e.length-1}));let I=k.#e[l];if(I===void 0)throw new RangeError(R.t("IdentifierCreatorProxy.invalidPrefixType"));let D=fs.get(I,p),O=m(2,null);if(Ur(O))D.resetTweakFactor();else{if(typeof O!="number")throw new RangeError(R.t("IdentifierCreatorProxy.tweakFactorMustBeNumber"));D.tweakFactor=O}return this.#t(D)}};gt=c(Ms),k=r(gt,0,"IdentifierCreatorProxy",Gr,k),s(gt,1,k);var Be=k,ke={name:"sparse",type:a.Boolean,multiplicity:n.Singleton,isRequired:!1},Wr,Br,_r,Hr,$r,U;$r=[i.describeClass(!0)];var T=class extends(Hr=Be,_r=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[A,Re,ke]})],Br=[i.describeMethod({infixBefore:"Sequence",type:a.String,multiplicity:n.Array,parameterDescriptors:[A,kt,Ct,ke]})],Wr=[i.describeMethod({type:a.String,multiplicity:n.Array,parameterDescriptors:[A]})],Hr){constructor(){super(...arguments);s(U,5,this)}create(e,p,m){let l=m??void 0;return this.setUpMatrixResult(()=>this.getCreator(e),p,(I,D)=>I.create(D,l))}createSequence(e,p,m,l){return this.iterableResult(()=>(this.appExtension.validateSequenceCount(m),this.getCreator(e).create(new xs(p,m),l??void 0)))}createAll(e){return this.iterableResult(()=>{let p=this.getCreator(e);return this.appExtension.validateSequenceCount(p.capacity),p.createAll()})}};U=c(Hr),r(U,1,"create",_r,T),r(U,1,"createSequence",Br,T),r(U,1,"createAll",Wr,T),T=r(U,0,"NumericIdentifierCreatorProxy",$r,T),s(U,1,T);var _e=class extends T{},j=class extends _e{},gs={extendsDescriptor:Re,multiplicity:n.Singleton},hs={extendsDescriptor:u,name:"baseIdentifier",multiplicity:n.Singleton},Fr={name:"serialComponent",type:a.String,multiplicity:n.Matrix,isRequired:!0},Xr,Yr,Jr,Kr,me;Kr=[i.describeClass(!0)];var b=class extends(Jr=_e,Yr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[A,gs,Fr,ke]})],Xr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[hs,Fr]})],Jr){constructor(){super(...arguments);s(me,5,this)}createSerialized(e,p,m,l){let I=l??void 0;return this.setUpMatrixResult(()=>this.getCreator(e),m,(D,O)=>D.createSerialized(p,O,I))}concatenate(e,p){return this.setUpMatrixResult(()=>this.getCreator([[e.substring(0,e.startsWith("0")?jr.UPC_COMPANY_PREFIX_MINIMUM_LENGTH+1:jr.GS1_COMPANY_PREFIX_MINIMUM_LENGTH),We.GS1CompanyPrefix]]),p,(m,l)=>m.concatenate(e,l))}};me=c(Jr),r(me,1,"createSerialized",Yr,b),r(me,1,"concatenate",Xr,b),b=r(me,0,"SerializableNumericIdentifierCreatorProxy",Kr,b),s(me,1,b);var Ds={name:"reference",type:a.String,multiplicity:n.Matrix,isRequired:!0},Qr,Zr,Pr,Ae;Pr=[i.describeClass(!0)];var y=class extends(Zr=Be,Qr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,parameterDescriptors:[A,Ds]})],Zr){constructor(){super(...arguments);s(Ae,5,this)}create(e,p){return this.setUpMatrixResult(()=>this.getCreator(e),p,(m,l)=>m.create(l))}};Ae=c(Zr),r(Ae,1,"create",Qr,y),y=r(Ae,0,"NonNumericIdentifierCreatorProxy",Pr,y),s(Ae,1,y);var Vr,ei,ti,Ce;ti=[i.describeClass(!1,{methodInfix:"GTIN",replacementParameterDescriptors:[{name:Se(A).name,replacement:xt}]})];var F=class extends(ei=T,Vr=[i.describeMethod({type:a.String,multiplicity:n.Matrix,ignoreInfix:!0,parameterDescriptors:[Ue,xt,Re,ke]})],ei){constructor(e){super(e,p=>p.gtinCreator);s(Ce,5,this)}createGTIN14(e,p,m,l){let I=l??void 0;return this.setUpMatrixResult(()=>this.getCreator(p),m,(D,O)=>D.createGTIN14(e,O,I))}};Ce=c(ei),r(Ce,1,"createGTIN14",Vr,F),F=r(Ce,0,"GTINCreatorProxy",ti,F),s(Ce,1,F);var ri,ht,Ts;ri=[i.describeClass(!1,{methodInfix:"GLN"})];var le=class extends(Ts=j){constructor(t){super(t,e=>e.glnCreator)}};ht=c(Ts),le=r(ht,0,"GLNCreatorProxy",ri,le),s(ht,1,le);var ii,Dt,bs;ii=[i.describeClass(!1,{methodInfix:"SSCC"})];var ue=class extends(bs=j){constructor(t){super(t,e=>e.ssccCreator)}};Dt=c(bs),ue=r(Dt,0,"SSCCCreatorProxy",ii,ue),s(Dt,1,ue);var si,Mt,ys;si=[i.describeClass(!1,{methodInfix:"GRAI"})];var de=class extends(ys=b){constructor(t){super(t,e=>e.graiCreator)}};Mt=c(ys),de=r(Mt,0,"GRAICreatorProxy",si,de),s(Mt,1,de);var ni,Tt,Is;ni=[i.describeClass(!1,{methodInfix:"GIAI"})];var fe=class extends(Is=y){constructor(t){super(t,e=>e.giaiCreator)}};Tt=c(Is),fe=r(Tt,0,"GIAICreatorProxy",ni,fe),s(Tt,1,fe);var pi,bt,Ns;pi=[i.describeClass(!1,{methodInfix:"GSRN"})];var xe=class extends(Ns=j){constructor(t){super(t,e=>e.gsrnCreator)}};bt=c(Ns),xe=r(bt,0,"GSRNCreatorProxy",pi,xe),s(bt,1,xe);var ai,yt,Ss;ai=[i.describeClass(!1,{methodInfix:"GDTI"})];var ge=class extends(Ss=b){constructor(t){super(t,e=>e.gdtiCreator)}};yt=c(Ss),ge=r(yt,0,"GDTICreatorProxy",ai,ge),s(yt,1,ge);var ci,It,Rs;ci=[i.describeClass(!1,{methodInfix:"GINC"})];var he=class extends(Rs=y){constructor(t){super(t,e=>e.gincCreator)}};It=c(Rs),he=r(It,0,"GINCCreatorProxy",ci,he),s(It,1,he);var oi,Nt,Es;oi=[i.describeClass(!1,{methodInfix:"GSIN"})];var De=class extends(Es=j){constructor(t){super(t,e=>e.gsinCreator)}};Nt=c(Es),De=r(Nt,0,"GSINCreatorProxy",oi,De),s(Nt,1,De);var mi,St,vs;mi=[i.describeClass(!1,{methodInfix:"GCN"})];var Me=class extends(vs=b){constructor(t){super(t,e=>e.gcnCreator)}};St=c(vs),Me=r(St,0,"GCNCreatorProxy",mi,Me),s(St,1,Me);var li,Rt,As;li=[i.describeClass(!1,{methodInfix:"CPID"})];var Te=class extends(As=y){constructor(t){super(t,e=>e.cpidCreator)}};Rt=c(As),Te=r(Rt,0,"CPIDCreatorProxy",li,Te),s(Rt,1,Te);var ui,Et,ks;ui=[i.describeClass(!1,{methodInfix:"GMN"})];var be=class extends(ks=y){constructor(t){super(t,e=>e.gmnCreator)}};Et=c(ks),be=r(Et,0,"GMNCreatorProxy",ui,be),s(Et,1,be);import{VariableMeasure as di}from"@aidc-toolkit/gs1";var fi={name:"rcnFormat",type:a.String,multiplicity:n.Singleton,isRequired:!0},Cs={name:"rcn",type:a.String,multiplicity:n.Array,isRequired:!0},ws={name:"rcnItemReference",type:a.Number,multiplicity:n.Singleton,isRequired:!0},Os={name:"rcnPriceOrWeight",type:a.Number,multiplicity:n.Matrix,isRequired:!0},xi,gi,hi,Di,ye;Di=[i.describeClass(!1,{namespace:"GS1",category:"variableMeasure"})];var C=class extends(hi=d,gi=[i.describeMethod({type:a.Number,multiplicity:n.Matrix,parameterDescriptors:[fi,Cs]})],xi=[i.describeMethod({type:a.String,multiplicity:n.Matrix,ignoreInfix:!0,parameterDescriptors:[fi,ws,Os]})],hi){constructor(){super(...arguments);s(ye,5,this)}parseVariableMeasureRCN(e,p){return this.arrayResult(p,m=>{let l=di.parseRCN(e,m);return[l.itemReference,l.priceOrWeight]})}createVariableMeasureRCN(e,p,m){return this.matrixResult(m,l=>di.createRCN(e,p,l))}};ye=c(hi),r(ye,1,"parseVariableMeasureRCN",gi,C),r(ye,1,"createVariableMeasureRCN",xi,C),C=r(ye,0,"VariableMeasureProxy",Di,C),s(ye,1,C);import{verifiedByGS1 as Ls}from"@aidc-toolkit/gs1";import{IdentifierTypes as qs}from"@aidc-toolkit/gs1";function zs(o){return o in qs}function He(o){let t=o.toUpperCase();if(!zs(t))throw new RangeError(R.t("ServiceProxy.invalidIdentifierType",{identifierType:o}));return t}var Us={extendsDescriptor:u,name:"hyperlinkIdentifier"},js={name:"hyperlinkText",type:a.String,multiplicity:n.Singleton,isRequired:!1},Fs={name:"hyperlinkDetails",type:a.String,multiplicity:n.Singleton,isRequired:!1},Mi,Ti,bi,we;bi=[i.describeClass(!1,{namespace:"GS1",category:"service"})];var G=class extends(Ti=d,Mi=[i.describeMethod({type:a.Any,multiplicity:n.Matrix,isAsync:!0,parameterDescriptors:[je,Us,js,Fs]})],Ti){constructor(){super(...arguments);s(we,5,this)}async verifiedByGS1(e,p,m,l){return this.appExtension.mapHyperlinkResults(this.setUpMatrixResult(()=>He(e),p,(I,D)=>Ls(I,D,m??void 0,l??void 0)))}};we=c(Ti),r(we,1,"verifiedByGS1",Mi,G),G=r(we,0,"VerifiedByGS1Proxy",bi,G),s(we,1,G);import{GCPLength as Gs,RemoteGCPLengthCache as yi}from"@aidc-toolkit/gs1";var Ws={extendsDescriptor:u,name:"gcpLengthIdentifier"},vt=class extends yi{#e;constructor(t){super(t.sharedAppDataStorage,yi.DEFAULT_BASE_URL,t.httpFetch),this.#e=t.logger}get nextCheckDateTime(){return super.nextCheckDateTime.then(t=>(this.#e.debug(`GS1 Company Prefix length next check date/time ${t?.toISOString()}`),t))}get cacheDateTime(){return super.cacheDateTime.then(t=>(this.#e.debug(`GS1 Company Prefix length cache date/time ${t?.toISOString()}`),t))}get cacheData(){return super.cacheData.then(t=>(this.#e.debug("GS1 Company Prefix length cache data retrieved"),t))}get sourceDateTime(){return super.sourceDateTime.then(t=>(this.#e.debug(`GS1 Company Prefix source date/time ${t.toISOString()}`),t))}get sourceData(){return super.sourceData.then(t=>(this.#e.debug("GS1 Company Prefix length source data retrieved"),t))}async update(t,e,p){return super.update(t,e,p).then(()=>{this.#e.trace(`GS1 Company Prefix length saved to shared data with next check date/time ${t.toISOString()}`)})}},Ii,Ni,Si,Ri,Ei,w,Ie,$e,W;Ei=[i.describeClass(!1,{namespace:"GS1",category:"service"})];var v=class extends(Ri=d,Si=[i.describeMethod({type:a.Number,multiplicity:n.Matrix,isAsync:!0,parameterDescriptors:[je,Ws]})],Ni=[i.describeMethod({type:a.String,multiplicity:n.Singleton,isAsync:!0,parameterDescriptors:[]})],Ii=[i.describeMethod({type:a.String,multiplicity:n.Singleton,isAsync:!0,parameterDescriptors:[]})],Ri){constructor(e){super(e);s(W,5,this);Xe(this,Ie);Xe(this,w);At(this,w,new Gs(new vt(e)))}async gcpLengthOf(e,p){return ze(this,Ie,$e).call(this).then(()=>this.setUpMatrixResult(()=>He(e),p,(m,l)=>Ne(this,w).lengthOf(m,l)))}async gcpLengthDateTime(){return ze(this,Ie,$e).call(this).then(()=>this.singletonResult(()=>Ne(this,w).dateTime.toISOString()))}async gcpLengthDisclaimer(){return ze(this,Ie,$e).call(this).then(()=>this.singletonResult(()=>Ne(this,w).disclaimer))}};W=c(Ri),w=new WeakMap,Ie=new WeakSet,$e=async function(){return Ne(this,w).load().catch(e=>{this.appExtension.logger.error("Load GS1 Company Prefix length data failed",e)})},r(W,1,"gcpLengthOf",Si,v),r(W,1,"gcpLengthDateTime",Ni,v),r(W,1,"gcpLengthDisclaimer",Ii,v),v=r(W,0,"GCPLengthProxy",Ei,v),s(W,1,v);export{_ as a,H as b,$ as c,x as d,Q as e,Z as f,P as g,f as h,V as i,ee as j,te as k,re as l,ie as m,se as n,ne as o,pe as p,ae as q,ce as r,oe as s,L as t,F as u,le as v,ue as w,de as x,fe as y,xe as z,ge as A,he as B,De as C,Me as D,Te as E,be as F,C as G,G as H,v as I,Bs as J};
@@ -0,0 +1 @@
1
+ import{b as S,c as L,d as f,f as I,h as C,k as R,m as k,n as d,o as h,q as x}from"./chunk-WLXID4YR.js";import{isNullish as b,logLevelOf as A}from"@aidc-toolkit/core";var Q={name:"spillArray",type:d.Any,multiplicity:h.Array,isRequired:!0},G={name:"spillMaximum",type:d.Number,multiplicity:h.Singleton,isRequired:!1},U={extendsDescriptor:G,sortOrder:0,name:"spillMaximumWidth"},X={extendsDescriptor:G,sortOrder:1,name:"spillMaximumHeight"},q={name:"logLevel",type:d.String,multiplicity:h.Singleton,isRequired:!1},W,T,j,z,B,F,p,D,H;F=[x.describeClass(!1,{category:"helper"})];var s=class s extends(B=k,z=[x.describeMethod({type:d.String,multiplicity:h.Singleton,parameterDescriptors:[]})],j=[x.describeMethod({type:d.Any,multiplicity:h.Matrix,isAsync:!0,requiresContext:!0,parameterDescriptors:[Q,X,U]})],T=[x.describeMethod({type:d.String,multiplicity:h.Array,isHidden:!0,isVolatile:!0,parameterDescriptors:[q]})],W=[x.describeMethod({type:d.String,multiplicity:h.Array,isHidden:!0,isStream:!0,parameterDescriptors:[q]})],B){constructor(){super(...arguments);L(p,5,this);I(this,D)}version(){return this.appExtension.version}async spill(t,l,e,o){let i,n=t.length,a=n!==0?t[0].length:0,y=this.singletonResult(()=>{if(n>1&&a>1)throw new RangeError(R.t("Proxy.matrixMustBeArray"));return!0});if(y===!0){let M=await C(this,D,H).call(this,{width:e,height:l},o),w=n===1,m=w?a:n,v=w?M.width:M.height,N=w?M.height:M.width,J=v*N;if(m>1&&m<=J){let E=Math.sqrt(m),u;if(Number.isInteger(Math.log10(m))){let r=10**Math.ceil(Math.log10(E));r>v&&(r/=10),r<=v&&m/r<=N&&(u=r)}u??=Math.max(Math.min(Math.ceil(E),v),Math.floor(m/N));let P=Math.ceil(m/u);if(i=[],w){let r=0;do{let g=r+u,c=t[0].slice(r,g);if(c.length<u){let K=c.length;c.length=u,c.fill("",K,u)}i.push(c),r=g}while(r<m)}else for(let r=0;r<u;r++){let g=[];for(let c=r;c<m;c+=u)g.push(t[c][0]);g.length<P&&(g[P-1]=""),i.push(g)}}else i=t}else i=[[y]];return i}loggerMessages(t){let l=this.appExtension,e;if(!b(t))try{e=A(t)}catch{}return e!==void 0&&(l.logger.settings.minLevel=e),l.memoryTransport.messages.map(o=>[o])}loggerStream(t,l){if(b(l))throw new Error("Streaming context not provided by application");let e=this.appExtension,o=!1,i,n=e.installStreaming(l,()=>{o&&e.memoryTransport.removeNotificationCallback(s.name),i!==void 0&&(e.logger.settings.minLevel=i)});if(e.memoryTransport.addNotificationCallback(s.name,(a,y)=>{n(this.iterableResult(()=>y))})){o=!0;let a;if(!b(t))try{a=A(t)}catch{}a!==void 0&&(i=e.logger.settings.minLevel,e.logger.settings.minLevel=a)}else n([["Only one logger stream allowable per workbook"]])}};p=S(B),D=new WeakSet,H=async function(t,l){if(b(l))throw new Error("Invocation context not provided by application");let e=t.width,o=t.height,i,n;if(b(e)||b(o)){let a=await this.appExtension.getSheetAddress(l);i=e??this.appExtension.maximumWidth-a.columnIndex,n=o??this.appExtension.maximumHeight-a.rowIndex}else i=e,n=o;return{width:i,height:n}},f(p,1,"version",z,s),f(p,1,"spill",j,s),f(p,1,"loggerMessages",T,s),f(p,1,"loggerStream",W,s),s=f(p,0,"AppHelperProxy",F,s),L(p,1,s);var O=s;export{O as a};